1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3044],{53614:function(e,t,r){var a=r(14034),i=r(51522),n=r(85876);e.exports=function(e,t){return n(i(e),a(t,0,e.length))}},76069:function(e,t,r){var a=r(14034),i=r(85876),n=r(98346);e.exports=function(e,t){var r=n(e);return i(r,a(t,0,r.length))}},45393:function(e,t,r){var a=r(53614),i=r(76069),n=r(86152),o=r(82406),l=r(38101);e.exports=function(e,t,r){return t=(r?o(e,t,r):void 0===t)?1:l(t),(n(e)?a:i)(e,t)}},46851:function(e,t,r){"use strict";r.r(t),r.d(t,{GuidedMode:function(){return tr}});var a=r(52322),i=r(38035),n=r(12483),o=r(5632),l=r(2784),s=r(51874),d=r(77787),c=r(22537),u=r(1010);let m=e=>e.map((e,t)=>({type:"bullet",attrs:{indent:0},content:[{type:"text",text:e}]})),p=e=>e&&0!==e.length?{type:"doc",content:m(e)}:null;var g=r(21156),f=r(54691),h=r(93202),x=r(19585),b=r(93206);let y=b.N-1,v=async(e,t,r,a,i)=>{let n=k.prepare({variables:{topic:e,format:t,num:y,language:a.englishName},params:{provider:i}}),o=await (0,f.I)(n,r,{timeout:x.VH.get("aiWizardOutlineMaxWait"),retries:0}).catch(()=>null);if(!o)return[];let l=o.split("\n").filter(e=>e.trim().length>0);return l},k=new g.V({systemPromptOperation:h.Run.GetOutlineSystem,userPromptOperation:h.Run.GetOutlineUser,variables:["topic","format","num","language"],params:{maxTokens:200,temperature:1,model:"gpt-3.5-turbo"}});var j=r(42111),w=r(80498),C=r(54680);let S="TIME OUT SKIP_SENTRY",_=e=>new Promise((t,r)=>setTimeout(()=>{r(S)},e)),z=e=>{let{topic:t,format:r,interactionId:a,locale:i,provider:n}=e,o=v(t,r,a,i,n),l=_(j.VH.get("aiWizardOutlineMaxWait")||7e3),s=(0,w.Z)(Promise.race([o,l]));return s},E=e=>{let{generateFormat:t,interactionId:r,locale:a}=e,i=(0,C.g5)(),[n,o]=(0,l.useState)(null),[s,d]=(0,l.useState)(!1),[c,u]=(0,l.useState)(""),m=(0,l.useRef)(),g=(0,l.useCallback)(async e=>{var n;if(t){if(o(e),u(null),null===(n=m.current)||void 0===n||n.reject("[DocWizard.GuidedMode] Cancelled in favor of new outline request SKIP_SENTRY"),!e)return;d(!0),m.current=z({topic:e.title,format:t.label(),interactionId:r,locale:a,provider:i}),m.current.then(e=>{u(p(e)),d(!1)},e=>{e===S&&d(!1)}).catch(e=>{console.error("[DocWizard.GuidedMode.generateOutlineDef]",e),d(!1)})}},[r,a,t,i]);return{topic:n,onSubmitTopic:g,isGeneratingOutline:s,initialOutlineContent:c}};var D=r(39486),I=r(41774),G=r(9449),R=r(91994),W=r(84405),O=r(31709),F=r(41425),P=r(23147),N=r(36651),A=r(39122);let L=e=>{let{push:t}=(0,o.useRouter)(),[r]=(0,h.CsQ)(),a=(0,R.TL)(),i=(0,R.qr)(),{user:n,currentWorkspace:s}=(0,N.SE)(),d=null==s?void 0:s.id,m=(0,j.ye)("streamResumingEnabled"),[p,g]=(0,l.useState)(!1),f=(0,l.useRef)(),x=(0,l.useRef)(),b=(0,l.useRef)(),[y,v]=(0,l.useState)(!1),k=(0,l.useCallback)(()=>{var t;v(!1),g(!1),null===(t=f.current)||void 0===t||t.call(f),x.current=void 0,a((0,I.Of)({id:e}))},[a,e]),w=(0,l.useCallback)(t=>{let{prompt:r,variables:a,params:n,options:o,trackingData:l,bufferCards:s,streamId:p,docId:h}=t;k(),g(!0),x.current=o;let y={...r.prepare({variables:a,params:n}),interactionId:e,workspaceId:d},{inputData:j,...w}=l||{};c.a.trackRequestSent(i,{interface:"wizard",streaming:!0,interactionId:e,provider:n.provider,inputContent:a.input,inputMessage:a.instructions,inputData:{format:o.docFormatKey,language:a.language,model:y.params.model,options:o,...j},...w}),console.log("[AIStream] start params=".concat(JSON.stringify(y.params))),p=p||(0,u.fZ)(),b.current=p;let{stream:C,cancel:S}=(0,G.z4)(y,{streamId:p,streamResumingEnabled:m,retries:3}),{promise:_,cancel:z}=(0,D.m3)({stream:C,onCancel:S,interactionId:y.interactionId,options:o,bufferCards:s,store:i,docId:h});return f.current=z,_.then(e=>{let{status:t}=e;return console.log("[AIStream] generateDoc => ".concat(t)),"READY"===t&&v(!0),t}).finally(()=>{g(!1)})},[k,e,i,m,d]),C=(0,l.useCallback)(i=>{let o=x.current,l=(0,O.R$)({docFlags:{cardLayoutsEnabled:!0},format:(null==o?void 0:o.docFormatKey)||"deck",generateStatus:"streaming",generateInfo:{interactionId:e,streamId:b.current,lastEventId:"0",lastCompletedCardId:null,imageOptions:null==o?void 0:o.imageOptions}}),s=(0,P.qI)(l);r({variables:{workspaceId:d,themeId:i.id,source:h.L17.AiGenerated,initialContent:{ydoc:s,schemaVersion:F.bI,editors:[null==n?void 0:n.id]}}}).then(r=>{let i=r.data.createDoc.id;(0,W.Q)({doc_id:i,source:h.L17.AiGenerated}),a((0,I.kr)({id:e,docId:i})),t("/docs/".concat(i,"?source=").concat(A.VY))})},[r,d,n,a,e,t]);return{generateDoc:w,createAndOpenDoc:C,cancelGenerateRequest:k,isReadyForEditor:y,isLoading:p}};var U=r(48525),T=r(91505),B=r(64939),K=r(55261),M=r(31458),H=r(63472),q=r(43297),V=r(77533),Z=r(29117),J=r(36474),Q=r(28535),Y=r(89099),X=r(62614),$=r(42946),ee=r(49929),et=r(5879),er=r(87254),ea=r(90980),ei=r(28918),en=r(14764),eo=r(85420),el=r(47850),es=r(11050),ed=r(21733),ec=r(28086),eu=r(67422),em=r(56542),ep=r(90221),eg=r(86900),ef=r(42626),eh=r(71391),ex=r(86509),eb=r(9432),ey=r(38438),ev=r(39615),ek=r(39475),ej=r(77381),ew=r(6085),eC=r(72762),eS=r(73528),e_=r(99173),ez=r(59799),eE=r(90507),eD=r(46741);let eI={fontFamily:'"Inter", sans-serif !important',fontWeight:"500",lineHeight:"1.5 !important",textTransform:"none",letterSpacing:"normal !important",textAlign:"left !important",margin:"0 !important",color:"gray.800 !important",background:"none !important",blockquote:{borderLeftWidth:"0px !important",borderLeftStyle:"solid !important",borderLeftColor:"transparent !important",padding:"0 !important",color:"gray.800 !important",fontStyle:"normal !important"},border:"0 none !important",padding:"0 !important",content:'""'},eG={...eI,color:"var(--chakra-colors-blue-500) !important","&:hover":{textDecoration:"underline"},cursor:"pointer"},eR={"p,h1,h2,h3,h4,h5,h6":{...eI,margin:0,my:"0.75em",fontSize:"var(--raw-editor-base-font-size)"},h1:{fontSize:"var(--chakra-fontSizes-3xl) !important",fontWeight:"700"},h2:{fontSize:"var(--chakra-fontSizes-xl) !important",fontWeight:"700"},h3:{fontSize:"var(--chakra-fontSizes-lg) !important",fontWeight:"700"},a:eG,"ul, ol":{fontWeight:"500"},blockquote:{borderLeft:"3px solid var(--chakra-colors-gray-200)",paddingLeft:"0.5em"},color:"gray.800 !important",wordBreak:"break-word",lineHeight:"1.5 !important",letterSpacing:"normal !important",".mention":{bgColor:"trueblue.50",whiteSpace:"break-spaces"}},eW={fontFamily:'"Inter", sans-serif !important',fontWeight:"500",".first-run-editor":{h:"100%"},".first-run-editor .ProseMirror":{"&::before":{fontWeight:"500 !important",lineHeight:"1.5 !important",color:"gray.400 !important",float:"left",pointerEvents:"none",height:"0"},...eR,"\n @media only screen and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 2),\n @media only screen and (max-device-width: 812px) and (-webkit-min-device-pixel-ratio: 3),\n @media only screen and (max-device-width: 640px) and (-webkit-min-device-pixel-ratio: 4)\n ":{fontSize:"16px !important"},height:"100%",borderRadius:"5px","&.focus-visible":{boxShadow:"0 0 0 2px rgb(49, 130, 206)"},"a.image-link":{pointerEvents:"none"},color:"gray.800",[eD.Ky]:{marginTop:0,marginBottom:0}}},eO=()=>[ef.B,ey.n,ev.x,eC.g,e_.k,eS.aV,ex.Z,eg.ZP,ek.Z,eb.ZP,eh.Z,ez.U,ej.l,ew.m],eF=()=>
1er.ag._({id:"w1P/iM"}),eP=e=>{let{initialContent:t,onCreate:r=e=>{},onUpdate:n=e=>{},flexProps:o={},placeholder:s=eF()}=e,d=(0,l.useMemo)(()=>eO(),[]),c=(0,eE.jE)({extensions:d,content:t,onCreate:e=>{let{editor:t}=e;r({editor:t}),window.firstRunEditor=t},onUpdate:n}),u=!!(null==c?void 0:c.isEmpty);return(0,a.jsx)(i.k,{direction:"column",h:"100%",minH:"0",w:"100%",sx:{...eW,...eD.dE},children:(0,a.jsx)(i.k,{direction:"column",color:"gray.500",bg:"white",minH:36,padding:1,backdropFilter:"blur(20px)",borderRadius:"md",sx:{".ProseMirror::before":u?{content:'"'.concat(s,'"')}:""},transitionProperty:"common",transitionDuration:"normal",overflowY:"auto",_focusWithin:{shadow:"outline"},maxH:72,...o,children:(0,a.jsx)(eE.kg,{editor:c,className:"first-run-editor",style:{wordBreak:"break-word",width:"100%",flex:1}})})})};var eN=r(20437),eA=r(54933),eL=r(41004),eU=r(82108),eT=r.n(eU),eB=r(21041);let eK=Object.values(eB.U),eM={presentation:{buttonBGColor:"#CCA5DA",smallButtonBGColor:"#84389E",bgImageUrl:"https://cdn.gamma.app/zc87vhr30n8uf3n/29a73f2a0f5840d4a9d30b150a8b0c22/optimized/slide-bg.svg"},document:{buttonBGColor:"#DEC1D1",smallButtonBGColor:"#B33D7E",bgImageUrl:"https://cdn.gamma.app/zc87vhr30n8uf3n/6a7b5c09b1fd40c98b188dcd4f6c14ec/original/proposal-bg.svg"},webpage:{buttonBGColor:"#F4E1C8",smallButtonBGColor:"#BF7C22",bgImageUrl:"https://cdn.gamma.app/zc87vhr30n8uf3n/eae3778a581240728566defb10f789c6/optimized/landing-bg.svg"}},eH=(0,eL.E)(q.K),eq=e=>{let{label:t,buttonBGColor:r,bgImageUrl:n,onClick:o,isSelected:l,shouldDim:s,index:d,size:c}=e;return(0,a.jsx)(i.k,{transitionProperty:"filter, transform, border",transitionDuration:"500ms, 200ms, 350ms",_hover:{transform:"scale(1.03)"},filter:s?"saturate(0.1) contrast(0.8)":void 0,width:"100%",borderWidth:l?"3px":"0",borderColor:l?"orchid.300":"transparent",borderRadius:"sm"===c?"lg":"2xl",h:"sm"===c?36:56,overflow:"hidden",shadow:"xl",children:(0,a.jsxs)(eH,{bg:r,role:"group",cursor:"pointer",onClick:o,initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:.6,delay:.25+.15*d,ease:"easeOut"},flex:1,children:[(0,a.jsx)(i.k,{mt:2,bg:"url('".concat(n,"')"),bgPos:"center",bgSize:"auto 100%",flex:1,bgRepeat:"no-repeat",h:"sm"===c?36:48,position:"relative",children:(0,a.jsx)(i.k,{position:"absolute",top:"50%",right:"50%",transform:l?"translate(50%,-50%) scale(1)":"translate(50%,-50%) scale(.4)",zIndex:1,bg:"white",boxSize:"sm"===c?7:12,align:"center",justify:"center",borderRadius:"full",shadow:"md",borderWidth:"2px",borderColor:r,opacity:l?1:0,transitionProperty:"common",transitionDuration:"normal",fontSize:"sm"===c?"sm":"lg",children:(0,a.jsx)(ee.G,{icon:eA.LEp})})}),(0,a.jsx)(Q.xu,{p:"sm"===c?1:2,w:"100%",children:(0,a.jsx)(X.z,{variant:"ghost",w:"100%",bg:"blackAlpha.400",color:"white",backdropFilter:"saturate(200%)",_groupHover:{bg:"blackAlpha.500"},size:c||void 0,px:2,children:eT()(t())})})]})})},eV=e=>{let{label:t,smallButtonBGColor:r,onClick:i,isSelected:n,shouldDim:o}=e;return(0,a.jsx)(Q.xu,{bg:o?"gray.300":"".concat(r),borderRadius:"md",children:(0,a.jsx)(X.z,{variant:"ghost",color:"white",w:"100%",onClick:i,_focus:{bg:"".concat(r)},_hover:{bg:"".concat(r)},leftIcon:n?(0,a.jsx)(ee.G,{icon:$.LEp,color:"white",size:"lg"}):void 0,children:eT()(t())})})},eZ=e=>{let{generatedFormat:t,onSelectOutput:r,size:i}=e;return(0,ep.s2)()?(0,a.jsx)(q.K,{direction:"column",spacing:2,transitionDuration:"fast",transitionProperty:"common",minW:"70vw",children:eK.map(e=>{let i=(null==t?void 0:t.key)===e.key,n=eM[e.key];return(0,a.jsx)(eV,{label:e.label,smallButtonBGColor:n.smallButtonBGColor,onClick:()=>r(e),isSelected:i,shouldDim:t&&!i},e.key)})}):(0,a.jsx)(eN.M,{spacing:2,columns:3,children:eK.map((e,a)=>{let n=(null==t?void 0:t.key)===e.key,o=eM[e.key];return(0,l.createElement)(eq,{...o,key:e.key,label:e.label,index:a,onClick:()=>r(e),shouldDim:t&&!n,isSelected:n,size:i})})})};var eJ=r(74105),eQ=r(29494),eY=r(20816),eX=r(32899),e$=r(94523),e0=r(25925),e1=r(46152),e2=r.n(e1),e4=r(16893);let e5=()=>[{title:er.ag._({id:"8aCwol"}),type:"professional",formats:["deck"]}
1,{title:er.ag._({id:"NOzvim"}),type:"professional",formats:["deck"]},{title:er.ag._({id:"z0+Ezb"}),type:"professional",formats:["deck","document"]},{title:er.ag._({id:"etsxle"}),type:"professional",formats:["deck","document"]},{title:er.ag._({id:"QmyfID"}),type:"professional",formats:["deck","document"]},{title:er.ag._({id:"ke6b8l"}),type:"professional",formats:["deck"]},{title:er.ag._({id:"QASHwu"}),type:"professional",formats:["deck","document","webpage"]},{title:er.ag._({id:"cs9eYK"}),type:"professional",formats:["document","webpage"]},{title:er.ag._({id:"hLoXl/"}),type:"professional",formats:["deck","document","webpage"]},{title:er.ag._({id:"XrkZJq"}),type:"professional",formats:["deck","webpage"]},{title:er.ag._({id:"3kE2m2"}),type:"professional",formats:["deck","document"]},{title:er.ag._({id:"nR7t2g"}),type:"professional",formats:["webpage"]},{title:er.ag._({id:"uQOk0H"}),type:"professional",formats:["deck"]},{title:er.ag._({id:"dQYE0e"}),type:"professional",formats:["webpage"]},{title:er.ag._({id:"gAU24l"}),type:"professional",formats:["deck","document"]},{title:er.ag._({id:"pdW8CP"}),type:"professional",formats:["deck","document"]},{title:er.ag._({id:"IMSFDD"}),type:"fun",formats:["deck","document","webpage"]},{title:er.ag._({id:"z4qYv+"}),type:"fun",formats:["deck","document","webpage"]},{title:er.ag._({id:"Pn5xLt"}),type:"fun",formats:["deck","document","webpage"]},{title:er.ag._({id:"Fn+7Lk"}),type:"fun",formats:["deck","document"]},{title:er.ag._({id:"vppqKi"}),type:"fun",formats:["deck","document"]},{title:er.ag._({id:"xzJ0eW"}),type:"fun",formats:["deck","document","webpage"]},{title:er.ag._({id:"ZbZjCz"}),type:"fun",formats:["deck","document","webpage"]},{title:er.ag._({id:"D1GFUx"}),type:"fun",formats:["deck"]},{title:er.ag._({id:"u+i9HG"}),type:"fun",formats:["deck","document","webpage"]},{title:er.ag._({id:"M9dp9c"}),type:"fun",formats:["deck","document"]},{title:er.ag._({id:"jEhpBa"}),type:"fun",formats:["deck","document"]},{title:er.ag._({id:"9BZ9jQ"}),type:"fun",formats:["deck","document","webpage"]},{title:er.ag._({id:"NumOzw"}),type:"fun",formats:["deck","document","webpage"]},{title:er.ag._({id:"Pq039X"}),type:"fun",formats:["deck","document","webpage"]},{title:er.ag._({id:"fbykc2"}),type:"fun",formats:["deck","document","webpage"]},{title:er.ag._({id:"v5X7dm"}),type:"fun",formats:["deck","document","webpage"]},{title:er.ag._({id:"qpRqy5"}),type:"fun",formats:["deck","document","webpage"]},{title:er.ag._({id:"hRcqGm"}),type:"fun",formats:["deck","document","webpage"]},{title:er.ag._({id:"lxeHIK"}),type:"fun",formats:["deck","document","webpage"]},{title:er.ag._({id:"AIR0U6"}),type:"fun",formats:["deck","document","webpage"]},{title:er.ag._({id:"raFuzm"}),type:"fun",formats:["deck","document","webpage"]},{title:er.ag._({id:"vptRa/"}),type:"fun",formats:["deck","document","webpage"]},{title:er.ag._({id:"H7DNgO"}),type:"fun",formats:["deck","document","webpage"]},{title:er.ag._({id:"4pkbqe"}),type:"fun",formats:["deck","document","webpage"]},{title:er.ag._({id:"dvQtGF"}),type:"fun",formats:["deck","document","webpage"]}],e3="40px",e8=(0,eL.E)(Q.xu),e6=(0,ep.s2)()?4:6,e7=e=>{let{setTopic:t,selectedTopic:r,generateFormat:i}=e,n=(0,e4.A)(e5),[o,s]=(0,l.useState)(e6),[d,c]=(0,l.useState)(0),[u,m]=(0,l.useState)((null==r?void 0:r.title)||""),p=(0,l.useRef)(null);(0,l.useEffect)(()=>{p.current&&p.current.scrollIntoView()},[]),(0,l.useEffect)(()=>{s(e6)},[i]);let g=(0,l.useMemo)(()=>(0,ei.J1)(u),[u]),f=(0,l.useMemo)(()=>g>100,[g]),h=(0,l.useCallback)(()=>{t({title:u,type:"custom",formats:["deck","document","webpage"]}),p.current&&p.current.blur()},[t,u]),x=(0,l.useMemo)(()=>(null==i?void 0:i.docFormat)?e2()(n.filter(e=>e.formats.includes(null==i?void 0:i.docFormat))):n,[n,null==i?void 0:i.docFormat]),b=o<x.length,y=(0,l.useCallback)(()=>{p.current&&(p.current.style.height=e3,p.current.style.height=p.current.scrollHeight<=160?"".concat(p.current.scrollHeight,"px"):"".concat(160,"px"))},[]);return(0,l.useEffect)(()=>{y()},[y,u]),(0,a.jsxs)(q.K,{spacing:2,alignItems:"flex-start",w:"100%",children:[(0,a.jsxs)(eJ.B,{children:[(0,a.jsx)(eQ.g,{h:e3,minH:e3,fontWeight:"500",borderRadius:"md",ref:p,onKeyDown:e=>{"Enter"===e.key&&e.target.value.length>0&&!f&&h()}
1,placeholder:er.ag._({id:"ZZypmp"}),bgColor:"white",color:"gray.800",value:(null==r?void 0:r.title)||u,onChange:e=>{t(null),o!==e6&&s(e6),m(e.target.value)}}),(0,a.jsx)(eY.x,{bottom:0,top:"auto",children:(0,a.jsx)(e$.kH,{placement:"top",shortcut:"Enter",label:(0,a.jsx)(et.cC,{id:"JlFcis"}),children:(0,a.jsx)(eX.h,{isDisabled:!!(!u||r||f),"aria-label":er.ag._({id:"hQRttt"}),variant:"ghost",size:"sm",onClick:h,icon:(0,a.jsx)(ee.G,{icon:eA.FzC,fixedWidth:!0})})})})]}),u.length>0&&(0,a.jsxs)(Z.U,{w:"100%",justify:"flex-end",alignItems:"center",gap:2,children:[g>=90&&(0,a.jsx)(V.x,{pl:2,fontSize:(0,ep.s2)()?"xs":"sm",color:"gray.600",flex:"1",lineHeight:"1.3",children:(0,a.jsx)(e9,{})}),(0,a.jsx)(ea.H,{charCount:g,max:100,shouldShow:u.length>0})]}),0===u.length&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Y.E,{justify:"flex-end",maxW:"100%",children:(0,a.jsx)(e0.M,{children:x.slice(0,o).map((e,i)=>{let n=r&&e.title===r.title;return(0,a.jsx)(e8,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{duration:.2,delay:(i-d)*.1},children:(0,a.jsx)(X.z,{fontSize:"sm",py:2,_hover:{bg:n?"":"orchid.100"},size:"sm",colorScheme:"orchid",color:n?"white":void 0,variant:"ghost",borderWidth:"1px",cursor:"pointer",onClick:()=>{t(e)},bg:n?"orchid.700":void 0,transitionProperty:"common",transitionDuration:"normal",whiteSpace:"break-spaces",height:"min(8, fit-content)",textAlign:"right",children:e.title})},e.title)})})}),b&&(0,a.jsx)(X.z,{alignSelf:"flex-end",size:"sm",variant:"ghost",colorScheme:"blackAlpha",leftIcon:(0,a.jsx)(ee.G,{icon:$.r8p}),onClick:()=>{s(e=>(c(e),e+6))},children:(0,a.jsx)(et.cC,{id:"7wGqZ+"})})]})]})},e9=()=>(0,ep.s2)()?(0,a.jsx)(et.cC,{id:"f+RG11"}):(0,a.jsx)(et.cC,{id:"Szh0Dy"}),te=e=>{let{onClick:t,generateFormat:r,setGenerateFormat:n,setEditor:o,editor:s,topic:d,setTopic:c,locale:u,setLocale:m,initialOutlineContent:p,onOutlineRetry:g,isSalGeneratingOutline:f}=e,[h,x]=(0,l.useState)(()=>(null==d?void 0:d.title.length)&&p?5:0),b=(0,l.useRef)(null),[y,v]=(0,l.useState)(0),[k,j]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if(h%2!=0)return;let e=setTimeout(()=>{x(e=>e+1)},1e3);return()=>{clearTimeout(e)}},[h,x]),(0,l.useEffect)(()=>{var e,t;if(!b.current||0===h||f)return;let r=null===(e=b.current)||void 0===e?void 0:e.querySelector("[data-chat-step-".concat(h,"]"));(0,ep.s2)()||(h===A.LB.USER__TOPIC_INPUT?null==r||null===(t=r.querySelector("input"))||void 0===t||t.focus():h===A.LB.USER__OUTLINE_INPUT&&(null==s||s.commands.focus())),setTimeout(()=>null==r?void 0:r.scrollIntoView({behavior:"smooth"}),100)},[h,s,f]);let w=(0,l.useCallback)(()=>{d&&(g(d),j(!0))},[g,d]),{hasEnoughCreditsToGenerateDeck:C,isCreditsReady:S}=(0,el.q)(),_=S&&!C,z=(0,ep.s2)()?{position:"absolute",top:A.WJ,right:A.WJ,zIndex:A.rj+1}:{position:"fixed",bottom:A.WJ,left:A.WJ},E=(0,ep.s2)()?"100%":"calc(100% - 6rem) ",D=y>=A.VN,I=!d||D,{user:G}=(0,ed.SE)(),R={bg:"trueblue.50"};return(0,a.jsxs)(i.k,{w:"100%",direction:"column",align:"center",justifyContent:"flex-start",pt:12,children:[(0,a.jsxs)(q.K,{justify:"center",spacing:6,w:["100%","calc(100%)","container.md"],p:4,py:8,ref:b,children:[h>=0&&(0,a.jsxs)(eu.K,{from:"Designer","data-chat-step-0":!0,cardStyleOverrides:R,children:[(0,a.jsx)("span",{role:"img","aria-label":er.ag._({id:"owjSLs"}),children:"\uD83D\uDC4B"})," ",(null==G?void 0:G.firstName)?(0,a.jsx)(et.cC,{id:"tQJo7q",values:{0:G.firstName}}):(0,a.jsx)(et.cC,{id:"76JfGK"})]}),_&&(0,a.jsx)(em.x,{}),!_&&h>=1&&(0,a.jsx)(eu.K,{from:"User",cardStyleOverrides:{bg:"white",color:"gray.800",p:1,w:E},"data-chat-step-1":!0,children:(0,a.jsx)(eZ,{onSelectOutput:e=>{n(e),h<=2&&x(2)},generatedFormat:r})}),!_&&h>=2&&(null==r?void 0:r.label)&&(0,a.jsxs)(eu.K,{from:"Designer","data-chat-step-2":!0,cardStyleOverrides:R,children:[(0,a.jsx)(et.cC,{id:"AXlI0b",values:{0:r.label()}}),(0,a.jsxs)(V.x,{fontSize:"sm",color:"gray.500",mt:2,children:[" ",(0,a.jsx)(et.cC,{id:"iNK4IK"})]})]}),!_&&h>=3&&(0,a.jsx)(eu.K,{from:"User",cardStyleOverrides:{bg:"white",color:"gray.800",w:E},"data-chat-step-3":!0,children:(0,a.jsx)(e7,{generateFormat:r,setTopic:e=>{null===e?x(3):x(4),c(e)},selectedTopic:d})}),!_&&h>=4&&(null==r?void 0:r.label)&&(null==d?void 0:d.title)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eu.K,{"data-chat-step-4":!0,cardStyleOverrides:R,children:(0,a.jsx)(et.cC,{id:"Bb4CDv",values:{0:d.title},components:{0:(0,a.jsx)("br",{})}})}),(f||p)&&(0,a.jsx)(eu.K,{"data-chat-step-45":!0,cardStyleOverrides:R,children:f?(0,a.jsx)(ec.xg,{}):k?(0,a.jsx)(et.cC,{id:"SM6Zkf"}):(0,a.jsx)(et.cC,{id:"2Ws1Ru"})})]}),!_&&h>=5&&(null==r?void 0:r.label)&&(null==d?void 0:d.title)&&!f&&(0,a.jsx)(eu.K,{minW:["80vw","80vw","600px"],from:"User",cardStyleOverrides:{bg:"white",color:"gray.800",mb:24,w:E}
1,"data-chat-step-5":!0,children:(0,a.jsxs)(q.K,{p:1,w:"100%",children:[(0,a.jsxs)(Z.U,{children:[(0,a.jsx)(V.x,{color:"gray.500",children:(0,ep.s2)()?(0,a.jsx)(et.cC,{id:"CqlFQA"}):p?(0,a.jsx)(et.cC,{id:"3t7kZ7"}):(0,a.jsx)(et.cC,{id:"7tWL7D",values:{0:null==r?void 0:r.label()}})}),(0,a.jsx)(J.L,{}),(0,a.jsx)(U.k,{locale:u,setLocale:m})]}),(0,a.jsx)(Q.xu,{w:"100%",position:"relative",borderWidth:"1px",borderRadius:"md",children:(0,a.jsx)(eP,{initialContent:p,flexProps:{width:"100% !important",padding:4,paddingY:3,fontSize:"md"},onCreate:e=>{let{editor:t}=e;o(t)},onUpdate:e=>{let{editor:t}=e;v((0,ei.J1)(t.state.doc.textContent))}})}),(0,a.jsxs)(Z.U,{w:"100%",justify:"flex-end",alignItems:"center",gap:2,children:[y>=.9*A.VN&&(0,a.jsx)(V.x,{pl:2,fontSize:(0,ep.s2)()?"xs":"sm",color:"gray.600",flex:"1",children:(0,a.jsx)(e9,{})}),y>=.8*A.VN&&(0,a.jsx)(ea.H,{shouldShow:y>=.8*A.VN,charCount:y,max:A.VN})]}),(0,a.jsxs)(Y.E,{spacing:3,children:[(0,a.jsx)(X.z,{"aria-label":"Try again",variant:"outline",onClick:w,leftIcon:(0,a.jsx)(ee.G,{icon:$.QDM}),flex:"1 0 auto",children:(0,a.jsx)(et.cC,{id:"KDw4GX"})}),(0,a.jsxs)(X.z,{isDisabled:I,"aria-label":"Send",variant:"solid",onClick:()=>{t({topicTitle:null==d?void 0:d.title})},flex:"4 1 auto",children:[(0,a.jsxs)(V.x,{flex:"100",children:[(0,a.jsx)(et.cC,{id:"xGVfLh"}),"\xa0\xa0",(0,a.jsx)(ee.G,{icon:$.eFW})]}),(0,a.jsx)(eo.J,{type:"wizardCreation"})]})]})]})})]}),(0,a.jsx)(en.r,{segmentEvent:es.AA.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GUIDED,...z})]})},tt=e=>{let{children:t}=e;return(0,a.jsx)(i.k,{h:"100vh",direction:"column",children:(0,a.jsx)(s.v4,{children:t})})},tr=()=>{let e=(0,R.qr)(),{isUserLoading:t,currentWorkspace:r}=(0,N.SE)(),{step:i,setStep:s,generateFormat:m,setGenerateFormat:p,selectedTheme:g,openAiStatus:f,setSelectedTheme:h,interactionId:x}=(0,C.dn)(),y=(0,o.useRouter)();(0,l.useEffect)(()=>{y.prefetch("/docs/[docId]")},[y]);let v=(0,j.ye)("aiWizardAverageWaitGuided"),k=(0,j.ye)("generatorLazyImages"),{themes:w,isThemesLoading:S}=(0,C.bo)(),[_,z]=(0,l.useState)(),[D,I]=(0,U.e)(),[G,W]=(0,l.useState)(null),O=(0,C.g5)(),{generateDoc:F,createAndOpenDoc:P,cancelGenerateRequest:A,isReadyForEditor:q,isLoading:V}=L(x),{topic:Z,onSubmitTopic:J,isGeneratingOutline:Q,initialOutlineContent:Y}=E({interactionId:x,generateFormat:m,locale:D}),X=(0,l.useCallback)(async t=>{let{topicTitle:r}=t;if(!_||!m)return;console.log("[AI] wizard generate start",{isAdvancedMode:!1,interactionId:x}),s("theme");let a="<h1>".concat(r,"</h1>\n").concat((0,d.c)(_,_.state.doc.content));F({prompt:m.prompt,variables:{input:a,language:D.englishName||"English",numCards:b.N},params:{provider:O},options:{docFormatKey:m.docFormat,imageOptions:{provider:"web"},lazyImages:k},trackingData:{inputData:{isAdvancedMode:!1}}}).catch(t=>{let{errorMessage:r,errorCode:a}=(0,u.uS)(t);c.a.trackStreamError(e,{interactionId:x,errorMessage:r,errorCode:a,errorName:"WizardError"}),W(r),n.Tb(t,{extra:{interactionId:x,context:"DocWizard.GuidedMode.generateFirstDraft"}})})},[_,m,x,s,F,D,e,O,k]),$=(0,l.useCallback)(()=>{s("input"),W(null)},[s]);return((0,l.useEffect)(()=>{"editor"===i&&g&&q&&P(g)},[P,q,g,i]),"DOWN"===f)?(0,a.jsx)(H.tW,{showHomeButton:!0}):G?(0,a.jsx)(H.As,{onClick:$,errMessage:G,interactionId:x}):(0,a.jsxs)(tt,{children:[(0,a.jsx)(M.D,{step:i,setStep:s,isLoading:V,isReadyForEditor:q,cancelGenerateRequest:A,stackProps:{position:"relative",top:-3},estimatedTime:v}),"theme"!==i&&(0,a.jsx)(T.t,{flexProps:{position:"fixed"}}),t||!r?null:"input"===i?(0,a.jsx)(te,{setEditor:z,editor:_,onClick:X,generateFormat:m,setGenerateFormat:p,topic:Z,setTopic:J,locale:D,setLocale:I,onOutlineRetry:()=>{Z&&J(Z)},initialOutlineContent:Y,isSalGeneratingOutline:Q}):"theme"===i&&m?(0,a.jsx)(K.JE,{initialTheme:g,onThemeSelect:h,onNextClick:()=>{s("editor")},themes:w,isThemesLoading:S,flexProps:{bg:"transparent",w:"100vw"}}):"editor"===i?(0,a.jsx)(B.r,{showDegraded:"DEGRADED"===f}):null]})}},21041:function(e,t,r){"use strict";r.d(t,{U:function(){return d}});var a=r(87254),i=r(21156),n=r(93202);let o={key:"presentation",label:()=>a.ag._({id:"nQbhA4"}),docFormat:"deck",prompt:new i.V({params:{temperature:1,model:"gpt-3.5-turbo"},variables:["input","numCards","language"],systemPromptOperation:n.Run.GeneratePresentationSystem,userPromptOperation:n.Run.GeneratePresentationUser})},l={key:"document",label:()=>a.ag._({id:"XH30C4"}),docFormat:"document",prompt:new i.V({params:{temperature:1,model:"gpt-3.5-turbo"},variables:["input","numCards","language"],systemPromptOperation:n.Run.GenerateDocumentSystem,userPromptOperation:n.Run.GenerateDocumentUser})},s={key:"webpage",label:()=>a.ag._({id:"1NdXQ6"}),docFormat:"webpage",prompt:new i.V({params:{temperature:1,model:"gpt-3.5-turbo"},variables:["input","numCards","language"],systemPromptOperation:n.Run.GenerateWebpageSystem,userPromptOperation:n.Run.GenerateWebpageUser})},d={presentation:o,document:l,webpage:s}},93206:function(e,t,r){"use strict";r.d(t,{N:function(){return a}});let a=8},19376:function(e,t,r){"use strict";r.d(t,{D:function(){return s}});var a=r(76801),i=r(52322),n=e=>(0,i.jsx)(a.m.circle,{cx:50,cy:50,r:42,fill:"transparent",...e});n.displayName="Circle";var o=r(14008),l=e=>{let{size:t,isIndeterminate:r,...n}=e;return(0,i.jsx)(a.m.svg,{viewBox:"0 0 100 100",__css:{width:t,height:t,animation:r?`${o.U1} 2s linear infinite`:void 0},...n})};l.displayName="Shape";var s=(0,r(68023).G)((e,t)=>{var r;let{size:s="48px",max:d=100,min:c=0,valueText:u,getValueText:m,value:p,capIsRound:g,children:f,thickness:h="10px",color:x="#0078d4",trackColor:b="#edebe9",isIndeterminate:y,...v}=e,k=(0,o.Wt)({min:c,max:d,value:p,valueText:u,getValueText:m,isIndeterminate:y}),j=y?void 0:(null!=(r=k.percent)?r:0)*2.64,w=null==j?void 0:`${j} ${264-j}`,C=y?{css:{animation:`${o.O2} 1.5s linear infinite`}}:{strokeDashoffset:66,strokeDasharray:w,transitionProperty:"stroke-dasharray, stroke",transitionDuration:"0.6s",transitionTimingFunction:"ease"};
1return(0,i.jsxs)(a.m.div,{ref:t,className:"chakra-progress",...k.bind,...v,__css:{display:"inline-block",position:"relative",verticalAlign:"middle",fontSize:s},children:[(0,i.jsxs)(l,{size:s,isIndeterminate:y,children:[(0,i.jsx)(n,{stroke:b,strokeWidth:h,className:"chakra-progress__track"}),(0,i.jsx)(n,{stroke:x,strokeWidth:h,className:"chakra-progress__indicator",strokeLinecap:g?"round":void 0,opacity:0!==k.value||y?void 0:0,...C})]}),f]})});s.displayName="CircularProgress"}}]); 2//# sourceMappingURL=3044.9af12d3edb413de0.js.map
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.