1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2468],{12468:(e,s,n)=>{n.r(s),n.d(s,{DashboardPanel:()=>ex});var t=n(95155),l=n(12115),i=n(36841),a=n(781),r=n(32388),c=n(67958),d=n(59806),o=n(86140),u=n(33171);function h(){let{platformStatus:e}=(0,u.nR)();return(null==e?void 0:e.basic_full_unlocked)!==!1?null:(0,t.jsx)("div",{className:"dash-pre-basic-notice",role:"status",children:(0,t.jsx)(o.j,{})})}var m=n(59305);function _(){let{restaurantId:e,persisted:s}=(0,a.W)(),[n,i]=(0,l.useState)(null),[r,c]=(0,l.useState)(!1),[d,o]=(0,l.useState)(""),u=null!=n?n:s,h=null==u?void 0:u.booked_plan,_=(null==u?void 0:u.manual_override_active)?u.manual_override_tier:h;if("pro"!==_&&"one"!==_||!u)return null;let g=!0===u.guest_plan_live,p="one"===_?"One":"Pro";async function v(){if(e&&!r){c(!0),o("");try{let s=await (0,m.Lk)("/restaurants/".concat(e,"/dashboard/guest-plan-release"),{live:!g});i(s)}catch(e){o(function(e){if(e instanceof m.ge&&e.detail&&"object"==typeof e.detail){let s=e.detail;if("guest_plan_release_stripe_required"===s.code&&s.message)return s.message}return"Die Freigabe konnte nicht gespeichert werden."}(e))}finally{c(!1)}}}return(0,t.jsxs)("div",{className:"dash-guest-plan-release",children:[(0,t.jsxs)("label",{className:"dash-guest-plan-release__row",children:[(0,t.jsxs)("span",{className:"dash-guest-plan-release__copy",children:[(0,t.jsxs)("span",{children:[p," f\xfcr G\xe4ste"]}),(0,t.jsx)("span",{className:"dash-guest-plan-release__state",children:g?"Sichtbar":"Noch nicht sichtbar"})]}),(0,t.jsx)("input",{type:"checkbox",role:"switch",checked:g,disabled:r,onChange:()=>void v(),"aria-label":"".concat(p," f\xfcr G\xe4ste")})]}),d?(0,t.jsx)("p",{className:"dash-guest-plan-release__error",role:"alert",children:d}):null]})}var g=n(19904);let p=(0,g.A)("timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);var v=n(69667);function x(){let{persisted:e}=(0,a.W)(),[s,n]=(0,l.useState)(()=>Date.now()),i=(null==e?void 0:e.manual_override_active)?e.manual_override_until:null;if((0,l.useEffect)(()=>{if(!i)return;let e=window.setInterval(()=>n(Date.now()),3e4);return()=>window.clearInterval(e)},[i]),!i)return null;let r=(0,v._)(i);if(!r)return null;let c=new Date(i).getTime()-s,d=Math.max(0,Math.floor(c/6e4)),o=[{value:Math.floor(d/1440),label:"Tage"},{value:Math.floor(d%1440/60),label:"Std."},{value:d%60,label:"Min."}];return(0,t.jsxs)("div",{className:"dash-platform-plan-timer",children:[(0,t.jsxs)("div",{className:"dash-platform-plan-timer__label",children:[(0,t.jsx)(p,{size:15,"aria-hidden":"true"}),(0,t.jsx)("span",{children:"Plattform-Tarif \xb7 Restzeit"})]}),(0,t.jsx)("div",{className:"dash-platform-plan-timer__clock",role:"timer","aria-label":c<=0?"Tarif abgelaufen":(0,v.H)(i,s),children:0===d?(0,t.jsx)("span",{className:"dash-platform-plan-timer__ending",children:c<=0?"Abgelaufen":"Unter 1 Min."}):o.map(e=>{let{value:s,label:n}=e;return(0,t.jsxs)("span",{className:"dash-platform-plan-timer__unit","aria-hidden":"true",children:[(0,t.jsx)("span",{className:"dash-platform-plan-timer__value",children:String(s).padStart(2,"0")}),(0,t.jsx)("span",{className:"dash-platform-plan-timer__unit-label",children:n})]},n)})}),(0,t.jsxs)("div",{className:"dash-platform-plan-timer__until",children:["Bis ",(0,t.jsx)("time",{dateTime:i,children:r})]})]})}let b=(0,g.A)("users-round",[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]]);var f=n(55136),j=n(46398);function N(e){let{planStatus:s,loading:n,activeTableSessions:l,venueLabel:i,venueClass:a,venueExtraClass:r,delLabel:c,delClass:d,delExtraClass:o}=e;return(0,t.jsxs)("div",{className:"card dash-cockpit",children:[(0,t.jsx)("header",{className:"dash-cockpit__head",children:(0,t.jsx)("h2",{className:"dash-cockpit__title",children:"Aktueller Betrieb"})}),(0,t.jsxs)("div",{className:"dash-cockpit__row",children:[(0,t.jsxs)("div",{className:"kpi-grid dash-cockpit__kpi",children:[(0,t.jsxs)("div",{className:"kpi dash-cockpit__tile",children:[(0,t.jsxs)("div",{className:"dash-cockpit__label",children:[(0,t.jsx)(b,{size:16,"aria-hidden":"true"}),(0,t.jsx)("span",{children:"Tische mit G\xe4sten"})]}),(0,t.jsx)("div",{className:"kpi__val",id:"dash-kpi-active-table-sessions",children:n?"â¦":l})]}),(0,t.jsxs)("div",{className:"kpi dash-cockpit__tile",children:[(0,t.jsxs)("div",{className:"dash-cockpit__label",children:[(0,t.jsx)(f.A,{size:16,"aria-hidden":"true"}),(0,t.jsx)("span",{children:"Restaurant"})]}),(0,t.jsx)("span",{className:"dash-del-status-pill ".concat(a," ").concat(r).trim(),id:"dash-venue-status-pill",role:"status","aria-label":"Restaurantstatus",children:i})]}),(0,t.jsxs)("div",{className:"kpi dash-cockpit__tile",children:[(0,t.jsxs)("div",{className:"dash-cockpit__label",children:[(0,t.jsx)(j.A,{size:16,"aria-hidden":"true"}),(0,t.jsx)("span",{children:"Lieferdienst"})]}),(0,t.jsx)("span",{className:"dash-del-status-pill ".concat(d," ").concat(o).trim(),id:"dash-del-status-pill",role:"status","aria-label":"Lieferdienst-Status",children:c})]})]}),s]})]})}var y=n(51798),k=n(28556),w=n(67781),S=n(64018),z=n(60988),C=n(63368);function D(e){return"number"==typeof e&&Number.isFinite(e)?"".concat((100*e).toLocaleStr
1ing("de-DE",{maximumFractionDigits:2})," %"):"â"}function E(e,s,n){if(n<=0)return"â";let t="number"==typeof e&&Number.isFinite(e)?"".concat((100*e).toLocaleString("de-DE",{maximumFractionDigits:1})," %"):"â";return"".concat(t," \xb7 ").concat(s," / ").concat(n)}function T(e){let s=new Date(e);return Number.isFinite(s.getTime())?s.toLocaleString("de-DE",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",timeZone:"UTC"}):"â"}function R(e){if("number"!=typeof e||!Number.isFinite(e))return"â";let s=100*e,n=s>0?"+":"";return"".concat(n).concat(s.toLocaleString("de-DE",{maximumFractionDigits:1})," %")}let A={revenue_cents:"Umsatz",paid_orders:"Bezahlte Bestellungen",total_orders_non_cancelled:"Bestellungen",average_order_value_cents:"\xd8 je Bestellung (ohne Storno)",average_guest_table_visit_bon_cents:"\xd8 Bon je Gastbesuch",distinct_table_members_with_paid_orders:"G\xe4ste",distinct_table_sessions_with_orders:"Tischbesuche mit Bestellung"},M={breakfast:"Fr\xfchst\xfcck",lunch:"Mittag",dinner:"Abend",late:"Sp\xe4t"},L={breakfast:0,lunch:1,dinner:2,late:3};function B(e){let s=L[e];return void 0!==s?s:1e3}function H(e){var s,n,i,a,r,c,o;let{onNotify:u}=e,h=(0,d.E)(),_=(0,k.BH)(),[g,p]=(0,l.useState)(null),[v,x]=(0,l.useState)(null),[b,f]=(0,l.useState)(!1),[j,N]=(0,l.useState)(""),y=(0,l.useMemo)(()=>_.buildAppliedInsightsQuery(),[_.buildAppliedInsightsQuery]),L=(0,l.useCallback)(async()=>{f(!0),N("");try{let[e,s]=await Promise.all([(0,m.JU)(h,y),(0,m.oA)(h,12).catch(()=>[])]);p(e),x(s)}catch(s){let e=s instanceof m.ge?s.message:"Auswertung konnte nicht geladen werden.";N(e),p(null),null==u||u(e)}finally{f(!1)}},[y,u,h]);(0,l.useEffect)(()=>{L()},[L]);let H=(null==g||null==(s=g.channels_applied)?void 0:s.length)===1&&"table"===g.channels_applied[0],F=(0,l.useMemo)(()=>{if(!(null==g?void 0:g.delta_percent))return[];let e=null!=g.comparison?new Set(["revenue_cents","paid_orders"]):new Set,s="number"==typeof g.delta_percent.average_guest_table_visit_bon_cents&&Number.isFinite(g.delta_percent.average_guest_table_visit_bon_cents);return Object.entries(g.delta_percent).filter(n=>{let[t,l]=n;return!e.has(t)&&(!s||"average_order_value_cents"!==t)&&"number"==typeof l&&Number.isFinite(l)})},[g]),G=(0,l.useMemo)(()=>{if(!(null==g?void 0:g.by_meal_phase))return[];let e=Object.entries(g.by_meal_phase).map(e=>{var s,n,t;let[l,i]=e,a=Math.max(0,null!=(s=i.revenue_cents)?s:0),r=Math.max(0,null!=(t=null!=(n=i.paid_orders)?n:i.orders)?t:0);return{key:l,sl:i,revenue:a,orders:r}}),s=e.reduce((e,s)=>e+s.revenue,0),n=e.reduce((e,s)=>e+s.orders,0);return e.map(e=>({...e,pctRevenue:s>0?e.revenue/s*100:null,pctOrders:n>0?e.orders/n*100:null})).sort((e,s)=>{let n=B(e.key)-B(s.key);return 0!==n?n:e.key.localeCompare(s.key,"de")})},[null==g?void 0:g.by_meal_phase]);return(0,t.jsxs)("div",{className:"card dash-insights",id:"admin-restaurant-insights",children:[(0,t.jsxs)("header",{className:"dash-insights__hero",children:[(0,t.jsxs)("div",{className:"dash-insights__hero-text",children:[(0,t.jsx)("h2",{className:"dash-insights__title",children:"Restaurant-Auswertung"}),(0,t.jsx)("p",{className:"admin-hint",children:_.appliedRangeDescription})]}),(0,t.jsx)("button",{type:"button",className:"ghost-footer dash-insights__refresh",onClick:()=>void L(),disabled:b,children:b?"Lade â¦":"Aktualisieren"})]}),(null==g?void 0:g.comparison)?(0,t.jsxs)("div",{className:"dash-insights__compare-banner",role:"status",children:[(0,t.jsx)("strong",{children:"Vergleich aktiv"}),(0,t.jsxs)("span",{className:"dash-insights__compare-range",children:[T(g.comparison.window_start_utc)," â"," ",T(g.comparison.window_end_utc)," UTC"]}),(0,t.jsxs)("span",{className:"dash-insights__compare-deltas",children:["Umsatz ",R(null==(n=g.delta_percent)?void 0:n.revenue_cents)," \xb7 Bezahlte Bestellungen"," ",R(null==(i=g.delta_percent)?void 0:i.paid_orders)]})]}):null,F.length>0?(0,t.jsx)("div",{className:"dash-insights__delta-grid","aria-label":"Vergleich",children:F.map(e=>{var s;let[n,l]=e;return(0,t.jsxs)("div",{className:"dash-insights__delta-pill",children:[(0,t.jsx)("span",{className:"dash-insights__delta-pill-label",children:null!=(s=A[n])?s:n.replace(/_/g," ")}),(0,t.jsx)("span",{className:"dash-insights__delta-pill-val",children:R(l)})]},n)})}):null,j?(0,t.jsx)("div",{className:"dash-insights__state dash-insights__state--error",role:"alert",children:j}):null,b&&!g?(0,t.jsx)("div",{className:"dash-insights__state dash-insights__state--loading","aria-busy":"true",children:"Auswertung wird geladen â¦"}):null,g?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"dash-summary-grid","aria-label":"Wic
1htigste Kennzahlen",children:[(0,t.jsx)(w.R,{label:"Umsatz",value:(0,C.N_)(g.revenue_cents)}),(0,t.jsx)(w.R,{label:"Bezahlte Bestellungen",value:g.paid_orders}),(0,t.jsx)(w.R,{label:"\xd8 Bon",value:(null!=(a=g.average_guest_table_visit_bon_cents)?a:g.average_order_value_cents)!=null?(0,C.N_)(null!=(r=g.average_guest_table_visit_bon_cents)?r:g.average_order_value_cents):"â",hint:null!=g.average_guest_table_visit_bon_cents?"Je Gastbesuch am Tisch":"Je Bestellung \xb7 ohne Storno"}),(0,t.jsx)(w.R,{label:"G\xe4ste",value:g.distinct_table_members_with_paid_orders,hint:"Mit bezahlter Tischbestellung"})]}),(0,t.jsx)(S.k,{title:"Umsatz & Trinkgeld",startCollapsed:!0,children:(0,t.jsxs)("div",{className:"dash-insights-metric-grid",children:[(0,t.jsx)(w.R,{label:"Bestellungen",value:g.total_orders_non_cancelled,hint:"Ohne Storno"}),(0,t.jsx)(w.R,{label:"Trinkgeld gesamt",value:(0,C.N_)(null!=(c=g.tips_cents)?c:0)}),(0,t.jsx)(w.R,{label:"Bons mit Trinkgeld",value:D(g.tip_order_rate)}),(0,t.jsx)(w.R,{label:"Trinkgeldanteil",value:D(g.tip_rate_of_subtotal),hint:"An der Zwischensumme"})]})}),(0,t.jsx)(S.k,{title:"G\xe4ste & Tische",startCollapsed:!0,children:(0,t.jsxs)("div",{className:"dash-insights-metric-grid",children:[(0,t.jsx)(w.R,{label:"Tischbesuche mit Bestellung",value:g.distinct_table_sessions_with_orders}),H?null:(0,t.jsx)(w.R,{label:"Bezahlte Tisch-Bestellungen",value:g.table_paid_orders}),(0,t.jsx)(w.R,{label:"\xd8 Bestellungen je Gastbesuch",value:"number"==typeof g.average_table_orders_per_guest_visit&&Number.isFinite(g.average_table_orders_per_guest_visit)?g.average_table_orders_per_guest_visit.toLocaleString("de-DE",{maximumFractionDigits:2}):"â",hint:"Am Tisch"}),(0,t.jsx)(w.R,{label:"Trinkgeldanteil am Tisch",value:D(g.tip_rate_of_subtotal_table),hint:"An der Zwischensumme"}),(0,t.jsx)(w.R,{label:"Tischbesuche mit Trinkgeld",value:D(g.tip_session_rate)}),(0,t.jsx)(w.R,{label:"Umsatz je Tischbesuch",value:null!=g.revenue_per_table_session_cents?(0,C.N_)(g.revenue_per_table_session_cents):"â"}),(0,t.jsx)(w.R,{label:"Umsatz je Tischgast",value:null!=g.revenue_per_table_guest_cents?(0,C.N_)(g.revenue_per_table_guest_cents):"â"}),(0,t.jsx)(w.R,{label:"Umsatz je bestellendem Gast",value:null!=g.revenue_per_ordering_guest_cents?(0,C.N_)(g.revenue_per_ordering_guest_cents):"â"}),(0,t.jsx)(w.R,{label:"\xd8 G\xe4ste je Tischbesuch",value:"number"==typeof g.avg_members_per_ordering_table_session?g.avg_members_per_ordering_table_session.toLocaleString("de-DE",{maximumFractionDigits:2}):"â",hint:"Mit Bestellung"}),(0,t.jsx)(w.R,{label:"\xd8 Dauer je Tischbesuch",value:"number"==typeof g.avg_table_session_duration_seconds?"".concat((g.avg_table_session_duration_seconds/60).toLocaleString("de-DE",{maximumFractionDigits:1})," min"):"â"})]})}),g.guest_course_combo_rates?(0,t.jsx)(S.k,{title:"Beliebte Kombinationen",startCollapsed:!0,descExplainer:{infoTitle:"Gang-Kombinationen",infoLabel:"Hinweise zur Auswertung",body:(0,t.jsx)("p",{children:"Nur nicht stornierte Tischbestellungen mit Session und Gast; Hauptgericht / Vorspeise / Dessert werden aus Kategorie und Ger\xe4te-Rolle abgeleitet."})},children:(0,t.jsxs)("div",{className:"dash-insights-metric-grid",children:[(0,t.jsx)(w.R,{label:"Hauptgericht + Dessert",value:E(g.guest_course_combo_rates.main_plus_dessert_rate,g.guest_course_combo_rates.guests_main_and_dessert,g.guest_course_combo_rates.guests_with_main),hint:"Von G\xe4sten mit Hauptgericht"}),(0,t.jsx)(w.R,{label:"Hauptgericht + Vorspeise",value:E(g.guest_course_combo_rates.main_plus_starter_rate,g.guest_course_combo_rates.guests_main_and_starter,g.guest_course_combo_rates.guests_with_main),hint:"Von G\xe4sten mit Hauptgericht"}),(0,t.jsx)(w.R,{label:"Hauptgericht + Vorspeise + Dessert",value:E(g.guest_course_combo_rates.main_plus_starter_plus_dessert_rate,g.guest_course_combo_rates.guests_main_and_starter_and_dessert,g.guest_course_combo_rates.guests_with_main),hint:"Von G\xe4sten mit Hauptgericht"})]})}):null,(0,t.jsx)(S.k,{title:"Speisekarte & Reservierungen",startCollapsed:!0,children:(0,t.jsxs)("div",{className:"dash-insights-metric-grid",children:[(0,t.jsx)(w.R,{label:"Erste Speisekarten-Aufrufe",value:g.menu_initial_opens}),(0,t.jsx)(w.R,{label:"Aktionen in der Speisekarte",value:null!=(o=g.menu_activity_events)?o:"â"}),(0,t.jsx)(w.R,{label:"Neue Reservierungen",value:g.reservations_created})]})}),g.by_meal_phase&&Object.keys(g.by_meal_phase).length?(0,t.jsxs)(S.k,{title:"Tageszeiten",startCollapsed:!0,children:[(0,t.jsx)(z.s,{heading:"Anteile im Zeitraum",headingLevel:"p",infoTitle:"Tageszeiten",infoLabel:"Hinweise zur Verteilung",className:"admin-section-help--spaced",children:(0,t.jsxs)("p",{children:["Anteile beziehen sich auf die Summe aller Phasen im gew\xe4hlten Zeitraum â"," ",(0,t.jsx)("strong",{children:"Umsatz"})," bzw. ",(0,t.jsx)("strong",{children:"Bezahlte Bestellungen"})," (falls mehrere Zahlen vorliegen)."]})}),(0,t.jsx)("div",{className:"kpi-grid dash-insights-meal-phase-grid",role:"list",children:G.map(e=>{var s,n;let l=Math.min(100,Math.max(0,null!=(n=null!=(s=e.pctRevenue)?s:e.pctOrders)?n:0)),i=function(e){let s=M[e];
1return s||e.split("_").filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}(e.key);return(0,t.jsxs)("div",{className:"kpi dash-insights-meal-phase-kpi",role:"listitem",children:[(0,t.jsx)("p",{className:"dash-insights-meal-phase-kpi__phase",id:"meal-ph-".concat(e.key),children:i}),(0,t.jsxs)("div",{className:"dash-insights-meal-phase-kpi__metrics","aria-labelledby":"meal-ph-".concat(e.key),children:[null!=e.pctRevenue?(0,t.jsxs)("div",{className:"dash-insights-meal-phase-kpi__primary",children:[(0,t.jsxs)("span",{className:"dash-insights-meal-phase-kpi__val",children:[e.pctRevenue.toLocaleString("de-DE",{maximumFractionDigits:1})," %"]}),(0,t.jsx)("span",{className:"dash-insights-meal-phase-kpi__val-suffix",children:"Umsatz"})]}):(0,t.jsxs)("div",{className:"dash-insights-meal-phase-kpi__primary",children:[(0,t.jsx)("span",{className:"dash-insights-meal-phase-kpi__val muted",children:"â"}),(0,t.jsx)("span",{className:"dash-insights-meal-phase-kpi__val-suffix",children:"Umsatz"})]}),null!=e.pctOrders?(0,t.jsxs)("div",{className:"dash-insights-meal-phase-kpi__secondary",children:[(0,t.jsxs)("span",{className:"dash-insights-meal-phase-kpi__pct-orders",children:[e.pctOrders.toLocaleString("de-DE",{maximumFractionDigits:1})," %"]}),(0,t.jsx)("span",{className:"dash-insights-meal-phase-kpi__suffix-muted",children:"Bestellungen"})]}):(0,t.jsx)("div",{className:"dash-insights-meal-phase-kpi__secondary muted",children:"â Best."})]}),(0,t.jsx)("div",{className:"dash-channel-list__bar dash-insights-meal-phase-kpi__bar","aria-hidden":"true",children:(0,t.jsx)("div",{className:"dash-channel-list__bar-fill",style:{width:"".concat(l,"%")}})}),(0,t.jsx)("div",{className:"admin-hint dash-insights-meal-phase-kpi__detail",children:(function(e){let s=[];if(null!=e.paid_orders){let n=e.paid_orders;s.push("".concat(n," ").concat(1===n?"bezahlte Bestellung":"bezahlte Bestellungen"))}else if(null!=e.orders){let n=e.orders;s.push("".concat(n," ").concat(1===n?"Bestellung":"Bestellungen"))}if(null!=e.revenue_cents&&s.push("Umsatz ".concat((0,C.N_)(e.revenue_cents))),null!=e.guests){let n=e.guests;s.push("".concat(n," ").concat(1===n?"Gast":"G\xe4ste"))}if(null!=e.menu_opens){let n=e.menu_opens;s.push("".concat(n," ").concat(1===n?"Men\xfc-\xd6ffnung":"Men\xfc-\xd6ffnungen"))}return null!=e.average_order_value_cents&&s.push("\xd8 ".concat((0,C.N_)(e.average_order_value_cents)," je Bestellung")),s.length?s:["â"]})(e.sl).map((e,s)=>(0,t.jsx)("div",{className:"dash-insights-meal-phase-kpi__detail-line",children:e},s))})]},e.key)})})]}):null,v&&v.length?(0,t.jsxs)("details",{className:"dash-insights-audit",children:[(0,t.jsx)("summary",{children:"Einstellungen-Verlauf"}),(0,t.jsx)("ul",{className:"dash-insights-audit__list",children:v.map(e=>(0,t.jsxs)("li",{children:[(0,t.jsx)("strong",{children:new Date(e.effective_from).toLocaleString("de-DE")}),e.effective_to?(0,t.jsxs)(t.Fragment,{children:[" â ",new Date(e.effective_to).toLocaleString("de-DE")]}):" â aktuell",":"," ","boolean"==typeof e.settings.upsell_enabled?"Empfehlungen ".concat(e.settings.upsell_enabled?"an":"aus"):"","boolean"==typeof e.settings.upsell_checkout_guardrails_enabled?", Empfehlungsschutz ".concat(e.settings.upsell_checkout_guardrails_enabled?"an":"aus"):"","string"==typeof e.settings.kitchen_load_state?", K\xfcche â".concat(e.settings.kitchen_load_state,"â"):""]},e.id))})]}):null]}):b||j?null:(0,t.jsx)("p",{className:"admin-hint dash-insights__empty",children:"Keine Daten."})]})}var F=n(18931),G=n(28941),Z=n(53218);let O=[{value:"closed",label:"Geschlossen"},{value:"auto",label:"Automatisch"},{value:"open",label:"Ge\xf6ffnet"}];function P(e){let{checked:s,onChange:n}=e;return(0,t.jsx)(G.Z,{compact:!0,checked:s,label:"Zeigen","aria-label":"G\xe4sten zeigen",onChange:n})}function W(e){let{onNotify:s,onAcceptsOrdersChange:n}=e,i=(0,d.E)(),{status:a,loading:r,saving:c,error:o,save:u,setMealToday:h}=(0,Z.F)(i),[_,g]=(0,l.useState)(""),[p,v]=(0,l.useState)(!1),[x,b]=(0,l.useState)(""),[f,j]=(0,l.useState)(!1),[N,y]=(0,l.useState)(!1);if((0,l.useEffect)(()=>{var e,s;a&&!N&&(g(null!=(e=a.service_notice_open)?e:""),v(a.service_notice_open_visible),b(null!=(s=a.service_notice_closed)?s:""),j(a.service_notice_closed_visible))},[a,N]),(0,l.useEffect)(()=>{r||null==n||n(a?a.accepts_orders_now:null)},[r,a,n]),!a)return null;let k=e=>s=>{y(!0),e(s)},w=async()=>{await u({service_notice_open:_,service_notice_open_visible:p,service_notice_closed:x,service_notice_closed_visible:f})&&(y(!1),null==s||s("Hinweise gespeichert."))};return(0,t.jsxs)(S.k,{id:"dash-service-status",startCollapsed:!0,title:"\xd6ffnung & Speisekarten",description:(0,t.jsxs)("span",{className:"dash-service-summary",children:[(0,t.jsx)("span",{className:a.accepts_orders_now?"dash-service-summary__open":"dash-service-summary__closed",children:a.accepts_orders_now?"Ge\xf6ffnet":"Geschlossen"}),(0,t.jsx)("span",{children:"auto"===a.service_override?"Nach \xd6ffnungszeiten":"Manuell eingestellt"})]}
1),children:[(0,t.jsxs)("div",{className:"dash-service-controls",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"dash-service-controls__label",children:"Restaurant \xf6ffnen"}),(0,t.jsxs)("div",{className:"service-tri service-tri--".concat(a.service_override),role:"radiogroup","aria-label":"\xd6ffnungsmodus",children:[(0,t.jsx)("span",{className:"service-tri__thumb","aria-hidden":"true"}),O.map(e=>(0,t.jsx)("button",{type:"button",role:"radio","aria-checked":a.service_override===e.value,disabled:c,className:a.service_override===e.value?"is-active":"",onClick:()=>void u({service_override:e.value}),children:e.label},e.value))]}),(0,t.jsx)("p",{className:"dash-service-controls__hint",children:"Automatisch folgt den hinterlegten \xd6ffnungszeiten."})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h4",{className:"dash-service-controls__label",children:"Speisekarten heute"}),(0,t.jsxs)("div",{className:"service-status-today",role:"group","aria-label":"Karten heute",children:[(0,t.jsx)(F.d,{quiet:!0,label:"Fr\xfchst\xfcck",state:a.breakfast,serviceOverride:a.service_override,timeZone:a.timezone,disabled:c,onChange:e=>void h("breakfast",e)}),(0,t.jsx)(F.d,{quiet:!0,label:"Mittag",state:a.lunch,serviceOverride:a.service_override,timeZone:a.timezone,disabled:c,onChange:e=>void h("lunch",e)}),(0,t.jsx)(F.d,{quiet:!0,label:"Abend",state:a.dinner,serviceOverride:a.service_override,timeZone:a.timezone,disabled:c,onChange:e=>void h("dinner",e)})]})]})]}),(0,t.jsxs)("details",{className:"service-status-notices-fold",children:[(0,t.jsxs)("summary",{className:"service-status-notices-fold__head",children:[(0,t.jsx)("span",{className:"service-status-notices-fold__title",children:"Nachricht f\xfcr G\xe4ste"}),(0,t.jsx)("span",{className:"service-status-notices-fold__chevron","aria-hidden":"true"})]}),(0,t.jsxs)("div",{className:"service-status-notices",children:[(0,t.jsxs)("div",{className:"service-status-notice",children:[(0,t.jsxs)("div",{className:"service-status-notice__head",children:[(0,t.jsx)("label",{className:"field-label",htmlFor:"service-notice-closed",children:"Bei geschlossenem Restaurant"}),(0,t.jsx)(P,{checked:f,onChange:e=>k(j)(e)})]}),(0,t.jsx)("textarea",{id:"service-notice-closed",maxLength:m._i,rows:2,placeholder:"Zum Beispiel: Wir sind morgen wieder f\xfcr Sie da.",value:x,onChange:e=>k(b)(e.target.value)})]}),(0,t.jsxs)("div",{className:"service-status-notice",children:[(0,t.jsxs)("div",{className:"service-status-notice__head",children:[(0,t.jsx)("label",{className:"field-label",htmlFor:"service-notice-open",children:"Bei ge\xf6ffnetem Restaurant"}),(0,t.jsx)(P,{checked:p,onChange:e=>k(v)(e)})]}),(0,t.jsx)("textarea",{id:"service-notice-open",maxLength:m._i,rows:2,placeholder:"Zum Beispiel: Heute frische Tagesgerichte.",value:_,onChange:e=>k(g)(e.target.value)})]}),(0,t.jsx)("button",{type:"button",className:"ghost-footer",disabled:c||!N,onClick:()=>void w(),children:c?"Speichert â¦":"Nachrichten speichern"})]})]}),o?(0,t.jsx)("p",{className:"admin-hint",role:"alert",children:o}):null]})}function U(e){let{setupPct:s,setupSummary:n,onResetOnboarding:l}=e;return(0,t.jsxs)("div",{className:"card dash-setup",id:"dashboard-setup-card",children:[(0,t.jsxs)("div",{className:"dash-setup__head admin-title-info-inline",children:[(0,t.jsx)("h2",{children:"Ersteinrichtung \xb7 Fortschritt"}),(0,t.jsx)(r.u,{infoTitle:"Ersteinrichtung",infoLabel:"Hinweise zum Einrichtungsfortschritt",children:(0,t.jsx)("p",{children:"Erledigte Schritte werden automatisch erkannt. Mit âSp\xe4terâ verschieben Sie offene Punkte in der Checkliste âBereit f\xfcr G\xe4steâ."})})]}),(0,t.jsxs)("div",{className:"setup-card-progress",children:[(0,t.jsx)("div",{className:"setup-ring",id:"setup-ring",style:{"--p":s},"aria-hidden":"true",children:(0,t.jsxs)("div",{className:"setup-ring-inner",id:"setup-ring-label",children:[s,"%"]})}),(0,t.jsxs)("div",{children:[(0,t.jsx)("strong",{id:"setup-summary-text",children:n}),(0,t.jsx)("div",{className:"btn-row dash-setup__actions",children:(0,t.jsx)("button",{type:"button",className:"ghost-footer",id:"btn-reset-onboarding",onClick:l,children:"âSp\xe4terâ-Markierungen zur\xfccksetzen"})})]})]})]})}var K=n(95604);
1let q=new Set(["treatment","with_upsell","with","active","upsell_on"]),I=new Set(["holdout","control","without_upsell","without","comparison","no_upsell"]);function V(e,s){return Object.entries({...function(e){let s={};for(let[i,a]of Object.entries(e)){var n,t,l;let e=Number(null!=(n=a.shown)?n:0),r=Number(null!=(t=a.accepted)?t:0)+Number(null!=(l=a.accepted_more)?l:0);s[i]={shown:e,accepted:r,rate:e>0?r/e:null}}return s}(s),...e}).map(e=>{var s;let[n,t]=e;return{key:n,kind:function(e){let s=e.trim().toLowerCase();return s?q.has(s)||s.includes("treatment")?"with":I.has(s)||s.includes("holdout")||s.includes("control")?"without":"other":"other"}(n),shown:Number(t.shown)||0,accepted:Number(t.accepted)||0,rate:null!=(s=t.rate)?s:null}}).filter(e=>e.shown>0||e.accepted>0)}let Q=e=>e.toLocaleString("de-DE");function J(e){let s,{title:n,arm:l,note:i}=e,a=(0,K.useTranslations)("adminUpsell");return(0,t.jsxs)("div",{className:"card",style:{padding:14,borderColor:"rgba(255,255,255,0.1)",minWidth:0,flex:"1 1 200px"},children:[(0,t.jsx)("h4",{style:{margin:"0 0 10px",fontSize:14,fontWeight:800},children:n}),l?(0,t.jsxs)("dl",{style:{margin:0,display:"grid",gridTemplateColumns:"1fr auto",gap:"6px 12px",fontSize:13},children:[(0,t.jsx)("dt",{style:{margin:0,color:"var(--admin-muted)"},children:a("insightsHoldoutColShown")}),(0,t.jsx)("dd",{style:{margin:0,fontWeight:700,textAlign:"right"},children:Q(l.shown)}),(0,t.jsx)("dt",{style:{margin:0,color:"var(--admin-muted)"},children:a("insightsHoldoutColAccepted")}),(0,t.jsx)("dd",{style:{margin:0,fontWeight:700,textAlign:"right"},children:Q(l.accepted)}),(0,t.jsx)("dt",{style:{margin:0,color:"var(--admin-muted)"},children:a("insightsHoldoutColRate")}),(0,t.jsx)("dd",{style:{margin:0,fontWeight:700,textAlign:"right"},children:"number"==typeof(s=l.rate)&&Number.isFinite(s)?"".concat((100*s).toFixed(1)," %"):"â"})]}):(0,t.jsx)("p",{className:"admin-hint",style:{margin:0},children:a("insightsHoldoutArmMissing")}),i?(0,t.jsx)("p",{className:"admin-hint",style:{margin:"10px 0 0",fontSize:12,lineHeight:1.45},children:i}):null]})}function X(e){let{holdoutConversionRates:s,holdoutEventsBreakdown:n,periodLabel:l}=e,i=(0,K.useTranslations)("adminUpsell");if(!function(e,s){let n=null!=e?e:{},t=null!=s?s:{};return(Object.keys(n).length>0||Object.keys(t).length>0)&&V(n,t).length>0}(s,n))return(0,t.jsx)("section",{"aria-labelledby":"upsell-holdout-comparison-title",children:(0,t.jsxs)("div",{className:"admin-title-info-inline",style:{marginBottom:8},children:[(0,t.jsx)("h3",{id:"upsell-holdout-comparison-title",style:{margin:0,fontSize:15},children:i("insightsHoldoutComparisonTitle")}),(0,t.jsx)(r.u,{infoTitle:i("insightsHoldoutComparisonTitle"),infoLabel:"Hinweise zum Holdout-Vergleich",children:(0,t.jsx)("p",{children:i("insightsHoldoutEmpty")})})]})});let{withArm:a,withoutArm:c,otherArms:d}=function(e){var s,n;let t=null,l=null,i=[];for(let s of e)"with"!==s.kind||t?"without"!==s.kind||l?i.push(s):l=s:t=s;return t||(t=null!=(s=e.find(e=>"with"===e.kind))?s:null),l||(l=null!=(n=e.find(e=>"without"===e.kind))?n:null),{withArm:t,withoutArm:l,otherArms:i}}(V(s,n)),o=null;if((null==a?void 0:a.rate)!=null&&(null==c?void 0:c.rate)!=null&&Number.isFinite(a.rate)&&Number.isFinite(c.rate)){let e=(a.rate-c.rate)*100,s=e>0?"+":"";o=i("insightsHoldoutRateDelta",{delta:"".concat(s).concat(e.toFixed(1)," Prozentpunkte")})}return(0,t.jsxs)("section",{"aria-labelledby":"upsell-holdout-comparison-title",children:[(0,t.jsxs)("div",{className:"admin-title-info-inline",style:{marginBottom:12},children:[(0,t.jsxs)("h3",{id:"upsell-holdout-comparison-title",style:{margin:0,fontSize:15},children:[i("insightsHoldoutComparisonTitle")," ",(0,t.jsxs)("span",{style:{fontWeight:500,opacity:.85},children:["(",l,")"]})]}),(0,t.jsx)(r.u,{infoTitle:i("insightsHoldoutComparisonTitle"),infoLabel:"Hinweise zum Holdout-Vergleich",children:(0,t.jsx)("p",{children:i("insightsHoldoutComparisonLead")})})]}),(0,t.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:10,alignItems:"stretch"},children:[(0,t.jsx)(J,{title:i("insightsHoldoutWithRecommendations"),arm:a}),(0,t.jsx)(J,{title:i("insightsHoldoutWithoutRecommendations"),arm:c,note:c&&0===c.shown?i("insightsHoldoutNoteNoSh
1own"):void 0})]}),o?(0,t.jsx)("p",{className:"admin-hint",style:{margin:"10px 0 0",color:"#a7f3d0"},children:o}):null,d.length>0?(0,t.jsx)("p",{className:"admin-hint",style:{margin:"8px 0 0",fontSize:12},children:i("insightsHoldoutOtherArms",{arms:d.map(e=>e.key).join(", ")})}):null]})}function Y(e){let{rows:s}=e,n=s.slice(0,40),l=n.slice(0,10),i=n.slice(10),a=(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:"#"}),(0,t.jsx)("th",{children:"Name"}),(0,t.jsx)("th",{children:"Menge"}),(0,t.jsx)("th",{children:"Umsatz"}),(0,t.jsx)("th",{children:"Anteil"}),(0,t.jsx)("th",{children:"\xd8 Zeile"})]})}),r=(e,s)=>e.map((e,n)=>{let l=s+n;return(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{children:l}),(0,t.jsx)("td",{children:e.menu_item_name}),(0,t.jsx)("td",{children:e.quantity_sold}),(0,t.jsx)("td",{children:(0,C.N_)(e.revenue)}),(0,t.jsx)("td",{children:"number"==typeof e.share_of_revenue?"".concat((100*e.share_of_revenue).toFixed(1)," %"):"â"}),(0,t.jsx)("td",{children:null!=e.avg_line_revenue_cents?(0,C.N_)(e.avg_line_revenue_cents):"â"})]},"".concat(e.menu_item_id,"-").concat(e.menu_item_name,"-").concat(l))});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"dash-insights-table-wrap",children:(0,t.jsxs)("table",{className:"admin-table dash-insights-table",children:[a,(0,t.jsx)("tbody",{children:r(l,1)})]})}),i.length>0?(0,t.jsxs)("details",{className:"dash-insights-rank-expand",children:[(0,t.jsxs)("summary",{children:["Weitere ",i.length," anzeigen (Platz ",11,"â",n.length,")"]}),(0,t.jsx)("div",{className:"dash-insights-table-wrap dash-insights-table-wrap--nested",children:(0,t.jsxs)("table",{className:"admin-table dash-insights-table",children:[a,(0,t.jsx)("tbody",{children:r(i,11)})]})})]}):null]})}function $(e){let{rows:s}=e,n=s.slice(0,40),l=n.slice(0,10),i=n.slice(10),a=(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:"#"}),(0,t.jsx)("th",{children:"Kategorie"}),(0,t.jsx)("th",{children:"Menge"}),(0,t.jsx)("th",{children:"Umsatz"}),(0,t.jsx)("th",{children:"Anteil"}),(0,t.jsx)("th",{children:"\xd8 Zeile"})]})}),r=(e,s)=>e.map((e,n)=>{let l=s+n;return(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{children:l}),(0,t.jsx)("td",{children:e.category_title}),(0,t.jsx)("td",{children:e.quantity_sold}),(0,t.jsx)("td",{children:(0,C.N_)(e.revenue)}),(0,t.jsx)("td",{children:"number"==typeof e.share_of_revenue?"".concat((100*e.share_of_revenue).toFixed(1)," %"):"â"}),(0,t.jsx)("td",{children:null!=e.avg_line_revenue_cents?(0,C.N_)(e.avg_line_revenue_cents):"â"})]},"".concat(e.category_title,"-").concat(l))});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"dash-insights-table-wrap",children:(0,t.jsxs)("table",{className:"admin-table dash-insights-table",children:[a,(0,t.jsx)("tbody",{children:r(l,1)})]})}),i.length>0?(0,t.jsxs)("details",{className:"dash-insights-rank-expand",children:[(0,t.jsxs)("summary",{children:["Weitere ",i.length," anzeigen (Platz ",11,"â",n.length,")"]}),(0,t.jsx)("div",{className:"dash-insights-table-wrap dash-insights-table-wrap--nested",children:(0,t.jsxs)("table",{className:"admin-table dash-insights-table",children:[a,(0,t.jsx)("tbody",{children:r(i,11)})]})})]}):null]})}var ee=n(64566),es=n(40089);function en(e){let{onNotify:s,embedded:n}=e,i=(0,d.E)(),a=(0,k.BH)(),[c,o]=(0,l.useState)(null),[u,h]=(0,l.useState)(!1),[_,g]=(0,l.useState)(""),p=(0,l.useMemo)(()=>a.buildAppliedInsightsQuery(),[a.buildAppliedInsightsQuery]),v=(0,l.useCallback)(async()=>{h(!0),g("");try{let e=await (0,m.JU)(i,p);o(e)}catch(n){let e=n instanceof m.ge?n.message:"Restaurant-Insights fehlgeschlagen.";g(e),o(null),null==s||s(e)}finally{h(!1)}},[p,s,i]);(0,l.useEffect)(()=>{v()},[v]);let x=(0,l.useMemo)(()=>{if(!(null==c?void 0:c.channel_mix))return[];let e=Object.entries(c.channel_mix),s=Math.max(...e.map(e=>{let[,s]=e;return s.revenue_cents||0}),1);return e.map(e=>{let[n,t]=e;return{k:n,v:t,maxRev:s}})},[c]),b=!!((null==c?void 0:c.channels_applied)&&1===c.channels_applied.length),f=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"btn-row",style:{marginBottom:12},children:(0,t.jsx)(es.r,{busy:u,onClick:()=>void v()})}),_?(0,t.jsx)("div",{className:"dash-insights__state dash-insights__state--error",role:"alert",children:_}):null,u&&!c?(0,t.jsx)("div",{className:"dash-insights__state dash-insights__state--loading","aria-busy":"true",children:"Daten werden geladen â¦"}):null,c?(0,t.jsxs)("div",{className:"admin-stack",style:{gap:16},children:[b?null:(0,t.jsx)(S.k,{title:"Verkaufskan\xe4le",children:0===x.length?(0,t.jsx)("p",{className:"admin-hint dash-insights__empty",children:"Keine Daten."}):(0,t.jsx)("ul",{className:"dash-channel-list",children:x.map(e=>{let{k:s,v:n,maxRev:l}=e,i=Math.round((n.revenue_cents||0)/l*100);return(0,t.jsxs)("li",{className:"dash-channel-list__item",children:[(0,t.jsxs)("div",{className:"dash-channel-list__row",children:[(0,t.jsx)("strong",{className:"dash-channel-list__name",children:s}),(0,t.jsxs)("span",{className:"dash-channel-list__stats",children:[n.orders," Best. \xb7 ",(0,C.N_)(n.revenue_cents),"number"==typeof n.revenue_share?" \xb7 ".concat((100*n.revenue_share).toFixed(1)," % Umsatz"):"",null!=n.average_order_value_cents?" \xb7 \xd8 ".concat((0,C.N_)(n.average_order_value_cents)):""]})]}),(0,t.jsx)("div",{className:"dash-channel-list__bar","aria-hidden":"true",children:(0,t.jsx)("div",{className:"dash-channel-list__bar-fill",style:{width:"".concat(i,"%")}})})]},s)})})}),(0,t.jsx)(S.k,{title:"Beliebte Produkte",children:(0,t.jsxs)("div",{className:"dash-insights-rank-grid",children:[(0,t.jsxs)("div",{className:"dash-insights-rank-col",children:[(0,t.jsx)("h4",{className:"dash-insights-rank-heading",children:"Bestseller"}),0===c.bestsellers.length?(0,t.jsx)("p",{className:"admin-hint",children:"Keine Daten."}):(0,t.jsx)(Y,{rows:c.bestsellers})]}),(0,t.jsxs)("div",{className:"dash-insights-rank-col",children:[(0,t.jsx)("h4",{className:"dash-insights-rank-heading",children:"Top-Kategorien"}),0===c.top_categories.length?(0,t.jsx)("p",{className:"admin-hint",children:"Keine Daten."}):(0,t.jsx)($,{rows:c.top_categories})]})]})})]}):u||_?null:(0,t.jsx)("p",{className:"admin-hint dash-insights__empty",children:"Keine Daten."})]}),j=(0,t.jsxs)("p",{children:["Gleicher Zeitraum und Kanalfilter wie unter ",(0,t.jsx)("strong",{children:"Report-Steuerung"})," und"," ",(0,t.jsx)("strong",{children:"Restaurant-Insights"}),"."]});return n?(0,t.jsxs)("div",{style:{marginTop:18,paddingTop:16,borderTop:"1px solid rgba(255,255,255,0.1)"},children:[(0,t.jsx)(z.s,{heading:"Produkte & Verkaufskan\xe4le",headingLevel:"h3",infoTitle:"Produkte & Verkaufskan\xe4le",infoLabel:"Zeitraum und Filter",className:"admin-section-help--spaced",children:j}),f]}):(0,t.jsx)(ee.q,{title:"Produkte & Verkaufskan\xe4le",titleAddon:(0,t.jsx)(r.u,{infoTitle:"Produkte & Verkaufskan\xe4le",infoLabel:"Zeitraum und Filter",children:j}),children:f})}let et=["Mo","Di","Mi","Do","Fr","Sa","So"],el=["0","1","2","3","4","5","6","7","8","9","10+"],ei={0:"tableMenuOrderPhase0",1:"tableMenuOrderPhase1",2:"tableMenuOrderPhase2",3:"tableMenuOrderPhase3",4:"tableMenuOrderPhase4",5:"tableMenuOrderPhase5",6:"tableMenuOrderPhase6",7:"tableMenuOrderPhase7",8:"tableMenuOrderPhase8",9:"tableMenuOrderPhase9","10+":"tableMenuOrderPhase10Plus"};function ea(e){switch(e.trim()){case"ok":return"vollst\xe4ndig";case"missing_line_item_link":return"keine Zuordnung";
1case"partial_missing_line_item_link":return"teilweise";default:return e}}let er=e=>"normal"===e?"Normal":"busy"===e?"Hohe Auslastung":"rush"===e?"Sehr hohe Auslastung":null!=e?e:"â",ec=e=>"number"==typeof e&&Number.isFinite(e)?"".concat((100*e).toLocaleString("de-DE",{minimumFractionDigits:1,maximumFractionDigits:1})," %"):"â",ed=e=>"number"==typeof e&&Number.isFinite(e)?e.toLocaleString("de-DE"):"â",eo=e=>"number"==typeof e&&Number.isFinite(e)?"".concat(e.toLocaleString("de-DE",{maximumFractionDigits:1})," s"):"â",eu=()=>({initial_opens_total:0,reengagements_total:0,distinct_active_guests:0,distinct_reengaged_guests:0,avg_reengagements_per_guest:null,avg_reengagements_per_reengaged_guest:null,avg_idle_seconds_before_reengagement:null,activity_conversion_rate:null,reengagement_conversion_rate:null,reengagements_by_orders_bucket:Object.fromEntries(el.map(e=>[e,0])),avg_seconds_since_session_start_on_reengagement:null}),eh={padding:"14px 16px",borderRadius:14,border:"1px solid rgba(255,255,255,0.11)",background:"linear-gradient(180deg, rgba(255,255,255,0.055), rgba(0,0,0,0.12))"},em={color:"var(--admin-muted)",fontSize:12,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase"};function e_(e){let{shown:s,unique_shown:n,shown_after_more:l}=e;return(0,t.jsxs)("div",{className:"dash-metric",children:[(0,t.jsx)("div",{className:"dash-metric__label",children:"Einmalige Anzeigen"}),(0,t.jsx)("div",{className:"dash-metric__val",children:ed(n)}),(0,t.jsxs)("div",{className:"dash-metric__hint",children:["Anteil einmaliger Anzeigen: ",ec(s>0?n/s:null)]}),(0,t.jsxs)("div",{className:"dash-metric__hint",children:["Nach âMehr anzeigenâ: ",ed(l)," (",ec(s>0?l/s:null),")"]})]})}function eg(e){let{accepted_total:s,accepted_after_more:n,shown_after_more:l,expand_more:i,scroll_more:a}=e;return(0,t.jsxs)("div",{className:"dash-metric",children:[(0,t.jsx)("div",{className:"dash-metric__label",children:"Nach âMehr anzeigenâ \xfcbernommen"}),(0,t.jsx)("div",{className:"dash-metric__val",children:ed(n)}),(0,t.jsxs)("div",{className:"dash-metric__hint",children:["Anteil aller \xdcbernahmen: ",ec(s>0?n/s:null)]}),(0,t.jsxs)("div",{className:"dash-metric__hint",children:["Annahmequote nach âMehr anzeigenâ: ",ec(l>0?n/l:null)]}),(0,t.jsxs)("div",{className:"dash-metric__hint",children:["Aufgeklappt: ",ed(i)," \xb7 Weitergescrollt: ",ed(a)]})]})}function ep(e){let{label:s,value:n,hint:l,tone:i="neutral"}=e;return(0,t.jsx)(w.R,{label:s,value:n,tone:"danger"===i?"warn":i,hint:(0,t.jsx)(r.u,{infoTitle:s,infoLabel:"Erkl\xe4rung: ".concat(s),children:(0,t.jsx)("p",{children:l})})})}function ev(e){var s,n,i,a,r,c,o,u,h,_,g,p,v,x,b,f,j,N,y,D,E,T,R,A,M,L,B,H,F,G,Z;let O,{onNotify:P,onNavigateToUpsellWizardTab:W}=e,U=(0,K.useTranslations)("adminUpsell"),q=(0,d.E)(),I=(0,k.BH)(),V=function(){let{buildAppliedInsightsQuery:e}=(0,k.BH)();return(0,l.useMemo)(()=>{let s=e();return{start:s.start,end:s.end,timezone_name:s.timezone,weekdays:s.weekdays,repeated_weekday:s.repeated_weekday,time_windows:s.time_windows,daypart:s.daypart,meal_phases:s.meal_phases,...s.since_restaurant_start?{since_restaurant_start:!0}:{},...s.kitchen_load?{kitchen_load:s.kitchen_load}:{},...s.learning_stage?{learning_stage:s.learning_stage}:{}}},[e])}(),[Q,J]=(0,l.useState)(null),[Y,$]=(0,l.useState)(!0),[ee,ev]=(0,l.useState)(!1),[ex,eb]=(0,l.useState)("normal"),[ef,ej]=(0,l.useState)([]),[eN,ey]=(0,l.useState)(!1),[ek,ew]=(0,l.useState)(!1),eS=(0,l.useCallback)(async()=>{$(!0);try{let e=await (0,m.Ml)(q,V);J(e)}catch(e){P(e instanceof m.ge?e.message:"Report konnte nicht geladen werden."),J(null)}finally{$(!1)}},[P,q,V]);(0,l.useEffect)(()=>{eS()},[eS]),(0,l.useEffect)(()=>{var e;let s=null==Q||null==(e=Q.kitchen_load_state)?void 0:e.toLowerCase();("normal"===s||"busy"===s||"rush"===s)&&eb(s)},[null==Q?void 0:Q.kitchen_load_state]);let ez=(0,l.useCallback)(async()=>{try{let e=await (0,m.PB)(q);ej(e.map(e=>({weekday:e.weekday,start_time:e.start_time,end_time:e.end_time,load_state:"rush"===e.load_state?"rush":"busy",is_active:e.is_active,label:e.label})))}catch(e){P(e instanceof m.ge?e.message:"Rush-Zeitfenster konnten nicht geladen werden."),ej([])}},[P,q]);(0,l.useEffect)(()=>{ez()},[ez]);let eC=async()=>{ey(!0);try{await (0,m._k)(q,ef),await ez(),await eS(),P("Rush-Zeitfenster gespeichert (UTC; schlie\xdft mit manueller K\xfcchenlast zusammen).")}catch(e){P(e instanceof m.ge?e.message:"Speichern fehlgeschlagen.")}finally{ey(!1)}},eD=async()=>{ev(!0);try{await (0,m.zA)(q,{kitchen_load_state:ex}),await eS(),P("K\xfcchenlast f\xfcr das Ranking gespeichert.")}catch(e){P(e instanceof m.ge?e.message:"K\xfcchenlast konnte nicht gespeichert werden.")}finally{ev(!1)}},eE=async()=>
1{if(window.confirm(U("insightsClearEventsConfirm"))){ew(!0);try{var e,s;let n=await (0,m.Xh)(q,{scope:"today",timezone_name:I.timezone||"Europe/Berlin"});P(U("insightsClearEventsDone",{upsellCount:null!=(e=n.deleted_events)?e:0,menuCount:null!=(s=n.deleted_table_menu_activity_events)?s:0}))}catch(e){P(e instanceof m.ge?e.message:String(U("insightsClearEventsErr")));return}finally{ew(!1)}$(!0);try{let e=await (0,m.Ml)(q,V);J(e)}catch(e){P(U("insightsClearEventsRefreshHint")),J(null)}finally{$(!1)}}},eT=null==Q?void 0:Q.feature_state,eR=null==Q?void 0:Q.data_quality,eA=null!=(s=null==Q?void 0:Q.direct_link_conversion_top)?s:[],eM=Q?function(e,s){var n,t,l,i,a,r,c,d,o,u,h,m,_,g,p;let v=e.custom_window;return v&&"object"==typeof v?{label:s,shown:Number(null!=(n=v.shown)?n:0),unique_shown:Number(null!=(t=v.unique_shown)?t:0),accepted:Number(null!=(l=v.accepted)?l:0),accepted_more:Number(null!=(i=v.accepted_more)?i:0),accepted_after_more:Number(null!=(r=null!=(a=v.accepted_after_more)?a:v.accepted_more)?r:0),show_more:Number(null!=(c=v.show_more)?c:0),expand_more:Number(null!=(d=v.expand_more)?d:0),scroll_more:Number(null!=(o=v.scroll_more)?o:0),shown_after_more:Number(null!=(u=v.shown_after_more)?u:0),dismissed:Number(null!=(h=v.dismissed)?h:0),conversion_rate:"number"==typeof v.impression_conversion_rate?v.impression_conversion_rate:"number"==typeof v.conversion_rate?v.conversion_rate:null,impression_conversion_rate:"number"==typeof v.impression_conversion_rate?v.impression_conversion_rate:"number"==typeof v.conversion_rate?v.conversion_rate:null,offer_moments:Number(null!=(m=v.offer_moments)?m:0),converted_offer_moments:Number(null!=(_=v.converted_offer_moments)?_:0),moment_conversion_rate:"number"==typeof v.moment_conversion_rate?v.moment_conversion_rate:null,events_by_type:v.events_by_type&&"object"==typeof v.events_by_type?v.events_by_type:{},offer_upsell_events:Array.isArray(v.offer_upsell_events)?v.offer_upsell_events:[],guardrails_funnel:null!=(g=v.guardrails_funnel)?g:null,table_menu_activity:null!=(p=v.table_menu_activity)?p:eu()}:null}(Q,I.appliedRangeDescription):null,eL=null!=eM?eM:Q?(e=>{var s,n,t,l,i,a,r,c,d,o,u,h,m;let _=null!=(s=e.events_by_type)?s:{},g=Number(null!=(n=_.shown_after_more)?n:0),p=Number(null!=(t=_.shown)?t:0)+g,v=Number(null!=(l=_.accepted_more)?l:0),x=Number(null!=(i=_.accepted)?i:0),b=x>0?x:v,f=Number(null!=(a=_.expand_more)?a:0),j=Number(null!=(r=_.scroll_more)?r:0),N=Number(null!=(c=_.show_more)?c:0)+f+j,y="number"==typeof e.impression_conversion_rate?e.impression_conversion_rate:p>0?b/p:null;return{label:"Gesamt bisher",shown:p,unique_shown:Number(null!=(d=e.unique_shown)?d:0),accepted:b,accepted_more:v,accepted_after_more:v,show_more:N,expand_more:f,scroll_more:j,shown_after_more:g,dismissed:Number(null!=(o=_.dismissed)?o:0),conversion_rate:y,impression_conversion_rate:y,offer_moments:Number(null!=(u=e.offer_moments)?u:0),converted_offer_moments:Number(null!=(h=e.converted_offer_moments)?h:0),moment_conversion_rate:"number"==typeof e.moment_conversion_rate?e.moment_conversion_rate:null,events_by_type:_,offer_upsell_events:null!=(m=e.offer_upsell_events_7d)?m:[],guardrails_funnel:e.guardrails_funnel_7d?{distinct_sessions_with_shown:e.guardrails_funnel_7d.distinct_sessions_with_shown,orders_completed_matching_session:e.guardrails_funnel_7d.orders_completed_matching_session}:null}})(Q):{label:I.appliedRangeDescription,shown:0,unique_shown:0,accepted:0,accepted_more:0,accepted_after_more:0,show_more:0,expand_more:0,scroll_more:0,shown_after_more:0,dismissed:0,conversion_rate:null,impression_conversion_rate:null,offer_moments:0,converted_offer_moments:0,moment_conversion_rate:null,events_by_type:{},offer_upsell_events:[],guardrails_funnel:null},eB=null!=(n=eL.table_menu_activity)?n:eu(),eH=function(e){let s=()=>Object.fromEntries(el.map(e=>[e,0]));if(!e)return s();if("3+"in e&&!("3"in e)){let n=s();return n["0"]=Number(e["0"])||0,n["1"]=Number(e["1"])||0,n["2"]=Number(e["2"])||0,n["10+"]=Number(e["3+"])||0,n}let n=s();for(let s of el)n[s]=Number(e[s])||0;return n}(eB.reengagements_by_orders_bucket),eF=null!=(i=null==eR?void 0:eR.active_menu_items_count)?i:0,eG=Q&&eF>0?(null!=(a=null==eR?void 0:eR.other_role_menu_items_count)?a:0)/eF:null,eZ=!!Q&&(!1===Q.passes_min_menu_upsell_gate||(null!=(r=null==eR?void 0:eR.total_completed_orders)?r:0)<30),eO=Q&&(Object.keys(null!=(c=Q.events_by_type)?c:{}).length>0||Object.keys(null!=(o=Q.holdout_events_breakdown)?o:{}).length>0||Object.keys(null!=(u=Q.holdout_conversion_rates)?u:{}).length>0),eP=W?(0,t.jsx)("button",{type:"button",className:"link-button",style:{color:"inherit",textDecoration:"underline",cursor:"pointer",background:"none",border:"none",padding:0,font:"inherit"},onClick:()=>W("card-upsell-links"),children:U("insightsQuickstartUpsellLinks")}):(0,t.jsx)("a",{href:"#card-upsell-links",children:U("insightsQuickstartUpsellLinks")});return(0,t.jsx)("section",{className:"admin-panel dash-upsell-clean",id:"admin-upsell-insights","aria-labelledby":"t-card-upsell-insights",children:(0,t.jsxs)("div",{className:"card dash-insights dash-upsell",children:[(0,t.jsxs)("header",{className:"dash-insights__hero",children:[(0,t.jsxs)("div",{className:"dash-insights__hero-text",children:[(0,t.jsx)("h2",{className:"dash-insights__title",id:"t-card-upsell-insights",children:"Empfehlungen"}),(0,t.jsx)("p",{className:"admin-hint",children:eL.label})]}),(0,t.jsx)(es.r,{busy:Y,onClick:()=>void eS()})]}),Y?(0,t.jsx)("p",{className:"admin-hint",children:"Auswertung wird geladen â¦"}):Q?(0,t.jsxs)("div",{className:"admin-stack",style:{gap:0},children:[eM?null:(0,t.jsx)("p",{className:"admin-hint",role:"status",children:"Zeitraumdaten fehlen. Angezeigt werden Gesamtwerte."}),(0,t.jsxs)("div",{className:"dash-summary-grid",children:[(0,t.jsx)(w.R,{label:"Empfehlungen gezeigt",value:ed(eL.shown)}),(0,t.jsx)(w.R,{label:"In den Warenkorb",value:ed(eL.accepted),tone:eL.accepted>0?"good":"neutral"}),(0,t.jsx)(w.R,{label:"Annahmequote",value:ec(null!=(h=eL.impression_conversion_rate)?h:eL.conversion_rate)}),(0,t.jsx)(w.R,{label:"Zugeordneter Umsatz",value:Q.custom_window&&null!=Q.custom_window.upsell_attributed_revenue_cents?(0,C.N_)(Number(Q.custom_window.upsell_attributed_revenue_cents)):"â",hint:Q.custom_window?"Zuordnung: ".concat(ea(String(null!=(_=Q.custom_window.upsell_attribution_status)?_:"â"))):"Keine Umsatzzuordnung verf\xfcgbar"})]}),(0,t.jsxs)(S.k,{title:"Wirkung im Detail",startCollapsed:!0,descExplainer:{infoTitle:"Annahmequote",infoLabel:"So werden Empfehlungen gez\xe4hlt",body:(0,t.jsx)("p",{children:"Die Annahmequote zeigt \xdcbernahmen in den Warenkorb je angezeigter Empfehlung. Angebotsmomente fassen mehrere angezeigte Empfehlungen zusammen. Zugeordneter Umsatz stammt nur aus verkn\xfcpften Bestellpositionen."})},children:[(0,t.jsxs)("div",{className:"dash-insights-metric-grid",children:[(0,t.jsx)(e_,{shown:eL.shown,unique_shown:Number(null!=(g=eL.unique_shown)?g:0),shown_after_more:Number(null!=(p=eL.shown_after_more)?p:0)}),(0,t.jsx)(eg,{accepted_total:eL.accepted,accepted_after_more:Number(null!=(x=null!=(v=eL.accepted_after_more)?v:eL.accepted_more)?x:0),shown_after_more:Number(null!=(b=eL.shown_after_more)?b:0),expand_more:Number(null!=(f=eL.expand_more)?f:0),scroll_more:Number(null!=(j=eL.scroll_more)?j:0)}),(0,t.jsx)(w.R,{label:"Empfehlungen geschlossen",value:ed(eL.dism
1issed)}),(0,t.jsx)(w.R,{label:"Erfolgreiche Angebotsmomente",value:ec(eL.moment_conversion_rate)})]}),(0,t.jsx)(X,{holdoutConversionRates:null!=(N=Q.holdout_conversion_rates)?N:{},holdoutEventsBreakdown:null!=(y=Q.holdout_events_breakdown)?y:{},periodLabel:eL.label})]}),(0,t.jsxs)(S.k,{title:"Men\xfcnutzung",startCollapsed:!0,children:[Q.custom_window&&"object"==typeof Q.custom_window?(0,t.jsxs)("div",{className:"card",style:{padding:14,borderColor:"var(--gold-border)",background:"rgba(199,179,106,0.06)"},children:[(0,t.jsx)(z.s,{heading:"Men\xfcaufrufe & Bestellungen",headingLevel:"h3",infoTitle:"Men\xfcaufrufe & Bestellungen",infoLabel:"Hinweise zum Report-Zeitraum",className:"admin-section-help--spaced",children:(0,t.jsx)("p",{children:"Gleicher Zeitraum und gleiche Zeitfilter wie Restaurant-Insights. Reaktivierung bezogen auf Event-Zeit."})}),(0,t.jsxs)("div",{className:"kpi-grid",style:{marginTop:8},children:[(0,t.jsxs)("div",{className:"kpi",children:[(0,t.jsx)("div",{className:"kpi__val",children:ed(Number(null!=(D=Q.custom_window.initial_open_total)?D:0))}),(0,t.jsx)("div",{className:"kpi__label",children:"Erste Men\xfcaufrufe"})]}),(0,t.jsxs)("div",{className:"kpi",children:[(0,t.jsx)("div",{className:"kpi__val",children:ed(Number(null!=(E=Q.custom_window.initial_open_with_order_within_15m)?E:0))}),(0,t.jsx)("div",{className:"kpi__label",children:"Bestellung â¤15 min"})]}),(0,t.jsxs)("div",{className:"kpi",children:[(0,t.jsx)("div",{className:"kpi__val",children:ed(Number(null!=(T=Q.custom_window.reengagements_total)?T:0))}),(0,t.jsx)("div",{className:"kpi__label",children:"Erneute Men\xfcnutzung"})]}),(0,t.jsxs)("div",{className:"kpi",children:[(0,t.jsx)("div",{className:"kpi__val",children:ec(Q.custom_window.reengagement_order_conversion_rate)}),(0,t.jsx)("div",{className:"kpi__label",children:"Bestellt nach erneutem Aufruf"})]}),(0,t.jsxs)("div",{className:"kpi",children:[(0,t.jsxs)("div",{className:"kpi__val",children:[ed(Number(null!=(R=Q.custom_window.reengagement_orders_within_5m)?R:0)),"/",ed(Number(null!=(A=Q.custom_window.reengagement_orders_within_15m)?A:0))]}),(0,t.jsx)("div",{className:"kpi__label",children:"Bestellt in 5 / 15 Min."})]}),(0,t.jsxs)("div",{className:"kpi",children:[(0,t.jsx)("div",{className:"kpi__val",children:null!=Q.custom_window.upsell_attributed_revenue_cents?(0,C.N_)(Number(Q.custom_window.upsell_attributed_revenue_cents)):"â"}),(0,t.jsxs)("div",{className:"kpi__label",children:["Zugeordneter Umsatz (",ea(String(null!=(M=Q.custom_window.upsell_attribution_status)?M:"â")),")"]})]})]})]}):null,(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{style:{margin:"0 0 10px",fontSize:13,fontWeight:800,color:"var(--admin-muted)",letterSpacing:"0.06em",textTransform:"uppercase"},children:"Nutzung am Tisch"}),(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(150px, 1fr))",gap:10,alignItems:"stretch"},children:[(0,t.jsx)(ep,{label:"\xd8 erneute Nutzungen je Gast",value:"number"==typeof(O=eB.avg_reengagements_per_guest)&&Number.isFinite(O)?O.toLocaleString("de-DE",{maximumFractionDigits:2}):"â",hint:U("tableMenuAvgReengagementsPerGuestHint")}),(0,t.jsx)(ep,{label:"G\xe4ste erneut aktiv",value:ed(eB.distinct_reengaged_guests),hint:U("tableMenuDistinctReengagedHint")}),(0,t.jsx)(ep,{label:U("tableMenuActivityConversion"),value:ec(eB.activity_conversion_rate),hint:U("tableMenuActivityConversionHint"),tone:(null!=(L=eB.activity_conversion_rate)?L:0)>=.15?"good":"neutral"}),(0,t.jsx)(ep,{label:U("tableMenuReengagementConversion"),value:ec(eB.reengagement_conversion_rate),hint:U("tableMenuReengagementConversionHint"),tone:(null!=(B=eB.reengagement_conversion_rate)?B:0)>=.15?"good":"neutral"}),(0,t.jsx)(ep,{label:"\xd8 Pause vor erneuter Nutzung",value:eo(eB.avg_idle_seconds_before_reengagement),hint:U("tableMenuAvgIdleHint")}),(0,t.jsx)(ep,{label:"\xd8 Zeit bis erneuter Nutzung",value:"number"==typeof(G=eB.avg_seconds_since_session_start_on_reengagement)&&Number.isFinite(G)?G<90?eo(G):"".concat((G/60).toLocaleString("de-DE",{maximumFractionDigits:1})," min"):"â",hint:U("tableMenuAvgSessionOffsetReengageHint")})]}),(0,t.jsxs)("div",{style:{marginTop:12},children:[(0,t.jsx)("div",{style:{...em,marginBottom:8},children:"Erneute Nutzung nach Bestellungen"}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(72px, 1fr))",gap:8},children:el.map(e=>{var s;let n=Number(null!=(s=eH[e])?s:0);return(0,t.jsxs)("div",{style:{...eh,textAlign:"center",padding:"10px 8px"},children:[(0,t.jsx)("div",{style:{fontSize:11,color:"var(--admin-muted)",fontWeight:700},children:U(ei[e])}),(0,t.jsx)("div",{style:{marginTop:6,fontSize:20,fontWeight:800,color:"var(--text)"},children:ed(n)})]},e)})}),(0,t.jsx)(z.s,{heading:"Erneute Men\xfcnutzung nach Bestellphase",headingLevel:"p",infoTitle:"Erneute Men\xfcnutzung nach Bestellphase",infoLabel:"Erkl\xe4rung der Phasen-Kacheln",className:"admin-section-help--spaced",children:(0,t.jsx)("p",{children:U("tableMenuReengagementsByOrderPhaseHint")})})]})]})]}),(0,t.jsx)(S.k,{title:"Verkaufte Produkte & Kan\xe4le",startCollapsed:!0,children:(0,t.jsx)(en,{onNotify:P,embedded:!0})}),(0,t.jsxs)(S.k,{title:"Einrichtung & Datenqualit\xe4t",startCollapsed:!0,children:[(0,t.jsx)(w.R,{label:"Lernfortschritt",value:eT?"Stufe ".concat(eT.learning_stage):"â",hint:eT?((Z=eT.learning_stage)<=0?"Stufe 0 â Grundregeln aktiv":1===Z?"Stufe 1 â Gemeinsam bestellte Produkte":2===Z?"Stufe 2 â Gelernte Produktpaare":3===Z?"Stufe 3 â Neue Vorschl\xe4ge und Ern\xe4hrungsfilter":4===Z?"Stufe 4 â Zus\xe4tzliche Verkaufssignale":5===Z?"Stufe 5 â Gelernte G\xe4stegruppen (experimentell)":"Stufe 5+ â Skalierung").replace(/^Stufe \d+\sâ\s/,""):"Noch keine Daten",tone:Q.passes_min_menu_upsell_gate?"good":"warn"}),(0,t.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(260px, 1fr))",gap:12},children:[(0,t.jsxs)("section",{style:{padding:14,borderRadius:14,border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.16)"},children:[(0,t.jsx)(z.s,{heading:"Men\xfcstruktur",headingLevel:"h3",infoTitle:"Men\xfcstruktur",infoLabel:"Hinweise zu Rollen und Datenqualit\xe4t",className:"admin-section-help--spaced",children:(0,t.jsx)("p",{children:"Aktive Gerichte, Rollen âSonstigesâ, effektive Rollenvielfalt, Kosten- und Ern\xe4hrungsabdeckung â Grundlage f\xfcr Upsell-Gates und Empfehlungen."})}),(0,t.jsxs)("ul",{style:{margin:0,paddingLeft:18,fontSize:13,lineHeight:1.6},children:[(0,t.jsxs)("li",{children:["Aktive Gerichte: ",ed(null==eR?void 0:eR.active_menu_items_count)]}),(0,t.jsxs)("li",{children:["Rolle âSonstigesâ (Datenbank): ",ed(null==eR?void 0:eR.other_role_menu_items_count),null!=eG?" (".concat(ec(eG),")"):""]}),(0,t.jsxs)("li",{children:["Effektive Rollenvielfalt (Kategorie + manuell):"," ",ed(null==eR?void 0:eR.effective_non_other_roles_count)," unterschiedliche (nicht âSonstigesâ)"]}),(0,t.jsxs)("li",{children:["Kostenabdeckung: ",ec(null==eR?void 0:eR.cost_coverage_ratio)]}),(0,t.jsxs)("li",{children:["Ern\xe4hrungs-Profile: ",ec(null==eR?void 0:eR.diet_profile_coverage_ratio)]})]}),Q.upsell_roles_hint?(0,t.jsx)("p",{className:"admin-hint",style:{marginTop:10,color:"#93c5fd"},children:Q.upsell_roles_hint}):null,Q.min_menu_upsell_gate_detail?(0,t.jsx)("p",{className:"admin-hint",style:{marginTop:10,color:"#f59e0b",fontWeight:600},children:Q.min_menu_upsell_gate_detail}):!1===Q.passes_min_menu_upsell_gate?(0,t.jsx)("p",{className:"admin-hint",style:{marginTop:10,color:"#f59e0b",fontWeight:600},children:"F\xfcr Empfehlungen fehlen aktive Vorschl\xe4ge in mindestens zwei Produktrollen."}):null,(null==eR?void 0:eR.effective_upsell_role_distribution)&&Object.keys(eR.effective_upsell_role_distribution).length>0?(0,t.jsxs)("p",{className:"admin-hint",style:{marginTop:10,fontSize:12,lineHeight:1.5},children:["Verteilung effektiver Rollen:"," ",Object.entries(eR.effective_upsell_role_distribution).map(e=>{let[s,n]=e;return"".concat(s,": ").concat(n)}
1).join(", ")]}):null]}),(0,t.jsxs)("section",{style:{padding:14,borderRadius:14,border:"1px solid rgba(255,255,255,0.1)",background:"rgba(0,0,0,0.16)"},children:[(0,t.jsx)(z.s,{heading:"Empfehlungen & Bestellabschluss",headingLevel:"h3",infoTitle:"Empfehlungen & Bestellabschluss",infoLabel:"Upsell-Schalter und Checkout-Guardrails",className:"admin-section-help--spaced",children:(0,t.jsx)("p",{children:"Upsell global, Checkout-Guardrails, K\xfcchenlast und abgeschlossene Bestellungen â zusammen mit den Guardrail-Funnel-Zahlen im gew\xe4hlten Zeitraum."})}),(0,t.jsxs)("ul",{style:{margin:0,paddingLeft:18,fontSize:13,lineHeight:1.6},children:[(0,t.jsxs)("li",{children:["Empfehlungen: ",Q.upsell_enabled?"an":"aus"]}),(0,t.jsxs)("li",{children:["Begrenzung beim Bestellabschluss: ",Q.upsell_checkout_guardrails_enabled?"an":"aus",null!=Q.guardrails_max_k?" (max. ".concat(Q.guardrails_max_k,")"):""]}),(0,t.jsxs)("li",{children:["Effektive K\xfcchenlast: ",er(null!=(H=Q.kitchen_load_effective)?H:Q.kitchen_load_state)]}),(0,t.jsxs)("li",{children:["Abgeschlossene Bestellungen: ",ed(null==eR?void 0:eR.total_completed_orders)]})]}),eL.guardrails_funnel?(0,t.jsxs)("p",{className:"admin-hint",style:{marginTop:10},children:[(0,t.jsxs)("strong",{children:[eL.label,":"]})," ",eL.guardrails_funnel.distinct_sessions_with_shown," Besuche mit angezeigten Empfehlungen,"," ",eL.guardrails_funnel.orders_completed_matching_session," passende Bestellungen."]}):Q.checkout_guardrails_help?(0,t.jsx)("p",{className:"admin-hint",style:{marginTop:10},children:Q.checkout_guardrails_help}):null,eZ?(0,t.jsxs)("p",{className:"admin-hint",style:{marginTop:10,color:"#a7f3d0"},children:[(0,t.jsx)("strong",{children:"Schnellstart:"})," Direktlinks und Kategorien unter ",eP," pflegen; Rollen je Gericht unter âProdukte verwaltenâ."]}):null]})]}),eA.length>0?(0,t.jsxs)("section",{children:[(0,t.jsx)(z.s,{heading:U("insightsDirectLinksTopTitle"),headingLevel:"h3",infoTitle:U("insightsDirectLinksTopTitle"),infoLabel:"Hinweise zu Direktlinks",className:"admin-section-help--spaced",children:(0,t.jsx)("p",{children:U("insightsDirectLinksTopLead")})}),(0,t.jsx)("div",{style:{overflowX:"auto"},children:(0,t.jsxs)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:13},children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{style:{textAlign:"left",borderBottom:"1px solid rgba(255,255,255,0.12)"},children:[(0,t.jsx)("th",{style:{padding:"8px"},children:U("insightsDirectLinksColPair")}),(0,t.jsx)("th",{style:{padding:"8px"},children:U("insightsDirectLinksColSource")}),(0,t.jsx)("th",{style:{padding:"8px"},children:U("insightsDirectLinksColSuggested")}),(0,t.jsx)("th",{style:{padding:"8px"},children:U("insightsDirectLinksColShown")}),(0,t.jsx)("th",{style:{padding:"8px"},children:U("insightsDirectLinksColCart")}),(0,t.jsx)("th",{style:{padding:"8px"},children:U("insightsDirectLinksColRate")})]})}),(0,t.jsx)("tbody",{children:eA.map(e=>{var s,n,l;return(0,t.jsxs)("tr",{style:{borderBottom:"1px solid rgba(255,255,255,0.06)"},children:[(0,t.jsx)("td",{style:{padding:"8px",verticalAlign:"top",maxWidth:280},children:(null==(s=e.direct_link_label)?void 0:s.trim())?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:{lineHeight:1.35},children:e.direct_link_label}),(0,t.jsx)("div",{style:{marginTop:6,fontSize:11,opacity:.78},children:(0,t.jsx)("code",{title:U("traceDirectLink",{id:e.menu_item_upsell_id}),children:U("insightsDirectLinksInternalIdLabel",{id:e.menu_item_upsell_id})})})]}):(0,t.jsx)("code",{title:U("traceDirectLink",{id:e.menu_item_upsell_id}),children:e.menu_item_upsell_id})}),(0,t.jsx)("td",{style:{padding:"8px"},children:"number"==typeof e.source_menu_item_id?(null==(n=e.source_menu_item_name)?void 0:n.trim())?e.source_menu_item_name.trim():U("traceDish",{id:e.source_menu_item_id}):"â"}),(0,t.jsx)("td",{style:{padding:"8px"},children:"number"==typeof e.suggested_menu_item_id?(null==(l=e.suggested_menu_item_name)?void 0:l.trim())?e.suggested_menu_item_name.trim():U("traceDish",{id:e.suggested_menu_item_id}):"â"}),(0,t.jsx)("td",{style:{padding:"8px"},children:e.shown}),(0,t.jsx)("td",{style:{padding:"8px"},children:e.accepted}),(0,t.jsx)("td",{style:{padding:"8px"},children:ec(e.shown>0?e.accepted/e.shown:null)})]},e.menu_item_upsell_id)})})]})})]}):(0,t.jsx)("p",{className:"admin-hint",children:U("insightsDirectLinksEmpty")})]}),(0,t.jsx)(S.k,{title:"K\xfcchenlast & Sto\xdfzeiten",startCollapsed:!0,children:(0,t.jsxs)("div",{className:"card-inner admin-stack",style:{gap:12},children:[(0,t.jsxs)("div",{className:"admin-stack",style:{gap:8},children:[(0,t.jsxs)("p",{style:{margin:0},children:[(0,t.jsx)("strong",{children:"K\xfcchenlast:"})," bevorzugt bei hoher Auslastung schnelle Gerichte."]}),(0,t.jsxs)("div",{className:"btn-row",style:{flexWrap:"wrap",gap:8,alignItems:"center"},children:[(0,t.jsxs)("select",{className:"admin-input",style:{maxWidth:220,padding:"8px 10px"},value:ex,disabled:ee||Y,onChange:e=>eb(e.target.value),"aria-label":"K\xfcchenlast",children:[(0,t.jsx)("option",{value:"normal",children:"Normal"}),(0,t.jsx)("option",{value:"busy",children:"Hohe Auslastung"}),(0,t.jsx)("option",{value:"rush",children:"Sehr hohe Auslastung"})]}),(0,t.jsx)("button",{type:"button",className:"ghost-footer",disabled:ee||Y,onClick:()=>void eD(),children:"K\xfcchenlast speichern"})]}),(0,t.jsxs)("p",{className:"admin-hint",children:["Manuell: ",er(Q.kitchen_load_state)," \xb7 aktuell:"," ",er(null!=(F=Q.kitchen_load_effective)?F:Q.kitchen_load_state)]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{style:{marginBottom:6},children:(0,t.jsx)("strong",{children:"Geplante Sto\xdfzeiten (UTC)"})}),(0,t.jsx)("p",{className:"admin-hint",style:{marginTop:0},children:"Wochentag + Uhrzeit; bei \xdcberschneidung mit âjetztâ wird die h\xf6here Last addiert."}),(0,t.jsxs)("div",{className:"admin-stack",style:{gap:8},children:[ef.map((e,s)=>{var n,l;return(0,t.jsxs)("div",{className:"btn-row",style:{flexWrap:"wrap",gap:8,alignItems:"center"},children:[(0,t.jsx)("select",{className:"admin-input",style:{maxWidth:72},value:e.weekday,disabled:eN||Y,onChange:e=>{let n=[...ef];n[s]={...n[s],weekday:Number(e.target.value)},ej(n)},"aria-label":"Wochentag Zeile ".concat(s+1),children:et.map((e,s)=>(0,t.jsx)("option",{value:s,children:e},e))}),(0,t.jsx)("input",{className:"admin-input",style:{maxWidth:88},type:"text",placeholder:"08:00",value:e.start_time,disabled:eN||Y,onChange:e=>{let n=[...ef];n[s]={...n[s],start_time:e.target.value},ej(n)},"aria-label":"Start Zeile ".concat(s+1)}),(0,t.jsx)("span",{style:{opacity:.7},children:"â"}),(0,t.jsx)("input",{className:"admin-input",style:{maxWidth:88},type:"text",placeholder:"10:30",value:e.end_time,disabled:eN||Y,onChange:e=>{let n=[...ef];n[s]={...n[s],end_time:e.target.value},ej(n)},"aria-label":"Ende Zeile ".concat(s+1)}),(0,t.jsxs)("select",{className:"admin-input",style:{maxWidth:180},value:null!=(n=e.load_state)?n:"busy",disabled:eN||Y,onChange:e=>{let n=[...ef];n[s]={...n[s],load_state:e.target.value},ej(n)},children:[(0,t.jsx)("option",{value:"busy",children:"Hohe Auslastung"}),(0,t.jsx)("option",{value:"rush",children:"Sehr hohe Auslastung"})]}),(0,t.jsxs)("label",{style:{display:"flex",gap:6,alignItems:"center",fontSize:13},children:[(0,t.jsx)("input",{type:"checkbox",checked:!1!==e.is_active,disabled:eN||Y,onChange:e=>{let n=[...ef];n[s]={...n[s],is_active:e.target.checked},ej(n)}}),"aktiv"]}),(0,t.jsx)("input",{className:"admin-input",style:{flex:1,minWidth:120,maxWidth:220},type:"text",placeholder:"Name (optional)",value:null!=(l=e.label)?l:"",disabled:eN||Y,onChange:e=>{let n=[...ef];n[s]={...n[s],label:e.target.value||null},ej(n)}}),(0,t.jsx)("button",{type:"button",className:"ghost-footer",disabled:eN||Y,onClick:()=>
1ej(ef.filter((e,n)=>n!==s)),children:"Entfernen"})]},"rush-".concat(s))}),(0,t.jsxs)("div",{className:"btn-row",style:{gap:8},children:[(0,t.jsx)("button",{type:"button",className:"ghost-footer",disabled:eN||Y,onClick:()=>ej([...ef,{weekday:4,start_time:"18:00",end_time:"21:00",load_state:"busy",is_active:!0,label:null}]),children:"Zeile hinzuf\xfcgen"}),(0,t.jsx)("button",{type:"button",className:"ghost-footer",disabled:eN||Y,onClick:()=>void eC(),children:"Zeitfenster speichern"})]})]})]})]})}),(0,t.jsx)(S.k,{title:"Technische Details",startCollapsed:!0,children:(0,t.jsxs)("div",{className:"card-inner admin-stack",style:{gap:12},children:[(0,t.jsx)("div",{className:"btn-row",style:{gap:8,alignItems:"center"},children:(0,t.jsx)("button",{type:"button",className:"ghost-footer",title:String(U("insightsClearEventsLead")),style:{borderColor:"rgba(248,113,113,0.45)"},disabled:Y||ek||!q,onClick:()=>void eE(),children:ek?"â¦":U("insightsClearEventsButton")})}),(0,t.jsxs)("p",{className:"admin-hint",children:["Gesamt-Events: ",ed(null==eR?void 0:eR.total_qualified_upsell_events)," \xb7 Pair-Stats:"," ",ed(null==eR?void 0:eR.pair_stats_pairs)," \xb7 Co-Occurrence:"," ",ed(null==eR?void 0:eR.cooccurrence_pairs)]}),eO?(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("pre",{style:{margin:0,padding:10,borderRadius:8,background:"rgba(0,0,0,0.2)",fontSize:12,overflow:"auto"},children:JSON.stringify({period_events:eL.events_by_type,all_events:Q.events_by_type,holdout_events:Q.holdout_events_breakdown,holdout_rates:Q.holdout_conversion_rates},null,2)})}):(0,t.jsx)("p",{className:"admin-hint",children:"Noch keine technischen Eventdetails vorhanden."}),(0,t.jsx)("p",{className:"admin-hint",style:{margin:0,fontSize:12},children:U("insightsClearEventsCockpitHint")})]})})]}):(0,t.jsx)("p",{className:"admin-hint",children:"Keine Daten."})]})})}function ex(e){let{setupPct:s,setupSummary:n,onResetOnboarding:o,onNotify:u,onJumpPanel:g}=e,p=(0,d.E)(),{isFeatureOpen:v}=(0,a.W)(),b=v("analytics"),f=(0,l.useCallback)(e=>{null==u||u(e)},[u]),j=(0,l.useCallback)(e=>{if(g)return void g(e);window.location.hash="#".concat(e)},[g]),[k,w]=(0,l.useState)(null),[S,z]=(0,l.useState)(void 0),[C,D]=(0,l.useState)(""),[E,T]=(0,l.useState)(!0),[R,A]=(0,l.useState)("â"),[M,L]=(0,l.useState)(!1),B=(0,l.useCallback)(async()=>{if(D(""),T(!0),w(null),!(0,m.jM)()){D("Die Verbindung zum Restaurant ist nicht eingerichtet. Bitte kontaktieren Sie den Support."),T(!1);return}let e=(0,m.ut)("/restaurants/".concat(p,"/dashboard/delivery-service")).catch(e=>e),s=(0,m.kD)(p).catch(e=>e),[n,t]=await Promise.all([e,s]);n instanceof m.ge||n instanceof Error?w("error"):w(!1!==n.enabled),"number"==typeof t?A(String(t)):A("â"),D(""),T(!1)},[p]);(0,l.useEffect)(()=>{L(!1),B()},[B]);let F=(0,l.useCallback)(e=>{z(e)},[]),G="â¦",Z="dash-del-status-pill--pending",O="";!0===S?(G="Ge\xf6ffnet",Z="",O="del-set-master__pill--on"):!1===S?(G="Geschlossen",Z="",O="del-set-master__pill--off"):null===S&&(G="â");let P="â¦",K="dash-del-status-pill--pending",q="";return E||"error"!==k?E||"boolean"!=typeof k||void 0===S||(k?!1!==S?(P="Aktiv",K="",q="del-set-master__pill--on"):(P="Geschlossen",K="",q="del-set-master__pill--off"):(P="Pausiert",K="",q="del-set-master__pill--off")):P="â",(0,t.jsxs)("section",{className:"admin-panel",id:"panel-dashboard","aria-labelledby":"t-dashboard",children:[(0,t.jsx)(c.H,{titleId:"t-dashboard",title:"\xdcbersicht",refreshId:"btn-dash-live-refresh",refreshing:E,onRefresh:()=>void B()}),(0,t.jsx)(h,{}),C?(0,t.jsx)("p",{className:"admin-hint dash-live-error",children:C}):null,(0,t.jsx)(N,{planStatus:(0,t.jsxs)("div",{className:"dash-plan-rail",children:[(0,t.jsx)(_,{}),(0,t.jsx)(x,{})]}),loading:E,activeTableSessions:R,venueLabel:G,venueClass:Z,venueExtraClass:O,delLabel:P,delClass:K,delExtraClass:q}),(0,t.jsx)(W,{onNotify:u,onAcceptsOrdersChange:F}),b?M?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.U,{}),(0,t.jsx)(H,{onNotify:u}),(0,t.jsx)(ev,{onNotify:f,onNavigateToUpsellWizardTab:j})]}):(0,t.jsxs)("div",{className:"card dash-insights",children:[(0,t.jsxs)("div",{className:"dash-insights__head admin-title-info-inline",children:[(0,t.jsx)("h2",{className:"dash-insights__title",children:"Analysen"}),(0,t.jsx)(r.u,{infoTitle:"Analysen",infoLabel:"Hinweise zu Analysen",children:(0,t.jsx)("p",{children:"Restaurant- und Upsell-Auswertungen werden erst bei Bedarf geladen."})})]}),(0,t.jsx)("button",{type:"button",className:"ghost-footer",onClick:()=>L(!0),children:"Analysen laden"})]}):(0,t.jsx)(i.u,{featureId:"analytics"}),(0,t.jsx)(U,{setupPct:s,setupSummary:n,onResetOnboarding:o})]})}},18931:(e,s,n)=>{n.d(s,{d:()=>i});var t=n(95155),l=n(28941);function i(e){let{label:s,state:n,serviceOverride:i,timeZone:a,disabled:r,quiet:c=!1,onChange:d}=e,o=n.today_on?"":function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Europe/Berlin";if(!e)return"";let n=Date.parse(e);if(!Number.isFinite(n))return"";let t={weekday:"short",hour:"2-digit",minute:"2-digit"};try{return new Intl.DateTimeFormat("de-DE",{...t,timeZone:s}).format(new Date(n))}catch(e){return new Intl.DateTimeFormat("de-DE",{...t,timeZone:"Europe/Berlin"}).format(new Date(n))}}(n.off_until,a),u="";c?o&&(u="bis ".concat(o)):n.configured?"closed"===i?u="Wirkt bei Automatisch und Ge\xf6ffnet.":o&&(u="Aus bis ".concat(o,".")):u="Ohne Aktiv und g\xfcltige Zeit hat der Schalter keine Wirkung.";let h=r||!n.configured;return(0,t.jsxs)("div",{className:"service-today-switch",children:[c?(0,t.jsx)(l.Z,{checked:n.today_on,disabled:h,label:s,"aria-label":s,onChange:d}):(0,t.jsxs)("label",{className:"service-today-switch__label",children:[(0,t.jsx)("input",{type:"checkbox",checked:n.today_on,disabled:h,onChange:e=>d(e.target.checked)})," ","".concat(s," heute")]}),u?(0,t.jsx)("span",{className:"admin-hint service-today-switch__hint",children:u}):null]})}},28941:(e,s,n)=>{n.d(s,{Z:()=>i});var t=n(95155),l=n(25016);function i(e){let{checked:s,onChange:n,disabled:i=!1,label:a,compact:r=!1,className:c,id:d,"aria-label":o,title:u}=e;return(0,t.jsxs)("label",{className:(0,l.cn)("svc-onoff",s?"svc-onoff--on":"svc-onoff--off",r&&"svc-onoff--compact",c),title:u,children:[a?(0,t.jsx)("span",{className:"svc-onoff__name",children:a}):null,(0,t.jsx)("input",{id:d,type:"checkbox",role:"switch",checked:s,disabled:i,"aria-label":o,onChange:e=>n(e.target.checked)}),(0,t.jsx)("span",{className:"svc-onoff__track","aria-hidden":"true",children:(0,t.jsx)("span",{className:"svc-onoff__thumb"})})]})}},46398:(e,s,n)=>{n.d(s,{A:()=>t});let t=(0,n(19904).A)("truck",[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]])},53218:(e,s,n)=>{n.d(s,{F:()=>i});var t=n(12115),l=n(59305);function i(e){let s=!(arguments.length>1)||void 0===arguments[1]||arguments[1],[n,i]=(0,t.useState)(null),[a,r]=(0,t.useState)(!1),[c,d]=(0,t.useState)(!1),[o,u]=(0,t.useState)("");(0,t.useEffect)(()=>
1{if(!s||null==e)return void i(null);let n=!1;return r(!0),u(""),(0,l.Cq)(e).then(e=>{n||i(e)}).catch(()=>{n||i(null)}).finally(()=>{n||r(!1)}),()=>{n=!0}},[e,s]);let h=(0,t.useCallback)(async s=>{if(null==e)return!1;d(!0),u("");try{return i(await (0,l.jg)(e,s)),!0}catch(e){return u(e instanceof l.ge?e.message:"\xd6ffnungsstatus konnte nicht gespeichert werden."),!1}finally{d(!1)}},[e]),m=(0,t.useCallback)((e,s)=>h({["".concat(e,"_today_on")]:s}),[h]);return{status:n,loading:a,saving:c,error:o,save:h,setMealToday:m}}},55136:(e,s,n)=>{n.d(s,{A:()=>t});let t=(0,n(19904).A)("store",[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5",key:"slp6dd"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244",key:"o0xfot"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05",key:"wn3emo"}]])},60988:(e,s,n)=>{n.d(s,{s:()=>i});var t=n(95155),l=n(32388);function i(e){let{heading:s,headingLevel:n="h3",infoTitle:i,infoLabel:a,children:r,className:c}=e;return(0,t.jsxs)("div",{className:"admin-section-help admin-title-info-inline".concat(c?" ".concat(c):""),children:[(0,t.jsx)(n,{className:"admin-section-help__heading",children:s}),(0,t.jsx)(l.u,{infoTitle:i,infoLabel:a,children:r})]})}},63368:(e,s,n)=>{function t(e){return(Math.round(Number(e)||0)/100).toLocaleString("de-DE",{style:"currency",currency:"EUR"})}function l(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();try{let n=new Date(e);if(Number.isNaN(n.getTime()))return"â";let t=new Date(s),l=n.getFullYear()===t.getFullYear()&&n.getMonth()===t.getMonth()&&n.getDate()===t.getDate(),i=n.toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"});if(l)return i;return"".concat(n.toLocaleDateString("de-DE",{day:"2-digit",month:"2-digit"}),", ").concat(i)}catch(e){return"â"}}function i(e){try{let s=new Date(e);if(Number.isNaN(s.getTime()))return"â";return s.toLocaleString("de-DE",{dateStyle:"medium",timeStyle:"short"})}catch(e){return"â"}}n.d(s,{N_:()=>t,ZB:()=>i,eN:()=>l})},64018:(e,s,n)=>{n.d(s,{k:()=>i});var t=n(95155),l=n(32388);function i(e){let{title:s,kicker:n,description:i,descExplainer:a,actions:r,children:c,id:d,className:o="",startCollapsed:u=!1}=e,h=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"dash-section__titles",children:[n?(0,t.jsx)("p",{className:"dash-section__kicker",children:n}):null,(0,t.jsxs)("div",{className:"admin-title-info-inline dash-section__title-row",children:[(0,t.jsx)("h3",{className:"dash-section__title",children:s}),a?(0,t.jsx)(l.u,{infoTitle:a.infoTitle,infoLabel:a.infoLabel,children:a.body}):null]}),i&&!a?(0,t.jsx)("div",{className:"dash-section__desc admin-hint",children:i}):null]}),r?(0,t.jsx)("div",{className:"dash-section__actions",children:r}):null]}),m=(0,t.jsx)("div",{className:"dash-section__body",children:c});return u?(0,t.jsx)("section",{className:"dash-section dash-section--collapsed ".concat(o).trim(),id:d,children:(0,t.jsxs)("details",{className:"dash-section__fold",children:[(0,t.jsxs)("summary",{className:"dash-section__head",children:[h,(0,t.jsx)("span",{className:"dash-section__chevron","aria-hidden":"true"})]}),m]})}):(0,t.jsxs)("section",{className:"dash-section ".concat(o).trim(),id:d,children:[(0,t.jsx)("header",{className:"dash-section__head",children:h}),m]})}},67781:(e,s,n)=>{n.d(s,{R:()=>l});var t=n(95155);function l(e){let{label:s,value:n,hint:l,tone:i="neutral",id:a,className:r=""}=e;return(0,t.jsxs)("div",{id:a,className:"dash-metric ".concat("neutral"!==i?"dash-metric--".concat(i):""," ").concat(r).trim(),children:[(0,t.jsx)("div",{className:"dash-metric__val",children:n}),(0,t.jsx)("div",{className:"dash-metric__label",children:s}),null!=l&&""!==l?(0,t.jsx)("div",{className:"dash-metric__hint",children:l}):null]})}},69667:(e,s,n)=>{function t(e){let s=new Date(e);return Number.isNaN(s.getTime())?"":new Intl.DateTimeFormat("de-DE",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(s)}function l(e,s){if(!e)return"ohne Enddatum";let n=new Date(e).getTime();if(Number.isNaN(n))return"ohne Enddatum";let t=Math.floor((n-s)/6e4);if(t<0)return"abgelaufen";let l=Math.floor(t/1440),i=Math.floor(t%1440/60),a=t%60;return l>=1?"noch ".concat(l," ").concat(1===l?"Tag":"Tage"," ").concat(i," Std."):i>=1?"noch ".concat(i," Std. ").concat(a," Min."):a>=1?"noch ".concat(a," Min."):"noch unter einer Minute"}n.d(s,{H:()=>l,_:()=>t})}}]);
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.