"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1616],{6344:(e,a,s)=>{s.r(a),s.d(a,{default:()=>u});var l=s(95155);s(12115);var r=s(73312),t=s(77995),d=s(13261),n=s(14057);let i=(0,n.A)("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);var c=s(76426),h=s(689),o=s(48070),x=s(35524);let m=(0,n.A)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),u=e=>{let{questions:a,selectedQuestionId:s,onSelectQuestion:n,drawMode:u,onSetDrawMode:f,onSaveSegment:p,onCancel:v,onDeleteLastSegment:j,canSave:y,canDelete:g}=e,N=a.find(e=>e.id===s);return(0,l.jsxs)("div",{className:"flex h-full flex-col",children:[(0,l.jsxs)("div",{className:"flex-1 overflow-hidden",children:[(0,l.jsx)("h3",{className:"mb-2 text-lg font-semibold",children:"Preguntas"}),(0,l.jsx)(t.F,{className:"h-[calc(100%-40px)] pr-4",children:(0,l.jsx)("div",{className:"space-y-1",children:a.map(e=>(0,l.jsxs)(r.$,{variant:s===e.id?"secondary":"ghost",className:"w-full justify-start gap-2",onClick:()=>n(e.id),children:[e.segments.length>0?(0,l.jsx)(d.A,{className:"h-4 w-4 text-green-500"}):(0,l.jsx)(i,{className:"h-4 w-4 text-muted-foreground"}),"Pregunta ",e.number]},e.id))})})]}),(0,l.jsx)("div",{className:"mt-4 border-t pt-4",children:N?(0,l.jsxs)("div",{className:"space-y-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsxs)("h4",{className:"font-semibold",children:["Pregunta: ",N.number]}),(0,l.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Segmentos guardados: ",N.segments.length]})]}),u?(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,l.jsxs)(r.$,{onClick:p,disabled:!y,children:[(0,l.jsx)(c.A,{className:"mr-2 h-4 w-4"})," Guardar"]}),(0,l.jsxs)(r.$,{variant:"outline",onClick:v,children:[(0,l.jsx)(h.A,{className:"mr-2 h-4 w-4"})," Cancelar"]})]}):(0,l.jsxs)(r.$,{className:"w-full",onClick:()=>f(!0),children:[(0,l.jsx)(o.A,{className:"mr-2 h-4 w-4"})," Marcar segmento"]}),(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,l.jsxs)(r.$,{variant:"destructive",onClick:j,disabled:!g,children:[(0,l.jsx)(x.A,{className:"mr-2 h-4 w-4"})," Borrar \xfaltimo"]}),(0,l.jsxs)(r.$,{variant:"outline",onClick:()=>{let e=a.findIndex(e=>e.id===s);e>-1&&e<a.length-1&&n(a[e+1].id)},children:["Siguiente ",(0,l.jsx)(m,{className:"ml-2 h-4 w-4"})]})]})]}):(0,l.jsx)("div",{className:"text-center text-muted-foreground",children:"Selecciona una pregunta de la lista."})})]})}},77995:(e,a,s)=>{s.d(a,{F:()=>n});var l=s(95155),r=s(12115),t=s(21868),d=s(21567);let n=r.forwardRef((e,a)=>{let{className:s,children:r,...n}=e;return(0,l.jsxs)(t.bL,{ref:a,className:(0,d.cn)("relative overflow-hidden",s),...n,children:[(0,l.jsx)(t.LM,{className:"h-full w-full rounded-[inherit]",children:r}),(0,l.jsx)(i,{}),(0,l.jsx)(t.OK,{})]})});n.displayName=t.bL.displayName;let i=r.forwardRef((e,a)=>{let{className:s,orientation:r="vertical",...n}=e;return(0,l.jsx)(t.VM,{ref:a,orientation:r,className:(0,d.cn)("flex touch-none select-none transition-colors","vertical"===r&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===r&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",s),...n,children:(0,l.jsx)(t.lr,{className:"relative flex-1 rounded-full bg-border"})})});i.displayName=t.VM.displayName},61786:(e,a,s)=>{s.d(a,{q:()=>l});function l(e,[a,s]){return Math.min(s,Math.max(a,e))}},41524:(e,a,s)=>{s.d(a,{c:()=>r});var l=s(12115);function r(e){let a=l.useRef(e);return l.useEffect(()=>{a.current=e}),l.useMemo(()=>(...e)=>a.current?.(...e),[])}},13261:(e,a,s)=>{s.d(a,{A:()=>l});let l=(0,s(14057).A)("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},76426:(e,a,s)=>{s.d(a,{A:()=>l});let l=(0,s(14057).A)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},48070:(e,a,s)=>{s.d(a,{A:()=>l});let l=(0,s(14057).A)("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]])},35524:(e,a,s)=>{s.d(a,{A:()=>l});let l=(0,s(14057).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},689:(e,a,s)=>{s.d(a,{A:()=>l});let l=(0,s(14057).A)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])}}]);