PageSourceSearch

https://storyweaver.org.in/assets/index.WqMQYWiH.js

js storyweaver.org.in collected 2026-10-01 10:13:10 UTC 9,419 bytes, 1 lines download raw bytes

1import{r as s,j as e}from"./react-vendor.B75MsAI9.js";import{u as a,M as l,T as t,e8 as r,ak as o,o as n,a as i,a4 as d,t as c,r as m,p,dc as u,dd as _,O as h,fF as g,U as x,N as j,z as f,S as v,H as C,g as N,w as b,fG as y,fH as $}from"./AuthModalContainer.D3JsQqnf.js";import{i as w}from"./isEmpty.CnTxIE1l.js";import{B as S}from"./main.DrmgIV4z.js";import{B as q}from"./Block.v-v90TCf.js";/* empty css                            */import"./RTLProvider.Bmr48mpV.js";import"./LazyFontLoader.5DGfhuFK.js";const T=({classroomStaticText:d,flpAddClassroomWorkflow:c,userId:m,lang:p,getFlpAllClassroom:u,onClose:_,viewport:h,isEdit:g,classId:x,allClassrooms:j,flpUpdateClassroom:f,addSlimNotification:v,flpState:C,onTriggerEvents:N})=>{const b=a(),y="pb-classroom-modal",[$,w]=s.useState({section:"",grade:"",school:"",village:"",city:"",state:C||""}),S=[{name:e.jsxs("div",{children:[e.jsx("p",{className:`${y}__grade`,children:d.grade1}),e.jsx("p",{className:`${y}__sub-grade`,children:d.recommendedForClass1})]}),value:"1",queryValue:d.grade1},{name:e.jsxs("div",{children:[e.jsx("p",{className:`${y}__grade`,children:d.grade2}),e.jsx("p",{className:`${y}__sub-grade`,children:d.recommendedForClass3})]}),value:"2",queryValue:d.grade2},{name:e.jsxs("div",{children:[e.jsx("p",{className:`${y}__grade`,children:d.grade3}),e.jsx("p",{className:`${y}__sub-grade`,children:d.recommendedForClass5})]}),value:"3",queryValue:d.grade3}];s.useEffect(()=>{if(g){let s=j.filter(s=>s.id===x);s.length>0&&w(s[0])}},[x,g,j]);const T=s=>{w({...$,[s.target.name]:s.target.value})};return e.jsx("div",{children:e.jsxs(l,{parentClassName:`${y}__modal`,onClose:_,fillViewport:!h.medium,children:[e.jsxs("p",{className:`${y}__modal-title`,children:[" ",d.addClassroom," "]}),e.jsxs(q,{background:"transparent",parentClassName:`${y}__section`,children:[e.jsxs("div",{className:`${y}__form-group`,children:[e.jsxs("span",{className:`${y}__form-body-label`,children:[" ",d.classSection," ",e.jsx("span",{className:`${y}__required`,children:"*"})," "]}),e.jsx(t,{error:r($.section,b).length&&d.cannotBeEmpty,parentClassName:`${y}__input ${y}__section-input`,name:"section",value:$.section,placeholder:d.enterClassSection,onChange:T,autoFocus:!0})]}),e.jsxs("div",{className:`${y}__form-group`,children:[e.jsxs("span",{className:`${y}__form-body-label`,children:[" ",d.usingClassroomResources," ",e.jsx("span",{className:`${y}__required`,children:"*"})," "]}),e.jsx(o,{parentClassName:`${y}__grade-dropdown`,id:"grade",name:"grade",textFieldLabel:"Search",value:S.find(s=>s.queryValue===$.grade)?S.find(s=>s.queryValue===$.grade).value:"",options:[{name:e.jsx("p",{className:`${y}__placeholder`,children:d.selectGrade}),queryValue:""},...S.map(s=>({name:s.name,queryValue:s.value}))],onChange:s=>((s,e)=>{w({...$,[s]:e})})("grade",s),autoFocus:!0,disabled:g})]}),e.jsxs("div",{className:`${y}__form-group`,children:[e.jsxs("span",{className:`${y}__form-body-label`,children:[" ",d.schoolText," ",e.jsx("span",{className:`${y}__required`,children:"*"})]}),e.jsx(t,{error:r($.school,b).length&&d.cannotBeEmpty,parentClassName:`${y}__input`,name:"school",value:$.school,placeholder:d.enterSchoolName,onChange:T})]}),e.jsxs("div",{className:`${y}__form-group`,children:[e.jsxs("span",{className:`${y}__form-body-label`,children:[" ",d.stateText," ",e.jsx("span",{className:`${y}__required`,children:"*"})]}),e.jsx(t,{error:r($.state,b).length&&d.cannotBeEmpty,parentClassName:`${y}__input`,name:"state",value:$.state})]}),e.jsxs("div",{className:`${y}__form-group`,children:[e.jsxs("span",{className:`${y}__form-body-label`,children:[" ",d.cityText," ",e.jsx("span",{className:`${y}__required`,children:"*"})]}),e.jsx(t,{error:r($.city,b).length&&d.cannotBeEmpty,parentClassName:`${y}__input`,name:"city",value:$.city,placeholder:d.enterCityName,onChange:T})]}),e.jsxs("div",{className:`${y}__form-group`,children:[e.jsxs("span",{className:`${y}__form-body-label`,children:[" ",d.villageText," ",e.jsx("span",{className:`${y}__required`,children:"*"})]}),e.jsx(t,{error:r($.village,b).length&&d.cannotBeEmpty,parentClassName:`${y}__input`,name:"village",value:$.village,placeholder:d.enterVillageName,onChange:T})]}),e.jsx(n,{variant:"primary",label:g?d.updateClassroom:d.createClassroom,onClick:s=>{N({event:i.classAdded}),(async(s,e)=>{var a,l;s.preventDefault();try{let s;e?(s=await f($,e,p,m),u(p,m),"ok"===(null==s?void 0:s.status)&&(null==(a=null==s?void 0:s.data)?void 0:a.message)&&v({type:"info",content:s.data.message})):(s=await c($,m,p),u(p,m),"ok"===(null==s?void 0:s.status)&&(null==(l=null==s?void 0:s.data)?void 0:l.message)&&v({type:"info",content:s.data.message})),_()}catch(t){}})(s,x)},disabled:!($.grade&&$.section.trim()&&$.school.trim()&&$.city.trim()&&$.state&&$.village.trim()),parentClassName:`${y}__modal-submit`})]})]})})};T.propTypes={classroomStaticText:d.object.isRequired,flpAddClassroomWorkflow:d.func.isRequired,userId:d.string.isRequired,lang:d.string.isRequired,getFlpAllClassroom:d.func.isRequired,onClose:d.func.isRequired,viewport:d.object.isRequired,isEdit:d.bool,classId:d.string,allClassrooms:d.array,flpUpdateClassroom:d.func.isRequired,addSlimNotification:d.func.isRequired,flpState:d.string,onTriggerEvents:d.func};const E=()=>{a();const l=c(),[t]=m(),r=t.get("language")||"en",[o,d]=s.useState(!1),[E,k]=s.useState(!1),[F,I]=s.useState(""),R=p(s=>s.viewport),V=p(s=>s.flpHome),A=p(s=>s.user),{isFetchingStaticContent:L,classroomStaticText:B,allClassrooms:z,isFetchingAllClassrooms:H,validateCode:M,flpState:U}=V,{isLoggedIn:P,isFetchingMe:W,profile:G}=A,O=null==G?void 0:G.id,D=null==G?void 0:G.profile_type;if(s.useEffect(()=>{O&&l(u({locale:r,userId:O}))},[l,r,O]),s.useEffect(()=>{P&&O&&(l(_({code:null,locale:r,id:O})).then(s=>{!1===s.already_verified?window.location.href=h.flpClassroom(r):s.already_verified&&s.locale!==r&&(window.location.href=h.flpClassroom(s.locale))}
1),l(g({id:O,locale:r})))},[l,P,O,r]),L||w(B)||W)return e.jsx(x,{});if(!P)return e.jsx(j,{to:h.flpClassroom(r).replace(`/${f}`,""),replace:!0});const Z=[{title:B.backToClassroom,href:h.flpClassroom(r),isInternal:!0}],J=s=>{const{event:e,itemType:a,itemId:l,itemValue:t}=s;window.dataLayer&&window.dataLayer.push({event:e,category:`${b.flpOneToMany}_${r}`,label:N.createClassroom,item_type:a||null,item_id:l||null,item_value:t||null,user_profile:D,user_id:O})};return e.jsxs("div",{className:"pb-student-classroom",children:[e.jsx(S,{paths:Z,parentClassName:"pb-student-classroom__brd-crumb"}),e.jsxs(q,{background:"transparent",parentClassName:"pb-student-classroom__title-section",children:[e.jsx("div",{className:"pb-student-classroom__class-title",children:B.myClassroom}),e.jsxs("div",{className:"pb-student-classroom__class-wrapper",children:[e.jsxs("div",{className:"pb-student-classroom__sub-wrapper",children:[e.jsx(v,{name:"class-profile"}),e.jsx("p",{className:"pb-student-classroom__class-text",children:`1.${B.createClassAddStudent}`})]}),e.jsxs("div",{className:"pb-student-classroom__sub-wrapper",children:[e.jsx(v,{name:"activity"}),e.jsx("p",{className:"pb-student-classroom__class-text",children:`2.${B.completeStartExercise}`})]}),e.jsxs("div",{className:"pb-student-classroom__sub-wrapper",children:[e.jsx(v,{name:"activity"}),e.jsx("p",{className:"pb-student-classroom__class-text",children:`3.${B.completeEndExercise}`})]})]})]}),e.jsxs(q,{parentClassName:"pb-student-classroom__section",noHorizontalPadding:!0,noVerticalPadding:!0,children:[z&&z.map(s=>{return a=s.section,l=s.school,t=s.id,o=s.grade,c=J,e.jsxs("div",{className:"pb-student-classroom__add-section",children:[e.jsxs("div",{className:"pb-student-classroom__details",children:[e.jsxs("p",{children:[e.jsx("span",{className:"pb-student-classroom__name",children:a}),e.jsx("span",{className:"pb-student-classroom__edit-icon",onClick:()=>{d(!0),k(!0),I(t)},children:e.jsx(v,{name:"edit-student",pushRight:!0,pushLeft:!0,size:"s"})})]}),e.jsxs("p",{children:[e.jsx("span",{children:o}),", ",l]})]}),e.jsx("div",{className:"pb-student-classroom__actions",children:e.jsx(n,{parentClassName:"pb-student-classroom__baseline-btn",label:B.goToClassroom,onClick:()=>{c({event:i.joinClass}),window.location.href=h.flpClassStudents(t,r)},iconLeft:"baseline",noIconTitle:!0})})]});var a,l,t,o,c}),e.jsx("div",{className:"pb-student-classroom__add-section pb-student-classroom__add-section--block",children:e.jsxs("span",{className:"pb-student-classroom__add-btn pb-student-classroom__add",onClick:()=>{d(!0),k(!1),I(""),J({event:i.addClass})},children:[e.jsx(v,{name:"icon-plus",pushRight:!0,size:"sm"}),B.addClassroom]})})]}),o&&e.jsx(T,{classroomStaticText:B,flpAddClassroomWorkflow:async s=>{try{const e=await l($({data:s,userId:O,locale:r}));return l(g({id:O,locale:r})),{status:(null==e?void 0:e.status)||"ok",data:(null==e?void 0:e.data)||e}}catch(e){return{status:"error",data:{message:e.message||"Failed to add classroom"}}}},lang:r,userId:O,getFlpAllClassroom:()=>{l(g({id:O,locale:r}))},onClose:()=>d(!1),viewport:R,isEdit:E,classId:F,allClassrooms:z,flpUpdateClassroom:async(s,e)=>{try{const a=await l(y({data:s,id:e,locale:r,userId:O}));return l(g({id:O,locale:r})),{status:(null==a?void 0:a.status)||"ok",data:(null==a?void 0:a.data)||a}}catch(a){return{status:"error",data:{message:a.message||"Failed to update classroom"}}}},addSlimNotification:s=>l(C(s)),flpState:U,onTriggerEvents:J})]})};export{T as CreateClassroomModal,E 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.