quantum-component-library 1.4.47-dev.8 → 1.4.47-dev.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./react-jsx-runtime-vendor-Dszzpdy0.cjs"),t=require("@chakra-ui/react"),r=require("react"),ge=require("./ufuzzy-vendor-7qHa_k39.cjs"),X=require("./react-select-vendor-D_Q2fL5j.cjs"),de=require("./react-icons-vendor-D2s8zw9h.cjs"),Q=require("./graphql-vendor-B-QTAQSb.cjs"),$=require("./generated.cjs"),y=require("./graphql-C6M9oyU0.cjs"),le=require("./react-dnd-vendor-BPzSDojS.cjs"),F=require("./generated-graphql.cjs"),K=require("./services.cjs"),oe=require("./types.cjs"),re=require("./utils.cjs"),Ee=require("./hooks.cjs"),Re=({setSearch:o,actions:n,updateUseCases:l,hideUseCaseFilter:d=!1})=>{const m=r.useMemo(()=>n?.flatMap(c=>c.useCases).filter((c,x,f)=>f.findIndex(i=>i.id===c.id)===x).map(c=>({label:c.name,value:c.id}))||[],[n]);return e.jsxRuntimeExports.jsxs(t.Flex,{width:"100%",alignContent:"space-evenly",gap:4,children:[e.jsxRuntimeExports.jsxs(t.InputGroup,{size:"md",flex:1,children:[e.jsxRuntimeExports.jsx(t.InputLeftElement,{children:e.jsxRuntimeExports.jsx(t.Icon,{as:de.FaSearch,color:"gray.300"})}),e.jsxRuntimeExports.jsx(t.Input,{placeholder:"Search by name...",width:"100%",maxW:d?void 0:"30rem",onChange:c=>o(c.target.value)})]}),!d&&e.jsxRuntimeExports.jsx(t.InputGroup,{size:"md",children:e.jsxRuntimeExports.jsx(X.st,{size:"md",chakraStyles:{container:c=>({...c,width:"100%"})},menuPortalTarget:document.body,placeholder:"Filter use case",isMulti:!0,options:m,onChange:c=>l(c.map(x=>x.value))})})]})},Z=({children:o})=>e.jsxRuntimeExports.jsx(t.FormLabel,{fontWeight:"bold",fontFamily:"sans-serif",fontSize:"large",children:o}),fe=({value:o,onChange:n})=>{const l=r.useState(()=>Math.random().toString(36).substring(2,15))[0],d=r.useCallback((m,c)=>{n(x=>{const f=[...x],[i]=f.splice(m,1);return f.splice(c,0,i),f})},[n]);return e.jsxRuntimeExports.jsx(t.Box,{children:e.jsxRuntimeExports.jsx(le.DndProvider,{backend:le.HTML5Backend,children:e.jsxRuntimeExports.jsx(t.TableContainer,{children:e.jsxRuntimeExports.jsxs(t.Table,{variant:"simple",size:"md",children:[e.jsxRuntimeExports.jsx(t.Thead,{children:e.jsxRuntimeExports.jsxs(t.Tr,{children:[e.jsxRuntimeExports.jsx(t.Th,{children:"Order"}),e.jsxRuntimeExports.jsx(t.Th,{children:"Name"})]})}),e.jsxRuntimeExports.jsx(t.Tbody,{children:o.map((m,c)=>e.jsxRuntimeExports.jsx(be,{listKey:l,index:c,id:m.id,name:m.name,move:d},m.id))})]})})})})},be=({listKey:o,index:n,id:l,name:d,move:m})=>{const c=r.useRef(null),[{handlerId:x},f]=le.useDrop({accept:o,collect:p=>({handlerId:p.getHandlerId()?.toString()??""}),hover:(p,S)=>{if(!c.current)return;const a=p.index,u=n;if(a===u)return;const j=c.current?.getBoundingClientRect(),g=(j.bottom-j.top)/2,C=S.getClientOffset().y-j.top;a<u&&C<g||a>u&&C>g||(m(a,u),p.index=u)}}),[{isDragging:i},N]=le.useDrag({type:o,item:()=>({id:l,index:n}),collect:p=>({isDragging:p.isDragging()})}),E=i?.6:1,M=i?"grabbing":"grab";return N(f(c)),e.jsxRuntimeExports.jsxs(t.Tr,{ref:c,style:{opacity:E,cursor:M},"data-handler-id":x,children:[e.jsxRuntimeExports.jsx(t.Td,{children:n+1}),e.jsxRuntimeExports.jsx(t.Td,{children:d})]})},ve=({items:o,onChange:n,selectedItem:l,isDisabled:d,selectedProps:m,buttonProps:c})=>{const x=i=>i===l||i.value===l,f=i=>x(i)?{...c,...m}:c;return e.jsxRuntimeExports.jsx(t.ButtonGroup,{isAttached:!0,isDisabled:d,children:o.map((i,N)=>e.jsxRuntimeExports.jsx(t.Tooltip,{label:i.tooltip,openDelay:50,closeDelay:200,placement:"top",visibility:i.tooltip?"visible":"hidden",hasArrow:!0,children:e.jsxRuntimeExports.jsx(t.Button,{onClick:()=>x(i)?null:n(i,N),isDisabled:i.disabled,...f(i),children:i.label})},N))})},ie=(o,n)=>n<0?-1*Math.abs(o):Math.abs(o),ye=({isReversed:o,min:n,max:l,value:d,onChange:m,inputProps:c,size:x,zeroMarker:f,formatValue:i,valueLabel:N,positiveNegativeLabels:E,isDisabled:M,...p})=>{const[S,a]=r.useState([void 0,void 0]),u=S[0],j=S[1],g=f&&n<-5&&l>5,b=Number(d?.[0]??j??n)>0?1:-1,C=Number(d?.[1]??j??l)<0?-1:1,z=E?.[0]===E?.[1],D=d?.[0],A=d?.[1];r.useEffect(()=>{D!==void 0&&A!==void 0&&a([D.toFixed(0),A.toFixed(0)])},[D,A,a]);const L=r.useCallback(([v,G])=>{v<G&&a([v.toFixed(0),G.toFixed(0)])},[a]),_=r.useCallback(([v,G])=>{v<G&&m([v,G])},[m]),P=r.useCallback(()=>{a(([v,G])=>{const J=isNaN(Number(v))?n:Number(v),s=isNaN(Number(G))?l:Number(G),h=ie(Number(J),b),T=ie(Number(s),C),I=b<0?Math.max(h,n):Math.min(h,l),B=C<0?Math.max(T,n):Math.min(T,l);return I>B?(m([B,I]),[B.toFixed(0),I.toFixed(0)]):(m([I,B]),[I.toFixed(0),B.toFixed(0)])})},[m,a,b,C,n,l]),R=r.useCallback(v=>{const G=v===""||isNaN(Number(v))?v:ie(Number(v),b);a(([J,s])=>[G.toString(),s])},[a,b]),w=r.useCallback(v=>{const G=v===""||isNaN(Number(v))?v:ie(Number(v),C);a(([J,s])=>[J,G.toString()])},[a,C]),k=r.useMemo(()=>x==="xs"?"0.75rem":void 0,[x]),H=r.useCallback((v,G)=>{const J=Number(G.target.value);if(!u||!j||![-1,1].includes(J))return;const s=I=>J<0?-1*Math.abs(I):Math.abs(I),h=v?s(Number(u)):Number(u),T=v?Number(j):s(Number(j));h>T?m([T,h]):m([h,T])},[u,j,m]);return e.jsxRuntimeExports.jsxs(t.Flex,{direction:"column",...p,children:[e.jsxRuntimeExports.jsx(t.Box,{pt:"1em",mb:"-0.5em",children:e.jsxRuntimeExports.jsxs(t.RangeSlider,{"aria-label":["min","max"],isReversed:o,value:[Number(u??n),Number(j??l)],max:l,min:n,minStepsBetweenThumbs:3,step:1,onChange:L,onChangeEnd:_,isDisabled:M,children:[e.jsxRuntimeExports.jsx(t.RangeSliderMark,{value:n,top:"-1em",children:e.jsxRuntimeExports.jsx(t.Text,{fontSize:x??"sm",fontWeight:"semibold",whiteSpace:"nowrap",children:i?i?.(n):n})}),e.jsxRuntimeExports.jsx(t.RangeSliderMark,{value:l,top:"-1em",children:e.jsxRuntimeExports.jsx(t.Text,{fontSize:x??"sm",fontWeight:"semibold",style:{transform:"translateX(-100%)"},whiteSpace:"nowrap",children:i?i(l):l})}),g&&e.jsxRuntimeExports.jsxs(t.RangeSliderMark,{value:0,top:"-1em",pos:"relative",children:[e.jsxRuntimeExports.jsx(t.Text,{fontSize:x,fontWeight:"semibold",children:i?.(0)??"0"}),e.jsxRuntimeExports.jsx(t.Box,{position:"absolute",width:"2px",height:"1em",top:"90%",left:"20%",backgroundColor:"var(--chakra-colors-gray-300)"})]}),e.jsxRuntimeExports.jsx(t.RangeSliderTrack,{children:e.jsxRuntimeExports.jsx(t.RangeSliderFilledTrack,{})}),e.jsxRuntimeExports.jsx(t.RangeSliderThumb,{index:0,w:k,h:k}),e.jsxRuntimeExports.jsx(t.RangeSliderThumb,{index:1,w:k,h:k})]})}),N&&e.jsxRuntimeExports.jsxs(t.Flex,{direction:o?"row-reverse":"row",justifyContent:"space-between",children:[e.jsxRuntimeExports.jsx(t.Text,{fontSize:x??"sm",fontWeight:"semibold",whiteSpace:"nowrap",children:N(n)}),e.jsxRuntimeExports.jsx(t.Text,{fontSize:x??"sm",fontWeight:"semibold",whiteSpace:"nowrap",children:N(l)})]}),e.jsxRuntimeExports.jsxs(t.Flex,{direction:o?"row-reverse":"row",justifyContent:"center",alignItems:"center",gap:"0.125em",children:[E&&e.jsxRuntimeExports.jsxs(t.Select,{width:"auto",size:x,fontWeight:"bold",value:b,onChange:v=>H(!0,v),isDisabled:z||M,children:[e.jsxRuntimeExports.jsx("option",{value:-1,children:E[0]}),e.jsxRuntimeExports.jsx("option",{value:1,children:E[1]})]}),e.jsxRuntimeExports.jsx(t.NumberInput,{precision:0,size:x??"sm",min:0,max:b<0?Math.abs(n):A??l,value:u===""?"":Math.abs(Number(u??n)),onChange:R,onBlur:P,borderWidth:1,borderRadius:3,borderColor:"#ccc",isDisabled:M,...c,children:e.jsxRuntimeExports.jsx(t.NumberInputField,{backgroundColor:"#fff",paddingRight:0,width:"4em"})}),e.jsxRuntimeExports.jsx(t.NumberInput,{size:x??"sm",min:0,max:C<0?Math.abs(D??n):l,precision:0,value:j===""?"":Math.abs(Number(j??l)),onChange:w,onBlur:P,borderWidth:1,borderRadius:3,borderColor:"#ccc",isDisabled:M,...c,children:e.jsxRuntimeExports.jsx(t.NumberInputField,{backgroundColor:"#fff",paddingRight:0,width:"4em"})}),E&&e.jsxRuntimeExports.jsxs(t.Select,{width:"auto",size:x,fontWeight:"bold",value:C,onChange:v=>H(!1,v),isDisabled:z||M,children:[e.jsxRuntimeExports.jsx("option",{value:-1,children:E[0]}),e.jsxRuntimeExports.jsx("option",{value:1,children:E[1]})]})]})]})},Ce=({tags:o,containerProps:n,...l})=>e.jsxRuntimeExports.jsx(t.HStack,{...n,children:o.map((d,m)=>e.jsxRuntimeExports.jsx(t.Tag,{...l,children:d},m))}),Te=new ge.uFuzzy({}),Se=({action:o,quantumIconSrc:n})=>o.quantumOwned?e.jsxRuntimeExports.jsx(t.Tooltip,{label:"This activity is owned by Quantum","aria-label":"Quantum owned",children:e.jsxRuntimeExports.jsx(t.Image,{src:n,alt:"Quantum owned",boxSize:"16px",display:"inline-block",ml:2,verticalAlign:"middle"})}):null,Me=(o,n)=>{if(!n||!n.trim().length)return o;const l=o.map(m=>m.name??"");return Te.filter(l,n)?.map(m=>o[m])??[]},Ae=o=>!o||o.length===0?"None":o.map(n=>n.replace(/([A-Z])/g," $1").trim()).join(", "),we=(o,n)=>!n||n.length==0?o:o.filter(l=>l.useCases.some(d=>n.includes(d.id))),xe=({actions:o,totalActions:n,onCreate:l,onDelete:d,onEdit:m,onView:c,onSelected:x,onDuplicate:f,disableMultiSelect:i,disableDelete:N,disableEdit:E,disableCreate:M,hideUseCase:p=!0,tableProps:S,containerProps:a,quantumIconSrc:u="/favicon.ico"})=>{const[j,g]=r.useState(""),[b,C]=r.useState(),z=r.useMemo(()=>{if(!o)return;const R=Me(o,j);return p?R:we(R,b)},[o,j,b,p]),D=r.useCallback(()=>{if(!d)return;const w=o.filter(k=>k.selected&&!k.quantumOwned).map(k=>k.id);d(w)},[o,d]),A=r.useCallback(()=>{if(!f)return;const R=o.filter(w=>w.selected);f(R.map(w=>w.id)),x&&R.forEach(w=>x(w,!1))},[o,f,x]),L=r.useMemo(()=>o.some(R=>R.selected&&!R.quantumOwned),[o]),_=r.useMemo(()=>o.some(R=>R.selected),[o]),P=r.useMemo(()=>o.some(R=>R.selected&&R.quantumOwned),[o]);return e.jsxRuntimeExports.jsxs(t.Box,{...a,children:[e.jsxRuntimeExports.jsxs(t.Flex,{alignContent:"space-between",gap:4,children:[(l||d||f)&&e.jsxRuntimeExports.jsxs(t.ButtonGroup,{mb:"1rem",gap:4,children:[l&&e.jsxRuntimeExports.jsx(t.Button,{isDisabled:!l||M,colorScheme:"blackAlpha",backgroundColor:"gray.700",onClick:l,children:"Create New Activity"}),d&&!i&&e.jsxRuntimeExports.jsx(t.Tooltip,{label:P?L?"Quantum-owned activities are selected and will be skipped":"Selected activities are quantum-owned and cannot be deleted":void 0,children:e.jsxRuntimeExports.jsx(t.Button,{colorScheme:"gray",isDisabled:!L||!d||N,onClick:D,children:"Delete Selected"})}),f&&!i&&e.jsxRuntimeExports.jsx(t.Button,{colorScheme:"gray",isDisabled:!_,onClick:A,children:"Duplicate Selected"})]}),e.jsxRuntimeExports.jsx(Re,{setSearch:g,actions:o,updateUseCases:C,hideUseCaseFilter:p})]}),e.jsxRuntimeExports.jsx(t.TableContainer,{mr:"2rem",overflowX:"hidden",...S,children:e.jsxRuntimeExports.jsxs(t.Table,{size:"md",variant:"simple",children:[e.jsxRuntimeExports.jsx(t.Thead,{position:"sticky",top:0,bg:"white",zIndex:1,children:e.jsxRuntimeExports.jsxs(t.Tr,{children:[e.jsxRuntimeExports.jsxs(t.Th,{fontWeight:"normal",children:["(showing ",z?.length??0," of"," ",n??o.length,")"]}),e.jsxRuntimeExports.jsx(t.Th,{children:"Name"}),e.jsxRuntimeExports.jsx(t.Th,{children:"Sensor Locations"}),!p&&e.jsxRuntimeExports.jsx(t.Th,{children:"Use Case"}),e.jsxRuntimeExports.jsx(t.Th,{})]})}),e.jsxRuntimeExports.jsx(t.Tbody,{children:z?.map(R=>e.jsxRuntimeExports.jsxs(t.Tr,{title:i&&R.selected?"This activity is selected. Click it again to deselect.":void 0,bg:i&&R.selected?"gray.200":void 0,_hover:{bg:i&&!R.selected?"#f7f7f7":void 0},cursor:i?"pointer":"default",onClick:()=>i?x?.(R,!R.selected):void 0,children:[e.jsxRuntimeExports.jsx(t.Td,{children:e.jsxRuntimeExports.jsxs(t.Flex,{children:[x&&!i&&e.jsxRuntimeExports.jsx(t.Checkbox,{isChecked:R.selected,onChange:w=>x(R,w.target.checked)}),(R.quantumOwned||!m)&&c&&e.jsxRuntimeExports.jsx(t.Button,{ml:"1em",size:"sm",variant:"link",colorScheme:"blue",onClick:()=>c(R.id),children:"View"}),!R.quantumOwned&&m&&e.jsxRuntimeExports.jsx(t.Button,{disabled:E,ml:"1em",size:"sm",variant:"link",colorScheme:"blue",onClick:()=>m(R.id),children:"Edit"})]})}),e.jsxRuntimeExports.jsx(t.Td,{whiteSpace:"break-spaces",children:e.jsxRuntimeExports.jsxs(t.Flex,{align:"center",gap:2,children:[e.jsxRuntimeExports.jsx(Se,{action:R,quantumIconSrc:u}),R.name]})}),e.jsxRuntimeExports.jsx(t.Td,{maxW:"20rem",whiteSpace:"break-spaces",children:Ae(R.sensorLocations)}),!p&&e.jsxRuntimeExports.jsx(t.Td,{maxW:"20rem",children:e.jsxRuntimeExports.jsx(Ce,{containerProps:{flexWrap:"wrap"},tags:R.useCases?.map(w=>w.name)??[]})})]},R.id))})]})})]})},Oe=({onSave:o,onCancel:n,onError:l,hideButtons:d=!1,setButtonDisabled:m,setButtonOnClick:c,quantumOwned:x})=>{const f=t.useToast(),[i,N]=r.useState("copy"),[E,M]=r.useState(""),[p,S]=r.useState([]),[a,u]=r.useState(!1),[j]=Q.useQuery({query:y.GET_GROUPS}),[g]=Q.useQuery({query:y.GET_ACTIONS_BY_GROUP,variables:{groupId:E},pause:!E}),[,b]=Q.useMutation(y.CREATE_ACTION),[,C]=Q.useMutation(y.CONVERT_ACTION_TO_QUANTUM_OWNED),z=r.useMemo(()=>j.data?.groups?j.data.groups.map(s=>$.getFragmentData(y.GROUP_FRAGMENT,s)):[],[j.data]),D=r.useMemo(()=>g.data?g.data.actions.map(h=>$.getFragmentData(y.ACTION_FRAGMENT,h)):[],[g.data]),A=r.useMemo(()=>D.filter(s=>p.includes(s.id)),[D,p]),L=r.useCallback(s=>{const h=s?.value||"";M(h),S([])},[]),_=r.useCallback(s=>{const h=s.map(T=>T.value);S(h)},[]),P=r.useCallback(async s=>{const h=$.getFragmentData(y.MODULE_CATEGORY_FRAGMENT,s.categories),T={...s,name:`${s.name} (Copy)`,description:s.description||void 0,instructionsPointOfInterest:s.instructionsPointOfInterest||void 0,instructionsMovementReport:s.instructionsMovementReport||void 0,laterality:s.laterality,activityKind:s.activityKind,sensorLocations:s.sensorLocations,thresholds:s.thresholds.map(B=>({...B,id:void 0})),categories:h?.map(B=>B.id),quantumOwned:x,id:void 0},I=await b({fields:T});if(I.error)throw new Error(I.error.message);if(I.data?.createAction)return $.getFragmentData(y.ACTION_FRAGMENT,I.data.createAction);throw new Error("No action data returned")},[b,x]),R=r.useCallback(async s=>{const h=await C({id:s.id});if(h.error)throw new Error(h.error.message);if(h.data?.convertActionToQuantumOwned)return $.getFragmentData(y.ACTION_FRAGMENT,h.data.convertActionToQuantumOwned);throw new Error("No action data returned")},[C]),w=r.useCallback(async()=>{if(u(!0),!A.length){const s=new Error(`No activities selected for ${i==="copy"?"copying":"converting"}`);l?.(s),u(!1);return}try{const s=[];let h=0;const T=i==="copy"?P:R,I=i==="copy"?"copy":"convert";for(const B of A)try{const U=await T(B);s.push(U)}catch(U){console.error(`Failed to ${I} activity "${B.name}":`,U),h++}if(s.length>0){const B=s.length,U=A.length,Y=i==="copy"?"copied":"converted",q=i==="copy"?"copy":"convert";f({title:h>0?`Partial ${q} completed`:`Activities ${Y} successfully`,description:h>0?`${B} of ${U} activities ${Y} successfully`:`${B} activit${B>1?"ies":"y"} ${Y} successfully`,status:h>0?"warning":"success",duration:3e3,isClosable:!0}),o?.(),M(""),S([])}else throw new Error(`Failed to ${I} any activities`)}catch(s){const h=i==="copy"?"copy":"convert",T=s instanceof Error?s.message:`Failed to ${h} activities`;f({title:`${i==="copy"?"Copy":"Convert"} failed`,description:T,status:"error",duration:5e3,isClosable:!0}),l?.(s instanceof Error?s:new Error(T))}finally{u(!1)}},[A,i,P,R,f,o,l]),k=r.useCallback(()=>{M(""),S([]),N("copy"),n?.()},[n]);r.useEffect(()=>{m&&m({cancelButton:!1,saveButton:A.length===0||a})},[A.length,a,m]),r.useEffect(()=>{c&&c({cancelButton:k,saveButton:w})},[c,k,w]);const H=r.useMemo(()=>z.map(s=>({value:s.id,label:s.name})),[z]),v=r.useMemo(()=>D.filter(s=>i==="copy"?!0:!s.quantumOwned).map(s=>({value:s.id,label:s.name,isQuantumOwned:s.quantumOwned})),[D,i]),G=j.fetching,J=g.fetching;return e.jsxRuntimeExports.jsx(t.Box,{children:e.jsxRuntimeExports.jsxs(t.VStack,{spacing:6,align:"stretch",children:[x&&e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(Z,{children:"Operation Mode"}),e.jsxRuntimeExports.jsx(t.RadioGroup,{value:i,onChange:s=>{N(s),S([])},children:e.jsxRuntimeExports.jsxs(t.HStack,{spacing:6,children:[e.jsxRuntimeExports.jsx(t.Radio,{value:"copy",colorScheme:"blue",children:e.jsxRuntimeExports.jsxs(t.VStack,{align:"start",spacing:1,children:[e.jsxRuntimeExports.jsx(t.Text,{fontWeight:"medium",children:"Copy Activities"}),e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.600",children:"Create new activities based on selected ones"})]})}),e.jsxRuntimeExports.jsx(t.Radio,{value:"convert",colorScheme:"green",children:e.jsxRuntimeExports.jsxs(t.VStack,{align:"start",spacing:1,children:[e.jsxRuntimeExports.jsx(t.Text,{fontWeight:"medium",children:"Convert to Quantum Owned"}),e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.600",children:"Convert existing activities to quantum-owned"})]})})]})})]}),e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(Z,{children:"Select Source Group"}),e.jsxRuntimeExports.jsx(X.st,{placeholder:"Choose a group...",options:H,value:H.find(s=>s.value===E)||null,onChange:L,isLoading:G,isDisabled:G,isClearable:!0}),j.error&&e.jsxRuntimeExports.jsxs(t.Alert,{status:"error",mt:2,children:[e.jsxRuntimeExports.jsx(t.AlertIcon,{}),e.jsxRuntimeExports.jsxs(t.Text,{fontSize:"sm",children:["Failed to load groups: ",j.error.message]})]})]}),E&&e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsxs(Z,{children:["Select Activities to"," ",i==="copy"?"Copy":"Convert"]}),J?e.jsxRuntimeExports.jsxs(t.HStack,{children:[e.jsxRuntimeExports.jsx(t.Spinner,{size:"sm"}),e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.600",children:"Loading activities..."})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(X.st,{placeholder:`Choose activities to ${i}...`,options:v,value:v.filter(s=>p.includes(s.value)),onChange:_,isDisabled:v.length===0,isClearable:!0,isMulti:!0,closeMenuOnSelect:!1,formatOptionLabel:(s,{context:h})=>e.jsxRuntimeExports.jsxs(t.HStack,{justify:"space-between",w:"100%",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxRuntimeExports.jsx(t.Text,{children:s.label}),h==="value"&&s.isQuantumOwned&&e.jsxRuntimeExports.jsx(t.Text,{color:"blue",fontSize:"xs",children:"(Quantum Owned)"})]}),s.isQuantumOwned&&h==="menu"&&e.jsxRuntimeExports.jsx(t.Tag,{size:"sm",colorScheme:"blue",variant:"solid",children:"Quantum Owned"})]})}),v.length===0&&e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.500",mt:2,children:"No activities found"})]}),g.error&&e.jsxRuntimeExports.jsxs(t.Alert,{status:"error",mt:2,children:[e.jsxRuntimeExports.jsx(t.AlertIcon,{}),e.jsxRuntimeExports.jsxs(t.Text,{fontSize:"sm",children:["Failed to load activities: ",g.error.message]})]})]}),A.length>0&&e.jsxRuntimeExports.jsxs(t.Box,{p:4,bg:"gray.50",borderRadius:"md",children:[e.jsxRuntimeExports.jsx(t.Text,{fontWeight:"semibold",mb:3,children:A.length===1?`Activity to ${i==="copy"?"Copy":"Convert"}:`:`${A.length} Activities to ${i==="copy"?"Copy":"Convert"}:`}),e.jsxRuntimeExports.jsxs(t.VStack,{align:"start",spacing:3,children:[A.map((s,h)=>e.jsxRuntimeExports.jsxs(t.Box,{w:"100%",p:3,bg:"white",borderRadius:"md",border:"1px solid",borderColor:"gray.200",children:[e.jsxRuntimeExports.jsxs(t.HStack,{justify:"space-between",align:"start",mb:2,children:[e.jsxRuntimeExports.jsxs(t.Text,{fontWeight:"medium",fontSize:"sm",children:[h+1,". ",s.name]}),s.quantumOwned&&e.jsxRuntimeExports.jsx(t.Tag,{size:"sm",colorScheme:"blue",variant:"solid",children:"Quantum Owned"})]}),e.jsxRuntimeExports.jsxs(t.VStack,{align:"start",spacing:1,fontSize:"sm",color:"gray.600",children:[s.description&&e.jsxRuntimeExports.jsxs(t.Text,{children:[e.jsxRuntimeExports.jsx("strong",{children:"Description:"})," ",s.description]}),e.jsxRuntimeExports.jsxs(t.Text,{children:[e.jsxRuntimeExports.jsx("strong",{children:"Type:"})," ",s.activityKind]}),e.jsxRuntimeExports.jsxs(t.Text,{children:[e.jsxRuntimeExports.jsx("strong",{children:"Laterality:"})," ",s.laterality]}),e.jsxRuntimeExports.jsxs(t.Text,{children:[e.jsxRuntimeExports.jsx("strong",{children:"Sensor Locations:"})," ",s.sensorLocations.length]}),e.jsxRuntimeExports.jsxs(t.Text,{children:[e.jsxRuntimeExports.jsx("strong",{children:"Thresholds:"})," ",s.thresholds.length]}),e.jsxRuntimeExports.jsxs(t.Text,{children:[e.jsxRuntimeExports.jsx("strong",{children:"Use Cases:"})," ",s.useCases.map(T=>T.name).join(", ")||"None"]})]})]},s.id)),A.length>1&&e.jsxRuntimeExports.jsx(t.Box,{w:"100%",p:2,bg:"blue.50",borderRadius:"md",border:"1px solid",borderColor:"blue.200",children:e.jsxRuntimeExports.jsxs(t.Text,{fontSize:"sm",fontWeight:"medium",color:"blue.800",children:["Total: ",A.length," activities will be"," ",i==="copy"?"copied":"converted"]})})]})]}),!d&&e.jsxRuntimeExports.jsxs(t.ButtonGroup,{spacing:4,justifyContent:"flex-end",children:[e.jsxRuntimeExports.jsx(t.Button,{variant:"outline",onClick:k,isDisabled:a,children:"Cancel"}),e.jsxRuntimeExports.jsxs(t.Button,{colorScheme:i==="copy"?"blue":"green",onClick:w,isDisabled:A.length===0||a,isLoading:a,loadingText:`${i==="copy"?"Copying":"Converting"}...`,children:[i==="copy"?"Copy":"Convert"," ",A.length===1?"Activity":`${A.length} Activities`]})]})]})})},Fe=({onSave:o,onCancel:n,onError:l,hideButtons:d=!1,setButtonDisabled:m,setButtonOnClick:c,quantumOwned:x})=>{const f=t.useToast(),[i,N]=r.useState(""),[E,M]=r.useState([]),[p,S]=r.useState(!1),[a,u]=r.useState("copy"),[j]=Q.useQuery({query:y.GET_GROUPS}),[g]=Q.useQuery({query:y.GET_MODULES_BY_GROUP,variables:{groupId:i},pause:!i}),[,b]=Q.useMutation(y.CREATE_MODULE),[,C]=Q.useMutation(y.UPDATE_MODULE),[,z]=Q.useMutation(y.CREATE_ACTION),[,D]=Q.useMutation(y.CONVERT_ACTION_TO_QUANTUM_OWNED),A=r.useMemo(()=>j.data?.groups?j.data.groups.map(s=>$.getFragmentData(y.GROUP_FRAGMENT,s)):[],[j.data]),L=r.useMemo(()=>g.data?.modules?$.getFragmentData(y.ACTION_MODULE_FRAGMENT,g.data?.modules).map(h=>{const T=$.getFragmentData(y.MODULE_ACTION_FRAGMENT,h.moduleActions);return{...h,moduleActions:T.map(I=>({...I,action:$.getFragmentData(y.ACTION_FRAGMENT,I.action)})),categories:$.getFragmentData(y.MODULE_CATEGORY_FRAGMENT,h.categories)}}):[],[g.data]),_=r.useMemo(()=>L.filter(s=>E.includes(s.id)),[L,E]),P=r.useCallback(s=>{const h=s?.value||"";N(h),M([])},[]),R=r.useCallback(s=>{const h=s.map(T=>T.value);M(h)},[]),w=r.useCallback(async()=>{if(S(!0),!_.length){S(!1);const s=new Error(`No modules selected for ${a==="convert"?"converting":"copying"}`);l?.(s);return}try{const s=[];let h=0;for(const T of _)try{let I=T.moduleActions.map(B=>B.actionId);if(x){const B=T.moduleActions.map(q=>q.action),U=async q=>{if(a==="copy"){if(q.quantumOwned)return q;const ce=$.getFragmentData(y.MODULE_CATEGORY_FRAGMENT,q.categories),ne={...q,quantumOwned:!0,thresholds:q.thresholds.map(O=>({...O,id:void 0})),categories:ce?.map(O=>O.id),id:void 0},se=await z({fields:ne});return se.error||!se.data?.createAction?null:$.getFragmentData(y.ACTION_FRAGMENT,se.data.createAction)}if(q.quantumOwned)return q;const te=await D({id:q.id});return te.error||!te.data?.convertActionToQuantumOwned?null:$.getFragmentData(y.ACTION_FRAGMENT,te.data.convertActionToQuantumOwned)};I=(await Promise.all(B.map(U))).filter(q=>!!q).map(q=>q.id)}if(a==="convert"){const B={name:T.name,description:T.description||void 0,actions:I,categories:T.categories.map(Y=>Y.id),quantumOwned:!0},U=await C({id:T.id,input:B});if(U.error)throw new Error(U.error.message);if(U.data?.updateModule){const Y=$.getFragmentData(y.ACTION_MODULE_FRAGMENT,U.data.updateModule);s.push(Y)}}else{const B={name:`${T.name} (Copy)`,description:T.description||void 0,actions:I,categories:T.categories.map(Y=>Y.id),quantumOwned:x},U=await b({input:B});if(U.error)throw new Error(U.error.message);if(U.data?.createModule){const Y=$.getFragmentData(y.ACTION_MODULE_FRAGMENT,U.data.createModule);s.push(Y)}}}catch(I){console.error(`Failed to ${a==="convert"?"convert":"copy"} module "${T.name}":`,I),h++}if(s.length>0){const T=s.length,I=_.length;f({title:h>0?`Partial ${a==="convert"?"convert":"copy"} completed`:`Modules ${a==="convert"?"converted":"copied"} successfully`,description:h>0?`${T} of ${I} modules ${a==="convert"?"converted":"copied"} successfully`:`${T} module${T>1?"s":""} ${a==="convert"?"converted":"copied"} successfully`,status:h>0?"warning":"success",duration:3e3,isClosable:!0}),s.length>0&&o?.(),N(""),M([])}else throw new Error(`Failed to ${a==="convert"?"convert":"copy"} any modules`)}catch(s){const h=s instanceof Error?s.message:`Failed to ${a==="convert"?"convert":"copy"} modules`;f({title:a==="convert"?"Convert failed":"Copy failed",description:h,status:"error",duration:5e3,isClosable:!0}),l?.(s instanceof Error?s:new Error(h))}finally{S(!1)}},[_,b,C,f,o,l,x,z,D,a]),k=r.useCallback(()=>{N(""),M([]),u("copy"),n?.()},[n]);r.useEffect(()=>{m&&m({cancelButton:!1,saveButton:_.length===0||p})},[_.length,p,m]),r.useEffect(()=>{c&&c({cancelButton:k,saveButton:w})},[c,k,w]);const H=r.useMemo(()=>A.map(s=>({value:s.id,label:s.name})),[A]),v=r.useMemo(()=>L.filter(s=>a==="copy"?!0:!s.quantumOwned).map(s=>({value:s.id,label:s.name,isQuantumOwned:s.quantumOwned})),[L,a]),G=j.fetching,J=g.fetching;return e.jsxRuntimeExports.jsx(t.Box,{children:e.jsxRuntimeExports.jsxs(t.VStack,{spacing:6,align:"stretch",children:[x&&e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(Z,{children:"Operation Mode"}),e.jsxRuntimeExports.jsx(t.RadioGroup,{value:a,onChange:s=>{u(s),M([])},children:e.jsxRuntimeExports.jsxs(t.HStack,{spacing:6,children:[e.jsxRuntimeExports.jsx(t.Radio,{value:"copy",colorScheme:"blue",children:e.jsxRuntimeExports.jsxs(t.VStack,{align:"start",spacing:1,children:[e.jsxRuntimeExports.jsx(t.Text,{fontWeight:"medium",children:"Copy Modules"}),e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.600",children:"Create new modules based on selected ones"})]})}),e.jsxRuntimeExports.jsx(t.Radio,{value:"convert",colorScheme:"green",children:e.jsxRuntimeExports.jsxs(t.VStack,{align:"start",spacing:1,children:[e.jsxRuntimeExports.jsx(t.Text,{fontWeight:"medium",children:"Convert to Quantum Owned"}),e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.600",children:"Convert existing modules to quantum-owned"})]})})]})})]}),e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(Z,{children:"Select Source Group"}),e.jsxRuntimeExports.jsx(X.st,{placeholder:"Choose a group...",options:H,value:H.find(s=>s.value===i)||null,onChange:P,isLoading:G,isDisabled:G,isClearable:!0}),j.error&&e.jsxRuntimeExports.jsxs(t.Alert,{status:"error",mt:2,children:[e.jsxRuntimeExports.jsx(t.AlertIcon,{}),e.jsxRuntimeExports.jsxs(t.Text,{fontSize:"sm",children:["Failed to load groups: ",j.error.message]})]})]}),i&&e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(Z,{children:a==="convert"?"Select Module to Convert":"Select Module to Copy"}),J?e.jsxRuntimeExports.jsxs(t.HStack,{children:[e.jsxRuntimeExports.jsx(t.Spinner,{size:"sm"}),e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.600",children:"Loading modules..."})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(X.st,{placeholder:a==="convert"?"Choose modules to convert...":"Choose modules to copy...",options:v,value:v.filter(s=>E.includes(s.value)),onChange:R,isDisabled:v.length===0,isClearable:!0,isMulti:!0,closeMenuOnSelect:!1,formatOptionLabel:(s,{context:h})=>e.jsxRuntimeExports.jsxs(t.HStack,{justify:"space-between",w:"100%",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxRuntimeExports.jsx(t.Text,{children:s.label}),h==="value"&&s.isQuantumOwned&&e.jsxRuntimeExports.jsx(t.Text,{color:"blue",fontSize:"xs",children:"(Quantum Owned)"})]}),s.isQuantumOwned&&h==="menu"&&e.jsxRuntimeExports.jsx(t.Tag,{size:"sm",colorScheme:"blue",variant:"solid",children:"Quantum Owned"})]})}),v.length===0&&e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.500",mt:2,children:"No modules found in this group"})]}),g.error&&e.jsxRuntimeExports.jsxs(t.Alert,{status:"error",mt:2,children:[e.jsxRuntimeExports.jsx(t.AlertIcon,{}),e.jsxRuntimeExports.jsxs(t.Text,{fontSize:"sm",children:["Failed to load modules: ",g.error.message]})]})]}),_.length>0&&e.jsxRuntimeExports.jsxs(t.Box,{p:4,bg:"gray.50",borderRadius:"md",children:[e.jsxRuntimeExports.jsx(t.Text,{fontWeight:"semibold",mb:3,children:_.length===1?`Module to ${a==="copy"?"Copy":"Convert"}`:`${_.length} Modules to ${a==="copy"?"Copy":"Convert"}`}),e.jsxRuntimeExports.jsxs(t.VStack,{align:"start",spacing:3,children:[_.map((s,h)=>e.jsxRuntimeExports.jsxs(t.Box,{w:"100%",p:3,bg:"white",borderRadius:"md",border:"1px solid",borderColor:"gray.200",children:[e.jsxRuntimeExports.jsxs(t.HStack,{justify:"space-between",align:"start",mb:2,children:[e.jsxRuntimeExports.jsxs(t.Text,{fontWeight:"medium",fontSize:"sm",children:[h+1,". ",s.name]}),s.quantumOwned&&e.jsxRuntimeExports.jsx(t.Tag,{size:"sm",colorScheme:"blue",variant:"solid",children:"Quantum Owned"})]}),e.jsxRuntimeExports.jsxs(t.VStack,{align:"start",spacing:1,fontSize:"sm",color:"gray.600",children:[s.description&&e.jsxRuntimeExports.jsxs(t.Text,{children:[e.jsxRuntimeExports.jsx("strong",{children:"Description:"})," ",s.description]}),e.jsxRuntimeExports.jsxs(t.Text,{children:[e.jsxRuntimeExports.jsx("strong",{children:"Actions:"})," ",s.moduleActions.length]}),e.jsxRuntimeExports.jsxs(t.Text,{children:[e.jsxRuntimeExports.jsx("strong",{children:"Categories:"})," ",s.categories.map(T=>T.name).join(", ")||"None"]})]})]},s.id)),_.length>1&&e.jsxRuntimeExports.jsx(t.Box,{w:"100%",p:2,bg:"blue.50",borderRadius:"md",border:"1px solid",borderColor:"blue.200",children:e.jsxRuntimeExports.jsxs(t.Text,{fontSize:"sm",fontWeight:"medium",color:"blue.800",children:["Total: ",_.length," modules will be"," ",a==="copy"?"copied":"converted"]})}),x&&_.filter(s=>s.moduleActions.some(h=>!h.action.quantumOwned)).length>0&&e.jsxRuntimeExports.jsx(t.Box,{p:2,bg:"yellow.50",borderRadius:"md",border:"1px solid",borderColor:"yellow.200",children:e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",fontWeight:"medium",color:"yellow.800",children:a==="convert"?"Converting Modules will convert non QM-Owned Actions to QM-Owned":"Copying Modules with Non QM-Owned Actions will create corresponding QM-Owned Actions"})})]})]}),!d&&e.jsxRuntimeExports.jsxs(t.ButtonGroup,{spacing:4,justifyContent:"flex-end",children:[e.jsxRuntimeExports.jsx(t.Button,{variant:"outline",onClick:k,isDisabled:p,children:"Cancel"}),e.jsxRuntimeExports.jsxs(t.Button,{colorScheme:a==="copy"?"blue":"green",onClick:w,isDisabled:_.length===0||p,isLoading:p,loadingText:`${a==="copy"?"Copying":"Converting"}...`,children:[a==="copy"?"Copy":"Convert"," ",_.length===1?"Module":`${_.length} Modules`]})]})]})})},me=({name:o,setName:n,actions:l,selectedActionIds:d,setSelectedActionIds:m,availableCategories:c,selectedCategoryIds:x,setSelectedCategoryIds:f,description:i,setDescription:N,...E})=>{const M=t.useDisclosure(),p=r.useMemo(()=>l.map(b=>({...b,selected:d.includes(b.id)})),[l,d]),S=r.useMemo(()=>l.reduce((b,C)=>(b[C.id]=C,b),{}),[l]),a=r.useMemo(()=>d.map(b=>S[b]),[p,d]),u=r.useCallback((b,C)=>{m(C?[...d,b.id]:d.filter(z=>z!==b.id))},[d,m]),j=r.useCallback(b=>{n(b.target.value)},[n]),g=r.useCallback(b=>{N?.(b.target.value)},[N]);return e.jsxRuntimeExports.jsxs(t.Box,{...E,children:[e.jsxRuntimeExports.jsxs(t.HStack,{gap:"2rem",children:[e.jsxRuntimeExports.jsx(Ne,{name:o??"",onInputChange:j}),e.jsxRuntimeExports.jsx(Le,{availableCategories:c,value:x,onChange:f})]}),e.jsxRuntimeExports.jsx(ke,{description:i??"",onInputChange:g}),e.jsxRuntimeExports.jsx(Ie,{value:a,onChange:m,onAdjustActivities:()=>M.onOpen()}),e.jsxRuntimeExports.jsxs(t.Modal,{isOpen:M.isOpen,onClose:M.onClose,size:"6xl",children:[e.jsxRuntimeExports.jsx(t.ModalOverlay,{}),e.jsxRuntimeExports.jsxs(t.ModalContent,{children:[e.jsxRuntimeExports.jsx(t.ModalHeader,{children:"Select Activities"}),e.jsxRuntimeExports.jsx(t.ModalCloseButton,{}),e.jsxRuntimeExports.jsx(t.ModalBody,{children:e.jsxRuntimeExports.jsx(xe,{actions:p,onSelected:u,disableCreate:!0,disableDelete:!0,tableProps:{height:"28rem",overflowY:"auto"}})}),e.jsxRuntimeExports.jsx(t.ModalFooter,{children:e.jsxRuntimeExports.jsx(t.Button,{colorScheme:"blue",onClick:M.onClose,isDisabled:d.length===0,children:"Done"})})]})]})]})},Ne=r.memo(({name:o,onInputChange:n})=>e.jsxRuntimeExports.jsxs(t.FormControl,{mb:4,children:[e.jsxRuntimeExports.jsx(Z,{children:"Module Name"}),e.jsxRuntimeExports.jsx(t.Input,{placeholder:"i.e. ACL RTP Test Battery",value:o,onChange:n,isRequired:!0})]})),Le=r.memo(({availableCategories:o,value:n,onChange:l})=>{const d=r.useMemo(()=>[...o,{id:"other",name:"Other"}],[o]),m=r.useMemo(()=>d.map(c=>({value:c.id,label:c.name})),[d]);return e.jsxRuntimeExports.jsxs(t.FormControl,{mb:4,children:[e.jsxRuntimeExports.jsx(Z,{children:"Module Category"}),e.jsxRuntimeExports.jsx(X.st,{isDisabled:o.length===0,isClearable:!0,options:m,value:d.filter(c=>n.includes(c.id)).map(c=>({value:c.id,label:c.name})),onChange:c=>l(c?[c.value]:[]),placeholder:"Select category"})]})}),ke=r.memo(({description:o,onInputChange:n})=>e.jsxRuntimeExports.jsxs(t.FormControl,{mb:4,children:[e.jsxRuntimeExports.jsx(Z,{children:e.jsxRuntimeExports.jsxs("span",{children:["Description",e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.500",children:"Briefly describe the objective of this module. Max 40 words."})]})}),e.jsxRuntimeExports.jsx(t.Input,{placeholder:"i.e. Assess readiness to return to play post-ACL reconstruction",value:o,onChange:n})]})),Ie=r.memo(({value:o,onChange:n,onAdjustActivities:l})=>{const d=r.useMemo(()=>o.map(m=>({id:m.id,name:m.name})),[o]);return e.jsxRuntimeExports.jsxs(t.FormControl,{mb:4,children:[e.jsxRuntimeExports.jsxs(t.HStack,{justifyContent:"space-between",children:[e.jsxRuntimeExports.jsx(Z,{children:e.jsxRuntimeExports.jsxs("span",{children:["Activities",e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.500",children:"Drag and drop to reorder the activities in this module."})]})}),e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"solid",colorScheme:"blue",onClick:l,children:"Add / Remove Activities"})]}),d.length===0?e.jsxRuntimeExports.jsx(t.VStack,{children:e.jsxRuntimeExports.jsxs(t.Text,{color:"gray.500",fontSize:"lg",mb:"4rem",mt:"4rem",children:["No activities selected for this module.",e.jsxRuntimeExports.jsx(t.Button,{ml:"0.5em",size:"sm",variant:"link",colorScheme:"blue",onClick:l,children:"Add activities."})]})}):e.jsxRuntimeExports.jsx(fe,{value:d,onChange:m=>{const c=m(d);n(c.map(x=>x.id))}})]})}),pe=({value:o,onChange:n,forceKind:l,disableRemove:d,disableKind:m,isDisabled:c,lockRanges:x,...f})=>{const i=r.useMemo(()=>[...o].sort((p,S)=>{const a=oe.availablePlanes.indexOf(p.plane),u=oe.availablePlanes.indexOf(S.plane);return a-u}),[o]),N=r.useCallback(p=>"segment"in p.id?K.getSegmentNameWithPlane(p.id.segment,p.plane,!0)??"Unknown":K.getJointNameWithPlane(p.id.joint,p.plane,!0)??"Unknown",[]),E=r.useCallback((p,S)=>{const a=i.findIndex(j=>j.id===S.id&&j.plane===S.plane);let u=[...i];l&&(S={...S,kind:l}),u[a]=S,x&&(u=u.map(j=>({...j,min:S.min,max:S.max}))),n(u)},[n,i,l,x]),M=r.useCallback(p=>{const S=i.filter(a=>a.id!==p.id||a.plane!==p.plane);n(S)},[n,i]);return e.jsxRuntimeExports.jsx(t.VStack,{alignItems:"flex-start",overflowY:"auto",...f,children:i.map((p,S)=>e.jsxRuntimeExports.jsx(De,{label:N(p),parameter:p,onChange:a=>E(S,a),onRemove:d||c?void 0:()=>M(p),forceKind:l,disableKind:m||c,isDisabled:c},`${JSON.stringify(p.id)}-${p.plane}`))})},De=({label:o,parameter:n,onChange:l,onRemove:d,forceKind:m,disableKind:c,isDisabled:x})=>{const f=r.useCallback(E=>"joint"in n.id?K.getJointAngleDirectionName(n.id.joint,n.plane,E<0?-1:1):K.getSegmentAngleDirectionName(n.id.segment,n.plane,E<0?-1:1),[n]),{min:i,max:N}="joint"in n.id?K.getNormativeJointRange(n.id.joint,n.plane):{min:-180,max:180};return e.jsxRuntimeExports.jsxs(t.VStack,{borderRadius:"md",p:2,px:4,bg:"gray.100",w:"100%",overflow:"hidden",flexShrink:"0",children:[e.jsxRuntimeExports.jsxs(t.HStack,{w:"100%",children:[e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",flex:1,textTransform:"capitalize",fontWeight:"semibold",children:o}),d&&!x&&e.jsxRuntimeExports.jsx(t.IconButton,{size:"xs",variant:"ghost","aria-label":"delete",icon:e.jsxRuntimeExports.jsx(t.Icon,{as:de.FaTrash}),onClick:d}),!m&&e.jsxRuntimeExports.jsx(ve,{selectedItem:n?.kind??F.ThresholdKind.Limit,onChange:({value:E})=>l({...n,kind:E}),isDisabled:c||x,buttonProps:{size:"sm",variant:"outline",colorScheme:"gray"},selectedProps:{variant:"solid",colorScheme:"teal"},items:[{value:F.ThresholdKind.Limit,label:"limit"},{value:F.ThresholdKind.Target,label:"target"}]})]}),e.jsxRuntimeExports.jsx(ye,{w:"100%",size:"xs",min:i,max:N,zeroMarker:!0,value:[n.min,n.max],onChange:E=>l({...n,min:E[0],max:E[1]}),formatValue:E=>`${Math.abs(E)}°`,valueLabel:E=>f(E)??"",positiveNegativeLabels:f(0)?[f(-1)??"",f(1)??""]:void 0,isDisabled:x})]})},ae=(o,n)=>"segment"in o&&"segment"in n&&o.segment===n.segment||"joint"in o&&"joint"in n&&o.joint===n.joint,he=({options:o,value:n,onChange:l,forceKind:d,singleValue:m,singleValueSideless:c,editOnly:x,disableKind:f,maxParameters:i,...N})=>{const E=c?2:i,M=r.useMemo(()=>o.map(u=>({label:"segment"in u.id?K.getSegmentNameWithPlane(u.id.segment,u.plane,!0)??"Unknown":K.getJointNameWithPlane(u.id.joint,u.plane,!0)??"Unknown",value:u.id,plane:u.plane})),[o]),p=r.useMemo(()=>{if(!c||n.length===0)return M;const u=n[0];return M.filter(j=>oe.getAnalysisPartIdNoSide(j.value)===oe.getAnalysisPartIdNoSide(u.id)&&j.plane===u.plane)},[M,n,c]),S=r.useMemo(()=>M.filter(u=>n.some(j=>ae(j.id,u.value)&&j.plane===u.plane)),[M,n]),a=r.useCallback(u=>{const j=u.map(g=>{const b=n.find(L=>ae(L.id,g.value)&&L.plane===g.plane),C=o.find(L=>ae(L.id,g.value)&&L.plane===g.plane),z=c?n.find(L=>oe.getAnalysisPartIdNoSide(L.id)===oe.getAnalysisPartIdNoSide(g.value)&&L.plane===g.plane):void 0,D=z&&!b?z.min:C&&C.min?C.min:0,A=z&&!b?z.max:C&&C.max?C.max:0;return b??{id:g.value,plane:g.plane,min:D,max:A,kind:d??F.ThresholdKind.Limit}});l(j)},[l,n,o,d,c]);return r.useEffect(()=>{const u=n.filter(j=>o.some(g=>ae(g.id,j.id)&&g.plane===j.plane));u.length!==n.length&&l(u)},[o,l]),e.jsxRuntimeExports.jsxs(t.Box,{...N,children:[e.jsxRuntimeExports.jsx(X.st,{isMulti:!m,placeholder:n.length?`${n.length} selected`:"Search...",value:S,isDisabled:x||S.length>=(E??1/0),onChange:u=>Array.isArray(u)?a([...u]):a(u!==null?[u]:[]),options:p,controlShouldRenderValue:!1}),e.jsxRuntimeExports.jsx(pe,{marginTop:2,maxH:"28rem",value:n,onChange:l,forceKind:d,disableKind:f,isDisabled:x,lockRanges:c})]})},je=o=>{switch(o){case F.SensorLocation.Thorax:return"Thorax";case F.SensorLocation.CenterBack:return"Center Back";case F.SensorLocation.Pelvis:return"Pelvis";case F.SensorLocation.LeftThigh:return"Left Thigh";case F.SensorLocation.RightThigh:return"Right Thigh";case F.SensorLocation.LeftShank:return"Left Shank";case F.SensorLocation.RightShank:return"Right Shank";case F.SensorLocation.LeftFoot:return"Left Foot";case F.SensorLocation.RightFoot:return"Right Foot";case F.SensorLocation.LeftUpperArm:return"Left Upper Arm";case F.SensorLocation.RightUpperArm:return"Right Upper Arm";case F.SensorLocation.LeftForearm:return"Left Forearm";case F.SensorLocation.RightForearm:return"Right Forearm";case F.SensorLocation.Head:return"Head"}return console.warn(`Unknown sensor location: ${o}`),"Unknown"},_e=6,Ge=[F.SensorLocation.LeftFoot,F.SensorLocation.LeftShank,F.SensorLocation.LeftThigh,F.SensorLocation.Pelvis,F.SensorLocation.RightFoot,F.SensorLocation.RightShank,F.SensorLocation.RightThigh,F.SensorLocation.Thorax,F.SensorLocation.CenterBack,F.SensorLocation.Head],Be=Ge.map(o=>({label:je(o),value:o})),ue=(o,n)=>o.map(l=>({label:n?n(l):l,value:l})),Pe=({id:o,onError:n,onCancel:l,onSave:d,hideButtons:m,setButtonOnClick:c,setButtonDisabled:x,quantumOwned:f,isView:i})=>{const[{fetching:N},E]=Q.useMutation(y.CREATE_ACTION),[{fetching:M},p]=Q.useMutation(y.UPDATE_ACTION),[{data:S}]=Q.useQuery({query:y.GET_ACTION_BY_ID,variables:{id:o??""},pause:!o}),a=$.getFragmentData(y.ACTION_FRAGMENT,S?.getActionById),u=N||M,j=!!a&&!!o,[g,b]=r.useState(""),[C,z]=r.useState(""),[D,A]=r.useState(""),[L,_]=r.useState(""),[P,R]=r.useState(),[w,k]=r.useState([]),[H,v]=r.useState([]),[G,J]=r.useState([]),s=r.useMemo(()=>H.map(O=>O.value),[H]),h=Ee.usePartOptionsForSensorLocations(s),[{data:T}]=Q.useQuery({query:y.GET_ALL_MODULE_CATEGORIES}),I=r.useMemo(()=>$.getFragmentData(y.MODULE_CATEGORY_FRAGMENT,T?.moduleCategories)?.map(W=>({label:W.name,value:W.id})),[T?.moduleCategories]),B=r.useMemo(()=>ue(Object.values(F.SessionType),K.mapSessionTypeEnumToLabel),[]),[U,Y]=r.useState([]),q=g.length>0,[te,ce]=r.useState({});r.useEffect(()=>{if(a){const O=$.getFragmentData(y.MODULE_CATEGORY_FRAGMENT,a.categories),W={name:a.name,activityType:a.activityType??void 0,description:a.description||"",cameraPlacement:a.cameraPlacement||"",videoLink:a.videoLink||"",sessionType:a.sessionType.map(V=>({label:K.mapSessionTypeEnumToLabel(V),value:V})),categories:O?.map(V=>V.id)||[],sensorLocations:a.sensorLocations.map(V=>({label:je(V),value:V})),thresholds:re.thresholdsToParameters(a.thresholds)};b(W.name),R(W.activityType??void 0),z(W.description),A(W.cameraPlacement),_(W.videoLink),k(W.sessionType),J(O?.map(V=>V.id)||[]),v(W.sensorLocations),Y(W.thresholds),ce(W)}},[a]);const ne=r.useMemo(()=>JSON.stringify(te)!==JSON.stringify({name:g,description:C,cameraPlacement:D,videoLink:L,activityType:P,sessionType:w.map(O=>O.value),categories:G,sensorLocations:s,thresholds:re.parametersToThresholds(U)}),[te,g,s,C,D,L,P,w,G,U]),se=r.useCallback(()=>{const O={name:g,description:C,cameraPlacement:D,videoLink:L,activityType:P,activityKind:K.getActivityKindFromActivityType(P),sessionType:w.map(V=>V.value),categories:G,sensorLocations:s,thresholds:re.parametersToThresholds(U),laterality:F.ActionLaterality.Either,quantumOwned:f};let W;j&&o?W=p({id:o,fields:O}):W=E({fields:O}),W.then(({error:V})=>{V?n(V):d()})},[f,E,p,o,g,s,C,D,L,P,w,G,j,U,d,n]);return r.useEffect(()=>{x&&x({cancelButton:u,saveButton:i?!0:u||!q||!ne})},[u,x,q,ne,i]),r.useEffect(()=>{c&&c({cancelButton:l,saveButton:i?()=>{}:se})},[c,l,se,i]),console.log(q,ne,u,te),e.jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2 gap-4 w-full",children:[e.jsxRuntimeExports.jsxs("div",{className:"col-span-2 lg:col-span-1 flex flex-col gap-4",children:[e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(ee,{children:"Name"}),e.jsxRuntimeExports.jsx(t.Input,{value:g,onChange:O=>b(O.target.value),type:"text",placeholder:"i.e. Lunge & Return",isDisabled:i})]}),e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(ee,{children:"Activity Type"}),e.jsxRuntimeExports.jsx(X.st,{isClearable:!0,isMulti:!1,value:P?{label:K.mapActivityTypeEnumToLabel(P),value:P}:null,onChange:O=>R(O?.value),options:ue(Object.values(F.ActivityType),K.mapActivityTypeEnumToLabel),placeholder:"(optional) Select activity type",isDisabled:i})]}),e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(ee,{children:"Camera Placement"}),e.jsxRuntimeExports.jsx(t.Textarea,{value:D,onChange:O=>A(O.target.value),rows:2,placeholder:"(optional) Describe camera setup, placement, angles",isDisabled:i})]}),e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(ee,{children:"Video Link"}),e.jsxRuntimeExports.jsx(t.Input,{value:L,onChange:O=>_(O.target.value),type:"url",placeholder:"(optional) https://...",isDisabled:i})]}),e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(ee,{children:"Description"}),e.jsxRuntimeExports.jsx(t.Textarea,{value:C,onChange:O=>z(O.target.value),rows:2,placeholder:"(optional) Describe how to perform the test or exercise",isDisabled:i})]}),e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(ee,{children:"Link to Category"}),e.jsxRuntimeExports.jsx(X.st,{isMulti:!0,value:I?.filter(O=>G.includes(O.value)),onChange:O=>J((O??[]).map(W=>W.value)),options:I,placeholder:"Select one or more categories",isDisabled:i})]}),e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(ee,{children:"Session Types"}),e.jsxRuntimeExports.jsx(X.st,{isMulti:!0,value:w,onChange:O=>k(O??[]),options:B,placeholder:"Select one or more session types",isDisabled:i})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"col-span-2 lg:col-span-1 flex flex-col gap-4",children:[e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(ee,{children:"Sensor Locations"}),e.jsxRuntimeExports.jsx(X.st,{isMulti:!0,value:H,onChange:O=>v([...O]),options:Be,isOptionDisabled:()=>H.length>=_e,isDisabled:i})]}),e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(ee,{children:"Default Parameters"}),e.jsxRuntimeExports.jsx(he,{options:h,value:U,onChange:Y,editOnly:i})]})]}),e.jsxRuntimeExports.jsx("div",{className:re.cn("col-span-2 flex justify-end",(m||i)&&"hidden"),children:e.jsxRuntimeExports.jsxs(t.ButtonGroup,{mt:16,gap:4,children:[e.jsxRuntimeExports.jsx(t.Button,{colorScheme:"gray",isDisabled:u,onClick:l,children:"Cancel"}),e.jsxRuntimeExports.jsx(t.Button,{colorScheme:"blue",isDisabled:u||!q||!ne,isLoading:u,onClick:se,children:"Save changes"})]})})]})},ee=({children:o})=>e.jsxRuntimeExports.jsx(t.FormLabel,{fontWeight:"bold",fontFamily:"sans-serif",fontSize:"large",children:o}),ze=({id:o,onCancel:n,onSave:l,onError:d,hideButtons:m,quantumOwned:c,setButtonOnClick:x,setButtonDisabled:f})=>{const[{data:i}]=Q.useQuery({query:c?y.GET_QUANTUM_OWNED_ACTIONS:y.GET_ACTIONS}),[{data:N}]=Q.useQuery({query:y.GET_MODULE_BY_ID,variables:{id:o},pause:!o}),[{data:E}]=Q.useQuery({query:y.GET_ALL_MODULE_CATEGORIES}),M=$.getFragmentData(y.MODULE_CATEGORY_FRAGMENT,E?.moduleCategories),[{fetching:p},S]=Q.useMutation(y.UPDATE_MODULE),[{fetching:a},u]=Q.useMutation(y.CREATE_MODULE),j=$.getFragmentData(y.ACTION_FRAGMENT,c?i?.quantumOwnedActions:i?.actions)??[],g=$.getFragmentData(y.ACTION_MODULE_FRAGMENT,N?.module),b=$.getFragmentData(y.MODULE_ACTION_FRAGMENT,g?.moduleActions)??[],[C,z]=r.useState([...b.map(k=>k.actionId)??[]]),[D,A]=r.useState(g?.name??""),[L,_]=r.useState([]),[P,R]=r.useState(g?.description??"");r.useEffect(()=>{g&&(z(b.map(k=>k.actionId)),A(g.name),R(g.description??""),_(g.categories.map(k=>$.getFragmentData(y.MODULE_CATEGORY_FRAGMENT,k).id)??[]))},[g,b]);const w=r.useCallback(()=>{let k;const H={actions:C,name:D,categories:L.filter(v=>v!=="other"),description:P,quantumOwned:c};g?k=S({id:g.id,input:H}):k=u({input:H}),k.then(({error:v})=>{v?d(v):l()})},[u,S,C,D,P,L,g,l,d]);return r.useEffect(()=>{f&&f({cancelButton:p||a,saveButton:p||a||!D||P.trim().split(/\s+/).filter(Boolean).length>40})},[f,p,a,C,D,P]),r.useEffect(()=>{x&&x({cancelButton:n,saveButton:w})},[x,n,w]),e.jsxRuntimeExports.jsxs(t.Box,{width:"100%",children:[e.jsxRuntimeExports.jsx(me,{name:D,setName:A,actions:j,selectedActionIds:C,setSelectedActionIds:z,availableCategories:M??[],selectedCategoryIds:L,setSelectedCategoryIds:_,description:P,setDescription:R}),!m&&e.jsxRuntimeExports.jsx(t.HStack,{justifyContent:"flex-start",children:e.jsxRuntimeExports.jsxs(t.ButtonGroup,{mt:16,gap:4,children:[e.jsxRuntimeExports.jsx(t.Button,{colorScheme:"gray",isDisabled:p||a,onClick:n,children:"Cancel"}),e.jsxRuntimeExports.jsx(t.Button,{colorScheme:"blue",isDisabled:p||a||!D||P.trim().split(/\s+/).filter(Boolean).length>40,isLoading:p||a,onClick:w,children:"Save"})]})})]})};exports.ActivityList=xe;exports.CopyActivityForm=Oe;exports.CopyModuleForm=Fe;exports.ModuleForm=me;exports.ParameterEditList=pe;exports.ParameterEditSelect=he;exports.UpsertActivityForm=Pe;exports.UpsertModuleForm=ze;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./react-jsx-runtime-vendor-Dszzpdy0.cjs"),t=require("@chakra-ui/react"),r=require("react"),ge=require("./ufuzzy-vendor-7qHa_k39.cjs"),X=require("./react-select-vendor-D_Q2fL5j.cjs"),de=require("./react-icons-vendor-D2s8zw9h.cjs"),Q=require("./graphql-vendor-B-QTAQSb.cjs"),$=require("./generated.cjs"),y=require("./graphql-C6M9oyU0.cjs"),le=require("./react-dnd-vendor-BPzSDojS.cjs"),F=require("./generated-graphql.cjs"),K=require("./services.cjs"),oe=require("./types.cjs"),re=require("./utils.cjs"),Ee=require("./hooks.cjs"),Re=({setSearch:o,actions:n,updateUseCases:l,hideUseCaseFilter:d=!1})=>{const m=r.useMemo(()=>n?.flatMap(c=>c.useCases).filter((c,x,f)=>f.findIndex(i=>i.id===c.id)===x).map(c=>({label:c.name,value:c.id}))||[],[n]);return e.jsxRuntimeExports.jsxs(t.Flex,{width:"100%",alignContent:"space-evenly",gap:4,children:[e.jsxRuntimeExports.jsxs(t.InputGroup,{size:"md",flex:1,children:[e.jsxRuntimeExports.jsx(t.InputLeftElement,{children:e.jsxRuntimeExports.jsx(t.Icon,{as:de.FaSearch,color:"gray.300"})}),e.jsxRuntimeExports.jsx(t.Input,{placeholder:"Search by name...",width:"100%",maxW:d?void 0:"30rem",onChange:c=>o(c.target.value)})]}),!d&&e.jsxRuntimeExports.jsx(t.InputGroup,{size:"md",children:e.jsxRuntimeExports.jsx(X.st,{size:"md",chakraStyles:{container:c=>({...c,width:"100%"})},menuPortalTarget:document.body,placeholder:"Filter use case",isMulti:!0,options:m,onChange:c=>l(c.map(x=>x.value))})})]})},Z=({children:o})=>e.jsxRuntimeExports.jsx(t.FormLabel,{fontWeight:"bold",fontFamily:"sans-serif",fontSize:"large",children:o}),fe=({value:o,onChange:n})=>{const l=r.useState(()=>Math.random().toString(36).substring(2,15))[0],d=r.useCallback((m,c)=>{n(x=>{const f=[...x],[i]=f.splice(m,1);return f.splice(c,0,i),f})},[n]);return e.jsxRuntimeExports.jsx(t.Box,{children:e.jsxRuntimeExports.jsx(le.DndProvider,{backend:le.HTML5Backend,children:e.jsxRuntimeExports.jsx(t.TableContainer,{children:e.jsxRuntimeExports.jsxs(t.Table,{variant:"simple",size:"md",children:[e.jsxRuntimeExports.jsx(t.Thead,{children:e.jsxRuntimeExports.jsxs(t.Tr,{children:[e.jsxRuntimeExports.jsx(t.Th,{children:"Order"}),e.jsxRuntimeExports.jsx(t.Th,{children:"Name"})]})}),e.jsxRuntimeExports.jsx(t.Tbody,{children:o.map((m,c)=>e.jsxRuntimeExports.jsx(be,{listKey:l,index:c,id:m.id,name:m.name,move:d},m.id))})]})})})})},be=({listKey:o,index:n,id:l,name:d,move:m})=>{const c=r.useRef(null),[{handlerId:x},f]=le.useDrop({accept:o,collect:p=>({handlerId:p.getHandlerId()?.toString()??""}),hover:(p,S)=>{if(!c.current)return;const a=p.index,u=n;if(a===u)return;const j=c.current?.getBoundingClientRect(),g=(j.bottom-j.top)/2,C=S.getClientOffset().y-j.top;a<u&&C<g||a>u&&C>g||(m(a,u),p.index=u)}}),[{isDragging:i},N]=le.useDrag({type:o,item:()=>({id:l,index:n}),collect:p=>({isDragging:p.isDragging()})}),E=i?.6:1,M=i?"grabbing":"grab";return N(f(c)),e.jsxRuntimeExports.jsxs(t.Tr,{ref:c,style:{opacity:E,cursor:M},"data-handler-id":x,children:[e.jsxRuntimeExports.jsx(t.Td,{children:n+1}),e.jsxRuntimeExports.jsx(t.Td,{children:d})]})},ve=({items:o,onChange:n,selectedItem:l,isDisabled:d,selectedProps:m,buttonProps:c})=>{const x=i=>i===l||i.value===l,f=i=>x(i)?{...c,...m}:c;return e.jsxRuntimeExports.jsx(t.ButtonGroup,{isAttached:!0,isDisabled:d,children:o.map((i,N)=>e.jsxRuntimeExports.jsx(t.Tooltip,{label:i.tooltip,openDelay:50,closeDelay:200,placement:"top",visibility:i.tooltip?"visible":"hidden",hasArrow:!0,children:e.jsxRuntimeExports.jsx(t.Button,{onClick:()=>x(i)?null:n(i,N),isDisabled:i.disabled,...f(i),children:i.label})},N))})},ie=(o,n)=>n<0?-1*Math.abs(o):Math.abs(o),ye=({isReversed:o,min:n,max:l,value:d,onChange:m,inputProps:c,size:x,zeroMarker:f,formatValue:i,valueLabel:N,positiveNegativeLabels:E,isDisabled:M,...p})=>{const[S,a]=r.useState([void 0,void 0]),u=S[0],j=S[1],g=f&&n<-5&&l>5,b=Number(d?.[0]??j??n)>0?1:-1,C=Number(d?.[1]??j??l)<0?-1:1,z=E?.[0]===E?.[1],D=d?.[0],A=d?.[1];r.useEffect(()=>{D!==void 0&&A!==void 0&&a([D.toFixed(0),A.toFixed(0)])},[D,A,a]);const L=r.useCallback(([v,G])=>{v<G&&a([v.toFixed(0),G.toFixed(0)])},[a]),_=r.useCallback(([v,G])=>{v<G&&m([v,G])},[m]),P=r.useCallback(()=>{a(([v,G])=>{const J=isNaN(Number(v))?n:Number(v),s=isNaN(Number(G))?l:Number(G),h=ie(Number(J),b),T=ie(Number(s),C),I=b<0?Math.max(h,n):Math.min(h,l),B=C<0?Math.max(T,n):Math.min(T,l);return I>B?(m([B,I]),[B.toFixed(0),I.toFixed(0)]):(m([I,B]),[I.toFixed(0),B.toFixed(0)])})},[m,a,b,C,n,l]),R=r.useCallback(v=>{const G=v===""||isNaN(Number(v))?v:ie(Number(v),b);a(([J,s])=>[G.toString(),s])},[a,b]),w=r.useCallback(v=>{const G=v===""||isNaN(Number(v))?v:ie(Number(v),C);a(([J,s])=>[J,G.toString()])},[a,C]),k=r.useMemo(()=>x==="xs"?"0.75rem":void 0,[x]),H=r.useCallback((v,G)=>{const J=Number(G.target.value);if(!u||!j||![-1,1].includes(J))return;const s=I=>J<0?-1*Math.abs(I):Math.abs(I),h=v?s(Number(u)):Number(u),T=v?Number(j):s(Number(j));h>T?m([T,h]):m([h,T])},[u,j,m]);return e.jsxRuntimeExports.jsxs(t.Flex,{direction:"column",...p,children:[e.jsxRuntimeExports.jsx(t.Box,{pt:"1em",mb:"-0.5em",children:e.jsxRuntimeExports.jsxs(t.RangeSlider,{"aria-label":["min","max"],isReversed:o,value:[Number(u??n),Number(j??l)],max:l,min:n,minStepsBetweenThumbs:3,step:1,onChange:L,onChangeEnd:_,isDisabled:M,children:[e.jsxRuntimeExports.jsx(t.RangeSliderMark,{value:n,top:"-1em",children:e.jsxRuntimeExports.jsx(t.Text,{fontSize:x??"sm",fontWeight:"semibold",whiteSpace:"nowrap",children:i?i?.(n):n})}),e.jsxRuntimeExports.jsx(t.RangeSliderMark,{value:l,top:"-1em",children:e.jsxRuntimeExports.jsx(t.Text,{fontSize:x??"sm",fontWeight:"semibold",style:{transform:"translateX(-100%)"},whiteSpace:"nowrap",children:i?i(l):l})}),g&&e.jsxRuntimeExports.jsxs(t.RangeSliderMark,{value:0,top:"-1em",pos:"relative",children:[e.jsxRuntimeExports.jsx(t.Text,{fontSize:x,fontWeight:"semibold",children:i?.(0)??"0"}),e.jsxRuntimeExports.jsx(t.Box,{position:"absolute",width:"2px",height:"1em",top:"90%",left:"20%",backgroundColor:"var(--chakra-colors-gray-300)"})]}),e.jsxRuntimeExports.jsx(t.RangeSliderTrack,{children:e.jsxRuntimeExports.jsx(t.RangeSliderFilledTrack,{})}),e.jsxRuntimeExports.jsx(t.RangeSliderThumb,{index:0,w:k,h:k}),e.jsxRuntimeExports.jsx(t.RangeSliderThumb,{index:1,w:k,h:k})]})}),N&&e.jsxRuntimeExports.jsxs(t.Flex,{direction:o?"row-reverse":"row",justifyContent:"space-between",children:[e.jsxRuntimeExports.jsx(t.Text,{fontSize:x??"sm",fontWeight:"semibold",whiteSpace:"nowrap",children:N(n)}),e.jsxRuntimeExports.jsx(t.Text,{fontSize:x??"sm",fontWeight:"semibold",whiteSpace:"nowrap",children:N(l)})]}),e.jsxRuntimeExports.jsxs(t.Flex,{direction:o?"row-reverse":"row",justifyContent:"center",alignItems:"center",gap:"0.125em",children:[E&&e.jsxRuntimeExports.jsxs(t.Select,{width:"auto",size:x,fontWeight:"bold",value:b,onChange:v=>H(!0,v),isDisabled:z||M,children:[e.jsxRuntimeExports.jsx("option",{value:-1,children:E[0]}),e.jsxRuntimeExports.jsx("option",{value:1,children:E[1]})]}),e.jsxRuntimeExports.jsx(t.NumberInput,{precision:0,size:x??"sm",min:0,max:b<0?Math.abs(n):A??l,value:u===""?"":Math.abs(Number(u??n)),onChange:R,onBlur:P,borderWidth:1,borderRadius:3,borderColor:"#ccc",isDisabled:M,...c,children:e.jsxRuntimeExports.jsx(t.NumberInputField,{backgroundColor:"#fff",paddingRight:0,width:"4em"})}),e.jsxRuntimeExports.jsx(t.NumberInput,{size:x??"sm",min:0,max:C<0?Math.abs(D??n):l,precision:0,value:j===""?"":Math.abs(Number(j??l)),onChange:w,onBlur:P,borderWidth:1,borderRadius:3,borderColor:"#ccc",isDisabled:M,...c,children:e.jsxRuntimeExports.jsx(t.NumberInputField,{backgroundColor:"#fff",paddingRight:0,width:"4em"})}),E&&e.jsxRuntimeExports.jsxs(t.Select,{width:"auto",size:x,fontWeight:"bold",value:C,onChange:v=>H(!1,v),isDisabled:z||M,children:[e.jsxRuntimeExports.jsx("option",{value:-1,children:E[0]}),e.jsxRuntimeExports.jsx("option",{value:1,children:E[1]})]})]})]})},Ce=({tags:o,containerProps:n,...l})=>e.jsxRuntimeExports.jsx(t.HStack,{...n,children:o.map((d,m)=>e.jsxRuntimeExports.jsx(t.Tag,{...l,children:d},m))}),Te=new ge.uFuzzy({}),Se=({action:o,quantumIconSrc:n})=>o.quantumOwned?e.jsxRuntimeExports.jsx(t.Tooltip,{label:"This activity is owned by Quantum","aria-label":"Quantum owned",children:e.jsxRuntimeExports.jsx(t.Box,{boxSize:"1.5em",borderRadius:"full",bg:"black",display:"flex",alignItems:"center",justifyContent:"center",children:e.jsxRuntimeExports.jsx(t.Image,{src:n,boxSize:"1em"})})}):null,Me=(o,n)=>{if(!n||!n.trim().length)return o;const l=o.map(m=>m.name??"");return Te.filter(l,n)?.map(m=>o[m])??[]},Ae=o=>!o||o.length===0?"None":o.map(n=>n.replace(/([A-Z])/g," $1").trim()).join(", "),we=(o,n)=>!n||n.length==0?o:o.filter(l=>l.useCases.some(d=>n.includes(d.id))),xe=({actions:o,totalActions:n,onCreate:l,onDelete:d,onEdit:m,onView:c,onSelected:x,onDuplicate:f,disableMultiSelect:i,disableDelete:N,disableEdit:E,disableCreate:M,hideUseCase:p=!0,tableProps:S,containerProps:a,quantumIconSrc:u="/favicon.ico"})=>{const[j,g]=r.useState(""),[b,C]=r.useState(),z=r.useMemo(()=>{if(!o)return;const R=Me(o,j);return p?R:we(R,b)},[o,j,b,p]),D=r.useCallback(()=>{if(!d)return;const w=o.filter(k=>k.selected&&!k.quantumOwned).map(k=>k.id);d(w)},[o,d]),A=r.useCallback(()=>{if(!f)return;const R=o.filter(w=>w.selected);f(R.map(w=>w.id)),x&&R.forEach(w=>x(w,!1))},[o,f,x]),L=r.useMemo(()=>o.some(R=>R.selected&&!R.quantumOwned),[o]),_=r.useMemo(()=>o.some(R=>R.selected),[o]),P=r.useMemo(()=>o.some(R=>R.selected&&R.quantumOwned),[o]);return e.jsxRuntimeExports.jsxs(t.Box,{...a,children:[e.jsxRuntimeExports.jsxs(t.Flex,{alignContent:"space-between",gap:4,children:[(l||d||f)&&e.jsxRuntimeExports.jsxs(t.ButtonGroup,{mb:"1rem",gap:4,children:[l&&e.jsxRuntimeExports.jsx(t.Button,{isDisabled:!l||M,colorScheme:"blackAlpha",backgroundColor:"gray.700",onClick:l,children:"Create New Activity"}),d&&!i&&e.jsxRuntimeExports.jsx(t.Tooltip,{label:P?L?"Quantum-owned activities are selected and will be skipped":"Selected activities are quantum-owned and cannot be deleted":void 0,children:e.jsxRuntimeExports.jsx(t.Button,{colorScheme:"gray",isDisabled:!L||!d||N,onClick:D,children:"Delete Selected"})}),f&&!i&&e.jsxRuntimeExports.jsx(t.Button,{colorScheme:"gray",isDisabled:!_,onClick:A,children:"Duplicate Selected"})]}),e.jsxRuntimeExports.jsx(Re,{setSearch:g,actions:o,updateUseCases:C,hideUseCaseFilter:p})]}),e.jsxRuntimeExports.jsx(t.TableContainer,{mr:"2rem",overflowX:"hidden",...S,children:e.jsxRuntimeExports.jsxs(t.Table,{size:"md",variant:"simple",children:[e.jsxRuntimeExports.jsx(t.Thead,{position:"sticky",top:0,bg:"white",zIndex:1,children:e.jsxRuntimeExports.jsxs(t.Tr,{children:[e.jsxRuntimeExports.jsxs(t.Th,{fontWeight:"normal",children:["(showing ",z?.length??0," of"," ",n??o.length,")"]}),e.jsxRuntimeExports.jsx(t.Th,{children:"Name"}),e.jsxRuntimeExports.jsx(t.Th,{children:"Sensor Locations"}),!p&&e.jsxRuntimeExports.jsx(t.Th,{children:"Use Case"}),e.jsxRuntimeExports.jsx(t.Th,{})]})}),e.jsxRuntimeExports.jsx(t.Tbody,{children:z?.map(R=>e.jsxRuntimeExports.jsxs(t.Tr,{title:i&&R.selected?"This activity is selected. Click it again to deselect.":void 0,bg:i&&R.selected?"gray.200":void 0,_hover:{bg:i&&!R.selected?"#f7f7f7":void 0},cursor:i?"pointer":"default",onClick:()=>i?x?.(R,!R.selected):void 0,children:[e.jsxRuntimeExports.jsx(t.Td,{children:e.jsxRuntimeExports.jsxs(t.Flex,{children:[x&&!i&&e.jsxRuntimeExports.jsx(t.Checkbox,{isChecked:R.selected,onChange:w=>x(R,w.target.checked)}),(R.quantumOwned||!m)&&c&&e.jsxRuntimeExports.jsx(t.Button,{ml:"1em",size:"sm",variant:"link",colorScheme:"blue",onClick:()=>c(R.id),children:"View"}),!R.quantumOwned&&m&&e.jsxRuntimeExports.jsx(t.Button,{disabled:E,ml:"1em",size:"sm",variant:"link",colorScheme:"blue",onClick:()=>m(R.id),children:"Edit"})]})}),e.jsxRuntimeExports.jsx(t.Td,{whiteSpace:"break-spaces",children:e.jsxRuntimeExports.jsxs(t.Flex,{align:"center",gap:2,children:[e.jsxRuntimeExports.jsx(Se,{action:R,quantumIconSrc:u}),R.name]})}),e.jsxRuntimeExports.jsx(t.Td,{maxW:"20rem",whiteSpace:"break-spaces",children:Ae(R.sensorLocations)}),!p&&e.jsxRuntimeExports.jsx(t.Td,{maxW:"20rem",children:e.jsxRuntimeExports.jsx(Ce,{containerProps:{flexWrap:"wrap"},tags:R.useCases?.map(w=>w.name)??[]})})]},R.id))})]})})]})},Oe=({onSave:o,onCancel:n,onError:l,hideButtons:d=!1,setButtonDisabled:m,setButtonOnClick:c,quantumOwned:x})=>{const f=t.useToast(),[i,N]=r.useState("copy"),[E,M]=r.useState(""),[p,S]=r.useState([]),[a,u]=r.useState(!1),[j]=Q.useQuery({query:y.GET_GROUPS}),[g]=Q.useQuery({query:y.GET_ACTIONS_BY_GROUP,variables:{groupId:E},pause:!E}),[,b]=Q.useMutation(y.CREATE_ACTION),[,C]=Q.useMutation(y.CONVERT_ACTION_TO_QUANTUM_OWNED),z=r.useMemo(()=>j.data?.groups?j.data.groups.map(s=>$.getFragmentData(y.GROUP_FRAGMENT,s)):[],[j.data]),D=r.useMemo(()=>g.data?g.data.actions.map(h=>$.getFragmentData(y.ACTION_FRAGMENT,h)):[],[g.data]),A=r.useMemo(()=>D.filter(s=>p.includes(s.id)),[D,p]),L=r.useCallback(s=>{const h=s?.value||"";M(h),S([])},[]),_=r.useCallback(s=>{const h=s.map(T=>T.value);S(h)},[]),P=r.useCallback(async s=>{const h=$.getFragmentData(y.MODULE_CATEGORY_FRAGMENT,s.categories),T={...s,name:`${s.name} (Copy)`,description:s.description||void 0,instructionsPointOfInterest:s.instructionsPointOfInterest||void 0,instructionsMovementReport:s.instructionsMovementReport||void 0,laterality:s.laterality,activityKind:s.activityKind,sensorLocations:s.sensorLocations,thresholds:s.thresholds.map(B=>({...B,id:void 0})),categories:h?.map(B=>B.id),quantumOwned:x,id:void 0},I=await b({fields:T});if(I.error)throw new Error(I.error.message);if(I.data?.createAction)return $.getFragmentData(y.ACTION_FRAGMENT,I.data.createAction);throw new Error("No action data returned")},[b,x]),R=r.useCallback(async s=>{const h=await C({id:s.id});if(h.error)throw new Error(h.error.message);if(h.data?.convertActionToQuantumOwned)return $.getFragmentData(y.ACTION_FRAGMENT,h.data.convertActionToQuantumOwned);throw new Error("No action data returned")},[C]),w=r.useCallback(async()=>{if(u(!0),!A.length){const s=new Error(`No activities selected for ${i==="copy"?"copying":"converting"}`);l?.(s),u(!1);return}try{const s=[];let h=0;const T=i==="copy"?P:R,I=i==="copy"?"copy":"convert";for(const B of A)try{const U=await T(B);s.push(U)}catch(U){console.error(`Failed to ${I} activity "${B.name}":`,U),h++}if(s.length>0){const B=s.length,U=A.length,Y=i==="copy"?"copied":"converted",q=i==="copy"?"copy":"convert";f({title:h>0?`Partial ${q} completed`:`Activities ${Y} successfully`,description:h>0?`${B} of ${U} activities ${Y} successfully`:`${B} activit${B>1?"ies":"y"} ${Y} successfully`,status:h>0?"warning":"success",duration:3e3,isClosable:!0}),o?.(),M(""),S([])}else throw new Error(`Failed to ${I} any activities`)}catch(s){const h=i==="copy"?"copy":"convert",T=s instanceof Error?s.message:`Failed to ${h} activities`;f({title:`${i==="copy"?"Copy":"Convert"} failed`,description:T,status:"error",duration:5e3,isClosable:!0}),l?.(s instanceof Error?s:new Error(T))}finally{u(!1)}},[A,i,P,R,f,o,l]),k=r.useCallback(()=>{M(""),S([]),N("copy"),n?.()},[n]);r.useEffect(()=>{m&&m({cancelButton:!1,saveButton:A.length===0||a})},[A.length,a,m]),r.useEffect(()=>{c&&c({cancelButton:k,saveButton:w})},[c,k,w]);const H=r.useMemo(()=>z.map(s=>({value:s.id,label:s.name})),[z]),v=r.useMemo(()=>D.filter(s=>i==="copy"?!0:!s.quantumOwned).map(s=>({value:s.id,label:s.name,isQuantumOwned:s.quantumOwned})),[D,i]),G=j.fetching,J=g.fetching;return e.jsxRuntimeExports.jsx(t.Box,{children:e.jsxRuntimeExports.jsxs(t.VStack,{spacing:6,align:"stretch",children:[x&&e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(Z,{children:"Operation Mode"}),e.jsxRuntimeExports.jsx(t.RadioGroup,{value:i,onChange:s=>{N(s),S([])},children:e.jsxRuntimeExports.jsxs(t.HStack,{spacing:6,children:[e.jsxRuntimeExports.jsx(t.Radio,{value:"copy",colorScheme:"blue",children:e.jsxRuntimeExports.jsxs(t.VStack,{align:"start",spacing:1,children:[e.jsxRuntimeExports.jsx(t.Text,{fontWeight:"medium",children:"Copy Activities"}),e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.600",children:"Create new activities based on selected ones"})]})}),e.jsxRuntimeExports.jsx(t.Radio,{value:"convert",colorScheme:"green",children:e.jsxRuntimeExports.jsxs(t.VStack,{align:"start",spacing:1,children:[e.jsxRuntimeExports.jsx(t.Text,{fontWeight:"medium",children:"Convert to Quantum Owned"}),e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.600",children:"Convert existing activities to quantum-owned"})]})})]})})]}),e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(Z,{children:"Select Source Group"}),e.jsxRuntimeExports.jsx(X.st,{placeholder:"Choose a group...",options:H,value:H.find(s=>s.value===E)||null,onChange:L,isLoading:G,isDisabled:G,isClearable:!0}),j.error&&e.jsxRuntimeExports.jsxs(t.Alert,{status:"error",mt:2,children:[e.jsxRuntimeExports.jsx(t.AlertIcon,{}),e.jsxRuntimeExports.jsxs(t.Text,{fontSize:"sm",children:["Failed to load groups: ",j.error.message]})]})]}),E&&e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsxs(Z,{children:["Select Activities to"," ",i==="copy"?"Copy":"Convert"]}),J?e.jsxRuntimeExports.jsxs(t.HStack,{children:[e.jsxRuntimeExports.jsx(t.Spinner,{size:"sm"}),e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.600",children:"Loading activities..."})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(X.st,{placeholder:`Choose activities to ${i}...`,options:v,value:v.filter(s=>p.includes(s.value)),onChange:_,isDisabled:v.length===0,isClearable:!0,isMulti:!0,closeMenuOnSelect:!1,formatOptionLabel:(s,{context:h})=>e.jsxRuntimeExports.jsxs(t.HStack,{justify:"space-between",w:"100%",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxRuntimeExports.jsx(t.Text,{children:s.label}),h==="value"&&s.isQuantumOwned&&e.jsxRuntimeExports.jsx(t.Text,{color:"blue",fontSize:"xs",children:"(Quantum Owned)"})]}),s.isQuantumOwned&&h==="menu"&&e.jsxRuntimeExports.jsx(t.Tag,{size:"sm",colorScheme:"blue",variant:"solid",children:"Quantum Owned"})]})}),v.length===0&&e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.500",mt:2,children:"No activities found"})]}),g.error&&e.jsxRuntimeExports.jsxs(t.Alert,{status:"error",mt:2,children:[e.jsxRuntimeExports.jsx(t.AlertIcon,{}),e.jsxRuntimeExports.jsxs(t.Text,{fontSize:"sm",children:["Failed to load activities: ",g.error.message]})]})]}),A.length>0&&e.jsxRuntimeExports.jsxs(t.Box,{p:4,bg:"gray.50",borderRadius:"md",children:[e.jsxRuntimeExports.jsx(t.Text,{fontWeight:"semibold",mb:3,children:A.length===1?`Activity to ${i==="copy"?"Copy":"Convert"}:`:`${A.length} Activities to ${i==="copy"?"Copy":"Convert"}:`}),e.jsxRuntimeExports.jsxs(t.VStack,{align:"start",spacing:3,children:[A.map((s,h)=>e.jsxRuntimeExports.jsxs(t.Box,{w:"100%",p:3,bg:"white",borderRadius:"md",border:"1px solid",borderColor:"gray.200",children:[e.jsxRuntimeExports.jsxs(t.HStack,{justify:"space-between",align:"start",mb:2,children:[e.jsxRuntimeExports.jsxs(t.Text,{fontWeight:"medium",fontSize:"sm",children:[h+1,". ",s.name]}),s.quantumOwned&&e.jsxRuntimeExports.jsx(t.Tag,{size:"sm",colorScheme:"blue",variant:"solid",children:"Quantum Owned"})]}),e.jsxRuntimeExports.jsxs(t.VStack,{align:"start",spacing:1,fontSize:"sm",color:"gray.600",children:[s.description&&e.jsxRuntimeExports.jsxs(t.Text,{children:[e.jsxRuntimeExports.jsx("strong",{children:"Description:"})," ",s.description]}),e.jsxRuntimeExports.jsxs(t.Text,{children:[e.jsxRuntimeExports.jsx("strong",{children:"Type:"})," ",s.activityKind]}),e.jsxRuntimeExports.jsxs(t.Text,{children:[e.jsxRuntimeExports.jsx("strong",{children:"Laterality:"})," ",s.laterality]}),e.jsxRuntimeExports.jsxs(t.Text,{children:[e.jsxRuntimeExports.jsx("strong",{children:"Sensor Locations:"})," ",s.sensorLocations.length]}),e.jsxRuntimeExports.jsxs(t.Text,{children:[e.jsxRuntimeExports.jsx("strong",{children:"Thresholds:"})," ",s.thresholds.length]}),e.jsxRuntimeExports.jsxs(t.Text,{children:[e.jsxRuntimeExports.jsx("strong",{children:"Use Cases:"})," ",s.useCases.map(T=>T.name).join(", ")||"None"]})]})]},s.id)),A.length>1&&e.jsxRuntimeExports.jsx(t.Box,{w:"100%",p:2,bg:"blue.50",borderRadius:"md",border:"1px solid",borderColor:"blue.200",children:e.jsxRuntimeExports.jsxs(t.Text,{fontSize:"sm",fontWeight:"medium",color:"blue.800",children:["Total: ",A.length," activities will be"," ",i==="copy"?"copied":"converted"]})})]})]}),!d&&e.jsxRuntimeExports.jsxs(t.ButtonGroup,{spacing:4,justifyContent:"flex-end",children:[e.jsxRuntimeExports.jsx(t.Button,{variant:"outline",onClick:k,isDisabled:a,children:"Cancel"}),e.jsxRuntimeExports.jsxs(t.Button,{colorScheme:i==="copy"?"blue":"green",onClick:w,isDisabled:A.length===0||a,isLoading:a,loadingText:`${i==="copy"?"Copying":"Converting"}...`,children:[i==="copy"?"Copy":"Convert"," ",A.length===1?"Activity":`${A.length} Activities`]})]})]})})},Fe=({onSave:o,onCancel:n,onError:l,hideButtons:d=!1,setButtonDisabled:m,setButtonOnClick:c,quantumOwned:x})=>{const f=t.useToast(),[i,N]=r.useState(""),[E,M]=r.useState([]),[p,S]=r.useState(!1),[a,u]=r.useState("copy"),[j]=Q.useQuery({query:y.GET_GROUPS}),[g]=Q.useQuery({query:y.GET_MODULES_BY_GROUP,variables:{groupId:i},pause:!i}),[,b]=Q.useMutation(y.CREATE_MODULE),[,C]=Q.useMutation(y.UPDATE_MODULE),[,z]=Q.useMutation(y.CREATE_ACTION),[,D]=Q.useMutation(y.CONVERT_ACTION_TO_QUANTUM_OWNED),A=r.useMemo(()=>j.data?.groups?j.data.groups.map(s=>$.getFragmentData(y.GROUP_FRAGMENT,s)):[],[j.data]),L=r.useMemo(()=>g.data?.modules?$.getFragmentData(y.ACTION_MODULE_FRAGMENT,g.data?.modules).map(h=>{const T=$.getFragmentData(y.MODULE_ACTION_FRAGMENT,h.moduleActions);return{...h,moduleActions:T.map(I=>({...I,action:$.getFragmentData(y.ACTION_FRAGMENT,I.action)})),categories:$.getFragmentData(y.MODULE_CATEGORY_FRAGMENT,h.categories)}}):[],[g.data]),_=r.useMemo(()=>L.filter(s=>E.includes(s.id)),[L,E]),P=r.useCallback(s=>{const h=s?.value||"";N(h),M([])},[]),R=r.useCallback(s=>{const h=s.map(T=>T.value);M(h)},[]),w=r.useCallback(async()=>{if(S(!0),!_.length){S(!1);const s=new Error(`No modules selected for ${a==="convert"?"converting":"copying"}`);l?.(s);return}try{const s=[];let h=0;for(const T of _)try{let I=T.moduleActions.map(B=>B.actionId);if(x){const B=T.moduleActions.map(q=>q.action),U=async q=>{if(a==="copy"){if(q.quantumOwned)return q;const ce=$.getFragmentData(y.MODULE_CATEGORY_FRAGMENT,q.categories),ne={...q,quantumOwned:!0,thresholds:q.thresholds.map(O=>({...O,id:void 0})),categories:ce?.map(O=>O.id),id:void 0},se=await z({fields:ne});return se.error||!se.data?.createAction?null:$.getFragmentData(y.ACTION_FRAGMENT,se.data.createAction)}if(q.quantumOwned)return q;const te=await D({id:q.id});return te.error||!te.data?.convertActionToQuantumOwned?null:$.getFragmentData(y.ACTION_FRAGMENT,te.data.convertActionToQuantumOwned)};I=(await Promise.all(B.map(U))).filter(q=>!!q).map(q=>q.id)}if(a==="convert"){const B={name:T.name,description:T.description||void 0,actions:I,categories:T.categories.map(Y=>Y.id),quantumOwned:!0},U=await C({id:T.id,input:B});if(U.error)throw new Error(U.error.message);if(U.data?.updateModule){const Y=$.getFragmentData(y.ACTION_MODULE_FRAGMENT,U.data.updateModule);s.push(Y)}}else{const B={name:`${T.name} (Copy)`,description:T.description||void 0,actions:I,categories:T.categories.map(Y=>Y.id),quantumOwned:x},U=await b({input:B});if(U.error)throw new Error(U.error.message);if(U.data?.createModule){const Y=$.getFragmentData(y.ACTION_MODULE_FRAGMENT,U.data.createModule);s.push(Y)}}}catch(I){console.error(`Failed to ${a==="convert"?"convert":"copy"} module "${T.name}":`,I),h++}if(s.length>0){const T=s.length,I=_.length;f({title:h>0?`Partial ${a==="convert"?"convert":"copy"} completed`:`Modules ${a==="convert"?"converted":"copied"} successfully`,description:h>0?`${T} of ${I} modules ${a==="convert"?"converted":"copied"} successfully`:`${T} module${T>1?"s":""} ${a==="convert"?"converted":"copied"} successfully`,status:h>0?"warning":"success",duration:3e3,isClosable:!0}),s.length>0&&o?.(),N(""),M([])}else throw new Error(`Failed to ${a==="convert"?"convert":"copy"} any modules`)}catch(s){const h=s instanceof Error?s.message:`Failed to ${a==="convert"?"convert":"copy"} modules`;f({title:a==="convert"?"Convert failed":"Copy failed",description:h,status:"error",duration:5e3,isClosable:!0}),l?.(s instanceof Error?s:new Error(h))}finally{S(!1)}},[_,b,C,f,o,l,x,z,D,a]),k=r.useCallback(()=>{N(""),M([]),u("copy"),n?.()},[n]);r.useEffect(()=>{m&&m({cancelButton:!1,saveButton:_.length===0||p})},[_.length,p,m]),r.useEffect(()=>{c&&c({cancelButton:k,saveButton:w})},[c,k,w]);const H=r.useMemo(()=>A.map(s=>({value:s.id,label:s.name})),[A]),v=r.useMemo(()=>L.filter(s=>a==="copy"?!0:!s.quantumOwned).map(s=>({value:s.id,label:s.name,isQuantumOwned:s.quantumOwned})),[L,a]),G=j.fetching,J=g.fetching;return e.jsxRuntimeExports.jsx(t.Box,{children:e.jsxRuntimeExports.jsxs(t.VStack,{spacing:6,align:"stretch",children:[x&&e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(Z,{children:"Operation Mode"}),e.jsxRuntimeExports.jsx(t.RadioGroup,{value:a,onChange:s=>{u(s),M([])},children:e.jsxRuntimeExports.jsxs(t.HStack,{spacing:6,children:[e.jsxRuntimeExports.jsx(t.Radio,{value:"copy",colorScheme:"blue",children:e.jsxRuntimeExports.jsxs(t.VStack,{align:"start",spacing:1,children:[e.jsxRuntimeExports.jsx(t.Text,{fontWeight:"medium",children:"Copy Modules"}),e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.600",children:"Create new modules based on selected ones"})]})}),e.jsxRuntimeExports.jsx(t.Radio,{value:"convert",colorScheme:"green",children:e.jsxRuntimeExports.jsxs(t.VStack,{align:"start",spacing:1,children:[e.jsxRuntimeExports.jsx(t.Text,{fontWeight:"medium",children:"Convert to Quantum Owned"}),e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.600",children:"Convert existing modules to quantum-owned"})]})})]})})]}),e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(Z,{children:"Select Source Group"}),e.jsxRuntimeExports.jsx(X.st,{placeholder:"Choose a group...",options:H,value:H.find(s=>s.value===i)||null,onChange:P,isLoading:G,isDisabled:G,isClearable:!0}),j.error&&e.jsxRuntimeExports.jsxs(t.Alert,{status:"error",mt:2,children:[e.jsxRuntimeExports.jsx(t.AlertIcon,{}),e.jsxRuntimeExports.jsxs(t.Text,{fontSize:"sm",children:["Failed to load groups: ",j.error.message]})]})]}),i&&e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(Z,{children:a==="convert"?"Select Module to Convert":"Select Module to Copy"}),J?e.jsxRuntimeExports.jsxs(t.HStack,{children:[e.jsxRuntimeExports.jsx(t.Spinner,{size:"sm"}),e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.600",children:"Loading modules..."})]}):e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(X.st,{placeholder:a==="convert"?"Choose modules to convert...":"Choose modules to copy...",options:v,value:v.filter(s=>E.includes(s.value)),onChange:R,isDisabled:v.length===0,isClearable:!0,isMulti:!0,closeMenuOnSelect:!1,formatOptionLabel:(s,{context:h})=>e.jsxRuntimeExports.jsxs(t.HStack,{justify:"space-between",w:"100%",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxRuntimeExports.jsx(t.Text,{children:s.label}),h==="value"&&s.isQuantumOwned&&e.jsxRuntimeExports.jsx(t.Text,{color:"blue",fontSize:"xs",children:"(Quantum Owned)"})]}),s.isQuantumOwned&&h==="menu"&&e.jsxRuntimeExports.jsx(t.Tag,{size:"sm",colorScheme:"blue",variant:"solid",children:"Quantum Owned"})]})}),v.length===0&&e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.500",mt:2,children:"No modules found in this group"})]}),g.error&&e.jsxRuntimeExports.jsxs(t.Alert,{status:"error",mt:2,children:[e.jsxRuntimeExports.jsx(t.AlertIcon,{}),e.jsxRuntimeExports.jsxs(t.Text,{fontSize:"sm",children:["Failed to load modules: ",g.error.message]})]})]}),_.length>0&&e.jsxRuntimeExports.jsxs(t.Box,{p:4,bg:"gray.50",borderRadius:"md",children:[e.jsxRuntimeExports.jsx(t.Text,{fontWeight:"semibold",mb:3,children:_.length===1?`Module to ${a==="copy"?"Copy":"Convert"}`:`${_.length} Modules to ${a==="copy"?"Copy":"Convert"}`}),e.jsxRuntimeExports.jsxs(t.VStack,{align:"start",spacing:3,children:[_.map((s,h)=>e.jsxRuntimeExports.jsxs(t.Box,{w:"100%",p:3,bg:"white",borderRadius:"md",border:"1px solid",borderColor:"gray.200",children:[e.jsxRuntimeExports.jsxs(t.HStack,{justify:"space-between",align:"start",mb:2,children:[e.jsxRuntimeExports.jsxs(t.Text,{fontWeight:"medium",fontSize:"sm",children:[h+1,". ",s.name]}),s.quantumOwned&&e.jsxRuntimeExports.jsx(t.Tag,{size:"sm",colorScheme:"blue",variant:"solid",children:"Quantum Owned"})]}),e.jsxRuntimeExports.jsxs(t.VStack,{align:"start",spacing:1,fontSize:"sm",color:"gray.600",children:[s.description&&e.jsxRuntimeExports.jsxs(t.Text,{children:[e.jsxRuntimeExports.jsx("strong",{children:"Description:"})," ",s.description]}),e.jsxRuntimeExports.jsxs(t.Text,{children:[e.jsxRuntimeExports.jsx("strong",{children:"Actions:"})," ",s.moduleActions.length]}),e.jsxRuntimeExports.jsxs(t.Text,{children:[e.jsxRuntimeExports.jsx("strong",{children:"Categories:"})," ",s.categories.map(T=>T.name).join(", ")||"None"]})]})]},s.id)),_.length>1&&e.jsxRuntimeExports.jsx(t.Box,{w:"100%",p:2,bg:"blue.50",borderRadius:"md",border:"1px solid",borderColor:"blue.200",children:e.jsxRuntimeExports.jsxs(t.Text,{fontSize:"sm",fontWeight:"medium",color:"blue.800",children:["Total: ",_.length," modules will be"," ",a==="copy"?"copied":"converted"]})}),x&&_.filter(s=>s.moduleActions.some(h=>!h.action.quantumOwned)).length>0&&e.jsxRuntimeExports.jsx(t.Box,{p:2,bg:"yellow.50",borderRadius:"md",border:"1px solid",borderColor:"yellow.200",children:e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",fontWeight:"medium",color:"yellow.800",children:a==="convert"?"Converting Modules will convert non QM-Owned Actions to QM-Owned":"Copying Modules with Non QM-Owned Actions will create corresponding QM-Owned Actions"})})]})]}),!d&&e.jsxRuntimeExports.jsxs(t.ButtonGroup,{spacing:4,justifyContent:"flex-end",children:[e.jsxRuntimeExports.jsx(t.Button,{variant:"outline",onClick:k,isDisabled:p,children:"Cancel"}),e.jsxRuntimeExports.jsxs(t.Button,{colorScheme:a==="copy"?"blue":"green",onClick:w,isDisabled:_.length===0||p,isLoading:p,loadingText:`${a==="copy"?"Copying":"Converting"}...`,children:[a==="copy"?"Copy":"Convert"," ",_.length===1?"Module":`${_.length} Modules`]})]})]})})},me=({name:o,setName:n,actions:l,selectedActionIds:d,setSelectedActionIds:m,availableCategories:c,selectedCategoryIds:x,setSelectedCategoryIds:f,description:i,setDescription:N,...E})=>{const M=t.useDisclosure(),p=r.useMemo(()=>l.map(b=>({...b,selected:d.includes(b.id)})),[l,d]),S=r.useMemo(()=>l.reduce((b,C)=>(b[C.id]=C,b),{}),[l]),a=r.useMemo(()=>d.map(b=>S[b]),[p,d]),u=r.useCallback((b,C)=>{m(C?[...d,b.id]:d.filter(z=>z!==b.id))},[d,m]),j=r.useCallback(b=>{n(b.target.value)},[n]),g=r.useCallback(b=>{N?.(b.target.value)},[N]);return e.jsxRuntimeExports.jsxs(t.Box,{...E,children:[e.jsxRuntimeExports.jsxs(t.HStack,{gap:"2rem",children:[e.jsxRuntimeExports.jsx(Ne,{name:o??"",onInputChange:j}),e.jsxRuntimeExports.jsx(Le,{availableCategories:c,value:x,onChange:f})]}),e.jsxRuntimeExports.jsx(ke,{description:i??"",onInputChange:g}),e.jsxRuntimeExports.jsx(Ie,{value:a,onChange:m,onAdjustActivities:()=>M.onOpen()}),e.jsxRuntimeExports.jsxs(t.Modal,{isOpen:M.isOpen,onClose:M.onClose,size:"6xl",children:[e.jsxRuntimeExports.jsx(t.ModalOverlay,{}),e.jsxRuntimeExports.jsxs(t.ModalContent,{children:[e.jsxRuntimeExports.jsx(t.ModalHeader,{children:"Select Activities"}),e.jsxRuntimeExports.jsx(t.ModalCloseButton,{}),e.jsxRuntimeExports.jsx(t.ModalBody,{children:e.jsxRuntimeExports.jsx(xe,{actions:p,onSelected:u,disableCreate:!0,disableDelete:!0,tableProps:{height:"28rem",overflowY:"auto"}})}),e.jsxRuntimeExports.jsx(t.ModalFooter,{children:e.jsxRuntimeExports.jsx(t.Button,{colorScheme:"blue",onClick:M.onClose,isDisabled:d.length===0,children:"Done"})})]})]})]})},Ne=r.memo(({name:o,onInputChange:n})=>e.jsxRuntimeExports.jsxs(t.FormControl,{mb:4,children:[e.jsxRuntimeExports.jsx(Z,{children:"Module Name"}),e.jsxRuntimeExports.jsx(t.Input,{placeholder:"i.e. ACL RTP Test Battery",value:o,onChange:n,isRequired:!0})]})),Le=r.memo(({availableCategories:o,value:n,onChange:l})=>{const d=r.useMemo(()=>[...o,{id:"other",name:"Other"}],[o]),m=r.useMemo(()=>d.map(c=>({value:c.id,label:c.name})),[d]);return e.jsxRuntimeExports.jsxs(t.FormControl,{mb:4,children:[e.jsxRuntimeExports.jsx(Z,{children:"Module Category"}),e.jsxRuntimeExports.jsx(X.st,{isDisabled:o.length===0,isClearable:!0,options:m,value:d.filter(c=>n.includes(c.id)).map(c=>({value:c.id,label:c.name})),onChange:c=>l(c?[c.value]:[]),placeholder:"Select category"})]})}),ke=r.memo(({description:o,onInputChange:n})=>e.jsxRuntimeExports.jsxs(t.FormControl,{mb:4,children:[e.jsxRuntimeExports.jsx(Z,{children:e.jsxRuntimeExports.jsxs("span",{children:["Description",e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.500",children:"Briefly describe the objective of this module. Max 40 words."})]})}),e.jsxRuntimeExports.jsx(t.Input,{placeholder:"i.e. Assess readiness to return to play post-ACL reconstruction",value:o,onChange:n})]})),Ie=r.memo(({value:o,onChange:n,onAdjustActivities:l})=>{const d=r.useMemo(()=>o.map(m=>({id:m.id,name:m.name})),[o]);return e.jsxRuntimeExports.jsxs(t.FormControl,{mb:4,children:[e.jsxRuntimeExports.jsxs(t.HStack,{justifyContent:"space-between",children:[e.jsxRuntimeExports.jsx(Z,{children:e.jsxRuntimeExports.jsxs("span",{children:["Activities",e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",color:"gray.500",children:"Drag and drop to reorder the activities in this module."})]})}),e.jsxRuntimeExports.jsx(t.Button,{size:"sm",variant:"solid",colorScheme:"blue",onClick:l,children:"Add / Remove Activities"})]}),d.length===0?e.jsxRuntimeExports.jsx(t.VStack,{children:e.jsxRuntimeExports.jsxs(t.Text,{color:"gray.500",fontSize:"lg",mb:"4rem",mt:"4rem",children:["No activities selected for this module.",e.jsxRuntimeExports.jsx(t.Button,{ml:"0.5em",size:"sm",variant:"link",colorScheme:"blue",onClick:l,children:"Add activities."})]})}):e.jsxRuntimeExports.jsx(fe,{value:d,onChange:m=>{const c=m(d);n(c.map(x=>x.id))}})]})}),pe=({value:o,onChange:n,forceKind:l,disableRemove:d,disableKind:m,isDisabled:c,lockRanges:x,...f})=>{const i=r.useMemo(()=>[...o].sort((p,S)=>{const a=oe.availablePlanes.indexOf(p.plane),u=oe.availablePlanes.indexOf(S.plane);return a-u}),[o]),N=r.useCallback(p=>"segment"in p.id?K.getSegmentNameWithPlane(p.id.segment,p.plane,!0)??"Unknown":K.getJointNameWithPlane(p.id.joint,p.plane,!0)??"Unknown",[]),E=r.useCallback((p,S)=>{const a=i.findIndex(j=>j.id===S.id&&j.plane===S.plane);let u=[...i];l&&(S={...S,kind:l}),u[a]=S,x&&(u=u.map(j=>({...j,min:S.min,max:S.max}))),n(u)},[n,i,l,x]),M=r.useCallback(p=>{const S=i.filter(a=>a.id!==p.id||a.plane!==p.plane);n(S)},[n,i]);return e.jsxRuntimeExports.jsx(t.VStack,{alignItems:"flex-start",overflowY:"auto",...f,children:i.map((p,S)=>e.jsxRuntimeExports.jsx(De,{label:N(p),parameter:p,onChange:a=>E(S,a),onRemove:d||c?void 0:()=>M(p),forceKind:l,disableKind:m||c,isDisabled:c},`${JSON.stringify(p.id)}-${p.plane}`))})},De=({label:o,parameter:n,onChange:l,onRemove:d,forceKind:m,disableKind:c,isDisabled:x})=>{const f=r.useCallback(E=>"joint"in n.id?K.getJointAngleDirectionName(n.id.joint,n.plane,E<0?-1:1):K.getSegmentAngleDirectionName(n.id.segment,n.plane,E<0?-1:1),[n]),{min:i,max:N}="joint"in n.id?K.getNormativeJointRange(n.id.joint,n.plane):{min:-180,max:180};return e.jsxRuntimeExports.jsxs(t.VStack,{borderRadius:"md",p:2,px:4,bg:"gray.100",w:"100%",overflow:"hidden",flexShrink:"0",children:[e.jsxRuntimeExports.jsxs(t.HStack,{w:"100%",children:[e.jsxRuntimeExports.jsx(t.Text,{fontSize:"sm",flex:1,textTransform:"capitalize",fontWeight:"semibold",children:o}),d&&!x&&e.jsxRuntimeExports.jsx(t.IconButton,{size:"xs",variant:"ghost","aria-label":"delete",icon:e.jsxRuntimeExports.jsx(t.Icon,{as:de.FaTrash}),onClick:d}),!m&&e.jsxRuntimeExports.jsx(ve,{selectedItem:n?.kind??F.ThresholdKind.Limit,onChange:({value:E})=>l({...n,kind:E}),isDisabled:c||x,buttonProps:{size:"sm",variant:"outline",colorScheme:"gray"},selectedProps:{variant:"solid",colorScheme:"teal"},items:[{value:F.ThresholdKind.Limit,label:"limit"},{value:F.ThresholdKind.Target,label:"target"}]})]}),e.jsxRuntimeExports.jsx(ye,{w:"100%",size:"xs",min:i,max:N,zeroMarker:!0,value:[n.min,n.max],onChange:E=>l({...n,min:E[0],max:E[1]}),formatValue:E=>`${Math.abs(E)}°`,valueLabel:E=>f(E)??"",positiveNegativeLabels:f(0)?[f(-1)??"",f(1)??""]:void 0,isDisabled:x})]})},ae=(o,n)=>"segment"in o&&"segment"in n&&o.segment===n.segment||"joint"in o&&"joint"in n&&o.joint===n.joint,he=({options:o,value:n,onChange:l,forceKind:d,singleValue:m,singleValueSideless:c,editOnly:x,disableKind:f,maxParameters:i,...N})=>{const E=c?2:i,M=r.useMemo(()=>o.map(u=>({label:"segment"in u.id?K.getSegmentNameWithPlane(u.id.segment,u.plane,!0)??"Unknown":K.getJointNameWithPlane(u.id.joint,u.plane,!0)??"Unknown",value:u.id,plane:u.plane})),[o]),p=r.useMemo(()=>{if(!c||n.length===0)return M;const u=n[0];return M.filter(j=>oe.getAnalysisPartIdNoSide(j.value)===oe.getAnalysisPartIdNoSide(u.id)&&j.plane===u.plane)},[M,n,c]),S=r.useMemo(()=>M.filter(u=>n.some(j=>ae(j.id,u.value)&&j.plane===u.plane)),[M,n]),a=r.useCallback(u=>{const j=u.map(g=>{const b=n.find(L=>ae(L.id,g.value)&&L.plane===g.plane),C=o.find(L=>ae(L.id,g.value)&&L.plane===g.plane),z=c?n.find(L=>oe.getAnalysisPartIdNoSide(L.id)===oe.getAnalysisPartIdNoSide(g.value)&&L.plane===g.plane):void 0,D=z&&!b?z.min:C&&C.min?C.min:0,A=z&&!b?z.max:C&&C.max?C.max:0;return b??{id:g.value,plane:g.plane,min:D,max:A,kind:d??F.ThresholdKind.Limit}});l(j)},[l,n,o,d,c]);return r.useEffect(()=>{const u=n.filter(j=>o.some(g=>ae(g.id,j.id)&&g.plane===j.plane));u.length!==n.length&&l(u)},[o,l]),e.jsxRuntimeExports.jsxs(t.Box,{...N,children:[e.jsxRuntimeExports.jsx(X.st,{isMulti:!m,placeholder:n.length?`${n.length} selected`:"Search...",value:S,isDisabled:x||S.length>=(E??1/0),onChange:u=>Array.isArray(u)?a([...u]):a(u!==null?[u]:[]),options:p,controlShouldRenderValue:!1}),e.jsxRuntimeExports.jsx(pe,{marginTop:2,maxH:"28rem",value:n,onChange:l,forceKind:d,disableKind:f,isDisabled:x,lockRanges:c})]})},je=o=>{switch(o){case F.SensorLocation.Thorax:return"Thorax";case F.SensorLocation.CenterBack:return"Center Back";case F.SensorLocation.Pelvis:return"Pelvis";case F.SensorLocation.LeftThigh:return"Left Thigh";case F.SensorLocation.RightThigh:return"Right Thigh";case F.SensorLocation.LeftShank:return"Left Shank";case F.SensorLocation.RightShank:return"Right Shank";case F.SensorLocation.LeftFoot:return"Left Foot";case F.SensorLocation.RightFoot:return"Right Foot";case F.SensorLocation.LeftUpperArm:return"Left Upper Arm";case F.SensorLocation.RightUpperArm:return"Right Upper Arm";case F.SensorLocation.LeftForearm:return"Left Forearm";case F.SensorLocation.RightForearm:return"Right Forearm";case F.SensorLocation.Head:return"Head"}return console.warn(`Unknown sensor location: ${o}`),"Unknown"},_e=6,Ge=[F.SensorLocation.LeftFoot,F.SensorLocation.LeftShank,F.SensorLocation.LeftThigh,F.SensorLocation.Pelvis,F.SensorLocation.RightFoot,F.SensorLocation.RightShank,F.SensorLocation.RightThigh,F.SensorLocation.Thorax,F.SensorLocation.CenterBack,F.SensorLocation.Head],Be=Ge.map(o=>({label:je(o),value:o})),ue=(o,n)=>o.map(l=>({label:n?n(l):l,value:l})),Pe=({id:o,onError:n,onCancel:l,onSave:d,hideButtons:m,setButtonOnClick:c,setButtonDisabled:x,quantumOwned:f,isView:i})=>{const[{fetching:N},E]=Q.useMutation(y.CREATE_ACTION),[{fetching:M},p]=Q.useMutation(y.UPDATE_ACTION),[{data:S}]=Q.useQuery({query:y.GET_ACTION_BY_ID,variables:{id:o??""},pause:!o}),a=$.getFragmentData(y.ACTION_FRAGMENT,S?.getActionById),u=N||M,j=!!a&&!!o,[g,b]=r.useState(""),[C,z]=r.useState(""),[D,A]=r.useState(""),[L,_]=r.useState(""),[P,R]=r.useState(),[w,k]=r.useState([]),[H,v]=r.useState([]),[G,J]=r.useState([]),s=r.useMemo(()=>H.map(O=>O.value),[H]),h=Ee.usePartOptionsForSensorLocations(s),[{data:T}]=Q.useQuery({query:y.GET_ALL_MODULE_CATEGORIES}),I=r.useMemo(()=>$.getFragmentData(y.MODULE_CATEGORY_FRAGMENT,T?.moduleCategories)?.map(W=>({label:W.name,value:W.id})),[T?.moduleCategories]),B=r.useMemo(()=>ue(Object.values(F.SessionType),K.mapSessionTypeEnumToLabel),[]),[U,Y]=r.useState([]),q=g.length>0,[te,ce]=r.useState({});r.useEffect(()=>{if(a){const O=$.getFragmentData(y.MODULE_CATEGORY_FRAGMENT,a.categories),W={name:a.name,activityType:a.activityType??void 0,description:a.description||"",cameraPlacement:a.cameraPlacement||"",videoLink:a.videoLink||"",sessionType:a.sessionType.map(V=>({label:K.mapSessionTypeEnumToLabel(V),value:V})),categories:O?.map(V=>V.id)||[],sensorLocations:a.sensorLocations.map(V=>({label:je(V),value:V})),thresholds:re.thresholdsToParameters(a.thresholds)};b(W.name),R(W.activityType??void 0),z(W.description),A(W.cameraPlacement),_(W.videoLink),k(W.sessionType),J(O?.map(V=>V.id)||[]),v(W.sensorLocations),Y(W.thresholds),ce(W)}},[a]);const ne=r.useMemo(()=>JSON.stringify(te)!==JSON.stringify({name:g,description:C,cameraPlacement:D,videoLink:L,activityType:P,sessionType:w.map(O=>O.value),categories:G,sensorLocations:s,thresholds:re.parametersToThresholds(U)}),[te,g,s,C,D,L,P,w,G,U]),se=r.useCallback(()=>{const O={name:g,description:C,cameraPlacement:D,videoLink:L,activityType:P,activityKind:K.getActivityKindFromActivityType(P),sessionType:w.map(V=>V.value),categories:G,sensorLocations:s,thresholds:re.parametersToThresholds(U),laterality:F.ActionLaterality.Either,quantumOwned:f};let W;j&&o?W=p({id:o,fields:O}):W=E({fields:O}),W.then(({error:V})=>{V?n(V):d()})},[f,E,p,o,g,s,C,D,L,P,w,G,j,U,d,n]);return r.useEffect(()=>{x&&x({cancelButton:u,saveButton:i?!0:u||!q||!ne})},[u,x,q,ne,i]),r.useEffect(()=>{c&&c({cancelButton:l,saveButton:i?()=>{}:se})},[c,l,se,i]),console.log(q,ne,u,te),e.jsxRuntimeExports.jsxs("div",{className:"grid grid-cols-2 gap-4 w-full",children:[e.jsxRuntimeExports.jsxs("div",{className:"col-span-2 lg:col-span-1 flex flex-col gap-4",children:[e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(ee,{children:"Name"}),e.jsxRuntimeExports.jsx(t.Input,{value:g,onChange:O=>b(O.target.value),type:"text",placeholder:"i.e. Lunge & Return",isDisabled:i})]}),e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(ee,{children:"Activity Type"}),e.jsxRuntimeExports.jsx(X.st,{isClearable:!0,isMulti:!1,value:P?{label:K.mapActivityTypeEnumToLabel(P),value:P}:null,onChange:O=>R(O?.value),options:ue(Object.values(F.ActivityType),K.mapActivityTypeEnumToLabel),placeholder:"(optional) Select activity type",isDisabled:i})]}),e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(ee,{children:"Camera Placement"}),e.jsxRuntimeExports.jsx(t.Textarea,{value:D,onChange:O=>A(O.target.value),rows:2,placeholder:"(optional) Describe camera setup, placement, angles",isDisabled:i})]}),e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(ee,{children:"Video Link"}),e.jsxRuntimeExports.jsx(t.Input,{value:L,onChange:O=>_(O.target.value),type:"url",placeholder:"(optional) https://...",isDisabled:i})]}),e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(ee,{children:"Description"}),e.jsxRuntimeExports.jsx(t.Textarea,{value:C,onChange:O=>z(O.target.value),rows:2,placeholder:"(optional) Describe how to perform the test or exercise",isDisabled:i})]}),e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(ee,{children:"Link to Category"}),e.jsxRuntimeExports.jsx(X.st,{isMulti:!0,value:I?.filter(O=>G.includes(O.value)),onChange:O=>J((O??[]).map(W=>W.value)),options:I,placeholder:"Select one or more categories",isDisabled:i})]}),e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(ee,{children:"Session Types"}),e.jsxRuntimeExports.jsx(X.st,{isMulti:!0,value:w,onChange:O=>k(O??[]),options:B,placeholder:"Select one or more session types",isDisabled:i})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"col-span-2 lg:col-span-1 flex flex-col gap-4",children:[e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(ee,{children:"Sensor Locations"}),e.jsxRuntimeExports.jsx(X.st,{isMulti:!0,value:H,onChange:O=>v([...O]),options:Be,isOptionDisabled:()=>H.length>=_e,isDisabled:i})]}),e.jsxRuntimeExports.jsxs(t.FormControl,{children:[e.jsxRuntimeExports.jsx(ee,{children:"Default Parameters"}),e.jsxRuntimeExports.jsx(he,{options:h,value:U,onChange:Y,editOnly:i})]})]}),e.jsxRuntimeExports.jsx("div",{className:re.cn("col-span-2 flex justify-end",(m||i)&&"hidden"),children:e.jsxRuntimeExports.jsxs(t.ButtonGroup,{mt:16,gap:4,children:[e.jsxRuntimeExports.jsx(t.Button,{colorScheme:"gray",isDisabled:u,onClick:l,children:"Cancel"}),e.jsxRuntimeExports.jsx(t.Button,{colorScheme:"blue",isDisabled:u||!q||!ne,isLoading:u,onClick:se,children:"Save changes"})]})})]})},ee=({children:o})=>e.jsxRuntimeExports.jsx(t.FormLabel,{fontWeight:"bold",fontFamily:"sans-serif",fontSize:"large",children:o}),ze=({id:o,onCancel:n,onSave:l,onError:d,hideButtons:m,quantumOwned:c,setButtonOnClick:x,setButtonDisabled:f})=>{const[{data:i}]=Q.useQuery({query:c?y.GET_QUANTUM_OWNED_ACTIONS:y.GET_ACTIONS}),[{data:N}]=Q.useQuery({query:y.GET_MODULE_BY_ID,variables:{id:o},pause:!o}),[{data:E}]=Q.useQuery({query:y.GET_ALL_MODULE_CATEGORIES}),M=$.getFragmentData(y.MODULE_CATEGORY_FRAGMENT,E?.moduleCategories),[{fetching:p},S]=Q.useMutation(y.UPDATE_MODULE),[{fetching:a},u]=Q.useMutation(y.CREATE_MODULE),j=$.getFragmentData(y.ACTION_FRAGMENT,c?i?.quantumOwnedActions:i?.actions)??[],g=$.getFragmentData(y.ACTION_MODULE_FRAGMENT,N?.module),b=$.getFragmentData(y.MODULE_ACTION_FRAGMENT,g?.moduleActions)??[],[C,z]=r.useState([...b.map(k=>k.actionId)??[]]),[D,A]=r.useState(g?.name??""),[L,_]=r.useState([]),[P,R]=r.useState(g?.description??"");r.useEffect(()=>{g&&(z(b.map(k=>k.actionId)),A(g.name),R(g.description??""),_(g.categories.map(k=>$.getFragmentData(y.MODULE_CATEGORY_FRAGMENT,k).id)??[]))},[g,b]);const w=r.useCallback(()=>{let k;const H={actions:C,name:D,categories:L.filter(v=>v!=="other"),description:P,quantumOwned:c};g?k=S({id:g.id,input:H}):k=u({input:H}),k.then(({error:v})=>{v?d(v):l()})},[u,S,C,D,P,L,g,l,d]);return r.useEffect(()=>{f&&f({cancelButton:p||a,saveButton:p||a||!D||P.trim().split(/\s+/).filter(Boolean).length>40})},[f,p,a,C,D,P]),r.useEffect(()=>{x&&x({cancelButton:n,saveButton:w})},[x,n,w]),e.jsxRuntimeExports.jsxs(t.Box,{width:"100%",children:[e.jsxRuntimeExports.jsx(me,{name:D,setName:A,actions:j,selectedActionIds:C,setSelectedActionIds:z,availableCategories:M??[],selectedCategoryIds:L,setSelectedCategoryIds:_,description:P,setDescription:R}),!m&&e.jsxRuntimeExports.jsx(t.HStack,{justifyContent:"flex-start",children:e.jsxRuntimeExports.jsxs(t.ButtonGroup,{mt:16,gap:4,children:[e.jsxRuntimeExports.jsx(t.Button,{colorScheme:"gray",isDisabled:p||a,onClick:n,children:"Cancel"}),e.jsxRuntimeExports.jsx(t.Button,{colorScheme:"blue",isDisabled:p||a||!D||P.trim().split(/\s+/).filter(Boolean).length>40,isLoading:p||a,onClick:w,children:"Save"})]})})]})};exports.ActivityList=xe;exports.CopyActivityForm=Oe;exports.CopyModuleForm=Fe;exports.ModuleForm=me;exports.ParameterEditList=pe;exports.ParameterEditSelect=he;exports.UpsertActivityForm=Pe;exports.UpsertModuleForm=ze;
@@ -1,5 +1,5 @@
1
1
  import { j as e } from "./react-jsx-runtime-vendor-OVHDjVDe.js";
2
- import { Flex as he, InputGroup as Fe, InputLeftElement as ct, Icon as Ue, Input as je, FormLabel as Be, Box as X, TableContainer as qe, Table as He, Thead as Ye, Tr as Se, Th as ue, Tbody as Je, Td as ge, ButtonGroup as xe, Tooltip as Le, Button as Y, RangeSlider as dt, RangeSliderMark as Ne, Text as x, RangeSliderTrack as ut, RangeSliderFilledTrack as ht, RangeSliderThumb as ke, Select as Re, NumberInput as Ee, NumberInputField as ze, HStack as te, Tag as fe, Checkbox as mt, Image as pt, useToast as Xe, VStack as ee, FormControl as q, RadioGroup as Ke, Radio as Ae, Alert as Te, AlertIcon as Me, Spinner as Ze, useDisclosure as gt, Modal as xt, ModalOverlay as jt, ModalContent as ft, ModalHeader as vt, ModalCloseButton as yt, ModalBody as bt, ModalFooter as Ct, IconButton as wt, Textarea as $e } from "@chakra-ui/react";
2
+ import { Flex as he, InputGroup as Fe, InputLeftElement as ct, Icon as Ue, Input as je, FormLabel as Be, Box as Y, TableContainer as qe, Table as He, Thead as Ye, Tr as Se, Th as ue, Tbody as Je, Td as ge, ButtonGroup as xe, Tooltip as Le, Button as J, RangeSlider as dt, RangeSliderMark as Ne, Text as x, RangeSliderTrack as ut, RangeSliderFilledTrack as ht, RangeSliderThumb as ke, Select as Re, NumberInput as Ee, NumberInputField as ze, HStack as te, Tag as fe, Checkbox as mt, Image as pt, useToast as Xe, VStack as ee, FormControl as q, RadioGroup as Ke, Radio as Ae, Alert as Te, AlertIcon as Me, Spinner as Ze, useDisclosure as gt, Modal as xt, ModalOverlay as jt, ModalContent as ft, ModalHeader as vt, ModalCloseButton as yt, ModalBody as bt, ModalFooter as Ct, IconButton as wt, Textarea as $e } from "@chakra-ui/react";
3
3
  import { useMemo as F, useState as P, useCallback as R, useRef as St, useEffect as ne, memo as Oe } from "react";
4
4
  import { u as At } from "./ufuzzy-vendor-Dl0ZI6Av.js";
5
5
  import { s as se } from "./react-select-vendor-BlY9Il4Q.js";
@@ -71,7 +71,7 @@ const Jt = ({
71
71
  },
72
72
  [n]
73
73
  );
74
- return /* @__PURE__ */ e.jsx(X, { children: /* @__PURE__ */ e.jsx(Rt, { backend: Et, children: /* @__PURE__ */ e.jsx(qe, { children: /* @__PURE__ */ e.jsxs(He, { variant: "simple", size: "md", children: [
74
+ return /* @__PURE__ */ e.jsx(Y, { children: /* @__PURE__ */ e.jsx(Rt, { backend: Et, children: /* @__PURE__ */ e.jsx(qe, { children: /* @__PURE__ */ e.jsxs(He, { variant: "simple", size: "md", children: [
75
75
  /* @__PURE__ */ e.jsx(Ye, { children: /* @__PURE__ */ e.jsxs(Se, { children: [
76
76
  /* @__PURE__ */ e.jsx(ue, { children: "Order" }),
77
77
  /* @__PURE__ */ e.jsx(ue, { children: "Name" })
@@ -133,7 +133,7 @@ const Jt = ({
133
133
  visibility: o.tooltip ? "visible" : "hidden",
134
134
  hasArrow: !0,
135
135
  children: /* @__PURE__ */ e.jsx(
136
- Y,
136
+ J,
137
137
  {
138
138
  onClick: () => d(o) ? null : n(o, I),
139
139
  isDisabled: o.disabled,
@@ -193,7 +193,7 @@ const Jt = ({
193
193
  ), L = F(
194
194
  () => d === "xs" ? "0.75rem" : void 0,
195
195
  [d]
196
- ), J = R(
196
+ ), X = R(
197
197
  (b, z) => {
198
198
  const Z = Number(z.target.value);
199
199
  if (!a || !p || ![-1, 1].includes(Z))
@@ -204,7 +204,7 @@ const Jt = ({
204
204
  [a, p, u]
205
205
  );
206
206
  return /* @__PURE__ */ e.jsxs(he, { direction: "column", ...h, children: [
207
- /* @__PURE__ */ e.jsx(X, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
207
+ /* @__PURE__ */ e.jsx(Y, { pt: "1em", mb: "-0.5em", children: /* @__PURE__ */ e.jsxs(
208
208
  dt,
209
209
  {
210
210
  "aria-label": ["min", "max"],
@@ -240,7 +240,7 @@ const Jt = ({
240
240
  g && /* @__PURE__ */ e.jsxs(Ne, { value: 0, top: "-1em", pos: "relative", children: [
241
241
  /* @__PURE__ */ e.jsx(x, { fontSize: d, fontWeight: "semibold", children: o?.(0) ?? "0" }),
242
242
  /* @__PURE__ */ e.jsx(
243
- X,
243
+ Y,
244
244
  {
245
245
  position: "absolute",
246
246
  width: "2px",
@@ -299,7 +299,7 @@ const Jt = ({
299
299
  size: d,
300
300
  fontWeight: "bold",
301
301
  value: y,
302
- onChange: (b) => J(!0, b),
302
+ onChange: (b) => X(!0, b),
303
303
  isDisabled: G || A,
304
304
  children: [
305
305
  /* @__PURE__ */ e.jsx("option", { value: -1, children: j[0] }),
@@ -364,7 +364,7 @@ const Jt = ({
364
364
  size: d,
365
365
  fontWeight: "bold",
366
366
  value: C,
367
- onChange: (b) => J(!1, b),
367
+ onChange: (b) => X(!1, b),
368
368
  isDisabled: G || A,
369
369
  children: [
370
370
  /* @__PURE__ */ e.jsx("option", { value: -1, children: j[0] }),
@@ -385,14 +385,15 @@ const Jt = ({
385
385
  label: "This activity is owned by Quantum",
386
386
  "aria-label": "Quantum owned",
387
387
  children: /* @__PURE__ */ e.jsx(
388
- pt,
388
+ Y,
389
389
  {
390
- src: n,
391
- alt: "Quantum owned",
392
- boxSize: "16px",
393
- display: "inline-block",
394
- ml: 2,
395
- verticalAlign: "middle"
390
+ boxSize: "1.5em",
391
+ borderRadius: "full",
392
+ bg: "black",
393
+ display: "flex",
394
+ alignItems: "center",
395
+ justifyContent: "center",
396
+ children: /* @__PURE__ */ e.jsx(pt, { src: n, boxSize: "1em" })
396
397
  }
397
398
  )
398
399
  }
@@ -444,11 +445,11 @@ const Jt = ({
444
445
  const f = s.filter((M) => M.selected);
445
446
  v(f.map((M) => M.id)), d && f.forEach((M) => d(M, !1));
446
447
  }, [s, v, d]), N = F(() => s.some((f) => f.selected && !f.quantumOwned), [s]), E = F(() => s.some((f) => f.selected), [s]), _ = F(() => s.some((f) => f.selected && f.quantumOwned), [s]);
447
- return /* @__PURE__ */ e.jsxs(X, { ...r, children: [
448
+ return /* @__PURE__ */ e.jsxs(Y, { ...r, children: [
448
449
  /* @__PURE__ */ e.jsxs(he, { alignContent: "space-between", gap: 4, children: [
449
450
  (i || c || v) && /* @__PURE__ */ e.jsxs(xe, { mb: "1rem", gap: 4, children: [
450
451
  i && /* @__PURE__ */ e.jsx(
451
- Y,
452
+ J,
452
453
  {
453
454
  isDisabled: !i || A,
454
455
  colorScheme: "blackAlpha",
@@ -462,7 +463,7 @@ const Jt = ({
462
463
  {
463
464
  label: _ ? N ? "Quantum-owned activities are selected and will be skipped" : "Selected activities are quantum-owned and cannot be deleted" : void 0,
464
465
  children: /* @__PURE__ */ e.jsx(
465
- Y,
466
+ J,
466
467
  {
467
468
  colorScheme: "gray",
468
469
  isDisabled: !N || !c || I,
@@ -473,7 +474,7 @@ const Jt = ({
473
474
  }
474
475
  ),
475
476
  v && !o && /* @__PURE__ */ e.jsx(
476
- Y,
477
+ J,
477
478
  {
478
479
  colorScheme: "gray",
479
480
  isDisabled: !E,
@@ -527,7 +528,7 @@ const Jt = ({
527
528
  }
528
529
  ),
529
530
  (f.quantumOwned || !u) && l && /* @__PURE__ */ e.jsx(
530
- Y,
531
+ J,
531
532
  {
532
533
  ml: "1em",
533
534
  size: "sm",
@@ -538,7 +539,7 @@ const Jt = ({
538
539
  }
539
540
  ),
540
541
  !f.quantumOwned && u && /* @__PURE__ */ e.jsx(
541
- Y,
542
+ J,
542
543
  {
543
544
  disabled: j,
544
545
  ml: "1em",
@@ -720,7 +721,7 @@ const Jt = ({
720
721
  saveButton: M
721
722
  });
722
723
  }, [l, L, M]);
723
- const J = F(() => G.map((t) => ({
724
+ const X = F(() => G.map((t) => ({
724
725
  value: t.id,
725
726
  label: t.name
726
727
  })), [G]), b = F(() => k.filter((t) => o === "copy" ? !0 : !t.quantumOwned).map((t) => ({
@@ -729,7 +730,7 @@ const Jt = ({
729
730
  // Add custom data to identify quantum-owned actions for UI display
730
731
  isQuantumOwned: t.quantumOwned
731
732
  })), [k, o]), z = p.fetching, Z = g.fetching;
732
- return /* @__PURE__ */ e.jsx(X, { children: /* @__PURE__ */ e.jsxs(ee, { spacing: 6, align: "stretch", children: [
733
+ return /* @__PURE__ */ e.jsx(Y, { children: /* @__PURE__ */ e.jsxs(ee, { spacing: 6, align: "stretch", children: [
733
734
  d && /* @__PURE__ */ e.jsxs(q, { children: [
734
735
  /* @__PURE__ */ e.jsx(re, { children: "Operation Mode" }),
735
736
  /* @__PURE__ */ e.jsx(
@@ -758,8 +759,8 @@ const Jt = ({
758
759
  se,
759
760
  {
760
761
  placeholder: "Choose a group...",
761
- options: J,
762
- value: J.find((t) => t.value === j) || null,
762
+ options: X,
763
+ value: X.find((t) => t.value === j) || null,
763
764
  onChange: N,
764
765
  isLoading: z,
765
766
  isDisabled: z,
@@ -816,11 +817,11 @@ const Jt = ({
816
817
  ] })
817
818
  ] })
818
819
  ] }),
819
- T.length > 0 && /* @__PURE__ */ e.jsxs(X, { p: 4, bg: "gray.50", borderRadius: "md", children: [
820
+ T.length > 0 && /* @__PURE__ */ e.jsxs(Y, { p: 4, bg: "gray.50", borderRadius: "md", children: [
820
821
  /* @__PURE__ */ e.jsx(x, { fontWeight: "semibold", mb: 3, children: T.length === 1 ? `Activity to ${o === "copy" ? "Copy" : "Convert"}:` : `${T.length} Activities to ${o === "copy" ? "Copy" : "Convert"}:` }),
821
822
  /* @__PURE__ */ e.jsxs(ee, { align: "start", spacing: 3, children: [
822
823
  T.map((t, m) => /* @__PURE__ */ e.jsxs(
823
- X,
824
+ Y,
824
825
  {
825
826
  w: "100%",
826
827
  p: 3,
@@ -883,7 +884,7 @@ const Jt = ({
883
884
  t.id
884
885
  )),
885
886
  T.length > 1 && /* @__PURE__ */ e.jsx(
886
- X,
887
+ Y,
887
888
  {
888
889
  w: "100%",
889
890
  p: 2,
@@ -904,7 +905,7 @@ const Jt = ({
904
905
  ] }),
905
906
  !c && /* @__PURE__ */ e.jsxs(xe, { spacing: 4, justifyContent: "flex-end", children: [
906
907
  /* @__PURE__ */ e.jsx(
907
- Y,
908
+ J,
908
909
  {
909
910
  variant: "outline",
910
911
  onClick: L,
@@ -913,7 +914,7 @@ const Jt = ({
913
914
  }
914
915
  ),
915
916
  /* @__PURE__ */ e.jsxs(
916
- Y,
917
+ J,
917
918
  {
918
919
  colorScheme: o === "copy" ? "blue" : "green",
919
920
  onClick: M,
@@ -1124,7 +1125,7 @@ const Jt = ({
1124
1125
  saveButton: M
1125
1126
  });
1126
1127
  }, [l, L, M]);
1127
- const J = F(() => T.map((t) => ({
1128
+ const X = F(() => T.map((t) => ({
1128
1129
  value: t.id,
1129
1130
  label: t.name
1130
1131
  })), [T]), b = F(() => N.filter((t) => r === "copy" ? !0 : !t.quantumOwned).map((t) => ({
@@ -1133,7 +1134,7 @@ const Jt = ({
1133
1134
  // Add custom data to identify quantum-owned modules
1134
1135
  isQuantumOwned: t.quantumOwned
1135
1136
  })), [N, r]), z = p.fetching, Z = g.fetching;
1136
- return /* @__PURE__ */ e.jsx(X, { children: /* @__PURE__ */ e.jsxs(ee, { spacing: 6, align: "stretch", children: [
1137
+ return /* @__PURE__ */ e.jsx(Y, { children: /* @__PURE__ */ e.jsxs(ee, { spacing: 6, align: "stretch", children: [
1137
1138
  d && /* @__PURE__ */ e.jsxs(q, { children: [
1138
1139
  /* @__PURE__ */ e.jsx(re, { children: "Operation Mode" }),
1139
1140
  /* @__PURE__ */ e.jsx(
@@ -1162,8 +1163,8 @@ const Jt = ({
1162
1163
  se,
1163
1164
  {
1164
1165
  placeholder: "Choose a group...",
1165
- options: J,
1166
- value: J.find((t) => t.value === o) || null,
1166
+ options: X,
1167
+ value: X.find((t) => t.value === o) || null,
1167
1168
  onChange: _,
1168
1169
  isLoading: z,
1169
1170
  isDisabled: z,
@@ -1216,11 +1217,11 @@ const Jt = ({
1216
1217
  ] })
1217
1218
  ] })
1218
1219
  ] }),
1219
- E.length > 0 && /* @__PURE__ */ e.jsxs(X, { p: 4, bg: "gray.50", borderRadius: "md", children: [
1220
+ E.length > 0 && /* @__PURE__ */ e.jsxs(Y, { p: 4, bg: "gray.50", borderRadius: "md", children: [
1220
1221
  /* @__PURE__ */ e.jsx(x, { fontWeight: "semibold", mb: 3, children: E.length === 1 ? `Module to ${r === "copy" ? "Copy" : "Convert"}` : `${E.length} Modules to ${r === "copy" ? "Copy" : "Convert"}` }),
1221
1222
  /* @__PURE__ */ e.jsxs(ee, { align: "start", spacing: 3, children: [
1222
1223
  E.map((t, m) => /* @__PURE__ */ e.jsxs(
1223
- X,
1224
+ Y,
1224
1225
  {
1225
1226
  w: "100%",
1226
1227
  p: 3,
@@ -1268,7 +1269,7 @@ const Jt = ({
1268
1269
  t.id
1269
1270
  )),
1270
1271
  E.length > 1 && /* @__PURE__ */ e.jsx(
1271
- X,
1272
+ Y,
1272
1273
  {
1273
1274
  w: "100%",
1274
1275
  p: 2,
@@ -1286,7 +1287,7 @@ const Jt = ({
1286
1287
  }
1287
1288
  ),
1288
1289
  d && E.filter((t) => t.moduleActions.some((m) => !m.action.quantumOwned)).length > 0 && /* @__PURE__ */ e.jsx(
1289
- X,
1290
+ Y,
1290
1291
  {
1291
1292
  p: 2,
1292
1293
  bg: "yellow.50",
@@ -1300,7 +1301,7 @@ const Jt = ({
1300
1301
  ] }),
1301
1302
  !c && /* @__PURE__ */ e.jsxs(xe, { spacing: 4, justifyContent: "flex-end", children: [
1302
1303
  /* @__PURE__ */ e.jsx(
1303
- Y,
1304
+ J,
1304
1305
  {
1305
1306
  variant: "outline",
1306
1307
  onClick: L,
@@ -1309,7 +1310,7 @@ const Jt = ({
1309
1310
  }
1310
1311
  ),
1311
1312
  /* @__PURE__ */ e.jsxs(
1312
- Y,
1313
+ J,
1313
1314
  {
1314
1315
  colorScheme: r === "copy" ? "blue" : "green",
1315
1316
  onClick: M,
@@ -1360,7 +1361,7 @@ const Jt = ({
1360
1361
  },
1361
1362
  [I]
1362
1363
  );
1363
- return /* @__PURE__ */ e.jsxs(X, { ...j, children: [
1364
+ return /* @__PURE__ */ e.jsxs(Y, { ...j, children: [
1364
1365
  /* @__PURE__ */ e.jsxs(te, { gap: "2rem", children: [
1365
1366
  /* @__PURE__ */ e.jsx(cn, { name: s ?? "", onInputChange: p }),
1366
1367
  /* @__PURE__ */ e.jsx(
@@ -1412,7 +1413,7 @@ const Jt = ({
1412
1413
  }
1413
1414
  ) }),
1414
1415
  /* @__PURE__ */ e.jsx(Ct, { children: /* @__PURE__ */ e.jsx(
1415
- Y,
1416
+ J,
1416
1417
  {
1417
1418
  colorScheme: "blue",
1418
1419
  onClick: A.onClose,
@@ -1513,7 +1514,7 @@ const Jt = ({
1513
1514
  /* @__PURE__ */ e.jsx(x, { fontSize: "sm", color: "gray.500", children: "Drag and drop to reorder the activities in this module." })
1514
1515
  ] }) }),
1515
1516
  /* @__PURE__ */ e.jsx(
1516
- Y,
1517
+ J,
1517
1518
  {
1518
1519
  size: "sm",
1519
1520
  variant: "solid",
@@ -1526,7 +1527,7 @@ const Jt = ({
1526
1527
  c.length === 0 ? /* @__PURE__ */ e.jsx(ee, { children: /* @__PURE__ */ e.jsxs(x, { color: "gray.500", fontSize: "lg", mb: "4rem", mt: "4rem", children: [
1527
1528
  "No activities selected for this module.",
1528
1529
  /* @__PURE__ */ e.jsx(
1529
- Y,
1530
+ J,
1530
1531
  {
1531
1532
  ml: "0.5em",
1532
1533
  size: "sm",
@@ -1748,7 +1749,7 @@ const Jt = ({
1748
1749
  (p) => s.some((g) => be(g.id, p.id) && g.plane === p.plane)
1749
1750
  );
1750
1751
  a.length !== n.length && i(a);
1751
- }, [s, i]), /* @__PURE__ */ e.jsxs(X, { ...I, children: [
1752
+ }, [s, i]), /* @__PURE__ */ e.jsxs(Y, { ...I, children: [
1752
1753
  /* @__PURE__ */ e.jsx(
1753
1754
  se,
1754
1755
  {
@@ -1839,9 +1840,9 @@ const Jt = ({
1839
1840
  }), r = U(
1840
1841
  ae,
1841
1842
  S?.getActionById
1842
- ), a = I || A, p = !!r && !!s, [g, y] = P(""), [C, G] = P(""), [k, T] = P(""), [N, E] = P(""), [_, f] = P(), [M, L] = P([]), [J, b] = P([]), [z, Z] = P([]), t = F(
1843
- () => J.map((O) => O.value),
1844
- [J]
1843
+ ), a = I || A, p = !!r && !!s, [g, y] = P(""), [C, G] = P(""), [k, T] = P(""), [N, E] = P(""), [_, f] = P(), [M, L] = P([]), [X, b] = P([]), [z, Z] = P([]), t = F(
1844
+ () => X.map((O) => O.value),
1845
+ [X]
1845
1846
  ), m = Yt(t), [{ data: w }] = le({
1846
1847
  query: rt
1847
1848
  }), D = F(() => U(
@@ -2076,10 +2077,10 @@ const Jt = ({
2076
2077
  se,
2077
2078
  {
2078
2079
  isMulti: !0,
2079
- value: J,
2080
+ value: X,
2080
2081
  onChange: (O) => b([...O]),
2081
2082
  options: fn,
2082
- isOptionDisabled: () => J.length >= xn,
2083
+ isOptionDisabled: () => X.length >= xn,
2083
2084
  isDisabled: o
2084
2085
  }
2085
2086
  )
@@ -2105,9 +2106,9 @@ const Jt = ({
2105
2106
  (u || o) && "hidden"
2106
2107
  ),
2107
2108
  children: /* @__PURE__ */ e.jsxs(xe, { mt: 16, gap: 4, children: [
2108
- /* @__PURE__ */ e.jsx(Y, { colorScheme: "gray", isDisabled: a, onClick: i, children: "Cancel" }),
2109
+ /* @__PURE__ */ e.jsx(J, { colorScheme: "gray", isDisabled: a, onClick: i, children: "Cancel" }),
2109
2110
  /* @__PURE__ */ e.jsx(
2110
- Y,
2111
+ J,
2111
2112
  {
2112
2113
  colorScheme: "blue",
2113
2114
  isDisabled: a || !B || !pe,
@@ -2156,7 +2157,7 @@ const Jt = ({
2156
2157
  }, [g, y]);
2157
2158
  const M = R(() => {
2158
2159
  let L;
2159
- const J = {
2160
+ const X = {
2160
2161
  actions: C,
2161
2162
  name: k,
2162
2163
  categories: N.filter((b) => b !== "other"),
@@ -2165,9 +2166,9 @@ const Jt = ({
2165
2166
  };
2166
2167
  g ? L = S({
2167
2168
  id: g.id,
2168
- input: J
2169
+ input: X
2169
2170
  }) : L = a({
2170
- input: J
2171
+ input: X
2171
2172
  }), L.then(({ error: b }) => {
2172
2173
  b ? c(b) : i();
2173
2174
  });
@@ -2192,7 +2193,7 @@ const Jt = ({
2192
2193
  cancelButton: n,
2193
2194
  saveButton: M
2194
2195
  });
2195
- }, [d, n, M]), /* @__PURE__ */ e.jsxs(X, { width: "100%", children: [
2196
+ }, [d, n, M]), /* @__PURE__ */ e.jsxs(Y, { width: "100%", children: [
2196
2197
  /* @__PURE__ */ e.jsx(
2197
2198
  an,
2198
2199
  {
@@ -2210,7 +2211,7 @@ const Jt = ({
2210
2211
  ),
2211
2212
  !u && /* @__PURE__ */ e.jsx(te, { justifyContent: "flex-start", children: /* @__PURE__ */ e.jsxs(xe, { mt: 16, gap: 4, children: [
2212
2213
  /* @__PURE__ */ e.jsx(
2213
- Y,
2214
+ J,
2214
2215
  {
2215
2216
  colorScheme: "gray",
2216
2217
  isDisabled: h || r,
@@ -2219,7 +2220,7 @@ const Jt = ({
2219
2220
  }
2220
2221
  ),
2221
2222
  /* @__PURE__ */ e.jsx(
2222
- Y,
2223
+ J,
2223
2224
  {
2224
2225
  colorScheme: "blue",
2225
2226
  isDisabled: h || r || !k || _.trim().split(/\s+/).filter(Boolean).length > 40,
@@ -1 +1 @@
1
- /*! tailwindcss v4.1.13 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--spacing:.25rem;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.col-span-2{grid-column:span 2/span 2}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline-block{display:inline-block}.table{display:table}.w-full{width:100%}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-end{justify-content:flex-end}.gap-2{gap:calc(var(--spacing)*2)}.gap-4{gap:calc(var(--spacing)*4)}.border{border-style:var(--tw-border-style);border-width:1px}.capitalize{text-transform:capitalize}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}@media (min-width:64rem){.lg\:col-span-1{grid-column:span 1/span 1}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}
1
+ /*! tailwindcss v4.1.13 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--spacing:.25rem;--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.col-span-2{grid-column:span 2/span 2}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.flex{display:flex}.grid{display:grid}.hidden{display:none}.table{display:table}.w-full{width:100%}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-end{justify-content:flex-end}.gap-2{gap:calc(var(--spacing)*2)}.gap-4{gap:calc(var(--spacing)*4)}.border{border-style:var(--tw-border-style);border-width:1px}.capitalize{text-transform:capitalize}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}@media (min-width:64rem){.lg\:col-span-1{grid-column:span 1/span 1}}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quantum-component-library",
3
- "version": "1.4.47-dev.8",
3
+ "version": "1.4.47-dev.9",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.cjs",