import{c as Ur,r as f,z as ct,G as qe,j as r,D as Y,E as Le,F as Us,Q as qs,A as Gs,d as Se,T as Dt,U as Hs,J as qr,V as Gr,W as Hr,X as Wr,Y as Jr,Z as Yr,_ as Xr,S as Kr,$ as Qr,m as oe,a0 as zt,a1 as O,a2 as ys,a3 as _s,a4 as bs,a5 as Pt,a6 as We,a7 as It,a8 as Je,a9 as Ye,aa as st,ab as Xe,ac as V,b as js,ad as Ke,O as Zt,ae as ea,af as ta,ag as sa,ah as ra,ai as aa,L as ia,e as na,aj as oa,ak as da}from"./index-CXvzG7LC.js";import{C as ca}from"./CGVContent-s34Ha3ZU.js";import{C as ze,a as Ze}from"./card-kLR-LkUf.js";import{u as la}from"./useBooking-BHgX-8QK.js";import{f as ua}from"./bookingApi-CCm_8x0I.js";import{P as Qe}from"./plane-CpYLxv2A.js";import{B as ks}from"./building-2-BepvW-s2.js";import{M as Ns}from"./message-square-Du8eBeCr.js";import{F as Ws}from"./file-text-tqdRfT19.js";import{C as Mt}from"./globe-Ba2Z2DMn.js";import"./map-pin-BN2Ozn3f.js";import"./shield-x8bwLA2Y.js";/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const et=Ur("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);var C;(function(s){s.assertEqual=i=>{};function e(i){}s.assertIs=e;function t(i){throw new Error}s.assertNever=t,s.arrayToEnum=i=>{const n={};for(const o of i)n[o]=o;return n},s.getValidEnumValues=i=>{const n=s.objectKeys(i).filter(c=>typeof i[i[c]]!="number"),o={};for(const c of n)o[c]=i[c];return s.objectValues(o)},s.objectValues=i=>s.objectKeys(i).map(function(n){return i[n]}),s.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const n=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&n.push(o);return n},s.find=(i,n)=>{for(const o of i)if(n(o))return o},s.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function a(i,n=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(n)}s.joinValues=a,s.jsonStringifyReplacer=(i,n)=>typeof n=="bigint"?n.toString():n})(C||(C={}));var Cs;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(Cs||(Cs={}));const g=C.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),de=s=>{switch(typeof s){case"undefined":return g.undefined;case"string":return g.string;case"number":return Number.isNaN(s)?g.nan:g.number;case"boolean":return g.boolean;case"function":return g.function;case"bigint":return g.bigint;case"symbol":return g.symbol;case"object":return Array.isArray(s)?g.array:s===null?g.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?g.promise:typeof Map<"u"&&s instanceof Map?g.map:typeof Set<"u"&&s instanceof Set?g.set:typeof Date<"u"&&s instanceof Date?g.date:g.object;default:return g.unknown}},l=C.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class J extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(n){return n.message},a={_errors:[]},i=n=>{for(const o of n.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)a._errors.push(t(o));else{let c=a,u=0;for(;u<o.path.length;){const m=o.path[u];u===o.path.length-1?(c[m]=c[m]||{_errors:[]},c[m]._errors.push(t(o))):c[m]=c[m]||{_errors:[]},c=c[m],u++}}};return i(this),a}static assert(e){if(!(e instanceof J))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,C.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},a=[];for(const i of this.issues)if(i.path.length>0){const n=i.path[0];t[n]=t[n]||[],t[n].push(e(i))}else a.push(e(i));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}J.create=s=>new J(s);const $t=(s,e)=>{let t;switch(s.code){case l.invalid_type:s.received===g.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case l.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,C.jsonStringifyReplacer)}`;break;case l.unrecognized_keys:t=`Unrecognized key(s) in object: ${C.joinValues(s.keys,", ")}`;break;case l.invalid_union:t="Invalid input";break;case l.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${C.joinValues(s.options)}`;break;case l.invalid_enum_value:t=`Invalid enum value. Expected ${C.joinValues(s.options)}, received '${s.received}'`;break;case l.invalid_arguments:t="Invalid function arguments";break;case l.invalid_return_type:t="Invalid function return type";break;case l.invalid_date:t="Invalid date";break;case l.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:C.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case l.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case l.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case l.custom:t="Invalid input";break;case l.invalid_intersection_types:t="Intersection results could not be merged";break;case l.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case l.not_finite:t="Number must be finite";break;default:t=e.defaultError,C.assertNever(s)}return{message:t}};let ma=$t;function fa(){return ma}const ha=s=>{const{data:e,path:t,errorMaps:a,issueData:i}=s,n=[...t,...i.path||[]],o={...i,path:n};if(i.message!==void 0)return{...i,path:n,message:i.message};let c="";const u=a.filter(m=>!!m).slice().reverse();for(const m of u)c=m(o,{data:e,defaultError:c}).message;return{...i,path:n,message:c}};function p(s,e){const t=fa(),a=ha({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===$t?void 0:$t].filter(i=>!!i)});s.common.issues.push(a)}class F{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const i of t){if(i.status==="aborted")return y;i.status==="dirty"&&e.dirty(),a.push(i.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const i of t){const n=await i.key,o=await i.value;a.push({key:n,value:o})}return F.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const i of t){const{key:n,value:o}=i;if(n.status==="aborted"||o.status==="aborted")return y;n.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(a[n.value]=o.value)}return{status:e.value,value:a}}}const y=Object.freeze({status:"aborted"}),Ve=s=>({status:"dirty",value:s}),q=s=>({status:"valid",value:s}),ws=s=>s.status==="aborted",Ss=s=>s.status==="dirty",Re=s=>s.status==="valid",rt=s=>typeof Promise<"u"&&s instanceof Promise;var x;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(x||(x={}));class me{constructor(e,t,a,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Rs=(s,e)=>{if(Re(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new J(s.common.issues);return this._error=t,this._error}}};function j(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:a,description:i}=s;if(e&&(t||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,c)=>{const{message:u}=s;return o.code==="invalid_enum_value"?{message:u??c.defaultError}:typeof c.data>"u"?{message:u??a??c.defaultError}:o.code!=="invalid_type"?{message:c.defaultError}:{message:u??t??c.defaultError}},description:i}}class N{get description(){return this._def.description}_getType(e){return de(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:de(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new F,ctx:{common:e.parent.common,data:e.data,parsedType:de(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(rt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){const a={common:{issues:[],async:(t==null?void 0:t.async)??!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:de(e)},i=this._parseSync({data:e,path:a.path,parent:a});return Rs(a,i)}"~validate"(e){var a,i;const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:de(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return Re(n)?{value:n.value}:{issues:t.common.issues}}catch(n){(i=(a=n==null?void 0:n.message)==null?void 0:a.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>Re(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:de(e)},i=this._parse({data:e,path:a.path,parent:a}),n=await(rt(i)?i:Promise.resolve(i));return Rs(a,n)}refine(e,t){const a=i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t;return this._refinement((i,n)=>{const o=e(i),c=()=>n.addIssue({code:l.custom,...a(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,t){return this._refinement((a,i)=>e(a)?!0:(i.addIssue(typeof t=="function"?t(a,i):t),!1))}_refinement(e){return new Ae({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return le.create(this,this._def)}nullable(){return Pe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return W.create(this)}promise(){return ot.create(this,this._def)}or(e){return it.create([this,e],this._def)}and(e){return nt.create(this,e,this._def)}transform(e){return new Ae({...j(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Lt({...j(this._def),innerType:this,defaultValue:t,typeName:_.ZodDefault})}brand(){return new Za({typeName:_.ZodBranded,type:this,...j(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Ft({...j(this._def),innerType:this,catchValue:t,typeName:_.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Gt.create(this,e)}readonly(){return Bt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const pa=/^c[^\s-]{8,}$/i,ga=/^[0-9a-z]+$/,xa=/^[0-9A-HJKMNP-TV-Z]{26}$/i,va=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ya=/^[a-z0-9_-]{21}$/i,_a=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ba=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ja=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ka="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Et;const Na=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ca=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,wa=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Sa=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ra=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Ta=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Js="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Aa=new RegExp(`^${Js}$`);function Ys(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Pa(s){return new RegExp(`^${Ys(s)}$`)}function Ia(s){let e=`${Js}T${Ys(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Ea(s,e){return!!((e==="v4"||!e)&&Na.test(s)||(e==="v6"||!e)&&wa.test(s))}function Oa(s,e){if(!_a.test(s))return!1;try{const[t]=s.split(".");if(!t)return!1;const a=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),i=JSON.parse(atob(a));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function Da(s,e){return!!((e==="v4"||!e)&&Ca.test(s)||(e==="v6"||!e)&&Sa.test(s))}class ce extends N{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==g.string){const n=this._getOrReturnCtx(e);return p(n,{code:l.invalid_type,expected:g.string,received:n.parsedType}),y}const a=new F;let i;for(const n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:l.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),a.dirty());else if(n.kind==="max")e.data.length>n.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:l.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),a.dirty());else if(n.kind==="length"){const o=e.data.length>n.value,c=e.data.length<n.value;(o||c)&&(i=this._getOrReturnCtx(e,i),o?p(i,{code:l.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):c&&p(i,{code:l.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),a.dirty())}else if(n.kind==="email")ja.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"email",code:l.invalid_string,message:n.message}),a.dirty());else if(n.kind==="emoji")Et||(Et=new RegExp(ka,"u")),Et.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"emoji",code:l.invalid_string,message:n.message}),a.dirty());else if(n.kind==="uuid")va.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"uuid",code:l.invalid_string,message:n.message}),a.dirty());else if(n.kind==="nanoid")ya.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"nanoid",code:l.invalid_string,message:n.message}),a.dirty());else if(n.kind==="cuid")pa.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"cuid",code:l.invalid_string,message:n.message}),a.dirty());else if(n.kind==="cuid2")ga.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"cuid2",code:l.invalid_string,message:n.message}),a.dirty());else if(n.kind==="ulid")xa.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"ulid",code:l.invalid_string,message:n.message}),a.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),p(i,{validation:"url",code:l.invalid_string,message:n.message}),a.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"regex",code:l.invalid_string,message:n.message}),a.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(i=this._getOrReturnCtx(e,i),p(i,{code:l.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),a.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(i=this._getOrReturnCtx(e,i),p(i,{code:l.invalid_string,validation:{startsWith:n.value},message:n.message}),a.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(i=this._getOrReturnCtx(e,i),p(i,{code:l.invalid_string,validation:{endsWith:n.value},message:n.message}),a.dirty()):n.kind==="datetime"?Ia(n).test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{code:l.invalid_string,validation:"datetime",message:n.message}),a.dirty()):n.kind==="date"?Aa.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{code:l.invalid_string,validation:"date",message:n.message}),a.dirty()):n.kind==="time"?Pa(n).test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{code:l.invalid_string,validation:"time",message:n.message}),a.dirty()):n.kind==="duration"?ba.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"duration",code:l.invalid_string,message:n.message}),a.dirty()):n.kind==="ip"?Ea(e.data,n.version)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"ip",code:l.invalid_string,message:n.message}),a.dirty()):n.kind==="jwt"?Oa(e.data,n.alg)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"jwt",code:l.invalid_string,message:n.message}),a.dirty()):n.kind==="cidr"?Da(e.data,n.version)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"cidr",code:l.invalid_string,message:n.message}),a.dirty()):n.kind==="base64"?Ra.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"base64",code:l.invalid_string,message:n.message}),a.dirty()):n.kind==="base64url"?Ta.test(e.data)||(i=this._getOrReturnCtx(e,i),p(i,{validation:"base64url",code:l.invalid_string,message:n.message}),a.dirty()):C.assertNever(n);return{status:a.value,value:e.data}}_regex(e,t,a){return this.refinement(i=>e.test(i),{validation:t,code:l.invalid_string,...x.errToObj(a)})}_addCheck(e){return new ce({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...x.errToObj(e)})}url(e){return this._addCheck({kind:"url",...x.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...x.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...x.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...x.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...x.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...x.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...x.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...x.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...x.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...x.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...x.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...x.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...x.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...x.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...x.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...x.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...x.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...x.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...x.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...x.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...x.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...x.errToObj(t)})}nonempty(e){return this.min(1,x.errToObj(e))}trim(){return new ce({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ce({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ce({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}ce.create=s=>new ce({checks:[],typeName:_.ZodString,coerce:(s==null?void 0:s.coerce)??!1,...j(s)});function za(s,e){const t=(s.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,i=t>a?t:a,n=Number.parseInt(s.toFixed(i).replace(".","")),o=Number.parseInt(e.toFixed(i).replace(".",""));return n%o/10**i}class Fe extends N{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==g.number){const n=this._getOrReturnCtx(e);return p(n,{code:l.invalid_type,expected:g.number,received:n.parsedType}),y}let a;const i=new F;for(const n of this._def.checks)n.kind==="int"?C.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:l.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:l.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:l.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="multipleOf"?za(e.data,n.value)!==0&&(a=this._getOrReturnCtx(e,a),p(a,{code:l.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),p(a,{code:l.not_finite,message:n.message}),i.dirty()):C.assertNever(n);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,x.toString(t))}gt(e,t){return this.setLimit("min",e,!1,x.toString(t))}lte(e,t){return this.setLimit("max",e,!0,x.toString(t))}lt(e,t){return this.setLimit("max",e,!1,x.toString(t))}setLimit(e,t,a,i){return new Fe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:x.toString(i)}]})}_addCheck(e){return new Fe({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:x.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:x.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:x.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:x.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:x.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:x.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:x.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:x.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:x.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&C.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(t===null||a.value>t)&&(t=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Fe.create=s=>new Fe({checks:[],typeName:_.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...j(s)});class Be extends N{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==g.bigint)return this._getInvalidInput(e);let a;const i=new F;for(const n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:l.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(a=this._getOrReturnCtx(e,a),p(a,{code:l.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),p(a,{code:l.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):C.assertNever(n);return{status:i.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return p(t,{code:l.invalid_type,expected:g.bigint,received:t.parsedType}),y}gte(e,t){return this.setLimit("min",e,!0,x.toString(t))}gt(e,t){return this.setLimit("min",e,!1,x.toString(t))}lte(e,t){return this.setLimit("max",e,!0,x.toString(t))}lt(e,t){return this.setLimit("max",e,!1,x.toString(t))}setLimit(e,t,a,i){return new Be({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:x.toString(i)}]})}_addCheck(e){return new Be({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:x.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:x.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:x.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:x.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:x.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Be.create=s=>new Be({checks:[],typeName:_.ZodBigInt,coerce:(s==null?void 0:s.coerce)??!1,...j(s)});class Ts extends N{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==g.boolean){const a=this._getOrReturnCtx(e);return p(a,{code:l.invalid_type,expected:g.boolean,received:a.parsedType}),y}return q(e.data)}}Ts.create=s=>new Ts({typeName:_.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...j(s)});class at extends N{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==g.date){const n=this._getOrReturnCtx(e);return p(n,{code:l.invalid_type,expected:g.date,received:n.parsedType}),y}if(Number.isNaN(e.data.getTime())){const n=this._getOrReturnCtx(e);return p(n,{code:l.invalid_date}),y}const a=new F;let i;for(const n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:l.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),a.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(i=this._getOrReturnCtx(e,i),p(i,{code:l.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),a.dirty()):C.assertNever(n);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new at({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:x.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:x.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}at.create=s=>new at({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:_.ZodDate,...j(s)});class As extends N{_parse(e){if(this._getType(e)!==g.symbol){const a=this._getOrReturnCtx(e);return p(a,{code:l.invalid_type,expected:g.symbol,received:a.parsedType}),y}return q(e.data)}}As.create=s=>new As({typeName:_.ZodSymbol,...j(s)});class Ps extends N{_parse(e){if(this._getType(e)!==g.undefined){const a=this._getOrReturnCtx(e);return p(a,{code:l.invalid_type,expected:g.undefined,received:a.parsedType}),y}return q(e.data)}}Ps.create=s=>new Ps({typeName:_.ZodUndefined,...j(s)});class Is extends N{_parse(e){if(this._getType(e)!==g.null){const a=this._getOrReturnCtx(e);return p(a,{code:l.invalid_type,expected:g.null,received:a.parsedType}),y}return q(e.data)}}Is.create=s=>new Is({typeName:_.ZodNull,...j(s)});class Es extends N{constructor(){super(...arguments),this._any=!0}_parse(e){return q(e.data)}}Es.create=s=>new Es({typeName:_.ZodAny,...j(s)});class Os extends N{constructor(){super(...arguments),this._unknown=!0}_parse(e){return q(e.data)}}Os.create=s=>new Os({typeName:_.ZodUnknown,...j(s)});class fe extends N{_parse(e){const t=this._getOrReturnCtx(e);return p(t,{code:l.invalid_type,expected:g.never,received:t.parsedType}),y}}fe.create=s=>new fe({typeName:_.ZodNever,...j(s)});class Ds extends N{_parse(e){if(this._getType(e)!==g.undefined){const a=this._getOrReturnCtx(e);return p(a,{code:l.invalid_type,expected:g.void,received:a.parsedType}),y}return q(e.data)}}Ds.create=s=>new Ds({typeName:_.ZodVoid,...j(s)});class W extends N{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),i=this._def;if(t.parsedType!==g.array)return p(t,{code:l.invalid_type,expected:g.array,received:t.parsedType}),y;if(i.exactLength!==null){const o=t.data.length>i.exactLength.value,c=t.data.length<i.exactLength.value;(o||c)&&(p(t,{code:o?l.too_big:l.too_small,minimum:c?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),a.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(p(t,{code:l.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),a.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(p(t,{code:l.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map((o,c)=>i.type._parseAsync(new me(t,o,t.path,c)))).then(o=>F.mergeArray(a,o));const n=[...t.data].map((o,c)=>i.type._parseSync(new me(t,o,t.path,c)));return F.mergeArray(a,n)}get element(){return this._def.type}min(e,t){return new W({...this._def,minLength:{value:e,message:x.toString(t)}})}max(e,t){return new W({...this._def,maxLength:{value:e,message:x.toString(t)}})}length(e,t){return new W({...this._def,exactLength:{value:e,message:x.toString(t)}})}nonempty(e){return this.min(1,e)}}W.create=(s,e)=>new W({type:s,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...j(e)});function we(s){if(s instanceof D){const e={};for(const t in s.shape){const a=s.shape[t];e[t]=le.create(we(a))}return new D({...s._def,shape:()=>e})}else return s instanceof W?new W({...s._def,type:we(s.element)}):s instanceof le?le.create(we(s.unwrap())):s instanceof Pe?Pe.create(we(s.unwrap())):s instanceof ke?ke.create(s.items.map(e=>we(e))):s}class D extends N{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=C.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==g.object){const m=this._getOrReturnCtx(e);return p(m,{code:l.invalid_type,expected:g.object,received:m.parsedType}),y}const{status:a,ctx:i}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof fe&&this._def.unknownKeys==="strip"))for(const m in i.data)o.includes(m)||c.push(m);const u=[];for(const m of o){const v=n[m],w=i.data[m];u.push({key:{status:"valid",value:m},value:v._parse(new me(i,w,i.path,m)),alwaysSet:m in i.data})}if(this._def.catchall instanceof fe){const m=this._def.unknownKeys;if(m==="passthrough")for(const v of c)u.push({key:{status:"valid",value:v},value:{status:"valid",value:i.data[v]}});else if(m==="strict")c.length>0&&(p(i,{code:l.unrecognized_keys,keys:c}),a.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const v of c){const w=i.data[v];u.push({key:{status:"valid",value:v},value:m._parse(new me(i,w,i.path,v)),alwaysSet:v in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const m=[];for(const v of u){const w=await v.key,A=await v.value;m.push({key:w,value:A,alwaysSet:v.alwaysSet})}return m}).then(m=>F.mergeObjectSync(a,m)):F.mergeObjectSync(a,u)}get shape(){return this._def.shape()}strict(e){return x.errToObj,new D({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,a)=>{var n,o;const i=((o=(n=this._def).errorMap)==null?void 0:o.call(n,t,a).message)??a.defaultError;return t.code==="unrecognized_keys"?{message:x.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new D({...this._def,unknownKeys:"strip"})}passthrough(){return new D({...this._def,unknownKeys:"passthrough"})}extend(e){return new D({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new D({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new D({...this._def,catchall:e})}pick(e){const t={};for(const a of C.objectKeys(e))e[a]&&this.shape[a]&&(t[a]=this.shape[a]);return new D({...this._def,shape:()=>t})}omit(e){const t={};for(const a of C.objectKeys(this.shape))e[a]||(t[a]=this.shape[a]);return new D({...this._def,shape:()=>t})}deepPartial(){return we(this)}partial(e){const t={};for(const a of C.objectKeys(this.shape)){const i=this.shape[a];e&&!e[a]?t[a]=i:t[a]=i.optional()}return new D({...this._def,shape:()=>t})}required(e){const t={};for(const a of C.objectKeys(this.shape))if(e&&!e[a])t[a]=this.shape[a];else{let n=this.shape[a];for(;n instanceof le;)n=n._def.innerType;t[a]=n}return new D({...this._def,shape:()=>t})}keyof(){return Xs(C.objectKeys(this.shape))}}D.create=(s,e)=>new D({shape:()=>s,unknownKeys:"strip",catchall:fe.create(),typeName:_.ZodObject,...j(e)});D.strictCreate=(s,e)=>new D({shape:()=>s,unknownKeys:"strict",catchall:fe.create(),typeName:_.ZodObject,...j(e)});D.lazycreate=(s,e)=>new D({shape:s,unknownKeys:"strip",catchall:fe.create(),typeName:_.ZodObject,...j(e)});class it extends N{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;function i(n){for(const c of n)if(c.result.status==="valid")return c.result;for(const c of n)if(c.result.status==="dirty")return t.common.issues.push(...c.ctx.common.issues),c.result;const o=n.map(c=>new J(c.ctx.common.issues));return p(t,{code:l.invalid_union,unionErrors:o}),y}if(t.common.async)return Promise.all(a.map(async n=>{const o={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(i);{let n;const o=[];for(const u of a){const m={...t,common:{...t.common,issues:[]},parent:null},v=u._parseSync({data:t.data,path:t.path,parent:m});if(v.status==="valid")return v;v.status==="dirty"&&!n&&(n={result:v,ctx:m}),m.common.issues.length&&o.push(m.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;const c=o.map(u=>new J(u));return p(t,{code:l.invalid_union,unionErrors:c}),y}}get options(){return this._def.options}}it.create=(s,e)=>new it({options:s,typeName:_.ZodUnion,...j(e)});function Vt(s,e){const t=de(s),a=de(e);if(s===e)return{valid:!0,data:s};if(t===g.object&&a===g.object){const i=C.objectKeys(e),n=C.objectKeys(s).filter(c=>i.indexOf(c)!==-1),o={...s,...e};for(const c of n){const u=Vt(s[c],e[c]);if(!u.valid)return{valid:!1};o[c]=u.data}return{valid:!0,data:o}}else if(t===g.array&&a===g.array){if(s.length!==e.length)return{valid:!1};const i=[];for(let n=0;n<s.length;n++){const o=s[n],c=e[n],u=Vt(o,c);if(!u.valid)return{valid:!1};i.push(u.data)}return{valid:!0,data:i}}else return t===g.date&&a===g.date&&+s==+e?{valid:!0,data:s}:{valid:!1}}class nt extends N{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),i=(n,o)=>{if(ws(n)||ws(o))return y;const c=Vt(n.value,o.value);return c.valid?((Ss(n)||Ss(o))&&t.dirty(),{status:t.value,value:c.data}):(p(a,{code:l.invalid_intersection_types}),y)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([n,o])=>i(n,o)):i(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}nt.create=(s,e,t)=>new nt({left:s,right:e,typeName:_.ZodIntersection,...j(t)});class ke extends N{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==g.array)return p(a,{code:l.invalid_type,expected:g.array,received:a.parsedType}),y;if(a.data.length<this._def.items.length)return p(a,{code:l.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),y;!this._def.rest&&a.data.length>this._def.items.length&&(p(a,{code:l.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...a.data].map((o,c)=>{const u=this._def.items[c]||this._def.rest;return u?u._parse(new me(a,o,a.path,c)):null}).filter(o=>!!o);return a.common.async?Promise.all(n).then(o=>F.mergeArray(t,o)):F.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new ke({...this._def,rest:e})}}ke.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ke({items:s,typeName:_.ZodTuple,rest:null,...j(e)})};class zs extends N{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==g.map)return p(a,{code:l.invalid_type,expected:g.map,received:a.parsedType}),y;const i=this._def.keyType,n=this._def.valueType,o=[...a.data.entries()].map(([c,u],m)=>({key:i._parse(new me(a,c,a.path,[m,"key"])),value:n._parse(new me(a,u,a.path,[m,"value"]))}));if(a.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const u of o){const m=await u.key,v=await u.value;if(m.status==="aborted"||v.status==="aborted")return y;(m.status==="dirty"||v.status==="dirty")&&t.dirty(),c.set(m.value,v.value)}return{status:t.value,value:c}})}else{const c=new Map;for(const u of o){const m=u.key,v=u.value;if(m.status==="aborted"||v.status==="aborted")return y;(m.status==="dirty"||v.status==="dirty")&&t.dirty(),c.set(m.value,v.value)}return{status:t.value,value:c}}}}zs.create=(s,e,t)=>new zs({valueType:e,keyType:s,typeName:_.ZodMap,...j(t)});class Ue extends N{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==g.set)return p(a,{code:l.invalid_type,expected:g.set,received:a.parsedType}),y;const i=this._def;i.minSize!==null&&a.data.size<i.minSize.value&&(p(a,{code:l.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&a.data.size>i.maxSize.value&&(p(a,{code:l.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());const n=this._def.valueType;function o(u){const m=new Set;for(const v of u){if(v.status==="aborted")return y;v.status==="dirty"&&t.dirty(),m.add(v.value)}return{status:t.value,value:m}}const c=[...a.data.values()].map((u,m)=>n._parse(new me(a,u,a.path,m)));return a.common.async?Promise.all(c).then(u=>o(u)):o(c)}min(e,t){return new Ue({...this._def,minSize:{value:e,message:x.toString(t)}})}max(e,t){return new Ue({...this._def,maxSize:{value:e,message:x.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ue.create=(s,e)=>new Ue({valueType:s,minSize:null,maxSize:null,typeName:_.ZodSet,...j(e)});class Zs extends N{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Zs.create=(s,e)=>new Zs({getter:s,typeName:_.ZodLazy,...j(e)});class Ms extends N{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return p(t,{received:t.data,code:l.invalid_literal,expected:this._def.value}),y}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ms.create=(s,e)=>new Ms({value:s,typeName:_.ZodLiteral,...j(e)});function Xs(s,e){return new Te({values:s,typeName:_.ZodEnum,...j(e)})}class Te extends N{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),a=this._def.values;return p(t,{expected:C.joinValues(a),received:t.parsedType,code:l.invalid_type}),y}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return p(t,{received:t.data,code:l.invalid_enum_value,options:a}),y}return q(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Te.create(e,{...this._def,...t})}exclude(e,t=this._def){return Te.create(this.options.filter(a=>!e.includes(a)),{...this._def,...t})}}Te.create=Xs;class $s extends N{_parse(e){const t=C.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==g.string&&a.parsedType!==g.number){const i=C.objectValues(t);return p(a,{expected:C.joinValues(i),received:a.parsedType,code:l.invalid_type}),y}if(this._cache||(this._cache=new Set(C.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=C.objectValues(t);return p(a,{received:a.data,code:l.invalid_enum_value,options:i}),y}return q(e.data)}get enum(){return this._def.values}}$s.create=(s,e)=>new $s({values:s,typeName:_.ZodNativeEnum,...j(e)});class ot extends N{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==g.promise&&t.common.async===!1)return p(t,{code:l.invalid_type,expected:g.promise,received:t.parsedType}),y;const a=t.parsedType===g.promise?t.data:Promise.resolve(t.data);return q(a.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ot.create=(s,e)=>new ot({type:s,typeName:_.ZodPromise,...j(e)});class Ae extends N{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:o=>{p(a,o),o.fatal?t.abort():t.dirty()},get path(){return a.path}};if(n.addIssue=n.addIssue.bind(n),i.type==="preprocess"){const o=i.transform(a.data,n);if(a.common.async)return Promise.resolve(o).then(async c=>{if(t.value==="aborted")return y;const u=await this._def.schema._parseAsync({data:c,path:a.path,parent:a});return u.status==="aborted"?y:u.status==="dirty"||t.value==="dirty"?Ve(u.value):u});{if(t.value==="aborted")return y;const c=this._def.schema._parseSync({data:o,path:a.path,parent:a});return c.status==="aborted"?y:c.status==="dirty"||t.value==="dirty"?Ve(c.value):c}}if(i.type==="refinement"){const o=c=>{const u=i.refinement(c,n);if(a.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(a.common.async===!1){const c=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return c.status==="aborted"?y:(c.status==="dirty"&&t.dirty(),o(c.value),{status:t.value,value:c.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(c=>c.status==="aborted"?y:(c.status==="dirty"&&t.dirty(),o(c.value).then(()=>({status:t.value,value:c.value}))))}if(i.type==="transform")if(a.common.async===!1){const o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Re(o))return y;const c=i.transform(o.value,n);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:c}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>Re(o)?Promise.resolve(i.transform(o.value,n)).then(c=>({status:t.value,value:c})):y);C.assertNever(i)}}Ae.create=(s,e,t)=>new Ae({schema:s,typeName:_.ZodEffects,effect:e,...j(t)});Ae.createWithPreprocess=(s,e,t)=>new Ae({schema:e,effect:{type:"preprocess",transform:s},typeName:_.ZodEffects,...j(t)});class le extends N{_parse(e){return this._getType(e)===g.undefined?q(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}le.create=(s,e)=>new le({innerType:s,typeName:_.ZodOptional,...j(e)});class Pe extends N{_parse(e){return this._getType(e)===g.null?q(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Pe.create=(s,e)=>new Pe({innerType:s,typeName:_.ZodNullable,...j(e)});class Lt extends N{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===g.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Lt.create=(s,e)=>new Lt({innerType:s,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...j(e)});class Ft extends N{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return rt(i)?i.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new J(a.common.issues)},input:a.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new J(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}Ft.create=(s,e)=>new Ft({innerType:s,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...j(e)});class Vs extends N{_parse(e){if(this._getType(e)!==g.nan){const a=this._getOrReturnCtx(e);return p(a,{code:l.invalid_type,expected:g.nan,received:a.parsedType}),y}return{status:"valid",value:e.data}}}Vs.create=s=>new Vs({typeName:_.ZodNaN,...j(s)});class Za extends N{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class Gt extends N{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const n=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return n.status==="aborted"?y:n.status==="dirty"?(t.dirty(),Ve(n.value)):this._def.out._parseAsync({data:n.value,path:a.path,parent:a})})();{const i=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?y:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:a.path,parent:a})}}static create(e,t){return new Gt({in:e,out:t,typeName:_.ZodPipeline})}}class Bt extends N{_parse(e){const t=this._def.innerType._parse(e),a=i=>(Re(i)&&(i.value=Object.freeze(i.value)),i);return rt(t)?t.then(i=>a(i)):a(t)}unwrap(){return this._def.innerType}}Bt.create=(s,e)=>new Bt({innerType:s,typeName:_.ZodReadonly,...j(e)});D.lazycreate;var _;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(_||(_={}));const G=ce.create;fe.create;W.create;const Ma=D.create;D.strictCreate;it.create;nt.create;ke.create;const $a=Te.create;ot.create;le.create;Pe.create;function Ks(s){const e=f.useRef({value:s,previous:s});return f.useMemo(()=>(e.current.value!==s&&(e.current.previous=e.current.value,e.current.value=s),e.current.previous),[s])}var lt="Checkbox",[Va,Ci]=ct(lt),[La,Ht]=Va(lt);function Fa(s){const{__scopeCheckbox:e,checked:t,children:a,defaultChecked:i,disabled:n,form:o,name:c,onCheckedChange:u,required:m,value:v="on",internal_do_not_use_render:w}=s,[A,S]=Gs({prop:t,defaultProp:i??!1,onChange:u,caller:lt}),[b,P]=f.useState(null),[R,z]=f.useState(null),T=f.useRef(!1),X=b?!!o||!!b.closest("form"):!0,$={checked:A,disabled:n,setChecked:S,control:b,setControl:P,name:c,form:o,value:v,hasConsumerStoppedPropagationRef:T,required:m,defaultChecked:ue(i)?!1:i,isFormControl:X,bubbleInput:R,setBubbleInput:z};return r.jsx(La,{scope:e,...$,children:Ba(w)?w($):a})}var Qs="CheckboxTrigger",er=f.forwardRef(({__scopeCheckbox:s,onKeyDown:e,onClick:t,...a},i)=>{const{control:n,value:o,disabled:c,checked:u,required:m,setControl:v,setChecked:w,hasConsumerStoppedPropagationRef:A,isFormControl:S,bubbleInput:b}=Ht(Qs,s),P=qe(i,v),R=f.useRef(u);return f.useEffect(()=>{const z=n==null?void 0:n.form;if(z){const T=()=>w(R.current);return z.addEventListener("reset",T),()=>z.removeEventListener("reset",T)}},[n,w]),r.jsx(Y.button,{type:"button",role:"checkbox","aria-checked":ue(u)?"mixed":u,"aria-required":m,"data-state":ir(u),"data-disabled":c?"":void 0,disabled:c,value:o,...a,ref:P,onKeyDown:Le(e,z=>{z.key==="Enter"&&z.preventDefault()}),onClick:Le(t,z=>{w(T=>ue(T)?!0:!T),b&&S&&(A.current=z.isPropagationStopped(),A.current||z.stopPropagation())})})});er.displayName=Qs;var Wt=f.forwardRef((s,e)=>{const{__scopeCheckbox:t,name:a,checked:i,defaultChecked:n,required:o,disabled:c,value:u,onCheckedChange:m,form:v,...w}=s;return r.jsx(Fa,{__scopeCheckbox:t,checked:i,defaultChecked:n,disabled:c,required:o,onCheckedChange:m,name:a,form:v,value:u,internal_do_not_use_render:({isFormControl:A})=>r.jsxs(r.Fragment,{children:[r.jsx(er,{...w,ref:e,__scopeCheckbox:t}),A&&r.jsx(ar,{__scopeCheckbox:t})]})})});Wt.displayName=lt;var tr="CheckboxIndicator",sr=f.forwardRef((s,e)=>{const{__scopeCheckbox:t,forceMount:a,...i}=s,n=Ht(tr,t);return r.jsx(Us,{present:a||ue(n.checked)||n.checked===!0,children:r.jsx(Y.span,{"data-state":ir(n.checked),"data-disabled":n.disabled?"":void 0,...i,ref:e,style:{pointerEvents:"none",...s.style}})})});sr.displayName=tr;var rr="CheckboxBubbleInput",ar=f.forwardRef(({__scopeCheckbox:s,...e},t)=>{const{control:a,hasConsumerStoppedPropagationRef:i,checked:n,defaultChecked:o,required:c,disabled:u,name:m,value:v,form:w,bubbleInput:A,setBubbleInput:S}=Ht(rr,s),b=qe(t,S),P=Ks(n),R=qs(a);f.useEffect(()=>{const T=A;if(!T)return;const X=window.HTMLInputElement.prototype,Ie=Object.getOwnPropertyDescriptor(X,"checked").set,H=!i.current;if(P!==n&&Ie){const Ge=new Event("click",{bubbles:H});T.indeterminate=ue(n),Ie.call(T,ue(n)?!1:n),T.dispatchEvent(Ge)}},[A,P,n,i]);const z=f.useRef(ue(n)?!1:n);return r.jsx(Y.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??z.current,required:c,disabled:u,name:m,value:v,form:w,...e,tabIndex:-1,ref:b,style:{...e.style,...R,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});ar.displayName=rr;function Ba(s){return typeof s=="function"}function ue(s){return s==="indeterminate"}function ir(s){return ue(s)?"indeterminate":s?"checked":"unchecked"}const Ut=f.forwardRef(({className:s,...e},t)=>r.jsx(Wt,{ref:t,className:Se("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),...e,children:r.jsx(sr,{className:Se("flex items-center justify-center text-current"),children:r.jsx(Dt,{className:"h-4 w-4"})})}));Ut.displayName=Wt.displayName;const nr=f.forwardRef(({className:s,...e},t)=>r.jsx("textarea",{className:Se("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),ref:t,...e}));nr.displayName="Textarea";var Jt="Progress",Yt=100,[Ua,wi]=ct(Jt),[qa,Ga]=Ua(Jt),or=f.forwardRef((s,e)=>{const{__scopeProgress:t,value:a=null,max:i,getValueLabel:n=Ha,...o}=s;(i||i===0)&&!Ls(i)&&console.error(Wa(`${i}`,"Progress"));const c=Ls(i)?i:Yt;a!==null&&!Fs(a,c)&&console.error(Ja(`${a}`,"Progress"));const u=Fs(a,c)?a:null,m=dt(u)?n(u,c):void 0;return r.jsx(qa,{scope:t,value:u,max:c,children:r.jsx(Y.div,{"aria-valuemax":c,"aria-valuemin":0,"aria-valuenow":dt(u)?u:void 0,"aria-valuetext":m,role:"progressbar","data-state":lr(u,c),"data-value":u??void 0,"data-max":c,...o,ref:e})})});or.displayName=Jt;var dr="ProgressIndicator",cr=f.forwardRef((s,e)=>{const{__scopeProgress:t,...a}=s,i=Ga(dr,t);return r.jsx(Y.div,{"data-state":lr(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...a,ref:e})});cr.displayName=dr;function Ha(s,e){return`${Math.round(s/e*100)}%`}function lr(s,e){return s==null?"indeterminate":s===e?"complete":"loading"}function dt(s){return typeof s=="number"}function Ls(s){return dt(s)&&!isNaN(s)&&s>0}function Fs(s,e){return dt(s)&&!isNaN(s)&&s<=e&&s>=0}function Wa(s,e){return`Invalid prop \`max\` of value \`${s}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Yt}\`.`}function Ja(s,e){return`Invalid prop \`value\` of value \`${s}\` supplied to \`${e}\`. The \`value\` prop must be:
  - a positive number
  - less than the value passed to \`max\` (or ${Yt} if no \`max\` prop is set)
  - \`null\` or \`undefined\` if the progress is indeterminate.

Defaulting to \`null\`.`}var ur=or,Ya=cr;const mr=f.forwardRef(({className:s,value:e,...t},a)=>r.jsx(ur,{ref:a,className:Se("relative h-4 w-full overflow-hidden rounded-full bg-secondary",s),...t,children:r.jsx(Ya,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));mr.displayName=ur.displayName;var Xt="Radio",[Xa,fr]=ct(Xt),[Ka,Qa]=Xa(Xt),hr=f.forwardRef((s,e)=>{const{__scopeRadio:t,name:a,checked:i=!1,required:n,disabled:o,value:c="on",onCheck:u,form:m,...v}=s,[w,A]=f.useState(null),S=qe(e,R=>A(R)),b=f.useRef(!1),P=w?m||!!w.closest("form"):!0;return r.jsxs(Ka,{scope:t,checked:i,disabled:o,children:[r.jsx(Y.button,{type:"button",role:"radio","aria-checked":i,"data-state":vr(i),"data-disabled":o?"":void 0,disabled:o,value:c,...v,ref:S,onClick:Le(s.onClick,R=>{i||u==null||u(),P&&(b.current=R.isPropagationStopped(),b.current||R.stopPropagation())})}),P&&r.jsx(xr,{control:w,bubbles:!b.current,name:a,value:c,checked:i,required:n,disabled:o,form:m,style:{transform:"translateX(-100%)"}})]})});hr.displayName=Xt;var pr="RadioIndicator",gr=f.forwardRef((s,e)=>{const{__scopeRadio:t,forceMount:a,...i}=s,n=Qa(pr,t);return r.jsx(Us,{present:a||n.checked,children:r.jsx(Y.span,{"data-state":vr(n.checked),"data-disabled":n.disabled?"":void 0,...i,ref:e})})});gr.displayName=pr;var ei="RadioBubbleInput",xr=f.forwardRef(({__scopeRadio:s,control:e,checked:t,bubbles:a=!0,...i},n)=>{const o=f.useRef(null),c=qe(o,n),u=Ks(t),m=qs(e);return f.useEffect(()=>{const v=o.current;if(!v)return;const w=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(w,"checked").set;if(u!==t&&S){const b=new Event("click",{bubbles:a});S.call(v,t),v.dispatchEvent(b)}},[u,t,a]),r.jsx(Y.input,{type:"radio","aria-hidden":!0,defaultChecked:t,...i,tabIndex:-1,ref:c,style:{...i.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});xr.displayName=ei;function vr(s){return s?"checked":"unchecked"}var ti=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ut="RadioGroup",[si,Si]=ct(ut,[Hs,fr]),yr=Hs(),_r=fr(),[ri,ai]=si(ut),br=f.forwardRef((s,e)=>{const{__scopeRadioGroup:t,name:a,defaultValue:i,value:n,required:o=!1,disabled:c=!1,orientation:u,dir:m,loop:v=!0,onValueChange:w,...A}=s,S=yr(t),b=qr(m),[P,R]=Gs({prop:n,defaultProp:i??null,onChange:w,caller:ut});return r.jsx(ri,{scope:t,name:a,required:o,disabled:c,value:P,onValueChange:R,children:r.jsx(Gr,{asChild:!0,...S,orientation:u,dir:b,loop:v,children:r.jsx(Y.div,{role:"radiogroup","aria-required":o,"aria-orientation":u,"data-disabled":c?"":void 0,dir:b,...A,ref:e})})})});br.displayName=ut;var jr="RadioGroupItem",kr=f.forwardRef((s,e)=>{const{__scopeRadioGroup:t,disabled:a,...i}=s,n=ai(jr,t),o=n.disabled||a,c=yr(t),u=_r(t),m=f.useRef(null),v=qe(e,m),w=n.value===i.value,A=f.useRef(!1);return f.useEffect(()=>{const S=P=>{ti.includes(P.key)&&(A.current=!0)},b=()=>A.current=!1;return document.addEventListener("keydown",S),document.addEventListener("keyup",b),()=>{document.removeEventListener("keydown",S),document.removeEventListener("keyup",b)}},[]),r.jsx(Hr,{asChild:!0,...c,focusable:!o,active:w,children:r.jsx(hr,{disabled:o,required:n.required,checked:w,...u,...i,name:n.name,ref:v,onCheck:()=>n.onValueChange(i.value),onKeyDown:Le(S=>{S.key==="Enter"&&S.preventDefault()}),onFocus:Le(i.onFocus,()=>{var S;A.current&&((S=m.current)==null||S.click())})})})});kr.displayName=jr;var ii="RadioGroupIndicator",Nr=f.forwardRef((s,e)=>{const{__scopeRadioGroup:t,...a}=s,i=_r(t);return r.jsx(gr,{...i,...a,ref:e})});Nr.displayName=ii;var Cr=br,wr=kr,ni=Nr;const Sr=f.forwardRef(({className:s,...e},t)=>r.jsx(Cr,{className:Se("grid gap-2",s),...e,ref:t}));Sr.displayName=Cr.displayName;const qt=f.forwardRef(({className:s,...e},t)=>r.jsx(wr,{ref:t,className:Se("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),...e,children:r.jsx(ni,{className:"flex items-center justify-center",children:r.jsx(Wr,{className:"h-2.5 w-2.5 fill-current text-current"})})}));qt.displayName=wr.displayName;const Me=54144,tt=1,oi=[{step:1,label:"Dates & Tarif",icon:zt},{step:2,label:"Informations",icon:st},{step:3,label:"Services",icon:Zt},{step:4,label:"Récapitulatif",icon:Ws},{step:5,label:"Paiement",icon:Mt}];function di(){const s=new Date(Date.now()+864e5),e=s.getMinutes();e>0&&e<=30?s.setMinutes(30,0,0):e>30?(s.setHours(s.getHours()+1),s.setMinutes(0,0,0)):s.setSeconds(0,0),s.getHours()<4&&s.setHours(4,0,0,0);const t=new Date(s.getTime()+7*24*60*60*1e3),a=`${String(s.getHours()).padStart(2,"0")}:${String(s.getMinutes()).padStart(2,"0")}`;return{arrivalDate:s,arrivalTime:a,departureDate:t,departureTime:"18:00"}}const L=s=>{const e=s.getFullYear(),t=String(s.getMonth()+1).padStart(2,"0"),a=String(s.getDate()).padStart(2,"0");return`${e}-${t}-${a}`};function Bs(s,e){return new Date(`${L(s)}T${e}`).toLocaleDateString("fr-FR",{weekday:"long",day:"numeric",month:"long",year:"numeric"})+` à ${e}`}function ci(s,e){return Math.max(1,Math.ceil((e.getTime()-s.getTime())/(1e3*60*60*24)))}const li=Ma({lastname:G().trim().min(2,"Minimum 2 caractères"),firstname:G().trim().min(2,"Minimum 2 caractères"),email:G().trim().email("Email invalide"),phone:G().trim().min(6,"Minimum 6 caractères"),vehiclePlate:G().trim().min(3,"Minimum 3 caractères"),vehicleBrand:G().trim().min(2,"Minimum 2 caractères"),customerType:$a(["particulier","entreprise"]),billingCompany:G().optional(),billingVat:G().optional(),billingAddress:G().optional(),billingZipcode:G().optional(),billingCity:G().optional()}).superRefine((s,e)=>{var t,a,i,n;s.customerType==="entreprise"&&((!((t=s.billingCompany)!=null&&t.trim())||s.billingCompany.trim().length<2)&&e.addIssue({code:l.custom,message:"Société requise",path:["billingCompany"]}),(!((a=s.billingAddress)!=null&&a.trim())||s.billingAddress.trim().length<3)&&e.addIssue({code:l.custom,message:"Adresse requise",path:["billingAddress"]}),(!((i=s.billingZipcode)!=null&&i.trim())||s.billingZipcode.trim().length<3)&&e.addIssue({code:l.custom,message:"Code postal requis",path:["billingZipcode"]}),(!((n=s.billingCity)!=null&&n.trim())||s.billingCity.trim().length<2)&&e.addIssue({code:l.custom,message:"Ville requise",path:["billingCity"]}))}),ui={closed:"Le parking est actuellement fermé pour les dates sélectionnées.",closed_arrival:"Le parking n'accepte pas d'arrivées à cette date/heure.",closed_departure:"Le parking n'accepte pas de départs à cette date/heure.",full:"Le parking est complet pour ces dates.",vehicle_type_not_accepted:"Ce type de véhicule n'est pas accepté.",no_pricing:"Aucun tarif disponible pour ces dates.",unavailable:"Service temporairement indisponible."},$e={enter:s=>({x:s>0?80:-80,opacity:0}),center:{x:0,opacity:1},exit:s=>({x:s>0?-80:80,opacity:0})},Ot="pending_booking_state";function Ri(){var xs;const[s]=Jr(),e=f.useRef(!1),t=f.useRef(!1),a=f.useRef(!1),i=f.useRef(!1),{user:n,profile:o,signInWithEmail:c,signUpWithEmail:u,signInWithProvider:m,resetPassword:v,updateProfile:w}=Yr(),[A,S]=f.useState(!1),b=f.useMemo(()=>{const d=s.get("ad"),k=s.get("at"),h=s.get("dd"),E=s.get("dt");if(d&&k&&h&&E){const M=new Date(d+"T00:00:00"),Oe=new Date(h+"T00:00:00");if(!isNaN(M.getTime())&&!isNaN(Oe.getTime())&&Oe>M&&M>=new Date(new Date().toISOString().slice(0,10)+"T00:00:00"))return{arrivalDate:M,arrivalTime:k,departureDate:Oe,departureTime:E}}return null},[s]),[P,R]=f.useState(1),[z,T]=f.useState(1),X=f.useMemo(()=>di(),[]),[$,Ie]=f.useState((b==null?void 0:b.arrivalDate)??X.arrivalDate),[H,Ge]=f.useState((b==null?void 0:b.arrivalTime)??X.arrivalTime),[B,Kt]=f.useState((b==null?void 0:b.departureDate)??X.departureDate),[K,Qt]=f.useState((b==null?void 0:b.departureTime)??X.departureTime),[mt,he]=f.useState(!1),[es,He]=f.useState(""),[pe,ft]=f.useState(""),[ge,ht]=f.useState(""),[Ne,pt]=f.useState(""),[xe,gt]=f.useState(""),[Q,xt]=f.useState(""),[ee,vt]=f.useState(""),[te,ts]=f.useState(""),[se,ss]=f.useState(""),[ve,rs]=f.useState(""),[re,yt]=f.useState("particulier"),[ye,_t]=f.useState(""),[ae,bt]=f.useState(""),[_e,jt]=f.useState(""),[be,kt]=f.useState(""),[je,Nt]=f.useState(""),[Z,as]=f.useState({}),[is,Rr]=f.useState(!1),[ns,os]=f.useState(!1),[U,Tr]=f.useState([]),[I,ds]=f.useState([]),[Ct,cs]=f.useState(!1),[wt,Ar]=f.useState(!1),[Pr,ls]=f.useState(!1),{data:ie,loading:St,error:Rt,fetchPrice:Ee,reset:mi}=Xr();f.useEffect(()=>{a.current||(a.current=!0,cs(!0),ua(Me).then(Tr).catch(d=>console.error("[Booking] Failed to fetch services:",d)).finally(()=>cs(!1)))},[]),f.useEffect(()=>{b&&!e.current&&(e.current=!0,Ee({parking_id:Me,arrival_date:L(b.arrivalDate),arrival_time:b.arrivalTime,departure_date:L(b.departureDate),departure_time:b.departureTime,vehicle_type:tt}),he(!0))},[b,Ee]),f.useEffect(()=>{if(o&&!t.current){t.current=!0,o.last_name&&ft(o.last_name),o.first_name&&ht(o.first_name),o.email&&pt(o.email),o.phone&&gt(o.phone),o.preferred_plate&&xt(o.preferred_plate);const d=[o.preferred_vehicle_brand,o.preferred_vehicle_model,o.preferred_vehicle_color].filter(Boolean).join(" ");d&&vt(d),o.company_name&&(yt("entreprise"),_t(o.company_name)),o.billing_address&&jt(o.billing_address),o.billing_zipcode&&kt(o.billing_zipcode),o.billing_city&&Nt(o.billing_city),o.billing_vat&&bt(o.billing_vat)}},[o]);const us=f.useCallback(()=>{const d={arrivalDate:$==null?void 0:$.toISOString(),arrivalTime:H,departureDate:B==null?void 0:B.toISOString(),departureTime:K,priceFetched:mt,lastname:pe,firstname:ge,email:Ne,phone:xe,vehiclePlate:Q,vehicleBrand:ee,flightDeparture:te,flightArrival:se,comments:ve,customerType:re,billingCompany:ye,billingVat:ae,billingAddress:_e,billingZipcode:be,billingCity:je,selectedServices:I};sessionStorage.setItem(Ot,JSON.stringify(d))},[$,H,B,K,mt,pe,ge,Ne,xe,Q,ee,te,se,ve,re,ye,ae,_e,be,je,I]),Ir=f.useCallback(async d=>(us(),m(d)),[us,m]);f.useEffect(()=>{var k;if(i.current)return;const d=sessionStorage.getItem(Ot);if(d){i.current=!0,sessionStorage.removeItem(Ot);try{const h=JSON.parse(d);if(h.arrivalDate&&Ie(new Date(h.arrivalDate)),h.arrivalTime&&Ge(h.arrivalTime),h.departureDate&&Kt(new Date(h.departureDate)),h.departureTime&&Qt(h.departureTime),h.lastname&&ft(h.lastname),h.firstname&&ht(h.firstname),h.email&&pt(h.email),h.phone&&gt(h.phone),h.vehiclePlate&&xt(h.vehiclePlate),h.vehicleBrand&&vt(h.vehicleBrand),h.flightDeparture&&ts(h.flightDeparture),h.flightArrival&&ss(h.flightArrival),h.comments&&rs(h.comments),h.customerType&&yt(h.customerType),h.billingCompany&&_t(h.billingCompany),h.billingVat&&bt(h.billingVat),h.billingAddress&&jt(h.billingAddress),h.billingZipcode&&kt(h.billingZipcode),h.billingCity&&Nt(h.billingCity),(k=h.selectedServices)!=null&&k.length&&ds(h.selectedServices),t.current=!1,h.arrivalDate&&h.departureDate){const E=new Date(h.arrivalDate),M=new Date(h.departureDate);Ee({parking_id:Me,arrival_date:L(E),arrival_time:h.arrivalTime,departure_date:L(M),departure_time:h.departureTime,vehicle_type:tt}),he(!0)}T(1),R(2)}catch(h){console.error("[Booking] Failed to restore state:",h)}}},[Ee]);const ms=(Rt==null?void 0:Rt.message)??null,{loading:Er,error:fs,create:Or}=la(),ne=(ie==null?void 0:ie.status)==="available"&&((xs=ie.pricing)!=null&&xs.length)?ie.pricing.reduce((d,k)=>d.price<k.price?d:k):null,Dr=ie&&ie.status!=="available",hs=f.useMemo(()=>U.filter(d=>I.includes(d.code)).reduce((d,k)=>d+k.price,0),[U,I]),zr={"Nettoyage intérieur":["Pack complet intérieur + extérieur","Pack Premium"],"Lavage extérieur à la main":["Pack complet intérieur + extérieur","Pack Confort","Pack Premium"],"Pack complet intérieur + extérieur":["Nettoyage intérieur","Lavage extérieur à la main","Pack Confort","Pack Premium"],"Ajout de lave-glace":["Pack sécurité","Pack Confort","Pack Premium"],"Pression des pneus":["Pack sécurité","Pack Confort","Pack Premium"],"Pack sécurité":["Ajout de lave-glace","Pression des pneus"],"Pack Confort":["Lavage extérieur à la main","Pack sécurité","Ajout de lave-glace","Pack complet intérieur + extérieur","Pression des pneus"],"Pack Premium":[]},ps=f.useCallback(()=>{var E;const d=new Set,k=U.filter(M=>I.includes(M.code)).map(M=>M.title);if(k.some(M=>M.includes("Pack Premium")))return U.forEach(M=>{!I.includes(M.code)&&!M.title.includes("Recharge")&&d.add(M.code)}),d;for(const M of k){const Oe=((E=Object.entries(zr).find(([De])=>M.includes(De)||De.includes(M)))==null?void 0:E[1])??[];for(const De of Oe){const At=U.find(vs=>vs.title.includes(De)||De.includes(vs.title));At&&!I.includes(At.code)&&d.add(At.code)}}return d},[U,I]),gs=f.useMemo(()=>ps(),[ps]),Zr=d=>{gs.has(d)||ds(k=>k.includes(d)?k.filter(h=>h!==d):[...k,d])},Mr=()=>{if(He(""),!$||!B){He("Veuillez sélectionner les dates.");return}const d=new Date,k=new Date(`${L($)}T${H}`),h=new Date(`${L(B)}T${K}`),E=new Date(d.getTime()+24*60*60*1e3);if(k<E){He("L'arrivée doit être au moins 24h à l'avance.");return}if(h<=k){He("La date de retour doit être après la date d'arrivée.");return}Ee({parking_id:Me,arrival_date:L($),arrival_time:H,departure_date:L(B),departure_time:K,vehicle_type:tt}),he(!0)},$r=()=>{ne&&(T(1),R(2))},Vr=()=>{const d=li.safeParse({lastname:pe,firstname:ge,email:Ne,phone:xe,vehiclePlate:Q,vehicleBrand:ee,customerType:re,billingCompany:ye,billingVat:ae,billingAddress:_e,billingZipcode:be,billingCity:je});if(!d.success){const k={};return d.error.errors.forEach(h=>{const E=h.path[0];k[E]=h.message}),as(k),!1}return as({}),!0},Lr=async()=>{if(Vr()){if(is&&n){os(!0);const d=ee.trim().split(/\s+/),k=d[0]||"",h=d[1]||"",E=d.slice(2).join(" ")||"";await w({first_name:ge,last_name:pe,phone:xe||null,preferred_plate:Q||null,preferred_vehicle_brand:k||null,preferred_vehicle_model:h||null,preferred_vehicle_color:E||null,...re==="entreprise"?{company_name:ye||null,billing_address:_e||null,billing_zipcode:be||null,billing_city:je||null,billing_vat:ae||null}:{}}),os(!1)}T(1),R(3)}},Fr=()=>{T(1),R(4)},Br=async()=>{var k,h;if(!wt)return;T(1),R(5);const d=await Or({parking_id:Me,arrival_date:L($),arrival_time:H,departure_date:L(B),departure_time:K,vehicle_type:tt,vehicle_plate:Q,vehicle_brand:ee,passenger:1,customer_civility:"M",customer_lastname:pe,customer_firstname:ge,customer_email:Ne,customer_phone:xe,...I.length>0&&{services:I},flight_departure_date:L($),flight_departure_time:H,flight_arrival_date:L(B),flight_arrival_time:K,...te&&{flight_departure_number:te},...se&&{flight_arrival_number:se},...ve&&{comments:ve},...re==="entreprise"&&{billing_company:ye,billing_vat:ae||void 0,billing_address:_e,billing_zipcode:be,billing_city:je}});d!=null&&d.stripe_checkout_url&&(n&&da.from("bookings").insert({user_id:n.id,order_id:d.order_id,booking_id:d.booking_id,status:d.status||"pending",amount:d.amount,currency:d.currency||"EUR",parking_name:d.parking_name,arrival_date:(k=d.dates)==null?void 0:k.arrival,departure_date:(h=d.dates)==null?void 0:h.departure,vehicle_plate:Q,vehicle_brand:ee,services:I.length>0?U.filter(E=>I.includes(E.code)).map(E=>({code:E.code,title:E.title,price:E.price})):null}).then(({error:E})=>{E&&console.error("[Booking] Failed to save booking:",E)}),window.location.href=d.stripe_checkout_url)},Tt=()=>{T(-1),R(d=>Math.max(1,d-1))},Ce=ci($,B);return r.jsxs("section",{className:"py-12 md:py-20",children:[r.jsxs("div",{className:"container mx-auto px-4 max-w-2xl",children:[r.jsx(Kr,{title:"Réservation",subtitle:"Réservez votre voiturier en quelques étapes"}),r.jsxs("div",{className:"mb-8",children:[r.jsx("div",{className:"flex justify-between mb-3",children:oi.map(d=>{const k=d.icon,h=P>=d.step;return r.jsxs("div",{className:`flex flex-col items-center gap-1 text-xs font-medium transition-colors ${h?"text-primary":"text-muted-foreground"}`,children:[r.jsx("div",{className:`w-9 h-9 rounded-full flex items-center justify-center border-2 transition-all ${P===d.step?"border-primary bg-primary/10":h?"border-primary/50 bg-primary/5":"border-border bg-muted/30"}`,children:r.jsx(k,{size:16})}),r.jsx("span",{className:"hidden sm:block",children:d.label})]},d.step)})}),r.jsx(mr,{value:P/5*100,className:"h-2"})]}),r.jsxs(Qr,{mode:"wait",custom:z,children:[P===1&&r.jsx(oe.div,{custom:z,variants:$e,initial:"enter",animate:"center",exit:"exit",transition:{duration:.3},children:r.jsx(ze,{className:"shadow-card border-border/50",children:r.jsxs(Ze,{className:"pt-6 space-y-5",children:[r.jsxs("h3",{className:"font-heading text-lg font-semibold flex items-center gap-2",children:[r.jsx(zt,{size:20,className:"text-primary"}),"Dates de votre séjour"]}),r.jsx("div",{className:"space-y-1 mb-1",children:r.jsxs("p",{className:"text-sm text-muted-foreground flex items-center gap-1.5",children:[r.jsx(Qe,{size:14,className:"text-primary"}),"Indiquez la date et l'heure de rendez-vous au terminal ",r.jsx("span",{className:"text-xs text-muted-foreground/70",children:"(environ 2h avant le décollage)"})]})}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(O,{children:"Date d'arrivée au terminal"}),r.jsx(ys,{value:$,onChange:d=>{Ie(d),he(!1)},minDate:(()=>{const d=new Date;return d.setDate(d.getDate()+1),d.setHours(0,0,0,0),d})(),placeholder:"Date d'arrivée"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(O,{children:"Heure d'arrivée"}),r.jsx(_s,{value:H,onChange:d=>{Ge(d),he(!1)},referenceDate:$})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(O,{children:"Date d'atterrissage retour"}),r.jsx(ys,{value:B,onChange:d=>{Kt(d),he(!1)},minDate:$||(()=>{const d=new Date;return d.setDate(d.getDate()+1),d.setHours(0,0,0,0),d})(),placeholder:"Date de retour"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(O,{children:"Heure d'atterrissage"}),r.jsx(_s,{value:K,onChange:d=>{Qt(d),he(!1)}}),r.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1.5",children:[r.jsx(bs,{size:12,className:"text-primary shrink-0"}),"Même en cas de retard, vous ne serez pas pénalisé et votre voiture sera au point de rendez-vous convenu."]})]})]}),es&&r.jsxs(Pt,{variant:"destructive",children:[r.jsx(We,{className:"h-4 w-4"}),r.jsx(It,{children:es})]}),!mt&&r.jsxs("button",{onClick:Mr,disabled:St,className:"w-full bg-gradient-gold text-primary-foreground font-semibold py-3 rounded-lg shadow-gold hover:opacity-90 transition-opacity flex items-center justify-center gap-2",children:[St?r.jsx(Je,{className:"animate-spin",size:18}):r.jsx(Ye,{size:18}),"Calculer le tarif"]}),St&&r.jsx("div",{className:"text-center text-muted-foreground text-sm py-4",children:"Calcul du tarif en cours…"}),ms&&r.jsxs(Pt,{variant:"destructive",children:[r.jsx(We,{className:"h-4 w-4"}),r.jsx(It,{children:ms})]}),Dr&&r.jsxs(Pt,{children:[r.jsx(We,{className:"h-4 w-4"}),r.jsx(It,{children:ui[ie.status]||"Non disponible pour ces dates."})]}),ne&&r.jsxs(oe.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"space-y-4",children:[r.jsxs("div",{className:"bg-muted/50 rounded-xl p-5 border border-border/50",children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsxs("span",{className:"text-sm text-muted-foreground",children:[Ce," jour",Ce>1?"s":""," de stationnement"]}),r.jsx("span",{className:"text-sm text-muted-foreground",children:ne.name})]}),r.jsxs("div",{className:"text-center",children:[r.jsxs("span",{className:"font-heading text-4xl font-bold text-gradient-gold",children:[ne.price.toFixed(2)," €"]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"TTC • Paiement sécurisé par Stripe"})]})]}),r.jsxs("button",{onClick:$r,className:"w-full bg-gradient-gold text-primary-foreground font-semibold py-3 rounded-lg shadow-gold hover:opacity-90 transition-opacity flex items-center justify-center gap-2",children:["Continuer ",r.jsx(Ye,{size:18})]})]})]})})},"step1"),P===2&&r.jsx(oe.div,{custom:z,variants:$e,initial:"enter",animate:"center",exit:"exit",transition:{duration:.3},children:r.jsx(ze,{className:"shadow-card border-border/50",children:r.jsxs(Ze,{className:"pt-6 space-y-5",children:[r.jsxs("h3",{className:"font-heading text-lg font-semibold flex items-center gap-2",children:[r.jsx(st,{size:20,className:"text-primary"}),"Vos informations"]}),!n&&r.jsxs("div",{className:"bg-primary/5 border border-primary/20 rounded-xl p-4 space-y-3",children:[r.jsx("p",{className:"text-sm font-medium",children:"Connectez-vous pour pré-remplir vos informations"}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsxs(Xe,{size:"sm",variant:"outline",onClick:()=>m("google"),className:"gap-2",children:[r.jsxs("svg",{viewBox:"0 0 24 24",className:"w-4 h-4",children:[r.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 01-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"}),r.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),r.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),r.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),"Google"]}),r.jsxs(Xe,{size:"sm",variant:"outline",onClick:()=>m("apple"),className:"gap-2",children:[r.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"w-4 h-4",children:r.jsx("path",{d:"M17.05 20.28c-.98.95-2.05.88-3.08.4-1.09-.5-2.08-.48-3.24 0-1.44.62-2.2.44-3.06-.4C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})}),"Apple"]}),r.jsxs(Xe,{size:"sm",variant:"outline",onClick:()=>m("linkedin_oidc"),className:"gap-2",children:[r.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor",className:"w-4 h-4 text-[#0A66C2]",children:r.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"})}),"LinkedIn"]}),r.jsxs(Xe,{size:"sm",variant:"outline",onClick:()=>S(!0),className:"gap-2",children:[r.jsx(st,{size:14}),"Email"]})]})]}),n&&r.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[r.jsx(bs,{size:16,className:"text-green-500"}),"Connecté en tant que ",(o==null?void 0:o.first_name)||n.email]}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("p",{className:"text-sm font-medium flex items-center gap-2",children:[r.jsx(ks,{size:16,className:"text-primary"})," Type de client"]}),r.jsxs(Sr,{value:re,onValueChange:d=>yt(d),className:"flex gap-6",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(qt,{value:"particulier",id:"type-particulier"}),r.jsx(O,{htmlFor:"type-particulier",className:"cursor-pointer",children:"Particulier"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(qt,{value:"entreprise",id:"type-entreprise"}),r.jsx(O,{htmlFor:"type-entreprise",className:"cursor-pointer",children:"Entreprise"})]})]}),re==="entreprise"&&r.jsxs(oe.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(O,{htmlFor:"billing-company",children:"Société *"}),r.jsx(V,{id:"billing-company",value:ye,onChange:d=>_t(d.target.value),placeholder:"Ma Société SAS"}),Z.billingCompany&&r.jsx("p",{className:"text-xs text-destructive",children:Z.billingCompany})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(O,{htmlFor:"billing-vat",children:"N° TVA"}),r.jsx(V,{id:"billing-vat",value:ae,onChange:d=>bt(d.target.value),placeholder:"FR12345678901"})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(O,{htmlFor:"billing-address",children:"Adresse de facturation *"}),r.jsx(V,{id:"billing-address",value:_e,onChange:d=>jt(d.target.value),placeholder:"12 rue de la Paix"}),Z.billingAddress&&r.jsx("p",{className:"text-xs text-destructive",children:Z.billingAddress})]}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(O,{htmlFor:"billing-zipcode",children:"Code postal *"}),r.jsx(V,{id:"billing-zipcode",value:be,onChange:d=>kt(d.target.value),placeholder:"75001"}),Z.billingZipcode&&r.jsx("p",{className:"text-xs text-destructive",children:Z.billingZipcode})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(O,{htmlFor:"billing-city",children:"Ville *"}),r.jsx(V,{id:"billing-city",value:je,onChange:d=>Nt(d.target.value),placeholder:"Paris"}),Z.billingCity&&r.jsx("p",{className:"text-xs text-destructive",children:Z.billingCity})]})]})]})]}),r.jsxs("div",{className:"border-t border-border/50 pt-4 grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(O,{htmlFor:"lastname",children:"Nom *"}),r.jsx(V,{id:"lastname",value:pe,onChange:d=>ft(d.target.value),placeholder:"Dupont"}),Z.lastname&&r.jsx("p",{className:"text-xs text-destructive",children:Z.lastname})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(O,{htmlFor:"firstname",children:"Prénom *"}),r.jsx(V,{id:"firstname",value:ge,onChange:d=>ht(d.target.value),placeholder:"Jean"}),Z.firstname&&r.jsx("p",{className:"text-xs text-destructive",children:Z.firstname})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(O,{htmlFor:"email",children:"Email *"}),r.jsx(V,{id:"email",type:"email",value:Ne,onChange:d=>pt(d.target.value),placeholder:"jean@example.com"}),Z.email&&r.jsx("p",{className:"text-xs text-destructive",children:Z.email})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(O,{htmlFor:"phone",children:"Téléphone *"}),r.jsx(V,{id:"phone",type:"tel",value:xe,onChange:d=>gt(d.target.value),placeholder:"+33 6 12 34 56 78"}),Z.phone&&r.jsx("p",{className:"text-xs text-destructive",children:Z.phone})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs(O,{htmlFor:"plate",className:"flex items-center gap-2",children:[r.jsx(js,{size:16})," Plaque d'immatriculation *"]}),r.jsx(V,{id:"plate",value:Q,onChange:d=>xt(d.target.value.toUpperCase()),placeholder:"AB-123-CD"}),Z.vehiclePlate&&r.jsx("p",{className:"text-xs text-destructive",children:Z.vehiclePlate})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs(O,{htmlFor:"vehicle-brand",className:"flex items-center gap-2",children:[r.jsx(js,{size:16})," Marque, modèle et couleur *"]}),r.jsx(V,{id:"vehicle-brand",value:ee,onChange:d=>vt(d.target.value),placeholder:"Peugeot 308 Grise"}),r.jsxs("p",{className:"text-xs text-muted-foreground flex items-center gap-1.5",children:[r.jsx("span",{className:"inline-flex h-4 w-4 rounded-full bg-accent text-accent-foreground text-[10px] font-bold items-center justify-center shrink-0",children:"!"}),"Hauteur maximale autorisée : 1,90 m"]}),Z.vehicleBrand&&r.jsx("p",{className:"text-xs text-destructive",children:Z.vehicleBrand})]}),r.jsxs("div",{className:"border-t border-border/50 pt-4",children:[r.jsxs("p",{className:"text-sm text-muted-foreground mb-3 flex items-center gap-2",children:[r.jsx(Qe,{size:16})," Informations de vol (optionnel)"]}),r.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsx(O,{htmlFor:"flight-dep",children:"N° vol aller"}),r.jsx(V,{id:"flight-dep",value:te,onChange:d=>ts(d.target.value.toUpperCase()),placeholder:"AF1234"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsx(O,{htmlFor:"flight-arr",children:"N° vol retour"}),r.jsx(V,{id:"flight-arr",value:se,onChange:d=>ss(d.target.value.toUpperCase()),placeholder:"AF5678"})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs(O,{htmlFor:"comments",className:"flex items-center gap-2",children:[r.jsx(Ns,{size:16})," Commentaires"]}),r.jsx(nr,{id:"comments",value:ve,onChange:d=>rs(d.target.value),placeholder:"Demande particulière…",rows:3})]}),n&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ut,{id:"save-profile",checked:is,onCheckedChange:d=>Rr(!!d)}),r.jsx(O,{htmlFor:"save-profile",className:"text-sm cursor-pointer",children:"Sauvegarder ces informations dans mon profil"})]}),r.jsxs("div",{className:"flex gap-3",children:[r.jsxs("button",{onClick:Tt,className:"flex-1 border border-border text-foreground font-medium py-3 rounded-lg hover:bg-muted/50 transition-colors flex items-center justify-center gap-2",children:[r.jsx(Ke,{size:18})," Retour"]}),r.jsx("button",{onClick:Lr,disabled:ns,className:"flex-1 bg-gradient-gold text-primary-foreground font-semibold py-3 rounded-lg shadow-gold hover:opacity-90 transition-opacity flex items-center justify-center gap-2 disabled:opacity-50",children:ns?r.jsxs(r.Fragment,{children:[r.jsx(Je,{className:"animate-spin",size:18})," Sauvegarde…"]}):r.jsxs(r.Fragment,{children:["Continuer ",r.jsx(Ye,{size:18})]})})]})]})})},"step2"),P===3&&r.jsx(oe.div,{custom:z,variants:$e,initial:"enter",animate:"center",exit:"exit",transition:{duration:.3},children:r.jsx(ze,{className:"shadow-card border-border/50",children:r.jsxs(Ze,{className:"pt-6 space-y-5",children:[r.jsxs("h3",{className:"font-heading text-lg font-semibold flex items-center gap-2",children:[r.jsx(Zt,{size:20,className:"text-primary"}),"Services additionnels"]}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Profitez de votre absence pour prendre soin de votre véhicule. Sélection optionnelle."}),Ct&&r.jsxs("div",{className:"text-center py-8",children:[r.jsx(Je,{className:"animate-spin mx-auto text-primary",size:24}),r.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Chargement des services…"})]}),!Ct&&U.length===0&&r.jsx("div",{className:"text-center py-8",children:r.jsx("p",{className:"text-sm text-muted-foreground",children:"Aucun service disponible pour le moment."})}),!Ct&&U.length>0&&r.jsx("div",{className:"space-y-3",children:U.map(d=>{const k=I.includes(d.code),h=gs.has(d.code);return r.jsx("button",{type:"button",onClick:()=>Zr(d.code),disabled:h,className:`w-full text-left rounded-xl border-2 p-4 transition-all ${k?"border-primary bg-primary/5 shadow-sm":h?"border-border/30 bg-muted/20 opacity-50 cursor-not-allowed":"border-border/50 bg-card hover:border-primary/30 hover:bg-muted/30"}`,children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:`mt-0.5 w-5 h-5 rounded-md border-2 flex items-center justify-center flex-shrink-0 transition-all ${k?"border-primary bg-primary":h?"border-muted-foreground/20":"border-muted-foreground/30"}`,children:k&&r.jsx(Dt,{size:14,className:"text-primary-foreground"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("span",{className:`font-medium text-sm ${h?"text-muted-foreground":""}`,children:d.title}),r.jsxs("span",{className:`font-heading font-bold whitespace-nowrap ${h?"text-muted-foreground":"text-primary"}`,children:[d.price.toFixed(2)," €"]})]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:d.description})]})]})},d.code)})}),I.length>0&&r.jsx(oe.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},className:"bg-primary/5 border border-primary/20 rounded-xl p-4",children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("span",{className:"text-sm font-medium",children:[I.length," service",I.length>1?"s":""," sélectionné",I.length>1?"s":""]}),r.jsxs("span",{className:"font-heading font-bold text-primary",children:[hs.toFixed(2)," €"]})]})}),r.jsxs("div",{className:"flex gap-3",children:[r.jsxs("button",{onClick:Tt,className:"flex-1 border border-border text-foreground font-medium py-3 rounded-lg hover:bg-muted/50 transition-colors flex items-center justify-center gap-2",children:[r.jsx(Ke,{size:18})," Retour"]}),r.jsxs("button",{onClick:Fr,className:"flex-1 bg-gradient-gold text-primary-foreground font-semibold py-3 rounded-lg shadow-gold hover:opacity-90 transition-opacity flex items-center justify-center gap-2",children:["Continuer ",r.jsx(Ye,{size:18})]})]})]})})},"step3"),P===4&&r.jsx(oe.div,{custom:z,variants:$e,initial:"enter",animate:"center",exit:"exit",transition:{duration:.3},children:r.jsx(ze,{className:"shadow-card border-border/50",children:r.jsxs(Ze,{className:"pt-6 space-y-5",children:[r.jsxs("h3",{className:"font-heading text-lg font-semibold flex items-center gap-2",children:[r.jsx(Ws,{size:20,className:"text-primary"}),"Récapitulatif de votre réservation"]}),r.jsxs("div",{className:"rounded-xl border border-border/40 overflow-hidden",children:[r.jsxs("div",{className:"bg-primary/5 px-5 py-3 border-b border-border/30 flex items-center justify-between",children:[r.jsxs("p",{className:"text-xs font-semibold uppercase tracking-wider text-primary flex items-center gap-2",children:[r.jsx(zt,{size:14})," Dates de stationnement"]}),r.jsxs("button",{onClick:()=>{T(-1),R(1)},className:"text-xs text-primary hover:text-primary/80 font-medium flex items-center gap-1 transition-colors",children:[r.jsx(et,{size:12})," Modifier"]})]}),r.jsxs("div",{className:"p-5 grid grid-cols-1 sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:r.jsx(Qe,{size:14,className:"text-primary"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Arrivée au terminal"}),r.jsx("p",{className:"font-medium text-sm capitalize",children:Bs($,H)})]})]}),r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"w-8 h-8 rounded-full bg-primary/10 flex items-center justify-center flex-shrink-0 mt-0.5",children:r.jsx(Qe,{size:14,className:"text-primary"})}),r.jsxs("div",{children:[r.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Atterrissage retour"}),r.jsx("p",{className:"font-medium text-sm capitalize",children:Bs(B,K)})]})]})]}),r.jsx("div",{className:"px-5 pb-4",children:r.jsxs("div",{className:"bg-muted/40 rounded-lg px-4 py-2 text-center",children:[r.jsx("span",{className:"text-xs text-muted-foreground",children:"Durée totale : "}),r.jsxs("span",{className:"text-sm font-semibold",children:[Ce," jour",Ce>1?"s":""]})]})})]}),r.jsxs("div",{className:"rounded-xl border border-border/40 overflow-hidden",children:[r.jsxs("div",{className:"bg-primary/5 px-5 py-3 border-b border-border/30 flex items-center justify-between",children:[r.jsxs("p",{className:"text-xs font-semibold uppercase tracking-wider text-primary flex items-center gap-2",children:[r.jsx(st,{size:14})," Informations client & véhicule"]}),r.jsxs("button",{onClick:()=>{T(-1),R(2)},className:"text-xs text-primary hover:text-primary/80 font-medium flex items-center gap-1 transition-colors",children:[r.jsx(et,{size:12})," Modifier"]})]}),r.jsxs("div",{className:"p-5 grid grid-cols-1 sm:grid-cols-2 gap-4 text-sm",children:[r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Client"}),r.jsxs("p",{className:"font-medium",children:[ge," ",pe]}),r.jsx("p",{className:"text-muted-foreground text-xs",children:Ne}),r.jsx("p",{className:"text-muted-foreground text-xs",children:xe})]}),r.jsxs("div",{className:"space-y-1",children:[r.jsx("p",{className:"text-xs text-muted-foreground font-medium",children:"Véhicule"}),r.jsx("p",{className:"font-medium",children:Q}),r.jsx("p",{className:"text-muted-foreground text-xs",children:ee})]})]}),(te||se)&&r.jsx("div",{className:"px-5 pb-4",children:r.jsxs("div",{className:"bg-muted/40 rounded-lg px-4 py-2 flex flex-wrap gap-4 text-xs text-muted-foreground",children:[te&&r.jsxs("span",{children:["✈ Vol aller : ",r.jsx("span",{className:"font-medium text-foreground",children:te})]}),se&&r.jsxs("span",{children:["✈ Vol retour : ",r.jsx("span",{className:"font-medium text-foreground",children:se})]})]})}),re==="entreprise"&&r.jsxs("div",{className:"px-5 pb-4 border-t border-border/30 pt-4",children:[r.jsxs("p",{className:"text-xs text-muted-foreground font-medium mb-1 flex items-center gap-1",children:[r.jsx(ks,{size:12})," Facturation entreprise"]}),r.jsx("p",{className:"font-medium text-sm",children:ye}),ae&&r.jsxs("p",{className:"text-xs text-muted-foreground",children:["TVA : ",ae]}),r.jsxs("p",{className:"text-xs text-muted-foreground",children:[_e,", ",be," ",je]})]})]}),I.length>0&&r.jsxs("div",{className:"rounded-xl border border-border/40 overflow-hidden",children:[r.jsxs("div",{className:"bg-primary/5 px-5 py-3 border-b border-border/30 flex items-center justify-between",children:[r.jsxs("p",{className:"text-xs font-semibold uppercase tracking-wider text-primary flex items-center gap-2",children:[r.jsx(Zt,{size:14})," Services additionnels (",I.length,")"]}),r.jsxs("button",{onClick:()=>{T(-1),R(3)},className:"text-xs text-primary hover:text-primary/80 font-medium flex items-center gap-1 transition-colors",children:[r.jsx(et,{size:12})," Modifier"]})]}),r.jsx("div",{className:"p-5 space-y-2",children:U.filter(d=>I.includes(d.code)).map(d=>r.jsxs("div",{className:"flex items-center justify-between py-1.5",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Dt,{size:14,className:"text-primary flex-shrink-0"}),r.jsx("span",{className:"text-sm",children:d.title})]}),r.jsxs("span",{className:"text-sm font-medium whitespace-nowrap",children:[d.price.toFixed(2)," €"]})]},d.code))})]}),ve&&r.jsxs("div",{className:"rounded-xl border border-border/40 overflow-hidden",children:[r.jsxs("div",{className:"bg-primary/5 px-5 py-3 border-b border-border/30 flex items-center justify-between",children:[r.jsxs("p",{className:"text-xs font-semibold uppercase tracking-wider text-primary flex items-center gap-2",children:[r.jsx(Ns,{size:14})," Commentaires"]}),r.jsxs("button",{onClick:()=>{T(-1),R(2)},className:"text-xs text-primary hover:text-primary/80 font-medium flex items-center gap-1 transition-colors",children:[r.jsx(et,{size:12})," Modifier"]})]}),r.jsx("div",{className:"p-5",children:r.jsx("p",{className:"text-sm text-muted-foreground",children:ve})})]}),ne&&r.jsxs("div",{className:"bg-gradient-to-br from-primary/10 via-primary/5 to-transparent border-2 border-primary/20 rounded-xl p-5 space-y-3",children:[r.jsxs("p",{className:"text-xs font-semibold uppercase tracking-wider text-primary flex items-center gap-2",children:[r.jsx(Mt,{size:14})," Détail du prix"]}),r.jsxs("div",{className:"flex items-center justify-between text-sm",children:[r.jsxs("span",{className:"text-muted-foreground",children:["Stationnement ",Ce," jour",Ce>1?"s":""," • ",ne.name]}),r.jsxs("span",{className:"font-medium",children:[ne.price.toFixed(2)," €"]})]}),I.length>0&&U.filter(d=>I.includes(d.code)).map(d=>r.jsxs("div",{className:"flex items-center justify-between text-sm",children:[r.jsx("span",{className:"text-muted-foreground",children:d.title}),r.jsxs("span",{className:"font-medium",children:[d.price.toFixed(2)," €"]})]},d.code)),r.jsxs("div",{className:"border-t-2 border-primary/20 pt-3 text-center",children:[r.jsxs("span",{className:"font-heading text-3xl font-bold text-gradient-gold",children:[(ne.price+hs).toFixed(2)," €"]}),r.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"TTC • Paiement sécurisé par Stripe"})]})]}),r.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-lg bg-muted/30 border border-border/30",children:[r.jsx(Ut,{id:"cgv",checked:wt,onCheckedChange:d=>Ar(d===!0),className:"mt-0.5"}),r.jsxs(O,{htmlFor:"cgv",className:"text-sm leading-relaxed cursor-pointer",children:["J'accepte les"," ",r.jsx("button",{type:"button",onClick:d=>{d.preventDefault(),ls(!0)},className:"text-primary underline underline-offset-2 hover:opacity-80",children:"Conditions Générales de Vente"})," ","et la politique de confidentialité."]})]}),r.jsx(ea,{open:Pr,onOpenChange:ls,children:r.jsxs(ta,{className:"max-w-2xl max-h-[80vh] p-0",children:[r.jsx(sa,{className:"p-6 pb-0",children:r.jsx(ra,{className:"font-heading text-lg",children:"Conditions Générales de Vente"})}),r.jsx(aa,{className:"px-6 pb-6 max-h-[calc(80vh-80px)]",children:r.jsx(ca,{})})]})}),r.jsxs("div",{className:"flex gap-3",children:[r.jsxs("button",{onClick:Tt,className:"flex-1 border border-border text-foreground font-medium py-3 rounded-lg hover:bg-muted/50 transition-colors flex items-center justify-center gap-2",children:[r.jsx(Ke,{size:18})," Retour"]}),r.jsxs("button",{onClick:Br,disabled:!wt,className:"flex-1 bg-gradient-gold text-primary-foreground font-semibold py-3 rounded-lg shadow-gold hover:opacity-90 transition-opacity flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",children:[r.jsx(Mt,{size:18})," Procéder au paiement"]})]})]})})},"step4"),P===5&&r.jsx(oe.div,{custom:z,variants:$e,initial:"enter",animate:"center",exit:"exit",transition:{duration:.3},children:r.jsx(ze,{className:"shadow-card border-border/50",children:r.jsxs(Ze,{className:"pt-6 py-16 text-center space-y-4",children:[Er&&r.jsxs(r.Fragment,{children:[r.jsx(Je,{className:"animate-spin mx-auto text-primary",size:40}),r.jsx("p",{className:"font-heading text-lg font-semibold",children:"Création de votre réservation…"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:"Vous allez être redirigé vers la page de paiement sécurisé Stripe."})]}),fs&&r.jsxs(r.Fragment,{children:[r.jsx(We,{className:"mx-auto text-destructive",size:40}),r.jsx("p",{className:"font-heading text-lg font-semibold text-destructive",children:"Erreur"}),r.jsx("p",{className:"text-sm text-muted-foreground",children:fs}),r.jsxs("button",{onClick:()=>{T(-1),R(4)},className:"mt-4 border border-border text-foreground font-medium py-2 px-6 rounded-lg hover:bg-muted/50 transition-colors inline-flex items-center gap-2",children:[r.jsx(Ke,{size:18})," Retour"]})]})]})})},"step5")]}),r.jsxs("div",{className:"mt-6 grid grid-cols-1 sm:grid-cols-2 gap-3",children:[r.jsxs("div",{className:"flex items-start gap-3 rounded-xl border border-border/50 bg-muted/30 p-4",children:[r.jsx(ia,{size:20,className:"text-primary shrink-0 mt-0.5"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Paiement rapide et sécurisé"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"CB, Apple Pay, Google Pay, Amazon Pay, Link."})]})]}),r.jsxs("div",{className:"flex items-start gap-3 rounded-xl border border-border/50 bg-muted/30 p-4",children:[r.jsx(na,{size:20,className:"text-primary shrink-0 mt-0.5"}),r.jsxs("div",{children:[r.jsx("p",{className:"text-sm font-semibold text-foreground",children:"Réservation sans risque"}),r.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Aucun frais de réservation et annulation gratuite jusqu'à 24h avant votre arrivée."})]})]})]})]}),r.jsx(oa,{open:A,onOpenChange:S,onSignIn:c,onSignUp:u,onSignInWithProvider:Ir,onResetPassword:v})]})}export{Ri as default};