PageSourceSearch

https://app.mydigitalchildcare.com/assets/ShareModal-88b684fd.js

js mydigitalchildcare.com collected 2026-10-05 02:36:25 UTC 4,109 bytes, 1 lines download raw bytes

1import{e as W,J as D,r as y,a3 as O,aG as w,aH as i,aI as E,a2 as z,aJ as F,aK as G,j as a,M as B,B as b,aL as U,aM as j,i as T,d as o,a as r,I as K,aN as Q,T as m,X as L,ax as M,N as A,m as X}from"./index-f8390669.js";const J=W({listContainer:{backgroundColor:({token:t})=>t.colorFillQuaternary,borderRadius:({token:t})=>t.borderRadius},listWrapper:{padding:"1rem",minHeight:"320px",maxHeight:"320px",overflow:"auto"},listSubTitle:{color:({token:t})=>t.colorHeading},listItem:{backgroundColor:({token:t})=>t.colorBgContainer,borderRadius:({token:t})=>t.borderRadius,padding:"0.25rem 1rem","&:hover":{backgroundColor:({token:t})=>t.colorPrimaryBg,cursor:"pointer"}},selectedRecipient:{backgroundColor:({token:t})=>t.colorPrimaryBg},result:{padding:0,"@global .ant-result-title":{fontSize:16},"@global .ant-result-content":{padding:0}}}),$=({onClose:t,form:s})=>{const S=D(),n=J({token:S}),[C,I]=y.useState(""),[p,f]=y.useState([]),[g,R]=y.useState([]),{data:c,isLoading:P}=O({searchKey:C,extra:{"filters[isRegistered]":"true","filters[status]":w.ACTIVE,...[i.TEACHER,i.TEACHER_PARENT].includes(s.template.canShareWith)?{"filters[type][$in][0]":E.TEACHER,"filters[type][$in][1]":E.LEAD_TEACHER}:{"filters[type]":E.ADMIN}}},{skip:s.template.canShareWith===null||[i.TEACHER,i.TEACHER_PARENT,i.ADMIN].includes(s.template.canShareWith)===!1,refetchOnMountOrArgChange:!0}),{data:d,isLoading:v}=z({searchKey:C,extraPopulate:{"populate[primaryGuardian][populate][identity]":"*","filters[primaryGuardian][isRegistered]":"true","filters[status]":F.ACTIVE,...s.student?{"filters[id]":s.student.id.toString()}:{}}},{skip:s.template.canShareWith===null||[i.TEACHER_PARENT,i.PARENT].includes(s.template.canShareWith)===!1,refetchOnMountOrArgChange:!0}),[_,{isLoading:N}]=G(),x=()=>{_({body:{teachers:g,students:p},id:s.id}).unwrap().then(()=>{X.success("Form shared successfully!"),t()})},k=(e,u)=>{e==="teacher"?R(l=>[...l,u]):f(l=>[...l,u])},H=(e,u)=>{e==="teacher"?R(l=>[...l].filter(h=>h!==u)):f(l=>[...l].filter(h=>h!==u))};return a(B,{open:!0,title:"Select recipient(s) to share form",onCancel:t,onOk:x,confirmLoading:N,width:600,footer:[a(b,{onClick:t,children:"Cancel"},"cancel"),a(b,{disabled:p.length===0&&g.length===0,onClick:x,type:"primary",icon:a(U,{}),children:"Share"},"save")],destroyOnClose:!0,children:N?a(j,{}):a(T,{children:a(o,{vertical:!0,gap:"1rem",children:r(o,{flex:1,className:n.listContainer,vertical:!0,children:[a(o,{flex:1,children:a(K.Search,{style:{flex:1},onSearch:e=>I(e),allowClear:!0,loading:P||v,placeholder:"Search child, educator or classroom"})}),(!d||d.length===0)&&(!c||c.length===0)?a(Q,{}):r(o,{className:n.listWrapper,flex:1,gap:"0.5rem",vertical:!0,children:[[i.ADMIN,i.TEACHER,i.TEACHER_PARENT].includes(s.template.canShareWith)&&c&&c.length>0&&r(T,{children:[r(m,{className:n.listSubTitle,children:["Educators (",c==null?void 0:c.length,")"]}),c.map(e=>r(o,{className:L(n.listItem,g.includes(e.id)?n.selectedRecipient:void 0),align:"center",gap:"1rem",onClick:()=>{g.includes(e.id)?H("teacher",e.id):k("teacher",e.id)},children:[a(M,{checked:g.includes(e.id),style:{marginRight:"0.5rem"}}),r(o,{vertical:!0,children:[a(A,{withAvatar:!0,identity:e.identity}),a(m.Text,{type:"secondary",style:{fontSize:S.fontSizeXSM,marginLeft:"2.5rem"},children:e.classrooms&&e.classrooms.map((u,l)=>{var h;return u.name+(l===((h=e.classrooms)==null?void 0:h.length)-1?"":", ")})})]})]},e.id))]}),[i.PARENT,i.TEACHER_PARENT].includes(s.template.canShareWith)&&d&&d.length>0&&r(T,{children:[r(m,{className:n.listSubTitle,children:["Students (",d==null?void 0:d.length,")"]}),d.map(e=>r(o,{className:L(n.listItem,p.includes(e.id)&&n.selectedRecipient),align:"center",gap:"1rem",onClick:()=>{p.includes(e.id)?H("student",e.id):k("student",e.id)},children:[a(M,{checked:p.includes(e.id),style:{marginRight:"0.5rem"}}),r(o,{vertical:!0,children:[a(A,{withAvatar:!0,identity:e.identity}),a(m.Text,{type:"secondary",style:{fontSize:S.fontSizeXSM,marginLeft:"2.5rem"},children:a(A,{size:"xsmall",secondary:!0,identity:e.primaryGuardian.identity})})]})]},e.id))]})]})]})})})})};export{$ as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.