1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/costs-Cs7kxm-Y.js","assets/vendor-pdf-C9TCjkzL.js","assets/vendor-motion-CAS9Mrr8.js","assets/vendor-charts-CCcpKWTT.js","assets/localDate-CPk2M2LN.js","assets/index-CxC89PRg.js","assets/index-BHIMbJfv.css","assets/query-boundary-Dr31qkJy.js","assets/refresh-cw-DKu0IaYb.js","assets/badge-DXnfPCD0.js","assets/tabs-B-n5hAmt.js","assets/select-CaKL9gM6.js","assets/index-BdQq_4o_.js","assets/Combination-Bymh1jIy.js","assets/use-vendor-price-lookup-04lZJ22Z.js","assets/trending-up-BjV9iP5n.js","assets/trending-down-BmxcqW4h.js","assets/calculator-BV2kfS6e.js","assets/calendar-vYmX8pTA.js","assets/circle-check-DI67LXtl.js","assets/camera-B4SZSADo.js","assets/bell-DzYm5-_7.js","assets/package-BJZd7r4E.js","assets/upload-DeoBYkDW.js","assets/trash-2-DAItjZQU.js","assets/use-tier-access-DycmD0Wc.js","assets/upgrade-gate-mCiqKCUt.js","assets/skeleton-ZbgX6FFt.js","assets/textarea-BZrH01Ga.js","assets/en-US-9sl_A5dN.js","assets/endOfMonth-B37p0woh.js","assets/format-Dluiar8k.js","assets/chevron-left-DKIysnTN.js","assets/popover-DLZ_2OLV.js","assets/index-tsYMXB1t.js","assets/use-document-visible-DWoKgyOr.js","assets/link-2-CFNn1Rdz.js","assets/map-pin-BxtxPAf8.js","assets/facebook-Dic-bB_v.js","assets/avatar-BXZlFucr.js","assets/circle-alert-Bk2Ttv0Y.js","assets/sparkles-Ng7JCvrm.js","assets/eye-BRfNH_fY.js","assets/copy-yT2DELCk.js","assets/clock-2yzUZvxM.js","assets/history-0Nf_RAiV.js","assets/wand-sparkles-B2BknuC3.js","assets/settings-HyLOzkhp.js","assets/send-C8KjI3V8.js","assets/info-ChcgE_OM.js","assets/lamplit-sheet-DBfx0skq.js","assets/index-rKuJWRrb.js","assets/square-check-big-Baf19B4G.js","assets/lightbulb-D-Lb647B.js","assets/log-out-7EEom-Pk.js","assets/kitchen-kcSOEjUE.js","assets/timer-muzNsa9z.js","assets/target-DCkY4qcc.js","assets/circle-x-nhZSNlVt.js","assets/flame-CV3aZ80H.js","assets/utensils-Cdrt-tP5.js","assets/utensils-crossed-DbIvEedr.js","assets/printer-ClqLiZZ6.js","assets/hr--TS_Dr5L.js","assets/dialog-BgJdL0ob.js","assets/index-VCvVs7VH.js","assets/save-D3c5lxQy.js","assets/search-Ceq5iq3J.js","assets/staffing-Cbh-CU4y.js","assets/cloud-sun-cBtmgMse.js","assets/sunrise-C9-tZEAJ.js","assets/zap-CADHOmxZ.js","assets/clipboard-check-DwWiHv34.js","assets/training-COxs6pu7.js","assets/service-CthVFD-X.js","assets/leadership-CcTHNb-y.js","assets/reviews-Bxe69nqe.js","assets/imageDownscale-CtZDWW2E.js","assets/pencil-Bgxdh-Vh.js","assets/globe-BQ7YksRf.js","assets/crisis-BjBxKyfK.js","assets/sops-Dj43b7do.js","assets/phone-BVSyDMXj.js","assets/square-pen-CAC7tN06.js"])))=>i.map(i=>d[i]); 2import{_ as F}from"./vendor-pdf-C9TCjkzL.js";import{j as e}from"./vendor-motion-CAS9Mrr8.js";import{a as x,c as M}from"./vendor-charts-CCcpKWTT.js";import{c as Yt,E as xe,C as pt,H as va,B as Z,I as ce,X as $t,J as we,K as Te,N as Me,O as je,P as V,Q as De,R as ut,d as Ce,V as La,n as zt,Y as Oa,Z as fe,_ as Ge,$ as _e,v as Aa,a0 as gr,a1 as yr,a2 as Ra,a3 as vr,a4 as br,a5 as Fa,a6 as wr,a7 as jr,a8 as Nr,M as Ha,S as kr,a9 as Cr,a as _r,e as Et,L as ze,aa as ba,p as Dr,r as Pr}from"./index-CxC89PRg.js";import{u as Tr}from"./use-tier-access-DycmD0Wc.js";import{U as Mr}from"./upgrade-gate-mCiqKCUt.js";import{S as Ve}from"./skeleton-ZbgX6FFt.js";import{T as Wa}from"./textarea-BZrH01Ga.js";import{B as Ba}from"./badge-DXnfPCD0.js";import{T as Sr,a as Er,b as Oe,c as Ae}from"./tabs-B-n5hAmt.js";import{S as ge,a as ye,b as ve,c as be,d as ee}from"./select-CaKL9gM6.js";import{t as A,c as U,g as ft,m as Ir,a as Gt,b as Lr,d as Or,e as Ar,f as Ya}from"./en-US-9sl_A5dN.js";import{e as Vt,d as Ue}from"./endOfMonth-B37p0woh.js";import{s as Pe,a as de,g as Rr,b as Xe,c as $a,d as za,l as wa,i as Fr,w as ja,e as Hr,f as me,h as H,j as Wr,k as Ga}from"./format-Dluiar8k.js";import{C as Va}from"./chevron-left-DKIysnTN.js";import{P as Ua,a as qa,b as Qa}from"./popover-DLZ_2OLV.js";import{S as Ze,a as Fe,b as He,c as Ka,d as Br,e as Yr}from"./index-tsYMXB1t.js";import{u as $r}from"./use-document-visible-DWoKgyOr.js";import{L as Ut}from"./link-2-CFNn1Rdz.js";import{M as bt}
2from"./map-pin-BxtxPAf8.js";import{F as qe}from"./facebook-Dic-bB_v.js";import{A as Xa,a as Za,b as Ja}from"./avatar-BXZlFucr.js";import{C as Re}from"./circle-alert-Bk2Ttv0Y.js";import{U as es}from"./upload-DeoBYkDW.js";import{S as xt}from"./sparkles-Ng7JCvrm.js";import{C as ts}from"./calendar-vYmX8pTA.js";import{E as as}from"./eye-BRfNH_fY.js";import{C as mt}from"./copy-yT2DELCk.js";import{C as Je}from"./clock-2yzUZvxM.js";import{R as ss}from"./refresh-cw-DKu0IaYb.js";import{T as zr}from"./trending-up-BjV9iP5n.js";import{H as rs}from"./history-0Nf_RAiV.js";import{C as Wt}from"./circle-check-DI67LXtl.js";import{W as Gr}from"./wand-sparkles-B2BknuC3.js";import{S as Vr}from"./settings-HyLOzkhp.js";import{S as Ur}from"./send-C8KjI3V8.js";import{I as qr}from"./info-ChcgE_OM.js";import{Q as Qr}from"./query-boundary-Dr31qkJy.js";import{L as Kr,I as L}from"./lamplit-sheet-DBfx0skq.js";import{c as ns,R as Xr,T as Zr,C as Jr}from"./index-rKuJWRrb.js";import{S as os}from"./square-check-big-Baf19B4G.js";import{L as en}from"./lightbulb-D-Lb647B.js";import{L as tn}from"./log-out-7EEom-Pk.js";const an=Yt("FileOutput",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4 7V4a2 2 0 0 1 2-2 2 2 0 0 0-2 2",key:"1vk7w2"}],["path",{d:"M4.063 20.999a2 2 0 0 0 2 1L18 22a2 2 0 0 0 2-2V7l-5-5H6",key:"1jink5"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]]);const wt=Yt("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);const sn=Yt("PartyPopper",[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]]);function Q(t,a){const s=A(t);return isNaN(a)?U(t,NaN):(a&&s.setDate(s.getDate()+a),s)}function se(t,a){const s=A(t);if(isNaN(a))return U(t,NaN);if(!a)return s;const r=s.getDate(),n=U(t,s.getTime());n.setMonth(s.getMonth()+a+1,0);const o=n.getDate();return r>=o?n:(s.setFullYear(n.getFullYear(),n.getMonth(),r),s)}function Qe(t,a){const s=a*7;return Q(t,s)}function rn(t,a){return se(t,a*12)}function nn(t){let a;return t.forEach(function(s){const r=A(s);(a===void 0||a<r||isNaN(Number(r)))&&(a=r)}),a||new Date(NaN)}function on(t){let a;return t.forEach(s=>{const r=A(s);(!a||a>r||isNaN(+r))&&(a=r)}),a||new Date(NaN)}function K(t,a){const s=Pe(t),r=Pe(a);return+s==+r}function ln(t,a,s){const r=de(t,s),n=de(a,s),o=+r-ft(r),i=+n-ft(n);return Math.round((o-i)/Ir)}function te(t){const a=A(t);return a.setDate(1),a.setHours(0,0,0,0),a}function jt(t,a){const s=Gt(),r=a?.weekStartsOn??a?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,n=A(t),o=n.getDay(),i=(o<r?-7:0)+6-(o-r);return n.setDate(n.getDate()+i),n.setHours(23,59,59,999),n}function is(t){return jt(t,{weekStartsOn:1})}function cn(t){const a=A(t),s=a.getFullYear(),r=a.getMonth(),n=U(t,0);return n.setFullYear(s,r+1,0),n.setHours(0,0,0,0),n.getDate()}function dn(){return Object.assign({},Gt())}function un(t){let s=A(t).getDay();return s===0&&(s=7),s}function mn(t){return Math.trunc(+A(t)/1e3)}function hn(t){const a=A(t),s=a.getMonth();return a.setFullYear(a.getFullYear(),s+1,0),a.setHours(0,0,0,0),a}function pn(t,a){return ln(hn(t),te(t),a)+1}function Ke(t,a){const s=A(t),r=A(a);return s.getTime()>r.getTime()}function ls(t,a){const s=A(t),r=A(a);return+s<+r}function fn(t,a){const s=a instanceof Date?U(a,0):new a(0);return s.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),s.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),s}const xn=10;class cs{subPriority=0;validate(a,s){return!0}}class gn extends cs{constructor(a,s,r,n,o){super(),this.value=a,this.validateValue=s,this.setValue=r,this.priority=n,o&&(this.subPriority=o)}validate(a,s){return this.validateValue(a,this.value,s)}set(a,s,r){return this.setValue(a,s,this.value,r)}}class yn extends cs{priority=xn;subPriority=-1;set(a,s){return s.timestampIsSet?a:U(a,fn(a,Date))}}class I{run(a,s,r,n){const o=this.parse(a,s,r,n);return o?{setter:new gn(o.value,this.validate,this.set,this.priority,this.subPriority),rest:o.rest}:null}validate(a,s,r){return!0}}class vn extends I{priority=140;parse(a,s,r){switch(s){case"G":case"GG":case"GGG":return r.era(a,{width:"abbreviated"})||r.era(a,{width:"narrow"});case"GGGGG":return r.era(a,{width:"narrow"});default:return r.era(a,{width:"wide"})||r.era(a,{width:"abbreviated"})||r.era(a,{width:"narrow"})}}set(a,s,r){return s.era=r,a.setFullYear(r,0,1),a.setHours(0,0,0,0),a}incompatibleTokens=["R","u","t","T"]}const Y={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/}
2,ie={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function $(t,a){return t&&{value:a(t.value),rest:t.rest}}function R(t,a){const s=a.match(t);return s?{value:parseInt(s[0],10),rest:a.slice(s[0].length)}:null}function le(t,a){const s=a.match(t);if(!s)return null;if(s[0]==="Z")return{value:0,rest:a.slice(1)};const r=s[1]==="+"?1:-1,n=s[2]?parseInt(s[2],10):0,o=s[3]?parseInt(s[3],10):0,i=s[5]?parseInt(s[5],10):0;return{value:r*(n*Lr+o*Or+i*Ar),rest:a.slice(s[0].length)}}function ds(t){return R(Y.anyDigitsSigned,t)}function W(t,a){switch(t){case 1:return R(Y.singleDigit,a);case 2:return R(Y.twoDigits,a);case 3:return R(Y.threeDigits,a);case 4:return R(Y.fourDigits,a);default:return R(new RegExp("^\\d{1,"+t+"}"),a)}}function gt(t,a){switch(t){case 1:return R(Y.singleDigitSigned,a);case 2:return R(Y.twoDigitsSigned,a);case 3:return R(Y.threeDigitsSigned,a);case 4:return R(Y.fourDigitsSigned,a);default:return R(new RegExp("^-?\\d{1,"+t+"}"),a)}}function qt(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;default:return 0}}function us(t,a){const s=a>0,r=s?a:1-a;let n;if(r<=50)n=t||100;else{const o=r+50,i=Math.trunc(o/100)*100,c=t>=o%100;n=t+i-(c?100:0)}return s?n:1-n}function ms(t){return t%400===0||t%4===0&&t%100!==0}class bn extends I{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(a,s,r){const n=o=>({year:o,isTwoDigitYear:s==="yy"});switch(s){case"y":return $(W(4,a),n);case"yo":return $(r.ordinalNumber(a,{unit:"year"}),n);default:return $(W(s.length,a),n)}}validate(a,s){return s.isTwoDigitYear||s.year>0}set(a,s,r){const n=a.getFullYear();if(r.isTwoDigitYear){const i=us(r.year,n);return a.setFullYear(i,0,1),a.setHours(0,0,0,0),a}const o=!("era"in s)||s.era===1?r.year:1-r.year;return a.setFullYear(o,0,1),a.setHours(0,0,0,0),a}}class wn extends I{priority=130;parse(a,s,r){const n=o=>({year:o,isTwoDigitYear:s==="YY"});switch(s){case"Y":return $(W(4,a),n);case"Yo":return $(r.ordinalNumber(a,{unit:"year"}),n);default:return $(W(s.length,a),n)}}validate(a,s){return s.isTwoDigitYear||s.year>0}set(a,s,r,n){const o=Rr(a,n);if(r.isTwoDigitYear){const c=us(r.year,o);return a.setFullYear(c,0,n.firstWeekContainsDate),a.setHours(0,0,0,0),de(a,n)}const i=!("era"in s)||s.era===1?r.year:1-r.year;return a.setFullYear(i,0,n.firstWeekContainsDate),a.setHours(0,0,0,0),de(a,n)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class jn extends I{priority=130;parse(a,s){return gt(s==="R"?4:s.length,a)}set(a,s,r){const n=U(a,0);return n.setFullYear(r,0,4),n.setHours(0,0,0,0),Xe(n)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class Nn extends I{priority=130;parse(a,s){return gt(s==="u"?4:s.length,a)}set(a,s,r){return a.setFullYear(r,0,1),a.setHours(0,0,0,0),a}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class kn extends I{priority=120;parse(a,s,r){switch(s){case"Q":case"QQ":return W(s.length,a);case"Qo":return r.ordinalNumber(a,{unit:"quarter"});case"QQQ":return r.quarter(a,{width:"abbreviated",context:"formatting"})||r.quarter(a,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(a,{width:"narrow",context:"formatting"});default:return r.quarter(a,{width:"wide",context:"formatting"})||r.quarter(a,{width:"abbreviated",context:"formatting"})||r.quarter(a,{width:"narrow",context:"formatting"})}}validate(a,s){return s>=1&&s<=4}set(a,s,r){return a.setMonth((r-1)*3,1),a.setHours(0,0,0,0),a}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class Cn extends I{priority=120;parse(a,s,r){switch(s){case"q":case"qq":return W(s.length,a);case"qo":return r.ordinalNumber(a,{unit:"quarter"});case"qqq":return r.quarter(a,{width:"abbreviated",context:"standalone"})||r.quarter(a,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(a,{width:"narrow",context:"standalone"});default:return r.quarter(a,{width:"wide",context:"standalone"})||r.quarter(a,{width:"abbreviated",context:"standalone"})||r.quarter(a,{width:"narrow",context:"standalone"})}}validate(a,s){return s>=1&&s<=4}set(a,s,r){return a.setMonth((r-1)*3,1),a.setHours(0,0,0,0),a}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class _n extends I{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(a,s,r){const n=o=>o-1;switch(s){case"M":return $(R(Y.month,a),n);case"MM":return $(W(2,a),n);case"Mo":return $(r.ordinalNumber(a,{unit:"month"}),n);case"MMM":return r.month(a,{width:"abbreviated",context:"formatting"})||r.month(a,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(a,{width:"narrow",context:"formatting"});default:return r.month(a,{width:"wide",context:"formatting"})||r.month(a,{width:"abbreviated",context:"formatting"})||r.month(a,{width:"narrow",context:"formatting"})}}validate(a,s){return s>=0&&s<=11}set(a,s,r){return a.setMonth(r,1),a.setHours(0,0,0,0),a}}class Dn extends I{priority=110;parse(a,s,r){const n=o=>o-1;switch(s){case"L":return $(R(Y.month,a),n);case"LL":return $(W(2,a),n);case"Lo":return $(r.ordinalNumber(a,{unit:"month"}),n);case"LLL":return r.month(a,{width:"abbreviated",context:"standalone"})||r.month(a,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(a,{width:"narrow",context:"standalone"});default:return r.month(a,{width:"wide",context:"standalone"})||r.month(a,{width:"abbreviated",context:"standalone"})||r.month(a,{width:"narrow",context:"standalone"})}}validate(a,s){return s>=0&&s<=11}set(a,s,r){return a.setMonth(r,1),a.setHours(0,0,0,0),a}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function Pn(t,a,s){const r=A(t),n=$a(r,s)-a;return r.setDate(r.getDate()-n*7),r}class Tn extends I{priority=100;parse(a,s,r){switch(s){case"w":return R(Y.week,a);case"wo":return r.ordinalNumber(a,{unit:"week"});default:return W(s.length,a)}}validate(a,s){return s>=1&&s<=53}set(a,s,r,n){return de(Pn(a,r,n),n)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function Mn(t,a){const s=A(t),r=za(s)-a;return s.setDate(s.getDate()-r*7),s}class Sn extends I{priority=100;parse(a,s,r){switch(s){case"I":return R(Y.week,a);case"Io":return r.ordinalNumber(a,{unit:"week"});default:return W(s.length,a)}}validate(a,s){return s>=1&&s<=53}set(a,s,r){return Xe(Mn(a,r))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const En=[31,28,31,30,31,30,31,31,30,31,30,31],In=[31,29,31,30,31,30,31,31,30,31,30,31];class Ln extends I{priority=90;subPriority=1;parse(a,s,r){switch(s){case"d":return R(Y.date,a);case"do":return r.ordinalNumber(a,{unit:"date"});default:return W(s.length,a)}}validate(a,s){const r=a.getFullYear(),n=ms(r),o=a.getMonth();return n?s>=1&&s<=In[o]:s>=1&&s<=En[o]}set(a,s,r){return a.setDate(r),a.setHours(0,0,0,0),a}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class On extends I{priority=90;subpriority=1;parse(a,s,r){switch(s){case"D":case"DD":return R(Y.dayOfYear,a);case"Do":return r.ordinalNumber(a,{unit:"date"});default:return W(s.length,a)}}validate(a,s){const r=a.getFullYear();return ms(r)?s>=1&&s<=366:s>=1&&s<=365}set(a,s,r){return a.setMonth(0,r),a.setHours(0,0,0,0),a}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function Qt(t,a,s){const r=Gt(),n=s?.weekStartsOn??s?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,o=A(t),i=o.getDay(),u=(a%7+7)%7,l=7-n,d=a<0||a>6?a-(i+l)%7:(u+l)%7-(i+l)%7;return Q(o,d)}class An extends I{priority=90;parse(a,s,r){switch(s){case"E":case"EE":case"EEE":return r.day(a,{width:"abbreviated",context:"formatting"})||r.day(a,{width:"short",context:"formatting"})||r.day(a,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(a,{width:"short",context:"formatting"})||r.day(a,{width:"narrow",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})||r.day(a,{width:"abbreviated",context:"formatting"})||r.day(a,{width:"short",context:"formatting"})||r.day(a,{width:"narrow",context:"formatting"})}}validate(a,s){return s>=0&&s<=6}set(a,s,r,n){return a=Qt(a,r,n),a.setHours(0,0,0,0),a}incompatibleTokens=["D","i","e","c","t","T"]}class Rn extends I{priority=90;parse(a,s,r,n){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+n.weekStartsOn+6)%7+c};switch(s){case"e":case"ee":return $(W(s.length,a),o);case"eo":return $(r.ordinalNumber(a,{unit:"day"}),o);case"eee":return r.day(a,{width:"abbreviated",context:"formatting"})||r.day(a,{width:"short",context:"formatting"})||r.day(a,{width:"narrow",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"})||r.day(a,{width:"narrow",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})||r.day(a,{width:"abbreviated",context:"formatting"})||r.day(a,{width:"short",context:"formatting"})||r.day(a,{width:"narrow",context:"formatting"})}}validate(a,s){return s>=0&&s<=6}set(a,s,r,n){return a=Qt(a,r,n),a.setHours(0,0,0,0),a}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class Fn extends I{priority=90;parse(a,s,r,n){const o=i=>{const c=Math.floor((i-1)/7)*7;return(i+n.weekStartsOn+6)%7+c};switch(s){case"c":case"cc":return $(W(s.length,a),o);case"co":return $(r.ordinalNumber(a,{unit:"day"}),o);case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"})||r.day(a,{width:"short",context:"standalone"})||r.day(a,{width:"narrow",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"})||r.day(a,{width:"narrow",context:"standalone"});default:return r.day(a,{width:"wide",context:"standalone"})||r.day(a,{width:"abbreviated",context:"standalone"})||r.day(a,{width:"short",context:"standalone"})||r.day(a,{width:"narrow",context:"standalone"})}}validate(a,s){return s>=0&&s<=6}set(a,s,r,n){return a=Qt(a,r,n),a.setHours(0,0,0,0),a}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function Hn(t,a){const s=A(t),r=un(s),n=a-r;return Q(s,n)}
2class Wn extends I{priority=90;parse(a,s,r){const n=o=>o===0?7:o;switch(s){case"i":case"ii":return W(s.length,a);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return $(r.day(a,{width:"abbreviated",context:"formatting"})||r.day(a,{width:"short",context:"formatting"})||r.day(a,{width:"narrow",context:"formatting"}),n);case"iiiii":return $(r.day(a,{width:"narrow",context:"formatting"}),n);case"iiiiii":return $(r.day(a,{width:"short",context:"formatting"})||r.day(a,{width:"narrow",context:"formatting"}),n);default:return $(r.day(a,{width:"wide",context:"formatting"})||r.day(a,{width:"abbreviated",context:"formatting"})||r.day(a,{width:"short",context:"formatting"})||r.day(a,{width:"narrow",context:"formatting"}),n)}}validate(a,s){return s>=1&&s<=7}set(a,s,r){return a=Hn(a,r),a.setHours(0,0,0,0),a}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class Bn extends I{priority=80;parse(a,s,r){switch(s){case"a":case"aa":case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"})||r.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})||r.dayPeriod(a,{width:"abbreviated",context:"formatting"})||r.dayPeriod(a,{width:"narrow",context:"formatting"})}}set(a,s,r){return a.setHours(qt(r),0,0,0),a}incompatibleTokens=["b","B","H","k","t","T"]}class Yn extends I{priority=80;parse(a,s,r){switch(s){case"b":case"bb":case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"})||r.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})||r.dayPeriod(a,{width:"abbreviated",context:"formatting"})||r.dayPeriod(a,{width:"narrow",context:"formatting"})}}set(a,s,r){return a.setHours(qt(r),0,0,0),a}incompatibleTokens=["a","B","H","k","t","T"]}class $n extends I{priority=80;parse(a,s,r){switch(s){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"})||r.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})||r.dayPeriod(a,{width:"abbreviated",context:"formatting"})||r.dayPeriod(a,{width:"narrow",context:"formatting"})}}set(a,s,r){return a.setHours(qt(r),0,0,0),a}incompatibleTokens=["a","b","t","T"]}class zn extends I{priority=70;parse(a,s,r){switch(s){case"h":return R(Y.hour12h,a);case"ho":return r.ordinalNumber(a,{unit:"hour"});default:return W(s.length,a)}}validate(a,s){return s>=1&&s<=12}set(a,s,r){const n=a.getHours()>=12;return n&&r<12?a.setHours(r+12,0,0,0):!n&&r===12?a.setHours(0,0,0,0):a.setHours(r,0,0,0),a}incompatibleTokens=["H","K","k","t","T"]}class Gn extends I{priority=70;parse(a,s,r){switch(s){case"H":return R(Y.hour23h,a);case"Ho":return r.ordinalNumber(a,{unit:"hour"});default:return W(s.length,a)}}validate(a,s){return s>=0&&s<=23}set(a,s,r){return a.setHours(r,0,0,0),a}incompatibleTokens=["a","b","h","K","k","t","T"]}class Vn extends I{priority=70;parse(a,s,r){switch(s){case"K":return R(Y.hour11h,a);case"Ko":return r.ordinalNumber(a,{unit:"hour"});default:return W(s.length,a)}}validate(a,s){return s>=0&&s<=11}set(a,s,r){return a.getHours()>=12&&r<12?a.setHours(r+12,0,0,0):a.setHours(r,0,0,0),a}incompatibleTokens=["h","H","k","t","T"]}class Un extends I{priority=70;parse(a,s,r){switch(s){case"k":return R(Y.hour24h,a);case"ko":return r.ordinalNumber(a,{unit:"hour"});default:return W(s.length,a)}}validate(a,s){return s>=1&&s<=24}set(a,s,r){const n=r<=24?r%24:r;return a.setHours(n,0,0,0),a}incompatibleTokens=["a","b","h","H","K","t","T"]}class qn extends I{priority=60;parse(a,s,r){switch(s){case"m":return R(Y.minute,a);case"mo":return r.ordinalNumber(a,{unit:"minute"});default:return W(s.length,a)}}validate(a,s){return s>=0&&s<=59}set(a,s,r){return a.setMinutes(r,0,0),a}incompatibleTokens=["t","T"]}class Qn extends I{priority=50;parse(a,s,r){switch(s){case"s":return R(Y.second,a);case"so":return r.ordinalNumber(a,{unit:"second"});default:return W(s.length,a)}}validate(a,s){return s>=0&&s<=59}set(a,s,r){return a.setSeconds(r,0),a}incompatibleTokens=["t","T"]}class Kn extends I{priority=30;parse(a,s){const r=n=>Math.trunc(n*Math.pow(10,-s.length+3));return $(W(s.length,a),r)}set(a,s,r){return a.setMilliseconds(r),a}incompatibleTokens=["t","T"]}class Xn extends I{priority=10;parse(a,s){switch(s){case"X":return le(ie.basicOptionalMinutes,a);case"XX":return le(ie.basic,a);case"XXXX":return le(ie.basicOptionalSeconds,a);case"XXXXX":return le(ie.extendedOptionalSeconds,a);default:return le(ie.extended,a)}}set(a,s,r){return s.timestampIsSet?a:U(a,a.getTime()-ft(a)-r)}incompatibleTokens=["t","T","x"]}class Zn extends I{priority=10;parse(a,s){switch(s){case"x":return le(ie.basicOptionalMinutes,a);case"xx":return le(ie.basic,a);case"xxxx":return le(ie.basicOptionalSeconds,a);case"xxxxx":return le(ie.extendedOptionalSeconds,a);default:return le(ie.extended,a)}}set(a,s,r){return s.timestampIsSet?a:U(a,a.getTime()-ft(a)-r)}incompatibleTokens=["t","T","X"]}class Jn extends I{priority=40;parse(a){return ds(a)}set(a,s,r){return[U(a,r*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class eo extends I{priority=20;parse(a){return ds(a)}set(a,s,r){return[U(a,r),{timestampIsSet:!0}]}incompatibleTokens="*"}const to={G:new vn,y:new bn,Y:new wn,R:new jn,u:new Nn,Q:new kn,q:new Cn,M:new _n,L:new Dn,w:new Tn,I:new Sn,d:new Ln,D:new On,E:new An,e:new Rn,c:new Fn,i:new Wn,a:new Bn,b:new Yn,B:new $n,h:new zn,H:new Gn,K:new Vn,k:new Un,m:new qn,s:new Qn,S:new Kn,X:new Xn,x:new Zn,t:new Jn,T:new eo},ao=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,so=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ro=/^'([^]*?)'?$/,no=/''/g,oo=/\S/,io=/[a-zA-Z]/;function Na(t,a,s,r){const n=dn(),o=n.locale??Ya,i=n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,c=n.weekStartsOn??n.locale?.options?.weekStartsOn??0,u={firstWeekContainsDate:i,weekStartsOn:c,locale:o},l=[new yn],d=a.match(so).map(g=>{const v=g[0];if(v in wa){const D=wa[v];return D(g,o.formatLong)}return g}).join("").match(ao),h=[];for(let g of d){Fr(g)&&ja(g,a,t),Hr(g)&&ja(g,a,t);const v=g[0],D=to[v];if(D){const{incompatibleTokens:b}=D;if(Array.isArray(b)){const z=h.find(G=>b.includes(G.token)||G.token===v);
2if(z)throw new RangeError(`The format string mustn't contain \`${z.fullToken}\` and \`${g}\` at the same time`)}else if(D.incompatibleTokens==="*"&&h.length>0)throw new RangeError(`The format string mustn't contain \`${g}\` and any other token at the same time`);h.push({token:v,fullToken:g});const S=D.run(t,g,o.match,u);if(!S)return U(s,NaN);l.push(S.setter),t=S.rest}else{if(v.match(io))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");if(g==="''"?g="'":v==="'"&&(g=lo(g)),t.indexOf(g)===0)t=t.slice(g.length);else return U(s,NaN)}}if(t.length>0&&oo.test(t))return U(s,NaN);const m=l.map(g=>g.priority).sort((g,v)=>v-g).filter((g,v,D)=>D.indexOf(g)===v).map(g=>l.filter(v=>v.priority===g).sort((v,D)=>D.subPriority-v.subPriority)).map(g=>g[0]);let f=A(s);if(isNaN(f.getTime()))return U(s,NaN);const y={};for(const g of m){if(!g.validate(f,u))return U(s,NaN);const v=g.set(f,y,u);Array.isArray(v)?(f=v[0],Object.assign(y,v[1])):f=v}return U(s,f)}function lo(t){return t.match(ro)[1].replace(no,"'")}function Kt(t,a){const s=A(t),r=A(a);return s.getFullYear()===r.getFullYear()&&s.getMonth()===r.getMonth()}function co(t,a){const s=A(t),r=A(a);return s.getFullYear()===r.getFullYear()}function It(t,a){return Q(t,-a)}function Lt(t,a){const s=A(t),r=s.getFullYear(),n=s.getDate(),o=U(t,0);o.setFullYear(r,a,15),o.setHours(0,0,0,0);const i=cn(o);return s.setMonth(a,Math.min(n,i)),s}function ka(t,a){const s=A(t);return isNaN(+s)?U(t,NaN):(s.setFullYear(a),s)}function uo(t,a){return Qe(t,-1)}var _=function(){return _=Object.assign||function(a){for(var s,r=1,n=arguments.length;r<n;r++){s=arguments[r];for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(a[o]=s[o])}return a},_.apply(this,arguments)};function mo(t,a){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&a.indexOf(r)<0&&(s[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(t);n<r.length;n++)a.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(t,r[n])&&(s[r[n]]=t[r[n]]);return s}function hs(t,a,s){for(var r=0,n=a.length,o;r<n;r++)(o||!(r in a))&&(o||(o=Array.prototype.slice.call(a,0,r)),o[r]=a[r]);return t.concat(o||Array.prototype.slice.call(a))}function et(t){return t.mode==="multiple"}function tt(t){return t.mode==="range"}function Nt(t){return t.mode==="single"}var ho={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function po(t,a){return H(t,"LLLL y",a)}function fo(t,a){return H(t,"d",a)}function xo(t,a){return H(t,"LLLL",a)}function go(t){return"".concat(t)}function yo(t,a){return H(t,"cccccc",a)}function vo(t,a){return H(t,"yyyy",a)}var bo=Object.freeze({__proto__:null,formatCaption:po,formatDay:fo,formatMonthCaption:xo,formatWeekNumber:go,formatWeekdayName:yo,formatYearCaption:vo}),wo=function(t,a,s){return H(t,"do MMMM (EEEE)",s)},jo=function(){return"Month: "},No=function(){return"Go to next month"},ko=function(){return"Go to previous month"},Co=function(t,a){return H(t,"cccc",a)},_o=function(t){return"Week n. ".concat(t)},Do=function(){return"Year: "},Po=Object.freeze({__proto__:null,labelDay:wo,labelMonthDropdown:jo,labelNext:No,labelPrevious:ko,labelWeekNumber:_o,labelWeekday:Co,labelYearDropdown:Do});function To(){var t="buttons",a=ho,s=Ya,r={},n={},o=1,i={},c=new Date;return{captionLayout:t,classNames:a,formatters:bo,labels:Po,locale:s,modifiersClassNames:r,modifiers:n,numberOfMonths:o,styles:i,today:c,mode:"default"}}function Mo(t){var a=t.fromYear,s=t.toYear,r=t.fromMonth,n=t.toMonth,o=t.fromDate,i=t.toDate;return r?o=te(r):a&&(o=new Date(a,0,1)),n?i=Vt(n):s&&(i=new Date(s,11,31)),{fromDate:o?Pe(o):void 0,toDate:i?Pe(i):void 0}}var ps=x.createContext(void 0);function So(t){var a,s=t.initialProps,r=To(),n=Mo(s),o=n.fromDate,i=n.toDate,c=(a=s.captionLayout)!==null&&a!==void 0?a:r.captionLayout;c!=="buttons"&&(!o||!i)&&(c="buttons");var u;(Nt(s)||et(s)||tt(s))&&(u=s.onSelect);var l=_(_(_({},r),s),{captionLayout:c,classNames:_(_({},r.classNames),s.classNames),components:_({},s.components),formatters:_(_({},r.formatters),s.formatters),fromDate:o,labels:_(_({},r.labels),s.labels),mode:s.mode||r.mode,modifiers:_(_({},r.modifiers),s.modifiers),modifiersClassNames:_(_({},r.modifiersClassNames),s.modifiersClassNames),onSelect:u,styles:_(_({},r.styles),s.styles),toDate:i});return e.jsx(ps.Provider,{value:l,children:t.children})}function O(){var t=x.useContext(ps);if(!t)throw new Error("useDayPicker must be used within a DayPickerProvider.");return t}function fs(t){var a=O(),s=a.locale,r=a.classNames,n=a.styles,o=a.formatters.formatCaption;return e.jsx("div",{className:r.caption_label,style:n.caption_label,"aria-live":"polite",role:"presentation",id:t.id,children:o(t.displayMonth,{locale:s})})}function Eo(t){return e.jsx("svg",_({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},t,{children:e.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.7
278175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function xs(t){var a,s,r=t.onChange,n=t.value,o=t.children,i=t.caption,c=t.className,u=t.style,l=O(),d=(s=(a=l.components)===null||a===void 0?void 0:a.IconDropdown)!==null&&s!==void 0?s:Eo;return e.jsxs("div",{className:c,style:u,children:[e.jsx("span",{className:l.classNames.vhidden,children:t["aria-label"]}),e.jsx("select",{name:t.name,"aria-label":t["aria-label"],className:l.classNames.dropdown,style:l.styles.dropdown,value:n,onChange:r,children:o}),e.jsxs("div",{className:l.classNames.caption_label,style:l.styles.caption_label,"aria-hidden":"true",children:[i,e.jsx(d,{className:l.classNames.dropdown_icon,style:l.styles.dropdown_icon})]})]})}function Io(t){var a,s=O(),r=s.fromDate,n=s.toDate,o=s.styles,i=s.locale,c=s.formatters.formatMonthCaption,u=s.classNames,l=s.components,d=s.labels.labelMonthDropdown;if(!r)return e.jsx(e.Fragment,{});if(!n)return e.jsx(e.Fragment,{});var h=[];if(co(r,n))for(var m=te(r),f=r.getMonth();f<=n.getMonth();f++)h.push(Lt(m,f));else for(var m=te(new Date),f=0;f<=11;f++)h.push(Lt(m,f));var y=function(v){var D=Number(v.target.value),b=Lt(te(t.displayMonth),D);t.onChange(b)},g=(a=l?.Dropdown)!==null&&a!==void 0?a:xs;return e.jsx(g,{name:"months","aria-label":d(),className:u.dropdown_month,style:o.dropdown_month,onChange:y,value:t.displayMonth.getMonth(),caption:c(t.displayMonth,{locale:i}),children:h.map(function(v){return e.jsx("option",{value:v.getMonth(),children:c(v,{locale:i})},v.getMonth())})})}function Lo(t){var a,s=t.displayMonth,r=O(),n=r.fromDate,o=r.toDate,i=r.locale,c=r.styles,u=r.classNames,l=r.components,d=r.formatters.formatYearCaption,h=r.labels.labelYearDropdown,m=[];if(!n)return e.jsx(e.Fragment,{});if(!o)return e.jsx(e.Fragment,{});for(var f=n.getFullYear(),y=o.getFullYear(),g=f;g<=y;g++)m.push(ka(Wr(new Date),g));var v=function(b){var S=ka(te(s),Number(b.target.value));t.onChange(S)},D=(a=l?.Dropdown)!==null&&a!==void 0?a:xs;return e.jsx(D,{name:"years","aria-label":h(),className:u.dropdown_year,style:c.dropdown_year,onChange:v,value:s.getFullYear(),caption:d(s,{locale:i}),children:m.map(function(b){return e.jsx("option",{value:b.getFullYear(),children:d(b,{locale:i})},b.getFullYear())})})}function Oo(t,a){var s=x.useState(t),r=s[0],n=s[1],o=a===void 0?r:a;return[o,n]}function Ao(t){var a=t.month,s=t.defaultMonth,r=t.today,n=a||s||r||new Date,o=t.toDate,i=t.fromDate,c=t.numberOfMonths,u=c===void 0?1:c;if(o&&Ue(o,n)<0){var l=-1*(u-1);n=se(o,l)}return i&&Ue(n,i)<0&&(n=i),te(n)}function Ro(){var t=O(),a=Ao(t),s=Oo(a,t.month),r=s[0],n=s[1],o=function(i){var c;if(!t.disableNavigation){var u=te(i);n(u),(c=t.onMonthChange)===null||c===void 0||c.call(t,u)}};return[r,o]}function Fo(t,a){for(var s=a.reverseMonths,r=a.numberOfMonths,n=te(t),o=te(se(n,r)),i=Ue(o,n),c=[],u=0;u<i;u++){var l=se(n,u);c.push(l)}return s&&(c=c.reverse()),c}function Ho(t,a){if(!a.disableNavigation){var s=a.toDate,r=a.pagedNavigation,n=a.numberOfMonths,o=n===void 0?1:n,i=r?o:1,c=te(t);if(!s)return se(c,i);var u=Ue(s,t);if(!(u<o))return se(c,i)}}function Wo(t,a){if(!a.disableNavigation){var s=a.fromDate,r=a.pagedNavigation,n=a.numberOfMonths,o=n===void 0?1:n,i=r?o:1,c=te(t);if(!s)return se(c,-i);var u=Ue(c,s);if(!(u<=0))return se(c,-i)}}var gs=x.createContext(void 0);function Bo(t){var a=O(),s=Ro(),r=s[0],n=s[1],o=Fo(r,a),i=Ho(r,a),c=Wo(r,a),u=function(h){return o.some(function(m){return Kt(h,m)})},l=function(h,m){u(h)||(m&&ls(h,m)?n(se(h,1+a.numberOfMonths*-1)):n(h))},d={currentMonth:r,displayMonths:o,goToMonth:n,goToDate:l,previousMonth:c,nextMonth:i,isDateDisplayed:u};return e.jsx(gs.Provider,{value:d,children:t.children})}function at(){var t=x.useContext(gs);if(!t)throw new Error("useNavigation must be used within a NavigationProvider");return t}function Ca(t){var a,s=O(),r=s.classNames,n=s.styles,o=s.components,i=at().goToMonth,c=function(d){i(se(d,t.dis
2playIndex?-t.displayIndex:0))},u=(a=o?.CaptionLabel)!==null&&a!==void 0?a:fs,l=e.jsx(u,{id:t.id,displayMonth:t.displayMonth});return e.jsxs("div",{className:r.caption_dropdowns,style:n.caption_dropdowns,children:[e.jsx("div",{className:r.vhidden,children:l}),e.jsx(Io,{onChange:c,displayMonth:t.displayMonth}),e.jsx(Lo,{onChange:c,displayMonth:t.displayMonth})]})}function Yo(t){return e.jsx("svg",_({width:"16px",height:"16px",viewBox:"0 0 120 120"},t,{children:e.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function $o(t){return e.jsx("svg",_({width:"16px",height:"16px",viewBox:"0 0 120 120"},t,{children:e.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var yt=x.forwardRef(function(t,a){var s=O(),r=s.classNames,n=s.styles,o=[r.button_reset,r.button];t.className&&o.push(t.className);var i=o.join(" "),c=_(_({},n.button_reset),n.button);return t.style&&Object.assign(c,t.style),e.jsx("button",_({},t,{ref:a,type:"button",className:i,style:c}))});function zo(t){var a,s,r=O(),n=r.dir,o=r.locale,i=r.classNames,c=r.styles,u=r.labels,l=u.labelPrevious,d=u.labelNext,h=r.components;if(!t.nextMonth&&!t.previousMonth)return e.jsx(e.Fragment,{});var m=l(t.previousMonth,{locale:o}),f=[i.nav_button,i.nav_button_previous].join(" "),y=d(t.nextMonth,{locale:o}),g=[i.nav_button,i.nav_button_next].join(" "),v=(a=h?.IconRight)!==null&&a!==void 0?a:$o,D=(s=h?.IconLeft)!==null&&s!==void 0?s:Yo;return e.jsxs("div",{className:i.nav,style:c.nav,children:[!t.hidePrevious&&e.jsx(yt,{name:"previous-month","aria-label":m,className:f,style:c.nav_button_previous,disabled:!t.previousMonth,onClick:t.onPreviousClick,children:n==="rtl"?e.jsx(v,{className:i.nav_icon,style:c.nav_icon}):e.jsx(D,{className:i.nav_icon,style:c.nav_icon})}),!t.hideNext&&e.jsx(yt,{name:"next-month","aria-label":y,className:g,style:c.nav_button_next,disabled:!t.nextMonth,onClick:t.onNextClick,children:n==="rtl"?e.jsx(D,{className:i.nav_icon,style:c.nav_icon}):e.jsx(v,{className:i.nav_icon,style:c.nav_icon})})]})}function _a(t){var a=O().numberOfMonths,s=at(),r=s.previousMonth,n=s.nextMonth,o=s.goToMonth,i=s.displayMonths,c=i.findIndex(function(y){return Kt(t.displayMonth,y)}),u=c===0,l=c===i.length-1,d=a>1&&(u||!l),h=a>1&&(l||!u),m=function(){r&&o(r)},f=function(){n&&o(n)};return e.jsx(zo,{displayMonth:t.displayMonth,hideNext:d,hidePrevious:h,nextMonth:n,previousMonth:r,onPreviousClick:m,onNextClick:f})}function Go(t){var a,s=O(),r=s.classNames,n=s.disableNavigation,o=s.styles,i=s.captionLayout,c=s.components,u=(a=c?.CaptionLabel)!==null&&a!==void 0?a:fs,l;return n?l=e.jsx(u,{id:t.id,displayMonth:t.displayMonth}):i==="dropdown"?l=e.jsx(Ca,{displayMonth:t.displayMonth,id:t.id}):i==="dropdown-buttons"?l=e.jsxs(e.Fragment,{children:[e.jsx(Ca,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id}),e.jsx(_a,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id})]}):l=e.jsxs(e.Fragment,{children:[e.jsx(u,{id:t.id,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),e.jsx(_a,{displayMonth:t.displayMonth,id:t.id})]}),e.jsx("div",{className:r.caption,style:o.caption,children:l})}function Vo(t){var a=O(),s=a.footer,r=a.styles,n=a.classNames.tfoot;return s?e.jsx("tfoot",{className:n,style:r.tfoot,children:e.jsx("tr",{children:e.jsx("td",{colSpan:8,children:s})})}):e.jsx(e.Fragment,{})}function Uo(t,a,s){for(var r=s?Xe(new Date):de(new Date,{locale:t,weekStartsOn:a}),n=[],o=0;o<7;o++){var i=Q(r,o);n.push(i)}return n}function qo(){var t=O(),a=t.classNames,s=t.styles,r=t.showWeekNumber,n=t.locale,o=t.weekStartsOn,i=t.ISOWeek,c=t.formatters.formatWeekdayName,u=t.labels.labelWeekday,l=Uo(n,o,i);return e.jsxs("tr",{style:s.head_row,className:a.head_row,children:[r&&e.jsx("td",{style:s.head_cell,className:a.head_cell}),l.map(function(d,h){return e.jsx("th",{scope:"col",className:a.head_cell,style:s.head_cell,"aria-label":u(d,{locale:n}),children:c(d,{locale:n})},h)})]})}function Qo(){var t,a=O(),s=a.classNames,r=a.styles,n=a.components,o=(t=n?.HeadRow)!==null&&t!==void 0?t:qo;return e.jsx("thead",{style:r.head,className:s.head,children:e.jsx(o,{})})}function Ko(t){var a=O(),s=a.locale,r=a.formatters.formatDay;return e.jsx(e.Fragment,{children:r(t.date,{locale:s})})}var Xt=x.createContext(void 0);function Xo(t){if(!et(t.initialProps)){var a={selected:void 0,modifiers:{disabled:[]}};return e.jsx(Xt.Provider,{value:a,children:t.children})}return e.jsx(Zo,{initialProps:t.initialProps,children:t.children})}function Zo(t){var a=t.initialProps,s=t.children,r=a.selected,n=a.min,o=a.max,i=function(l,d,h){var m,f;
2(m=a.onDayClick)===null||m===void 0||m.call(a,l,d,h);var y=!!(d.selected&&n&&r?.length===n);if(!y){var g=!!(!d.selected&&o&&r?.length===o);if(!g){var v=r?hs([],r):[];if(d.selected){var D=v.findIndex(function(b){return K(l,b)});v.splice(D,1)}else v.push(l);(f=a.onSelect)===null||f===void 0||f.call(a,v,l,d,h)}}},c={disabled:[]};r&&c.disabled.push(function(l){var d=o&&r.length>o-1,h=r.some(function(m){return K(m,l)});return!!(d&&!h)});var u={selected:r,onDayClick:i,modifiers:c};return e.jsx(Xt.Provider,{value:u,children:s})}function Zt(){var t=x.useContext(Xt);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}function Jo(t,a){var s=a||{},r=s.from,n=s.to;return r&&n?K(n,t)&&K(r,t)?void 0:K(n,t)?{from:n,to:void 0}:K(r,t)?void 0:Ke(r,t)?{from:t,to:n}:{from:r,to:t}:n?Ke(t,n)?{from:n,to:t}:{from:t,to:n}:r?ls(t,r)?{from:t,to:r}:{from:r,to:t}:{from:t,to:void 0}}var Jt=x.createContext(void 0);function ei(t){if(!tt(t.initialProps)){var a={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return e.jsx(Jt.Provider,{value:a,children:t.children})}return e.jsx(ti,{initialProps:t.initialProps,children:t.children})}function ti(t){var a=t.initialProps,s=t.children,r=a.selected,n=r||{},o=n.from,i=n.to,c=a.min,u=a.max,l=function(f,y,g){var v,D;(v=a.onDayClick)===null||v===void 0||v.call(a,f,y,g);var b=Jo(f,r);(D=a.onSelect)===null||D===void 0||D.call(a,b,f,y,g)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(o?(d.range_start=[o],i?(d.range_end=[i],K(o,i)||(d.range_middle=[{after:o,before:i}])):d.range_end=[o]):i&&(d.range_start=[i],d.range_end=[i]),c&&(o&&!i&&d.disabled.push({after:It(o,c-1),before:Q(o,c-1)}),o&&i&&d.disabled.push({after:o,before:Q(o,c-1)}),!o&&i&&d.disabled.push({after:It(i,c-1),before:Q(i,c-1)})),u){if(o&&!i&&(d.disabled.push({before:Q(o,-u+1)}),d.disabled.push({after:Q(o,u-1)})),o&&i){var h=me(i,o)+1,m=u-h;d.disabled.push({before:It(o,m)}),d.disabled.push({after:Q(i,m)})}!o&&i&&(d.disabled.push({before:Q(i,-u+1)}),d.disabled.push({after:Q(i,u-1)}))}return e.jsx(Jt.Provider,{value:{selected:r,onDayClick:l,modifiers:d},children:s})}function ea(){var t=x.useContext(Jt);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function ht(t){return Array.isArray(t)?hs([],t):t!==void 0?[t]:[]}function ai(t){var a={};return Object.entries(t).forEach(function(s){var r=s[0],n=s[1];a[r]=ht(n)}),a}var re;(function(t){t.Outside="outside",t.Disabled="disabled",t.Selected="selected",t.Hidden="hidden",t.Today="today",t.RangeStart="range_start",t.RangeEnd="range_end",t.RangeMiddle="range_middle"})(re||(re={}));var si=re.Selected,ue=re.Disabled,ri=re.Hidden,ni=re.Today,Ot=re.RangeEnd,At=re.RangeMiddle,Rt=re.RangeStart,oi=re.Outside;function ii(t,a,s){var r,n=(r={},r[si]=ht(t.selected),r[ue]=ht(t.disabled),r[ri]=ht(t.hidden),r[ni]=[t.today],r[Ot]=[],r[At]=[],r[Rt]=[],r[oi]=[],r);return t.fromDate&&n[ue].push({before:t.fromDate}),t.toDate&&n[ue].push({after:t.toDate}),et(t)?n[ue]=n[ue].concat(a.modifiers[ue]):tt(t)&&(n[ue]=n[ue].concat(s.modifiers[ue]),n[Rt]=s.modifiers[Rt],n[At]=s.modifiers[At],n[Ot]=s.modifiers[Ot]),n}var ys=x.createContext(void 0);function li(t){var a=O(),s=Zt(),r=ea(),n=ii(a,s,r),o=ai(a.modifiers),i=_(_({},n),o);return e.jsx(ys.Provider,{value:i,children:t.children})}function vs(){var t=x.useContext(ys);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function ci(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function di(t){return!!(t&&typeof t=="object"&&"from"in t)}function ui(t){return!!(t&&typeof t=="object"&&"after"in t)}function mi(t){return!!(t&&typeof t=="object"&&"before"in t)}function hi(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function pi(t,a){var s,r=a.from,n=a.to;if(r&&n){var o=me(n,r)<0;o&&(s=[n,r],r=s[0],n=s[1]);var i=me(t,r)>=0&&me(n,t)>=0;return i}return n?K(n,t):r?K(r,t):!1}function fi(t){return Ga(t)}function xi(t){return Array.isArray(t)&&t.every(Ga)}function gi(t,a){return a.some(function(s){if(typeof s=="boolean")return s;if(fi(s))return K(t,s);if(xi(s))return s.includes(t);if(di(s))return pi(t,s);if(hi(s))return s.dayOfWeek.includes(t.getDay());if(ci(s)){var r=me(s.before,t),n=me(s.after,t),o=r>
20,i=n<0,c=Ke(s.before,s.after);return c?i&&o:o||i}return ui(s)?me(t,s.after)>0:mi(s)?me(s.before,t)>0:typeof s=="function"?s(t):!1})}function ta(t,a,s){var r=Object.keys(a).reduce(function(o,i){var c=a[i];return gi(t,c)&&o.push(i),o},[]),n={};return r.forEach(function(o){return n[o]=!0}),s&&!Kt(t,s)&&(n.outside=!0),n}function yi(t,a){for(var s=te(t[0]),r=Vt(t[t.length-1]),n,o,i=s;i<=r;){var c=ta(i,a),u=!c.disabled&&!c.hidden;if(!u){i=Q(i,1);continue}if(c.selected)return i;c.today&&!o&&(o=i),n||(n=i),i=Q(i,1)}return o||n}var vi=365;function bs(t,a){var s=a.moveBy,r=a.direction,n=a.context,o=a.modifiers,i=a.retry,c=i===void 0?{count:0,lastFocused:t}:i,u=n.weekStartsOn,l=n.fromDate,d=n.toDate,h=n.locale,m={day:Q,week:Qe,month:se,year:rn,startOfWeek:function(v){return n.ISOWeek?Xe(v):de(v,{locale:h,weekStartsOn:u})},endOfWeek:function(v){return n.ISOWeek?is(v):jt(v,{locale:h,weekStartsOn:u})}},f=m[s](t,r==="after"?1:-1);r==="before"&&l?f=nn([l,f]):r==="after"&&d&&(f=on([d,f]));var y=!0;if(o){var g=ta(f,o);y=!g.disabled&&!g.hidden}return y?f:c.count>vi?c.lastFocused:bs(f,{moveBy:s,direction:r,context:n,modifiers:o,retry:_(_({},c),{count:c.count+1})})}var ws=x.createContext(void 0);function bi(t){var a=at(),s=vs(),r=x.useState(),n=r[0],o=r[1],i=x.useState(),c=i[0],u=i[1],l=yi(a.displayMonths,s),d=n??(c&&a.isDateDisplayed(c))?c:l,h=function(){u(n),o(void 0)},m=function(v){o(v)},f=O(),y=function(v,D){if(n){var b=bs(n,{moveBy:v,direction:D,context:f,modifiers:s});K(n,b)||(a.goToDate(b,n),m(b))}},g={focusedDay:n,focusTarget:d,blur:h,focus:m,focusDayAfter:function(){return y("day","after")},focusDayBefore:function(){return y("day","before")},focusWeekAfter:function(){return y("week","after")},focusWeekBefore:function(){return y("week","before")},focusMonthBefore:function(){return y("month","before")},focusMonthAfter:function(){return y("month","after")},focusYearBefore:function(){return y("year","before")},focusYearAfter:function(){return y("year","after")},focusStartOfWeek:function(){return y("startOfWeek","before")},focusEndOfWeek:function(){return y("endOfWeek","after")}};return e.jsx(ws.Provider,{value:g,children:t.children})}function aa(){var t=x.useContext(ws);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}function wi(t,a){var s=vs(),r=ta(t,s,a);return r}var sa=x.createContext(void 0);function ji(t){if(!Nt(t.initialProps)){var a={selected:void 0};return e.jsx(sa.Provider,{value:a,children:t.children})}return e.jsx(Ni,{initialProps:t.initialProps,children:t.children})}function Ni(t){var a=t.initialProps,s=t.children,r=function(o,i,c){var u,l,d;if((u=a.onDayClick)===null||u===void 0||u.call(a,o,i,c),i.selected&&!a.required){(l=a.onSelect)===null||l===void 0||l.call(a,void 0,o,i,c);return}(d=a.onSelect)===null||d===void 0||d.call(a,o,o,i,c)},n={selected:a.selected,onDayClick:r};return e.jsx(sa.Provider,{value:n,children:s})}function js(){var t=x.useContext(sa);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function ki(t,a){var s=O(),r=js(),n=Zt(),o=ea(),i=aa(),c=i.focusDayAfter,u=i.focusDayBefore,l=i.focusWeekAfter,d=i.focusWeekBefore,h=i.blur,m=i.focus,f=i.focusMonthBefore,y=i.focusMonthAfter,g=i.focusYearBefore,v=i.focusYearAfter,D=i.focusStartOfWeek,b=i.focusEndOfWeek,S=function(k){var N,Be,Ne,Ye;Nt(s)?(N=r.onDayClick)===null||N===void 0||N.call(r,t,a,k):et(s)?(Be=n.onDayClick)===null||Be===void 0||Be.call(n,t,a,k):tt(s)?(Ne=o.onDayClick)===null||Ne===void 0||Ne.call(o,t,a,k):(Ye=s.onDayClick)===null||Ye===void 0||Ye.call(s,t,a,k)},z=function(k){var N;m(t),(N=s.onDayFocus)===null||N===void 0||N.call(s,t,a,k)},G=function(k){var N;h(),(N=s.onDayBlur)===null||N===void 0||N.call(s,t,a,k)},J=function(k){var N;(N=s.onDayMouseEnter)===null||N===void 0||N.call(s,t,a,k)},j=function(k){var N;(N=s.onDayMouseLeave)===null||N===void 0||N.call(s,t,a,k)},T=function(k){var N;(N=s.onDayPointerEnter)===null||N===void 0||N.call(s,t,a,k)},q=function(k){var N;(N=s.onDayPointerLeave)===null||N===void 0||N.call(s,t,a,k)},B=function(k){var N;(N=s.onDayTouchCancel)===null||N===void 0||N.call(s,t,a,k)},ne=function(k){var N;(N=s.onDayTouchEnd)===null||N===void 0||N.call(s,t,a,k)},Se=function(k){var N;(N=s.onDayTouchMove)===null||N===void 0||N.call(s,t,a,k)},We=function(k){var N;(N=s.onDayTouchStart)===null||N===void 0||N.call(s,t,a,k)},st=function(k){var N;(N=s.onDayKeyUp)===null||N===void 0||N.call(s,t,a,k)},pe=function(k){var N;switch(k.key){case"ArrowLeft":k.preventDefault(),k.stopPropagation(),s.dir==="rtl"?c():u();break;case"ArrowRight":k.preventDefault(),k.stopPropagation(),s.dir==="rtl"?u():c();break;case"ArrowDown":k.preventDefault(),k.stopPropagation(),l();break;case"ArrowUp":k.preventDefault(),k.stopPropagation(),d();break;
2case"PageUp":k.preventDefault(),k.stopPropagation(),k.shiftKey?g():f();break;case"PageDown":k.preventDefault(),k.stopPropagation(),k.shiftKey?v():y();break;case"Home":k.preventDefault(),k.stopPropagation(),D();break;case"End":k.preventDefault(),k.stopPropagation(),b();break}(N=s.onDayKeyDown)===null||N===void 0||N.call(s,t,a,k)},rt={onClick:S,onFocus:z,onBlur:G,onKeyDown:pe,onKeyUp:st,onMouseEnter:J,onMouseLeave:j,onPointerEnter:T,onPointerLeave:q,onTouchCancel:B,onTouchEnd:ne,onTouchMove:Se,onTouchStart:We};return rt}function Ci(){var t=O(),a=js(),s=Zt(),r=ea(),n=Nt(t)?a.selected:et(t)?s.selected:tt(t)?r.selected:void 0;return n}function _i(t){return Object.values(re).includes(t)}function Di(t,a){var s=[t.classNames.day];return Object.keys(a).forEach(function(r){var n=t.modifiersClassNames[r];if(n)s.push(n);else if(_i(r)){var o=t.classNames["day_".concat(r)];o&&s.push(o)}}),s}function Pi(t,a){var s=_({},t.styles.day);return Object.keys(a).forEach(function(r){var n;s=_(_({},s),(n=t.modifiersStyles)===null||n===void 0?void 0:n[r])}),s}function Ti(t,a,s){var r,n,o,i=O(),c=aa(),u=wi(t,a),l=ki(t,u),d=Ci(),h=!!(i.onDayClick||i.mode!=="default");x.useEffect(function(){var J;u.outside||c.focusedDay&&h&&K(c.focusedDay,t)&&((J=s.current)===null||J===void 0||J.focus())},[c.focusedDay,t,s,h,u.outside]);var m=Di(i,u).join(" "),f=Pi(i,u),y=!!(u.outside&&!i.showOutsideDays||u.hidden),g=(o=(n=i.components)===null||n===void 0?void 0:n.DayContent)!==null&&o!==void 0?o:Ko,v=e.jsx(g,{date:t,displayMonth:a,activeModifiers:u}),D={style:f,className:m,children:v,role:"gridcell"},b=c.focusTarget&&K(c.focusTarget,t)&&!u.outside,S=c.focusedDay&&K(c.focusedDay,t),z=_(_(_({},D),(r={disabled:u.disabled,role:"gridcell"},r["aria-selected"]=u.selected,r.tabIndex=S||b?0:-1,r)),l),G={isButton:h,isHidden:y,activeModifiers:u,selectedDays:d,buttonProps:z,divProps:D};return G}function Mi(t){var a=x.useRef(null),s=Ti(t.date,t.displayMonth,a);return s.isHidden?e.jsx("div",{role:"gridcell"}):s.isButton?e.jsx(yt,_({name:"day",ref:a},s.buttonProps)):e.jsx("div",_({},s.divProps))}function Si(t){var a=t.number,s=t.dates,r=O(),n=r.onWeekNumberClick,o=r.styles,i=r.classNames,c=r.locale,u=r.labels.labelWeekNumber,l=r.formatters.formatWeekNumber,d=l(Number(a),{locale:c});if(!n)return e.jsx("span",{className:i.weeknumber,style:o.weeknumber,children:d});var h=u(Number(a),{locale:c}),m=function(f){n(a,s,f)};return e.jsx(yt,{name:"week-number","aria-label":h,className:i.weeknumber,style:o.weeknumber,onClick:m,children:d})}function Ei(t){var a,s,r=O(),n=r.styles,o=r.classNames,i=r.showWeekNumber,c=r.components,u=(a=c?.Day)!==null&&a!==void 0?a:Mi,l=(s=c?.WeekNumber)!==null&&s!==void 0?s:Si,d;return i&&(d=e.jsx("td",{className:o.cell,style:n.cell,children:e.jsx(l,{number:t.weekNumber,dates:t.dates})})),e.jsxs("tr",{className:o.row,style:n.row,children:[d,t.dates.map(function(h){return e.jsx("td",{className:o.cell,style:n.cell,role:"presentation",children:e.jsx(u,{displayMonth:t.displayMonth,date:h})},mn(h))})]})}function Da(t,a,s){for(var r=s?.ISOWeek?is(a):jt(a,s),n=s?.ISOWeek?Xe(t):de(t,s),o=me(r,n),i=[],c=0;c<=o;c++)i.push(Q(n,c));var u=i.reduce(function(l,d){var h=s?.ISOWeek?za(d):$a(d,s),m=l.find(function(f){return f.weekNumber===h});return m?(m.dates.push(d),l):(l.push({weekNumber:h,dates:[d]}),l)},[]);return u}function Ii(t,a){var s=Da(te(t),Vt(t),a);if(a?.useFixedWeeks){var r=pn(t,a);if(r<6){var n=s[s.length-1],o=n.dates[n.dates.length-1],i=Qe(o,6-r),c=Da(Qe(o,1),i,a);s.push.apply(s,c)}}return s}function Li(t){var a,s,r,n=O(),o=n.locale,i=n.classNames,c=n.styles,u=n.hideHead,l=n.fixedWeeks,d=n.components,h=n.weekStartsOn,m=n.firstWeekContainsDate,f=n.ISOWeek,y=Ii(t.displayMonth,{useFixedWeeks:!!l,ISOWeek:f,locale:o,weekStartsOn:h,firstWeekContainsDate:m}),g=(a=d?.Head)!==null&&a!==void 0?a:Qo,v=(s=d?.Row)!==null&&s!==void 0?s:Ei,D=(r=d?.Footer)!==null&&r!==void 0?r:Vo;return e.jsxs("table",{id:t.id,className:i.table,style:c.table,role:"grid","aria-labelledby":t["aria-labelledby"],children:[!u&&e.jsx(g,{}),e.jsx("tbody",{className:i.tbody,style:c.tbody,children:y.map(function(b){return e.jsx(v,{displayMonth:t.displayMonth,dates:b.dates,weekNumber:b.weekNumber},b.weekNumber)})}),e.jsx(D,{displayMonth:t.displayMonth})]})}function Oi(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Ai=Oi()?x.useLayoutEffect:x.useEffect,Ft=!1,Ri=0;function Pa(){return"react-day-picker-".concat(++Ri)}function Fi(t){var a,s=t??(Ft?Pa():null),r=x.useState(s),n=r[0],o=r[1];return Ai(function(){n===null&&o(Pa())},[]),x.useEffect(function(){Ft===!1&&(Ft=!0)},[]),(a=t??n)!==null&&a!==void 0?a:void 0}function Hi(t){var a,s,r=O(),n=r.dir,o=r.classNames,i=r.styles,c=r.components,u=at().displayMonths,l=Fi(r.id?"".concat(r.id,"-").concat(t.displayIndex):void 0),d=r.id?"".concat(r.id,"-grid-").concat(t.displayIndex):void 0,h=[o.month],m=i.month,f=t.displayIndex===0,y=t.displayIndex===u.length-1,g=!f&&!y;n==="rtl"&&(a=[f,y],y=a[0],f=a[1]),f&&(h.push(o.caption_start),m=_(_({},m),i.caption_start)),y&&(h.push(o.caption_end),m=_(_({},m),i.caption_end)),g&&(h.push(o.caption_between),m=_(_({},m),i.caption_between));var v=(s=c?.Caption)!==null&&s!==void 0?s:Go;return e.jsxs("div",{className:h.join(" "),style:m,children:[e.jsx(v,{id:l,dis
2playMonth:t.displayMonth,displayIndex:t.displayIndex}),e.jsx(Li,{id:d,"aria-labelledby":l,displayMonth:t.displayMonth})]},t.displayIndex)}function Wi(t){var a=O(),s=a.classNames,r=a.styles;return e.jsx("div",{className:s.months,style:r.months,children:t.children})}function Bi(t){var a,s,r=t.initialProps,n=O(),o=aa(),i=at(),c=x.useState(!1),u=c[0],l=c[1];x.useEffect(function(){n.initialFocus&&o.focusTarget&&(u||(o.focus(o.focusTarget),l(!0)))},[n.initialFocus,u,o.focus,o.focusTarget,o]);var d=[n.classNames.root,n.className];n.numberOfMonths>1&&d.push(n.classNames.multiple_months),n.showWeekNumber&&d.push(n.classNames.with_weeknumber);var h=_(_({},n.styles.root),n.style),m=Object.keys(r).filter(function(y){return y.startsWith("data-")}).reduce(function(y,g){var v;return _(_({},y),(v={},v[g]=r[g],v))},{}),f=(s=(a=r.components)===null||a===void 0?void 0:a.Months)!==null&&s!==void 0?s:Wi;return e.jsx("div",_({className:d.join(" "),style:h,dir:n.dir,id:n.id,nonce:r.nonce,title:r.title,lang:r.lang},m,{children:e.jsx(f,{children:i.displayMonths.map(function(y,g){return e.jsx(Hi,{displayIndex:g,displayMonth:y},g)})})}))}function Yi(t){var a=t.children,s=mo(t,["children"]);return e.jsx(So,{initialProps:s,children:e.jsx(Bo,{children:e.jsx(ji,{initialProps:s,children:e.jsx(Xo,{initialProps:s,children:e.jsx(ei,{initialProps:s,children:e.jsx(li,{children:e.jsx(bi,{children:a})})})})})})})}function $i(t){return e.jsx(Yi,_({},t,{children:e.jsx(Bi,{initialProps:t})}))}function ra({className:t,classNames:a,showOutsideDays:s=!0,...r}){return e.jsx($i,{showOutsideDays:s,className:xe("p-3",t),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:xe(va({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:xe(va({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...a},components:{IconLeft:({className:n,...o})=>e.jsx(Va,{className:xe("h-4 w-4",n),...o}),IconRight:({className:n,...o})=>e.jsx(pt,{className:xe("h-4 w-4",n),...o})},...r})}ra.displayName="Calendar";const Ta={"National Pancake Day":"/images/holiday-food.png","National Blueberry Pancake Day":"/images/holiday-food.png","Valentines Day":"/images/holiday-valentines.png","Valentine's Day":"/images/holiday-valentines.png","National Pizza Day":"/images/holiday-pizza.png","St. Patrick's Day":"/images/holiday-stpatricks.png","St Patricks Day":"/images/holiday-stpatricks.png","Mother's Day":"/images/holiday-family.png","Mothers Day":"/images/holiday-family.png","Father's Day":"/images/holiday-family.png","Fathers Day":"/images/holiday-family.png","Independence Day":"/images/holiday-patriotic.png","Memorial Day":"/images/holiday-patriotic.png","Labor Day":"/images/holiday-patriotic.png","National Taco Day":"/images/holiday-tacos.png","Cinco de Mayo":"/images/holiday-cincodemayo.png",Halloween:"/images/holiday-community.png",Thanksgiving:"/images/holiday-thanksgiving.png",Christmas:"/images/holiday-christmas.png","Christmas Eve":"/images/holiday-christmas.png","Christmas Day":"/images/holiday-christmas.png","New Year's Eve":"/images/holiday-newyears.png","New Years Eve":"/images/holiday-newyears.png","Super Bowl Sunday":"/images/holiday-sports.png","National Burger Day":"/images/holiday-burger.png","National Cheeseburger Day":"/images/holiday-burger.png","National Hamburger Day":"/images/holiday-burger.png","National Wine Day":"/images/holiday-cocktails.png","National Coffee Day":"/images/holiday-coffee.png","National Cappuccino Day":"/images/holiday-coffee.png","National Irish Coffee Day":"/images/holiday-coffee.png","National Espresso Day":"/images/holiday-coffee.png","National Hot Chocolate Day":"/images/holiday-coffee.png","National Ice Cream Day":"/images/holiday-icecream.png","National Waiter Day":"/images/holiday-hospitality.png","National Bartender Day":"/images/holiday-cocktails.png","Earth Day":"/images/holiday-community.png","National Frozen Food Day":"/images/holiday-frozen.png","National Chocolate Cake Day":"/images/holiday-chocolate.png","National Brownie Day":"/images/holiday-chocolate.png","National Cocoa Day":"/images/holiday-chocolate.png","National Grilled Cheese Day":"/images/holiday-grilledcheese.png","National Sandwich Day":"/images/holiday-sandwich.png","National Pie Day":"/images/holiday-pie.png","National Margarita Day":"/images/holiday-margarita.png","National Beer Day":"/images/holiday-beer.png","National IPA Day":"/images/holiday-beer.png","National Craft Beer Day":"/images/holiday-beer.png","National Pasta Day":"/images/holiday-pasta.png","National Fried Chicken Day":"/images/holiday-chicken.png","National Chicken Wing Day":"/images/holiday-chicken.png","National Shrimp Day":"/images/holiday-seafood.png","National Lobster Day":"/images/holiday-seafood.png","National Croissant Day":"/images/holiday-brunch.png","National Restaurant Week":"/images/holiday-hospitality.png","National Corn Dog Day":"/images/holiday-corndog.png","National Pretzel Day":"/images/holiday-brunch.png","National Iced Tea Day":"/images/holiday-cocktails.png"},zi=[[/pizza/i,"/images/holiday-pizza.png"],[/burger|hamburger|cheeseburger/i,"/images/holiday-burger.png"],[/taco|mexican|enchilada/i,"/images/holiday-tacos.png"],[/beer|ale|lager|ipa|brew/i,"/images/holiday-beer.png"],[/wine|champagne|prosecco/i,"/images/holiday-cocktails.png"],[/margarita|tequila|cocktail/i,"/images/holiday-margarita.png"],[/coffee|espresso|cappuccino|latte/i,"/images/holiday-coffee.png"],[/chocolate|brownie|cocoa|fudge/i,"/images/holiday-chocolate.png"],[/ice cream|gelato|sundae|frozen/i,"/images/holiday-icecream.png"],[/chicken|wing/i,"/images/holiday-chicken.png"],[/shrimp|lobster|seafood|crab|oyster/i,"/images/holiday-seafood.png"],[/pasta|spaghetti|fettuccine|no
2odle/i,"/images/holiday-pasta.png"],[/sandwich|sub|hoagie|deli/i,"/images/holiday-sandwich.png"],[/pie|cobbler/i,"/images/holiday-pie.png"],[/pancake|waffle|brunch|croissant|french toast/i,"/images/holiday-brunch.png"],[/grilled cheese/i,"/images/holiday-grilledcheese.png"],[/corn dog/i,"/images/holiday-corndog.png"],[/patriot|independence|memorial|flag|july/i,"/images/holiday-patriotic.png"],[/valentine|romance|love/i,"/images/holiday-valentines.png"],[/patrick|irish|shamrock/i,"/images/holiday-stpatricks.png"],[/cinco|mayo/i,"/images/holiday-cincodemayo.png"],[/thanksgiving|turkey/i,"/images/holiday-thanksgiving.png"],[/christmas|xmas|holiday season/i,"/images/holiday-christmas.png"],[/new year|nye/i,"/images/holiday-newyears.png"],[/super bowl|football|game day/i,"/images/holiday-sports.png"],[/mother|father|family|parent/i,"/images/holiday-family.png"],[/bartender|mixolog/i,"/images/holiday-cocktails.png"],[/waiter|server|hospitality|restaurant week/i,"/images/holiday-hospitality.png"]],Ma={food:"/images/holiday-food.png",family:"/images/holiday-family.png",community:"/images/holiday-community.png",hospitality:"/images/holiday-hospitality.png",sports:"/images/holiday-sports.png"};function Gi(t,a){if(Ta[t])return Ta[t];for(const[s,r]of zi)if(s.test(t))return r;return Ma[a]||Ma.food}const Vi={"National Pancake Day":{caption:`It's National Pancake Day and we're flipping out! ð¥ 3 4Whether you're a buttermilk classic fan or love something a little more creative, today's the day to treat yourself to a stack. 5 6Swing by for brunch and let us do the cooking â because pancakes always taste better when someone else makes them. 7 8Tag your brunch crew below! ð`},"Valentine's Day":{caption:`Love is in the air â and on the menu. ð 9 10This Valentine's Day, skip the ordinary and give your someone special a night they'll remember. Our kitchen is pulling out all the stops with a curated experience designed for two. 11 12Reservations are filling fast. Don't wait â the best tables go first. 13 14Link in bio to reserve your spot.`},"National Pizza Day":{caption:`It's National Pizza Day and we're not about to let it pass quietly. ð 15 16Our ovens are fired up, the dough is stretched, and the cheese pull is real. Whether you're team classic margherita or you like to go bold, today belongs to you. 17 18Dine in, carry out, or delivery â just don't miss it. 19 20Drop your go-to topping in the comments ð`},"St. Patrick's Day":{caption:`Happy St. Patrick's Day! âï¸ 21 22Green beer? Sure. But we're going bigger â think hearty specials, great pours, and an atmosphere that makes you want to stay all night. 23 24No reservation needed. Just walk in, grab a seat, and raise a glass with us. 25 26See you tonight! ð»`},"Mother's Day":{caption:`She deserves more than flowers. ð 27 28This Mother's Day, bring her somewhere special. A table set just for her, a meal she doesn't have to cook, and a moment she'll actually remember. 29 30We're taking reservations now â and the best spots won't last. 31 32Book today. She's worth it.`}
32,"Father's Day":{caption:`Dad doesn't ask for much â but he deserves a great meal. 𥩠33 34This Father's Day, skip the ties and gift cards. Bring him in for a meal he'll actually enjoy. Great food, cold drinks, zero dishes to wash. 35 36Reservations open now. Let's make Dad's day.`},"Independence Day":{caption:`Happy 4th of July! ðºð¸ 37 38Celebrate with cold drinks, great food, and even better company. Whether you're stopping in before the fireworks or making us your whole evening, we've got you covered. 39 40Walk-ins welcome. Patio is open. Let's celebrate together. ð`},"National Taco Day":{caption:`It's National Taco Day and we're ALL in. ð® 41 42Crispy, soft, loaded, simple â however you like your tacos, today is your day. Our kitchen is ready to deliver. 43 44Bring your appetite. Bring your crew. Let's taco 'bout it. 45 46Comment your order below ð`},Halloween:{caption:`Something wicked this way comes... to our kitchen. ð 47 48Halloween night just got a whole lot tastier. Costumes encouraged, good vibes guaranteed, and our menu is hauntingly good. 49 50Stop in for a bite â if you dare. ð»`},Thanksgiving:{caption:`Grateful for good food, great people, and this incredible community. ð 51 52This Thanksgiving, let us take the stress off your plate (and put the turkey on it). Whether you're dining in or ordering a feast to go, we've got everything you need for a perfect holiday. 53 54Pre-orders are open now â don't wait until the last minute!`},Christmas:{caption:`Merry Christmas from our family to yours. ð 55 56The holidays are meant for gathering around great food with the people you love. Let us be part of your celebration this season. 57 58Warm wishes and full plates â that's our kind of holiday. 59 60Happy holidays, everyone. â¤ï¸`},"New Year's Eve":{caption:`Ring in the New Year with us! ð¥ 61 62Forget the crowded bars and overpriced covers. Celebrate at our place with great food, craft cocktails, and a midnight toast worth remembering. 63 64Limited spots available â reserve now before they're gone. 65 66See you at midnight! ð`},"Super Bowl Sunday":{caption:`Game day. Our place. Let's go. ð 67 68Big screens, bigger appetizers, and the coldest drinks in town. Whether you're here for the game or just the commercials, we've got a seat for you. 69 70No cover. No hassle. Just show up hungry. 71 72Who are you rooting for? Drop it below ð`},"National Burger Day":{caption:`It's National Burger Day and our grill is working overtime. ð 73 74Juicy, stacked, and made the way a burger should be â no shortcuts, no compromises. Today's the day to come in and taste what we're all about. 75 76Dine in or carry out. Just don't let this one pass you by.`},"National Wine Day":{caption:`Pour yourself into something good. ð· 77
78It's National Wine Day and our wine list is ready for you. Whether you're a bold red lover or a crisp white enthusiast, we've got the perfect glass waiting. 79 80Pair it with dinner and make tonight a proper celebration. 81 82What's your go-to pour? Tell us below ð`},"National Coffee Day":{caption:`First sip of the day hits different here. â 83 84Happy National Coffee Day! Whether you're fueling up for the morning rush or settling in for a long brunch, our coffee game is strong. 85 86Come grab a cup and see why our regulars keep coming back. 87 88How do you take yours?`},"Cinco de Mayo":{caption:`¡Feliz Cinco de Mayo! ð 89 90Margaritas are flowing, the kitchen is fired up, and the vibes are just right. Come celebrate with bold flavors, great drinks, and a night you won't forget. 91 92No reservation needed â just bring your appetite and your crew. ð²ð½`},"National Ice Cream Day":{caption:`Scoop season is officially here. ð¦ 93 94Happy National Ice Cream Day! Our dessert menu is calling your name. Whether you finish your meal with a scoop or make it the main event, today is the day to indulge. 95 96Life's too short to skip dessert.`},"National Waiter Day":{caption:`Today we celebrate the heartbeat of every great restaurant â our service team. ð 97 98Happy National Waiter Day to the incredible people who make every guest feel welcome, remembered, and taken care of. 99 100Next time you're in, give your server a little extra love. They've earned it. â¤ï¸`},"National Bartender Day":{caption:`Raise your glass to the ones who make the magic happen behind the bar. ð¸ 101 102Happy National Bartender Day! Our bartenders don't just pour drinks â they create experiences. Come say cheers to them tonight. 103 104What's your favorite cocktail? Let us know ð`},"Earth Day":{caption:`This planet gives us everything â including the ingredients on your plate. ð 105 106Happy Earth Day! We're proud to source locally, reduce waste, and cook with care for the world around us. 107 108Great food and a better future â that's what we're about. 109 110How are you celebrating today?`},"Labor Day":{caption:`You've worked hard. You deserve a meal you didn't have to make. ðª 111 112Happy Labor Day! Come relax, unwind, and let us take care of dinner tonight. You've earned it. 113 114Walk-ins welcome all day. See you soon!`},"National Frozen Food Day":{caption:`Behind every great dish is serious prep work â and yes, some of it involves our freezer. âï¸ 115 116Happy National Frozen Food Day! From our house-made frozen desserts to perfectly prepped ingredients, we make freezer magic happen. 117 118Come taste the difference fresh-from-scratch makes (even when it starts frozen). ð¨`}};function Ui(t,a,s){const r=s?` 119 120${s}`:"";switch(a){case"food":return`Happy ${t}! ð½ï¸ 121 122Today calls for something special from our kitchen. We're celebrating the only way we know how â with incredible food and great company.${r} 123 124Come see what we've got cooking. Walk-ins welcome! 125 126Tag someone who needs to know about this ð`;case"family":return`Happy ${t}! â¤ï¸ 127 128Some days are made for gathering around a great table with the people who matter most. Today is one of those days.${r} 129 130Let us set the table â you just bring the ones you love. 131 132Reservations recommended. Link in bio.`;case"community":return`Happy ${t}! ð 133 134This community is everything to us. Today we celebrate together â with great food, warm hospitality, and the kind of atmosphere that makes you want to stay.${r} 135 136Come be part of it. We'd love to see you tonight.`;case"hospitality":return`Happy ${t}! ð 137 138Behind every great meal is a team that pours their heart into every detail. Today
138we recognize the people who make hospitality an art.${r} 139 140Come experience what real service feels like. We'll be here.`;case"sports":return`It's ${t} and we're ready! ð 141 142Big screens, cold drinks, and an atmosphere that makes every play feel bigger. Whether you're here for the competition or the appetizers, we've got you covered.${r} 143 144No cover. Walk-ins welcome. Let's do this!`;default:return`Happy ${t}! ð 145 146We're celebrating today with what we do best â great food, warm hospitality, and an atmosphere you won't want to leave.${r} 147 148Come join us. Walk-ins always welcome.`}}function Ht(t,a,s,r){const n=Vi[t],o=n?n.caption:Ui(t,a,s),i=n?.hashtags||r||[],c=i.length>0?` 149 150`+i.map(l=>l.startsWith("#")?l:`#${l}`).join(" "):"",u=Gi(t,a);return{caption:o+c,hashtags:i,imageUrl:u}}const Ns=[{value:"event_promo",label:"Event Promo"},{value:"special",label:"Special / Limited Time"},{value:"menu_feature",label:"Menu Feature"},{value:"live_music",label:"Live Music / Entertainment"},{value:"happy_hour",label:"Happy Hour / Bar Feature"},{value:"catering",label:"Catering / Large Party"},{value:"hiring",label:"Hiring"},{value:"community",label:"Community / Charity"},{value:"tonight_vibe",label:"Tonight's Vibe (Quick Post)"},{value:"holiday",label:"Holiday / National Day"}],qi=[{value:"short_punchy",label:"Short & Punchy"},{value:"warm_hospitality",label:"Warm & Hospitality-forward"},{value:"premium",label:"Premium / Elevated"},{value:"straight_info",label:"Straight Info / No Fluff"}],Qi=[{value:"date_night",label:"Date Night"},{value:"families",label:"Families"},{value:"lunch_crowd",label:"Lunch Crowd"},{value:"bar_crowd",label:"Bar Crowd"},{value:"music_lovers",label:"Music Lovers"},{value:"brunch",label:"Brunch"}],Ki=[{value:"fun",label:"Fun"},{value:"classy",label:"Classy"},{value:"high_energy",label:"High Energy"},{value:"low_key",label:"Low Key"},{value:"community",label:"Community"}],Xi=[{value:"reserve_table",label:"Reserve a table"},{value:"order_online",label:"Order online"},{value:"visit_us",label:"Visit us today"},{value:"call_now",label:"Call now"},{value:"limited_time",label:"Limited time only"},{value:"tag_friend",label:"Tag a friend"},{value:"share_post",label:"Share this post"}],Sa={instagram:{chars:2200,label:"Instagram"},facebook:{chars:63206,label:"Facebook"},google_business:{chars:1500,label:"Google Business"},linkedin:{chars:3e3,label:"LinkedIn"},x:{chars:280,label:"X/Twitter"},nextdoor:{chars:1e4,label:"Nextdoor"}},ks=t=>{switch(t){case"facebook":return e.jsx(qe,{className:"h-3.5 w-3.5 text-amber-600"});case"instagram":return e.jsx(wt,{className:"h-3.5 w-3.5 text-pink-600"});case"google_business":return e.jsx(bt,{className:"h-3.5 w-3.5 text-red-500"});case"linkedin":return e.jsx(He,{className:"h-3.5 w-3.5 text-amber-700"});case"x":return e.jsx(Fe,{className:"h-3.5 w-3.5"});case"nextdoor":return e.jsx(Ze,{className:"h-3.5 w-3.5 text-green-600"});default:return e.jsx(Ut,{className:"h-3.5 w-3.5"})}},Cs=t=>{switch(t){case"facebook":return"bg-amber-600";case"instagram":return"bg-gradient-to-tr from-amber-600 via-pink-500 to-orange-400";case"google_business":return"bg-primary";case"linkedin":return"bg-amber-700";case"x":return"bg-black dark:bg-stone-800 border border-stone-300 dark:border-stone-600";case"nextdoor":return"bg-green-600";default:return"bg-muted-foreground"}},_s=t=>{switch(t){case"facebook":return e.jsx(Yr,{className:"h-5 w-5 text-amber-600"});case"instagram":return e.jsx(Br,{className:"h-5 w-5 text-pink-500"});case"google_business":return e.jsx(Ka,{className:"h-5 w-5 text-red-500"});case"linkedin":return e.jsx(He,{className:"h-5 w-5 text-amber-700"});case"x":return e.jsx(Fe,{className:"h-5 w-5"});case"nextdoor":return e.jsx(Ze,{className:"h-5 w-5 text-green-600"});default:return null}};function Zi({activeAccounts:t,selectedAccountIds:a,onToggle:s,onSelectAll:r,onAddChannel:n}){return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:a.length>0?`${a.length} channel${a.length!==1?"s":""} selected`:"Select channels"}),t.length>1&&e.jsx("button",{onClick:r,className:"text-xs px-3 py-1 rounded-full border font-medium transition-colors",style:{borderColor:"#a9702f",color:"#c8934e"},"data-testid":"button-select-all-accounts",children:a.length===t.length?"Deselect All":"Select All"})]}),t.length>0?e.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.map(o=>{const i=a.includes(o.id);return e.jsxs("button",{onClick:()=>s(o.id),className:"relative rounded-full transition-all",style:i?{boxShadow:"0 0 0 2px #a9702f",borderRadius:"9999px"}:{opacity:.5},title:`${o.displayName} (${o.provider.replace("_"," ")})`,"data-testid":`channel-avatar-${o.id}`,children:[e.jsxs(Xa,{className:"h-10 w-10",children:[o.profilePictureUrl?e.jsx(Za,{src:o.profilePictureUrl,alt:o.displayName}):null,e.jsx(Ja,{className:"text-xs font-medium flex items-center justify-center",children:_s(o.provider)||o.displayName.charAt(0).toUpperCase()})]}),e.jsxs("span",{className:`absolute -bottom-0.5 -right-0.5 h-4 w-4 roun
150ded-full flex items-center justify-center text-white ${Cs(o.provider)}`,children:[o.provider==="facebook"&&e.jsx(qe,{className:"h-2.5 w-2.5"}),o.provider==="instagram"&&e.jsx(wt,{className:"h-2.5 w-2.5"}),o.provider==="google_business"&&e.jsx(bt,{className:"h-2.5 w-2.5"}),o.provider==="linkedin"&&e.jsx(He,{className:"h-2.5 w-2.5"}),o.provider==="x"&&e.jsx(Fe,{className:"h-2.5 w-2.5"}),o.provider==="nextdoor"&&e.jsx(Ze,{className:"h-2.5 w-2.5"})]})]},o.id)}),e.jsx("button",{onClick:n,className:"h-10 w-10 rounded-full border-2 border-dashed border-muted-foreground/30 flex items-center justify-center text-muted-foreground hover:border-primary hover:text-primary transition-colors",title:"Add channel","data-testid":"button-add-channel",children:e.jsx("span",{className:"text-lg leading-none",children:"+"})})]}):e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm text-amber-600 dark:text-amber-400",children:[e.jsx(Re,{className:"h-4 w-4"}),e.jsx("span",{children:"No channels connected."}),e.jsx(Z,{variant:"ghost",size:"sm",onClick:n,"data-testid":"button-connect-accounts",children:"Connect now"})]})]})}const Ji=x.memo(Zi);function el({fileInputRef:t,dropZoneRef:a,isDragging:s,isUploading:r,mediaUrl:n,imageKey:o,uploadedFileName:i,uploadedFileSize:c,generatingHolidayId:u,onFileSelect:l,onRemoveImage:d,onBrowseClick:h,onDragOver:m,onDragEnter:f,onDragLeave:y,onDrop:g}){return e.jsxs(e.Fragment,{children:[e.jsx("input",{ref:t,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",onChange:l,className:"hidden","data-testid":"input-file-upload"}),u&&!n?e.jsxs("div",{className:"border-2 border-dashed rounded-md p-6 flex flex-col items-center gap-2 text-center",style:{borderColor:"#a9702f"},children:[e.jsx(ce,{className:"h-6 w-6 animate-spin",style:{color:"#a9702f"}}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"Generating holiday image..."})]}):n?e.jsxs("div",{className:"relative rounded-md border overflow-hidden",children:[e.jsx("img",{src:n,alt:"Post media",className:"w-full max-h-64 object-cover"},o),i&&e.jsxs("div",{className:"px-3 py-1.5 text-xs text-stone-400 border-t",style:{backgroundColor:"#1c1210"},children:[i," (",c,")"]}),e.jsx(Z,{size:"icon",variant:"secondary",className:"absolute top-2 right-2",onClick:d,"data-testid":"button-remove-image",children:e.jsx($t,{className:"h-4 w-4"})})]}):e.jsx("div",{ref:a,onDragOver:m,onDragEnter:f,onDragLeave:y,onDrop:g,onClick:h,className:"border-2 border-dashed rounded-md p-6 cursor-pointer transition-colors",style:s?{borderColor:"#a9702f",backgroundColor:"rgba(169, 112, 47,0.05)"}:{borderColor:"rgba(255,255,255,0.1)"},"data-testid":"dropzone-image",children:e.jsx("div",{className:"flex flex-col items-center gap-2 text-center",children:r?e.jsxs(e.Fragment,{children:[e.jsx(ce,{className:"h-6 w-6 animate-spin",style:{color:"#a9702f"}}),e.jsx("div",{className:"text-sm text-muted-foreground",children:"Uploading..."})]}):e.jsxs(e.Fragment,{children:[e.jsx(es,{className:"h-6 w-6 text-muted-foreground/50"}),e.jsx("div",{className:"text-sm text-muted-foreground",children:s?e.jsx("span",{className:"font-medium",style:{color:"#a9702f"},children:"Drop your image here"}):e.jsxs(e.Fragment,{children:["Drag & drop an image, or ",e.jsx("span",{style:{color:"#c8934e"},children:"click to browse"})]})}),e.jsx("div",{className:"text-xs text-muted-foreground/60",children:"JPEG, PNG, GIF, WebP up to 10MB"})]})})})]})}const tl=x.memo(el);function al({aiFormData:t,setAiFormData:a,holidays:s,isGenerating:r,onClose:n,onGenerate:o,onSelectHolidayBadge:i}){return e.jsxs(we,{style:{borderTop:"2px solid #a9702f"},children:[e.jsx(Te,{className:"pb-2",children:e.jsxs(Me,{className:"flex flex-wrap items-center justify-between gap-2",style:{fontSize:"16px",fontWeight:600},children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(xt,{className:"h-4 w-4",style:{color:"#c8934e"}}),"Post Generator"]}),e.jsx("button",{onClick:n,className:"h-7 w-7 rounded-full flex items-center justify-center transition-colors hover:bg-white/10","data-testid":"button-close-generator",children:e.jsx($t,{className:"h-4 w-4"})})]})}),e.jsxs(je,{className:"space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(V,{className:"text-xs",children:"Post Type"}),e.jsxs(ge,{value:t.postType,onValueChange:c=>a({...t,postType:c}),children:[e.jsx(ye,{className:"border-0 border-b border-stone-700 rounded-none focus:border-[#a9702f]",style:{backgroundColor:"#1c1210"},"data-testid":"select-post-type",children:e.jsx(ve,{placeholder:"What are you posting about?"})}),e.jsx(be,{children:Ns.map(c=>e.jsx(ee,{value:c.value,children:c.label},c.value))})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(V,{className:"text-xs",children:"Style"}),e.jsxs(ge,{value:t.outputStyle,onValueChange:c=>a({...t,outputStyle:c}
150),children:[e.jsx(ye,{className:"border-0 border-b border-stone-700 rounded-none focus:border-[#a9702f]",style:{backgroundColor:"#1c1210"},"data-testid":"select-output-style",children:e.jsx(ve,{})}),e.jsx(be,{children:qi.map(c=>e.jsx(ee,{value:c.value,children:c.label},c.value))})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(V,{className:"text-xs",children:"Event / Item Name"}),e.jsx(De,{placeholder:"e.g., Jazz Night, Wagyu Ribeye",value:t.eventName,onChange:c=>a({...t,eventName:c.target.value}),className:"border-0 border-b border-stone-700 rounded-none focus:border-[#a9702f]",style:{backgroundColor:"#1c1210"},"data-testid":"input-event-name"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(V,{className:"text-xs",children:"Date"}),e.jsxs(Ua,{children:[e.jsx(qa,{asChild:!0,children:e.jsxs(Z,{variant:"outline",className:"w-full justify-start text-left font-normal border-0 border-b border-stone-700 rounded-none",style:{backgroundColor:"#1c1210"},"data-testid":"input-event-date",children:[e.jsx(ts,{className:"mr-2 h-4 w-4",style:{color:"#c8934e"}}),t.eventDate?H(Na(t.eventDate,"yyyy-MM-dd",new Date),"MMM d, yyyy"):"Pick a date"]})}),e.jsx(Qa,{className:"w-auto p-0",align:"start",children:e.jsx(ra,{mode:"single",selected:t.eventDate?Na(t.eventDate,"yyyy-MM-dd",new Date):void 0,onSelect:c=>a({...t,eventDate:c?H(c,"yyyy-MM-dd"):""}),initialFocus:!0,"data-testid":"calendar-event-date"})})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(V,{className:"text-xs",children:"Target Audience"}),e.jsxs(ge,{value:t.targetAudience,onValueChange:c=>a({...t,targetAudience:c}),children:[e.jsx(ye,{className:"border-0 border-b border-stone-700 rounded-none focus:border-[#a9702f]",style:{backgroundColor:"#1c1210"},"data-testid":"select-target-audience",children:e.jsx(ve,{placeholder:"Who is this for?"})}),e.jsx(be,{children:Qi.map(c=>e.jsx(ee,{value:c.value,children:c.label},c.value))})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(V,{className:"text-xs",children:"Tone"}),e.jsxs(ge,{value:t.tone,onValueChange:c=>a({...t,tone:c}),children:[e.jsx(ye,{className:"border-0 border-b border-stone-700 rounded-none focus:border-[#a9702f]",style:{backgroundColor:"#1c1210"},"data-testid":"select-tone",children:e.jsx(ve,{})}),e.jsx(be,{children:Ki.map(c=>e.jsx(ee,{value:c.value,children:c.label},c.value))})]})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(V,{className:"text-xs",children:"Promotion / Discount"}),e.jsx(De,{placeholder:"e.g., 15% off, buy one get one, free dessert",value:t.promotionDiscount,onChange:c=>a({...t,promotionDiscount:c.target.value}),className:"border-0 border-b border-stone-700 rounded-none focus:border-[#a9702f]",style:{backgroundColor:"#1c1210"},"data-testid":"input-promotion-discount"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(V,{className:"text-xs",children:"Call to Action"}),e.jsxs(ge,{value:t.callToAction,onValueChange:c=>a({...t,callToAction:c}),children:[e.jsx(ye,{className:"border-0 border-b border-stone-700 rounded-none focus:border-[#a9702f]",style:{backgroundColor:"#1c1210"},"data-testid":"select-call-to-action",children:e.jsx(ve,{placeholder:"Select CTA"})}),e.jsx(be,{children:Xi.map(c=>e.jsx(ee,{value:c.value,children:c.label},c.value))})]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx(V,{className:"text-xs",children:"Additional Details"}),e.jsx(Wa,{placeholder:"Add more details about this post...",value:t.promotionDetails,onChange:c=>a({...t,promotionDetails:c.target.value}),rows:2,className:"border-0 border-b border-stone-700 rounded-none focus:border-[#a9702f]",style:{backgroundColor:"#1c1210"},"data-testid":"textarea-promotion-details"})]}),s&&s.length>0&&e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsx("span",{className:"text-xs text-muted-foreground mr-1",children:"Upcoming:"}),s.slice(0,5).map(c=>e.jsx("button",{className:"text-xs px-2 py-0.5 rounded-full border transition-colors cursor-pointer",style:t.selectedHoliday===c.name?{backgroundColor:"#a9702f",borderColor:"#a9702f",color:"white"}:{backgroundColor:"#241812",borderColor:"#a9702f",color:"#c8934e"},onClick:()=>i(c.name),"data-testid":`badge-holiday-${c.id}`,children:c.name},c.id))]}),e.jsx("button",{onClick:o,disabled:r||!t.postType,className:"w-full py-2.5 rounded-md text-sm font-bold uppercase tracking-wider text-white transition-colors disabled:opacity-50",style:{backgroundColor:"#a9702f"},"data-testid":"button-generate-post",children:r?e.jsxs("span",{className:"flex items-center justify-center gap-2",children:[e.jsx(ce,{className:"h-4 w-4 animate-spin"}),"Generating your post..."]}):e.jsxs("span",{className:"flex items-center justify-center gap-2",children:[e.jsx(xt,{className:"h-4 w-4"}),"Generate Post"]})})]})]})}const sl=x.memo(al);function rl({showPreview:t,isGenerating:a,caption:s,selectedAccountIds:r,activeAccounts:n,brandSettings:o,mediaUrl:i,imageKey:c,generatedPost:u,copiedField:l,onCopy:d}){return e.jsx("div",{className:`lg:col-span-2 ${t?"":"hidden lg:block"}`,children:e.jsxs(we,{className:"sticky top-4",style:{borderTop:"2px solid #a9702f"},children:[e.jsx(Te,{className:"pb-2",children:e.jsxs(Me,{className:"text-sm flex flex-wrap items-center gap-2 font-semibold",children:[e.jsx(as,{className:"h-4 w-4",style:{color:"#c8934e"}}),"Post Preview"]})}),e.jsx(je,{className:"space-y-3",children:a?e.jsxs("div",{className:"space-y-3 py-4",children:[e.jsx("div",{className:"h-4 rounded animate-pulse",style:{backgroundColor:"#241812",width:"80%"}}
150),e.jsx("div",{className:"h-4 rounded animate-pulse",style:{backgroundColor:"#241812",width:"100%"}}),e.jsx("div",{className:"h-4 rounded animate-pulse",style:{backgroundColor:"#241812",width:"60%"}}),e.jsxs("div",{className:"flex gap-2 mt-4",children:[e.jsx("div",{className:"h-6 w-20 rounded-full animate-pulse",style:{backgroundColor:"#241812"}}),e.jsx("div",{className:"h-6 w-16 rounded-full animate-pulse",style:{backgroundColor:"#241812"}}),e.jsx("div",{className:"h-6 w-24 rounded-full animate-pulse",style:{backgroundColor:"#241812"}})]})]}):s?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"border rounded-md overflow-hidden relative",children:[r.length>0&&(()=>{const h=n.find(m=>m.id===r[0]);return h?e.jsx("div",{className:"absolute top-2 right-2 z-10",children:e.jsx("span",{className:"text-[13px] px-2 py-0.5 rounded-full font-medium",style:{backgroundColor:"#241812",color:"#c8934e",border:"1px solid rgba(255,255,255,0.09)"},children:h.provider==="google_business"?"Google Business":h.provider.charAt(0).toUpperCase()+h.provider.slice(1)})}):null})(),e.jsxs("div",{className:"p-3 flex items-center gap-2 border-b bg-muted/30",children:[e.jsx("div",{className:"h-8 w-8 rounded-full bg-muted"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-xs font-medium",children:o?.restaurantName||"Your Restaurant"}),e.jsx("div",{className:"text-[13px] text-muted-foreground",children:"Just now"})]})]}),e.jsx("div",{className:"p-3",children:e.jsx("p",{className:"text-sm whitespace-pre-wrap","data-testid":"text-preview-caption",children:s})}),i&&e.jsx("img",{src:i,alt:"Preview",className:"w-full max-h-48 object-cover border-t"},c),u?.hashtags&&u.hashtags.length>0&&e.jsx("div",{className:"px-3 pb-3 flex flex-wrap gap-1",children:u.hashtags.map((h,m)=>e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{backgroundColor:"#241812",color:"#c8934e"},children:h},m))})]}),e.jsxs("div",{className:"flex flex-wrap gap-1",children:[e.jsxs("button",{onClick:()=>d(s,"caption"),className:"text-xs px-3 py-1 rounded-full border transition-colors",style:{borderColor:"#a9702f",color:"#c8934e"},"data-testid":"button-copy-caption",children:[l==="caption"?e.jsx(ut,{className:"h-3 w-3 inline mr-1"}):e.jsx(mt,{className:"h-3 w-3 inline mr-1"}),"Copy Caption"]}),u?.hashtags&&e.jsxs("button",{onClick:()=>d(u.hashtags.join(" "),"hashtags"),className:"text-xs px-3 py-1 rounded-full border transition-colors",style:{borderColor:"#a9702f",color:"#c8934e"},"data-testid":"button-copy-hashtags",children:[l==="hashtags"?e.jsx(ut,{className:"h-3 w-3 inline mr-1"}):e.jsx(mt,{className:"h-3 w-3 inline mr-1"}),"Hashtags"]})]}),u?.shortCaption&&e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-1",children:[e.jsx(V,{className:"text-xs",children:"Short Caption"}),e.jsx("button",{onClick:()=>d(u.shortCaption,"short"),className:"h-6 w-6 rounded-full flex items-center justify-center transition-colors hover:bg-white/10","data-testid":"button-copy-short",children:l==="short"?e.jsx(ut,{className:"h-3 w-3"}):e.jsx(mt,{className:"h-3 w-3"})})]}),e.jsx("p",{className:"text-xs rounded p-2 italic text-stone-400 border-l-2",style:{backgroundColor:"#1c1210",borderLeftColor:"#a9702f"},"data-testid":"text-short-caption",children:u.shortCaption})]}),u?.suggestedPostTime&&e.jsxs("div",{className:"flex items-center gap-2 text-xs rounded p-2",style:{backgroundColor:"rgba(169, 112, 47,0.1)"},"data-testid":"text-suggested-time",children:[e.jsx(Je,{className:"h-3 w-3",style:{color:"#c8934e"}}),e.jsxs("span",{className:"text-amber-400",children:["Best time: ",e.jsx("strong",{children:u.suggestedPostTime})]})]}),r.length>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsx(V,{className:"text-xs",children:"Publishing to"}),e.jsx("div",{className:"flex flex-wrap gap-1",children:r.map(h=>{const m=n.find(f=>f.id===h);return m?e.jsxs(Ba,{variant:"secondary",className:"text-xs","data-testid":`badge-publish-target-${h}`,children:[ks(m.provider),e.jsx("span",{className:"ml-1",children:m.displayName})]},h):null})})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center text-muted-foreground",children:[e.jsx("div",{className:"h-16 w-12 border-2 border-dashed border-muted-foreground
150/20 rounded mb-4 flex items-center justify-center",children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"h-1.5 w-6 bg-muted-foreground/20 rounded"}),e.jsx("div",{className:"h-1.5 w-8 bg-muted-foreground/20 rounded"}),e.jsx("div",{className:"h-4 w-8 bg-muted-foreground/10 rounded mt-1"})]})}),e.jsx("p",{className:"text-sm",children:"See your post's preview here"})]})})]})})}const nl=x.memo(rl);function ol({connectedAccounts:t,activeAccounts:a,accountsLoading:s,disconnectPending:r,onConnectMeta:n,onConnectGoogle:o,onConnectLinkedIn:i,onConnectX:c,onDisconnect:u}){return e.jsxs(we,{children:[e.jsx(Te,{className:"pb-3",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx(Me,{className:"text-base",children:"Channels"}),t&&t.filter(l=>l.status==="active").length>0&&e.jsxs("span",{className:"text-xs px-2.5 py-1 rounded-full font-medium",style:{backgroundColor:"rgba(169, 112, 47,0.15)",color:"#c8934e",border:"1px solid rgba(255,255,255,0.09)"},"data-testid":"badge-channels-connected",children:[t.filter(l=>l.status==="active").length,"/",t.length," Channels connected"]})]})}),e.jsxs(je,{className:"space-y-4",children:[e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:[{label:"Facebook / Instagram",icon:e.jsx(qe,{className:"h-5 w-5 text-amber-600"}),handler:n,testId:"button-connect-meta",connected:a.some(l=>l.provider==="facebook"||l.provider==="instagram")},{label:"Google Business",icon:e.jsx(Ka,{className:"h-5 w-5 text-red-500"}),handler:o,testId:"button-connect-google",connected:a.some(l=>l.provider==="google_business")},{label:"LinkedIn",icon:e.jsx(He,{className:"h-5 w-5 text-amber-700"}),handler:i,testId:"button-connect-linkedin",connected:a.some(l=>l.provider==="linkedin")},{label:"X (Twitter)",icon:e.jsx(Fe,{className:"h-5 w-5"}),handler:c,testId:"button-connect-x",connected:a.some(l=>l.provider==="x")}].map(l=>e.jsxs("div",{className:"rounded-lg p-4 border flex items-center justify-between gap-3",style:{backgroundColor:"#241812"},children:[e.jsxs("div",{className:"flex items-center gap-3",children:[l.icon,e.jsx("span",{className:"text-sm font-medium",children:l.label})]}),l.connected?e.jsxs("span",{className:"flex items-center gap-1 text-xs text-green-400 font-medium",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-green-400"}),"Connected"]}):e.jsx("button",{onClick:l.handler,className:"text-xs px-3 py-1 rounded-full font-medium",style:{backgroundColor:"#a9702f",color:"white"},"data-testid":l.testId,children:"Connect"})]},l.testId))}),s?e.jsx("div",{className:"space-y-3",children:[1,2].map(l=>e.jsx(Ve,{className:"h-16 w-full"},l))}):t&&t.length>0?e.jsx("div",{className:"space-y-2",children:t.map(l=>e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 p-3 rounded-lg border",style:{backgroundColor:"#241812"},"data-testid":`card-account-${l.id}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsxs(Xa,{className:"h-10 w-10",children:[l.profilePictureUrl?e.jsx(Za,{src:l.profilePictureUrl,alt:l.displayName}):null,e.jsx(Ja,{className:"flex items-center justify-center",children:_s(l.provider)||l.displayName.charAt(0)})]}),e.jsxs("span",{className:`absolute -bottom-0.5 -right-0.5 h-4 w-4 rounded-full flex items-center justify-center text-white ${Cs(l.provider)}`,children:[l.provider==="facebook"&&e.jsx(qe,{className:"h-2.5 w-2.5"}),l.provider==="instagram"&&e.jsx(wt,{className:"h-2.5 w-2.5"}),l.provider==="google_business"&&e.jsx(bt,{className:"h-2.5 w-2.5"}),l.provider==="linkedin"&&e.jsx(He,{className:"h-2.5 w-2.5"}),l.provider==="x"&&e.jsx(Fe,{className:"h-2.5 w-2.5"}),l.provider==="nextdoor"&&e.jsx(Ze,{className:"h-2.5 w-2.5"})]})]}),e.jsxs("div",{children:[e.jsx("div",{className:"font-medium text-sm",children:l.displayName}),e.jsx("div",{className:"text-xs text-muted-foreground capitalize",children:l.provider==="facebook"?"Facebook Page":l.provider==="instagram"?"Instagram Professional Account":l.provider==="google_business"?"Google Business Profile":l.provider==="linkedin"?"LinkedIn Profile":l.provider==="x"?"X (Twitter) Account":l.provider==="nextdoor"?"Nextdoor Account":l.provider.replace("_"," ")})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.status==="active"?e.jsxs("span",{className:"flex items-center gap-1.5 text-xs px-2 py-0.5 rounded-full bg-green-500/15 text-green-400 border border-green-500/30",children:[e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-green-400"}),"Active"]}):e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-red-500/15 text-red-400 border border-red-500/30",children:"Inactive"}),e.jsx("button",{onClick:()=>u(l.id),disabled:r,className:"h-7 w-7 rounded-full flex items-center justify-center transition-colors hover:bg-white/10",style:{color:"#c8934e"},title:"Reconnect","data-testid":`button-disconnect-${l.id}`,children:e.jsx(ss,{className:"h-3.5 w-3.5"})})]})]},l.id))}):e.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[e.jsx(Ut,{className:"h-12 w-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{className:"font-medium",children:"No channels connected yet"}),e.jsx("p",{className:"text-sm mt-1",children:"Connect your social media accounts above to start posting"})]})]})]})}const il=x.memo(ol),ll=t=>{const[a,s]=t.split("-").map(Number),r=new Date;r.setHours(0,0,0,0);const n=new Date(r.getFullYear(),a-1,s);return n<r&&n.setFullYear(n.getFullYear()+1),n.toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})},cl=t=>{const[a,s]=t.split("-").map(Number),r=new Date;r.setHours(0,0,0,0);const n=new Date(r.getFullYear(),a-1,s);n.setHours(0,0,0,0),n<r&&n.setFullYear(n.getFullYear()+1);const o=Math.round((n.getTime()-r.getTime())/(1e3*60*60*24));return o===0?"Today":o===1?"Tomorrow":`In ${o} days`};function dl({holidays:t,holidaysLoading:a,generatingHolidayId:s,onSelectHoliday:r,onDraftHoliday:n}){return e.jsxs(we,{children:[e.jsx(Te,{className:"pb-3",children:e.jsxs(Me,{className:"text-base flex items-center gap-2",children:[e.jsx(xt,{className:"h-4 w-4",style:{color:"#c8934e"}}),"Upcoming Holidays"]})}),e.jsxs(je,{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"National days and holidays relevant to restaurants. Click one to generate a post about it."}),a?e.jsx("div",{className:"space-y-2",children:[1,2,3].map(o=>e.jsx(Ve,{className:"h-16 w-full"},o))}):t&&t.length>0?e.jsx("div",{className:"grid grid-cols-1 gap-3",children:t.map(o=>e.jsxs("div",{className:"p-4 rounded-lg border border-l-[3px] curs
150or-pointer transition-colors hover:bg-white/[0.02]",style:{backgroundColor:"#241812",borderLeftColor:"#a9702f"},onClick:()=>r(o),children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-medium text-sm mb-1",children:o.name}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[e.jsx("span",{className:"text-muted-foreground",children:ll(o.date)}),e.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium",style:{backgroundColor:"rgba(169, 112, 47,0.15)",color:"#c8934e"},children:cl(o.date)}),e.jsx("span",{className:"px-2 py-0.5 rounded-full text-xs",style:o.category==="food"?{backgroundColor:"rgba(169, 112, 47,0.15)",color:"#c8934e"}:{backgroundColor:"rgba(34,197,94,0.15)",color:"#7E8A55"},children:o.category})]}),o.suggestedAngle&&e.jsx("div",{className:"text-sm text-stone-400 mt-2 italic",children:o.suggestedAngle})]}),e.jsx("div",{className:"flex items-center gap-2 shrink-0",children:e.jsx("button",{className:"text-xs px-3 py-1.5 rounded-full border transition-colors font-medium",style:{borderColor:"#a9702f",color:"#c8934e"},disabled:s===o.id,onClick:i=>{i.stopPropagation(),n(o)},"data-testid":`btn-draft-holiday-${o.id}`,children:s===o.id?e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ce,{className:"h-3 w-3 animate-spin"})," Generating..."]}):"Draft Post"})})]}),o.suggestedTags&&o.suggestedTags.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:o.suggestedTags.map((i,c)=>e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full border",style:{borderColor:"#a9702f",color:"#c8934e"},children:i},c))})]},o.id))}):e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No upcoming holidays found."})]})]})}const ul=x.memo(dl);function ml({post:t,connectedAccounts:a,onReuse:s,onRetry:r,isRetrying:n}){const[o,i]=x.useState(!1),{data:c}=Ce({queryKey:[`/api/social-media/posts/${t.id}/results`],enabled:o}),l=(t.platformTargets||[]).map(m=>a.find(y=>y.id===m)?.provider||"unknown"),d=t.status==="failed"||t.status==="partial",h=t.status==="posted"?{backgroundColor:"rgba(34,197,94,0.15)",color:"#7E8A55",borderColor:"rgba(34,197,94,0.3)"}:t.status==="failed"?{backgroundColor:"rgba(239,68,68,0.15)",color:"#e89484",borderColor:"rgba(239,68,68,0.3)"}:t.status==="partial"?{backgroundColor:"rgba(234,179,8,0.15)",color:"#cf9a45",borderColor:"rgba(234,179,8,0.3)"}:{backgroundColor:"rgba(169, 112, 47,0.15)",color:"#c8934e",borderColor:"rgba(255,255,255,0.09)"};return e.jsxs("div",{className:"rounded-lg p-3 border",style:{backgroundColor:"#241812"},"data-testid":`sent-post-${t.id}`,children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm line-clamp-2 mb-2",children:t.caption}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[l.map((m,f)=>e.jsx("span",{children:ks(m)},f)),e.jsx("span",{className:"px-2 py-0.5 rounded-full",style:{backgroundColor:"rgba(169, 112, 47,0.15)",color:"#c8934e"},children:t.createdAt?new Date(t.createdAt).toLocaleDateString():"Unknown"}),t.status==="scheduled"&&t.scheduledFor&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Je,{className:"h-3 w-3"}),new Date(t.scheduledFor).toLocaleString()]})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 shrink-0",children:[d&&r&&e.jsxs("button",{onClick:()=>r(t.id),disabled:n,className:"text-xs px-3 py-1 rounded-full border transition-colors flex items-center gap-1",style:{borderColor:"rgba(239,68,68,0.4)",color:"#e89484"}
150,"data-testid":`btn-retry-post-${t.id}`,children:[n?e.jsx(ce,{className:"h-3 w-3 animate-spin"}):e.jsx(ss,{className:"h-3 w-3"}),"Retry"]}),e.jsx("button",{onClick:s,className:"text-xs px-3 py-1 rounded-full border transition-colors",style:{borderColor:"#a9702f",color:"#c8934e"},"data-testid":`btn-reuse-post-${t.id}`,children:"Reuse"}),e.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full border flex items-center gap-1",style:h,children:[t.status==="posted"&&e.jsx(Wt,{className:"h-3 w-3"}),t.status==="failed"&&e.jsx(Re,{className:"h-3 w-3"}),t.status==="partial"&&e.jsx(Re,{className:"h-3 w-3"}),t.status]})]})]}),d&&e.jsxs("div",{className:"mt-2",children:[e.jsxs("button",{onClick:()=>i(!o),className:"text-xs flex items-center gap-1 transition-colors",style:{color:"#c8934e"},"data-testid":`btn-why-failed-${t.id}`,children:[o?e.jsx(La,{className:"h-3 w-3"}):e.jsx(zt,{className:"h-3 w-3"}),o?"Hide details":"Why did this fail?"]}),o&&e.jsx("div",{className:"mt-1.5 space-y-1.5",children:c&&c.length>0?c.map(m=>e.jsxs("div",{className:"p-2 rounded text-xs border flex items-start gap-2",style:{backgroundColor:"#1c1210",borderColor:m.status==="failed"?"rgba(239,68,68,0.2)":"rgba(34,197,94,0.2)"},children:[m.status==="failed"?e.jsx(Re,{className:"h-3 w-3 mt-0.5 shrink-0 text-red-400"}):e.jsx(Wt,{className:"h-3 w-3 mt-0.5 shrink-0 text-green-400"}),e.jsxs("div",{children:[e.jsx("span",{className:"font-medium capitalize",children:m.provider}),m.status==="failed"&&m.errorMessage&&e.jsxs("span",{className:"text-stone-400",children:[" -- ",m.errorMessage]}),m.status==="success"&&e.jsx("span",{className:"text-green-400",children:" -- Published successfully"}),m.retryCount>0&&e.jsxs("span",{className:"text-stone-500",children:[" (retried ",m.retryCount,"x)"]})]})]},m.id)):e.jsx("div",{className:"p-2 rounded text-xs text-stone-400 border",style:{backgroundColor:"#1c1210",borderColor:"rgba(239,68,68,0.2)"},children:"Post failed -- check channel connection and try again"})})]})]})}function hl({postHistory:t,connectedAccounts:a,isRetrying:s,onReuse:r,onRetry:n}){return e.jsxs(we,{children:[e.jsx(Te,{className:"pb-3",children:e.jsx(Me,{className:"text-base",children:"Sent Posts"})}),e.jsx(je,{children:t&&t.length>0?e.jsxs("div",{className:"space-y-3",children:[(()=>{const o=t.filter(c=>{if(!c.createdAt)return!1;const u=new Date(c.createdAt),l=new Date;return u.getMonth()===l.getMonth()&&u.getFullYear()===l.getFullYear()}),i={};return o.forEach(c=>{(c.platformTargets||[]).forEach(u=>{const d=a?.find(h=>h.id===u)?.provider||`Account #${u}`;i[d]=(i[d]||0)+1})}),e.jsxs("div",{className:"rounded-lg p-3 mb-2",style:{backgroundColor:"#241812"},"data-testid":"monthly-post-summary",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsxs("p",{className:"text-sm font-semibold",children:["This Month: ",o.length," posts"]}),o.length>0&&e.jsx(zr,{className:"h-3 w-3 text-green-400"})]}),Object.keys(i).length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:Object.entries(i).map(([c,u])=>{const l={facebook:"bg-amber-500/15 text-amber-400 border-amber-500/30",instagram:"bg-pink-500/15 text-pink-400 border-pink-500/30",google_business:"bg-red-500/15 text-red-400 border-red-500/30",x:"bg-stone-500/15 text-stone-300 border-stone-500/30",linkedin:"bg-amber-700/15 text-amber-300 border-amber-700/30"};return e.jsxs("span",{className:`text-xs px-2 py-0.5 rounded-full border ${l[c]||""}`,children:[c,": ",u]},c)})})]})})(),t.slice(0,20).map(o=>e.jsx(ml,{post:o,connectedAccounts:a||[],onReuse:()=>r(o.caption),onRetry:i=>n(i),isRetrying:s},o.id))]}):e.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[e.jsx(rs,{className:"h-12 w-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{className:"font-medium",children:"No posts yet"}),e.jsx("p",{className:"text-sm mt-1",children:"Your published posts will appear here"})]})})]})}const pl=x.memo(hl);function fl({postHistory:t,connectedAccounts:a}){const s=new Date,r=(t||[]).filter(l=>{if(!l.createdAt)return!1;const d=new Date(l.createdAt);return d.getMonth()===s.getMonth()&&d.getFullYear()===s.getFullYear()&&(l.status==="posted"||l.status==="partial")}),n=(a||[]).filter(l=>l.status==="active"),o=(t||[]).filter(l=>l.status==="scheduled"),i=(t||[]).filter(l=>l.status==="posted"&&l.createdAt).sort((l,d)=>new Date(d.createdAt).getTime()-new Date(l.createdAt).getTime())[0],c=l=>{const d=s.getTime()-new Date(l).getTime(),h=Math.floor(d/6e4);if(h<60)return`${h}m ago`;const m=Math.floor(h/60);return m<24?`${m}h ago`:`${Math.floor(m/24)}d ago`},u=[{label:"Posts This Month",value:`${r.length} post${r.length!==1?"s":""}`,color:r.length>0?"text-white":"text-stone-400"},{label:"Channels Active",value:n.length>0?`${n.length}`:"--",color:n.length<4&&n.length>0?"text-amber-400":"text-white",sub:n.length>0&&n.length<4?`${n.length} of 4 connected`:void 0},{label:"Scheduled",value:`${o.length} scheduled`,color:o.length>0?"text-white":"text-stone-400"},{label:"Last Post",value:i?(i.caption||"").substring(0,30)+(i.caption&&i.caption.length>30?"...":""):"No posts yet",color:i?"text-white":"text-stone-400",sub:i?.createdAt?c(String(i.createdAt)):void 0},{label:"Best Time Today",value:"4:30 PM",color:"text-white"}];return e.jsx("div",{className:"flex gap-3 overflow-x-auto pb-2 mb-4 scrollbar-thin","data-testid":"social-performance-strip",children:u.map((l,d)=>e.jsxs("div",{className:"min-w-[160px] flex-shrink-0 rounded-lg p-3 border-l-[3px]",style:{backgroundColor:"#241812",borderLeftColor:"#a9702f"},"data-testid":`metric-card-${d}`,children:[e.jsx("div",{className:"text-[12px] text-stone-400 uppercase tracking-wider mb-1",children:l.label}),e.jsx("div",{className:`text-sm font-bold ${l.color} truncate`,children:l.value}),l.sub&&e.jsx("div",{className:"text-[13px] text-amber-400 mt-0.5",children:l.sub})]},d))})}function xl(){const{toast:t}
150=Oa(),a=$r(),[s,r]=x.useState("create"),[n,o]=x.useState(null),[i,c]=x.useState(!1),[u,l]=x.useState(!1),[d,h]=x.useState(""),[m,f]=x.useState(""),[y,g]=x.useState([]),[v,D]=x.useState(null),[b,S]=x.useState(!1),[z,G]=x.useState(!1),[J,j]=x.useState(!1),T=x.useRef(new Set),[q,B]=x.useState(null),[ne,Se]=x.useState(""),[We,st]=x.useState(!1),[pe,rt]=x.useState(void 0),[k,N]=x.useState("12:00"),[Be,Ne]=x.useState(""),[Ye,_t]=x.useState(""),la=x.useRef(null),$s=x.useRef(null),nt=x.useRef(0),[cc,zs]=x.useState(null),[$e,Dt]=x.useState({postType:"",outputStyle:"warm_hospitality",eventName:"",eventDate:H(new Date,"yyyy-MM-dd"),startTime:"",endTime:"",promotionDetails:"",targetAudience:"",tone:"classy",cta:"reserve_now",selectedHoliday:"",postTypeData:{},promotionDiscount:"",callToAction:""}),{data:ca,isLoading:Gs}=Ce({queryKey:["/api/social-media/holidays/upcoming"]}),{data:da}=Ce({queryKey:["/api/social-media/brand-settings"]}),{data:Ee,isLoading:Vs}=Ce({queryKey:["/api/social-media/accounts"]}),{data:ot}=Ce({queryKey:["/api/social-media/posts"]}),{data:Us}=Ce({queryKey:["/api/social-media/accounts/health"],refetchInterval:a?300*1e3:!1}),oe=x.useMemo(()=>Ee?.filter(p=>p.status==="active")||[],[Ee]),ua=(ot||[]).filter(p=>p.status==="failed"||p.status==="partial").length,it=(Us||[]).filter(p=>p.tokenStatus==="expired"||p.tokenStatus==="expiring_soon"),[qs,Qs]=x.useState("");x.useEffect(()=>{const p=setTimeout(()=>Qs(d),250);return()=>clearTimeout(p)},[d]),x.useEffect(()=>{const p=new URLSearchParams(window.location.search),w=p.get("connected"),C=p.get("error");if(w&&(fe.invalidateQueries({queryKey:["/api/social-media/accounts"]}),fe.invalidateQueries({queryKey:["/api/social-media/accounts/health"]}),t({title:"Account Connected",description:`Your ${w} account has been connected successfully.`}),window.history.replaceState({},"",window.location.pathname)),C){const E=p.get("diag");let P="";if(E)try{const X=JSON.parse(E);P=` | Scopes: ${(X.scopes||[]).join(", ")||"none"} | Token type: ${X.type||"unknown"} | Valid: ${X.is_valid} | API status: ${X.accounts_status} | Pages count: ${X.accounts_count??"N/A"}`,X.source&&(P+=` | Source: ${X.source}`),X.businesses_count!==void 0&&(P+=` | Businesses found: ${X.businesses_count}`),X.businesses_status&&(P+=` | Biz API status: ${X.businesses_status}`),X.accounts_error&&(P+=` | Error: ${X.accounts_error}`),X.business_error&&(P+=` | Biz Error: ${X.business_error}`)}catch{}const ae=p.get("msg"),ke=p.get("detail"),dt=ae?` Details: ${decodeURIComponent(ae)}`:"",ya=ke?` Details: ${decodeURIComponent(ke)}`:"",xr={no_pages:`No Facebook Pages found.${P}`,invalid_state:"Connection session expired. Please try again.",oauth_failed:`Connection failed.${ya||dt||" Please try again."}`,missing_params:"Connection was incomplete. Please try again.",google_denied:"Google connection was denied or cancelled.",google_rate_limited:"Google Business Profile connection is being set up. This feature will be available shortly â please check back in 24-48 hours.",google_api_not_enabled:"The Google Business Profile API is not enabled in your Google Cloud project. Please enable the 'My Business Account Management API' and 'My Business Business Information API' in Google Cloud Console, then try again.",no_google_locations:"No Google Business Profile locations were found for this Google account. Make sure the Google account you're connecting has a verified Business Profile.",google_locations_failed:`Could not retrieve your Business Profile locations.${ya||" The API may not be enabled in your Google Cloud project."}`};t({title:"Connection Failed",description:xr[C]||`Connection error: ${C}`,variant:"destructive"}),window.history.replaceState({},"",window.location.pathname)}},[]);const lt=Ge({mutationFn:async p=>(await _e("POST","/api/social-media/generate-post",p)).json(),onSuccess:p=>{D(p),h(p.primaryCaption),l(!1),t({title:"Post generated!",description:"Your content is ready. Edit it below or publish."})},onError:()=>{t({title:"Error",description:"Failed to generate post. Please try again.",variant:"destructive"})}}),Pt=Ge({mutationFn:async p=>{await _e("DELETE",`/api/social-media/accounts/${p}`)},onSuccess:()=>
150{fe.invalidateQueries({queryKey:["/api/social-media/accounts"]}),fe.invalidateQueries({queryKey:["/api/social-media/accounts/health"]}),t({title:"Disconnected",description:"Account has been disconnected."})},onError:()=>{t({title:"Error",description:"Failed to disconnect account.",variant:"destructive"})}}),Ie=Ge({mutationFn:async p=>(await _e("POST","/api/social-media/posts",p)).json(),onSuccess:p=>{fe.invalidateQueries({queryKey:["/api/social-media/accounts"]}),fe.invalidateQueries({queryKey:["/api/social-media/posts"]});const w=p.results||[],C=w.filter(P=>P.status==="failed"),E=w.filter(P=>P.status==="success");C.length>0&&E.length===0?t({title:"Publishing Failed",description:C.map(P=>`${P.provider}: ${P.errorMessage}`).join("; "),variant:"destructive"}):C.length>0?t({title:"Partially Published",description:`${E.length} succeeded, ${C.length} failed: ${C.map(P=>P.errorMessage).join("; ")}`,variant:"destructive"}):t({title:"Published!",description:`Your post has been sent to ${E.length} platform${E.length!==1?"s":""}.`}),h(""),f(""),D(null),g([])},onError:()=>{t({title:"Error",description:"Failed to publish post. Please try again.",variant:"destructive"})}}),Tt=Ge({mutationFn:async p=>(await _e("POST",`/api/social-media/posts/${p}/retry`)).json(),onSuccess:p=>{fe.invalidateQueries({queryKey:["/api/social-media/posts"]});const w=p.results||[],C=w.filter(P=>P.status==="failed"),E=w.filter(P=>P.status==="success");C.length===0?t({title:"Retry Successful",description:"All platforms published successfully."}):E.length>0?t({title:"Partial Retry Success",description:`${E.length} succeeded, ${C.length} still failing.`,variant:"destructive"}):t({title:"Retry Failed",description:C.map(P=>P.errorMessage).join("; "),variant:"destructive"})},onError:()=>{t({title:"Error",description:"Failed to retry post.",variant:"destructive"})}}),ct=x.useCallback(async p=>{if(!["image/jpeg","image/png","image/gif","image/webp"].includes(p.type)){t({title:"Invalid file",description:"Please upload a JPEG, PNG, GIF, or WebP image.",variant:"destructive"});return}if(p.size>10*1024*1024){t({title:"File too large",description:"Images must be under 10MB.",variant:"destructive"});return}G(!0),Ne(p.name),_t(`${(p.size/1024).toFixed(1)} KB`);try{const C=new FormData;C.append("image",p);const E=await fetch("/api/social-media/upload-image",{method:"POST",body:C,credentials:"include"});if(!E.ok)throw new Error("Upload failed");const P=await E.json(),ae=window.location.origin+P.url;f(ae),t({title:"Image uploaded",description:"Your image is ready."})}catch{t({title:"Upload failed",description:"Could not upload the image. Try again.",variant:"destructive"}),Ne(""),_t("")}finally{G(!1)}},[t]),ma=x.useCallback(p=>{p.preventDefault(),p.stopPropagation()},[]),ha=x.useCallback(p=>{p.preventDefault(),p.stopPropagation(),nt.current+=1,p.dataTransfer.types.includes("Files")&&S(!0)},[]),pa=x.useCallback(p=>{p.preventDefault(),p.stopPropagation(),nt.current-=1,nt.current===0&&S(!1)},[]),fa=x.useCallback(p=>{p.preventDefault(),p.stopPropagation(),nt.current=0,S(!1);const w=p.dataTransfer.files;w.length>0&&ct(w[0])},[ct]),Ks=x.useCallback(p=>{const w=p.target.files;w&&w.length>0&&ct(w[0])},[ct]),Xs=x.useCallback(()=>{f(""),Ne(""),_t("")},[]),Zs=x.useCallback(()=>{la.current?.click()},[]),Js=x.useCallback(()=>r("accounts"),[]),er=x.useCallback(()=>l(!1),[]),tr=x.useCallback(p=>{Pt.mutate(p)},[Pt]),ar=x.useCallback(async()=>{try{const w=await(await fetch("/api/oauth/meta/start",{credentials:"include"})).json();w.authUrl?window.location.href=w.authUrl:t({title:"Error",description:w.message||"Failed to start connection.",variant:"destructive"})}catch{t({title:"Error",description:"Failed to start connection.",variant:"destructive"})}},[t]),sr=x.useCallback(async()=>{try{const w=await(await fetch("/api/oauth/google/start",{credentials:"include"})).json();w.authUrl?window.location.href=w.authUrl:t({title:"Error",description:w.message||"Failed to start connection.",variant:"destructive"})}catch{t({title:"Error",description:"Failed to start connection.",variant:"destructive"})}},[t]),rr=x.useCallback(async()=>{try{const w=await(await fetch("/api/oauth/linkedin/start",{credentials:"include"})).json();w.authUrl?window.location.href=w.authUrl:t({title:"Error",description:w.message||"Failed to start connection.",variant:"destructive"})}catch{t({title:"Error",description:"Failed to start connection.",variant:"destructive"})}},[t]),nr=x.useCallback(async()=>{try{const w=await(await fetch("/api/oauth/x/start",{credentials:"include"})).json();w.authUrl?window.location.href=w.authUrl:t({title:"Error",description:w.message||"Failed to start connection.",variant:"destructive"})}catch{t({title:"Error",description:"Failed to start connection.",variant:"destructive"})}},[t]);x.useCallback(async()=>{try{const w=await(await fetch("/api/oauth/nextdoor/start",{credentials:"include"})).json();w.authUrl?window.location.href=w.authUrl:t({title:"Error",description:w.message||"Failed to start connection.",variant:"destructive"})}catch{t({title:"Error",description:"Failed to start connection.",variant:"destructive"})}},[t]),x.useEffect(()=>{const p=/https?:\/\/[^\s)>\]]{30,}/g,w=d.match(p);if(!w)return;const C=w.filter(P=>!P.includes("tinyurl.com")&&!T.current.has(P));if(C.length===0)return;const E=setTimeout(async()=>{j(!0);try{let P=d;for(const ae of C){T.current.add(ae);const ke=await _e("POST","/api/shorten-url",{url:ae});if(ke.ok){const dt=await ke.json();dt.shortUrl&&(P=P.replace(ae,dt.shortUrl))}}P!==d&&h(P)}catch{}finally{j(!1)}},800);return()=>clearTimeout(E)},[d]);const or=()=>{if(y.length===0){t({title:"Select channels",description:"Please select at least one channel to publish to.",variant:"destructive"});return}if(!d.trim()){t({title:"Write something",description:"Please write a caption for your post.",variant:"destructive"});return}Ie.mutate({caption:d.trim(),platformTargets:y,postNow:!0,generatedContent:v||void 0,mediaUrls:m?[m]:[]})},ir=()=>{if(y.length===0){t({title:"Select channels",description:"Please select at least one channel to publish to.",variant:"destructive"});return}if(!d.trim()){t({title:"Write something",description:"Please write a caption for your post.",variant:"destructive"});return}
150if(!pe){t({title:"Pick a date",description:"Please select a date to schedule your post.",variant:"destructive"});return}const[p,w]=k.split(":").map(Number),C=new Date(pe);if(C.setHours(p,w,0,0),C<=new Date){t({title:"Invalid time",description:"Scheduled time must be in the future.",variant:"destructive"});return}Ie.mutate({caption:d.trim(),platformTargets:y,postNow:!1,scheduledFor:C.toISOString(),generatedContent:v||void 0,mediaUrls:m?[m]:[]}),st(!1),rt(void 0),N("12:00")},lr=x.useCallback(p=>{g(w=>w.includes(p)?w.filter(C=>C!==p):[...w,p])},[]),cr=x.useCallback(()=>{g(p=>p.length===oe.length?[]:oe.map(w=>w.id))},[oe]),dr=x.useCallback((p,w)=>{navigator.clipboard.writeText(p),o(w),setTimeout(()=>o(null),2e3),t({title:"Copied!",description:"Text copied to clipboard."})},[t]),ur=x.useCallback(()=>{if(!$e.postType){t({title:"Missing info",description:"Please select a post type.",variant:"destructive"});return}const p=y.map(w=>oe.find(E=>E.id===w)?.provider||"").filter(Boolean);lt.mutate({...$e,platforms:p.length>0?p:["facebook","instagram"],postTypeData:$e.postTypeData||{},mediaUrl:m||""})},[$e,y,oe,m,lt,t]),Mt=x.useCallback((p,w)=>{Dt(C=>({...C,postType:"holiday",eventName:p,selectedHoliday:p,eventDate:w||H(new Date,"yyyy-MM-dd")})),l(!0),r("create")},[]),xa=x.useCallback(p=>{h(p),r("create"),t({title:"Post content loaded",description:"Edit and repost!"})},[t]),mr=x.useCallback(p=>{Tt.mutate(p)},[Tt]),hr=x.useCallback(p=>{const w=Ht(p.name,p.category,p.suggestedAngle??void 0,p.suggestedTags??void 0);h(w.caption),r("create")},[]),pr=x.useCallback(async p=>{Mt(p.name),l(!0),B(p.id),f("");try{const w=await fetch("/api/social-media/holiday/generate",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({holidayName:p.name,holidayDescription:p.suggestedAngle??"",holidayTags:p.suggestedTags??[],category:p.category??""})});if(w.ok){const C=await w.json(),E=C.imageUrl.startsWith("http")?C.imageUrl:window.location.origin+C.imageUrl;f(E),Se(C.imageId||Date.now().toString())}else{const C=Ht(p.name,p.category,p.suggestedAngle??void 0,p.suggestedTags??void 0),E=window.location.origin+C.imageUrl;f(E)}}catch{const w=Ht(p.name,p.category,p.suggestedAngle??void 0,p.suggestedTags??void 0),C=window.location.origin+w.imageUrl;f(C)}finally{B(null)}},[Mt]),fr=p=>{zs(H(p,"yyyy-MM-dd")),Dt(w=>({...w,eventDate:H(p,"yyyy-MM-dd")})),r("create"),l(!0)},Le=(()=>{const p=y.map(E=>oe.find(ae=>ae.id===E)?.provider||"").filter(Boolean),w=Array.from(new Set(p));if(w.length===0)return null;let C={chars:1/0,label:""};return w.forEach(E=>{const P=Sa[E];P&&P.chars<C.chars&&(C=P)}),C.chars===1/0?null:C})(),St=Le?d.length/Le.chars*100:0,ga=St>=100?"text-red-500":St>=80?"text-amber-400":"text-stone-400";return e.jsxs("div",{className:"space-y-4",children:[e.jsx(fl,{postHistory:ot,connectedAccounts:Ee}),it.length>0&&e.jsx("div",{className:"space-y-2",children:it.map(p=>e.jsxs("div",{className:"flex items-start gap-3 rounded-lg p-3 border text-sm",style:{backgroundColor:p.tokenStatus==="expired"?"rgba(239,68,68,0.1)":"rgba(234,179,8,0.1)",borderColor:p.tokenStatus==="expired"?"rgba(239,68,68,0.3)":"rgba(234,179,8,0.3)"},"data-testid":`token-warning-${p.id}`,children:[e.jsx(Re,{className:"h-4 w-4 mt-0.5 shrink-0",style:{color:p.tokenStatus==="expired"?"#e89484":"#cf9a45"}}),e.jsx("div",{className:"flex-1",children:e.jsx("p",{style:{color:p.tokenStatus==="expired"?"#e89484":"#cf9a45"},children:p.message})}),p.tokenStatus==="expired"&&e.jsx("button",{onClick:()=>r("accounts"),className:"text-xs px-3 py-1 rounded-full border shrink-0",style:{borderColor:"rgba(239,68,68,0.3)",color:"#e89484"},children:"Reconnect"})]},p.id))}),e.jsxs(Sr,{value:s,onValueChange:r,children:[e.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2 mb-4",children:e.jsxs(Er,{children:[e.jsxs(Oe,{value:"create","data-testid":"tab-create-post",children:[e.jsx(Gr,{className:"h-4 w-4 mr-2"}),"Create"]}),e.jsxs(Oe,{value:"schedule","data-testid":"tab-schedule",children:[e.jsx(Aa,{className:"h-4 w-4 mr-2"}),"Schedule"]}),e.jsxs(Oe,{value:"accounts","data-testid":"tab-accounts",children:[e.jsx(Ut,{className:"h-4 w-4 mr-2"}),"Channels",it.length>0&&e.jsx("span",{className:"ml-1.5 flex h-4 w-4 items-center justify-center rounded-full text-[13px] font-bold",style:{backgroundColor:"rgba(239,68,68,0.8)",color:"white"},children:it.length})]}),e.jsxs(Oe,{value:"holidays","data-testid":"tab-holidays",children:[e.jsx(sn,{className:"h-4 w-4 mr-2"}),"Holidays"]}),e.jsxs(Oe,{value:"history","data-testid":"tab-history",children:[e.jsx(rs,{className:"h-4 w-4 mr-2"}),"Sent",ua>0&&e.jsx("span",{className:"ml-1.5 flex h-4 w-4 items-center justify-center rounded-full text-[13px] font-bold",style:{backgroundColor:"rgba(239,68,68,0.8)",color:"white"},children:ua})]}),e.jsxs(Oe,{value:"settings","data-testid":"tab-settings",children:[e.jsx(Vr,{className:"h-4 w-4 mr-2"}),"Voice"]})]})}),e.jsx(Ae,{value:"create",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-5 ga
150p-4",children:[e.jsxs("div",{className:"lg:col-span-3 space-y-4",children:[e.jsx(we,{onDragOver:ma,onDragEnter:ha,onDragLeave:pa,onDrop:fa,className:"transition-colors",style:{animation:"socialShimmer 3s ease-in-out infinite"},children:e.jsxs(je,{className:"p-4 space-y-4",children:[b&&e.jsx("div",{className:"flex items-center justify-center p-6 border-2 border-dashed rounded-md",style:{borderColor:"#a9702f",backgroundColor:"rgba(169, 112, 47,0.05)"},children:e.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[e.jsx(es,{className:"h-8 w-8",style:{color:"#a9702f"}}),e.jsx("span",{className:"text-sm font-medium",style:{color:"#a9702f"},children:"Drop your image here"})]})}),e.jsx(Ji,{activeAccounts:oe,selectedAccountIds:y,onToggle:lr,onSelectAll:cr,onAddChannel:Js}),e.jsx(Wa,{placeholder:"What would you like to share?",value:d,onChange:p=>h(p.target.value),rows:8,className:"text-base resize-none border-0 focus-visible:ring-0 shadow-none","data-testid":"textarea-caption"}),(d||Le)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[e.jsxs("span",{className:ga,children:[d.length," characters"]}),Le&&e.jsxs("span",{className:`font-medium ${ga}`,children:["/ ",Le.chars," (",Le.label,")",St>=100&&" -- over limit"]}),J&&e.jsxs("span",{className:"flex items-center gap-1 text-primary",children:[e.jsx(ce,{className:"h-3 w-3 animate-spin"}),"Shortening link..."]}),(()=>{const p=y.map(C=>oe.find(P=>P.id===C)?.provider||"").filter(Boolean);return Array.from(new Set(p)).map(C=>{const E=Sa[C];if(!E)return null;const P=d.length>E.chars,ae=d.length/E.chars*100,ke=P?"text-red-500 border-red-500/30 bg-red-500/10":ae>=80?"text-amber-400 border-amber-400/30 bg-amber-400/10":"";return e.jsxs(Ba,{variant:"outline",className:`text-xs ${ke}`,"data-testid":`badge-char-limit-${C}`,children:[E.label,": ",d.length,"/",E.chars]},C)})})()]}),e.jsx(tl,{fileInputRef:la,dropZoneRef:$s,isDragging:b,isUploading:z,mediaUrl:m,imageKey:ne,uploadedFileName:Be,uploadedFileSize:Ye,generatingHolidayId:q,onFileSelect:Ks,onRemoveImage:Xs,onBrowseClick:Zs,onDragOver:ma,onDragEnter:ha,onDragLeave:pa,onDrop:fa}),e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-t pt-3",children:[e.jsx("div",{className:"flex flex-wrap items-center gap-1",children:e.jsxs(Z,{variant:u?"default":"outline",size:"sm",onClick:()=>l(!u),style:u?{backgroundColor:"#a9702f",color:"white"}:{},"data-testid":"button-ai-assistant",children:[e.jsx(xt,{className:"h-4 w-4 mr-1"}),"Post Assistant"]})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(Z,{variant:"outline",size:"sm",onClick:()=>c(!i),className:"lg:hidden","data-testid":"button-toggle-preview",children:[e.jsx(as,{className:"h-4 w-4 mr-1"}),"Preview"]}),e.jsx(Z,{onClick:or,disabled:!d.trim()||y.length===0||Ie.isPending,style:{borderColor:"#a9702f"},"data-testid":"button-publish-now",children:Ie.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ce,{className:"h-4 w-4 mr-2 animate-spin"}),"Publishing..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ur,{className:"h-4 w-4 mr-2"}),"Publish Now"]})}),e.jsxs(Ua,{open:We,onOpenChange:st,children:[e.jsx(qa,{asChild:!0,children:e.jsxs(Z,{variant:"outline",disabled:!d.trim()||y.length===0||Ie.isPending,"data-testid":"button-schedule-post",children:[e.jsx(Je,{className:"h-4 w-4 mr-2"}),"Schedule"]})}),e.jsx(Qa,{className:"w-auto p-4",align:"end",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"text-sm font-medium",children:"Schedule Post"}),e.jsx(ra,{mode:"single",selected:pe,onSelect:rt,disabled:p=>p<Pe(new Date),className:"rounded-md border"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{className:"text-sm whitespace-nowrap",children:"Time:"}),e.jsx(De,{type:"time",value:k,onChange:p=>N(p.target.value),className:"w-full","data-testid":"input-schedule-time"})]}),pe&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:["Posting on ",H(pe,"EEE, MMM d, yyyy")," at ",k]}),e.jsxs(Z,{onClick:ir,disabled:!pe||Ie.isPending,className:"w-full","data-testid":"button-confirm-schedule",children:[e.jsx(ts,{className:"h-4 w-4 mr-2"}),"Confirm Schedule"]})]})})]})]})]})]})}),u&&e.jsx(sl,{aiFormData:$e,setAiFormData:Dt,holidays:ca,isGenerating:lt.isPending,onClose:er,onGenerate:ur,onSelectHolidayBadge:Mt})]}),e.jsx(nl,{showPreview:i,isGenerating:lt.isPending,caption:qs,selectedAccountIds:y,activeAccounts:oe,brandSettings:da,mediaUrl:m,imageKey:ne,generatedPost:v,copiedField:n,onCopy:dr})]})}
150),e.jsx(Ae,{value:"schedule",children:e.jsx(gl,{posts:ot||[],connectedAccounts:Ee||[],onReuse:xa,onEmptyCellClick:fr})}),e.jsx(Ae,{value:"accounts",children:e.jsx(il,{connectedAccounts:Ee,activeAccounts:oe,accountsLoading:Vs,disconnectPending:Pt.isPending,onConnectMeta:ar,onConnectGoogle:sr,onConnectLinkedIn:rr,onConnectX:nr,onDisconnect:tr})}),e.jsx(Ae,{value:"holidays",children:e.jsx(ul,{holidays:ca,holidaysLoading:Gs,generatingHolidayId:q,onSelectHoliday:hr,onDraftHoliday:pr})}),e.jsx(Ae,{value:"history",children:e.jsx(pl,{postHistory:ot,connectedAccounts:Ee,isRetrying:Tt.isPending,onReuse:xa,onRetry:mr})}),e.jsx(Ae,{value:"settings",children:e.jsxs(we,{style:{animation:"socialShimmer 3s ease-in-out infinite"},children:[e.jsx(Te,{className:"pb-3",children:e.jsx(Me,{className:"text-base font-semibold",children:"Brand Voice Settings"})}),e.jsx(je,{children:e.jsx(yl,{settings:da})})]})})]})]})}function gl({posts:t,connectedAccounts:a,onReuse:s,onEmptyCellClick:r}){const[n,o]=x.useState(()=>de(new Date,{weekStartsOn:0})),[i,c]=x.useState(null),u=typeof window<"u"&&window.innerWidth<768,[l,d]=x.useState(u?"list":"week"),[h,m]=x.useState("all"),f=jt(n,{weekStartsOn:0}),y=Array.from({length:7},(j,T)=>Q(n,T)),g=Pe(new Date),v=j=>{const T=j.scheduledFor||j.createdAt;return T?Pe(new Date(T)):null},D=j=>t.filter(T=>{const q=v(T);return q&&K(q,j)}),b=t.filter(j=>{if(h==="all")return!0;const T=v(j);return T?h==="upcoming"?Ke(T,g)||K(T,g):!Ke(T,g)&&!K(T,g):!1}).sort((j,T)=>{const q=v(j),B=v(T);return!q||!B?0:B.getTime()-q.getTime()}),S=j=>{switch(j){case"facebook":return e.jsx(qe,{className:"h-3 w-3 text-amber-600"});case"instagram":return e.jsx(wt,{className:"h-3 w-3 text-pink-500"});case"google_business":return e.jsx(bt,{className:"h-3 w-3 text-green-600"});case"linkedin":return e.jsx(He,{className:"h-3 w-3 text-amber-700"});case"x":return e.jsx(Fe,{className:"h-3 w-3"});case"nextdoor":return e.jsx(Ze,{className:"h-3 w-3 text-green-500"});default:return null}},z=j=>{switch(j){case"posted":return{backgroundColor:"rgba(34,197,94,0.15)",borderColor:"rgba(34,197,94,0.3)",color:"#7E8A55"};case"scheduled":return{backgroundColor:"rgba(169, 112, 47,0.15)",borderColor:"rgba(255,255,255,0.09)",color:"#c8934e"};case"failed":return{backgroundColor:"rgba(239,68,68,0.15)",borderColor:"rgba(239,68,68,0.3)",color:"#e89484"};case"partial":return{backgroundColor:"rgba(234,179,8,0.15)",borderColor:"rgba(234,179,8,0.3)",color:"#facc15"};default:return{backgroundColor:"#241812",borderColor:"rgba(255,255,255,0.1)"}}},G=j=>(j.platformTargets||[]).map(T=>a.find(B=>B.id===T)?.provider||"unknown"),J=y.reduce((j,T)=>j+D(T).length,0);return e.jsx("div",{className:"space-y-4",children:e.jsxs(we,{children:[e.jsx(Te,{className:"pb-3",children:e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsx(Me,{className:"text-base",children:"Post Schedule"}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsxs("div",{className:"flex items-center rounded-full p-0.5",style:{backgroundColor:"#241812"},children:[e.jsx("button",{onClick:()=>d("week"),className:"text-xs px-3 py-1 rounded-full transition-colors font-medium",style:l==="week"?{backgroundColor:"#a9702f",color:"#1c1210"}:{color:"#888"},"data-testid":"btn-view-week",children:"Week"}),e.jsx("button",{onClick:()=>d("list"),className:"text-xs px-3 py-1 rounded-full transition-colors font-medium",style:l==="list"?{backgroundColor:"#a9702f",color:"#1c1210"}:{color:"#888"},"data-testid":"btn-view-list",children:"List"})]})})]})}),e.jsxs(je,{children:[l==="week"?e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Z,{variant:"outline",size:"sm",onClick:()=>o(uo(n)),"data-testid":"btn-prev-week",children:e.jsx(Va,{className:"h-4 w-4"})}),e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-sm font-semibold","data-testid":"text-week-range",children:[H(n,"MMM d")," â ",H(f,"MMM d, yyyy")]}),e.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{backgroundColor:"rgba(169, 112, 47,0.15)",color:"#c8934e"},children:[J," post",J!==1?"s":""," this week"]})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{onClick:()=>o(de(new Date,{weekStartsOn:0})),className:"text-xs px-2.5 py-1 rounded-full border font-medium",style:{borderColor:"#a9702f",color:"#c8934e"},"data-testid":"btn-today",children:"Today"}),e.jsx(Z,{variant:"outline",size:"sm",onClick:()=>
150o(Qe(n,1)),"data-testid":"btn-next-week",children:e.jsx(pt,{className:"h-4 w-4"})})]})]}),e.jsx("div",{className:"grid grid-cols-7 gap-1","data-testid":"schedule-week-grid",children:y.map(j=>{const T=D(j),q=K(j,g);return e.jsxs("div",{className:"min-h-[120px]",children:[e.jsxs("div",{className:"text-center py-1 rounded-t-md text-xs font-medium",style:q?{backgroundColor:"#a9702f",color:"#1c1210"}:{backgroundColor:"#241812",color:"#888"},children:[e.jsx("div",{children:H(j,"EEE")}),e.jsx("div",{className:q?"font-bold":"",children:H(j,"d")})]}),e.jsxs("div",{className:"border border-t-0 rounded-b-md p-1 space-y-1 min-h-[88px]",style:q?{backgroundColor:"rgba(169, 112, 47,0.04)"}:{},children:[T.length===0&&e.jsx("button",{onClick:()=>r(j),className:"w-full min-h-[72px] border border-dashed rounded flex items-center justify-center text-muted-foreground/30 transition-colors group",style:{borderColor:"rgba(255,255,255,0.05)"},"data-testid":`empty-cell-${H(j,"yyyy-MM-dd")}`,children:e.jsx(gr,{className:"h-4 w-4 opacity-0 group-hover:opacity-50 transition-opacity"})}),T.slice(0,3).map(B=>{const ne=G(B);return e.jsxs("button",{onClick:()=>c(i?.id===B.id?null:B),className:"w-full text-left p-1 rounded border text-[13px] leading-tight truncate cursor-pointer",style:z(B.status),"data-testid":`schedule-post-${B.id}`,children:[e.jsxs("div",{className:"flex items-center gap-0.5 mb-0.5",children:[ne.slice(0,2).map((Se,We)=>e.jsx("span",{"data-testid":`icon-provider-${Se}-${B.id}`,children:S(Se)},We)),ne.length>2&&e.jsxs("span",{className:"text-[12px] text-muted-foreground",children:["+",ne.length-2]})]}),e.jsx("span",{className:"line-clamp-2",children:(B.caption||"").substring(0,50)})]},B.id)}),T.length>3&&e.jsxs("span",{className:"text-[13px] text-center block px-1 py-0.5 rounded-full",style:{backgroundColor:"rgba(169, 112, 47,0.15)",color:"#c8934e"},children:["+",T.length-3," more"]})]})]},j.toISOString())})})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex flex-wrap items-center gap-1","data-testid":"list-filter-controls",children:["all","upcoming","past"].map(j=>e.jsx(Z,{variant:h===j?"secondary":"ghost",size:"sm",onClick:()=>m(j),"data-testid":`btn-filter-${j}`,children:j==="all"?"All":j==="upcoming"?"Upcoming":"Past"},j))}),b.length===0?e.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[e.jsx(Aa,{className:"h-12 w-12 mx-auto mb-3 opacity-30"}),e.jsx("p",{className:"font-medium",children:"No posts found"}),e.jsx("p",{className:"text-sm mt-1",children:"Posts you create will appear here"})]}):b.slice(0,30).map(j=>{const T=G(j),q=v(j);return e.jsx("button",{onClick:()=>c(i?.id===j.id?null:j),className:"w-full text-left p-3 rounded-lg border transition-colors",style:i?.id===j.id?{backgroundColor:"#241812",borderColor:"#a9702f"}:{backgroundColor:"#241812"},"data-testid":`list-post-${j.id}`,children:e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm line-clamp-1",children:j.caption||"No content"}),e.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[e.jsx("div",{className:"flex items-center gap-1",children:T.map((B,ne)=>e.jsx("span",{"data-testid":`list-icon-${B}-${j.id}`,children:S(B)},ne))}),e.jsx("span",{className:"text-xs text-muted-foreground",children:q?H(q,"EEE, MMM d"):"No date"})]})]}),e.jsx("span",{className:"text-[13px] shrink-0 px-2 py-0.5 rounded-full border",style:z(j.status),children:j.status})]})},j.id)})]}),i&&e.jsxs("div",{className:"mt-4 p-4 rounded-lg border",style:{backgroundColor:"#241812"},"data-testid":"post-detail-panel",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2 mb-3",children:[e.jsxs("div",{className:"flex gap-1",children:[e.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full border flex items-center gap-1",style:z(i.status),children:[i.status==="posted"&&e.jsx(Wt,{className:"h-3 w-3"}),i.status==="failed"&&e.jsx(Re,{className:"h-3 w-3"}),i.status]}),i.postType&&e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{backgroundColor:"rgba(169, 112, 47,0.15)",color:"#c8934e"},children:Ns.find(j=>j.value===i.postType)?.label||i.postType})]}),e.jsx("button",{onClick:()=>c(null),className:"h-6 w-6 rounded-full flex items-center justify-center transition-colors hover:bg-white/10","data-testid":"btn-close-post-detail",children:e.jsx($t,{className:"h-3 w-3"})})]}),e.jsx("p",{className:"text-sm mb-3 whitespace-pre-wrap",children:i.caption||"No content"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs text-muted-foreground mb-3",children:[e.jsx(Je,{className:"h-3 w-3"}),i.scheduledFor?H(new Date(i.scheduledFor),"EEE, MMM d, yyyy 'at' h:mm a"):i.createdAt?H(new Date(i.createdAt),"EEE, MMM d, yyyy 'at' h:mm a"):"No date",e.jsx("span",{className:"mx-1",children:"|"}),e.jsx("div",{className:"flex items-center gap-1",children:G(i).map((j,T)=>e.jsx("span",{children:S(j)},T))})]}),i.mediaUrls&&i.mediaUrls.length>0&&e.jsx("div",{className:"flex gap-2 mb-3",children:i.mediaUrls.map((j,T)=>e.jsx("img",{src:j,alt:"Post media",className:"h-16 w-16 object-cover rounded-md border"},T))}),e.jsxs("button",{onClick:()=>s(i.caption),className:"text-xs px-3 py-1.5 rounded-full border transition-colors",style:{borderColor:"#a9702f",color:"#c8934e"},"data-testid":"btn-reuse-from-schedule",children:[e.jsx(mt,{className:"h-3 w-3 inline mr-1"}),"Reuse Content"]})]})]})]})})}function yl({settings:t}){const{toast:a}
150=Oa(),[s,r]=x.useState(!1),[n,o]=x.useState(!1),[i,c]=x.useState(""),[u,l]=x.useState(""),[d,h]=x.useState(!1),[m,f]=x.useState({voiceAdjectives:t?.voiceAdjectives||["warm","welcoming"],defaultCta:t?.defaultCta||"reserve",neverSayList:t?.neverSayList?.join(", ")||"",emojiLevel:t?.emojiLevel||"light",hashtagStyle:t?.hashtagStyle||"minimal",restaurantName:t?.restaurantName||"",location:t?.location||""}),y=Ge({mutationFn:async b=>{const S={...b,neverSayList:b.neverSayList.split(",").map(G=>G.trim()).filter(Boolean)};return(await _e("POST","/api/social-media/brand-settings",S)).json()},onSuccess:()=>{fe.invalidateQueries({queryKey:["/api/social-media/brand-settings"]}),r(!0),setTimeout(()=>r(!1),1500),a({title:"Saved!",description:"Brand voice settings updated."})},onError:()=>{a({title:"Error",description:"Failed to save settings.",variant:"destructive"})}}),g=async()=>{if(!i.trim()){a({title:"Enter a description",description:"Tell us what you want to post about.",variant:"destructive"});return}h(!0),l("");try{const S=await(await _e("POST","/api/social-media/voice-preview",{description:i})).json();l(S.preview||"")}catch{a({title:"Error",description:"Failed to generate preview.",variant:"destructive"})}finally{h(!1)}},v=["warm","confident","welcoming","premium","playful","professional"],D=b=>{f(S=>({...S,voiceAdjectives:S.voiceAdjectives.includes(b)?S.voiceAdjectives.filter(z=>z!==b):[...S.voiceAdjectives,b]}))};return e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Set your brand voice to keep posts consistent, even when different team members create them."}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Restaurant Name"}),e.jsx(De,{value:m.restaurantName,onChange:b=>f({...m,restaurantName:b.target.value}),placeholder:"Your restaurant name",className:"border-0 border-b border-stone-700 rounded-none focus:border-[#a9702f]",style:{backgroundColor:"#1c1210"},"data-testid":"input-restaurant-name"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Location"}),e.jsx(De,{value:m.location,onChange:b=>f({...m,location:b.target.value}),placeholder:"e.g., Cedar Park, TX",className:"border-0 border-b border-stone-700 rounded-none focus:border-[#a9702f]",style:{backgroundColor:"#1c1210"},"data-testid":"input-location"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Voice Adjectives"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:v.map(b=>{const S=m.voiceAdjectives.includes(b);return e.jsx("button",{className:"text-xs px-3 py-1.5 rounded-full border transition-colors cursor-pointer",style:S?{backgroundColor:"#a9702f",borderColor:"#a9702f",color:"#1c1210"}:{backgroundColor:"#241812",borderColor:"rgba(255,255,255,0.09)",color:"#888"},onClick:()=>D(b),"data-testid":`badge-voice-${b.toLowerCase().replace(/\s+/g,"-")}`,children:b},b)})})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Default CTA"}),e.jsxs(ge,{value:m.defaultCta,onValueChange:b=>f({...m,defaultCta:b}),children:[e.jsx(ye,{className:"border-0 border-b border-stone-700 rounded-none focus:border-[#a9702f]",style:{backgroundColor:"#1c1210"},"data-testid":"select-default-cta",children:e.jsx(ve,{})}),e.jsxs(be,{children:[e.jsx(ee,{value:"reserve",children:"Reserve"}),e.jsx(ee,{value:"walk_ins",children:"Walk-ins Welcome"}),e.jsx(ee,{value:"order_online",children:"Order Online"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Emoji Level"}),e.jsxs(ge,{value:m.emojiLevel,onValueChange:b=>f({...m,emojiLevel:b}),children:[e.jsx(ye,{className:"border-0 border-b border-stone-700 rounded-none focus:border-[#a9702f]",style:{backgroundColor:"#1c1210"},"data-testid":"select-emoji-level",children:e.jsx(ve,{})}),e.jsxs(be,{children:[e.jsx(ee,{value:"none",children:"None"}),e.jsx(ee,{value:"light",children:"Light"}),e.jsx(ee,{value:"normal",children:"Normal"})]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(V,{children:"Hashtag Style"}),e.jsxs(ge,{value:m.hashtagStyle,onValueChange:b=>f({...m,hashtagStyle:b}),children:[e.jsx(ye,{className:"border-0 border-b border-stone-700 rounded-none focus:border-[#a9702f]",style:{backgroundColor:"#1c1210"},"data-testid":"select-hashtag-style",children:e.jsx(ve,{})}),e.jsxs(be,{children:[e.jsx(ee,{value:"none",children:"None"}),e.jsx(ee,{value:"minimal",children:"Minimal (3-5)"}),e.jsx(ee,{value:"local",children:"Local-focused"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(V,{children:"Never Say (comma-separated)"}),e.jsx("span",{className:"text-xs text-muted-foreground",title:"These words will be excluded from all generated posts",children:e.jsx(qr,{className:"h-3 w-3"})})]}),e.jsx(De,{value:m.neverSayList,onChange:b=>f({...m,neverSayList:b.target.value}),placeholder:"e.g., cheap, best ever, guaranteed",className:"border-0 border-b border-stone-700 rounded-none focus:border-[#a9702f]",style:{backgroundColor:"#1c1210"},"data-testid":"input-never-say"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"These words will be excluded from all generated posts"})]}),e.jsx("button",{onClick:()=>y.mutate(m),disabled:y.isPending,className:"w-full py-2.5 rounded-md text-sm font-bold text-white transition-colors disabled:opacity-50 flex items-center justify-center gap-2",style:s?{backgroundColor:"#7E8A55"}:{backgroundColor:"#a9702f"},"data-testid":"button-save-brand-settings",children:y.isPending?e.jsxs(e.Fragment,{children:[e.jsx(ce,{className:"h-4 w-4 animate-spin"}),"Saving..."]}):s?e.jsxs(e.Fragment,{children:[e.jsx(ut,{className:"h-4 w-4"}),"Saved"]}):"Save Brand Voice Settings"}),e.jsxs("div",{className:"border-t pt-4 mt-4",children:[e.jsxs("button",{onClick:()=>o(!n),className:"flex items-center gap-2 text-sm font-semibold mb-3 w-full","data-testid":"button-toggle-voice-preview",children:[n?e.jsx(La,{className:"h-4 w-4"}):e.jsx(zt,{className:"h-4 w-4"}),"Preview Your Voice"]}),n&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:"Describe a special or event in one sentence. We will generate a sample post using your configured voice settings."}),e.jsx(De,{value:i,onChange:b=>c(b.target.value),placeholder:"e.g., Crawfish boil every Thursday",className:"border-0 border-b border-stone-700 rounded-none focus:border-[#a9702f]",style:{backgroundColor:"#1c1210"},"data-testid":"input-voice-preview"}),e.jsx("button",{onClick:g,disabled:d||!i.trim(),className:"text-xs px-4 py-1.5 rounded-full border transition-colors disabled:opacity-50",style:{borderColor:"#a9702f",color:"#c8934e"},"data-testid":"button-generate-voice-preview",children:d?e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ce,{className:"h-3 w-3 animate-spin"}),"Generating..."]}):"Generate Sample Post"}),u&&e.jsx("div",{className:"p-3 rounded-md text-sm border-l-2",style:{backgroundColor:"#1c1210",borderLeftColor:"#a9702f"},"data-testid":"text-voice-preview-result",children:u})]})]})]})}var he="Accordion",vl=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[na,bl,wl]=yr(he),[kt]=vr(he,[wl,ns]),oa=ns(),Ds=M.forwardRef((t,a)=>{const{type:s,...r}=t,n=r,o=r;return e.jsx(na.Provider,{scope:t.__scopeAccordion,children:s==="multiple"?e.jsx(Cl,{...o,ref:a}):e.jsx(kl,{...n,ref:a})})});Ds.displayName=he;var[Ps,jl]=kt(he),[Ts,Nl]=kt(he,{collapsible:!1}),kl=M.forwardRef((t,a)=>{const{value:s,defaultValue:r,onValueChange:n=()=>{},collapsible:o=!1,...i}=t,[c,u]=Ra({prop:s,defaultProp:r,onChange:n});return e.jsx(Ps,{scope:t.__scopeAccordion,value:c?[c]:[],onItemOpen:u,onItemClose:M.useCallback(()=>o&&u(""),[o,u]),children:e.jsx(Ts,{scope:t.__scopeAccordion,collapsible:o,children:e.jsx(Ms,{...i,ref:a})})})}),Cl=M.forwardRef((t,a)=>{const{value:s,defaultValue:r,onValueChange:n=()=>{},...o}=t,[i=[],c]=Ra({prop:s,defaultProp:r,onChange:n}),u=M.useCallback(d=>c((h=[])=>[...h,d]),[c]),l=M.useCallback(d=>c((h=[])=>h.filter(m=>m!==d)),[c]);return e.jsx(Ps,{scope:t.__scopeAccordion,value:i,onItemOpen:u,onItemClose:l,children:e.jsx(Ts,{scope:t.__scopeAccordion,collapsible:!0,children:e.jsx(Ms,{...o,ref:a})})})}),[_l,Ct]=kt(he),Ms=M.forwardRef((t,a)=>{const{__scopeAccordion:s,disabled:r,dir:n,orientation:o="vertical",...i}=t,c=M.useRef(null),u=wr(c,a),l=bl(s),h=jr(n)==="ltr",m=Nr(t.onKeyDown,f=>{if(!vl.includes(f.key))return;const y=f.target,g=l().filter(T=>!T.ref.current?.disabled),v=g.findIndex(T=>T.ref.current===y),D=g.length;if(v===-1)return;f.preventDefault();let b=v;const S=0,z=D-1,G=()=>{b=v+1,b>z&&(b=S)},J=()=>{b=v-1,b<S&&(b=z)};switch(f.key){case"Home":b=S;break;case"End":b=z;break;case"ArrowRight":o==="horizontal"&&(h?G():J());break;case"ArrowDown":o==="vertical"&&G();break;case"ArrowLeft":o==="horizontal"&&(h?J():G());break;case"ArrowUp":o==="vertical"&&J();break}const j=b%D;g[j].ref.current?.focus()});return e.jsx(_l,{scope:s,disabled:r,direction:n,orientation:o,children:e.jsx(na.Slot,{scope:s,children:e.jsx(Fa.div,{...i,"data-orientation":o,ref:u,onKeyDown:r?void 0:m})})})}),vt="AccordionItem",[Dl,ia]=kt(vt),Ss=M.forwardRef((t,a)=>{const{__scopeAccordion:s,value:r,...n}
150=t,o=Ct(vt,s),i=jl(vt,s),c=oa(s),u=br(),l=r&&i.value.includes(r)||!1,d=o.disabled||t.disabled;return e.jsx(Dl,{scope:s,open:l,disabled:d,triggerId:u,children:e.jsx(Xr,{"data-orientation":o.orientation,"data-state":Rs(l),...c,...n,ref:a,disabled:d,open:l,onOpenChange:h=>{h?i.onItemOpen(r):i.onItemClose(r)}})})});Ss.displayName=vt;var Es="AccordionHeader",Is=M.forwardRef((t,a)=>{const{__scopeAccordion:s,...r}=t,n=Ct(he,s),o=ia(Es,s);return e.jsx(Fa.h3,{"data-orientation":n.orientation,"data-state":Rs(o.open),"data-disabled":o.disabled?"":void 0,...r,ref:a})});Is.displayName=Es;var Bt="AccordionTrigger",Ls=M.forwardRef((t,a)=>{const{__scopeAccordion:s,...r}=t,n=Ct(he,s),o=ia(Bt,s),i=Nl(Bt,s),c=oa(s);return e.jsx(na.ItemSlot,{scope:s,children:e.jsx(Zr,{"aria-disabled":o.open&&!i.collapsible||void 0,"data-orientation":n.orientation,id:o.triggerId,...c,...r,ref:a})})});Ls.displayName=Bt;var Os="AccordionContent",As=M.forwardRef((t,a)=>{const{__scopeAccordion:s,...r}=t,n=Ct(he,s),o=ia(Os,s),i=oa(s);return e.jsx(Jr,{role:"region","aria-labelledby":o.triggerId,"data-orientation":n.orientation,...i,...r,ref:a,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...t.style}})});As.displayName=Os;function Rs(t){return t?"open":"closed"}var Pl=Ds,Tl=Ss,Ml=Is,Fs=Ls,Hs=As;const Sl=Pl,Ws=x.forwardRef(({className:t,...a},s)=>e.jsx(Tl,{ref:s,className:xe("border-b",t),...a}));Ws.displayName="AccordionItem";const Bs=x.forwardRef(({className:t,children:a,...s},r)=>e.jsx(Ml,{className:"flex",children:e.jsxs(Fs,{ref:r,className:xe("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",t),...s,children:[a,e.jsx(zt,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));Bs.displayName=Fs.displayName;const Ys=x.forwardRef(({className:t,children:a,...s},r)=>e.jsx(Hs,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...s,children:e.jsx("div",{className:xe("pb-4 pt-0",t),children:a})}));Ys.displayName=Hs.displayName;const ed={protein:"5",produce:"10",dairy:"3",dry_goods:"2",other:"0"},td=[{label:"Casual Dining",value:"28"},{label:"Brunch/Breakfast",value:"30"},{label:"Seafood/Fine Dining",value:"32"},{label:"Quick Service",value:"25"}],ad={protein:"#e0b24e",produce:"#d98a3f",dairy:"#c8934e",dry_goods:"#a99a82",other:"#efe7d8"};function El({text:t,surface:a="dark"}){const s=a==="paper",r=t.split(` 151`),n=[];r.forEach((u,l)=>{const d=u.trim();if(!d||d.startsWith("#")||d.endsWith(":"))return;(d.match(/^[-â¢â¡ââââ]\s|^\[\s?\]\s|^\[x\]\s/i)||d.length>5)&&n.push(l)});const[o,i]=x.useState(new Set),c=u=>{i(l=>{const d=new Set(l);return d.has(u)?d.delete(u):d.add(u),d})};return e.jsxs("div",{children:[n.length>0&&e.jsxs("div",{className:`flex items-center gap-2 mb-3 text-xs ${s?"":"text-muted-foreground"}`,style:s?{color:L.mid}:void 0,"data-testid":"checklist-progress",children:[e.jsx("div",{className:`flex-1 h-1.5 overflow-hidden ${s?"rounded-[1px]":"rounded-full bg-muted"}`,style:s?{background:"rgba(41,34,26,0.12)"}:void 0,children:e.jsx("div",{className:`h-full transition-all duration-300 ${s?"rounded-[1px]":"rounded-full"}`,style:{width:`${o.size/n.length*100}%`,background:s?o.size===n.length?L.good:"#8a744c":"#a9702f"}})}),e.jsxs("span",{className:"font-medium",style:{color:s?o.size===n.length?L.good:L.mid:o.size===n.length?"#7E8A55":"#c8934e"},children:[o.size," of ",n.length," completed"]})]}),e.jsx("div",{className:"space-y-2",children:r.map((u,l)=>{const d=u.trim();if(!d)return null;if(d.startsWith("#")||d.endsWith(":"))return e.jsxs("div",{className:"mt-4 mb-1",children:[e.jsx("div",{className:s?"paper-title":"text-[12px] font-bold tracking-wider uppercase",style:s?void 0:{color:"#c8934e"},children:d.replace(/^#+\s*/,"").replace(/:$/,"")}),e.jsx("div",{className:"h-px mt-1",style:{background:s?"rgba(41,34,26,0.18)":"rgba(200, 147, 78,0.2)"}})]},l);const h=d.match(/^[-â¢â¡ââââ]\s|^\[\s?\]\s|^\[x\]\s/i),m=d.replace(/^[-â¢â¡ââââ]\s|^\[\s?\]\s|^\[x\]\s/i,"").trim();if(h||d.length>5){const f=o.has(l);return e.jsxs("label",{className:"flex items-start gap-3 cursor-pointer group py-1","data-testid":`checklist-item-${l}`,children:[e.jsx("input",{type:"checkbox",checked:f,className:`mt-0.5 h-4 w-4 border-2 cursor-pointer shrink-0 accent-primary ${s?"rounded-[2px]":"rounded"}`,style:{accentColor:s?"#8a744c":"#a9702f"},onChange:()=>c(l)}),e.jsx("span",{className:s?`text-[15px] leading-relaxed transition-colors ${f?"line-through":""}`:`text-sm leading-relaxed transition-colors ${f?"line-through text-muted-foreground
151/50":"text-muted-foreground group-hover:text-foreground"}`,style:s?{color:f?L.faint:L.full}:void 0,children:m||d})]},l)}return e.jsx("div",{className:s?"text-[15px] leading-relaxed":"text-sm text-muted-foreground leading-relaxed",style:s?{color:L.mid}:void 0,children:d},l)})})]})}function Il(t,a="dark"){return e.jsx(El,{text:t,surface:a})}function Ll(t,a="dark"){const s=a==="paper",r=t.split(` 152`),n=[];let o={header:null,steps:[]},i=null;for(const u of r){const l=u.trim();if(!l)continue;const d=l.match(/^(?:WHEN\s|IF\s|AFTER\s|BEFORE\s|DURING\s).{10,}/i)||l===l.toUpperCase()&&l.length>10&&!l.match(/^\d/);if(d&&o.steps.length>0){i&&(o.steps.push(i),i=null),n.push(o),o={header:l,steps:[]};continue}if(d&&o.steps.length===0&&!o.header){o.header=l;continue}const h=l.match(/^(\d+)[\.\)]\s*(.+)/);if(h){i&&o.steps.push(i);const m=h[2].includes('"')||h[2].includes("â")||h[2].includes("â");i={num:h[1],text:h[2].replace(/\*\*/g,""),isQuote:m}}else i?(i.text+=" "+l.replace(/\*\*/g,""),(l.includes('"')||l.includes("â"))&&(i.isQuote=!0)):o.steps.push({num:"",text:l.replace(/\*\*/g,""),isQuote:!1})}return i&&o.steps.push(i),(o.steps.length>0||o.header)&&n.push(o),n.some(u=>u.steps.some(l=>l.num))?e.jsx("div",{className:"space-y-4",children:n.map((u,l)=>e.jsxs("div",{children:[u.header&&e.jsx("div",{className:s?"font-semibold text-[15px] mb-3":"font-bold text-sm text-foreground mb-3",style:s?{color:L.full}:void 0,children:u.header}),e.jsxs("div",{className:"relative",children:[u.steps.filter(d=>d.num).length>1&&e.jsx("div",{className:"absolute left-[11px] top-7 bottom-3 w-px",style:{background:s?"rgba(41,34,26,0.15)":"rgba(255,255,255,0.07)"}}),e.jsx("div",{className:"space-y-3",children:u.steps.map((d,h)=>e.jsxs("div",{className:"flex items-start gap-3 relative","data-testid":`script-step-${l}-${h}`,children:[d.num?e.jsx("div",{className:`w-6 h-6 flex items-center justify-center text-xs font-bold shrink-0 z-10 ${s?"rounded-[2px] ledger-stat-value":"rounded-full"}`,style:s?{background:"rgba(41,34,26,0.05)",color:L.mid,border:"1px solid rgba(41,34,26,0.28)"}:{background:"rgba(169, 112, 47,0.15)",color:"#c8934e",border:"1.5px solid rgba(169, 112, 47,0.4)"},children:d.num}):e.jsx("div",{className:"w-6 shrink-0"}),d.isQuote?s?e.jsxs("div",{className:"flex-1 pl-3 text-[15px] leading-relaxed",style:{borderLeft:"2px solid var(--ledger-red)",color:L.full,fontStyle:"italic"},children:[e.jsx("span",{style:{color:L.faint},className:"mr-0.5",children:"â"}),d.text,e.jsx("span",{style:{color:L.faint},className:"ml-0.5",children:"â"})]}):e.jsxs("div",{className:"flex-1 rounded-lg p-2.5 text-sm text-muted-foreground leading-relaxed",style:{background:"#241812"},children:[e.jsx("span",{className:"text-primary/50 mr-1",children:"â"}),d.text,e.jsx("span",{className:"text-primary/50 ml-1",children:"â"})]}):e.jsx("p",{className:s?"text-[15px] leading-relaxed pt-0.5 flex-1":"text-sm text-muted-foreground leading-relaxed pt-0.5 flex-1",style:s?{color:L.full}:void 0,children:d.text})]},h))})]})]},l))}):s?e.jsx("div",{className:"whitespace-pre-wrap text-[15px] leading-relaxed pl-4",style:{borderLeft:"2px solid var(--ledger-red)",color:L.full},children:t}):e.jsx("div",{className:"whitespace-pre-wrap text-sm leading-relaxed border-l-4 pl-4",style:{borderColor:"rgba(255,255,255,0.09)"},children:t})}function Ol(t,a="dark"){const s=a==="paper",r=s?e.jsx("div",{className:"w-[3px] h-[3px] mt-2 shrink-0",style:{background:L.faint}}):e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-muted-foreground/40 mt-1.5 shrink-0"}),n=s?"flex items-start gap-2.5 text-[15px] leading-relaxed":"flex items-start gap-2 text-sm text-muted-foreground",o=s?{color:L.full}:void 0,i=(l,d=!1)=>s?e.jsx("span",{className:`inline-block paper-title px-1.5 py-0.5 ${d?"mr-2":""}`,style:{border:"1px solid rgba(41,34,26,0.28)",borderRadius:"2px",fontSize:"0.6875rem"},children:l.toUpperCase()}):e.jsx("span",{className:`inline-block text-[13px] font-bold tracking-wider bg-amber-500/15 text-amber-400 border border-amber-500/20 px-2 py-0.5 rounded ${d?"mr-2":""}`,children:l.toUpperCase()}),c=t.split(/\n(?=PHASE\s+\d)/i);if(c.length>1){const l=[];for(const d of c){const h=d.trim().split(` 153`),m=h[0]?.match(/^PHASE\s+(\d+)[:\s\u2014\u2013-]*(.*)/i);if(m){const f=h.slice(1).map(y=>
153y.trim()).filter(Boolean).map(y=>y.replace(/^[-\u2022]\s*/,""));l.push({num:m[1],title:m[2].trim()||`Phase ${m[1]}`,items:f})}else{const f=h.map(y=>y.trim()).filter(Boolean).map(y=>y.replace(/^[-\u2022]\s*/,""));l.push({num:"",title:"",items:f})}}return e.jsx("div",{className:s?void 0:"space-y-3",children:l.map((d,h)=>e.jsxs("div",{className:s?"py-3.5 first:pt-0":"rounded-lg border border-border/50 p-4",style:s&&h>0?{borderTop:"1px solid rgba(41,34,26,0.12)"}:void 0,"data-testid":`framework-phase-${d.num||h}`,children:[e.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[d.num&&(s?e.jsx("div",{className:"ledger-stat-value text-[20px] leading-none shrink-0 w-7 pt-0.5",style:{color:"var(--ledger-red)"},children:d.num}):e.jsx("div",{className:"w-7 h-7 rounded-full border-2 border-primary flex items-center justify-center text-xs font-bold text-primary shrink-0",children:d.num})),e.jsx("div",{className:s?"font-semibold text-[15px] pt-0.5":"font-semibold text-sm text-foreground pt-0.5",style:s?{color:L.full}:void 0,children:d.title})]}),d.items.length>0&&e.jsx("ul",{className:"space-y-1 ml-10",children:d.items.map((m,f)=>e.jsxs("li",{className:n,style:o,children:[r,m]},f))})]},h))})}const u=t.split(/\n(?=(?:SERVER|BARTENDER|HOST|MANAGER|SHIFT LEAD|BOH|FOH|KITCHEN|BAR)[:\s])/i);if(u.length<=1){const d=t.split(` 154`).filter(m=>m.trim()).map(m=>m.trim());return d.some(m=>/^[-\u2022*]\s/.test(m))||d.length>2?e.jsx("ul",{className:"space-y-1.5",children:d.map((m,f)=>{const y=m.replace(/^[-\u2022*]\s*/,""),g=y.match(/^(SERVER|BARTENDER|HOST|MANAGER|SHIFT LEAD|BOH|FOH|KITCHEN|BAR)[:\s]/i);return g?e.jsxs("li",{className:"mt-3 first:mt-0",children:[i(g[1],!0),e.jsx("span",{className:s?"text-[15px] leading-relaxed":"text-sm text-muted-foreground",style:s?{color:L.full}:void 0,children:y.slice(g[0].length).trim()})]},f):e.jsxs("li",{className:n,style:o,children:[r,y]},f)})}):e.jsx("div",{className:s?"whitespace-pre-wrap text-[15px] leading-relaxed":"whitespace-pre-wrap text-sm leading-relaxed text-muted-foreground",style:s?{color:L.full}:void 0,children:t})}return e.jsx("div",{className:"space-y-4",children:u.map((l,d)=>{const h=l.split(` 155`),m=h[0]?.trim(),f=m?.match(/^(SERVER|BARTENDER|HOST|MANAGER|SHIFT LEAD|BOH|FOH|KITCHEN|BAR)[:\s](.*)/i),y=h.slice(1).filter(g=>g.trim()).map(g=>g.trim().replace(/^[-\u2022]\s*/,""));return e.jsxs("div",{className:s?"py-3.5 first:pt-0":"rounded-lg border border-border/50 p-4",style:s&&d>0?{borderTop:"1px solid rgba(41,34,26,0.12)"}:void 0,"data-testid":`framework-section-${d}`,children:[f&&e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i(f[1]),f[2]&&e.jsx("span",{className:s?"font-semibold text-[15px]":"font-semibold text-sm",style:s?{color:L.full}:void 0,children:f[2].trim()})]}),!f&&m&&e.jsx("div",{className:s?"font-semibold text-[15px] mb-2":"font-semibold text-sm text-foreground mb-2",style:s?{color:L.full}:void 0,children:m}),e.jsx("ul",{className:"space-y-1",children:y.map((g,v)=>e.jsxs("li",{className:n,style:o,children:[r,g]},v))})]},d)})})}const Ea={principle:{icon:en,label:"Principle",color:"bg-amber-500/10 text-amber-600 dark:text-amber-400"},output:{icon:an,label:"Framework",color:"bg-primary/10 text-primary"},checklist:{icon:os,label:"Checklist",color:"bg-[#7E8A55]/15 text-[#7E8A55] dark:text-[#9dab6d]"},script:{icon:Ha,label:"Script",color:"bg-amber-500/10 text-amber-600 dark:text-amber-400"}};function Al({content:t}){const a=[{issue:"Late Food",recovery:"Free dessert or comp drink",authority:"Server authority up to $20"},{issue:"Wrong Item",recovery:"Replace immediately + comp item",authority:"Server authority"},{issue:"Guest Complaint",recovery:"Manager visit + appropriate comp",authority:"Manager up to $100"}],s=t.filter(n=>n.contentType==="checklist"),r=[];for(const n of s){const o=(n.content||"").split(` 156`);for(const i of o)if((i.toLowerCase().includes("minute")||i.toLowerCase().includes("second")||i.toLowerCase().includes("timing"))&&(r.push(i.trim().replace(/^[-\u2022\u25a1]\s*/,"")),r.length>=4))break;if(r.length>=4)break}return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"rounded-[2px] border border-primary/20 p-4",style:{background:"#1f1310"},children:[e.jsxs("h4",{className:"text-sm font-bold text-foreground mb-3 flex items-center gap-2",children:[e.jsx(kr,{className:"h-4 w-4 text-primary"}),"Top Recovery Protocols"]}),e.jsx("div",{className:"space-y-2",children:a.map((n,o)=>e.jsxs("div",{className:"flex items-start gap-3 text-sm","data-testid":`quick-ref-protocol-${o}`,children:[e.jsx("div",{className:"w-5 h-5 rounded-full bg-primary/15 text-primary flex items-center justify-center text-xs font-bold shrink-0 mt-0.5",children:o+1}),e.jsxs("div",{children:[e.jsxs("span",{className:"font-semibold text-foreground",children:[n.issue,":"]})," ",e.jsx("span",{className:"text-muted-foreground",children:n.recovery}),e.jsxs("span",{className:"text-xs text-primary/70 ml-2",children:["(",n.authority,")"]})]})]},o))})]}),r.length>0&&e.jsxs("div",{className:"rounded-[2px] border border-primary/20 p-4",style:{background:"#1f1310"},children:[e.jsxs("h4",{className:"text-sm font-bold text-foreground mb-3 flex items-center gap-2",children:[e.jsx(Je,{className:"h-4 w-4 text-primary"}),"Non-Negotiable Timing Standards"]}),e.jsx("div",{className:"space-y-1.5",children:r.map((n,o)=>e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-primary shrink-0"}),n]},o))})]}),r.length===0&&e.jsx("div",{className:"rounded-[2px] border border-dashed border-muted-foreground
156/30 p-4 text-center",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Timing standards will appear here once configured in your checklists."})}),e.jsxs("div",{className:"rounded-[2px] border border-primary/20 p-4",style:{background:"#1f1310"},children:[e.jsx("h4",{className:"text-sm font-bold text-foreground mb-3",children:"Comp Authority Limits"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[{role:"Server",limit:"Dessert / non-alc drink"},{role:"Bartender",limit:"One round / appetizer"},{role:"Shift Lead",limit:"Up to $25"},{role:"Manager",limit:"Up to $100"}].map(n=>e.jsxs("div",{className:"flex items-center gap-2 p-2 rounded-[2px] bg-muted/30",children:[e.jsxs("span",{className:"font-semibold text-foreground",children:[n.role,":"]}),e.jsx("span",{className:"text-muted-foreground",children:n.limit})]},n.role))})]})]})}function Rl({content:t}){const a=t.filter(o=>o.contentType==="checklist"),s=t.filter(o=>o.contentType==="script"),r=[];for(const o of a){const i=(o.content||"").split(` 157`);for(const c of i){const u=c.trim();if(u&&!u.startsWith("#")&&!u.endsWith(":")&&u.length>5&&(r.push(u.replace(/^[-\u2022\u25a1\u2713\u2714\u2610\u2611]\s|^\[\s?\]\s|^\[x\]\s/i,"").trim()),r.length>=5))break}if(r.length>=5)break}const n=[];for(const o of s){const c=(o.content||"").split(` 158`).filter(u=>u.trim()).slice(0,2).join(" ").substring(0,80);if(n.push({title:o.title||"Untitled Script",preview:c+(c.length>=80?"...":"")}),n.length>=3)break}return e.jsxs("div",{className:"space-y-6",children:[r.length>0&&e.jsxs("div",{className:"rounded-[2px] border border-primary/20 p-4",style:{background:"#1f1310"},children:[e.jsxs("h4",{className:"text-sm font-bold text-foreground mb-3 flex items-center gap-2",children:[e.jsx(os,{className:"h-4 w-4 text-primary"}),"Key Training Standards"]}),e.jsx("div",{className:"space-y-1.5",children:r.map((o,i)=>e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[e.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-primary shrink-0"}),o]},i))})]}),n.length>0&&e.jsxs("div",{className:"rounded-[2px] border border-primary/20 p-4",style:{background:"#1f1310"},children:[e.jsxs("h4",{className:"text-sm font-bold text-foreground mb-3 flex items-center gap-2",children:[e.jsx(Ha,{className:"h-4 w-4 text-primary"}),"Training Scripts"]}),e.jsx("div",{className:"space-y-2",children:n.map((o,i)=>e.jsxs("div",{className:"p-2 rounded-[2px] bg-muted/30",children:[e.jsx("div",{className:"text-xs font-semibold text-foreground",children:o.title}),e.jsx("div",{className:"text-xs text-muted-foreground mt-0.5",children:o.preview})]},i))})]}),r.length===0&&n.length===0&&e.jsx("div",{className:"rounded-[2px] border border-dashed border-muted-foreground/30 p-4 text-center",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Training materials will appear here once you add checklists and scripts."})})]})}function Ia({content:t,slug:a}){const s=t.reduce((u,l)=>{const d=l.contentType||"output";return u[d]||(u[d]=[]),u[d].push(l),u},{}),r=["checklist","script","output","principle"],n=r.filter(u=>s[u]?.length),o=r.filter(u=>!s[u]?.length).map(u=>({type:u,config:Ea[u]})).filter(u=>u.config);if(n.length===0&&a!=="service")return null;const i=n.reduce((u,l)=>u+s[l].length,0),c=a==="service"?"Service Standards":a==="training"?"Training Materials":"The Framework";return e.jsxs("div",{className:"mt-4",children:[a==="service"&&e.jsx(Al,{content:t}),a==="training"&&e.jsx(Rl,{content:t}),n.length>0&&e.jsxs(Kr,{title:c,meta:`${i} ${i===1?"ENTRY":"ENTRIES"}`,className:a==="service"||a==="training"?"mt-8":"",testid:`domain-framework-${a}`,folio:e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"THE HOUSE STANDARD"}),e.jsx("span",{children:"RUN IT AT PRE-SHIFT"})]}),children:[e.jsx(Sl,{type:"multiple",children:n.map((u,l)=>{const d=Ea[u];if(!d)return null;const h=s[u],m=d.icon;return e.jsxs(Ws,{value:u,className:"border-0",style:l>0?{borderTop:"1px solid rgba(41,34,26,0.12)"}:void 0,children:[e.jsx(Bs,{className:"py-3 hover:no-underline",style:{color:L.mid},"data-testid":`accordion-${u}`,children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(m,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"paper-title",children:d.label}),e.jsx("span",{className:"ledger-stat-value text-[15px]",style:{color:L.faint},children:h.length})]})}),e.jsx(Ys,{className:"pb-5 space-y-6",children:h.map(f=>e.jsxs("div",{"data-testid":`content-item-${f.id}`,children:[e.jsxs("h4",{className:"font-semibold mb-3 flex items-center gap-2 text-[15px]",style:{color:L.full},children:[e.jsx(m,{className:"h-4 w-4",style:{color:"var(--ledger-red)"}}),f.title]}),u==="checklist"?Il(f.content||"","paper"):u==="script"?Ll(f.content||"","paper"):u==="output"?Ol(f.content||"","paper"):u==="principle"?e.jsx("div",{className:"pl-4 py-1 italic text-[15px] leading-relaxed whitespace-pre-wrap",style:{borderLeft:"2px s
158olid var(--ledger-red)",color:L.full},children:f.content}):e.jsx("div",{className:"whitespace-pre-wrap text-[15px] leading-relaxed",style:{color:L.full},children:f.content})]},f.id))})]},u)})}),o.length>0&&a==="service"&&e.jsx("div",{className:"mt-4","data-testid":"empty-sections",children:o.map(({type:u,config:l})=>{const d=l.icon;return e.jsxs("div",{className:"py-3",style:{borderTop:"1px dashed rgba(41,34,26,0.22)"},"data-testid":`empty-section-${u}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",style:{color:L.faint},children:[e.jsx(d,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"paper-title",style:{color:L.faint},children:l.label}),e.jsx("span",{className:"ledger-stat-value text-[15px]",children:"0"})]}),e.jsx("p",{className:"text-[13px]",style:{color:L.mid},children:"Add your standards here. They'll appear on the Quick Reference view."})]},u)})})]})]})}const Fl=M.lazy(()=>F(()=>import("./costs-Cs7kxm-Y.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54])).then(t=>({default:t.MarginStatusStrip}))),Hl=M.lazy(()=>F(()=>import("./costs-Cs7kxm-Y.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54])).then(t=>({default:t.FoodCostCalculator}))),Wl=M.lazy(()=>F(()=>import("./costs-Cs7kxm-Y.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54])).then(t=>({default:t.VendorInvoiceTracker}))),Bl=M.lazy(()=>F(()=>import("./kitchen-kcSOEjUE.js"),__vite__mapDeps([55,2,3,4,5,1,6,9,10,28,11,12,13,14,41,56,57,44,45,58,59,60,22,15,19,42,61,43,62,25,26,27,29,30,31,32,33,34,35,36,37,38,39,40,23,18,8,46,47,48,49,7,50,51,52,53,54])).then(t=>({default:t.KitchenStatusStrip}))),Yl=M.lazy(()=>F(()=>import("./kitchen-kcSOEjUE.js"),__vite__mapDeps([55,2,3,4,5,1,6,9,10,28,11,12,13,14,41,56,57,44,45,58,59,60,22,15,19,42,61,43,62,25,26,27,29,30,31,32,33,34,35,36,37,38,39,40,23,18,8,46,47,48,49,7,50,51,52,53,54])).then(t=>({default:t.KitchenComplianceEngine}))),$l=M.lazy(()=>F(()=>import("./kitchen-kcSOEjUE.js"),__vite__mapDeps([55,2,3,4,5,1,6,9,10,28,11,12,13,14,41,56,57,44,45,58,59,60,22,15,19,42,61,43,62,25,26,27,29,30,31,32,33,34,35,36,37,38,39,40,23,18,8,46,47,48,49,7,50,51,52,53,54])).then(t=>({default:t.RecipeScaler}))),zl=M.lazy(()=>F(()=>import("./hr--TS_Dr5L.js"),__vite__mapDeps([63,2,3,4,5,1,6,7,8,9,28,11,12,13,64,65,41,19,43,62,66,23,67,58,45,42,24])).then(t=>({default:t.HRStatusStrip}))),Gl=M.lazy(()=>F(()=>import("./hr--TS_Dr5L.js"),__vite__mapDeps([63,2,3,4,5,1,6,7,8,9,28,11,12,13,64,65,41,19,43,62,66,23,67,58,45,42,24])).then(t=>({default:t.HRComplianceEngine}))),Vl=M.lazy(()=>F(()=>import("./hr--TS_Dr5L.js"),__vite__mapDeps([63,2,3,4,5,1,6,7,8,9,28,11,12,13,64,65,41,19,43,62,66,23,67,58,45,42,24])).then(t=>({default:t.HRRecordsViewer}))),Ul=M.lazy(()=>F(()=>import("./staffing-Cbh-CU4y.js"),__vite__mapDeps([68,2,3,5,1,6,9,10,28,11,12,13,41,69,70,59,61,45,66,15,16,49,71,17,44,72,43])).then(t=>({default:t.StaffingMetricStrip}))),ql=M.lazy(()=>F(()=>import("./staffing-Cbh-CU4y.js"),__vite__mapDeps([68,2,3,5,1,6,9,10,28,11,12,13,41,69,70,59,61,45,66,15,16,49,71,17,44,72,43])).then(t=>({default:t.LaborDemandEngine}))),Ql=M.lazy(()=>F(()=>import("./training-COxs6pu7.js"),__vite__mapDeps([73,2,3,5,1,6,71,57])).then(t=>({default:t.TrainingMetricStrip}))),Kl=M.lazy(()=>F(()=>import("./training-COxs6pu7.js"),__vite__mapDeps([73,2,3,5,1,6,71,57])).then(t=>({default:t.SkillsCertificationEngine}))),Xl=M.lazy(()=>F(()=>import("./service-CthVFD-X.js"),__vite__mapDeps([74,2,3,5,1,6,28,11,12,13,41,43])).then(t=>({default:t.ServiceMetricStrip}))),Zl=M.lazy(()=>F(()=>import("./service-CthVFD-X.js"),__vite__mapDeps([74,2,3,5,1,6,28,11,12,13,41,43])).then(t=>({default:t.GuestRecoveryAdvisor}))),Jl=M.lazy(()=>F(()=>import("./leadership-CcTHNb-y.js"),__vite__mapDeps([75,2,3,4,5,1,6,7,8,9,11,12,13,64,65,47,21,44,52])).then(t=>({default:t.DailyTaskReminder}))),ec=M.lazy(()=>F(()=>import("./reviews-Bxe69nqe.js"),__vite__mapDeps([76,2,3,5,1,6,7,8,9,28,11,12,13,77,64,65,78,24,41,71,45,43,79,19,23,66,32])).then(t=>({default:t.ReviewResponseGenerator}))),tc=M.lazy(()=>F(()=>import("./crisis-BjBxKyfK.js"),__vite__mapDeps([80,2,3,5,1,6,9,28,11,12,13,44,47,67,43,66,32,48,45])).then(t=>({default:t.CrisisReadinessStrip}))),ac=M.lazy(()=>F(()=>import("./crisis-BjBxKyfK.js"),__vite__mapDeps([80,2,3,5,1,6,9,28,11,12,13,44,47,67,43,66,32,48,45])).then(t=>({default:t.CrisisResponseEngine}))),sc=M.lazy(()=>F(()=>import("./sops-Dj43b7do.js"),__vite__mapDeps([81,2,3,5,1,6,7,8,9,10,28,11,12,13,41,72,67,44,19,58,43,66,62,24,18,82,22,83,25,26,27,29,30,31,32,33,34,35,36,37,38,39,40,23,42,15,45,46,47,48,49,50,51,52,53,54])).then(t=>({default:t.SOPHealthStrip}))),rc=M.lazy(()=>F(()=>import("./sops-Dj43b7do.js"),__vite__mapDeps([81,2,3,5,1,6,7,8,9,10,28,11,12,13,41,72,67,44,19,58,43,66,62,24,18,82,22,83,25,26,27,29,30,31,32,33,34,35,36,37,38,39,40,23,42,15,45,46,47,48,49,50,51,52,53,54])).then(t=>({default:t.SOPCaptureEngine}))),nc=M.lazy(()=>F(()=>import("./sops-Dj43b7do.js"),__vite__mapDeps([81,2,3,5,1,6,7,8,9,10,28,11,12,13,41,72,67,44,19,58,43,66,62,24,18,82,22,83,25,26,27,29,30,31,32,33,34,35,36,37,38,39,40,23,42,15,45,46,47,48,49,50,51,52,53,54])).then(t=>({default:t.AssetHealthStrip}))),oc=M.lazy(()=>F(()=>import("./sops-Dj43b7do.js"),__vite__mapDeps([81,2,3,5,1,6,7,8,9,10,28,11,12,13,41,72,67,44,19,58,43,66,62,24,18,82,22,83,25,26,27,29,30,31,32,33,34,35,36,37,38,39,40,23,42,15,45,46,47,48,49,50,51,52,53,54])).then(t=>({default:t.FacilityCommandCenter})));function ic(){return e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(ce,{className:"h-6 w-6 animate-spin text-muted-foreground"})})}function lc(){const{slug:t}=Cr(),{logout:a}=_r(),{isDomainLocked:s}=Tr(),{data:r,isLoading:n,isError:o,refetch:i}=Ce({queryKey:["/api/domains",t],queryFn:async()=>{const d=await fetch(`/api/domains/${t}`);if(!d.ok)throw new Error("Failed to fetch domain");return d.json()}});if(n)return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("header",{className:"border-b border-border sticky top-0 bg-background/95 backdrop-blur z-50",style:{paddingTop:"env(safe-area-inset-top, 0px)"},children:e.jsx("div",{className:"container mx-auto px-4 py-4 flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Et,{className:"h-6 w-6 text-primary"}),e.jsx("span",{className:"font-bold",children:"The Restaurant Consultant"})]})})}),e.jsxs("main",{className:"container mx-auto px-4 py-8 max-w-4xl",children:[e.jsx(Ve,{className:"h-8 w-48 mb-4"}),e.jsx(Ve,{className:"h-4 w-full mb-8"}),e.jsx("div",{className:"space-y-4",children:[...Array(4)].map((d,h)=>e.jsx(Ve,{className:"h-20 w-full"},h))})]})]});if(o)return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("header",{className:"border-b border-border sticky top-0 bg-background/95 backdrop-blur z-50",style:{paddingTop:"env(safe-area-inset-top, 0px)"},children:e.jsx("div",{className:"container mx-auto px-4 py-4 flex items-center justify-between",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Et,{className:"h-6 w-6 text-primary"}),e.jsx("span",{className:"font-bold",children:"The Restaurant Consultant"})]})})}),e.jsx("main",{className:"container mx-auto px-4 py-8 max-w-4xl",children:e.jsx(Qr,{onRetry:()=>i(),title:"Couldn't load this domain",testId:"domain-error"})})]});if(!r)return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Domain Not Found"}),e.jsx(ze,{href:"/",children:e.jsx(Z,{children:"Return Home"})})]})});const{domain:c,content:u}=r,l=t?s(t):!1;return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx("header",{className:"border-b border-border sticky top-0 bg-background/95 backdrop-blur z-50",style:{paddingTop:"env(safe-area-inset-top, 0px)"},children:e.jsxs("div",{className:"container mx-auto px-4 py-4 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(ze,{href:"/",children:e.jsx(Z,{variant:"ghost",size:"icon","data-testid":"button-back",children:e.jsx(ba,{className:"h-4 w-4"})})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Et,{className:"h-6 w-6 text-primary"}),e.jsx("span",{className:"font-bold hidden sm:inline",children:"The Restaurant Consultant"})]})]}),e.jsx(Z,{variant:"ghost",size:"icon",onClick:()=>a(),"data-testid":"button-logout",children:e.jsx(tn,{className:"h-4 w-4"})})]})}),e.jsxs("main",{className:"container mx-auto px-4 py-8 max-w-4xl",children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-3xl font-bold mb-2",children:c.name}),e.jsx("p",{className:"text-muted-foreground",children:c.description})]}),l?e.jsx(Mr,{domain:t||"",children:e.jsx(Ia,{content:u,slug:t||""})}):e.jsxs(e.Fragment,{children:[e.jsxs(x.Suspense,{fallback:e.jsx(ic,{}),children:[t==="leadership"&&e.jsx(Jl,{}),t==="service"&&e.jsx(Xl,{contentCount:u.length}),t==="service"&&e.jsx(Zl,{}),t==="costs"&&e.jsx(ze,{href:"/menu-engineering",children:e.jsxs("div",{className:"flex items-center gap-3 p-4 mb-4 cursor-pointer",style:{background:"#241812",border:"1px solid #a9702f",borderRadius:"2px"},"data-testid":"link-menu-engineering",children:[e.jsx("div",{className:"w-10 h-10 flex items-center justify-center flex-shrink-0",style:{backgroundColor:"rgba(200, 147, 78,0.15)",borderRadius:"2px"},children:e.jsx(Dr,{className:"h-5 w-5",style:{color:"#c8934e"}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-white font-semibold text-sm",children:"Menu Engineering"}),e.jsx("p",{className:"text-xs",style:{color:"#a99a82"}
158,children:"Analyze every menu item by cost, margin, and popularity. Find your Stars and Dogs."})]}),e.jsx(pt,{className:"h-5 w-5 flex-shrink-0",style:{color:"#c8934e"}})]})}),t==="costs"&&e.jsx(Fl,{}),t==="costs"&&e.jsx(Hl,{}),t==="costs"&&e.jsx(Wl,{}),t==="reviews"&&e.jsx(ec,{}),t==="training"&&e.jsx(Ql,{content:u}),t==="training"&&e.jsx(Kl,{}),t==="staffing"&&e.jsx(Ul,{}),t==="staffing"&&e.jsx(ql,{}),t==="hr"&&e.jsx(zl,{}),t==="hr"&&e.jsx(Gl,{}),t==="hr"&&e.jsx(Vl,{}),t==="kitchen"&&e.jsx(Bl,{}),t==="kitchen"&&e.jsx(Yl,{}),t==="kitchen"&&e.jsx($l,{}),t==="sops"&&e.jsx(ze,{href:"/sop-generator",children:e.jsxs("div",{className:"flex items-center gap-3 p-4 mb-4 cursor-pointer",style:{background:"#241812",border:"1px solid #a9702f",borderRadius:"2px"},"data-testid":"link-sop-generator",children:[e.jsx("div",{className:"w-10 h-10 flex items-center justify-center flex-shrink-0",style:{backgroundColor:"rgba(200, 147, 78,0.15)",borderRadius:"2px"},children:e.jsx(Pr,{className:"h-5 w-5",style:{color:"#c8934e"}})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-white font-semibold text-sm",children:"SOP Generator"}),e.jsx("p",{className:"text-xs",style:{color:"#a99a82"},children:"16 pre-built SOPs personalized to your restaurant. Generate, print, and export your complete operations manual."})]}),e.jsx(pt,{className:"h-5 w-5 flex-shrink-0",style:{color:"#c8934e"}})]})}),t==="sops"&&e.jsx(sc,{}),t==="sops"&&e.jsx(rc,{}),t==="crisis"&&e.jsx(tc,{}),t==="crisis"&&e.jsx(ac,{}),t==="facilities"&&e.jsx(nc,{}),t==="facilities"&&e.jsx(oc,{}),t==="social-media"&&e.jsx(xl,{})]}),e.jsx(Ia,{content:u,slug:t||""}),e.jsx("div",{className:"mt-8 pt-8 border-t border-border",children:e.jsx(ze,{href:"/",children:e.jsxs(Z,{variant:"outline",children:[e.jsx(ba,{className:"h-4 w-4 mr-2"}),"Back to All Domains"]})})})]})]})]})}const sd=Object.freeze(Object.defineProperty({__proto__:null,default:lc},Symbol.toStringTag,{value:"Module"}));export{ed as C,td as F,ad as a,an as b,sd as d};
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.