UNPKG

pxt-core

Version:

Microsoft MakeCode provides Blocks / JavaScript / Python tools and editors

1 lines • 2.79 MB
!function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var l="function"==typeof require&&require;if(!a&&l)return l(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[s]={exports:{}};t[s][0].call(u.exports,(function(e){return i(t[s][1][e]||e)}),u,u.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.pushNotificationMessage=n.Notification=void 0;const r=e("react/jsx-runtime"),i=e("react"),o=e("react-dom");class s extends i.Component{constructor(e){super(e),this.state={notifications:{}}}push(e){const t=this.state.notifications,n=ts.pxtc.Util.guidGen();Object.keys(t).filter((n=>t[n].kind==e.kind)).forEach((e=>this.remove(e))),t[n]=e;const r=this;setTimeout((()=>{r.remove(n)}),3e3),this.setState({notifications:t})}remove(e){const t=this.state.notifications;t[e]&&(delete t[e],this.setState({notifications:t}))}render(){const{notifications:e}=this.state;return(0,r.jsx)("div",Object.assign({id:"msg","aria-live":"polite"},{children:Object.keys(e).map((t=>function(e,t){const{kind:n,text:i,hc:o}=t;let s="ignored info message";switch(n){case"err":s="red inverted segment";break;case"warn":s="orange inverted segment";break;case"info":s="teal inverted segment";break;case"compile":s="ignored info message"}return(0,r.jsx)("div",Object.assign({id:`${n}msg`,className:`ui ${o} ${s}`},{children:i}),`${e}`)}(t,e[t])))}))}}n.Notification=s;let a,l=!1;n.pushNotificationMessage=function(e){if(l)a&&a.push(e);else{l=!0;const t=document.body.appendChild(document.createElement("div"));(a=o.render(i.createElement(s,e),t)).push(e)}}},{react:364,"react-dom":307,"react/jsx-runtime":365}],2:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Button=void 0;const r=e("react/jsx-runtime"),i=e("../util");n.Button=e=>{const{id:t,className:n,style:o,ariaLabel:s,ariaHidden:a,ariaDescribedBy:l,ariaControls:c,ariaExpanded:u,ariaHasPopup:d,ariaPosInSet:p,ariaSetSize:h,ariaSelected:f,role:g,onClick:m,onKeydown:v,onBlur:y,buttonRef:b,title:x,label:E,leftIcon:_,rightIcon:w,hardDisabled:S,href:T,target:k,tabIndex:C}=e;let{disabled:A}=e;A=A||S;const j=(0,i.classList)("common-button",n,A&&"disabled");return(0,r.jsx)("button",Object.assign({id:t,className:j,style:o,title:x,ref:b,onClick:A?void 0:e=>{m&&m(),T&&window.open(T,k||"_blank","noopener,noreferrer"),e.stopPropagation(),e.preventDefault()},onKeyDown:v||i.fireClickOnEnter,onBlur:y,role:g||"button",tabIndex:C||(A?-1:0),disabled:S,"aria-label":s,"aria-hidden":a,"aria-controls":c,"aria-expanded":u,"aria-haspopup":d,"aria-posinset":p,"aria-setsize":h,"aria-describedby":l,"aria-selected":f},{children:(0,r.jsxs)("span",Object.assign({className:"common-button-flex"},{children:[_&&(0,r.jsx)("i",{className:_,"aria-hidden":!0}),(0,r.jsx)("span",Object.assign({className:"common-button-label"},{children:E})),w&&(0,r.jsx)("i",{className:"right "+w,"aria-hidden":!0})]}))}))}},{"../util":40,"react/jsx-runtime":365}],3:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Card=void 0;const r=e("react/jsx-runtime"),i=e("../util");n.Card=e=>{const{id:t,className:n,role:o,children:s,ariaDescribedBy:a,ariaLabelledBy:l,ariaHidden:c,ariaLabel:u,onClick:d,label:p,labelClass:h,tabIndex:f}=e;return(0,r.jsxs)("div",Object.assign({id:t,className:(0,i.classList)("common-card",n),role:o||(d?"button":void 0),"aria-describedby":a,"aria-labelledby":l,"aria-hidden":c,"aria-label":u,onClick:d,tabIndex:f,onKeyDown:i.fireClickOnEnter},{children:[(0,r.jsx)("div",Object.assign({className:"common-card-body"},{children:s})),p&&(0,r.jsx)("label",Object.assign({className:(0,i.classList)("common-card-label",h)},{children:p}))]}))}},{"../util":40,"react/jsx-runtime":365}],4:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Checkbox=void 0;const r=e("react/jsx-runtime"),i=e("../util");n.Checkbox=e=>{const{id:t,className:n,ariaHidden:o,ariaLabel:s,role:a,isChecked:l,onChange:c,label:u}=e;return(0,r.jsxs)("div",Object.assign({className:(0,i.classList)("common-checkbox",n)},{children:[(0,r.jsx)("input",{id:t,tabIndex:0,type:"checkbox",checked:l,onChange:()=>{c(!l)},onKeyDown:i.fireClickOnEnter,role:a,"aria-hidden":o,"aria-label":s}),u&&(0,r.jsx)("label",Object.assign({htmlFor:t},{children:u}))]}))}},{"../util":40,"react/jsx-runtime":365}],5:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DraggableGraph=void 0;const r=e("react/jsx-runtime"),i=e("react"),o=e("../util");function s(e,t,n,r,i,o){let s;switch(i){case"linear":s=i=>t+(i-e)*(r-t)/(n-e);break;case"curve":s=i=>t+(r-t)*Math.sin((i-e)/(n-e)*(Math.PI/2));break;case"logarithmic":s=i=>t+Math.log10(1+(i-e)/(n-e)*9)*(r-t)}const a=(n-e)/20,l=[`M ${e} ${t}`];let c=e,u=t,d=e,p=t;for(let t=1;t<21;t++){if(p=s(d=e+t*a),!o){l.push(`L ${d} ${p}`);continue}const n=Math.atan2(p-u,d-c),r=Math.sqrt((p-u)**2+(d-c)**2),i=c+Math.cos(n)*(r/4)+20*Math.cos(n+Math.PI/2),h=u+Math.sin(n)*(r/4)+20*Math.sin(n+Math.PI/2);l.push(`Q ${i} ${h} ${c+Math.cos(n)*(r/2)} ${u+Math.sin(n)*(r/2)}`);const f=c+Math.cos(n)*(3*r/4)-20*Math.cos(n+Math.PI/2),g=u+Math.sin(n)*(3*r/4)-20*Math.sin(n+Math.PI/2);l.push(`Q ${f} ${g} ${d} ${p}`),c=d,u=p}return l.join(" ")}n.DraggableGraph=e=>{const{interpolation:t,min:n,max:a,points:l,handleStartAnimationRef:c,onPointChange:u,id:d,className:p,ariaLabel:h,ariaHidden:f,ariaDescribedBy:g,role:m,aspectRatio:v,squiggly:y,valueUnits:b}=e,x=1/v*1e3,E=x-62.5,_=962.5/(l.length-1),w=E/(a-n),[S,T]=i.useState(-1),k=e=>(1-(e.y-25)/E)*(a-n)+n;let C;const A=(e,t)=>{C&&cancelAnimationFrame(C),C=requestAnimationFrame((()=>{j(e,t)}))},j=(e,t)=>{u(e,Math.max(Math.min(t,a),n))},I=[],O=e=>t=>{t&&(I[e]=t)};i.useEffect((()=>{I.forEach(((e,t)=>{e.onpointerdown=n=>{if(-1!==S)return;n.preventDefault();const r=(0,o.clientCoord)(n),i=(0,o.screenToSVGCoord)(e.ownerSVGElement,r);T(t),A(t,k(i))},e.onpointermove=n=>{if(S!==t)return;n.preventDefault();const r=(0,o.clientCoord)(n),i=(0,o.screenToSVGCoord)(e.ownerSVGElement,r);A(t,k(i))},e.onpointerleave=n=>{if(S!==t)return;T(-1);const r=(0,o.clientCoord)(n),i=(0,o.screenToSVGCoord)(e.ownerSVGElement,r);A(t,k(i))},e.onpointerup=n=>{if(S!==t)return;T(-1);const r=(0,o.clientCoord)(n),i=(0,o.screenToSVGCoord)(e.ownerSVGElement,r);A(t,k(i))}}))}),[S,u]);const N=e=>Math.min(Math.max(l[e],n),a);return(0,r.jsx)("div",Object.assign({id:d,className:(0,o.classList)("common-draggable-graph",p),"aria-label":h,"aria-hidden":f,"aria-describedby":g,role:m},{children:(0,r.jsxs)("svg",Object.assign({className:"draggable-graph-svg",viewBox:`0 0 1000 ${x}`,xmlns:"http://www.w3.org/2000/svg"},{children:[(0,r.jsx)("defs",{children:(0,r.jsxs)("filter",Object.assign({id:"dropshadow"},{children:[(0,r.jsx)("feGaussianBlur",{in:"SourceAlpha",stdDeviation:"3"}),(0,r.jsx)("feOffset",{dx:"0",dy:"0"}),(0,r.jsx)("feComponentTransfer",{children:(0,r.jsx)("feFuncA",{type:"linear",slope:"0.5"})}),(0,r.jsxs)("feMerge",{children:[(0,r.jsx)("feMergeNode",{}),(0,r.jsx)("feMergeNode",{in:"SourceGraphic"})]})]}))}),l.map(((e,n)=>{const i=n<l.length-1,o=Math.max(_*n-12.5,25),c=25+Math.max(w*(a-N(n))-12.5,12.5),u=i&&N(n+1)>N(n)||!i&&N(n-1)>N(n);return(0,r.jsxs)("g",Object.assign({className:"draggable-graph-column"},{children:[i&&(0,r.jsx)("path",{className:"draggable-graph-path",stroke:"black",fill:"none",strokeWidth:"2px",d:s(o,c,Math.max(_*(n+1),0),25+Math.max(w*(a-N(n+1))-12.5,12.5),t,y)}),(0,r.jsx)("circle",{className:"draggable-graph-point",cx:o+12.5,cy:c,r:25,fill:"white",filter:"url(#dropshadow)"}),(0,r.jsx)("text",Object.assign({className:"common-draggable-graph-text",x:i?o+50:o-25,y:u?c+50:Math.max(c-25,25),textAnchor:i?"start":"end",fontSize:25},{children:Math.round(N(n))+(b||"")})),(0,r.jsx)("rect",{className:"draggable-graph-surface",ref:O(n),x:o-_/6,y:0,width:_/3,height:x,fill:"white",opacity:0})]}),n)})),(0,r.jsx)("rect",Object.assign({x:"-2",y:"0",width:"1",height:"100%",fill:"grey"},{children:(0,r.jsx)("animate",{ref:e=>{e&&c&&c((t=>{t<=0&&(t=1),e.setAttribute("dur",t+"ms"),e.beginElement()}))},attributeName:"x",from:"2%",to:"98%",dur:"1000ms",begin:"indefinite"})}))]}))}))}},{"../util":40,react:364,"react/jsx-runtime":365}],6:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Dropdown=void 0;const r=e("react/jsx-runtime"),i=e("react"),o=e("../util"),s=e("./Button"),a=e("./FocusList");n.Dropdown=e=>{const{id:t,className:n,ariaHidden:l,ariaLabel:c,role:u,items:d,tabIndex:p,selectedId:h,onItemSelected:f}=e,[g,m]=i.useState(!1);let v;const y=(0,o.classList)("common-dropdown",n),b=d.find((e=>e.id===h))||d[0];return(0,r.jsxs)("div",Object.assign({className:y,ref:e=>{e&&(v=e)},onBlur:e=>{v&&g&&!v.contains(e.relatedTarget)&&m(!1)}},{children:[(0,r.jsx)(s.Button,Object.assign({},b,{id:t,tabIndex:p,rightIcon:g?"fas fa-chevron-up":"fas fa-chevron-down",role:u,className:(0,o.classList)("common-dropdown-button",g&&"expanded",b.className),onClick:()=>{m(!g)},onKeydown:e=>{const t=d.indexOf(b);"ArrowDown"===e.key?t<d.length-1&&(f(d[t+1].id),e.preventDefault(),e.stopPropagation()):"ArrowUp"===e.key?t>0&&(f(d[t-1].id),e.preventDefault(),e.stopPropagation()):"Enter"===e.key&&(m(!0),e.preventDefault(),e.stopPropagation())},ariaHasPopup:"listbox",ariaExpanded:g,ariaLabel:c,ariaHidden:l})),g&&(0,r.jsx)(a.FocusList,Object.assign({role:"listbox",className:"common-menu-dropdown-pane common-dropdown-shadow",childTabStopId:h,"aria-labelledby":t,useUpAndDownArrowKeys:!0,onItemReceivedFocus:e=>{e.id&&d.some((t=>t.id===e.id))&&f(e.id)}},{children:(0,r.jsx)("ul",Object.assign({role:"presentation"},{children:d.map((e=>(0,r.jsx)("li",Object.assign({role:"presentation"},{children:(0,r.jsx)(s.Button,Object.assign({},e,{className:(0,o.classList)("common-dropdown-item",e.className),onClick:()=>{m(!1),f(e.id)},ariaSelected:e.id===h,role:"option"}))}),e.id)))}))}))]}))}},{"../util":40,"./Button":2,"./FocusList":8,react:364,"react/jsx-runtime":365}],7:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.EditorToggle=void 0;const r=e("react/jsx-runtime"),i=e("../util"),o=e("./Button"),s=e("./FocusList"),a=e("./MenuDropdown");n.EditorToggle=e=>{const{id:t,className:n,ariaHidden:o,ariaLabel:s,role:d,items:p,selected:h}=e,f=p.some((e=>u(e))),g=e=>{};return(0,r.jsxs)("div",Object.assign({className:"common-editor-toggle-outer"},{children:[(0,r.jsx)(c,Object.assign({},e)),(0,r.jsxs)("div",Object.assign({id:t,className:(0,i.classList)("common-editor-toggle",f&&"has-dropdown",n),role:d||"tablist","aria-hidden":!0,"aria-label":s},{children:[p.map(((e,t)=>{const n=h===t;return(0,r.jsxs)("div",Object.assign({className:(0,i.classList)("common-editor-toggle-item",n&&"selected",u(e)&&"common-editor-toggle-item-dropdown")},{children:[(0,r.jsx)(l,{item:e,isSelected:n,onKeydown:g}),u(e)&&(0,r.jsx)(a.MenuDropdown,{id:"toggle-dropdown",className:"toggle-dropdown",icon:"fas fa-chevron-down",title:lf("More options"),tabIndex:-1,ariaHidden:!0,items:e.items.map((e=>({title:e.title,label:e.label,onClick:e.onClick,leftIcon:e.icon})))})]}),t)})),(0,r.jsx)("div",{className:"common-editor-toggle-handle","aria-hidden":!0})]}))]}))};const l=e=>{const{item:t,isSelected:n,onKeydown:i}=e,{label:s,title:a,onClick:l,icon:c,focusable:u}=t;return(0,r.jsx)(o.Button,{className:c?void 0:"no-icon",role:u?"tab":void 0,tabIndex:-1,onKeydown:i,label:s,title:a,onClick:l,leftIcon:c,ariaHidden:!0})},c=e=>{const{items:t,id:n,selected:i,ariaHidden:a}=e,l=t.reduce(((e,t,n)=>{const r=[...e];return r.push(Object.assign({},t)),i===n&&(r[r.length-1].selected=!0),u(t)&&r.push(...t.items.filter((e=>e.focusable))),r}),[]);return(0,r.jsx)(s.FocusList,Object.assign({id:n,role:"tablist",className:"common-toggle-accessibility",childTabStopId:n+"-selected"},{children:l.map(((e,t)=>(0,r.jsx)(o.Button,{className:e.selected?"selected":void 0,id:e.selected?n+"-selected":void 0,role:"tab",title:e.title,label:e.label,onClick:e.onClick,ariaSelected:e.selected,ariaHidden:a},t)))}))};function u(e){var t;return!!(null===(t=e.items)||void 0===t?void 0:t.length)}},{"../util":40,"./Button":2,"./FocusList":8,"./MenuDropdown":14,"react/jsx-runtime":365}],8:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.FocusList=void 0;const r=e("react/jsx-runtime");n.FocusList=e=>{const{id:t,className:n,role:i,ariaHidden:o,ariaLabel:s,childTabStopId:a,children:l,onItemReceivedFocus:c,useUpAndDownArrowKeys:u}=e;let d,p;return(0,r.jsx)("div",Object.assign({id:t,className:n,role:i,tabIndex:a?void 0:0,onKeyDown:e=>{if(!(null==d?void 0:d.length))return;const t=document.activeElement,n=d.indexOf(t),r=e=>{e.focus(),c&&c(e)};-1===n&&t!==p||("Enter"===e.key||" "===e.key?(e.preventDefault(),e.stopPropagation(),t.click?t.click():t.dispatchEvent(new Event("click"))):e.key===(u?"ArrowDown":"ArrowRight")?(n===d.length-1||t===p?r(d[0]):r(d[n+1]),e.preventDefault(),e.stopPropagation()):e.key===(u?"ArrowUp":"ArrowLeft")?(r(0===n||t===p?d[d.length-1]:d[Math.max(n-1,0)]),e.preventDefault(),e.stopPropagation()):"Home"===e.key?(r(d[0]),e.preventDefault(),e.stopPropagation()):"End"===e.key&&(r(d[d.length-1]),e.preventDefault(),e.stopPropagation()))},ref:e=>{if(!e||p)return;p=e;const t=e.querySelectorAll('[tabindex]:not([tabindex="-1"]),[data-isfocusable]');d=[];for(const e of t.values())d.push(e),e.setAttribute("tabindex","-1"),e.setAttribute("data-isfocusable","true");if(a){const e=p.querySelector("#"+a);e&&e.setAttribute("tabindex","0")}},"aria-hidden":o,"aria-label":s},{children:l}))}},{"react/jsx-runtime":365}],9:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.FocusTrap=void 0;const r=e("react/jsx-runtime"),i=e("react"),o=e("../util");n.FocusTrap=e=>{const{children:t,id:n,className:s,onEscape:a,arrowKeyNavigation:l,dontStealFocus:c,includeOutsideTabOrder:u}=e;let d;const[p,h]=i.useState(!1),f=()=>(0,o.nodeListToArray)(u?d.querySelectorAll("[tabindex]"):d.querySelectorAll('[tabindex]:not([tabindex="-1"])'));return(0,r.jsx)("div",Object.assign({id:n,className:(0,o.classList)("common-focus-trap",s),ref:e=>{e&&(d=e,c||p||e.contains(document.activeElement)||!f().length||(d.focus(),h(!0)))},onKeyDown:e=>{if(!d)return;const t=(t,n)=>{const r=f();if(!r.length)return;const i=r.indexOf(e.target);t?n?r[r.length-1].focus():i===r.length-1?r[0].focus():r[i+1].focus():n?r[0].focus():0===i?r[r.length-1].focus():r[Math.max(i-1,0)].focus(),e.preventDefault(),e.stopPropagation()};"Escape"===e.key?(a(),e.preventDefault(),e.stopPropagation()):"Tab"===e.key?e.shiftKey?t(!1,!1):t(!0,!1):l&&("ArrowDown"===e.key?t(!0,!1):"ArrowUp"===e.key?t(!1,!1):"Home"===e.key?t(!1,!0):"End"===e.key&&t(!0,!0))},tabIndex:-1},{children:t}))}},{"../util":40,react:364,"react/jsx-runtime":365}],10:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Input=void 0;const r=e("react/jsx-runtime"),i=e("react"),o=e("../util"),s=e("./Button");n.Input=e=>{const{id:t,className:n,inputClassName:a,groupClassName:l,role:c,ariaHidden:u,ariaLabel:d,initialValue:p,label:h,title:f,placeholder:g,icon:m,iconTitle:v,disabled:y,type:b,readOnly:x,autoComplete:E,selectOnClick:_,onChange:w,onEnterKey:S,onIconClick:T,onBlur:k,handleInputRef:C,preserveValueOnBlur:A}=e,[j,I]=i.useState(void 0);return(0,r.jsxs)("div",Object.assign({className:(0,o.classList)("common-input-wrapper",y&&"disabled",n)},{children:[h&&(0,r.jsx)("label",Object.assign({className:"common-input-label",htmlFor:t},{children:h})),(0,r.jsxs)("div",Object.assign({className:(0,o.classList)("common-input-group",l)},{children:[(0,r.jsx)("input",{id:t,className:(0,o.classList)("common-input",m&&"has-icon",a),title:f,role:c||"textbox",tabIndex:y?-1:0,"aria-label":d,"aria-hidden":u,type:b||"text",placeholder:g,value:void 0!==j?j:p||"",readOnly:!!x,onClick:e=>{_&&e.target.select()},onChange:e=>{const t=e.target.value;x||j===t||I(t),w&&w(t)},onKeyDown:t=>{const n="number"==typeof t.which?t.which:t.keyCode;(13===n||e.treatSpaceAsEnter&&32===n)&&S&&(t.preventDefault(),S(j))},onBlur:()=>{k&&k(j),A||I(void 0)},autoComplete:E?"":"off",autoCorrect:E?"":"off",autoCapitalize:E?"":"off",spellCheck:E,disabled:y,ref:C}),m&&(T?(0,r.jsx)(s.Button,{leftIcon:m,title:v,disabled:y,onClick:()=>{T&&T(j)}}):(0,r.jsx)("i",{className:m,"aria-hidden":!0}))]}))]}))}},{"../util":40,"./Button":2,react:364,"react/jsx-runtime":365}],11:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.LazyImage=void 0;const r=e("react/jsx-runtime");let i;n.LazyImage=e=>{const{id:t,className:n,role:o,src:s,alt:a,title:l,ariaLabel:c,ariaHidden:u,ariaDescribedBy:d}=e;let p;return function(){if(i)return;i=new IntersectionObserver((e=>{e.forEach((e=>{if(e.intersectionRatio>0){i.unobserve(e.target);const t=e.target.getAttribute("data-src");e.target.src=t;const n=e.target;n.src=t,n.onload=()=>{n.parentElement.classList.add("loaded"),n.parentElement.classList.remove("error")},n.onerror=()=>{n.parentElement.classList.add("error"),n.parentElement.classList.remove("loaded")}}}))}),{rootMargin:"50px 0px",threshold:.01})}(),(0,r.jsxs)("div",Object.assign({className:"common-lazy-image-wrapper"},{children:[(0,r.jsx)("img",{id:t,ref:e=>{e&&(p&&i.unobserve(p),p=e,i.observe(e))},className:n,"data-src":s,alt:a,title:l,role:o,"aria-label":c,"aria-hidden":u,"aria-describedby":d}),(0,r.jsx)("div",{className:"common-spinner"}),(0,r.jsx)("i",{className:"fas fa-image","aria-hidden":!0})]}))}},{"react/jsx-runtime":365}],12:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Link=void 0;const r=e("react/jsx-runtime"),i=e("../util");n.Link=e=>{const{id:t,className:n,ariaLabel:o,href:s,target:a,children:l,tabIndex:c}=e,u=(0,i.classList)("common-link",n);return(0,r.jsx)("a",Object.assign({id:t,className:u,"aria-label":o,href:s,target:a,rel:"_blank"===a?"noopener noreferrer":"",tabIndex:null!=c?c:0},{children:l}))}},{"../util":40,"react/jsx-runtime":365}],13:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.List=void 0;const r=e("react/jsx-runtime"),i=e("react"),o=e("../util");n.List=e=>{const{id:t,className:n,ariaHidden:s,ariaLabel:a,role:l}=e;return(0,r.jsx)("div",Object.assign({id:t,"aria-hidden":s,"aria-label":a,role:l,className:(0,o.classList)("common-list",n)},{children:i.Children.map(e.children,((e,t)=>(0,r.jsx)("div",Object.assign({className:"common-list-item"},{children:e}),t)))}))}},{"../util":40,react:364,"react/jsx-runtime":365}],14:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MenuDropdown=void 0;const r=e("react/jsx-runtime"),i=e("react"),o=e("../util"),s=e("./Button"),a=e("./FocusTrap");n.MenuDropdown=e=>{const{id:t,className:n,ariaHidden:l,ariaLabel:c,role:u,items:d,label:p,title:h,icon:f,tabIndex:g}=e,[m,v]=i.useState(!1);let y,b;const x=(0,o.classList)("common-menu-dropdown",n),E=t+"-menu";return(0,r.jsxs)("div",Object.assign({className:x,ref:e=>{e&&(y=e)},onBlur:e=>{y&&m&&!y.contains(e.relatedTarget)&&v(!1)}},{children:[(0,r.jsx)(s.Button,{id:t,label:p,tabIndex:g,buttonRef:e=>{e&&(b=e)},title:h,leftIcon:f,role:u||"menuitem",className:(0,o.classList)("menu-button",m&&"expanded"),onClick:()=>{v(!m)},ariaHasPopup:"true",ariaExpanded:m,ariaControls:m?E:void 0,ariaLabel:c,ariaHidden:l}),m&&(0,r.jsx)("div",Object.assign({role:"menu",className:"common-menu-dropdown-pane",tabIndex:0,id:E,"aria-labelledby":t},{children:(0,r.jsx)(a.FocusTrap,Object.assign({arrowKeyNavigation:!0,onEscape:()=>{v(!1),b&&b.focus()}},{children:(0,r.jsx)("ul",Object.assign({role:"presentation"},{children:d.map(((e,t)=>(0,r.jsx)("li",Object.assign({role:"presentation"},{children:(0,r.jsx)(s.Button,Object.assign({},e,{className:(0,o.classList)("common-menu-dropdown-item",e.className),onClick:()=>{v(!1),e.onClick()},role:"menuitem",ariaPosInSet:t+1,ariaSetSize:d.length}))}),t)))}))}))}))]}))}},{"../util":40,"./Button":2,"./FocusTrap":9,react:364,"react/jsx-runtime":365}],15:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Modal=void 0;const r=e("react/jsx-runtime"),i=e("react-dom"),o=e("../util"),s=e("./Button"),a=e("./FocusTrap");n.Modal=e=>{const{children:t,id:n,className:l,ariaLabel:c,ariaHidden:u,ariaDescribedBy:d,role:p,title:h,leftIcon:f,helpUrl:g,actions:m,onClose:v,parentElement:y,fullscreen:b,hideDismissButton:x}=e,E=e=>{v&&v()},_=(0,o.classList)("common-modal-container",b&&"fullscreen",l);return i.createPortal((0,r.jsx)(a.FocusTrap,Object.assign({className:_,onEscape:E},{children:(0,r.jsxs)("div",Object.assign({id:n,className:"common-modal",role:p||"dialog","aria-hidden":u,"aria-label":c,"aria-describedby":d,"aria-labelledby":"modal-title"},{children:[(0,r.jsxs)("div",Object.assign({className:"common-modal-header"},{children:[b&&!x&&(0,r.jsx)("div",Object.assign({className:"common-modal-back"},{children:(0,r.jsx)(s.Button,{className:"menu-button",onClick:E,title:lf("Go Back"),label:lf("Go Back"),leftIcon:"fas fa-arrow-left"})})),(0,r.jsxs)("div",Object.assign({id:"modal-title",className:"common-modal-title"},{children:[f&&(0,r.jsx)("i",{className:f,"aria-hidden":!0}),h]})),b&&g&&(0,r.jsx)("div",Object.assign({className:"common-modal-help"},{children:(0,r.jsx)(s.Button,{className:"menu-button",title:lf("Help on {0} dialog",h),href:e.helpUrl,onClick:()=>{},rightIcon:"fas fa-question"})})),!b&&!x&&(0,r.jsx)("div",Object.assign({className:"common-modal-close"},{children:(0,r.jsx)(s.Button,{className:"menu-button inverted",onClick:E,title:lf("Close"),rightIcon:"fas fa-times-circle"})}))]})),(0,r.jsx)("div",Object.assign({className:"common-modal-body"},{children:t})),(null==m?void 0:m.length)&&(0,r.jsx)("div",Object.assign({className:"common-modal-footer"},{children:m.map(((e,t)=>{var n;return(0,r.jsx)(s.Button,{className:null!==(n=e.className)&&void 0!==n?n:"primary inverted",disabled:e.disabled,onClick:e.onClick,href:e.url,label:e.label,title:e.label,rightIcon:(e.xicon?"xicon ":"")+e.icon,leftIcon:e.leftIcon},t)}))}))]}))})),y||document.getElementById("root")||document.body)}},{"../util":40,"./Button":2,"./FocusTrap":9,"react-dom":307,"react/jsx-runtime":365}],16:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.RadioButtonGroup=void 0;const r=e("react/jsx-runtime"),i=e("../util"),o=e("./FocusList");n.RadioButtonGroup=e=>{const{id:t,className:n,ariaHidden:s,ariaLabel:a,role:l,choices:c,selectedId:u,onChoiceSelected:d}=e;return(0,r.jsx)(o.FocusList,Object.assign({id:t,className:(0,i.classList)("common-radio-group",n),ariaHidden:s,ariaLabel:a,role:l||"radiogroup",childTabStopId:u},{children:c.map((e=>(0,r.jsxs)("div",Object.assign({className:(0,i.classList)("common-radio-choice",e.className,u===e.id&&"selected"),onClick:()=>(e=>{d(e)})(e.id)},{children:[(0,r.jsx)("input",{type:"radio",id:e.id,value:e.id,name:t+"-input",checked:u===e.id,tabIndex:0,"aria-label":e.label?void 0:e.title,"aria-labelledby":e.label?e.id+"-label":void 0}),e.label&&(0,r.jsx)("span",Object.assign({id:e.id+"-label"},{children:e.label})),e.icon&&(0,r.jsx)("i",{className:e.icon,"aria-hidden":!0})]}),e.id)))}))}},{"../util":40,"./FocusList":8,"react/jsx-runtime":365}],17:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.TeachingBubble=n.Location=void 0;const r=e("react/jsx-runtime"),i=e("react-dom"),o=e("./Button"),s=e("../util"),a=e("./FocusTrap"),l=e("react");var c,u;(u=c=n.Location||(n.Location={}))[u.Above=0]="Above",u[u.Below=1]="Below",u[u.Left=2]="Left",u[u.Right=3]="Right",u[u.Center=4]="Center";n.TeachingBubble=e=>{const{id:t,className:n,ariaLabel:u,ariaHidden:d,ariaDescribedBy:p,role:h,targetContent:f,onClose:g,onNext:m,onBack:v,onFinish:y,stepNumber:b,totalSteps:x,parentElement:E,activeTarget:_}=e,w={above:!1,below:!1,left:!1,right:!1};(0,l.useEffect)((()=>(S(),window.addEventListener("resize",S),()=>{window.removeEventListener("resize",S)})),[b]);const S=()=>{const e=document.getElementById(t),n=document.querySelector(".teaching-bubble-arrow");n.style.border="none";const r=e.getBoundingClientRect(),i=document.querySelector(f.targetQuery);if(!i)return O(e,r),void C();const o=i.getBoundingClientRect(),s=T(o,i);k(s),A(s,e,r,n)},T=(e,t)=>{let n=e.top,r=e.left,i=e.width,o=e.height;if(f.location!==c.Center){const e=parseFloat(window.getComputedStyle(t).paddingTop),s=parseFloat(window.getComputedStyle(t).paddingRight),a=parseFloat(window.getComputedStyle(t).paddingBottom),l=parseFloat(window.getComputedStyle(t).paddingLeft);e<10&&(n-=10+e,o+=10-e),a<10&&(o+=10-a),l<10&&(r-=10+l,i+=10-l),s<10&&(i+=10-s)}return{top:n,bottom:n+o,left:r,right:r+i,width:i,height:o}},k=e=>{const t=document.querySelector(".teaching-bubble-cutout");t.style.top=`${e.top}px`,t.style.left=`${e.left}px`,t.style.width=`${e.width}px`,t.style.height=`${e.height}px`,_&&(t.style.pointerEvents="none")},C=()=>{const e=document.querySelector(".teaching-bubble-cutout");e.style.top="0px",e.style.left="0px",e.style.width="0px",e.style.height="0px"},A=(e,t,n,r)=>{w.above=!1,w.below=!1,w.left=!1,w.right=!1;const i="10px solid transparent",o=()=>{const t=e.top-n.height-10,o=e.left-(n.width-e.width)/2;if(w.above=!0,!u(t,o))return;const s=t+n.height,a=e.left+(e.width-10)/2;r.style.borderLeft=i,r.style.borderRight=i,r.style.borderTop="10px solid",N(r,s,a)},s=()=>{const t=e.bottom+10,o=e.left-(n.width-e.width)/2;if(w.below=!0,!u(t,o))return;const s=t-10,a=e.left+(e.width-10)/2;r.style.borderLeft=i,r.style.borderRight=i,r.style.borderBottom="10px solid",N(r,s,a)},a=()=>{const t=e.top-(n.height-e.height)/2,o=e.left-n.width-10;if(w.left=!0,!u(t,o))return;const s=t+(n.height-10)/2,a=e.left-10;r.style.borderLeft="10px solid",r.style.borderTop=i,r.style.borderBottom=i,N(r,s,a)},l=()=>{const t=e.top-(n.height-e.height)/2,o=e.right+10;if(w.right=!0,!u(t,o))return;const s=t+(n.height-10)/2,a=e.right;r.style.borderRight="10px solid",r.style.borderTop=i,r.style.borderBottom=i,N(r,s,a)},u=(r,i)=>{const[o,s]=j(e,n,r,i);return o&&s?(N(t,o,s),!0):(d(),!1)},d=()=>{w.above?w.below?w.left?w.right?O(t,n):l():a():s():o()};switch(f.location){case c.Above:o();break;case c.Below:s();break;case c.Left:a();break;case c.Right:l();break;default:(()=>{const t=(e.height-n.height)/2+e.top,r=(e.width-n.width)/2+e.left;u(t,r)})()}},j=(e,t,n,r)=>{n<10&&(n=10),r<10&&(r=10);const i=r+t.width,o=n+t.height;return i<window.innerWidth-10&&o<window.innerHeight-10?[n,r]:(i>window.innerWidth&&(r-=i-window.innerWidth+10),o>window.innerHeight&&(n-=o-window.innerHeight+10),I(e,t,n,r)?[null,null]:[n,r])},I=(e,t,n,r)=>{const i=r<e.left+e.width,o=r+t.width>e.left,s=n<e.top+e.height,a=n+t.height>e.top;return i&&o&&s&&a},O=(e,t)=>{N(e,(window.innerHeight-t.height)/2,(window.innerWidth-t.width)/2)},N=(e,t,n)=>{t<10&&(t=10),n<10&&(n=10),e.style.top=t+"px",e.style.left=n+"px"},R=b>1,P=b<x,D=x>1,M=lf("Close"),L=lf("Back"),B=lf("Next"),F=D?lf("Finish"):lf("Got it"),U=(0,s.classList)("teaching-bubble-container",n);return i.createPortal((0,r.jsxs)(a.FocusTrap,Object.assign({className:U,onEscape:g},{children:[(0,r.jsx)("div",{className:"teaching-bubble-cutout"}),(0,r.jsx)("div",{className:"teaching-bubble-arrow"}),(0,r.jsxs)("div",Object.assign({id:t,className:"teaching-bubble",role:h||"dialog","aria-hidden":d,"aria-label":u,"aria-describedby":p,"aria-labelledby":"teaching-bubble-title"},{children:[(0,r.jsx)(o.Button,{className:"teaching-bubble-close",onClick:g,title:M,ariaLabel:M,rightIcon:"fas fa-times-circle"}),(0,r.jsxs)("div",Object.assign({className:"teaching-bubble-content"},{children:[(0,r.jsx)("strong",{children:f.title}),(0,r.jsx)("p",{children:f.description}),(0,r.jsxs)("div",Object.assign({className:"teaching-bubble-footer "+(D?"":"no-steps")},{children:[D&&(0,r.jsxs)("div",Object.assign({className:"teaching-bubble-steps"},{children:[b," of ",x]})),(0,r.jsxs)("div",Object.assign({className:"teaching-bubble-navigation"},{children:[R&&(0,r.jsx)(o.Button,{className:"secondary-button",onClick:v,title:L,ariaLabel:L,label:L}),P&&(0,r.jsx)(o.Button,{className:"primary-button",onClick:m,title:B,ariaLabel:B,label:B}),!P&&(0,r.jsx)(o.Button,{className:"primary-button",onClick:y,title:F,ariaLabel:F,label:F})]}))]}))]}))]}))]})),E||document.getElementById("root")||document.body)}},{"../util":40,"./Button":2,"./FocusTrap":9,react:364,"react-dom":307,"react/jsx-runtime":365}],18:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Textarea=void 0;const r=e("react/jsx-runtime"),i=e("react"),o=e("../util");n.Textarea=e=>{const{id:t,className:n,role:s,ariaHidden:a,ariaLabel:l,initialValue:c,label:u,title:d,placeholder:p,autoComplete:h,cols:f,rows:g,disabled:m,minLength:v,readOnly:y,resize:b,wrap:x,onChange:E,onEnterKey:_}=e,[w,S]=i.useState(c||"");return i.useEffect((()=>{S(c)}),[c]),(0,r.jsxs)("div",Object.assign({className:(0,o.classList)("common-textarea-wrapper",m&&"disabled",b&&`resize-${b}`,n)},{children:[u&&(0,r.jsx)("label",Object.assign({className:"common-textarea-label"},{children:u})),(0,r.jsx)("div",Object.assign({className:"common-textarea-group"},{children:(0,r.jsx)("textarea",{id:t,className:"common-textarea",title:d,role:s||"textbox",tabIndex:m?-1:0,"aria-label":l,"aria-hidden":a,placeholder:p,value:w||"",cols:f,rows:g,minLength:v,wrap:x,readOnly:!!y,onChange:e=>{const t=e.target.value;y||w===t||S(t),E&&E(t)},onKeyDown:e=>{const t="number"==typeof e.which?e.which:e.keyCode;13!==t&&32!==t||_&&(e.preventDefault(),_(w))},autoComplete:h?"":"off",autoCorrect:h?"":"off",autoCapitalize:h?"":"off",spellCheck:h,disabled:m})}))]}))}},{"../util":40,react:364,"react/jsx-runtime":365}],19:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.DeleteConfirmationModal=void 0;const r=e("react/jsx-runtime"),i=e("../controls/Modal");n.DeleteConfirmationModal=e=>{const t=[{label:lf("Cancel"),onClick:e.onCancelClick},{label:lf("Remove"),className:"red",onClick:()=>{e.onDeleteClick(e.ns)}}];return(0,r.jsx)(i.Modal,Object.assign({title:lf("Removing extension"),actions:t,onClose:e.onCancelClick},{children:lf("Are you sure you want to remove this extension? Doing so will remove any of its blocks that you used in your code and other extensions that use it.")}))}},{"../controls/Modal":15,"react/jsx-runtime":365}],20:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ExtensionCard=void 0;const r=e("react/jsx-runtime"),i=e("../controls/Button"),o=e("../controls/Card"),s=e("../controls/LazyImage"),a=e("../util");n.ExtensionCard=e=>{const{title:t,description:n,imageUrl:l,learnMoreUrl:c,label:u,onClick:d,extension:p,loading:h,showDisclaimer:f}=e,g=pxt.Util.guidGen();return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(o.Card,Object.assign({className:(0,a.classList)("common-extension-card",h&&"loading"),onClick:()=>{d&&d(p)},ariaLabelledBy:g+"-title",ariaDescribedBy:g+"-description",tabIndex:d&&0,label:u},{children:[(0,r.jsx)("div",Object.assign({className:"common-extension-card-contents"},{children:!h&&(0,r.jsxs)(r.Fragment,{children:[l&&(0,r.jsx)(s.LazyImage,{src:l,alt:t}),(0,r.jsx)("div",Object.assign({className:"common-extension-card-title",id:g+"-title"},{children:t})),(0,r.jsx)("div",Object.assign({className:"common-extension-card-description"},{children:(0,r.jsx)("div",Object.assign({id:g+"-description"},{children:n}))})),(f||c)&&(0,r.jsxs)("div",Object.assign({className:"common-extension-card-extra-content"},{children:[f&&lf("User-provided extension, not endorsed by Microsoft."),c&&(0,r.jsx)(i.Button,{className:"link-button",label:lf("Learn More"),title:lf("Learn More"),onClick:()=>{},href:c})]}))]})})),(0,r.jsx)("div",{className:"common-spinner"})]}))})}},{"../controls/Button":2,"../controls/Card":3,"../controls/LazyImage":11,"../util":40,"react/jsx-runtime":365}],21:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ImportModal=void 0;const r=e("react/jsx-runtime"),i=e("../controls/Modal");n.ImportModal=e=>{const t=[{label:lf("Cancel"),onClick:e.onCancelClick},{label:lf("Import"),onClick:()=>{e.onImportClick(document.getElementById("url-input").value)}}];return(0,r.jsxs)(i.Modal,Object.assign({title:lf("Import extension"),actions:t,className:"import-extension-modal"},{children:[lf("Enter Github project URL"),(0,r.jsx)("input",{id:"url-input"})]}))}},{"../controls/Modal":15,"react/jsx-runtime":365}],22:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.ColorPickerField=void 0;const r=e("react/jsx-runtime"),i=e("react"),o=e("../controls/Button"),s=e("../controls/Input");n.ColorPickerField=e=>{const{index:t,color:n,onColorChanged:a,onMoveColor:l}=e,[c,u]=i.useState(void 0);return(0,r.jsxs)("div",Object.assign({className:"common-color-picker-field"},{children:[(0,r.jsx)("div",Object.assign({className:"common-color-index"},{children:t})),(0,r.jsxs)("div",Object.assign({className:"common-color-inputs"},{children:[(0,r.jsx)("input",{className:"color-input",type:"color",value:c||n,onBlur:()=>{c&&a(c),u(void 0)},onChange:e=>{u(e.target.value.toUpperCase())}}),(0,r.jsx)(s.Input,{initialValue:c||n.toUpperCase(),onChange:e=>{"#"!=(null==(e=e.trim())?void 0:e[0])&&(e="#"+e),e.length>7&&(e=e.substring(0,7)),/#[0-9a-fA-F]{6}/.test(e)&&a(e.toUpperCase())}})]})),(0,r.jsx)(o.Button,{className:"circle-button",title:lf("Move color up"),leftIcon:"fas fa-arrow-up",onClick:()=>l(!0),disabled:1===t}),(0,r.jsx)(o.Button,{className:"circle-button",title:lf("Move color down"),leftIcon:"fas fa-arrow-down",onClick:()=>l(!1),disabled:15===t})]}))}},{"../controls/Button":2,"../controls/Input":10,react:364,"react/jsx-runtime":365}],23:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.PaletteEditor=void 0;const r=e("react/jsx-runtime"),i=e("react"),o=e("./ColorPickerField");n.PaletteEditor=e=>{const{palette:t,onPaletteChanged:n}=e,[s,a]=(0,i.useState)(t);return(0,i.useEffect)((()=>{n(s)}),[s]),(0,i.useEffect)((()=>{a(t)}),[t]),(0,r.jsx)("div",Object.assign({className:"common-palette-editor"},{children:s.colors.slice(1).map(((e,t)=>(0,r.jsx)(o.ColorPickerField,{index:t+1,color:e,onColorChanged:e=>((e,t)=>{const n=s;a(Object.assign(Object.assign({},n),{colors:n.colors.map(((n,r)=>e===r?t:n))}))})(t+1,e),onMoveColor:e=>((e,t)=>{const n=s,r=Object.assign(Object.assign({},n),{colors:n.colors.slice()});t?e>1&&(r.colors[e-1]=n.colors[e],r.colors[e]=n.colors[e-1]):e<r.colors.length-1&&(r.colors[e+1]=n.colors[e],r.colors[e]=n.colors[e+1]),a(r)})(t+1,e)},t+1)))}))}},{"./ColorPickerField":22,react:364,"react/jsx-runtime":365}],24:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.PalettePicker=void 0;const r=e("react/jsx-runtime"),i=e("../controls/Dropdown"),o=e("./PaletteSwatch");n.PalettePicker=e=>{const{palettes:t,selectedId:n,onPaletteSelected:s}=e;return(0,r.jsx)(i.Dropdown,{id:"common-palette-picker",selectedId:n,onItemSelected:e=>{s(t.find((t=>t.id===e)))},items:t.map((e=>({id:e.id,title:e.name,label:(0,r.jsx)(o.PaletteSwatch,{palette:e})})))})}},{"../controls/Dropdown":6,"./PaletteSwatch":25,"react/jsx-runtime":365}],25:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.PaletteSwatch=void 0;const r=e("react/jsx-runtime");n.PaletteSwatch=e=>{const{palette:t}=e;return(0,r.jsxs)("div",Object.assign({className:"common-palette-swatch"},{children:[(0,r.jsx)("div",Object.assign({className:"common-palette-swatch-name"},{children:t.name})),(0,r.jsx)("div",Object.assign({className:"common-palette-color-list"},{children:t.colors.slice(1).map(((e,t)=>(0,r.jsx)(i,{color:e},t)))}))]}))};const i=e=>(0,r.jsx)("div",{className:"common-palette-color",style:{backgroundColor:e.color}})},{"react/jsx-runtime":365}],26:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.AllPalettes=n.Arcade=n.Adventure=n.Sweet=n.SteamPunk=n.StillLife=n.DIY=n.Poke=n.Grayscale=n.Matte=n.Pastel=n.Adafruit=void 0,n.Adafruit={id:"Adafruit",name:lf("Adafruit"),colors:["#000000","#FFFFFF","#FF0000","#FF007D","#FF7a00","#e5FF00","#2D9F00","#00FF72","#0034FF","#17ABFF","#C600FF","#636363","#7400DB","#00EFFF","#DF2929","#000000"]},n.Pastel={id:"Pastel",name:lf("Pastel"),colors:["#000000","#fff7e4","#f98284","#feaae4","#ffc384","#fff7a0","#87a889","#b0eb93","#b0a9e4","#accce4","#b3e3da","#d9c8bf","#6c5671","#ffe6c6","#dea38b","#28282e"]},n.Matte={id:"Matte",name:lf("Matte"),colors:["#000000","#FFF1E8","#FF004D","#FF77A8","#FFA300","#FFEC27","#008751","#00E436","#29ADFF","#C2C3C7","#7E2553","#83769C","#5F574F","#FFCCAA","#AB5236","#1D2B53"]},n.Grayscale={id:"Grayscale",name:lf("Grayscale"),colors:["#000000","#FFFFFF","#EDEDED","#DBDBDB","#C8C8C8","#B6B6B6","#A4A4A4","#929292","#808080","#6D6D6D","#5B5B5B","#494949","#373737","#242424","#121212","#000000"]},n.Poke={id:"Poke",name:lf("Poke"),colors:["#000000","#ffffff","#d45362","#e8958b","#cc8945","#f5dc8c","#417d53","#5dd48f","#5162c2","#6cadeb","#b56edd","#8f3f29","#612431","#c0fac2","#24325e","#1b1221"]},n.DIY={id:"DIY",name:lf("DIY"),colors:["#000000","#f8f8f8","#f80000","#FF93C4","#f8a830","#f8f858","#089050","#70d038","#2868c0","#10c0c8","#c868e8","#c0c0c0","#787878","#f8d898","#c04800","#000000"]},n.StillLife={id:"StillLife",name:lf("Still Life"),colors:["#000000","#a8e4d4","#d13b27","#e07f8a","#cc8218","#b3e868","#5d853a","#68c127","#286fb8","#9b8bff","#3f2811","#513155","#122615","#c7b581","#7a2222","#000000"]},n.SteamPunk={id:"SteamPunk",name:lf("Steam Punk"),colors:["#000000","#c0d1cc","#603b3a","#170e19","#775c4f","#77744f","#4f7754","#a19f7c","#4f5277","#65738c","#3a604a","#213b25","#433a60","#7c94a1","#3b2137","#2f213b"]},n.Sweet={id:"Sweet",name:lf("Sweet"),colors:["#000000","#f4f4f4","#b13e53","#a7f070","#ef7d57","#ffcd75","#257179","#38b764","#29366f","#3b5dc9","#41a6f6","#566c86","#333c57","#94b0c2","#5d275d","#1a1c2c"]},n.Adventure={id:"Adventure",name:lf("Adventure"),colors:["#000000","#f5edba","#9d303b","#d26471","#e4943a","#c0c741","#647d34","#34859d","#17434b","#7ec4c1","#584563","#8c8fae","#3e2137","#d79b7d","#9a6348","#1f0e1c"]},n.Arcade={id:"Arcade",name:lf("Arcade"),colors:["#000000","#FFFFFF","#FF2121","#FF93C4","#FF8135","#FFF609","#249CA3","#78DC52","#003FAD","#87F2FF","#8E2EC4","#A4839F","#5C406c","#E5CDC4","#91463d","#000000"]},n.AllPalettes=[n.Arcade,n.Matte,n.Pastel,n.Sweet,n.Poke,n.Adventure,n.DIY,n.Adafruit,n.StillLife,n.SteamPunk,n.Grayscale]},{}],27:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Badge=void 0;const r=e("react/jsx-runtime"),i=e("../util");n.Badge=e=>{const{badge:t,disabled:n,isNew:o,onClick:s}=e,a=s&&(()=>{s(t)}),l=n&&t.lockedImage||t.image,c=n?pxt.U.lf("Locked '{0}' badge",t.title):t.title;return(0,r.jsxs)("div",Object.assign({className:"profile-badge "+(s?"clickable":""),role:s?"button":void 0,tabIndex:s?0:void 0,title:lf("{0} Badge",t.title),onClick:a,onKeyDown:i.fireClickOnEnter},{children:[o&&(0,r.jsx)("div",Object.assign({className:"profile-badge-notification"},{children:pxt.U.lf("New!")})),(0,r.jsx)("img",{src:l,alt:c})]}))}},{"../util":40,"react/jsx-runtime":365}],28:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.badgeDescription=n.BadgeInfo=void 0;const r=e("react/jsx-runtime"),i=e("../util"),o=e("./Badge");n.BadgeInfo=e=>{const{badge:t}=e,i=new Date(t.timestamp);return(0,r.jsxs)("div",Object.assign({className:"profile-badge-info"},{children:[(0,r.jsx)("div",Object.assign({className:"profile-badge-info-image"},{children:(0,r.jsx)(o.Badge,{badge:t,disabled:!t.timestamp})})),(0,r.jsxs)("div",Object.assign({className:"profile-badge-info-item",id:"profile-badge-info-"+t.id},{children:[(0,r.jsx)("div",Object.assign({className:"profile-badge-info-header"},{children:lf("Awarded For:")})),(0,r.jsx)("div",Object.assign({className:"profile-badge-info-text"},{children:(0,n.badgeDescription)(t)}))]})),t.timestamp?(0,r.jsxs)("div",Object.assign({className:"profile-badge-info-item"},{children:[(0,r.jsx)("div",Object.assign({className:"profile-badge-info-header"},{children:lf("Awarded On:")})),(0,r.jsx)("div",Object.assign({className:"profile-badge-info-text"},{children:i.toLocaleDateString(pxt.U.userLanguage())}))]})):void 0]}))};function s(e){var t;if(-1!==e.indexOf("/api/md/")){const n=e.split("/api/md/")[1].split("/").slice(1).join("/");return(null===(t=pxt.webConfig)||void 0===t?void 0:t.skillmapUrl)+"#docs:"+n}{const t=e.split("#");if(2==t.length)return pxt.webConfig.skillmapUrl+"#github:https://github.com/"+t[0]+"/"+t[1]}return pxt.BrowserUtils.isLocalHostDev()?"http://localhost:3000#local:"+e:e}n.badgeDescription=e=>{switch(e.type){case"skillmap-completion":return(0,r.jsx)("span",{children:(0,i.jsxLF)(lf("Completing {0}"),(0,r.jsx)("a",Object.assign({tabIndex:0,"aria-labelledby":"profile-badge-info-"+e.id,target:"_blank",rel:"noopener noreferrer",href:s(e.sourceURL)},{children:pxt.U.rlf(e.title)})))})}}},{"../util":40,"./Badge":27,"react/jsx-runtime":365}],29:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.BadgeList=void 0;const r=e("react/jsx-runtime"),i=e("./Badge");n.BadgeList=e=>{const{onBadgeClick:t,availableBadges:n,userState:o}=e,s=n.slice();let a={};for(const e of o.badges){a[e.id]=!0;const t=s.findIndex((t=>t.id===e.id));t>-1?s[t]=Object.assign(Object.assign({},s[t]),{timestamp:s[t].timestamp||e.timestamp}):s.push(e)}const l=[];for(let e=0;e<Math.max(s.length+10,20);e++)l.push((0,r.jsx)("div",{className:"placeholder-badge"},e));return(0,r.jsxs)("div",Object.assign({className:"profile-badge-list"},{children:[(0,r.jsxs)("div",Object.assign({className:"profile-badge-header",id:"profile-badge-header"},{children:[(0,r.jsx)("span",Object.assign({className:"profile-badge-title"},{children:lf("Badges")})),(0,r.jsx)("span",Object.assign({className:"profile-badge-subtitle"},{children:lf("Click each badge to see details")}))]})),(0,r.jsx)("div",Object.assign({className:"profile-badges-scroller"},{children:(0,r.jsxs)("div",Object.assign({className:"profile-badges",role:"list","aria-labelledby":"profile-badge-header"},{children:[(0,r.jsx)("div",Object.assign({className:"profile-badges-background-container","aria-hidden":"true"},{children:(0,r.jsx)("div",Object.assign({className:"profile-badges-background"},{children:l}))})),s.map((e=>(0,r.jsxs)("div",Object.assign({className:"profile-badge-and-title",role:"listitem"},{children:[(0,r.jsx)(i.Badge,{onClick:t,badge:e,disabled:!a[e.id]}),(0,r.jsx)("div",Object.assign({className:"profile-badge-name"},{children:e.title}))]}),e.id)))]}))}))]}))}},{"./Badge":27,"react/jsx-runtime":365}],30:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.Profile=void 0;const r=e("react/jsx-runtime"),i=e("./BadgeList"),o=e("./UserPane"),s=e("./BadgeInfo");n.Profile=e=>{var t,n,a;const{user:l,signOut:c,deleteProfile:u,onClickedEmail:d,notification:p,checkedEmail:h,showModalAsync:f}=e,g=(null==l?void 0:l.profile)||{idp:{}},m=(null===(t=null==l?void 0:l.preferences)||void 0===t?void 0:t.badges)||{badges:[]},v=(null===(a=null===(n=pxt.appTarget)||void 0===n?void 0:n.cloud)||void 0===a?void 0:a.showBadges)||!1;return(0,r.jsxs)("div",Object.assign({className:"user-profile"},{children:[(0,r.jsx)(o.UserPane,{profile:g,onSignOutClick:c,onDeleteProfileClick:u,notification:p,emailChecked:h,onEmailCheckClick:d}),v&&(0,r.jsx)(i.BadgeList,{availableBadges:pxt.appTarget.defaultBadges||[],userState:m,onBadgeClick:e=>{f({header:lf("{0} Badge",e.title),size:"tiny",hasCloseIcon:!0,onClose:()=>{const e=document.body.querySelector(".common-modal-container.fullscreen [tabindex]");e&&e.focus()},jsx:(0,r.jsx)(s.BadgeInfo,{badge:e})})}})]}))}},{"./BadgeInfo":28,"./BadgeList":29,"./UserPane":33,"react/jsx-runtime":365}],31:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.SignInModal=void 0;const r=e("react/jsx-runtime"),i=e("react"),o=e("../controls/Checkbox"),s=e("../controls/Button"),a=e("../controls/Link"),l=e("../controls/Modal");n.SignInModal=e=>{var t,n;const{onSignIn:c,onClose:u,appMessage:d,dialogMessages:p,hideDismissButton:h}=e,{signInMessage:f,signUpMessage:g}=p||{signInMessage:lf("Sign in to save your progress and access your work anytime, anywhere."),signUpMessage:lf("Join now to save your progress and access your work anytime, anywhere.")},m=null!==(t=e.resolvePath)&&void 0!==t?t:e=>e,[v,y]=i.useState(!1),[b,x]=i.useState(null!==(n=e.mode)&&void 0!==n?n:"signin"),E=i.useMemo((()=>"signin"===b?lf("Sign in"):lf("Sign up")),[b]),_=i.useMemo((()=>"signin"===b?f:g),[b,f,g]),w=i.useMemo((()=>"signin"===b?(0,r.jsxs)("div",Object.assign({className:"switch"},{children:[(0,r.jsx)("span",{children:lf("Don't have an account?")}),(0,r.jsx)(s.Button,{className:"link-button",onClick:()=>x("signup"),title:lf("Sign up"),label:lf("Sign up")})]})):(0,r.jsxs)("div",Object.assign({className:"switch"},{children:[(0,r.jsx)("span",{children:lf("Have an account?")}),(0,r.jsx)(s.Button,{className:"link-button",onClick:()=>x("signin"),title:lf("Sign in"),label:lf("Sign in")})]}))),[b]);return(0,r.jsx)(l.Modal,Object.assign({title:E,onClose:u,hideDismissButton:h},{children:(0,r.jsxs)("div",Object.assign({className:"signin-form"},{children:[(0,r.jsxs)("div",Object.assign({className:"signin-header"},{children:[d||void 0," ",_]})),(0,r.jsx)("div",Object.assign({className:"signin-body"},{children:(0,r.jsxs)("div",Object.assign({className:"providers"},{children:[pxt.auth.identityProviders().map(((e,t)=>{const n="signin"===b?lf("Continue with {0}",e.name):lf("Sign up with {0}",e.name);return(0,r.jsx)(s.Button,{className:"teal inverted provider",onClick:()=>c(e,v),title:n,ariaLabel:n,label:(0,r.jsxs)("div",Object.assign({className:"label"},{children:[(0,r.jsx)("div",{children:(0,r.jsx)("img",{className:"logo",src:m(e.icon)})}),(0,r.jsx)("div",Object.assign({className:"title"},{children:n}))]}))},t)})),(0,r.jsx)("div",Object.assign({className:"rememberme"},{children:(0,r.jsx)(o.Checkbox,{id:"rememberme",label:lf("Remember me"),isChecked:v,onChange:y})}))]}))})),(0,r.jsxs)("div",Object.assign({className:"signin-footer"},{children:[w,(0,r.jsx)("div",Object.assign({className:"learn"},{children:(0,r.jsx)(a.Link,Object.assign({href:"/identity/sign-in",target:"_blank"},{children:lf("Learn more")}))}))]}))]}))}))}},{"../controls/Button":2,"../controls/Checkbox":4,"../controls/Link":12,"../controls/Modal":15,react:364,"react/jsx-runtime":365}],32:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.UserNotification=void 0;const r=e("react/jsx-runtime");n.UserNotification=e=>{const{message:t,icon:n,actionText:i,link:o,xicon:s,title:a}=e.notification;return(0,r.jsxs)("div",Object.assign({className:"profile-notification"},{children:[(0,r.jsx)("div",Object.assign({className:"profile-notification-icon"},{children:(0,r.jsx)("i",{className:`${s?"xicon":"ui large circular icon "} ${n}`})})),(0,r.jsx)("div",Object.assign({className:"profile-notification-title"},{children:a})),(0,r.jsx)("div",Object.assign({className:"profile-notification-message"},{children:t})),(0,r.jsxs)("button",Object.assign({className:"ui icon button profile-notification-button",onClick:()=>{window.open(o,"_blank")},role:"link"},{children:[(0,r.jsx)("i",{className:"icon external alternate"}),i]}))]}))}},{"react/jsx-runtime":365}],33:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.UserPane=void 0;const r=e("react/jsx-runtime"),i=e("../util"),o=e("./UserNotification"),s=e("../controls/Checkbox"),a=e("../controls/Button");n.UserPane=e=>{const{profile:t,onSignOutClick:n,onDeleteProfileClick:l,onEmailCheckClick:c,notification:u,emailChecked:d}=e,{username:p,displayName:h,picture:f,pictureUrl:g}=t.idp,m=null!=g?g:null==f?void 0:f.dataUrl,v=(0,r.jsxs)(r.Fragment,{children:[d===i.CheckboxStatus.Waiting?(0,r.jsx)("div",{className:"common-spinner"}):void 0,lf("I would like to receive the MakeCode newsletter. "),(0,r.jsx)("a",Object.assign({href:"https://makecode.com/privacy",target:"_blank",rel:"noopener noreferrer",tabIndex:0},{children:lf("View Privacy Statement")}))]});return(0,r.jsxs)("div",Object.assign({className:"profile-user-pane"},{children:[(0,r.jsx)("div",Object.assign({className:"profile-portrait"},{children:m?(0,r.jsx)("div",{children:(0,r.jsx)("img",{src:m,alt:pxt.U.lf("Profile Picture"),referrerPolicy:"no-referrer"})}):(0,r.jsx)("div",Object.assign({className:"profile-initials-portrait"},{children:pxt.auth.userInitials(t)}))})),(0,r.jsxs)("div",Object.assign({className:"profile-user-details"},{children:[(0,r.jsx)("div",Object.assign({className:"profile-display-name"},{children:h})),p&&(0,r.jsx)("div",Object.assign({className:"profile-username"},{children:p}))]})),u&&(0,r.jsx)(o.UserNotification,{notification:u}),(0,r.jsx)("div",{className:"profile-spacer"}),(0,r.jsx)("div",Object.assign({className:"profile-email"},{children:(0,r.jsx)(s.Checkbox,{id:"profile-email-checkbox",className:d===i.CheckboxStatus.Waiting?"loading":"",isChecked:d===i.CheckboxStatus.Selected,onChange:c,label:v})})),(0,r.jsxs)("div",Object.assign({className:"profile-actions"},{children:[(0,r.jsx)(a.Button,{className:"link-button",title:lf("Delete Profile"),label:lf("Delete Profile"),onClick:l}),(0,r.jsx)(a.Button,{className:"sign-out",leftIcon:"fas fa-sign-out-alt",title:lf("Sign Out"),label:lf("Sign Out"),onClick:n})]}))]}))}},{"../controls/Button":2,"../controls/Checkbox":4,"../util":40,"./UserNotification":32,"react/jsx-runtime":365}],34:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.addGameToKioskAsync=void 0;n.addGameToKioskAsync=async(e,t)=>{const n=await fetch("https://makecode.com/api/kiosk/updatecode",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({kioskCode:e,shareId:t})});if(!n.ok)throw new Error(n.statusText)}},{}],35:[function(e,t,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.MultiplayerConfirmation=void 0;const r=e("react/jsx-runtime"),i=e("../controls/Modal");n.MultiplayerConfirmation=e=>{const{