(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{918:function(e,t,a){"use strict";a.d(t,"a",(function(){return g}));var n=a(1),l=a.n(n),o=a(172),i=a(2),c=a(19),r=a(24),s=a(8),m=a(7),d=a(93),p=a(133),u=a(126),b=a(62);const h=a(994),g=l.a.memo(e=>{const[t,a]=Object(n.useState)(""),[g,j]=Object(n.useState)(""),[v,O]=Object(n.useState)(""),[w,C]=Object(n.useState)(0),[N,x]=Object(n.useState)(!1),[f,k]=Object(n.useState)(!1),[_,y]=Object(n.useState)(function(){const e=[{q:(()=>{const e=E(1,9);return`这段代码会输出 5+6+7+....+15 连续求和的结果。\n请另写一段代码, 输出 ${e} * ${e+1} * ${e+2}...* ${e+E(5,20)} 连续相乘的结果。`})(),code:"let sum = 0;\nfor (let i = 5; i <=15; i++) {\n sum += i;\n}\nconsole.log(sum);"},{q:(()=>{const e=["play piano","speak English","draw pictures","sing songs","wash cloths","watch TV"],t=e[E(0,e.length-1)];return`修改howToDo的代码, \n使得console.log(howToDo('${t.split(" ")[1]}')); \n输出 ${t}, 并且其他结果保持不变`})(),code:"function howToDo(name) {\n if (name == 'apple') {\n return `eat ${name}`;\n } else if (name == 'juice') {\n return `drink ${name}`;\n } else {\n return 'do nothing';\n }\n}\n\nconsole.log(howToDo('apple')); // eat apple\nconsole.log(howToDo('juice')); // drink juice\nconsole.log(howToDo('bug')); // do nothing\nconsole.log(howToDo('school')); // do nothing"},{q:(()=>{const e=E(6,8),t=[];for(let a=0;a list[j + 1]) {\n temp = list[j];\n list[j] = list[j + 1];\n list[j + 1] = temp;\n }\n }\n }\n return list;\n};"}];return e[Math.floor(Math.random()*e.length)]}()),S=!!g,T=()=>{const a=c.a.pending(Object(i.e)("submiting"));e.onConfirm(t,g,_.q+"\n"+_.code,v).then(()=>{c.a.closeNotice(a),c.a.success(Object(i.e)("submitApplySuccess")),M(b.c.SUBMIT_APPLICATION),e.onClose()}).catch(e=>{c.a.closeNotice(a),c.a.error(Object(i.e)("submitFail"))})},D=()=>{S&&C(1)},F=()=>{C(0)},M=e=>{(new b.a).track(e)},$=Object(i.e)("applyCreator");let q=l.a.createElement(l.a.Fragment,null),I=[],A=l.a.createElement(l.a.Fragment,null);return 0===w?(q=l.a.createElement("div",{className:h.desc},Object(i.e)("applyDesc")),I=[{text:Object(i.e)("next_step"),disabled:!S,onClick:D}],A=l.a.createElement(l.a.Fragment,null,l.a.createElement("div",{className:h.inputContainer},l.a.createElement("div",{className:h.fieldContainer},l.a.createElement(s.a,{className:h.br8},`${Object(i.e)("phone_number")} (${Object(i.e)("inputOptional")})`),l.a.createElement("input",{type:"number",placeholder:"请输入你的手机号码",value:t,onChange:e=>{a(e.target.value),x(!1)}}),N&&l.a.createElement("div",{className:h.errorMsg},Object(i.e)("wrongNumber"))),l.a.createElement("div",{className:h.fieldContainer},l.a.createElement(s.a,{className:h.br8},Object(i.e)("applyReason"),"*"),l.a.createElement("textarea",{value:g,placeholder:Object(i.e)("whyWantTryGameEditor"),onChange:e=>{j(e.target.value),k(!1)}}),f&&l.a.createElement("div",{className:h.errorMsg},Object(i.e)("inputMinWords",{count:10})))))):(I=[{text:Object(i.e)("prev_step"),onClick:F},{text:Object(i.e)("submit"),onClick:T}],A=l.a.createElement("div",{className:h.inputContainer},l.a.createElement("div",{className:h.fieldContainer},l.a.createElement(s.a,{className:h.br8},Object(i.e)("topic")),l.a.createElement("div",null,l.a.createElement(s.a,{size:14,className:h.br16,wrap:!0},_.q),l.a.createElement("div",{className:h.codeBlock,style:{display:_.inline?"inline-block":"block",padding:_.inline?"0px 8px":"8px 16px",marginTop:_.inline?"0":"4px",transform:_.inline?"translate(0, 25%)":void 0}},_.code))),l.a.createElement("div",{className:h.fieldContainer+" "+h.lastField},l.a.createElement(s.a,{className:h.br8},Object(i.e)("answer"),"*"),l.a.createElement("textarea",{value:v,placeholder:`${Object(i.e)("answer")} (${Object(i.e)("inputOptional")})`,onChange:e=>O(e.target.value)})))),Object(m.f)()?Object(m.l)()?l.a.createElement(d.a,{title:$,onClose:e.onClose,buttons:I,minWidth:"400px"},q,A):l.a.createElement(p.a,{className:h.overlay},l.a.createElement("div",{className:h.head},l.a.createElement(r.a,{icon:"back",size:24,onClick:0===w?e.onClose:F}),l.a.createElement(s.a,null,$),0===w?l.a.createElement(s.a,{size:20,onClick:D,weight:S?"default":"disabled"},l.a.createElement("b",null,Object(i.e)("next_step"))):l.a.createElement(s.a,{size:20,onClick:T},l.a.createElement("b",null,Object(i.e)("submit")))),l.a.createElement("div",{className:h.overlayBody},q,A)):l.a.createElement(o.a,{onClose:e.onClose},l.a.createElement("div",{className:h.applyFormContainer},l.a.createElement(r.a,{icon:"close",onClick:e.onClose,className:h.closeBtn}),l.a.createElement("div",{className:h.titleContainer},l.a.createElement("div",{className:h.title},$),q),l.a.createElement("div",{className:h.pageContainer},A),l.a.createElement("div",{className:h.buttons},I.map((e,t)=>l.a.createElement(u.a,{key:t,onClick:e.onClick,disabled:e.disabled},e.text)))))});function E(e,t){return Math.floor(Math.random()*t)+e}},994:function(e,t,a){e.exports={phonePortrait:"screen and (max-width: 500px) and (orientation: portrait)",tablet:"screen and (orientation: portrait) and (min-width: 501px) and (max-width: 1024px) and (min-height: 501px) and (max-height: 1366px), screen and (orientation: landscape) and (min-height: 501px) and (max-height: 1024px) and (min-width: 501px) and (max-width: 1366px)",phone:"screen and (max-width: 500px), screen and (max-height: 500px)",br8:"_3ih2BEeB-YUGRK0FMDhUJi",br16:"_2ms_ar9yLV8VNWIDA8zA5Z",applyFormContainer:"_2LZaXTVyOXDD1p75wvo_or",closeBtn:"_4nSR58v9wwT7m2YOWwTfG",titleContainer:"EewUhFSSMiK8Os2ywne2l",title:"peO9vQf6j1lLHh_iliwac",desc:"_3NN1q4Nvh-fXavlA5r5Au0",inputContainer:"_1o7IAvnm3lFIYLhDZIDnnK",fieldContainer:"Eeg9iaedFmcw1ywbXSUIM",lastField:"V_JmUvpJNH4HV7uedOa-6",codeBlock:"_2OPkFDX-GZlxr3Masb3O15",buttons:"_1lKamA2yNIwbP_Z9gSPzAF",errorMsg:"_3iaqZE98kfKQqpRqrTNPmX",pageContainer:"_2PkSFgmqPU473hI7nB0hI3",overlay:"_3qUpCql_IuY1VR5dupHybC",overlayBody:"_2X-svjSvzBJ3kJ3zPcM6J5",head:"_3-dLd3b6g7ApkJOo2Lz0Rb"}}}]);