1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="9aebf215-3816-88c0-2673-cac6d3f127b1")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,728515,e=>{"use strict";var t=e.i(843476),r=e.i(271645);e.s(["ClearableTextField",0,function({hint:e="",labelText:n,title:a,minLines:s,maxLines:l,inputFormatters:i=[],textStyle:o,keyboardType:d="text",textInputAction:c="none",value:u,keepHint:m=!1,hasHeight:p=!0,isReadOnly:f=!1,enabled:h=!0,clearButtonVisibility:x=!0,onEditingComplete:g,onFieldSubmitted:b,validator:y,onChanged:v,className:j,style:w}){let N=u??"",[k,S]=(0,r.useState)(N),[C,_]=(0,r.useState)(N),[P,E]=(0,r.useState)(),[T,M]=(0,r.useState)(!1),D=(0,r.useRef)(null);N!==C&&(_(N),S(N));let B=(l??s??1)>1;return(0,t.jsxs)("div",{className:["flex flex-col gap-1.5",j].filter(Boolean).join(" "),style:w,children:[a?(0,t.jsx)("div",{className:"text-xs font-medium text-foreground",children:a}):null,(0,t.jsxs)("label",{className:"relative flex items-center rounded-lg border border-border bg-background",children:[n?(0,t.jsx)("span",{className:"pl-3 text-xs text-muted-foreground",children:n}):null,(0,t.jsx)(B?"textarea":"input",{ref:D,className:"z-10 flex-1 border-0 bg-transparent p-3 text-sm font-sans outline-none disabled:cursor-not-allowed disabled:bg-muted/40",placeholder:m?"":e,value:k,onChange:e=>{let t;return t=e.target.value,void(i.forEach(e=>{t=e(t)}),S(t),E(y?y(t):void 0),v?.(t),M(!!t))},onBlur:g,onKeyDown:e=>{"Enter"===e.key&&b?.(k)},readOnly:f,disabled:!h,style:o,minLength:s,rows:B?Math.max(s??1,1):void 0,maxLength:l,type:B?void 0:d}),m?(0,t.jsx)("div",{className:"pointer-events-none absolute left-3 right-9 z-0 flex gap-0.5 text-sm text-[rgba(2,15,22,0.4)]","aria-hidden":!0,children:e.split("").map((e,r)=>(0,t.jsx)("span",{className:["transition-opacity",r<k.length?"opacity-20":"opacity-100"].join(" "),children:e},r))}):null,x&&T&&!f?(0,t.jsx)("button",{type:"button",className:"absolute right-2 top-1/2 z-20 h-7 w-7 -translate-y-1/2 rounded-full border-0 bg-muted/40 text-foreground shadow-sm transition hover:brightness-95",onClick:()=>{S(""),E(void 0),v?.(""),M(!1),D.current?.focus()},"aria-label":"Clear input",children:"Ã"}):null]}),P?(0,t.jsx)("div",{className:"text-xs text-destructive",children:P}):null]})}])},221642,e=>{"use strict";var t=e.i(843476);e.s(["DashSeparator",0,function({height:e=1,color:r="hsl(var(--foreground))",dashWidth:n=10,gapWidth:a=10,className:s,style:l}){let i={"--dash-color":r,"--dash-width":`${n}px`,"--dash-gap":`${a}px`,height:e,backgroundImage:"repeating-linear-gradient(to right, var(--dash-color), var(--dash-color) var(--dash-width), transparent var(--dash-width), transparent calc(var(--dash-width) + var(--dash-gap)))",backgroundRepeat:"repeat-x",backgroundSize:"calc(var(--dash-width) + var(--dash-gap)) 100%",...l};return(0,t.jsx)("div",{className:["w-full",s].filter(Boolean).join(" "),"aria-hidden":!0,style:i})}])},953421,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(131128),a=e.i(127890);function s({firstDay:e,focusedDay:l,selectedStartDate:i,selectedEndDate:o,unavailableDates:d=[],title:c,buttonTextFirst:u="Apply",buttonTextSecond:m="Clear",dateSelectorWarningText:p,hasTimeSlots:f=!0,timeSlots:h=[],selectedTimeSlotId:x,onTimeSlotSelected:g,allowSaturday:b=!0,allowSunday:y=!1,allowAllDates:v=!1,onDaySelected:j}){let[w,N]=(0,r.useState)(i),[k,S]=(0,r.useState)(o),C=(0,r.useMemo)(()=>d.map(e=>e.toDateString()),[d]),_=t=>!v&&(!b&&6===t.getDay()||!y&&0===t.getDay()||!!e&&t<e||C.includes(t.toDateString())),P=h.map(e=>({label:e.label,value:e.id}));return(0,t.jsxs)("div",{className:"grid gap-3 rounded-xl border border-border bg-white p-3",children:[c?(0,t.jsx)("div",{className:"text-lg font-bold text-foreground",children:c}):null,(0,t.jsxs)("div",{className:"grid grid-cols-[repeat(auto-fit,minmax(220px,1fr))] gap-2",children:[(0,t.jsxs)("label",{className:"grid gap-1 text-sm text-foreground",children:[(0,t.jsx)("span",{children:"Start date"}),(0,t.jsx)("input",{type:"date",value:w?w.toISOString().slice(0,10):"",min:e?e.toISOString().slice(0,10):void 0,onChange:e=>{let t=e.target.value?new Date(e.target.value):void 0;t&&_(t)||N(t)},className:"rounded-lg border border-border p-2.5 text-sm outline-none"})]}),(0,t.jsxs)("label",{className:"grid gap-1 text-sm text-foreground",children:[(0,t.jsx)("span",{children:"End date"}),(0,t.jsx)("input",{type:"date",value:k?k.toISOString().slice(0,10):"",min:w?w.toISOString().slice(0,10):e?.toISOString().slice(0,10),onChange:e=>{let t=e.target.value?new Date(e.target.value):void 0;t&&_(t)||S(t)},className:"rounded-lg border border-border p-2.5 text-sm outline-none"})]})]}),f&&h.length>0?(0,t.jsx)("div",{className:"grid gap-2",children:(0,t.jsx)(n.DsDropdown,{items:P,value:x,onChange:e=>{"string"==typeof e&&g?.(e)},hintText:"Select a time"})}):null,p?(0,t.jsx)("div",{className:"text-[13px] text-destructive",children:p}):null,(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(a.DsButton,{size:"big",label:m,color:"outlineSecondary",onTap:()=>{N(void 0),S(void 0)}}),(0,t.jsx)(a.DsButton,{size:"big",label:u,onTap:()=>{w&&j?.(w,k)},disabled:!w})]})]})}e.s(["DateRangeSelector",0,function(e){let r=`${e.selectedStartDate?.toISOString()??"none"}|${e.selectedEndDate?.toISOString()??"none"}`;return(0,t.jsx)(s,{...e},r)}])},127890,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(952789);
2let a={active:{background:n.dsBackgroundColors.primaryButton,foreground:n.dsTextColors.contrast,stroke:null},activeSecondary:{background:n.dsBackgroundColors.secondaryButton,foreground:n.dsTextColors.contrast,stroke:null},active10:{background:n.dsBackgroundColors.primaryButton10,foreground:n.dsTextColors.accent,stroke:null},success:{background:n.dsBackgroundColors.success,foreground:n.dsTextColors.contrast,stroke:null},contrast:{background:n.dsBackgroundColors.primaryThemed,foreground:n.dsTextColors.accent,stroke:null},white:{background:n.dsBackgroundColors.buttonContrast,foreground:n.dsTextColors.accent,stroke:null},disabled:{background:n.dsBackgroundColors.tertiaryThemed,foreground:n.dsTextColors.secondaryThemed,stroke:null},outline:{background:n.dsBackgroundColors.transparent,foreground:n.dsTextColors.accent,stroke:n.dsStrokeColors.focus},outlineSecondary:{background:n.dsBackgroundColors.transparent,foreground:n.dsTextColors.accent,stroke:n.dsStrokeColors.neutral},outlineNeutral:{background:n.dsBackgroundColors.transparent,foreground:n.dsTextColors.primaryThemed,stroke:n.dsStrokeColors.neutral},outlineSuccess:{background:n.dsBackgroundColors.transparent,foreground:n.dsTextColors.success,stroke:n.dsStrokeColors.success},outlineCritical:{background:n.dsBackgroundColors.transparent,foreground:n.dsTextColors.danger,stroke:n.dsStrokeColors.critical},transparent:{background:n.dsBackgroundColors.actionTertiary,foreground:n.dsTextColors.accent,stroke:null},noBackground:{background:n.dsBackgroundColors.transparent,foreground:n.dsTextColors.accent,stroke:null},bgFinal:{background:n.dsBackgroundColors.finalAction,foreground:n.dsTextColors.contrast,stroke:null},critical:{background:n.dsBackgroundColors.critical,foreground:n.dsTextColors.contrast,stroke:null}},s={small:32,big:48},l={small:"0 12px",big:"0 16px"};e.s(["DsButton",0,function({size:e,icon:n,label:i,onTap:o,buttonType:d="button",color:c="active",borderWidth:u=1,borderRadius:m=8,shadowColor:p="transparent",fixedSize:f,padding:h,className:x,style:g,disabled:b,title:y,ariaLabel:v}){let[j,w]=(0,r.useState)(!1);if(!n&&!i)throw Error("DsButton must have either an icon or a label");let N=a[c]??a.active,k=a.disabled,S=b||"button"===d&&!o,{background:C,foreground:_,stroke:P}=S?k:N,E=(0,r.useMemo)(()=>f?{width:f,height:f}:{height:s[e]},[f,e]),T=async()=>{if(!S&&!j&&o)try{w(!0),await o()}finally{w(!1)}};return(0,t.jsx)("button",{type:d,onClick:T,disabled:S||j,title:y,"aria-label":v,className:["inline-flex items-center justify-center gap-2 font-semibold leading-none","small"===e?"text-sm":"text-base","transition-transform duration-150 ease-out","focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-500",S||j?"cursor-not-allowed opacity-80":"cursor-pointer active:translate-y-px",x].filter(Boolean).join(" "),"data-variant":c,"data-size":e,"aria-busy":j,style:{background:C,color:_,border:P?`${u}px solid ${S?k.background:P}`:"none",borderRadius:m,boxShadow:"transparent"===p?void 0:`0 2px 6px ${p}`,padding:f?0:h??l[e],...E,...g},children:j?(0,t.jsx)("span",{className:"h-4 w-4 rounded-full border-[3px] border-current border-t-transparent animate-spin","aria-hidden":!0}):(0,t.jsxs)("span",{className:"inline-flex items-center justify-center gap-2",children:[n?(0,t.jsx)("span",{"aria-hidden":!0,children:n}):null,i?(0,t.jsx)("span",{className:"whitespace-nowrap",children:i}):null]})})}],127890)},678055,e=>{"use strict";var t=e.i(843476),r=e.i(271645);e.s(["DsCarouselSlider",0,function({items:e,itemBuilder:n,onPageChanged:a,aspectRatio:s=16/9,viewportFraction:l=.8,autoPlay:i=!1,autoPlayIntervalMs:o=3e3,infinite:d=!1,className:c,style:u}){let[m,p]=(0,r.useState)(0),f=(0,r.useRef)(null),h=Math.max(1,Math.min(3,Math.round(1/l))),x=(0,r.useMemo)(()=>e.map((e,t)=>({item:e,idx:t})),[e]);(0,r.useEffect)(()=>{if(i&&!(e.length<=1))return f.current=window.setInterval(()=>{p(t=>{let r=t+1;return r>=e.length?d?0:t:r}),a?.((m+1)%e.length,"auto")},o),()=>{null!==f.current&&window.clearInterval(f.current)}},[i,o,e.length,d,a,m]);let g=(e,t)=>{p(e),a?.(e,t)};return(0,t.jsxs)("div",{className:["relative w-full overflow-hidden",c].filter(
2Boolean).join(" "),style:{aspectRatio:s,...u},children:[(0,t.jsx)("div",{className:"flex gap-3 overflow-x-auto pb-2 transition-transform duration-300 ease-out snap-x snap-mandatory [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:{"--viewport-fraction":l},children:x.map(({item:e,idx:r})=>(0,t.jsx)("div",{className:"snap-center transition-transform duration-200 ease-out data-[active=true]:scale-[1.02]","data-active":r===m,style:{flex:`0 0 ${100*l}%`},onClick:()=>g(r,"manual"),children:n(r,e)},r))}),(0,t.jsx)("div",{className:"absolute inset-x-0 bottom-2 flex justify-center gap-1.5",children:x.slice(0,h?void 0:x.length).map(({idx:e})=>(0,t.jsx)("button",{type:"button",className:"h-2.5 w-2.5 rounded-full border-0 bg-black/40 transition-colors data-[active=true]:bg-primary","data-active":e===m,onClick:()=>g(e,"manual"),"aria-label":`Go to slide ${e+1}`},e))})]})}])},890261,e=>{"use strict";var t=e.i(843476);e.s(["DsCheckbox",0,function({text:e,onChanged:r,isSelected:n=!1,isFullWidth:a=!1,isCheckBoxLocatedLeft:s=!0,isSpaceBetween:l=!1,multiLineText:i=!1,hasDivider:o=!1,isDisabled:d=!1,contentPadding:c=0,iconSize:u=24,textPadding:m=8,hasText:p=!0,className:f,style:h}){let x=()=>{d||r(!n)},g=(0,t.jsx)("span",{className:["inline-flex items-center justify-center rounded-lg border",n?"border-primary bg-primary text-white":"border-border bg-transparent text-white",d?"border-border bg-muted/40":null].filter(Boolean).join(" "),"aria-hidden":!0,style:{width:u,height:u},"data-checked":n,"data-disabled":d,children:n?(0,t.jsx)("svg",{viewBox:"0 0 24 24",width:u,height:u,fill:"none",stroke:"currentColor",strokeWidth:"3",children:(0,t.jsx)("polyline",{points:"4 12 10 18 20 6"})}):null}),b=p?(0,t.jsx)("span",{className:"font-sans text-sm text-foreground",children:e}):null,y=(0,t.jsxs)("div",{className:"inline-flex items-center",style:{justifyContent:l?"space-between":"flex-start",gap:m},children:[s?g:b,a||i?(0,t.jsx)("span",{className:"inline-flex flex-1",children:b}):b,s?null:g]});return(0,t.jsxs)("div",{className:["inline-flex flex-col select-none",d?"cursor-not-allowed opacity-70":"cursor-pointer",f].filter(Boolean).join(" "),role:"checkbox","aria-checked":n,tabIndex:0,onClick:x,onKeyDown:e=>{(" "===e.key||"Enter"===e.key)&&(e.preventDefault(),x())},"data-disabled":d,style:{padding:c,...h},children:[y,o?(0,t.jsx)("div",{className:"mt-2 h-px w-full bg-black/40"}):null]})}])},1455,e=>{"use strict";var t=e.i(843476),r=e.i(418883),n=e.i(138995),a=e.i(776553);function s(e){let[t="",r=""]=e.split("T");return{date:t,time:r}}e.s(["DsDateTimePicker",0,function({id:e,label:l,value:i,disabled:o,minDate:d,datePlaceholder:c="Select date",timePlaceholder:u="--:--",dateButtonClassName:m,timeTriggerClassName:p,isTimeDisabled:f,onChange:h}){let{date:x,time:g}=s(i),b=`${e}-date`,y=`${e}-time`;return(0,t.jsxs)("div",{className:"space-y-2",children:[l?(0,t.jsx)(r.Label,{htmlFor:b,children:l}):null,(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsx)(n.DsDatePicker,{id:b,value:x,disabled:o,min:d,placeholder:c,buttonClassName:m??"min-w-[10rem] flex-1",onChange:e=>{var t;(t=e.target.value)?h(`${t}T${g||(0,a.currentLocalTimeValue)()}`):h("")}}),(0,t.jsx)(a.DsTimePicker,{id:y,value:g,disabled:o,placeholder:u,triggerClassName:p,isTimeDisabled:f,onChange:e=>{h(`${x||(0,a.currentLocalDateValue)()}T${e}`)}})]})]})},"splitLocalDateTimeValue",0,s])},131128,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(689664);e.s(["DsDropdown",0,function({items:e,value:a,onChange:s,searchEnabled:l=!0,prefixIcon:i,suffixIcon:o,borderColor:d="hsl(var(--border))",borderRadius:c=8,backgroundColor:u="hsl(var(--card))",labelStyle:m,hintText:p,multi:f=!1,className:h,style:x}){let g=(0,r.useMemo)(()=>f?Array.isArray(a)?a:[]:a,[f,a]);return(0,t.jsxs)("div",{className:["grid gap-1 rounded-lg border bg-card p-2",h].filter(Boolean).join(" "),style:{borderColor:d,borderRadius:c,backgroundColor:u,...x},children:[(0,t.jsxs)("div",{className:"inline-flex items-center gap-2",children:[i?(0,t.jsx)("span",{className:"inline-flex items-center justify-center text-inherit",children:i}):null,(0,t.jsx)("input",{className:"flex-1 border-0 bg-transparent text-sm outline-none placeholder:text-slate-500",placeholder:p,readOnly:!l,"aria-label":"Search options"}),o?(0,t.jsx)("span",{className:"inline-flex items-center justify-center text-inherit",children:o}):null]}),(0,t.jsx)("div",{className:"grid gap-1",children:e.map(e=>{let r=f?g.some(t=>t===e.value):g===e.value;return(0,t.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between rounded-md border border-border bg-muted/30 px-3 py-2 text-sm transition-colors data-[selected=true]:border-primary data-[selected=true]:bg-primary/10 data-[selected=true]:text-primary disabled:cursor-not-allowed disabled:opacity-60","data-selected":r,disabled:e.disabled,onClick:()=>(e=>{if(f){let t=Array.isArray(g)?g:[];s(t.some(t=>t===e)?t.filter(t=>t!==e):[...t,e])}else s(e)})(e.value),children:[(0,t.jsx)("span",{style:m,children:e.label}),r?(0,t.jsx)(n.Check,{className:"h-4 w-4 text-primary","aria-hidden":!0}):null]},String(e.value))})})]})}])},210572,e=>{"use strict";var t=e.i(843476);let r=(0,e.i(271645).forwardRef)(function({label:e,helperText:r,error:n,containerClassName:a,labelClassName:s,inputClassName:l,helperTextClassName:i,errorClassName:o,id:d,readOnly:c,...u},m){let p=d??u.name,f=r&&p?`${p}-helper`:void 0,h=n&&p?`${p}
2-error`:void 0,x=[f,h].filter(Boolean).join(" ")||void 0;return(0,t.jsxs)("div",{className:a,children:[e?(0,t.jsx)("label",{className:s??"text-sm font-semibold text-foreground",htmlFor:p,children:e}):null,(0,t.jsx)("input",{...u,id:p,ref:m,readOnly:c,"aria-invalid":!!n||void 0,"aria-describedby":x,className:["w-full rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground outline-none transition focus:border-primary focus:ring-2 focus:ring-primary/20 disabled:bg-muted/30 disabled:text-muted-foreground",c?"bg-muted/30 text-muted-foreground":"",l].filter(Boolean).join(" ")}),r?(0,t.jsx)("p",{id:f,className:i??"text-xs text-muted-foreground",children:r}):null,n?(0,t.jsx)("p",{id:h,className:o??"text-xs text-destructive",role:"alert",children:n}):null]})});e.s(["DsInput",0,r])},134047,e=>{"use strict";var t=e.i(843476);e.i(986823);var r=e.i(113827),n=e.i(749505);let a=(e,t,r)=>Math.min(Math.max(e,t),r);e.s(["DsPagination",0,function({page:e,pageSize:s,totalCount:l,onPageChange:i,className:o,disabled:d}){let c=Math.max(1,e),u=Math.max(0,l??0),m=Math.max(1,s?Math.ceil(u/s):1),p=function(e,t,r=1){if(t<=7)return Array.from({length:t},(e,t)=>t+1);let n=[1],s=a(e-r,2,t-1),l=a(e+r,2,t-1);s>2&&n.push("ellipsis");for(let e=s;e<=l;e+=1)n.push(e);return l<t-1&&n.push("ellipsis"),n.push(t),n}(c,m),f=c>1,h=c<m,x="pointer-events-none opacity-50",g=e=>t=>{t.preventDefault(),d||i(e)};return(0,t.jsx)(n.Pagination,{className:(0,r.cn)("justify-end",o),children:(0,t.jsxs)(n.PaginationContent,{children:[(0,t.jsx)(n.PaginationItem,{children:(0,t.jsx)(n.PaginationPrevious,{href:"#",onClick:g(c-1),className:(0,r.cn)(!f||d?x:"")})}),p.map((e,a)=>"ellipsis"===e?(0,t.jsx)(n.PaginationItem,{children:(0,t.jsx)(n.PaginationEllipsis,{})},`ellipsis-${a}`):(0,t.jsx)(n.PaginationItem,{children:(0,t.jsx)(n.PaginationLink,{href:"#",onClick:g(e),isActive:e===c,className:(0,r.cn)(d?x:""),children:e})},e)),(0,t.jsx)(n.PaginationItem,{children:(0,t.jsx)(n.PaginationNext,{href:"#",onClick:g(c+1),className:(0,r.cn)(!h||d?x:"")})})]})})}])},708789,e=>{"use strict";var t=e.i(843476);e.s(["DsRadio",0,function({text:e,onChanged:r,value:n,groupValue:a,widget:s,hasBorder:l=!0,isFullWidth:i=!1,textStyle:o,isTextOnRight:d=!0,className:c,style:u}){let m=n===a,p=()=>{m||r(n)},f=(0,t.jsx)("span",{className:["inline-flex h-6 w-6 items-center justify-center rounded-full border",m?"border-primary":"border-border"].join(" "),"aria-hidden":!0,children:m?(0,t.jsx)("span",{className:"h-3.5 w-3.5 rounded-full bg-primary"}):null}),h=(0,t.jsx)("span",{className:"font-sans text-sm text-foreground",style:o,children:s??e});return(0,t.jsxs)("div",{className:["inline-flex items-center gap-2 rounded-2xl p-2","cursor-pointer select-none",c].filter(Boolean).join(" "),role:"radio",tabIndex:0,"aria-checked":m,onClick:p,onKeyDown:e=>{(" "===e.key||"Enter"===e.key)&&(e.preventDefault(),p())},style:{border:l?`0.5px solid ${m?"hsl(var(--primary))":"hsl(var(--border))"}`:void 0,...u},children:[d?f:h,i?(0,t.jsx)("span",{className:"flex-1"}):(0,t.jsx)("span",{className:"w-2"}),d?h:f]})}])},168299,e=>{"use strict";var t=e.i(843476);let r=(0,e.i(271645).forwardRef)(function({label:e,helperText:r,error:n,containerClassName:a,labelClassName:s,selectClassName:l,helperTextClassName:i,errorClassName:o,id:d,...c},u){let m=d??c.name,p=r&&m?`${m}-helper`:void 0,f=n&&m?`${m}-error`:void 0,h=[p,f].filter(Boolean).join(" ")||void 0;return(0,t.jsxs)("div",{className:a,children:[e?(0,t.jsx)("label",{className:s??"text-sm font-semibold text-foreground",htmlFor:m,children:e}):null,(0,t.jsx)("select",{...c,id:m,ref:u,"aria-invalid":!!n||void 0,"aria-describedby":h,className:["w-full rounded-lg border border-border bg-card px-3 py-2 text-sm text-foreground outline-none transition focus:border-primary focus:ring-2 focus:ring-primary/20 disabled:bg-muted/30 disabled:text-muted-foreground",l].filter(
2Boolean).join(" ")}),r?(0,t.jsx)("p",{id:p,className:i??"text-xs text-muted-foreground",children:r}):null,n?(0,t.jsx)("p",{id:f,className:o??"text-xs text-destructive",role:"alert",children:n}):null]})});e.s(["DsSelect",0,r])},129519,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(890261);let a={enabledColor:"hsl(var(--primary))",disabledColor:"hsl(var(--foreground) / 0.4)",iconSize:32,enabledTitleStyle:{fontWeight:700,fontSize:16,color:"hsl(var(--foreground))"},enabledSubTitleStyle:{fontWeight:400,fontSize:12,color:"hsl(var(--foreground) / 0.6)"},disabledTitleStyle:{fontWeight:700,fontSize:16,color:"hsl(var(--foreground) / 0.4)"},disabledSubTitleStyle:{fontWeight:400,fontSize:12,color:"hsl(var(--foreground) / 0.4)"},insidePadding:16,outsidePadding:16,buttonType:"switchButton",height:72,borderWidth:0,borderColor:"hsl(var(--foreground) / 0.6)",backgroundColor:"hsl(var(--card))"};e.s(["DsSwitch",0,function({icon:e,title:s,subtitle:l,infoText:i,enabled:o,checkBoxGroup:d=!1,onChanged:c,theme:u,buttonType:m,isSwitchLocatedLeft:p=!1,isDisabled:f=!1,className:h,style:x}){let[g,b]=(0,r.useState)(o),y={...a,...u??{},buttonType:m??u?.buttonType??a.buttonType};(0,r.useEffect)(()=>{d&&o!==g&&b(o)},[d,o,g]);let v=e=>{if(f)return;let t="boolean"==typeof e?e:!g;b(t),c?.(t)},j="switchButton"===y.buttonType?(0,t.jsxs)("label",{className:"relative inline-flex items-center",onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("input",{type:"checkbox",checked:g,onChange:e=>{e.stopPropagation(),v(e.target.checked)},disabled:f,className:"sr-only"}),(0,t.jsx)("span",{className:"inline-flex h-7 w-12 items-center rounded-full px-1 transition-colors",style:{backgroundColor:g?y.enabledColor:y.disabledColor},children:(0,t.jsx)("span",{className:`h-5 w-5 rounded-full bg-card transition-transform ${g?"translate-x-5":""}`})})]}):(0,t.jsx)("div",{onClick:e=>e.stopPropagation(),children:(0,t.jsx)(n.DsCheckbox,{text:"",isSelected:g,onChanged:()=>v(),isDisabled:f})});return(0,t.jsx)("div",{className:["flex items-center rounded-2xl",f?"cursor-not-allowed opacity-70":"cursor-pointer",h].filter(Boolean).join(" "),style:{minHeight:y.height,border:y.borderWidth>0?`${y.borderWidth}px solid ${y.borderColor}`:void 0,backgroundColor:y.backgroundColor,padding:`${y.insidePadding}px`,...x},onClick:()=>v(),role:"switch","aria-checked":g,"aria-disabled":f,children:(0,t.jsxs)("div",{className:"flex w-full items-center gap-3",children:[p?j:null,(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-1",children:[s?(0,t.jsxs)("div",{style:g?y.enabledTitleStyle:y.disabledTitleStyle,className:"inline-flex items-center gap-1.5",children:[s,i?(0,t.jsx)("span",{className:"text-xs text-primary",children:i}):null]}):null,l?(0,t.jsx)("div",{style:g?y.enabledSubTitleStyle:y.disabledSubTitleStyle,children:l}):null]}),e?(0,t.jsx)("div",{className:"inline-flex items-center justify-center",style:{width:y.iconSize,height:y.iconSize,color:g?y.enabledColor:y.disabledColor},children:e}):null,p?null:j]})})}])},782551,864256,e=>{"use strict";var t=e.i(843476),r=e.i(952789);e.i(924856);let n={titleBold:{fontSize:24,lineHeight:26,letterSpacing:0,fontWeight:700},title:{fontSize:24,lineHeight:26,letterSpacing:0,fontWeight:400},bodyBig:{fontSize:18,lineHeight:24,letterSpacing:0,fontWeight:400},bodyBigBold:{fontSize:18,lineHeight:24,letterSpacing:0,fontWeight:700},bodyMedium:{fontSize:16,lineHeight:20,letterSpacing:0,fontWeight:400},bodyMediumBold:{fontSize:16,lineHeight:20,letterSpacing:0,fontWeight:700},button:{fontSize:14,lineHeight:16,letterSpacing:0,fontWeight:700},bodyText:{fontSize:14,lineHeight:16,letterSpacing:0,fontWeight:400},bodyBoldText:{fontSize:14,lineHeight:16,letterSpacing:0,fontWeight:700},labelBold:{fontSize:12,lineHeight:16,letterSpacing:0,fontWeight:700},label:{fontSize:12,lineHeight:16,letterSpacing:0,fontWeight:400},widgetTitle:{fontSize:16,lineHeight:20,letterSpacing:0,fontWeight:700},headline:{fontSize:48,lineHeight:60,letterSpacing:0,fontWeight:500},eyebrow:{fontSize:12,lineHeight:14,letterSpacing:.08,fontWeight:700}},a="primaryThemed";e.s(["defaultTextColor",0,a],864256),e.s(["DsText",0,function({text:e,variant:s,color:l,customTextColor:i,maxLines:o,softWrap:d,textAlign:c,textDecoration:u,overflow:m="fade",selectable:p=!1,forceLineHeight:f=!1,className:h,style:x}){let g=n[s],b=i??r.dsTextColors[l??a],y=o&&o>0,v=["inline font-sans"];return h&&v.push(h),p&&v.push("select-text"),y&&v.push("overflow-hidden"),"fade"===m&&v.push("overflow-hidden"),!1===d&&v.push("whitespace-nowrap"),(0,t.jsx)("span",{className:v.join(" "),"data-variant":s,style:{color:b,fontSize:`${g.fontSize}px`,lineHeight:f?`${g.lineHeight}px`:void 0,letterSpacing:`${g.letterSpacing}px`,fontWeight:g.fontWeight,textAlign:c,textDecoration:u,overflow:y?"hidden":void 0,textOverflow:y?"ellipsis"===m?"ellipsis":"clip":void 0,...y?{WebkitLineClamp:o,WebkitBoxOrient:"vertical",display:"-webkit-box"}:{},..."fade"===m?{WebkitMaskImage:"linear-gradient(90deg, rgba(0, 0, 0, 1) 70%, transparent)",maskImage:"linear-gradient(90deg, rgba(0, 0, 0, 1) 70%, transparent)"}:{},...x},children:e})}],782551)},39456,e=>{"use strict";var t=e.i(843476),r=e.i(271645);e.s(["FilterChip",0,function({label:e,summary:n,isActive:a=!1,badgeContent:s,align:l="left",onClear:i,onOpenChange:o,children:d,className:c,popoverClassName:u}){let[m,p]=(0,r.useState)(!1),f=(0,r.useRef)(null),h=(0,r.useRef)(void 0);(0,r.useEffect)(()=>{h.current=o},[o]),(0,r.useEffect)(()=>{h.current?.(m)},[m]),(0,r.useEffect)(()=>{let e=e=>{m&&f.current&&!f.current.contains(e.target)&&p(!1)},t=e=>{"Escape"===e.key&&p(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[m]);let x="number"==typeof s&&s>0;
2return(0,t.jsxs)("div",{ref:f,className:["relative",c].filter(Boolean).join(" "),children:[(0,t.jsxs)("button",{type:"button",className:["inline-flex min-h-[40px] items-center gap-2 rounded-full border px-3 py-2 text-sm font-semibold transition",a?"border-primary bg-primary/10 text-foreground shadow-[0_4px_10px_rgba(1,131,129,0.12)]":"border-border bg-card text-foreground hover:border-border"].join(" "),"aria-haspopup":"dialog","aria-expanded":m,onClick:()=>p(e=>!e),children:[(0,t.jsx)("span",{className:"whitespace-nowrap",children:e}),x?(0,t.jsx)("span",{className:"ml-1 inline-flex items-center justify-center rounded-full bg-primary px-2 py-0.5 text-xs font-bold text-white",children:s}):null,n?(0,t.jsx)("span",{className:"max-w-[160px] truncate text-xs font-semibold text-primary",children:n}):null,a&&i?(0,t.jsx)("span",{role:"button","aria-label":`Clear ${e} filter`,tabIndex:0,className:"ml-1 inline-flex h-5 w-5 items-center justify-center rounded-full text-base leading-none text-muted-foreground transition hover:bg-white/70",onClick:e=>{e.stopPropagation(),i()},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),e.stopPropagation(),i())},children:"Ã"}):null]}),m?(0,t.jsx)("div",{className:["absolute z-30 mt-2 w-[320px] max-w-[calc(100vw-2rem)] rounded-2xl border border-border bg-card p-3 shadow-[0_12px_30px_rgba(13,20,28,0.12)]","right"===l?"right-0":"left-0",u].filter(Boolean).join(" "),role:"dialog",children:d({close:()=>p(!1)})}):null]})}])},419739,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(522016),a=e.i(127890),s=e.i(210572);e.s(["InsurancePolicyCard",0,function({title:e,status:l,detailItems:i,documentUrl:o,processingNotice:d,upcomingNotice:c,onUpload:u,isUploading:m=!1,uploadError:p,className:f}){let h=(0,r.useId)(),x=(0,r.useRef)(null),[g,b]=(0,r.useState)(null);return(0,t.jsxs)("div",{className:["rounded-2xl border border-border bg-card p-4 shadow-sm",f].filter(Boolean).join(" "),children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-base font-semibold text-foreground",children:e}),(0,t.jsxs)("p",{className:`mt-1 text-sm font-semibold ${l.tone}`,children:["Status: ",l.status]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:l.detail})]}),o?(0,t.jsx)(n.default,{className:"text-xs font-semibold text-primary underline-offset-2 hover:underline",href:o,target:"_blank",rel:"noreferrer",children:"View document"}):null]}),d?(0,t.jsx)("div",{className:"mt-3 rounded-lg border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:d}):null,c?(0,t.jsx)("div",{className:"mt-2 rounded-lg border border-border bg-muted/30 px-3 py-2 text-xs text-[hsl(var(--secondary))]",children:c}):null,(0,t.jsx)("div",{className:"mt-3 grid gap-2 sm:grid-cols-2",children:i.map(e=>(0,t.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 px-3 py-2",children:[(0,t.jsx)("div",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:e.label}),(0,t.jsx)("div",{className:"text-sm font-semibold text-foreground",children:e.value})]},e.label))}),u?(0,t.jsxs)("div",{className:"mt-4 grid gap-3",children:[(0,t.jsx)(s.DsInput,{id:`${h}-file`,ref:x,type:"file",accept:"application/pdf,image/*",label:"Upload policy file",onChange:e=>{b(e.target.files?.[0]??null)},disabled:m}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsx)(a.DsButton,{size:"small",label:m?"Uploadingâ¦":"Upload",onTap:()=>{g&&(u?.(g),b(null),x.current&&(x.current.value=""))},disabled:m||!g}),p?(0,t.jsx)("span",{className:"text-xs text-destructive",children:p}):null]})]}):null]})}])},267486,e=>{"use strict";var t=e.i(843476),r=e.i(271645);e.i(986823);var n=e.i(113827);e.s(["MapSplitShell",0,function({map:e,controls:a,panelSummary:s,panelContent:l,panelToolbar:i,closedSummary:o,panelFooter:d,defaultPanelState:c="open",mapHeights:u,sectionClassName:m,mapClassName:p,panelClassName:f,openPanelClassName:h,expandedPanelClassName:x,closedPanelClassName:g}){let b=(0,r.useRef)(null),y=(0,r.useRef)(null),[v,j]=(0,r.useState)(c),[w,N]=(0,r.useState)(!1),[k,S]=(0,r.useState)(0),[C,_]=(0,r.useState)({top:64,left:0,right:0}),[P,E]=(0,r.useState)(!1),[T,M]=(0,r.useState)(null),D=(0,r.useRef)(null),B=(0,r.useRef)(!1),I=(0,r.useMemo)(()=>({open:P?u?.desktopOpen??u?.open??48:u?.open??44,expanded:P?u?.desktopExpanded??u?.expanded??36:u?.expanded??36,closed:P?u?.desktopClosed??u?.closed??82:u?.closed??78}),[P,u]);(0,r.useEffect)(()=>{let e=window.matchMedia("(min-width: 1024px)"),t=()=>E(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),(0,r.useEffect)(()=>{let e=document.querySelector("main");if(!e)return;let t=()=>{S(Math.max(e.offsetWidth-e.clientWidth,0))};t();let r=new ResizeObserver(t);return r.observe(e),window.addEventListener("resize",t),()=>{r.disconnect(),window.removeEventListener("resize",t)}},[]),(0,r.useEffect)(()=>
2{if(!P){let e=window.setTimeout(()=>{_({top:0,left:0,right:0})},0);return()=>window.clearTimeout(e)}let e=null,t=null,r=null,n=[],a=()=>{let e=document.getElementById("navbar");if(!e)return;let t=e.getBoundingClientRect();_({top:Math.max(t.bottom,0),left:Math.max(t.left,0),right:Math.max(window.innerWidth-t.right,0)})},s=0,l=()=>{let r=document.getElementById("navbar");if(!r){s<30&&(s+=1,t=window.requestAnimationFrame(l));return}a(),(e=new ResizeObserver(a)).observe(r)};l(),window.addEventListener("resize",a),window.addEventListener("scroll",a,!0);let i=e=>{("transform"===e.propertyName||"height"===e.propertyName||"opacity"===e.propertyName)&&a()};return window.addEventListener("transitionend",i,!0),r=window.requestAnimationFrame(()=>{window.requestAnimationFrame(a)}),n.push(window.setTimeout(a,120)),n.push(window.setTimeout(a,320)),n.push(window.setTimeout(a,520)),()=>{null!==t&&window.cancelAnimationFrame(t),null!==r&&window.cancelAnimationFrame(r),n.forEach(e=>window.clearTimeout(e)),e?.disconnect(),window.removeEventListener("resize",a),window.removeEventListener("scroll",a,!0),window.removeEventListener("transitionend",i,!0)}},[P]),(0,r.useEffect)(()=>{let e=document.querySelector("main");if(!e)return;let t=()=>{if(!b.current||!y.current)return;let e=b.current.getBoundingClientRect(),t=y.current.getBoundingClientRect().top<=e.bottom+1;N(e=>e===t?e:t)};t();let r=0,n=()=>{r||(r=window.requestAnimationFrame(()=>{r=0,t()}))};return e.addEventListener("scroll",n,{passive:!0}),()=>{r&&window.cancelAnimationFrame(r),e.removeEventListener("scroll",n)}},[]),(0,r.useEffect)(()=>{let e=document.querySelector("main");if(!e)return;let t=e instanceof HTMLElement?e.style.overflowY:"",r=e instanceof HTMLElement?e.style.overscrollBehavior:"";return"closed"===v&&e instanceof HTMLElement&&(e.style.overflowY="hidden",e.style.overscrollBehavior="none"),()=>{e instanceof HTMLElement&&(e.style.overflowY=t,e.style.overscrollBehavior=r)}},[v]);let O=e=>"closed"===e?I.closed:"expanded"===e?I.expanded:I.open,A=e=>{let t=["expanded","open","closed"],r=t.indexOf(v),n="up"===e?Math.max(0,r-1):Math.min(t.length-1,r+1);j(t[n]),M(null),D.current=null},L=()=>{j("closed"===v?"expanded":"closed"),M(null),D.current=null},$="closed"===v?g:"expanded"===v?x:h;return(0,t.jsxs)("section",{className:(0,n.cn)("relative min-h-screen bg-background",m),children:[(0,t.jsx)("div",{className:(0,n.cn)("sticky top-0 z-0 transition-[height] duration-300",p,null!==T&&"duration-0"),style:{height:`${T??O(v)}vh`},children:e}),(0,t.jsxs)("div",{className:"relative z-10 min-h-screen pointer-events-none",children:[(0,t.jsx)("div",{ref:b,className:(0,n.cn)("fixed z-20 px-4 pt-3 pb-3 pointer-events-auto",w?"bg-background/95 backdrop-blur border-b border-border shadow-[0_6px_18px_rgba(15,23,42,0.06)]":"bg-transparent"),style:{top:P?`${C.top}px`:"var(--impersonation-banner-offset, 0px)",left:P?`${C.left}px`:0,right:P?`${C.right+k}px`:`${k}px`},children:a}),(0,t.jsxs)("div",{ref:y,className:(0,n.cn)("relative z-10 -mt-4 rounded-t-3xl bg-background shadow-[0_-4px_20px_rgba(0,0,0,0.08)] pointer-events-auto transition-all duration-300 overflow-x-hidden",null!==T&&"duration-0","closed"===v?"min-h-0":"min-h-[32vh] md:min-h-screen",f,$),children:[(0,t.jsxs)("div",{className:"flex w-full items-center justify-center rounded-t-3xl px-4 pt-3 pb-2",onPointerDown:e=>{if("mouse"===e.pointerType&&0!==e.button)return;let t=e.clientY,r=T??O(v);D.current=r,B.current=!1;let n=document.body.style.userSelect;document.body.style.userSelect="none";let a=e=>{let n,a=e.clientY-t;Math.abs(a)>4&&(B.current=!0);let s=(n=r+a/Math.max(window.innerHeight,1)*100,Math.min(I.closed,Math.max(I.expanded,n)));D.current=s,M(s)},s=()=>{var e;let t;document.body.style.userSelect=n,window.removeEventListener("pointermove",a),window.removeEventListener("pointerup",s),e=D.current??r,j((t=[{state:"expanded",height:I.expanded},{state:"open",height:I.open},{state:"closed",height:I.closed}]).reduce((t,r)=>t?Math.abs(r.height-e)<Math.abs(t.height-e)?r:t:r,t[0]).state),M(null),D.current=null};window.addEventListener("pointermove",a),window.addEventListener("pointerup",s)},onClick:()=>
2{if(B.current){B.current=!1;return}L()},style:{touchAction:"none"},role:"separator","aria-orientation":"horizontal","aria-label":"Resize results panel",tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),L()),"ArrowUp"===e.key&&(e.preventDefault(),A("up")),"ArrowDown"===e.key&&(e.preventDefault(),A("down"))},children:[(0,t.jsx)("div",{className:"h-1 w-10 rounded-full bg-muted-foreground/30"}),"closed"===v&&o?(0,t.jsx)("span",{className:"sr-only",children:o}):null]}),"closed"===v?(0,t.jsx)("div",{className:"pb-2"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3 px-4 py-2",children:[(0,t.jsx)("div",{className:"min-w-0 flex-1",children:s}),i?(0,t.jsx)("div",{className:"flex flex-wrap items-center justify-end gap-2",children:i}):null]}),l,d]})]})]})]})}])},649999,282282,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(716327),a=e.i(632781),s=e.i(96315),l=e.i(515281),i=e.i(575387),o=e.i(197589),d=e.i(756202);let c=({user:e,phone:t})=>{var r;return{id:e.id,user_group_id:(r=e.user_group)?"string"==typeof r?r:"object"==typeof r&&"id"in r?r.id??null:null:null,user_id:e.user_id??null,phone:t,phone_revealed:e.phone_revealed,phone_revealed_on:e.phone_revealed_on??null,email:e.email,push_id:e.push_id??null,date_joined:e.date_joined,first_name:e.first_name??null,last_name:e.last_name??null,username:e.username??null,photo_url:e.photo_url??null,is_onboarded:e.is_onboarded,is_admin:e.is_admin,is_archived:e.is_archived,is_active:e.is_active,source:e.source,terms_accepted:e.terms_accepted??null,last_active:e.last_active??null,timezone:e.timezone??null,role_id:(e=>{if(e){if("string"==typeof e)return e;if("object"==typeof e&&"id"in e)return e.id}})(e.role),send_new_invoice_emails:e.send_new_invoice_emails}};e.s(["buildUserWriteRequest",0,c],282282);var u=e.i(268531),m=e.i(499971),p=e.i(78135),f=e.i(594249),h=e.i(478736);e.i(556651);var x=e.i(856128);let g=(e,t)=>((e?.trim()?.[0]??"")+(t?.trim()?.[0]??"")).toUpperCase()||"?",b=e=>[e.first_name,e.last_name].filter(Boolean).join(" ").trim()||e.email||"Unknown contact";e.s(["OnSiteContactDrawer",0,function({open:e,onOpenChange:n,value:y,contacts:v,onChange:j,currentUserId:w,isLoading:N=!1,onContactPhoneUpdated:k,enablePhoneEdit:S=!0}){let{permissions:C}=(0,x.useSupplierPermissions)(),{toast:_}=(0,d.useToast)(),[P,E]=(0,r.useState)(null),[T,M]=(0,r.useState)(""),[D,B]=(0,r.useState)(null),I=(0,o.useApiV1UsersUpdate)(),O=S&&C.canManageUsers,A=v.filter(e=>!!e.id),L=(0,r.useMemo)(()=>A.find(e=>e.id===P)??null,[A,P]),$=()=>{E(null),M(""),B(null)},R=async()=>{if(!L?.id)return;let e=T.trim(),t=e.length>0?e:null;if(t===(L.phone?.trim()||null))return void $();try{await I.mutateAsync({userId:L.id,data:c({user:L,phone:t})}),await k?.(L.id),_({title:"Phone number updated",description:"Contact phone number was updated successfully."}),$()}catch(e){console.error("Unable to update contact phone",e),B("Unable to update phone number. Please try again."),_({title:"Could not update phone number",description:"Please try again.",variant:"destructive"})}};return(0,t.jsx)(u.ResponsiveModal,{open:e,onOpenChange:n,title:"Select On-Site Contact",description:"Choose a contact who will be present on-site.",dialogContentProps:{className:"max-w-lg max-h-[90vh] flex flex-col p-0 overflow-hidden"},dialogHeaderProps:{className:"px-4 pt-4 text-left"},drawerContentProps:{className:"max-h-[90vh] flex flex-col p-0 overflow-hidden"},drawerHeaderProps:{className:"px-4 pt-4 text-left"},children:(0,t.jsx)("div",{className:"min-w-0 flex-1 overflow-x-hidden overflow-y-auto px-4 py-4 max-h-[60vh]",children:N?(0,t.jsx)("p",{className:"py-4 text-center text-sm text-muted-foreground",children:"Loading contacts..."}):0===A.length?(0,t.jsx)("p",{className:"py-4 text-center text-sm text-muted-foreground",children:"No contacts available for this account."}):(0,t.jsx)(f.RadioGroup,{value:y??"",onValueChange:e=>{j(e||null),n(!1)},className:"min-w-0 space-y-2",children:A.map(e=>{let r=e.id??"",n=w&&e.id===w,o=y===r,d=!e.phone?.trim(),c=P===r;return(0,t.jsxs)("div",{className:["min-w-0 overflow-hidden rounded-lg border p-3 transition-colors",o?"border-primary bg-primary/5":"border-border bg-card",d?"cursor-not-allowed opacity-60":"cursor-pointer"].join(" "),children:[(0,t.jsxs)("div",{className:"flex min-w-0 items-start gap-2",children:[(0,t.jsx)(f.RadioGroupItem,{value:r,id:r,disabled:d,className:"mt-1 shrink-0"}),(0,t.jsxs)("label",{htmlFor:r,className:"flex w-0 min-w-0 flex-1 cursor-pointer items-start gap-2 overflow-hidden",children:[(0,t.jsxs)(h.Avatar,{className:"h-10 w-10 shrink-0",children:[(0,t.jsx)(h.AvatarImage,{src:void 0}),(0,t.jsx)(h.AvatarFallback,{className:"bg-primary/10 text-primary",children:g(e.first_name,e.last_name)})]}),(0,t.jsxs)("div",{className:"w-0 min-w-0 flex-1 overflow-hidden",children:[(0,t.jsxs)("p",{className:"truncate text-sm font-medium text-foreground",children:[b(e)," ",n?"(You)":""]}),e.email?(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-1 text-sm text-muted-foreground",children:[(0,t.jsx)(s.Mail,{className:"h-3 w-3 shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:e.email})]}):null,c?null:e.phone?(0,t.jsxs)("p",{className:"flex min-w-0 items-center gap-1 text-sm text-muted-foreground",children:[(0,t.jsx)(i.Phone,{className:"h-3 w-3 shrink-0","aria-hidden":!0}),(0,t.jsx)("span",{className:"min-w-0 truncate",children:e.phone})]}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Phone required to select"})]})]}),O?(0,t.jsxs)(m.Button,{type:"button",variant:"ghost",className:"h-8 w-8 shrink-0 px-0","aria-label":`Edit phone for ${b(e)}`,title:"Edit phone",onClick:e=>{let t;e.preventDefault(),e.stopPropagation(),(t=A.find(e=>e.id===r))&&(E(r),M(t.phone??""),B(null))},children:[(0,t.jsx)(l.Pencil,{className:"h-3.5 w-3.5","aria-hidden":!0}),(0,t.jsx)("span",{className:"sr-only",children:"Edit phone"})]}):null]}),O&&c?(0,t.jsxs)("form",{className:"mt-3 min-w-0 space-y-2 pl-7 sm:pl-8",onSubmit:e=>{e.preventDefault(),R()},children:[(0,t.jsx)(p.Input,{value:T,onChange:e=>{M(e.target.value),D&&B(null)},placeholder:"Enter phone number",className:"h-9",disabled:I.isPending}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(m.Button,{type:"submit",size:"sm",className:"h-8",disabled:I.isPending,children:I.isPending?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.Loader2,{className:"mr-1 h-3.5 w-3.5 animate-spin","aria-hidden":!0}),"Saving..."]}):"Save"}),(0,t.jsx)(m.Button,{type:"button",size:"sm",variant:"outline",className:"h-8",disabled:I.isPending,onClick:e=>{e.preventDefault(),$()},children:"Cancel"})]}),D?(0,t.jsx)("p",{className:"text-xs text-destructive",children:D}):null]}):null]},r)})})})})},"OnSiteContactTrigger",0,function({selectedContact:e,currentUserId:r,onClick:a,disabled:s=!1,isLoading:l=!1}){let i=r&&e?.id===r;return(0,t.jsxs)("button",{type:"button",onClick:a,disabled:s||l,className:"flex min-w-0 max-w-full w-full items-center gap-3 overflow-hidden rounded-lg border border-border bg-card p-3 text-left transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50",children:[(0,t.jsxs)(h.Avatar,{className:"h-10 w-10 shrink-0",children:[(0,t.jsx)(h.AvatarImage,{src:void 0}),(0,t.jsx)(h.AvatarFallback,{className:"bg-primary/10 text-primary",children:e?g(e.first_name,e.last_name):"?"})]}),(0,t.jsx)("div",{className:"min-w-0 flex-1",children:l?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading contacts..."}):e?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"truncate font-medium text-foreground",children:[b(e)," ",i?"(You)":""]}),(0,t.jsx)("p",{className:"truncate text-sm text-muted-foreground",children:e.phone||e.email||"No contact info"})]}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Select on-site contact"})}),(0,t.jsx)(n.ChevronDown,{className:"h-5 w-5 shrink-0 text-muted-foreground","aria-hidden":!0})]})}],649999)},184158,e=>{"use strict";var t=e.i(843476),r=e.i(522016),n=e.i(618566),a=e.i(24071);e.s(["PageHeader",0,function({title:e,backHref:s,backBehavior:l="href",rightSlot:i}){let o=(0,n.useRouter)();return(0,t.jsxs)("div",{className:"sticky top-0 z-20 flex items-center justify-between border-b border-border bg-background px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[s?"href"===l?(0,t.jsx)(r.default,{href:s,className:"p-2 -ml-2 roun
2ded-full hover:bg-muted active:bg-muted/80 transition-colors","aria-label":"Back",children:(0,t.jsx)(a.ChevronLeft,{className:"h-6 w-6 text-foreground"})}):(0,t.jsx)("button",{type:"button",onClick:()=>{if("history-or-href"!==l){s&&o.push(s);return}{let e=document.referrer;if(e&&e.startsWith(window.location.origin)&&window.history.length>1)return void o.back()}s&&o.push(s)},className:"p-2 -ml-2 rounded-full hover:bg-muted active:bg-muted/80 transition-colors","aria-label":"Back",children:(0,t.jsx)(a.ChevronLeft,{className:"h-6 w-6 text-foreground"})}):null,(0,t.jsx)("h1",{className:"text-lg font-semibold text-foreground",children:e})]}),i?(0,t.jsx)("div",{className:"flex items-center gap-2",children:i}):null]})}])},209126,475907,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(618566),a=e.i(667668),s=e.i(912598),l=e.i(197589),i=e.i(582629);async function o(e){return(0,l.apiV1PaymentMethodsDetachOneTimeCreate)({stripe_payment_method_id:e})}async function d(e){if(e)try{await o(e)}catch{}}e.s(["cleanupOneTimePaymentMethod",0,d],475907);var c=e.i(253204),u=e.i(650782);e.i(398106);var m=e.i(429634),p=e.i(641881),f=e.i(893019),h=e.i(756202),x=e.i(371561);e.i(298820);var g=e.i(130691);e.i(126844);var b=e.i(437567),y=e.i(499971),v=e.i(308574),j=e.i(870387),w=e.i(226091),N=e.i(632781),k=e.i(77071),S=e.i(328623),C=e.i(786563),_=e.i(573474),P=e.i(882303),E=e.i(268531);e.i(467541);var T=e.i(55448);let M=(e,t)=>(0,g.getApiErrorMessage)(e,t),D=(e,t)=>{let r=window.getComputedStyle(document.documentElement).getPropertyValue(e).trim();if(!r)return t;let n=document.createElement("span");n.style.color=`hsl(${r})`,n.style.position="absolute",n.style.pointerEvents="none",n.style.opacity="0",document.body.appendChild(n);let a=window.getComputedStyle(n).color;return n.remove(),a||t},B=()=>({base:{fontSize:"16px",color:D("--foreground","#f3f6f8"),"::placeholder":{color:D("--muted-foreground","#9ca3af")},iconColor:D("--primary","#22c1c3")},invalid:{color:D("--destructive","#f87171"),iconColor:D("--destructive","#f87171")}}),I=e=>{let t=e.data;return t&&"object"==typeof t?{last4:"string"==typeof t.last4?t.last4:null,bankName:"string"==typeof t.bank_name?t.bank_name:null}:{last4:null,bankName:null}},O=e=>{if(!e)return null;let t=e.replace(/\D/g,"");return t?t.slice(-4):null},A=e=>{let{last4:t,bankName:r}=I(e);if("us_bank_account"===e.type){let e=r?`${r} \u00b7 `:"",n=t?`XXXX-${t}`:"XXXX";return`${e}${n}`}let n=e.card?.brand?e.card.brand.toUpperCase():"CARD",a=O(e.card?.number)??t;if("card"===e.type){let e=a?`XXXX-${a}`:"XXXX";return`${n} ${e}`}return e.type??"Payment method"},L=e=>{let t="us_bank_account"===e.type?"bank":"card"===e.type?"card":null;if(!t)return null;let{last4:r,bankName:n}=I(e),a=O(e.card?.number)??r??"0000";return{id:e.id,type:t,last4:a,brand:e.card?.brand??void 0,bankName:"bank"===t?n??"Bank Account":void 0}},$=e=>"bank"===e.type?`${e.bankName??"Bank Account"} \u2022\u2022\u2022\u2022 ${e.last4}`:"card"===e.type?`${(e.brand??"card").toUpperCase()} \u2022\u2022\u2022\u2022 ${e.last4}`:"Pay on Net Terms",R=e=>[...e.filter(e=>e.isDefault),...e.filter(e=>!e.isDefault)],z=({clientSecret:e,allowOneTimeUse:n,onSaved:s,onUseOnce:l,onError:i})=>{let o=(0,a.useStripe)(),d=(0,a.useElements)(),[c,u]=(0,r.useState)(!1),[m,p]=(0,r.useState)(B),[f,h]=(0,r.useState)(!1);(0,r.useEffect)(()=>{p(B());let e=new MutationObserver(()=>{p(B())});return e.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme"]}),()=>e.disconnect()},[]);let x=async t=>{if(t.preventDefault(),!o||!d)return;let r=d.getElement(a.CardElement);if(r){u(!0);try{let t=await o.confirmCardSetup(e,{payment_method:{card:r,metadata:{downstream_save_on_file:f?"false":"true"}},return_url:window.location.href});if(t.error)throw Error(t.error.message||"Unable to add card");let n=t.setupIntent;if(n?.payment_method&&"string"==typeof n.payment_method)f?await l(n.payment_method):s(n.payment_method);else throw Error("Unable to save card")}catch(e){i(e.message||"Unable to add card")}finally{u(!1)}}};return(0,t.jsxs)("form",{onSubmit:x,className:"space-y-7",children:[(0,t.jsx)("div",{className:"rounded-xl border border-border bg-background px-4 py-4 shadow-[inset_0_0_0_1px_hsl(var(--border)/0.35)]",children:(0,t.jsx)(a.CardElement,{options:{style:m}},m.base.color)}),n?(0,t.jsxs)("label",{className:"flex items-start gap-4 px-1 text-sm",children:[(0,t.jsx)(v.Checkbox,{checked:f,onCheckedChange:e=>h(!0===e),className:"mt-0.5 h-5 w-5 rounded-[5px] border-2 border-muted-foreground
2/70 data-[state=checked]:border-primary"}),(0,t.jsxs)("span",{className:"space-y-2",children:[(0,t.jsx)("span",{className:"block text-base font-semibold leading-tight text-foreground",children:"Do not save this payment method"}),(0,t.jsx)("span",{className:"block text-sm font-medium leading-relaxed text-muted-foreground",children:"Use this card for this payment only. It will not be stored for future payments."})]})]}):null,(0,t.jsx)(y.Button,{type:"submit",className:"h-11 w-full rounded-lg text-sm font-semibold",disabled:c,children:c?"Processing...":f?"Use card once":"Save payment method"})]})};function U({open:e,onOpenChange:o,selectedMethod:g,onSelectMethod:v,defaultPaymentMethodId:D=null,userGroupId:B,methods:I,allowAdd:O,allowRemove:F,closeOnSelect:W=!0,footer:H,hasCompany:q,companyName:V,creditLimit:K,creditUtilized:G,showRentNowPayLaterSection:X=!0,hideThirdPartyWallets:Y=!1,allowOneTimeUse:Q=!1,allowInactiveMethods:J=!1,onAddCardOverride:Z}){let ee=(0,n.useRouter)(),et=(0,n.usePathname)(),er=(0,n.useSearchParams)(),en=(0,s.useQueryClient)(),{toast:ea}=(0,h.useToast)(),{effectiveUserGroupId:es}=(0,c.useEffectiveUserGroupId)(),el=(0,u.useMe)({allowImpersonation:!0}),ei=el.data?(0,T.toUserEntity)(el.data):null,eo=ei?.id,ed=(0,c.resolveEffectiveUserGroupId)(B,es??ei?.userGroupId??null),ec=void 0!==I,eu=!!v,em=O??(!ec&&!eu),ep=F??(!ec&&!eu),ef=!ec&&!eu,eh=!ec&&!!ed,ex=(0,r.useRef)(null),eg=(0,r.useRef)(!1),eb=(0,r.useRef)(!1),ey=(0,r.useRef)(e),[ev,ej]=(0,r.useState)(null);(0,r.useEffect)(()=>{ex.current=g?.oneTimeStripePaymentMethodId??null},[g?.oneTimeStripePaymentMethodId]),(0,r.useEffect)(()=>()=>{d(ex.current)},[]);let ew=(0,r.useCallback)(e=>{let t=g?.oneTimeStripePaymentMethodId??ex.current;t&&e?.id!==t&&e?.oneTimeStripePaymentMethodId!==t&&d(t)},[g?.oneTimeStripePaymentMethodId]);(0,r.useEffect)(()=>{ey.current&&!e&&(eg.current?(eg.current=!1,eb.current=!1):eb.current?eb.current=!1:ew(null)),ey.current=e},[ew,e]);let[eN,ek]=(0,r.useState)(!1),[eS,eC]=(0,r.useState)(!1),[e_,eP]=(0,r.useState)(null),eE=(0,r.useRef)(null),eT=er.get("setup_intent_client_secret"),eM=(0,m.useSetupIntent)({user_group:ed??void 0},{enabled:eh&&(eN||!!eT)}),eD=(0,l.useApiV1UserGroupsRetrieve)(ed??"",{"expand[]":["credit_limit_utilized"]},{query:{enabled:eh}}),eB=(0,f.usePaymentMethods)({limit:100,user_group:ed??void 0},{enabled:eh}),eI=(0,r.useMemo)(()=>(eB.data?.data??[]).filter(e=>(0,b.isPaymentMethodSelectable)(e,{allowInactive:J})),[J,eB.data?.data]),eO=(0,r.useMemo)(()=>eI.filter(e=>"card"===e.type),[eI]),eA=(0,r.useMemo)(()=>eI.filter(e=>"us_bank_account"===e.type),[eI]),eL=D??eD.data?.default_payment_method??null,e$=(0,r.useMemo)(()=>ec?R((I??[]).filter(e=>"card"===e.type&&!!e.id&&(0,b.isPaymentMethodSelectable)(e,{allowInactive:J})).map(e=>({id:e.id,label:$(e),subtitle:"Credit/Debit Card",value:e,isDefault:eL===e.id}))):R(eO.filter(e=>!(Y&&(e=>{let t=e.data;if(!t||"object"!=typeof t)return null;let r=t.wallet;if(!r||"object"!=typeof r)return null;let n=r.type;return"apple_pay"===n||"google_pay"===n?n:null})(e))).map(e=>{let t=L(e);return t&&t.id?{id:t.id,label:A(e),subtitle:"Credit/Debit Card",value:t,isDefault:eL===t.id,apiMethod:e}:null}).filter(e=>null!==e)),[J,eL,Y,ec,eO,I]),eR=(0,r.useMemo)(()=>ec?R((I??[]).filter(e=>"bank"===e.type&&!!e.id&&(0,b.isPaymentMethodSelectable)(e,{allowInactive:J})).map(e=>({id:e.id,label:$(e),subtitle:"Bank Account",value:e,isDefault:eL===e.id}))):R(eA.map(e=>{let t=L(e);return t&&t.id?{id:t.id,label:A(e),subtitle:"Bank Account",value:t,isDefault:eL===t.id,apiMethod:e}:null}).filter(e=>null!==e)),[J,eL,ec,eA,I]),ez=(0,r.useMemo)(()=>{let e=g?.oneTimeStripePaymentMethodId,t=g?.id;if(!e||g?.type!=="card")return e$;let r=e=>!!(e.value.id&&ev&&!ev.has(e.value.id)),n=e$.find(r=>r.value.id===t||r.value.id===e)??e$.find(e=>r(e)&&(!eo||e.apiMethod?.user===eo))??e$.find(r)??null;if(n)return e$.map(t=>t.id!==n.id?t:{...t,value:{...t.value,oneTimeStripePaymentMethodId:e}});let a={...g,id:g.id??e,oneTimeStripePaymentMethodId:e};return[{id:`one-time-${e}`,label:"One-time card",subtitle:"Use once for this payment",value:a,isDefault:!1},...e$]},[e$,eo,ev,g]),eU=(0,l.useApiV1UserGroupsDefaultPaymentMethodUpdate)({mutation:{onSuccess:()=>{ed&&en.invalidateQueries({queryKey:(0,l.getApiV1UserGroupsRetrieveQueryKey)(ed)})}}}),eF=(0,l.useApiV1PaymentMethodsCreate)({mutation:{onSuccess:()=>{en.invalidateQueries({queryKey:(0,l.getApiV1PaymentMethodsListQueryKey)()})}}}),eW=(0,l.useApiV1PaymentMethodsDestroy)({mutation:{onSuccess:()=>{en.invalidateQueries({queryKey:(0,l.getApiV1PaymentMethodsListQueryKey)()})}}}),eH=!!(eM.data?.client_secret&&eM.data?.publishable_key),eq=eN&&eM.data?.publishable_key?(0,x.getStripe)(eM.data.publishable_key):null,eV=(0,r.useCallback)(async(e,t)=>{if(!ei?.id)throw Error("Unable to resolve current user");eP(null),eF.reset(),await eF.mutateAsync({data:{user:ei.id,user_group:ed??null,stripe_id:e}}).finally(()=>(0,m.clearSetupIntentQueries)(en)),ew(null),await en.invalidateQueries({queryKey:(0,l.getApiV1PaymentMethodsListQueryKey)()}),await eB.refetch(),t?.replaceUrl&&ee.replace(et),t?.closeDrawer&&ek(!1),t?.showSuccessToast&&ea({title:"Card added",description:"Your card has been added successfully."})},[ew,ei,et,eF,eB,en,ee,ea,ed]);(0,r.useEffect)(()=>{let e=eM.data;eh&&eT&&e?.publishable_key&&eE.current!==eT&&(eE.current=eT,(async()=>{let t=await (0,x.getStripe)(e.publishable_key);if(!t||!ei?.id)return;let{setupIntent:r,error:n}=await t.retrieveSetupIntent(eT);if(!n&&r&&("succeeded"===r.status||"processing"===r.status)&&r.payment_method&&"string"==typeof r.payment_method)try{await eV(r.payment_method,{closeDrawer:!0,replaceUrl:!0,showSuccessToast:!0})}catch(e){ea({title:"Unable to save payment method",description:M(e,"Please try again."),variant:"destructive"})}})())},[ei?.id,et,eV,ee,eM.data,eT,eh,ea]);let eK=async e=>{try{await eV(e,{closeDrawer:!0,showSuccessToast:!0})}catch{}},eG=async e=>{let t=new Set(eO.map(e=>e.id));ej(t);let r=await eB.refetch(),n=r.data?.data??[],a=n.find(t=>
2t.id===e)??n.find(e=>"card"===e.type&&!t.has(e.id)),s=a?L(a):null,l={id:s?.id??e,type:"card",last4:s?.last4??"0000",brand:s?.brand??"Card",oneTimeStripePaymentMethodId:e};ew(l),v?.(l),ek(!1),(0,m.clearSetupIntentQueries)(en),W&&(eb.current=!0,e6(!1)),ea({title:"Card ready",description:"This card will be used for this payment only."})},eX=async()=>{eC(!0);try{if(!ei?.id)throw Error("Unable to resolve current user");let e=[ei.first_name,ei.last_name].filter(Boolean).join(" ").trim()||ei.email||"Account holder",t=await (0,p.connectBankAccount)({userGroupId:ed??void 0,billingName:e,billingEmail:ei.email??void 0});if(!t)return;await en.invalidateQueries({queryKey:(0,l.getApiV1PaymentMethodsListQueryKey)()});let r=await eB.refetch();if("verified"===t.status){let e=r.data?.data.find(e=>e.id===t.payment_method),n=e?L(e):null;n&&v&&e8(n)}ea("verified"===t.status?{title:"Bank connected",description:"Your bank account has been added successfully."}:{title:"Bank verification pending",description:"Finish verification in company billing before this account can be used."})}catch(e){await en.invalidateQueries({queryKey:(0,l.getApiV1PaymentMethodsListQueryKey)()}),await eB.refetch(),ea({title:"Connection failed",description:M(e,"Please try again."),variant:"destructive"})}finally{eC(!1)}},eY=async(e,t)=>{if(ep){if(eI.length<=1)return void ea({title:"Cannot remove",description:"You must have at least one payment method.",variant:"destructive"});try{await eW.mutateAsync({id:e});let r=eI.filter(t=>t.id!==e);t&&r.length&&ed&&eU.mutate({userGroupId:ed,data:{payment_method:r[0].id}}),ea({title:"Payment method removed"})}catch(e){ea({title:"Unable to remove payment method",description:M(e,"Please try again."),variant:"destructive"})}}},eQ=q??!!ed,eJ=V??eD.data?.name??"Downstream Systems, Inc",eZ=K??eD.data?.credit_line_limit??0,e0=G??eD.data?.credit_limit_utilized??0,e1=!!(eZ&&eZ>0),e2=e1?eZ-(e0??0):0,e4=e1&&(e0??0)>(eZ??0),e5=e1?Math.min((e0??0)/(eZ||1)*100,100):0,e3=g?.type==="net_terms",e6=e=>{e||(eb.current||ew(null),eg.current=!0),o(e)},e8=e=>{v&&(ew(e),v(e),W&&(eb.current=!!e.oneTimeStripePaymentMethodId,e6(!1)))},e7=(e,r)=>e.length?e.map(e=>{let r=g?.oneTimeStripePaymentMethodId??null,n=g?.id??null,a=eu?r?e.value.id===n||e.value.id===r||e.value.oneTimeStripePaymentMethodId===r:g?.id===e.value.id&&g?.type===e.value.type:e.isDefault,s=r&&(e.value.id===n||e.value.id===r)?{...e.value,oneTimeStripePaymentMethodId:r}:e.value;return(0,t.jsx)("div",{className:`group w-full p-4 rounded-xl border transition-all ${a?"border-primary bg-primary/5":"border-border bg-card hover:border-primary/50"}`,children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsxs)("button",{onClick:()=>{eu&&e8(s)},className:"flex items-center gap-3 flex-1 text-left",children:[(0,t.jsx)("div",{className:"w-5 h-5 rounded-full border-2 border-primary flex items-center justify-center",children:a?(0,t.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-primary"}):null}),(0,t.jsx)("div",{className:"w-10 h-10 rounded-lg bg-muted flex items-center justify-center overflow-hidden",children:"bank"===e.value.type?(0,t.jsx)(w.FileText,{className:"w-5 h-5 text-muted-foreground"}):(0,t.jsx)(j.CreditCard,{className:"w-5 h-5 text-muted-foreground"})}),(0,t.jsxs)("div",{className:"text-left",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("p",{className:"font-semibold",children:e.label}),e.isDefault?(0,t.jsxs)("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium px-1.5 py-0.5 rounded bg-primary/10 text-primary",children:[(0,t.jsx)(C.Star,{className:"w-3 h-3 fill-primary","aria-hidden":"true"}),"Default"]}):null]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e.subt
2itle})]})]}),ef&&e.apiMethod?.id?(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[e.isDefault?null:(0,t.jsxs)("button",{onClick:t=>{var r;t.stopPropagation(),r=e.apiMethod.id,ed&&eU.mutate({userGroupId:ed,data:{payment_method:r}})},className:"inline-flex items-center gap-1 rounded-lg px-2 py-1.5 text-xs font-medium text-muted-foreground opacity-0 transition-opacity hover:text-primary hover:bg-primary/10 focus-visible:opacity-100 group-hover:opacity-100",title:"Mark as default",children:[(0,t.jsx)(C.Star,{className:"w-3.5 h-3.5","aria-hidden":"true"}),"Mark as default"]}),ep?(0,t.jsx)("button",{onClick:t=>{t.stopPropagation(),eY(e.apiMethod.id,e.isDefault)},className:"p-2 text-muted-foreground hover:text-destructive hover:bg-destructive/10 rounded-lg transition-colors",title:"Remove payment method",children:(0,t.jsx)(_.Trash2,{className:"w-4 h-4"})}):null]}):null]})},e.id)}):(0,t.jsx)("p",{className:"text-sm text-muted-foreground text-center py-3",children:r});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(E.ResponsiveModal,{open:e,onOpenChange:e6,title:"Select Payment Method",dialogContentProps:{className:"sm:max-w-[520px] p-0 max-h-[90vh] flex flex-col"},dialogHeaderProps:{className:"text-center px-4 pt-4 pb-2 shrink-0"},drawerContentProps:{className:"max-h-[90vh] flex flex-col"},drawerHeaderProps:{className:"text-center pb-2"},dialogFooterProps:{className:"border-t border-border bg-background p-4"},drawerFooterProps:{className:"border-t border-border bg-background p-4 pb-[calc(env(safe-area-inset-bottom)+1rem)]"},footer:H,children:(0,t.jsxs)("div",{className:"p-4 space-y-6 pb-8 overflow-y-auto",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-muted-foreground",children:"Cards"}),em?(0,t.jsxs)(y.Button,{variant:"ghost",size:"sm",onClick:()=>{Z?Z():ek(!0)},className:"h-8 px-2 text-primary hover:bg-primary/5 hover:text-primary focus-visible:text-primary",children:[(0,t.jsx)(k.Plus,{className:"w-4 h-4 mr-1"}),"Add New Card"]}):null]}),(0,t.jsx)("div",{className:"space-y-2",children:e7(ez,"No cards added yet")})]}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-muted-foreground",children:"Bank Accounts"}),em?(0,t.jsxs)(y.Button,{variant:"ghost",size:"sm",onClick:eX,disabled:eS,className:"h-8 px-2 text-primary hover:bg-primary/5 hover:text-primary focus-visible:text-primary",children:[eS?(0,t.jsx)(N.Loader2,{className:"w-4 h-4 mr-1 animate-spin"}):(0,t.jsx)(k.Plus,{className:"w-4 h-4 mr-1"}),"Add New Bank Account"]}):null]}),(0,t.jsx)("div",{className:"space-y-2",children:e7(eR,"No bank accounts linked yet")})]}),X?(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-muted-foreground mb-3",children:"Rent Now, Pay Later"}),eu?(0,t.jsxs)(t.Fragment,{children:[eQ?null:(0,t.jsx)("div",{className:"p-4 rounded-xl border border-dashed border-primary/50 bg-primary/5",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"w-10 h-10 rounded-lg bg-primary/20 flex items-center justify-center flex-shrink-0",children:(0,t.jsx)(P.Users,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"font-semibold text-foreground",children:"Join a Company"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Connect to your company account to unlock net terms and team billing features."}),(0,t.jsx)(y.Button,{size:"sm",variant:"outline",className:"mt-3 border-primary text-primary hover:bg-primary/5",onClick:()=>{sessionStorage.setItem("companyCreateReturnUrl",window.location.pathname),e6(!1),window.location.href="/onboarding/company"},children:"Join Company"})]})]})}),eQ&&!e1?(0,t.jsx)("div",{className:"p-4 rounded-xl border border-dashed border-primary/50 bg-primary/5",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"w-10 h-10 rounded-lg bg-primary/20 flex items-center justify-center flex-shrink-0",children:(0,t.jsx)(S.Sparkles,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"font-semibold text-foreground",children:"Rent Now. Pay Later."}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Get up to $50,000 in credit with net terms. Apply now and get approved in minutes."}),(0,t.jsx)(y.Button,{size:"sm",className:"mt-3",onClick:()=>{e6(!1),window.location.href=(0,i.routeCustomerRequestIncrease)()},children:"Apply for Net Terms"})]})]})}):null,eQ&&e1?(0,t.jsx)("button",{onClick:()=>{v&&(ew(null),v({id:null,type:"net_terms",last4:"0000"}),W&&e6(!1))},className:`w-full p-4 rounded-xl border transition-all text-left ${e3?"border-primary bg-primary/5":"border-border bg-card hover:border-primary/50"}`,children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"w-5 h-5 rounded-full border-2 border-primary flex items-center justify-center",children:e3?(0,t.jsx)("div",{className:"w-2.5 h-2.5 rounded-full bg-primary"}):null}),(0,t.jsx)("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center",children:(0,t.jsx)(w.FileText,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"font-semibold text-foreground",children:"Pay on Net Terms"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:eJ}),(0,t.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,t.jsxs)("div",{className:"flex justify-between text-xs",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Available Credit"}),(0,t.jsxs)("span",{className:"font-medium text-foreground",children:["$",e2.toLocaleStr
2ing()," of $",(eZ??0).toLocaleString()]})]}),(0,t.jsx)("div",{className:"h-1.5 bg-muted rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:`h-full rounded-full transition-all ${e4?"bg-destructive":e5>66?"bg-amber-500":"bg-primary"}`,style:{width:`${e5}%`}})})]})]})]})}):null]}):X&&eQ?(0,t.jsx)("div",{className:"p-4 rounded-xl border border-dashed border-primary/50 bg-primary/5",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"w-10 h-10 rounded-lg bg-primary/20 flex items-center justify-center flex-shrink-0",children:(0,t.jsx)(S.Sparkles,{className:"w-5 h-5 text-primary"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"font-semibold text-foreground",children:"Rent Now. Pay Later."}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Use net terms with your company credit line."}),eZ&&eZ>0?(0,t.jsxs)("div",{className:"mt-3 space-y-1",children:[(0,t.jsxs)("div",{className:"flex justify-between text-xs",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Available Credit"}),(0,t.jsxs)("span",{className:"font-medium text-foreground",children:["$",e2.toLocaleString()," of $",eZ.toLocaleString()]})]}),(0,t.jsx)("div",{className:"h-1.5 bg-muted rounded-full overflow-hidden",children:(0,t.jsx)("div",{className:`h-full rounded-full transition-all ${e4?"bg-destructive":"bg-primary"}`,style:{width:`${e5}%`}})})]}):null]})]})}):null]}):null]})}),(0,t.jsx)(E.ResponsiveModal,{open:eN,onOpenChange:ek,title:"Add New Card",titleClassName:"text-lg font-semibold leading-none text-foreground",dialogContentProps:{className:"sm:max-w-[520px] p-0 max-h-[90vh] flex flex-col rounded-xl [&_[data-dialog-close]]:right-4 [&_[data-dialog-close]]:top-4 [&_[data-dialog-close]]:flex [&_[data-dialog-close]]:h-8 [&_[data-dialog-close]]:w-8 [&_[data-dialog-close]]:items-center [&_[data-dialog-close]]:justify-center [&_[data-dialog-close]]:rounded-full [&_[data-dialog-close]]:border-2 [&_[data-dialog-close]]:border-primary/70 [&_[data-dialog-close]]:text-muted-foreground [&_[data-dialog-close]]:opacity-100 [&_[data-dialog-close]_svg]:h-5 [&_[data-dialog-close]_svg]:w-5"},dialogHeaderProps:{className:"px-4 pt-4 pb-12 text-left"},drawerContentProps:{className:"max-h-[90vh] p-0"},drawerHeaderProps:{className:"px-4 pt-4 pb-8 text-left"},children:eN?(0,t.jsx)("div",{className:"px-4 pb-8 space-y-4",children:eM.isLoading?(0,t.jsx)("div",{className:"text-sm text-muted-foreground",children:"Preparing Stripe\\u2026"}):eH&&eq?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a.Elements,{stripe:eq,options:{clientSecret:eM.data.client_secret},children:(0,t.jsx)(z,{clientSecret:eM.data.client_secret,allowOneTimeUse:Q&&e1,onSaved:eK,onUseOnce:eG,onError:e=>eP(e)})}),e_?(0,t.jsx)("p",{className:"text-xs text-destructive",children:e_}):null,eF.isError?(0,t.jsx)("p",{className:"text-xs text-destructive",children:"Unable to save payment method. Please try again."}):null]}):(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("p",{className:"text-sm text-destructive",children:"Unable to load payment form."}),(0,t.jsx)(y.Button,{type:"button",variant:"outline",onClick:()=>eM.refetch(),children:"Retry"})]})}):null})]})}e.s(["PaymentMethodModal",0,U,"default",0,U],209126)},847240,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(657688),a=e.i(522016),s=e.i(203358),l=e.i(582629);e.i(632821);var i=e.i(559528),o=e.i(362474);let d=e=>e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toString();e.s(["ProductCard",0,function({product:e,showFreeDelivery:c,revealDelayMs:u=0,onSelect:m}){let p,[f,h]=(0,r.useState)(!1),x=("string"==typeof(p=e.images?.[0])?p:p?.image)||e.image_del||'data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="400" height="300" viewBox="0 0 400 300"><defs><linearGradient id="pbg" x1="0%25" y1="0%25" x2="100%25" y2="100%25"><stop offset="0%25" stop-color="%23f1f5f9"/><stop offset="100%25" stop-color="%23e2e8f0"/></linearGradient></defs><rect width="400" height="300" fill="url(%23pbg)"/><g transform="translate(170, 115)"><rect x="0" y="20" width="60" height="50" rx="4" fill="%23cbd5e1"/><polygon points="30,0 60,20 0,20" fill="%23b0bac9"/><line x1="30" y1="20" x2="30" y2="70" stroke="%23a1aab8" stroke-width="2"/><line x1="0" y1="45" x2="60" y2="45" stroke="%23a1aab8" stroke-width="2"/></g></svg>',g=e.id??"",b=g?`${(0,l.routeCustomerOrderNewSuppliers)()}?main_product_id=${g}`:(0,l.routeCustomerOrderNewSuppliers)(),y=()=>(0,i.track)(o.PRODUCT_VIEWED,{product_id:e.id,product_name:e.name}),v="group flex overflow-hidden rounded-xl border border-border bg-card text-left transition-all hover:-translate-y-0.5 hover:border-primary/30 animate-slide-up md:flex-col",j=u>0?{animationDelay:`${u}ms`}:void 0,w=(0,r.useMemo)(()=>(e.tags??[]).some(e=>{let t=e.name.toLowerCase();return t.includes("free delivery")||t.includes("free-delivery")}),[e.tags]),N=e.description||e.main_product_infos?.[0]?.description||"View available listings.",k=d(e.likes_count??0),S=d(e.listings_count??0),C=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"h-28 w-28 flex-shrink-0 overflow-hidden bg-muted md:h-auto md:w-full md:aspect-[16/9]",children:(0,t.jsx)(n.default,{src:x,alt:e.name,onLoad:()=>h(!0),width:400,height:300,className:`${f?"opacity-100":"opacity-0"} h-full w-full object-cover transition-all duration-500 group-hover:scale-105`,loading:"lazy",unoptimized:!0})}),(0,t.jsxs)("div",{className:"flex-1 p-4",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-card-foreground transition-colors group-hover:text-primary",children:e.name}),(0,t.jsx)("p",{className:"mt-1 line-clamp-2 text-xs text-muted-foreground",children:N}),(0,t.jsxs)("div",{className:"mt-2 flex items-center gap-2 text-xs text-muted-foreground",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(s.ThumbsUp,{
2className:"h-3 w-3 text-primary","aria-hidden":!0}),(0,t.jsx)("span",{children:k})]}),(0,t.jsx)("span",{children:"â¢"}),(0,t.jsxs)("span",{children:[S," listings"]})]}),c&&w?(0,t.jsx)("span",{className:"mt-2 inline-flex items-center justify-center rounded-full bg-primary/10 px-2 py-0.5 text-[10px] font-semibold text-primary",children:"Free Delivery"}):null]})]});return m&&g?(0,t.jsx)("button",{type:"button",className:v,style:j,onClick:()=>{y(),m(g)},children:C}):(0,t.jsx)(a.default,{href:b,className:v,style:j,onClick:y,children:C})}])},252946,524393,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(522016);e.i(924856);let a={privacy:{label:"Privacy Policy",href:"/privacy-policy"},terms:{label:"Terms of Service",href:"/terms-of-service"}},s={onboarding:"By checking this box, I agree to receive account and order-related text messages (such as booking, delivery, and pickup updates) from Downstream at the phone number above. Consent is not a condition of any purchase. Message and data rates may apply and message frequency varies. Reply STOP to unsubscribe or HELP for help. See our Privacy Policy and Terms of Service.",checkout:"By checking this box, I agree to receive text messages about this order â including delivery, pickup, and status updates â from Downstream at my account phone number. Consent is not a condition of this purchase. Message and data rates may apply and message frequency varies. Reply STOP to unsubscribe or HELP for help. See our Privacy Policy and Terms of Service."},l={onboarding:"Get account and order updates",checkout:"Text me updates about this order"};e.s(["SMS_CONSENT_DISCLOSURE",0,s,"SMS_CONSENT_POLICY_LINKS",0,a,"SMS_CONSENT_TITLE",0,l,"buildSmsConsentRequest",0,function(e){let t={phone_number:e.phoneNumber,disclosure_text:s[e.surface],method:"web_form"};return e.sourceUrl&&(t.source_url=e.sourceUrl.slice(0,512)),t}],524393);var i=e.i(308574);e.s(["SmsConsentField",0,function({surface:e,checked:o,onCheckedChange:d,disabled:c=!1,helperText:u,className:m}){var p;let f,h;return(0,t.jsxs)("div",{className:["rounded-xl border border-primary/30 bg-primary/[0.03] p-3 dark:bg-primary/5",m??""].join(" "),children:[(0,t.jsxs)("label",{className:["flex items-center gap-2.5",c?"cursor-not-allowed":"cursor-pointer"].join(" "),children:[(0,t.jsx)(i.Checkbox,{checked:o,onCheckedChange:e=>d(!0===e),disabled:c,"aria-label":l[e],className:"rounded-[5px]"}),(0,t.jsx)("span",{className:"text-sm font-semibold text-foreground",children:l[e]})]}),(0,t.jsx)("p",{className:"mt-1 pl-[30px] text-xs leading-relaxed text-muted-foreground",children:(p=s[e],f=[a.privacy,a.terms],h=RegExp(`(${f.map(e=>e.label.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})`,"g"),p.split(h).map((e,a)=>{let s=f.find(t=>t.label===e);return s?(0,t.jsx)(n.default,{href:s.href,target:"_blank",rel:"noreferrer",className:"font-medium text-primary hover:underline",onClick:e=>e.stopPropagation(),children:e},a):(0,t.jsx)(r.Fragment,{children:e},a)}))}),u?(0,t.jsx)("p",{className:"mt-2 pl-[30px] text-xs text-muted-foreground",children:u}):null]})}],252946)},143566,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(221642),a=e.i(782551),s=e.i(864086);e.s(["DSFilterableListView",0,function({items:e,itemBuilder:l,filters:i,prefixIcon:o,filterIcon:d,selectedFilterIcon:c,filterBackground:u="hsl(var(--card))",scrollDirection:m="vertical",noItemsMessage:p,title:f,actions:h,fillColor:x,hintText:g,suffixIcon:b,padding:y=0,searchFiledPadding:v=0,hasShadow:j=!0,isDesc:w=!1,reversed:N=!1,searchBarAction:k,itemToString:S}){let[C,_]=(0,r.useState)(""),[P,E]=(0,r.useState)(i),T=(0,r.useMemo)(()=>{let t=[...e];if(C.trim()){let e=C.toLowerCase();t=t.filter(t=>(S?S(t):JSON.stringify(t??{})).toLowerCase().includes(e))}return(P??[]).forEach(e=>{let r=e.options.filter(e=>e.isSelected);0!==r.length&&(t=t.filter(e=>r.every(t=>t.filter(e))))}),w&&(t=t.reverse()),N&&(t=t.reverse()),t},[e,P,C,S,w,N]),M=(P?.length??0)>0,D=(P??[]).some(e=>e.options.some(e=>e.isSelected));return(0,t.jsxs)("div",{className:"flex flex-col gap-3",style:{padding:y},children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",style:{padding:v},children:[f??(0,t.jsxs)("div",{className:["flex min-w-[200px] flex-1 items-center gap-2 rounded-lg border border-border bg-card px-3 py-2",j?"border-transparent shadow-[0_6px_20px_rgba(0,0,0,0.08)]":"",x?"bg-muted/40":""].filter(
2Boolean).join(" "),children:[(0,t.jsx)(s.SearchField,{rootClassName:"flex-1",value:C,onChange:_,placeholder:g??"Search",showClear:!1,className:"h-auto border-0 bg-transparent p-0 shadow-none focus-visible:ring-0 focus-visible:ring-offset-0",iconClassName:o?"hidden":"absolute left-0 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",inputClassName:o?"pl-0 pr-8 placeholder:text-slate-500":"pl-6 pr-8 placeholder:text-slate-500"}),C&&(0,t.jsx)("button",{type:"button",className:"border-0 bg-transparent text-base text-muted-foreground transition hover:opacity-80",onClick:()=>_(""),children:b??"Ã"})]}),k,h&&h.length>0&&(0,t.jsx)("div",{className:"inline-flex gap-1.5",children:h.map((e,r)=>(0,t.jsx)("button",{type:"button",onClick:e.onTap,className:"rounded-lg border-0 bg-muted/30 p-2 transition hover:brightness-95",children:e.icon},r))}),M&&(0,t.jsx)("div",{className:"inline-flex items-center justify-center rounded-lg border border-border p-2",style:{backgroundColor:u},children:D?c??d:d})]}),M&&(0,t.jsx)("div",{className:"grid gap-2 rounded-2xl border border-border bg-card p-3",children:(P??[]).map((e,r)=>(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)(a.DsText,{variant:"labelBold",text:e.label}),(0,t.jsx)("div",{className:"flex flex-wrap gap-2.5",children:e.options.map((n,a)=>(0,t.jsxs)("label",{className:"inline-flex items-center gap-1.5 text-sm",children:[(0,t.jsx)("input",{type:e.isMultiSelectable?"checkbox":"radio",name:e.label,checked:!!n.isSelected,onChange:()=>{E(e=>{var t;if(!e)return e;let n=[...e],s=n[r],l={...t=s.options[a],isSelected:!t.isSelected},i=[...s.options];return s.isMultiSelectable?i[a]=l:i=i.map((e,t)=>t===a?l:{...e,isSelected:!1}),n[r]={...s,options:i},s.onOptionChanged?.(),n})}}),(0,t.jsx)("span",{children:n.label})]},n.label))}),(0,t.jsx)(n.DashSeparator,{color:"hsl(var(--border))"})]},e.label))}),(0,t.jsx)("div",{className:["flex flex-wrap gap-2","vertical"===m?"flex-col":"flex-row"].join(" "),children:0===T.length?(0,t.jsx)("div",{className:"w-full rounded-lg border border-dashed border-border bg-muted/30 p-3",children:(0,t.jsx)(a.DsText,{variant:"bodyText",text:p??"No items"})}):T.map((e,r)=>(0,t.jsx)("div",{className:"w-full",children:l(e,r)},r))})]})}])},306630,e=>{"use strict";var t=e.i(843476),r=e.i(271645),n=e.i(143566);e.s(["DSFilterablePaginatedListView",0,function({items:e,pageSize:a=10,itemBuilder:s,filters:l,prefixIcon:i,filterIcon:o,selectedFilterIcon:d,filterBackground:c,noItemsMessage:u,title:m,actions:p,fillColor:f,hintText:h,suffixIcon:x,padding:g,searchFiledPadding:b,hasShadow:y,itemToString:v}){let[j,w]=(0,r.useState)(0),N=Math.max(1,Math.ceil(e.length/a)),k=(0,r.useMemo)(()=>{let t=j*a;return e.slice(t,t+a)},[e,j,a]),S=e=>{w(Math.min(Math.max(e,0),N-1))};return(0,t.jsxs)("div",{className:"grid gap-3",children:[(0,t.jsx)(n.DSFilterableListView,{items:k,itemBuilder:s,filters:l,prefixIcon:i,filterIcon:o,selectedFilterIcon:d,filterBackground:c,noItemsMessage:u,title:m,actions:p,fillColor:f,hintText:h,suffixIcon:x,padding:g,searchFiledPadding:b,hasShadow:y,itemToString:v}),(0,t.jsxs)("div",{className:"inline-flex items-center justify-end gap-2",children:[(0,t.jsx)("button",{type:"button",className:"rounded-md border border-border bg-white px-3 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50",onClick:()=>S(j-1),disabled:0===j,children:"Prev"}),(0,t.jsxs)("span",{className:"text-sm text-slate-700",children:["Page ",j+1," of ",N]}),(0,t.jsx)("button",{type:"button",className:"rounded-md border border-border bg-white px-3 py-2 text-sm disabled:cursor-not-allowed disabled:opacity-50",onClick:()=>S(j+1),disabled:j>=N-1,children:"Next"})]})]})}])},232189,(e,t,r)=>{"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},865156,(e,t,r)=>{"use strict";var n=e.r(232189);function a(){}function s(){}s.resetWarningCache=a,t.exports=function(){function e(e,t,r,a,s,l){if(l!==n){var i=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol
2:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:a};return r.PropTypes=r,r}},745009,(e,t,r)=>{t.exports=e.r(865156)()},667668,e=>{"use strict";var t=e.i(271645),r=e.i(745009);function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){l(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,a=e&&("u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=a){var s=[],l=!0,i=!1;try{for(a=a.call(e);!(l=(r=a.next()).done)&&(s.push(r.value),!t||s.length!==t);l=!0);}catch(e){i=!0,n=e}finally{try{l||null==a.return||a.return()}finally{if(i)throw n}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return o(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var d=function(e,r,n){var a=!!n,s=t.default.useRef(n);t.default.useEffect(function(){s.current=n},[n]),t.default.useEffect(function(){if(!a||!e)return function(){};var t=function(){s.current&&s.current.apply(s,arguments)};return e.on(r,t),function(){e.off(r,t)}},[a,r,e,s])},c=function(e){var r=t.default.useRef(e);return t.default.useEffect(function(){r.current=e},[e]),r.current},u=function(e){return null!==e&&"object"===s(e)},m="[object Object]",p=function e(t,r){if(!u(t)||!u(r))return t===r;var n=Array.isArray(t);if(n!==Array.isArray(r))return!1;var a=Object.prototype.toString.call(t)===m;if(a!==(Object.prototype.toString.call(r)===m))return!1;if(!a&&!n)return t===r;var s=Object.keys(t),l=Object.keys(r);if(s.length!==l.length)return!1;for(var i={},o=0;o<s.length;o+=1)i[s[o]]=!0;for(var d=0;d<l.length;d+=1)i[l[d]]=!0;var c=Object.keys(i);return c.length===s.length&&c.every(function(n){return e(t[n],r[n])})},f=function(e,t,r){return u(e)?Object.keys(e).reduce(function(n,s){var i=!u(t)||!p(e[s],t[s]);return r.includes(s)?(i&&console.warn("Unsupported prop change: options.".concat(s," is not a mutable property.")),n):i?a(a({},n||{}),{},l({},s,e[s])):n},null):null},h="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",x=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h;if(null===e||u(e)&&"function"==typeof e.elements&&"function"==typeof e.createToken&&"function"==typeof e.createPaymentMethod&&"function"==typeof e.confirmCardPayment)return e;throw Error(t)},g=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h;if(u(e)&&"function"==typeof e.then)return{tag:"async",stripePromise:Promise.resolve(e).then(function(e){return x(e,t)})};var r=x(e,t);return null===r?{tag:"empty"}:{tag:"sync",stripe:r}},b=function(e){e&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"6.3.0"}),e.registerAppInfo({name:"react-stripe-js",version:"6.3.0",url:"https://stripe.com/docs/stripe-js/react"}))},y=t.default.createContext(null);y.displayName="ElementsContext";var v=function(e,t){if(!e)throw Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e},j=function(e){var r=e.stripe,n=e.options,a=e.children,s=t.default.useMemo(function(){return g(r)},[r]),l=i(t.default.useState(function(){return{stripe:"sync"===s.tag?s.stripe:null,elements:"sync"===s.tag?s.stripe.elements(n):null}}),2),o=l[0],d=l[1];t.default.useEffect(function(){var e=!0,t=function(e){d(function(t){return t.stripe?t:{stripe:e,elements:e.elements(n)}})};return"async"!==s.tag||o.stripe?"sync"!==s.tag||o.stripe||t(s.stripe):s.stripePromise.then(function(r){r&&e&&t(r)}),function(){e=!1}},[s,o,n]);var u=c(r);t.default.useEffect(function(){null!==u&&u!==r&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[u,r]);var m=c(n);return t.default.useEffect(function(){if(o.elements){var e=f(n,m,["clientSecret","fonts"]);e&&o.elements.update(e)}},[n,m,o.elements]),t.default.useEffect(function(){b(o.stripe)},[o.stripe]),t.default.createElement(y.Provider,{value:o},a)};j.propTypes={stripe:r.default.any,options:r.default.object};r.default.func.isRequired;var w=t.default.createContext(null);w.displayName="CheckoutContext";var N=function(e){var r=t.default.useContext(w),n=t.default.useContext(y);if(!r)return v(n,e);if(!n)return r;throw Error("You cannot wrap the part of your app that ".concat(e," in both a checkout provider and <Elements> provider."))},k=["mode"],S=function(e,n,a){var s="".concat(e.charAt(0).toUpperCase()+e.slice(1),"Element"),l=n?function(e){N("mounts <".concat(s,">"));var r=e.id,n=e.className;return t.default.createElement("div",{id:r,className:n})}:function(r){var n,a=r.id,l=r.className,o=r.options,u=void 0===o?{}:o,m=r.onBlur,p=r.onFocus,h=r.onReady,x=r.onChange,g=r.onEscape,b=r.onClick,y=r.onLoadError,v=r.onLoaderStart,j=r.onNetworksChange,w=r.onConfirm,S=r.onCancel,C=r.onShippingAddressChange,_=r.onShippingRateChange,P=r.onSavedPaymentMethodRemove,E=r.onSavedPaymentMethodUpdate,T=N("mounts <".concat(s,">")),M="elements"in T?T.elements:null,D="checkoutState"in T?T.checkoutState:null,B=(null==D?void 0:D.type)==="success"||(null==D?void 0:D.type)==="loading"?D.sdk:null,I=i(t.default.useState(null),2),O=I[0],A=I[1],L=t.default.useRef(null),$=t.default.useRef(null);d(O,"blur",m),d(O,"focus",p),d(O,"escape",g),d(O,"click",b),d(O,"loaderror",y),d(O,"loaderstart",v),d(O,"networksch
2ange",j),d(O,"confirm",w),d(O,"cancel",S),d(O,"shippingaddresschange",C),d(O,"shippingratechange",_),d(O,"savedpaymentmethodremove",P),d(O,"savedpaymentmethodupdate",E),d(O,"change",x),h&&(n="expressCheckout"===e?h:function(){h(O)}),d(O,"ready",n),t.default.useLayoutEffect(function(){if(null===L.current&&null!==$.current&&(M||B)){var t=null;if(B)switch(e){case"paymentForm":t=B.createForm(u);break;case"payment":t=B.createPaymentElement(u);break;case"address":if("mode"in u){var r=u.mode,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},s=Object.keys(e);for(n=0;n<s.length;n++)r=s[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)r=s[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(u,k);if("shipping"===r)t=B.createShippingAddressElement(n);else if("billing"===r)t=B.createBillingAddressElement(n);else throw Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":t=B.createExpressCheckoutElement(u);break;case"currencySelector":t=B.createCurrencySelectorElement();break;case"taxId":t=B.createTaxIdElement(u);break;case"contactDetails":t=B.createContactDetailsElement();break;default:throw Error("<".concat(s,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}else M&&(t=M.create(e,u));L.current=t,A(t),t&&t.mount($.current)}},[M,B,u]);var R=c(u);return t.default.useEffect(function(){if(L.current){var e=f(u,R,["paymentRequest"]);e&&"update"in L.current&&L.current.update(e)}},[u,R]),t.default.useLayoutEffect(function(){return function(){if(L.current&&"function"==typeof L.current.destroy)try{L.current.destroy(),L.current=null}catch(e){}}},[]),t.default.createElement("div",{id:a,className:l,ref:$})};return l.propTypes={id:r.default.string,className:r.default.string,onChange:r.default.func,onBlur:r.default.func,onFocus:r.default.func,onReady:r.default.func,onEscape:r.default.func,onClick:r.default.func,onLoadError:r.default.func,onLoaderStart:r.default.func,onNetworksChange:r.default.func,onConfirm:r.default.func,onCancel:r.default.func,onShippingAddressChange:r.default.func,onShippingRateChange:r.default.func,onSavedPaymentMethodRemove:r.default.func,onSavedPaymentMethodUpdate:r.default.func,options:r.default.object},l.displayName=s,l.__elementType=e,l},C="u"<typeof window;t.default.createContext(null).displayName="EmbeddedCheckoutProviderContext",S("auBankAccount",C);var _=S("card",C);S("cardNumber",C),S("cardExpiry",C),S("cardCvc",C),S("iban",C);var P=S("payment",C);S("expressCheckout",C),S("paymentRequestButton",C),S("linkAuthentication",C),S("contactDetails",C),S("address",C),S("shippingAddress",C),S("paymentMethodMessaging",C),S("taxId",C),S("issuingCardNumberDisplay",C),S("issuingCardCvcDisplay",C),S("issuingCardExpiryDisplay",C),S("issuingCardPinDisplay",C),S("issuingCardCopyButton",C),e.s(["CardElement",0,_,"Elements",0,j,"PaymentElement",0,P,"useElements",0,function(){var e;return(e="calls useElements()",v(t.default.useContext(y),e)).elements},"useStripe",0,function(){return N("calls useStripe()").stripe}])}]); 3 4//# debugId=9aebf215-3816-88c0-2673-cac6d3f127b1
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.