PageSourceSearch

https://foodflo.app/_app/immutable/nodes/61.5wtmnhwu.js

js foodflo.app collected 2026-10-04 18:49:10 UTC 13,723 bytes, 2 lines download raw bytes

1import"../chunks/CuOgnXdt.js";import{p as wt,j as A,k as kt,w as $t,h as Z,l as f,g as t,t as h,a as x,b as Tt,d as Et,c as r,s as o,u as V,f as g,$ as Ft,r as a,n as Dt,i as Ct,e as At}from"../chunks/DXN_rciI.js";import{s as It,a as St}from"../chunks/DnE_0yvS.js";import{d as Pt,a as ve,s as v,e as Nt}from"../chunks/Dhs1PqO2.js";import{i as w}from"../chunks/B_reJdki.js";import{e as Ce,i as Ve}from"../chunks/BkNvGB5n.js";import{h as Kt}from"../chunks/BHKw1Ydb.js";import{a as Ae}from"../chunks/D2NywcLB.js";import{s as Xe,r as X,a as ce,c as Lt}from"../chunks/Cxz7eCdv.js";import{s as Ot}from"../chunks/DLYa3ulr.js";import{b as ze}from"../chunks/BfayF9Eg.js";import{a as Wt}from"../chunks/Dc0d9q00.js";import{e as Ie}from"../chunks/Cm8-HkeJ.js";import{c as Se}from"../chunks/Cp5e8Dak.js";import{C as jt}from"../chunks/B1YHaUHM.js";import{A as Ht}from"../chunks/D8ZJCL_J.js";import{W as Be}from"../chunks/nBh2HOUQ.js";import{X as qt}from"../chunks/D_iEPM9u.js";import{P as Ge}from"../chunks/_8LYn_Bh.js";import{T as Mt}from"../chunks/Bgom-qwN.js";import{C as Je}from"../chunks/dSaCUZaH.js";import{C as Qe}from"../chunks/DcC4RmRL.js";import{L as Pe}from"../chunks/oGzVPnu6.js";import{T as Rt}from"../chunks/ChjiF1e5.js";(function(){try{var I=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};I.SENTRY_RELEASE={id:"e6477a3dc0969721ce553fb9ccfd038301828980"};var _=new I.Error().stack;_&&(I._sentryDebugIds=I._sentryDebugIds||{},I._sentryDebugIds[_]="ed3d6306-6474-4536-a560-ad1daa67e22a",I._sentryDebugIdIdentifier="sentry-dbid-ed3d6306-6474-4536-a560-ad1daa67e22a")}catch{}})();var Ze=g("<!> ",1),Ut=g('<div class="mb-4 p-3 rounded-lg bg-red-50 border border-red-200 text-sm text-red-700 flex items-center gap-2"><!> </div>'),Yt=g('<label class="flex items-center gap-1.5 cursor-pointer"><input type="checkbox" name="eventFilters" class="rounded border-stone-300 text-stone-800 focus:ring-stone-400"/> <span class="text-xs text-stone-700"> </span></label>'),Vt=g('<div class="rounded-2xl border border-stone-200 bg-white p-5 mb-5"><h2 class="text-sm font-semibold text-stone-900 mb-4"> </h2> <form method="POST" action="?/create"><div class="mb-4"><label for="url" class="block text-xs font-medium text-stone-700 mb-1"> <span class="text-red-500">*</span></label> <input id="url" name="url" type="url" required="" placeholder="https://your-server.com/webhook" class="w-full px-3 py-2 rounded-lg border border-stone-200 bg-stone-50 text-sm text-stone-900 placeholder:text-stone-400 focus:outline-none focus:ring-2 focus:ring-stone-300 focus:border-transparent"/> <p class="text-[11px] text-stone-400 mt-1"> </p></div> <div class="mb-4"><label for="description" class="block text-xs font-medium text-stone-700 mb-1"> <span class="text-stone-400"> </span></label> <input id="description" name="description" type="text" maxlength="2000" class="w-full px-3 py-2 rounded-lg border border-stone-200 bg-stone-50 text-sm text-stone-900 placeholder:text-stone-400 focus:outline-none focus:ring-2 focus:ring-stone-300 focus:border-transparent"/></div> <div class="mb-5"><p class="text-xs font-medium text-stone-700 mb-2"> <span class="text-stone-400 font-normal"> </span></p> <div class="flex flex-wrap gap-2"></div></div> <div class="flex items-center justify-end gap-2"><button type="button" class="px-4 py-2 rounded-lg border border-stone-200 bg-white hover:bg-stone-50 text-stone-700 text-xs font-medium transition-colors"> </button> <button type="submit" class="inline-flex items-center gap-1.5 px-4 py-2 rounded-lg text-white text-xs font-bold transition-colors disabled:opacity-60" style="background:#E31E24"><!> </button></div></form></div>'),Xt=g('<div class="rounded-2xl border border-stone-200 bg-white p-12 text-center text-stone-500"><!> <p class="text-sm font-medium text-stone-700 mb-1"> </p> <p class="text-xs text-stone-400 mb-5"> </p> <button type="button" class="inline-flex items-center gap-1.5 px-4 py-2 rounded-lg text-white text-xs font-bold transition-colors" style="background:#E31E24"><!> </button></div>'),zt=g('<span class="text-[10px] px-2 py-0.5 rounded-full bg-emerald-50 text-emerald-700 font-bold border border-emerald-200 shrink-0"> </span>'),Bt=g('<span class="text-[10px] px-2 py-0.5 rounded-full bg-stone-100 text-stone-500 font-bold border border-stone-200 shrink-0"> </span>
1'),Gt=g('<p class="text-xs text-stone-500 mb-2"> </p>'),Jt=g('<span class="text-[11px] text-stone-400"> </span>'),Qt=g('<span class="text-[10px] px-2 py-0.5 rounded-full bg-stone-100 text-stone-600 border border-stone-200 font-medium"> </span>'),Zt=g('· <span class="text-amber-600"> </span>',1),ea=g('<div><div class="flex items-start gap-4"><div class="shrink-0 mt-0.5"><!></div> <div class="flex-1 min-w-0"><div class="flex items-center gap-2 flex-wrap mb-1"><code class="text-xs font-mono text-stone-800 break-all"> </code> <!></div> <!> <div class="flex items-center gap-1.5 flex-wrap"><!></div> <p class="text-[11px] text-stone-400 mt-2"> <!> <!></p></div> <div class="shrink-0 flex items-center gap-2"><form method="POST" action="?/toggle"><input type="hidden" name="webhookId"/> <input type="hidden" name="isActive"/> <button type="submit" class="inline-flex items-center gap-1.5 px-2.5 h-8 rounded-lg border border-stone-200 bg-white hover:bg-stone-50 text-stone-700 text-xs font-medium transition-colors disabled:opacity-50"><!> </button></form> <form method="POST" action="?/delete"><input type="hidden" name="webhookId"/> <button type="submit" class="inline-flex items-center gap-1.5 px-2.5 h-8 rounded-lg text-red-600 hover:bg-red-50 text-xs font-medium transition-colors disabled:opacity-50"><!> </button></form></div></div></div>'),ta=g('<div class="space-y-3"></div>'),aa=g('<a class="inline-flex items-center gap-1.5 text-xs text-stone-500 hover:text-stone-800 mb-4 transition-colors"><!> </a> <div class="flex items-start justify-between mb-6 gap-4"><div><h1 class="text-2xl font-bold text-stone-900 flex items-center gap-2"><!> </h1> <p class="text-sm text-stone-500 mt-1"> </p></div> <button type="button" class="inline-flex items-center gap-1.5 px-3 h-9 rounded-lg text-white text-xs font-bold transition-colors shrink-0" style="background:#E31E24"><!></button></div> <!> <!> <!> <!>',1);function Fa(I,_){wt(_,!0);const l=()=>St(Wt,"$_",et),[et,tt]=It(),m="dashboard.integrationsPage.webhooks",Ne=[{value:"order.created",labelKey:"eventOrderCreated"},{value:"order.status_changed",labelKey:"eventOrderStatusChanged"},{value:"menu.item.availability_changed",labelKey:"eventMenuItemAvailability"},{value:"inventory.changed",labelKey:"eventInventoryChanged"}],Ke=V(()=>{var s;return((s=_.data.integration)==null?void 0:s.providerName)??l()("dashboard.integrationsPage.fallbackName")});let L=A(!1),ee=A(!1),te=A(""),me=A(""),W=A(kt([]));function at(s){f(W,t(W).includes(s)?t(W).filter(n=>n!==s):[...t(W),s],!0)}function Le(){f(te,""),f(me,""),f(W,[],!0),f(L,!1)}$t(()=>{_.form&&_.form.success&&_.form.action==="create"&&Le()});let ue=A(!1),ae=A(null),fe=A(!1);function rt(s){f(ae,s,!0),f(ue,!0)}function st(){var s;f(fe,!0),(s=t(ae))==null||s.requestSubmit(),f(ae,null)}let S=A(null);function Oe(s){if(!s)return"—";const n=new Date(s);return Number.isNaN(n.getTime())?"—":n.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function ot(s){var c;const n=(c=Ne.find(i=>i.value===s))==null?void 0:c.labelKey;return n?l()(`${m}.${n}`):s}var We=aa();Kt("w8r3lh",s=>{Et(n=>{Ft.title=`${n??""} · ${t(Ke)??""} · FoodFlow`},[()=>l()(`${m}.title`)])});var re=Z(We),je=r(re);Ht(je,{class:"w-3.5 h-3.5"});var nt=o(je);a(re);var pe=o(re,2),be=r(pe),xe=r(be),He=r(xe);Be(He,{class:"w-6 h-6 text-stone-700"});var it=o(He);a(xe);var qe=o(xe,2),lt=r(qe,!0);a(qe),a(be);var _e=o(be,2),dt=r(_e);{var vt=s=>{var n=Ze(),c=Z(n);qt(c,{class:"w-3.5 h-3.5"});var i=o(c);h(p=>v(i,` ${p??""}`),[()=>l()("common.cancel")]),x(s,n)},ct=s=>{var n=Ze(),c=Z(n);Ge(c,{class:"w-3.5 h-3.5"});var i=o(c);h(p=>v(i,` ${p??""}`),[()=>l()(`${m}.addEndpoint`)]),x(s,n)};w(dt,s=>{t(L)?s(vt):s(ct,-1)})}a(_e),a(pe);var Me=o(pe,2);{var mt=s=>{var n=Ut(),c=r(n);Mt(c,{class:"w-4 h-4 shrink-0"});var i=o(c);a(n),h(()=>v(i,` ${_.form.error??""}`)),x(s,n)};w(Me,s=>{_.form&&!_.form.success&&_.form.error&&s(mt)})}var Re=o(Me,2);{var ut=s=>{var n=Vt(),c=r(n),i=r(c,!0);a(c);var p=o(c,2),k=r(p),P=r(k),F=r(P);Dt(),a(P);var N=o(P,2);X(N);var j=o(N,2),z=r(j,!0);a(j),a(k);var D=o(k,2),C=r(D),H=r(C),se=o(H),he=r(se,!0);a(se),a(C);var B=o(C,2);X(B),a(D);var G=o(D,2),q=r(G),oe=r(q),M=o(oe),ge=r(M,!0);a(M),a(q);var ne=o(q,2);Ce(ne,21,()=>Ne,Ve,(b,y)=>{var $=Yt(),T=r($);X(T);var K=o(T,2),U=r(K,!0);a(K),a($),h((J,Q)=>{ce(T,t(y).value),Lt(T,J),v(U,Q)},[()=>t(W).includes(t(y).value),()=>l()(`${m}.${t(y).labelKey}`)]),ve("change",T,()=>at(t(y).value)),x(b,$)}),a(ne),a(G);var ie=o(G,2),O=r(ie),le=r(O,!0);a(O);var R=o(O,2),de=r(R);{var ye=b=>{Pe(b,{class:"w-3.5 h-3.5 animate-spin"})};w(de,b=>{t(ee)&&b(ye)})}var we=o(de);a(R),a(ie),a(p),Ae(p,(b,y)=>{var $;return($=Ie)==null?void 0:$(b,y)},()=>()=>(f(ee,!0),async({update:b})=>{await b(),await Se("app:webhooks"),f(ee,!1)})),a(n),h((b,y,$,T,K,U,J,Q,ke,$e,Y)=>{v(i,b),v(F,`${y??""} `),v(z,$),v(H,`${T??""} `),v(he,K),Xe(B,"placeholder",U),v(oe,`${J??""}
1 `),v(ge,Q),v(le,ke),R.disabled=$e,v(we,` ${Y??""}`)},[()=>l()(`${m}.newEndpoint`),()=>l()(`${m}.endpointUrl`),()=>l()(`${m}.httpsHint`),()=>l()("dashboard.common.description"),()=>l()("dashboard.common.optional"),()=>l()(`${m}.descriptionPlaceholder`),()=>l()(`${m}.eventFilters`),()=>l()(`${m}.eventFiltersHint`),()=>l()("common.cancel"),()=>t(ee)||!t(te).trim(),()=>l()(`${m}.saveEndpoint`)]),ze(N,()=>t(te),b=>f(te,b)),ze(B,()=>t(me),b=>f(me,b)),ve("click",O,Le),x(s,n)};w(Re,s=>{t(L)&&s(ut)})}var Ue=o(Re,2);{var ft=s=>{var n=Xt(),c=r(n);Be(c,{class:"w-10 h-10 mx-auto mb-3 text-stone-300"});var i=o(c,2),p=r(i,!0);a(i);var k=o(i,2),P=r(k,!0);a(k);var F=o(k,2),N=r(F);Ge(N,{class:"w-3.5 h-3.5"});var j=o(N);a(F),a(n),h((z,D,C)=>{v(p,z),v(P,D),v(j,` ${C??""}`)},[()=>l()(`${m}.emptyTitle`),()=>l()(`${m}.emptyHint`),()=>l()(`${m}.addEndpoint`)]),ve("click",F,()=>f(L,!0)),x(s,n)},pt=s=>{var n=ta();Ce(n,21,()=>_.data.endpoints??[],c=>c.id,(c,i)=>{const p=V(()=>t(i).isActive);var k=ea(),P=r(k),F=r(P),N=r(F);{var j=e=>{Je(e,{class:"w-4 h-4 text-emerald-500"})},z=e=>{Qe(e,{class:"w-4 h-4 text-stone-300"})};w(N,e=>{t(p)?e(j):e(z,-1)})}a(F);var D=o(F,2),C=r(D),H=r(C),se=r(H,!0);a(H);var he=o(H,2);{var B=e=>{var d=zt(),u=r(d,!0);a(d),h(E=>v(u,E),[()=>l()("dashboard.common.active")]),x(e,d)},G=e=>{var d=Bt(),u=r(d,!0);a(d),h(E=>v(u,E),[()=>l()(`${m}.disabled`)]),x(e,d)};w(he,e=>{t(p)?e(B):e(G,-1)})}a(C);var q=o(C,2);{var oe=e=>{var d=Gt(),u=r(d,!0);a(d),h(()=>v(u,t(i).description)),x(e,d)};w(q,e=>{t(i).description&&e(oe)})}var M=o(q,2),ge=r(M);{var ne=e=>{var d=Jt(),u=r(d,!0);a(d),h(E=>v(u,E),[()=>l()(`${m}.allEvents`)]),x(e,d)},ie=e=>{var d=Ct(),u=Z(d);Ce(u,17,()=>t(i).eventFilters,Ve,(E,Fe)=>{var De=Qt(),gt=r(De,!0);a(De),h(yt=>v(gt,yt),[()=>ot(t(Fe))]),x(E,De)}),x(e,d)};w(ge,e=>{t(i).eventFilters.length===0?e(ne):e(ie,-1)})}a(M);var O=o(M,2),le=r(O),R=o(le);{var de=e=>{var d=Zt(),u=o(Z(d)),E=r(u,!0);a(u),h(Fe=>v(E,Fe),[()=>l()(`${m}.consecutiveFailures`,{values:{count:t(i).consecutiveFailures}})]),x(e,d)};w(R,e=>{t(i).consecutiveFailures>0&&e(de)})}var ye=o(R,2);{var we=e=>{var d=At();h(u=>v(d,`· ${u??""}`),[()=>l()(`${m}.autoDisabled`,{values:{date:Oe(t(i).disabledAt)}})]),x(e,d)};w(ye,e=>{t(i).disabledAt&&!t(p)&&e(we)})}a(O),a(D);var b=o(D,2),y=r(b),$=r(y);X($);var T=o($,2);X(T);var K=o(T,2),U=r(K);{var J=e=>{Pe(e,{class:"w-3 h-3 animate-spin"})},Q=e=>{Qe(e,{class:"w-3 h-3"})},ke=e=>{Je(e,{class:"w-3 h-3"})};w(U,e=>{t(S)===t(i).id?e(J):t(p)?e(Q,1):e(ke,-1)})}var $e=o(U);a(K),a(y),Ae(y,(e,d)=>{var u;return(u=Ie)==null?void 0:u(e,d)},()=>()=>(f(S,t(i).id,!0),async({update:e})=>{await e(),await Se("app:webhooks"),f(S,null)}));var Y=o(y,2),Te=r(Y);X(Te);var Ee=o(Te,2),Ye=r(Ee);{var xt=e=>{Pe(e,{class:"w-3 h-3 animate-spin"})},_t=e=>{Rt(e,{class:"w-3 h-3"})};w(Ye,e=>{t(S)===t(i).id?e(xt):e(_t,-1)})}var ht=o(Ye);a(Ee),a(Y),Ae(Y,(e,d)=>{var u;return(u=Ie)==null?void 0:u(e,d)},()=>()=>(f(S,t(i).id,!0),async({update:e})=>{await e(),await Se("app:webhooks"),f(S,null)})),a(b),a(P),a(k),h((e,d,u,E)=>{Ot(k,1,`rounded-2xl border bg-white p-5 transition-colors ${t(p)?"border-stone-200":"border-stone-100 opacity-75"}`),v(se,t(i).url),v(le,`${e??""} `),ce($,t(i).id),ce(T,d),K.disabled=t(S)===t(i).id,v($e,` ${u??""}`),ce(Te,t(i).id),Ee.disabled=t(S)===t(i).id,v(ht,` ${E??""}`)},[()=>l()(`${m}.added`,{values:{date:Oe(t(i).createdAt)}}),()=>String(!t(p)),()=>t(p)?l()(`${m}.disable`):l()(`${m}.enable`),()=>l()("common.delete")]),Nt("submit",Y,e=>{t(fe)?f(fe,!1):(e.preventDefault(),rt(e.currentTarget))}),x(c,k)}),a(n),x(s,n)};w(Ue,s=>{var n,c;(((n=_.data.endpoints)==null?void 0:n.length)??0)===0&&!t(L)?s(ft):(((c=_.data.endpoints)==null?void 0:c.length)??0)>0&&s(pt,1)})}var bt=o(Ue,2);{let s=V(()=>l()(`${m}.deleteTitle`)),n=V(()=>l()(`${m}.deleteMessage`)),c=V(()=>l()("common.delete")),i=V(()=>l()("common.cancel"));jt(bt,{get title(){return t(s)},get message(){return t(n)},variant:"danger",get confirmText(){return t(c)},get cancelText(){return t(i)},onConfirm:st,onCancel:()=>{f(ae,null)},get open(){return t(ue)},set open(p){f(ue,p,!0)}})}h((s,n,c)=>{var i;Xe(re,"href",`/dashboard/integrations/${((i=_.data.integration)==null?void 0:i.id)??""}`),v(nt,` ${s??""}`),v(it,` ${n??""}`),v(lt,c)},[()=>l()(`${m}.backTo`,{values:{provider:t(Ke)}}),()=>l()(`${m}.endpoints`),()=>l()(`${m}.hint`)]),ve("click",_e,()=>f(L,!t(L))),x(I,We),Tt(),tt()}Pt(["click","change"]);export{Fa as component};
2//# sourceMappingURL=61.5wtmnhwu.js.map

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.