!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=(new t.Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="b77ae579-0d5c-4919-a5b3-3abe15619fcf",t._sentryDebugIdIdentifier="sentry-dbid-b77ae579-0d5c-4919-a5b3-3abe15619fcf")}catch(t){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8180],{51928:function(t,e,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/chat",function(){return i(2878)}])},77268:function(t,e,i){"use strict";i.d(e,{U:function(){return a}});var r=i(38604);i(75271);var n=i(87137);let o={info:{backgroundColor:"#E5E2D5",color:"#5D5A53"},success:{backgroundColor:"#E8F5E9",color:"#2E7D32"},warning:{backgroundColor:"#FFF3E0",color:"#E65100"},error:{backgroundColor:"#FFEBEE",color:"#C62828"}},a=t=>{let{title:e,children:i,status:a="info",icon:s,className:l}=t,{backgroundColor:d,color:c}=o[a],h="info"===a?(0,r.tZ)(n.s,{}):null;return(0,r.BX)("div",{css:{backgroundColor:d,borderRadius:8,padding:16,color:c,lineHeight:1.6,fontSize:14},className:l,children:[(0,r.BX)("div",{css:{display:"flex",alignItems:"center",gap:8,marginBottom:8,fontSize:16},children:[s||h,(0,r.tZ)("h3",{css:{fontWeight:600,margin:0,fontSize:"inherit"},children:e})]}),(0,r.tZ)("div",{children:i})]})}},80138:function(t,e,i){"use strict";i.d(e,{E:function(){return C}});var r=i(38604),n=i(75271),o=/^image-([\da-f]+)-(\d+x\d+)-(\w+)$/,a=t=>{let e=o.exec(t),[,i,r,n]=null!=e?e:[];if(!e||!i||!r||!n)throw Error(`Could not parse image ID "${t}"`);let[a,s]=r.split("x").map(t=>Number.parseInt(t,10));if(Number.isNaN(a)||Number.isNaN(s)||!a||!s)throw Error(`Invalid dimensions "${r}"`);return{assetId:i,dimensions:{height:s,width:a,aspectRatio:a/s},format:n}},s=t=>{let e=t.lastIndexOf("-");return t.slice(6,e)+"."+t.slice(e+1)},l=({baseUrl:t,...e})=>{let{metadata:i,...r}=u({...e,options:{includeMetadata:!0}});if(!i)throw Error("Missing image output metadata");return{src:`${t}${s(e.id)}?${b(r)}`,width:i.outputDimensions.width,height:i.outputDimensions.height}},d=({id:t,mode:e="contain",width:i,height:r,hotspot:n,crop:o,baseUrl:a,...l})=>{let{w:d,h:c}=u({id:t,mode:e,width:i,height:r,hotspot:n,crop:o}),p=`${a}${s(t)}`;return Array.from(new Set(h(d).map(i=>{let r=Math.round(d*i);if(i<1&&r<50)return null;let a=u({id:t,mode:e,width:r,height:c&&Math.round(c*i),hotspot:n,crop:o,...l});return`${p}?${b(a)} ${a.w}w`}).filter(t=>!!t)))},c=({id:t,baseUrl:e})=>{let{assetId:i,dimensions:r,format:n}=a(t);return{src:`${e}${i}-${r.width}x${r.height}.${n}`,width:r.width,height:r.height}},h=t=>t<160?[.5,1,2]:t<750?[.5,1,1.5,2]:t<1400?[.25,.5,.75,1,1.5,2]:[.25,.5,.75,1,1.25,1.5,1.75,2],u=({id:t,mode:e="contain",width:i,height:r,hotspot:n,crop:o,queryParams:s,options:{includeMetadata:l=!1}={}})=>{let d=a(t).dimensions,{width:c,height:h,aspectRatio:u}=o?m(d,o):d;if(i||(r?(i=Math.round(r*u),r=void 0):i=Math.round(c/2)),"cover"!==e||i&&r&&i/r!==u?"contain"===e&&r&&(i=Math.min(i,Math.round(r*u)),r=void 0):e="contain",i>c||r&&r>h){let t=r?i/r:u;t>=u?(i=c,r=r&&Math.round(i/t)):i=Math.round((r=h)*t)}let b={w:i,q:75,...s};if(b.fm||(b.auto="format"),o&&(b.rect=f(d,o)),"cover"===e){if(b.fit="crop",r&&(b.h=r),n){let t=o?n.x/(1-o.left-o.right):n.x,e=o?n.y/(1-o.top-o.bottom):n.y;b["fp-x"]=g(p(t,0,1),3),b["fp-y"]=g(p(e,0,1),3)}else b.crop="entropy"}else b.fit="max";if(l){let t=r||Math.round(i/u);b.metadata={sourceDimensions:d,outputDimensions:{width:i,height:t,aspectRatio:i/t}}}return b},p=(t,e,i)=>Math.max(e,Math.min(i,t)),g=(t,e)=>Math.round(t*Math.pow(10,e))/Math.pow(10,e),m=(t,e)=>{if(e.left+e.right>=1||e.top+e.bottom>=1)throw Error(`Invalid crop: ${JSON.stringify(e)}; crop values must be less than 1`);let i=Math.round(t.width*(1-e.left-e.right)),r=Math.round(t.height*(1-e.top-e.bottom));return{width:i,height:r,aspectRatio:i/r}},f=(t,e)=>{let{width:i,height:r}=m(t,e);return[Math.round(e.left*t.width),Math.round(e.top*t.height),i,r].join(",")},b=t=>new URLSearchParams(Object.entries(t).sort(([t],[e])=>t.localeCompare(e)).map(([t,e])=>[t,String(e)])).toString().replace(/%2C/g,","),w=({as:t,preview:e,style:i,alt:r,...o})=>{let[a,s]=(0,n.useState)(!1),l=(0,n.useRef)(null),d=()=>{s(!0)};(0,n.useEffect)(()=>{var t;null!=(t=l.current)&&t.complete&&d()});let c=t||"img";return n.createElement(n.Fragment,null,!a&&n.createElement(c,{alt:a?"":r,className:o.className,"data-lqip":!0,height:o.height,id:o.id,src:e,style:i,width:o.width}),n.createElement(c,{"data-loading":!a||null,alt:a?r:"",onLoad:d,ref:l,style:a?i:{...x,...i},...o}))},x={height:"10px",width:"10px",position:"absolute",zIndex:-10,opacity:0,pointerEvents:"none",userSelect:"none"},y=({as:t,baseUrl:e,projectId:i,dataset:r,id:o,hotspot:a,crop:s,width:h,height:u,mode:p="contain",preview:g,htmlWidth:m,htmlHeight:f,htmlId:b,queryParams:x,...y})=>{var v,C;if(!o)throw Error("Missing required `id` prop for <SanityImage>.");if(!e&&(!i||!r))throw Error("Missing required `baseUrl` or `projectId` and `dataset` props for <SanityImage>.");e=null!=e?e:`https://cdn.sanity.io/images/${i}/${r}/`;let Z=o.endsWith("-svg"),S=g&&!Z?w:null!=t?t:"img",M={alt:null!=(v=y.alt)?v:"",loading:null!=(C=y.loading)?C:"lazy",id:b,...y};if(Z)return n.createElement(S,{...c({id:o,baseUrl:e}),...M});let E={baseUrl:e,id:o,crop:s,hotspot:a,width:h,height:u,mode:p,queryParams:x},{src:I,...k}=l(E);return M.srcSet=d(E).join(", "),M.src=I,M.width=null!=m?m:k.width,M.height=null!=f?f:k.height,g&&(M.as=null!=t?t:"img",M.preview=g),n.createElement(S,{...M})},v=i(83710);let C=t=>(0,r.tZ)(y,{baseUrl:v.NZ,...t})},87137:function(t,e,i){"use strict";i.d(e,{s:function(){return n}});var r=i(38604);let n=t=>(0,r.tZ)("svg",{viewBox:"0 0 24 24",width:"1em",...t,children:(0,r.tZ)("path",{fill:"currentColor",d:"M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20ZM11 7H13V9H11V7ZM11 11H13V17H11V11Z"})})},2878:function(t,e,i){"use strict";i.r(e),i.d(e,{__N_SSP:function(){return I},default:function(){return k}});var r=i(38604),n=i(58479),o=i(75271),a=i(74662),s=i(35487),l=i(93739),d=i(95237),c=i(73631),h=i(4738);let u=t=>(0,r.BX)("svg",{width:"1em",viewBox:"0 0 24 24",...t,children:[(0,r.tZ)("title",{children:"User icon"}),(0,r.tZ)("path",{fill:"currentColor",d:"M4 22C4 17.5817 7.58172 14 12 14C16.4183 14 20 17.5817 20 22H18C18 18.6863 15.3137 16 12 16C8.68629 16 6 18.6863 6 22H4ZM12 13C8.685 13 6 10.315 6 7C6 3.685 8.685 1 12 1C15.315 1 18 3.685 18 7C18 10.315 15.315 13 12 13ZM12 11C14.21 11 16 9.21 16 7C16 4.79 14.21 3 12 3C9.79 3 8 4.79 8 7C8 9.21 9.79 11 12 11Z"})]});var p=i(80138);let g=t=>{let{isFeatured:e,message:i}=t;return(0,r.BX)(c.E.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:16},css:{alignItems:"flex-end",display:"flex",gap:16,flexDirection:"ai"===i.type?"row":"row-reverse",alignSelf:"ai"===i.type?"flex-start":"flex-end"},children:["ai"===i.type?(0,r.tZ)(p.E,{id:"image-b33d3c9a8ca345f032db732809550a03109e9104-350x350-png",alt:"Lola",width:e?132:44,height:e?132:44,css:{transition:"transform 3s ease-in-out",width:e?132:44,[h.r.mobile]:{maxWidth:"56px",width:e?132:32}}}):(0,r.tZ)("div",{css:{width:42,height:42,backgroundColor:h.r.colors.green100,color:h.r.colors.n0,borderRadius:10,border:"2px solid ".concat(h.r.colors.n0),flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,r.tZ)(u,{css:{height:24,width:24}})}),(0,r.tZ)("div",{css:{padding:"24px",borderRadius:8,backgroundColor:"ai"===i.type?h.r.colors.n0:h.r.iceBlue,fontSize:16,position:"relative",boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.1)",":before":{content:'""',position:"absolute",left:"ai"===i.type?-8:void 0,right:"user"===i.type?-8:void 0,bottom:14,width:0,height:0,borderTop:"8px solid transparent",borderBottom:"8px solid transparent",borderRight:"ai"===i.type?"8px solid ".concat(h.r.colors.n0):void 0,borderLeft:"user"===i.type?"8px solid ".concat(h.r.iceBlue):void 0}},children:i.content.split("\n").map((t,e)=>(0,r.BX)(o.Fragment,{children:[t,(0,r.tZ)("br",{})]},e))})]})},m=t=>{let{messages:e,splitQuestions:i=!0,...n}=t;return(0,r.tZ)("div",{css:{display:"flex",flexDirection:"column",gap:24,"& > :not(.chat-list__divider)":{maxWidth:"85%",[h.r.mobile]:{maxWidth:"100%"}}},...n,children:(0,r.tZ)(d.M,{mode:"popLayout",children:e.map((t,n)=>(0,r.BX)(o.Fragment,{children:[(0,r.tZ)(g,{message:t,isFeatured:1===e.length&&"ai"===t.type}),i&&n>=2&&n%2==0&&(0,r.BX)(c.E.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},exit:{opacity:0,y:16},className:"chat-list__divider",css:{marginTop:24,position:"relative",textAlign:"center"},children:[(0,r.tZ)("h2",{css:{textAlign:"center",fontSize:16,fontWeight:550,color:h.r.colors.n70,display:"inline-block",backgroundColor:h.r.colors.n20,margin:0,position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",padding:"0 16px",whiteSpace:"nowrap"},children:"Ask a different question…"}),(0,r.tZ)("hr",{css:{backgroundColor:"transparent",border:"none",borderBottom:"1px solid ".concat(h.r.colors.n30),width:"100%"}})]})]},t.content))})})},f=t=>(0,r.BX)("svg",{width:"1em",viewBox:"0 0 24 24",...t,children:[(0,r.tZ)("title",{children:"Send"}),(0,r.tZ)("path",{fill:"currentColor",d:"M1.94607 9.31543C1.42353 9.14125 1.4194 8.86022 1.95682 8.68108L21.043 2.31901C21.5715 2.14285 21.8746 2.43866 21.7265 2.95694L16.2733 22.0432C16.1223 22.5716 15.8177 22.59 15.5944 22.0876L11.9999 14L17.9999 6.00005L9.99992 12L1.94607 9.31543Z"})]});var b=i(57542),w=i(49008),x=i(40664),y=i(3476),v=i(88451),C=i(25383);let Z=(0,o.forwardRef)((t,e)=>(0,r.BX)(v.V,{ref:e,name:"chatbot-lola-guest",css:{color:h.r.colors.n70},children:[(0,r.tZ)("h3",{css:{fontSize:20,fontWeight:550,color:h.r.colors.n80},children:"Sign in to chat with Lola"}),(0,r.tZ)("p",{children:"Please create an account or sign in to enable all features Project Read AI has to offer. Creating an account is free and only takes a minute."}),(0,r.tZ)(C.B,{mode:"signup"})]}));Z.displayName="GuestChatDialog";var S=i(77268);let M=["What’s the difference between an ORF-based screener and a diagnostic exam?","What is Project Read? How can I use it in my classroom?","My students can segment the sounds in a word, but struggle to blend them together.","Write me a lesson plan that is 30 minutes on -sion endings for my intervention group"],E=[{type:"ai",content:"\uD83D\uDC4B Hi! I'm Lola, your AI instructional coach for the Science of Reading.\nYou can ask me for help with lesson planning, assessment and implementation of structured literacy in your classroom, or general questions related to Science of Reading."}];var I=!0,k=(0,n.j5)(t=>{let{features:e}=t,{isTeacher:i}=(0,y._)(),[n,d]=(0,o.useState)(E),[c,u]=(0,o.useState)(""),[p,g]=(0,o.useState)(!1),[v,C]=(0,o.useState)(!0),I=(0,o.useRef)(null),k=async t=>{if(!i){var e;null===(e=I.current)||void 0===e||e.open();return}if(p)return;v&&C(!1);let r=null!=t?t:c;g(!0),u(""),d(t=>[...t,{content:r,type:"user"}]),(0,w.L9)(x.M.chat.messageSent,{category:"chatbot-lola"});let n=await b.L.post("/api/chat",{message:r});n.success&&d(t=>[...t,{content:n.data.response,type:"ai"}]),g(!1)};return(0,r.BX)("div",{css:{maxWidth:980,padding:24,margin:"0 auto",[h.r.mobile]:{padding:"24px 16px"}},children:[(0,r.BX)("div",{css:{textAlign:"center"},children:[(0,r.BX)("h1",{css:{margin:0,color:h.r.colors.green100},children:["Ask Lola",(0,r.BX)("span",{css:{verticalAlign:"super",fontSize:12,letterSpacing:1,textTransform:"uppercase"},children:[" ","Beta"]})]}),(0,r.tZ)("p",{css:{margin:0,color:h.r.colors.n70,fontSize:14,fontWeight:700},children:"AI instructional coach for the Science of Reading"})]}),e.chatbotEnabled?(0,r.BX)("div",{children:[(0,r.tZ)(m,{messages:n,css:{margin:"32px 0"}}),v&&(0,r.BX)(r.HY,{children:[(0,r.tZ)("h2",{css:{textAlign:"center",fontSize:14,color:h.r.colors.n70,marginBottom:8},children:"You can ask me things like…"}),(0,r.tZ)("ul",{css:{listStyle:"none",margin:0,padding:"0 0 16px 0",display:"grid",gap:16,gridTemplateColumns:"1fr 1fr",[h.r.mobile]:{gridTemplateColumns:"1fr"}},children:M.map((t,e)=>(0,r.tZ)("li",{children:(0,r.tZ)("button",{onClick:()=>{(0,w.L9)(x.M.general.buttonClicked,{category:"chatbot-lola",elementIdentifier:"example-question",identifier:"Question ".concat(e)}),k(t)},css:{padding:"16px 16px",background:"white",borderRadius:8,border:"none",fontWeight:600,color:h.r.colors.green100,boxShadow:"0px 4px 8px rgba(0, 0, 0, 0.1)",cursor:"pointer",transition:"box-shadow 0.2s ease-in-out, transform 0.2s ease-in-out",":hover, :focus":{boxShadow:"0px 8px 16px rgba(0, 0, 0, 0.1)",transform:"translateY(-2px)"}},children:t})},t))})]}),(0,r.tZ)("form",{onSubmit:t=>{t.preventDefault(),k()},css:{position:"sticky",bottom:32,margin:"32px auto 0",width:"100%"},children:(0,r.BX)("div",{css:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center",margin:"0 auto"},children:[(0,r.tZ)(l.o,{autoComplete:"off",type:"text",placeholder:i?"Ask me a question...":"Sign in to ask a question...",name:"message",value:c,onChange:t=>u(t.currentTarget.value),onClick:()=>{if(!i){var t;null===(t=I.current)||void 0===t||t.open()}}}),(0,r.tZ)("div",{css:{position:"absolute",right:4,top:"50%",transform:"translateY(-50%)",aspectRatio:"1/1",height:"calc(100% - 8px)"},children:p?(0,r.tZ)(s.gb,{css:{height:"100%",padding:4,width:"100%"}}):(0,r.tZ)(a.i,{type:"submit",disabled:p,"aria-label":"Submit question",css:{width:"100%",display:"flex",alignContent:"center",justifyContent:"center",padding:4,borderRadius:6,border:"1px solid transparent",height:"100%",":hover, :focus":{color:h.r.colors.n0,background:h.r.colors.green100,borderColor:h.r.colors.green100}},children:(0,r.tZ)(f,{css:{marginTop:1,marginRight:1,fontSize:"1.5em"}})})})]})}),(0,r.tZ)("p",{css:{fontSize:13,lineHeight:1.4,opacity:.75,textAlign:"center",maxWidth:"min(100%, calc(100vw - 40px), 720px)",width:"100%",textWrap:"balance",margin:"8px auto 32px"},children:"Always review AI-generated content for accuracy and appropriateness."})]}):(0,r.tZ)(S.U,{title:"Not available",css:{marginTop:32,maxWidth:500,marginInline:"auto"},children:"Your school has disabled access to Lola. Please contact your school administrator if you believe this is an error."}),(0,r.tZ)(Z,{ref:I})]})})}},function(t){t.O(0,[8479,2888,9774,179],function(){return t(t.s=51928)}),_N_E=t.O()}]);