1try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e73e7d28-0c1f-47ea-ad11-4504ecbc94ed",e._sentryDebugIdIdentifier="sentry-dbid-e73e7d28-0c1f-47ea-ad11-4504ecbc94ed")}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6002],{8372:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(45452).A)("move-up",[["path",{d:"M8 6L12 2L16 6",key:"1yvkyx"}],["path",{d:"M12 2V22",key:"r89rzk"}]])},18018:(e,t,n)=>{n.d(t,{p:()=>r});var a=n(35480);n(14932);var s=n(66015);function r(e){let{className:t,type:n,...r}=e;return(0,a.jsx)("input",{type:n,"data-slot":"input",className:(0,s.cn)("border-input file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...r,"data-sentry-component":"Input","data-sentry-source-file":"input.tsx"})}},18050:(e,t,n)=>{n.r(t),n.d(t,{default:()=>C});var a=n(35480),s=n(14932),r=n(66370),i=n(99943),d=n(48182),o=n(91460),l=n(6438),c=n(10832),u=n(18018),m=n(42572),x=n(79326),f=n(21412),p=n(72379),h=n(78615),v=n(45182);let y=h.Ik({name:h.Yj().min(3).max(200),value:h.Yj().min(3).max(2500)});function g(e){let{open:t,setOpen:n,business:i,informationModule:h,maxIndex:g}=e,b=(0,v.c)("settings.dialogs"),j=(0,f.mN)({resolver:(0,x.u)(y),defaultValues:{name:"",value:""}});async function k(e){try{h?await (0,d.O)(i.id,h.id,{...h,name:e.name,value:e.value}):await (0,o.b)(i.id,{id:"",index:g+1,name:e.name,value:e.value,type:"instructions"}),n(!1)}catch(e){p.oR.error(b("saveError"))}}return(0,s.useEffect)(()=>{h&&j.reset({name:h.name,value:h.value})},[h,j]),(0,s.useEffect)(()=>{t||j.reset({name:"",value:""})},[t]),(0,a.jsx)(l.lG,{open:t,onOpenChange:n,"data-sentry-element":"Dialog","data-sentry-component":"InstructionDialogComponent","data-sentry-source-file":"instruction-dialog-component.tsx",children:(0,a.jsxs)(l.Cf,{className:"max-w-[calc(100vw-2rem)] md:max-w-[800px]","data-sentry-element":"DialogContent","data-sentry-source-file":"instruction-dialog-component.tsx",children:[(0,a.jsxs)(l.c7,{"data-sentry-element":"DialogHeader","data-sentry-source-file":"instruction-dialog-component.tsx",children:[(0,a.jsx)(l.L3,{"data-sentry-element":"DialogTitle","data-sentry-source-file":"instruction-dialog-component.tsx",children:h?b("editInstruction"):b("addInstruction")}),(0,a.jsx)(l.rr,{"data-sentry-element":"DialogDescription","data-sentry-source-file":"instruction-dialog-component.tsx"})]}),(0,a.jsx)(c.lV,{...j,"data-sentry-element":"Form","data-sentry-source-file":"instruction-dialog-component.tsx",children:(0,a.jsxs)("form",{onSubmit:j.handleSubmit(k),className:"space-y-2",children:[(0,a.jsx)(c.zB,{control:j.control,name:"name",render:e=>{let{field:t}=e;return(0,a.jsxs)(c.eI,{children:[(0,a.jsx)(c.lR,{children:b("nameLabel")}),(0,a.jsx)(c.MJ,{children:(0,a.jsx)(u.p,{...t})}),(0,a.jsx)(c.C5,{})]})},"data-sentry-element":"FormField","data-sentry-source-file":"instruction-dialog-component.tsx"}),(0,a.jsx)(c.zB,{control:j.control,name:"value",render:e=>{let{field:t}=e;return(0,a.jsxs)(c.eI,{children:[(0,a.jsx)(c.lR,{children:b("descriptionLabel")}),(0,a.jsx)(c.MJ,{children:(0,a.jsx)(m.T,{...t,className:"h-48 md:h-96 resize-none"})}),(0,a.jsx)(c.C5,{})]})},"data-sentry-element":"FormField","data-sentry-source-file":"instruction-dialog-component.tsx"}),(0,a.jsx)("div",{className:"flex flex-row-reverse",children:(0,a.jsx)(r.$,{type:"submit","data-sentry-element":"Button","data-sentry-source-file":"instruction-dialog-component.tsx",children:h?b("edit"):b("add")})})]})})]})})}var b=n(44669),j=n(31611),k=n(8372),w=n(18921),z=n(98182),N=n(44180),M=n(58296);function C(e){let{business:t,informationModules:n,updateInformationModules:o}=e,l=(0,v.c)("settings.tabs.instructions"),c=(0,v.c)("common"),[u,m]=(0,s.use
1State)(!1),[x,f]=(0,s.useState)(),[h,y]=(0,s.useState)(),[C,I]=(0,s.useState)(0),[A,D]=(0,s.useState)(0),S=(0,s.useRef)({request:async()=>!1});async function L(){try{await S.current.request()&&(await (0,i.o)(t.id,x.id),f(void 0),o())}catch(e){p.oR.error(l("deleteError"))}}async function R(e,a){let s=n.filter(e=>"instructions"==e.type).sort((e,t)=>e.index-t.index),r=s.findIndex(t=>t.id==e.id),i=s["up"==a?r-1:r+1];await (0,d.O)(t.id,e.id,{...e,index:i.index}),await (0,d.O)(t.id,i.id,{...i,index:e.index}),o()}return(0,s.useEffect)(()=>{let e=n.filter(e=>"instructions"==e.type).sort((e,t)=>e.index-t.index);e.length>0&&(I(e[0].index),D(e[e.length-1].index));let a=-1;for(let n of e)n.index==a?((0,d.O)(t.id,n.id,{...n,index:A+1}),o()):a=n.index;if(x){let e=n.find(e=>e.id==x.id);e?f(e):f(void 0)}},[n]),(0,s.useEffect)(()=>{u||(y(void 0),o())},[u]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(b.A,{ref:S,"data-sentry-element":"DeleteDialogComponent","data-sentry-source-file":"instructions-tab-component.tsx"}),(0,a.jsx)(g,{business:t,open:u,setOpen:m,maxIndex:A,informationModule:h,"data-sentry-element":"InstructionDialogComponent","data-sentry-source-file":"instructions-tab-component.tsx"}),(0,a.jsxs)(M.Zp,{"data-sentry-element":"Card","data-sentry-source-file":"instructions-tab-component.tsx",children:[(0,a.jsx)(M.aR,{"data-sentry-element":"CardHeader","data-sentry-source-file":"instructions-tab-component.tsx",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(M.ZB,{"data-sentry-element":"CardTitle","data-sentry-source-file":"instructions-tab-component.tsx",children:l("title")}),(0,a.jsx)(M.BT,{"data-sentry-element":"CardDescription","data-sentry-source-file":"instructions-tab-component.tsx",children:l("description")})]}),(0,a.jsxs)(r.$,{size:"sm",onClick:()=>m(!0),"data-sentry-element":"Button","data-sentry-source-file":"instructions-tab-component.tsx",children:[(0,a.jsx)(j.A,{className:"size-4 mr-1","data-sentry-element":"Plus","data-sentry-source-file":"instructions-tab-component.tsx"}),l("add")]})]})}),(0,a.jsx)(M.Wu,{"data-sentry-element":"CardContent","data-sentry-source-file":"instructions-tab-component.tsx",children:0===n.length?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-10 text-gray-400",children:[(0,a.jsx)("svg",{className:"size-10 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 6.75h12M8.25 12h12m-12 5.25h12M3.75 6.75h.007v.008H3.75V6.75zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zM3.75 12h.007v.008H3.75V12zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm-.375 5.25h.007v.008H3.75v-.008zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"})}),(0,a.jsx)("p",{className:"mt-2 text-sm",children:l("noInstructions")}),(0,a.jsx)(r.$,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>m(!0),children:l("addFirst")})]}):(0,a.jsxs)("div",{className:"flex flex-col md:flex-row gap-3 min-h-[300px]",children:[(0,a.jsx)("div",{className:"w-full md:w-64 md:shrink-0 space-y-1 overflow-y-auto max-h-[200px] md:max-h-[400px] border rounded-lg p-1.5",children:n.sort((e,t)=>e.index-t.index).map(e=>(0,a.jsx)("div",{className:"p-2 rounded-lg text-sm font-medium truncate cursor-pointer transition-colors ".concat((null==x?void 0:x.id)===e.id?"bg-blue-50 text-blue-700 border border-blue-200":"text-gray-600 hover:bg-gray-50"),onClick:()=>f(e),children:e.name},e.id))}),x?(0,a.jsxs)("div",{className:"flex-1 border rounded-lg p-4 overflow-y-auto max-h-[400px]",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5 mb-3 justify-end",children:[x.index!=C&&(0,a.jsx)(r.$,{size:"icon",variant:"ghost",className:"size-8","aria-label":"Mover arriba",onClick:()=>R(x,"up"),children:(0,a.jsx)(k.A,{className:"size-4"})}),x.index!=A&&(0,a.jsx)(r.$,{size:"icon",variant:"ghost",className:"size-8","aria-label":"Mover abajo",onClick:()=>R(x,"down"),children:(0,a.jsx)(w.A,{className:"size-4"})}),(0,a.jsx)(r.$,{size:"icon",variant:"ghost",className:"size-8","aria-label":c("edit"),onClick:()=>{y(x),m(!0)},children:(0,a.jsx)(z.A,{className:"size-4"})}),(0,a.jsx)(r.$,{size:"icon",variant:"ghost",className:"size-8 text-red-500 hover:text-red-700","aria-label":c("delete"),onClick:()=>L(),children:(0,a.jsx)(N.A,{className:"size-4"})})]}),(0,a.jsx)("p",{className:"text-xs font-medium text-gray-500 uppercase tracking-wide",children:l("nameLabel")}
1),(0,a.jsx)("p",{className:"text-sm text-gray-800 mb-3",children:x.name}),(0,a.jsx)("p",{className:"text-xs font-medium text-gray-500 uppercase tracking-wide",children:l("contentLabel")}),(0,a.jsx)("p",{className:"text-sm text-gray-700 whitespace-pre-wrap",children:x.value})]}):(0,a.jsx)("div",{className:"flex-1 flex items-center justify-center border rounded-lg text-gray-400 text-sm",children:l("selectToView")})]})})]})]})}},18921:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(45452).A)("move-down",[["path",{d:"M8 18L12 22L16 18",key:"cskvfv"}],["path",{d:"M12 2V22",key:"r89rzk"}]])},22977:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(45452).A)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},31611:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(45452).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},44180:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(45452).A)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]])},48182:(e,t,n)=>{n.d(t,{O:()=>s});var a=n(12151);let s=(0,a.createServerReference)("70f59b87a309f574f260098a28220e8488920480b3",a.callServer,void 0,a.findSourceMapURL,"updateInformationModule")},66370:(e,t,n)=>{n.d(t,{$:()=>o,r:()=>d});var a=n(35480);n(14932);var s=n(60712),r=n(36325),i=n(66015);let d=(0,r.F)("inline-flex items-center hover:cursor-pointer justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",outline:"border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:" h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function o(e){let{className:t,variant:n,size:r,asChild:o=!1,...l}=e,c=o?s.DX:"button";return(0,a.jsx)(c,{"data-slot":"button",className:(0,i.cn)(d({variant:n,size:r,className:t})),...l,"data-sentry-element":"Comp","data-sentry-component":"Button","data-sentry-source-file":"button.tsx"})}},91460:(e,t,n)=>{n.d(t,{b:()=>s});var a=n(12151);let s=(0,a.createServerReference)("60aac43cdeee8d53af06227388ec413cbce30f4239",a.callServer,void 0,a.findSourceMapURL,"createInformationModule")},98182:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(45452).A)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},99943:(e,t,n)=>{n.d(t,{o:()=>s});var a=n(12151);let s=(0,a.createServerReference)("607cceac0a5e7047b166f8e464dac62ddf385790a7",a.callServer,void 0,a.findSourceMapURL,"deleteInformationModule")}}]);
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.