@pie-element/passage 6.2.0-next.6 → 6.2.0-next.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [6.2.0-next.8](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@6.2.0-next.7...@pie-element/passage@6.2.0-next.8) (2026-04-17)
7
+
8
+ ### Bug Fixes
9
+
10
+ - bump libs PIE-129 ([cee3e10](https://github.com/pie-framework/pie-elements/commit/cee3e109a9c1d9a68ab592781c968f6b27209846))
11
+
12
+ # [6.2.0-next.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@6.2.0-next.6...@pie-element/passage@6.2.0-next.7) (2026-04-16)
13
+
14
+ ### Bug Fixes
15
+
16
+ - bump libs PIE-46, PIE-25, PIE-54, PIE-44, PIE-29, PIE-13, PIE-129 ([5c17838](https://github.com/pie-framework/pie-elements/commit/5c17838a53483437e42dc679a4361e16b7ef5e31))
17
+
6
18
  # [6.2.0-next.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage@6.2.0-next.5...@pie-element/passage@6.2.0-next.6) (2026-04-13)
7
19
 
8
20
  ### Bug Fixes
@@ -3,6 +3,18 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [4.2.0-next.7](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@4.2.0-next.6...@pie-element/passage-configure@4.2.0-next.7) (2026-04-17)
7
+
8
+ ### Bug Fixes
9
+
10
+ - bump libs PIE-129 ([cee3e10](https://github.com/pie-framework/pie-elements/commit/cee3e109a9c1d9a68ab592781c968f6b27209846))
11
+
12
+ # [4.2.0-next.6](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@4.2.0-next.5...@pie-element/passage-configure@4.2.0-next.6) (2026-04-16)
13
+
14
+ ### Bug Fixes
15
+
16
+ - bump libs PIE-46, PIE-25, PIE-54, PIE-44, PIE-29, PIE-13, PIE-129 ([5c17838](https://github.com/pie-framework/pie-elements/commit/5c17838a53483437e42dc679a4361e16b7ef5e31))
17
+
6
18
  # [4.2.0-next.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/passage-configure@4.2.0-next.4...@pie-element/passage-configure@4.2.0-next.5) (2026-04-13)
7
19
 
8
20
  ### Bug Fixes
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/passage-configure",
3
3
  "private": true,
4
- "version": "4.2.0-next.5",
4
+ "version": "4.2.0-next.7",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
@@ -13,8 +13,8 @@
13
13
  "@mui/icons-material": "^7.3.4",
14
14
  "@mui/material": "^7.3.4",
15
15
  "@pie-framework/pie-configure-events": "^1.3.0",
16
- "@pie-lib/config-ui": "12.2.0-next.29",
17
- "@pie-lib/editable-html-tip-tap": "1.2.0-next.28",
16
+ "@pie-lib/config-ui": "12.2.0-next.36",
17
+ "@pie-lib/editable-html-tip-tap": "1.2.0-next.35",
18
18
  "lodash-es": "^4.17.23",
19
19
  "prop-types": "^15.8.1",
20
20
  "react": "18.3.1",
package/module/element.js CHANGED
@@ -1 +1 @@
1
- import{_dll_pie_lib__math_rendering as e}from"../../../@pie-lib/math-rendering-module@^4.1.0/module/index.js";import{_dll_react_dom as t,_dll_react as s,_dll_prop_types as n,_dll_mui__material as i,_dll_mui__material_styles as r,_dll_pie_lib__render_ui as a}from"../../../@pie-lib/shared-module@^4.1.0/module/index.js";var o={};Object.defineProperty(o,"__esModule",{value:!0});class l extends CustomEvent{constructor(e,t,s){super(l.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:s}}),this.component=e,this.complete=t}}l.TYPE="model-set";var c=o.ModelSetEvent=l;class d extends CustomEvent{constructor(e,t){super(d.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}d.TYPE="session-changed",o.SessionChangedEvent=d;var h,u=t;h=u.createRoot,u.hydrateRoot;const m=s,p=n,{Tabs:b}=i,{Tab:_}=i,{styled:g}=r,{Collapsible:v}=a,{color:E}=a,{PreviewPrompt:x}=a,{Purpose:T}=a,{UiLayout:f}=a;const y=g("div")({flexGrow:1,backgroundColor:E.background(),color:E.text(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"}}),M=g("div")(({theme:e})=>({backgroundColor:E.background(),color:E.text(),padding:e.spacing(2),"& blockquote":{background:"#f9f9f9",borderLeft:"5px solid #ccc",margin:"1.5em 10px",padding:".5em 10px"}})),C=g("div")({fontSize:"1.75rem"}),k=g("div")({fontSize:"1.5rem"}),O=g("div")({fontSize:"1.25rem"}),R=g(_)(({theme:e})=>({background:e.palette.common.white,fontSize:"inherit",fontFamily:"Roboto, sans-serif",opacity:.7,color:e.palette.common.black,"&.Mui-selected":{opacity:1,color:e.palette.common.black}}));class S extends m.Component{constructor(...e){super(...e),S.prototype.__init.call(this),S.prototype.__init2.call(this),S.prototype.__init3.call(this),S.prototype.__init4.call(this)}__init(){this.state={activeTab:0}}__init2(){this.handleChange=(e,t)=>{this.setState(()=>({activeTab:t})),setTimeout(()=>{const e=new CustomEvent("pie-ui-passage-tabChanged",{detail:{tab:t}});window.dispatchEvent(e)})}}__init3(){this.handleKeyDown=(e,t)=>{const{key:s}=e,{tabs:n}=this.props;let i=-1;const r=n.findIndex(e=>e.id===t);switch(s){case"ArrowRight":i=(r+1)%n.length;break;case"ArrowLeft":i=(r-1+n.length)%n.length;break;case"Home":i=0;break;case"End":i=n.length-1;break;case"Enter":case" ":i=r}-1!==i&&(e.preventDefault(),e.stopPropagation(),this.handleChange(e,n[i].id),document.getElementById(`button-${n[i].id}`).focus())}}__init4(){this.parsedText=(e="")=>{const t=document.createElement("div");t.innerHTML=e.replace(/(<br\/>\n)/g,"<br/>");const s=t.querySelector("audio");if(s){const e=document.createElement("source");e.setAttribute("type","audio/mp3"),e.setAttribute("src",s.getAttribute("src")),s.removeAttribute("src"),s.appendChild(e)}return t.innerHTML}}renderInstructions(e,t=!1){if(!e)return;const s=m.createElement(x,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:e});return t?s:m.createElement(v,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},s)}renderTab(e,t){return m.createElement(M,{key:e.id,id:`tabpanel-${e.id}`,role:"tabpanel","aria-labelledby":`button-${e.id}`},this.renderInstructions(e.teacherInstructions,t),(e.title||e.subtitle)&&m.createElement("h2",null,e.title&&m.createElement(T,{purpose:"passage-title"},m.createElement(C,{dangerouslySetInnerHTML:{__html:this.parsedText(e.title)}})),e.subtitle&&m.createElement(T,{purpose:"passage-subtitle"},m.createElement(k,{dangerouslySetInnerHTML:{__html:this.parsedText(e.subtitle)}}))),e.author&&m.createElement(T,{purpose:"passage-author"},m.createElement(O,{className:"author",dangerouslySetInnerHTML:{__html:this.parsedText(e.author)}})),e.text&&m.createElement(T,{purpose:"passage-text"},m.createElement("div",{key:e.id,className:"text",dangerouslySetInnerHTML:{__html:this.parsedText(e.text)}})))}render(){const{model:e,tabs:t,disabledTabs:s}=this.props,{activeTab:n}=this.state;if(!function(e){let t,s=e[0],n=1;for(;n<e.length;){const i=e[n],r=e[n+1];if(n+=2,("optionalAccess"===i||"optionalCall"===i)&&null==s)return;"access"===i||"optionalAccess"===i?(t=s,s=r(s)):"call"!==i&&"optionalCall"!==i||(s=r((...e)=>s.call(t,...e)),t=void 0)}return s}([t,"optionalAccess",e=>e.length]))return;const{extraCSSRules:i}=e||{},r=(t||[]).find(e=>e.id===n);return m.createElement(f,{extraCSSRules:i},m.createElement(y,{className:"passages"},s||1===t.length?t.map(e=>this.renderTab(e,s)):m.createElement(m.Fragment,null,m.createElement(b,{sx:{position:"sticky",top:0,background:E.background(),color:E.text(),fontFamily:"Roboto, sans-serif","& .MuiTabs-indicator":{backgroundColor:"#f50057"}},value:n,onChange:this.handleChange},t.map(e=>m.createElement(R,{key:e.id,id:`button-${e.id}`,label:m.createElement(T,{purpose:"passage-label"},m.createElement("span",{dangerouslySetInnerHTML:{__html:this.parsedText(e.label)}})),value:e.id,tabIndex:n===e.id?0:-1,"aria-controls":`tabpanel-${e.id}`,"aria-selected":n===e.id,onKeyDown:t=>this.handleKeyDown(t,e.id)}))),r?this.renderTab(r,s):null)))}}S.propTypes={tabs:p.arrayOf(p.shape({id:p.number.isRequired,label:p.string.isRequired,title:p.string.isRequired,subtitle:p.string,author:p.string,text:p.string.isRequired,teacherInstructions:p.string}).isRequired).isRequired,disabledTabs:p.bool,model:p.object};const{renderMath:w}=e,A=s;class L extends HTMLElement{constructor(){super(),L.prototype.__init.call(this),this._model={passages:[]},this._session=null,this._root=null,this._mathObserver=null,this._mathRenderPending=!1}setLangAttribute(){const e=this._model&&(this._model.language,1)?this._model.language:"",t=e?e.slice(0,2):"en";this.setAttribute("lang",t)}__init(){this._scheduleMathRender=()=>{this._mathRenderPending||(this._mathRenderPending=!0,requestAnimationFrame(()=>{this._mathObserver&&this._mathObserver.disconnect(),w(this),this._mathRenderPending=!1,setTimeout(()=>{this._mathObserver&&this._mathObserver.observe(this,{childList:!0,subtree:!0})},50)}))}}_initMathObserver(){this._mathObserver||(this._mathObserver=new MutationObserver(this._scheduleMathRender),this._mathObserver.observe(this,{childList:!0,subtree:!0}))}_disconnectMathObserver(){this._mathObserver&&(this._mathObserver.disconnect(),this._mathObserver=null)}set model(e){this._model=e,this.dispatchEvent(new c(this.tagName.toLowerCase(),this._session,!!this._model)),this.setLangAttribute(),this._render()}set session(e){this._session=e}connectedCallback(){this.setAttribute("aria-label","Passage"),this.setAttribute("role","region"),this._initMathObserver(),this._render()}_render(){const{passages:e=[]}=this._model;if(this._model.passages.length>0){const t=e.map((e,t)=>({id:t,...e})),s=A.createElement(S,{tabs:t});this._root||(this._root=h(this)),this._root.render(s),this._initMathObserver()}}disconnectedCallback(){this._disconnectMathObserver(),this._root&&this._root.unmount()}}export{L as default};
1
+ import{_dll_pie_lib__math_rendering as e}from"../../../@pie-lib/math-rendering-module@^4.1.0/module/index.js";import{_dll_react_dom as t,_dll_prop_types as n,_dll_react as i,_dll_mui__material_styles as r,_dll_mui__material as s,_dll_debug as o,_dll_mui__material_collapse as a}from"../../../@pie-lib/shared-module@^4.1.0/module/index.js";import{green as l,orange as c,red as d,indigo as p,pink as u}from"@mui/material/colors";var h={};Object.defineProperty(h,"__esModule",{value:!0});class m extends CustomEvent{constructor(e,t,n){super(m.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:n}}),this.component=e,this.complete=t}}m.TYPE="model-set";var f=h.ModelSetEvent=m;class E extends CustomEvent{constructor(e,t){super(E.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}E.TYPE="session-changed",h.SessionChangedEvent=E;var g,b=t;g=b.createRoot,b.hydrateRoot;const y=i,v=n,x=e=>"string"==typeof e?e:"number"==typeof e?`${e}px`:"30px",C=({size:e,children:t})=>{const n={height:e=x(e),width:e,display:"inline-block",position:"relative"};return y.createElement("div",{style:n},t)};C.propTypes={size:v.number,children:v.oneOfType([v.arrayOf(v.node),v.node]).isRequired};const _=i,k=n,R=({size:e,children:t,sx:n})=>_.createElement(C,{size:e},_.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40",...n}},t));R.propTypes={size:k.oneOfType([k.string,k.number]),children:k.oneOfType([k.arrayOf(k.node),k.node]).isRequired,sx:k.object},k.string.isRequired;const T=({fill:e})=>_.createElement("polygon",{transform:"translate(2, 0)",points:"34.1,28.6 34.1,2.2 2,2.2 2,34.3 40.1,34.3",fill:e});T.propTypes={fill:k.string.isRequired};const O=({fill:e})=>_.createElement("path",{transform:"translate(1, 0)",d:"M31.2,29.1v-0.3c2.2-2.8,3.6-6.3,3.6-10.1c0-8.9-7.2-16.1-16.1-16.1c-8.8,0.1-16,7.3-16,16.2 s7.2,16.1,16.1,16.1h18.5L31.2,29.1z",fill:e});O.propTypes={fill:k.string.isRequired};const S=({fill:e})=>_.createElement("circle",{transform:"translate(-3,0)",cx:"23",cy:"20.4",r:"16",fill:e});S.propTypes={fill:k.string.isRequired};const A=({fill:e})=>_.createElement("rect",{x:"3.6",y:"4.1",width:"32",height:"32",fill:e});A.propTypes={fill:k.string.isRequired};const N=n,M=i;var D=(e,t)=>{class n extends M.Component{static __initStatic(){this.propTypes={iconSet:N.oneOf(["emoji","check"]),shape:N.oneOf(["round","square"]),category:N.oneOf(["feedback",void 0]),open:N.bool,size:N.oneOfType([N.number,N.string]),fg:N.string,bg:N.string}}static __initStatic2(){this.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,size:30,fg:"#4aaf46",bg:"#f8ffe2"}}render(){const{iconSet:n,shape:i,category:r,open:s,size:o,fg:a,bg:l}=this.props,c="check"===n?M.createElement(e,{fill:a}):M.createElement(t,{fill:a}),d="check"===n?M.createElement(e,{fill:l}):M.createElement(t,{fill:l});return s?M.createElement(R,{size:o},d):M.createElement(R,{size:o},"feedback"===r?"round"===i?M.createElement(O,{fill:l}):M.createElement(T,{fill:l}):"round"===i?M.createElement(S,{fill:l}):M.createElement(A,{fill:l}),c)}}return n.__initStatic(),n.__initStatic2(),n};const F=n,B=i,L=({fill:e})=>B.createElement("g",{transform:"translate(1, 0)"},B.createElement("path",{d:"M24.7,22.1c-1.5,1.7-3.6,2.7-5.8,2.7s-4.5-1.1-5.8-2.7l-2.8,1.6c2,2.7,5.2,4.2,8.7,4.2 c3.4,0,6.6-1.6,8.7-4.2L24.7,22.1z",fill:e}),B.createElement("rect",{x:"21.1",y:"13.1",width:"3.7",height:"4.7",fill:e}),B.createElement("rect",{x:"12.7",y:"13.1",width:"3.7",height:"4.7",fill:e}));L.propTypes={fill:F.string.isRequired};const w=({fill:e,x:t=0,y:n=0})=>B.createElement("polygon",{transform:`translate(${t}, ${n})`,points:"19.1,28.6 11.8,22.3 14.4,19.2 17.9,22.1 23.9,11.4 27.5,13.4",fill:e});w.propTypes={fill:F.string.isRequired,x:F.number,y:F.number};const I=D(w,L);I.propTypes={iconSet:F.oneOf(["emoji","check"]),shape:F.oneOf(["round","square"]),category:F.oneOf(["feedback",void 0]),open:F.bool,fg:F.string,bg:F.string,size:F.oneOfType([F.string,F.number])},I.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#f8ffe2",size:30};const z=n,{styled:P}=r;z.string.isRequired,z.string.isRequired,z.string.isRequired,z.string.isRequired,z.string.isRequired,P("div")(({size:e})=>({width:e||"25px",height:e||"25px"})),z.bool,z.string;const q=n,j=i,H=({fill:e})=>j.createElement("g",{transform:"translate(0.5, 0.5)"},j.createElement("rect",{x:"11",y:"17.3",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)",width:"16.6",height:"3.7",fill:e}),j.createElement("rect",{x:"17.4",y:"10.7",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)",width:"3.7",height:"16.6",fill:e}));H.propTypes={fill:q.string.isRequired};const Y=({fill:e})=>j.createElement("g",{transform:"translate(1,0)"},j.createElement("rect",{x:"21",y:"12.9",width:"3.7",height:"4.7",fill:e}),j.createElement("rect",{x:"12.7",y:"12.9",width:"3.7",height:"4.7",fill:e}),j.createElement("rect",{x:"12.2",y:"22.5",width:"13",height:"3.3",fill:e}));Y.propTypes={fill:q.string.isRequired};const U=D(H,Y);U.propTypes={iconSet:q.oneOf(["emoji","check"]),shape:q.oneOf(["round","square"]),category:q.oneOf(["feedback",void 0]),open:q.bool,fg:q.string,bg:q.string,size:q.oneOfType([q.string,q.number])},U.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#fcb733",bg:"#fbf2e3",size:30};const $=n,K=i,W=()=>{const e={fill:"none",stroke:"#BCE2FF",strokeWidth:2,strokeMiterlimit:10};return K.createElement("g",null,K.createElement("line",{style:e,x1:"-98",y1:"142",x2:"-114.6",y2:"142"}),K.createElement("line",{style:e,x1:"-98",y1:"146.3",x2:"-114.6",y2:"146.3"}),K.createElement("line",{style:e,x1:"-104",y1:"150.7",x2:"-114.6",y2:"150.7"}))},G=({children:e,size:t})=>K.createElement(C,{size:t},K.createElement("svg",{version:"1.1",viewBox:"-128 129 31 31",style:{enableBackground:"new -128 129 31 31"}},e));G.propTypes={children:$.oneOfType([$.arrayOf($.node),$.node]).isRequired,size:$.number};const V=()=>K.createElement("g",null,K.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),K.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),K.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),K.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),K.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#7FABC6"},width:"4.1",height:"4.1"}),K.createElement("polygon",{style:{fill:"#7FABC6"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "})),J=()=>K.createElement("g",null,K.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),K.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),K.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),K.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),K.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#1A9CFF"},width:"4.1",height:"4.1"}),K.createElement("polygon",{style:{fill:"#1A9CFF"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "}));class X extends K.Component{constructor(e){super(e)}render(){return!0===this.props.open?K.createElement(G,null,K.createElement(V,null),K.createElement(W,null)):K.createElement(G,null,K.createElement(J,null),K.createElement(W,null))}}X.propTypes={open:$.bool},X.defaultProps={open:!1};const Q=n,Z=i,ee=({fill:e})=>Z.createElement("path",{fill:e,d:"M-130.4,142.1c0-2.1,1.7-3.9,3.9-3.9c0.3,0,0.5,0,0.8,0.1c-0.6-0.8-1.5-1.3-2.6-1.3c-1.8,0-3.3,1.5-3.3,3.3c0,1.1,0.5,2,1.3,2.6C-130.4,142.6-130.4,142.4-130.4,142.1z"});ee.propTypes={fill:Q.string};class te extends Z.Component{static __initStatic(){this.propTypes={classes:Q.object.isRequired,size:Q.number}}render(){const{size:e}=this.props;return!0===this.props.open?Z.createElement(C,{size:e},Z.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 32"},Z.createElement("path",{fill:"#BCE2FF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),Z.createElement("path",{fill:"#BCE2FF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),Z.createElement(ee,{fill:"#1A9CFF"}))):Z.createElement(C,{size:e},Z.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 31"},Z.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-120.7,142.4c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-121.6,146-120.7,144.3-120.7,142.4z"}),Z.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-124.4,154.3h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-123.6,153.9-123.9,154.3-124.4,154.3z"}),Z.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-121.3,141.8c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.2,145.3-121.3,143.7-121.3,141.8z"}),",",Z.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-125,153.7h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.2,153.3-124.6,153.7-125,153.7z"}),Z.createElement("path",{fill:"#1A9CFF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),Z.createElement("path",{fill:"#1A9CFF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),Z.createElement(ee,{fill:"1A9CFF"})))}}te.__initStatic(),te.propTypes={open:Q.bool},te.defaultProps={open:!1};const ne=n,ie=i,re=({fill:e})=>ie.createElement("g",null,ie.createElement("rect",{x:"19.3",y:"10.3",width:"4.5",height:"12.7",fill:e}),ie.createElement("rect",{x:"19.3",y:"26.2",width:"4.5",height:"4.5",fill:e}));re.propTypes={fill:ne.string.isRequired};const se=({fill:e})=>ie.createElement("polygon",{points:"14.8,4.5 5.6,13.8 5.6,27 14.8,36.5 28.1,36.5 37.6,27 37.6,13.8 28.1,4.5",fill:e});se.propTypes={fill:ne.string.isRequired};const oe=({fill:e})=>ie.createElement("g",null,ie.createElement("rect",{x:"23.8",y:"15",width:"3.5",height:"4.4",fill:e}),ie.createElement("rect",{x:"16",y:"15",width:"3.5",height:"4.4",fill:e}),ie.createElement("path",{d:"M24.2,27.1h-5.1c-0.8,0-1.5-0.7-1.5-1.5v0c0-0.8,0.7-1.5,1.5-1.5h5.1c0.8,0,1.5,0.7,1.5,1.5v0 C25.7,26.4,25,27.1,24.2,27.1z",fill:e}));oe.propTypes={fill:ne.string.isRequired};class ae extends ie.Component{constructor(e){super(e);const{fg:t="#464146",bg:n="white"}=this.props;this.icons={check:ie.createElement(R,null,ie.createElement(se,{fill:n}),ie.createElement(re,{fill:t})),emoji:ie.createElement(R,null,ie.createElement(se,{fill:n}),ie.createElement(oe,{fill:t})),feedback:{check:ie.createElement(R,null,ie.createElement(se,{fill:n}),ie.createElement(oe,{fill:t})),emoji:ie.createElement(R,null,ie.createElement(se,{fill:n}),ie.createElement(oe,{fill:t})),square:{check:ie.createElement(R,null,ie.createElement(se,{fill:n}),ie.createElement(re,{fill:t})),emoji:ie.createElement(R,null,ie.createElement(se,{fill:n}),ie.createElement(oe,{fill:t})),open:{check:ie.createElement(R,null,ie.createElement(re,{fill:n})),emoji:ie.createElement(R,null,ie.createElement(oe,{fill:n}))}}}}}render(){const{iconSet:e,category:t,shape:n,open:i}=this.props;return void 0===t?this.icons[e]:void 0===n?this.icons.feedback[e]:!0===i?this.icons.feedback.square.open[e]:this.icons.feedback.square[e]}}ae.propTypes={iconSet:ne.oneOf(["emoji","check",void 0]),shape:ne.oneOf(["square",void 0]),category:ne.oneOf(["feedback",void 0]),open:ne.bool,fg:ne.string,bg:ne.string},ae.defaultProps={iconSet:"check",shape:void 0,category:void 0,open:!1,fg:"#464146",bg:"white"};const le=n,ce=i,de=({fill:e})=>ce.createElement("g",{transform:"translate(0, 0)"},ce.createElement("polygon",{points:"27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6",fill:e}),ce.createElement("polygon",{points:"16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3",fill:e}));de.propTypes={fill:le.string.isRequired};const pe=({fill:e})=>ce.createElement("g",{transform:"translate(2, 0)"},ce.createElement("rect",{x:"20.6",y:"11.8",width:"4",height:"5",fill:e}),ce.createElement("rect",{x:"11.5",y:"11.8",width:"4",height:"5",fill:e}),ce.createElement("rect",{x:"10.9",y:"22.9",transform:"matrix(0.9794 -0.2019 0.2019 0.9794 -4.6237 4.1559)",width:"14.3",height:"3.7",fill:e}));pe.propTypes={fill:le.string.isRequired};const ue=D(de,pe);ue.propTypes={iconSet:le.oneOf(["emoji","check"]),shape:le.oneOf(["round","square"]),category:le.oneOf(["feedback",void 0]),open:le.bool,fg:le.string,bg:le.string,size:le.oneOfType([le.string,le.number])},ue.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#c1e1ac",size:30};const he=n,me=i,fe=({fill:e})=>me.createElement("g",null,me.createElement("rect",{x:"-115",y:"136.7",width:"3",height:"3",fill:e}),me.createElement("polygon",{points:"-112,147.7 -112,141.7 -115.8,141.7 -115.8,143.7 -114,143.7 -114,147.7 -116.2,147.7 -116.2,149.7 -109.8,149.7 -109.8,147.7",fill:e}));fe.propTypes={fill:he.string.isRequired};const Ee=({fill:e})=>me.createElement("path",{d:"M-113,158.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105,158.5-113,158.5z M-113,130.5c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-105.6,130.5-113,130.5z",fill:e});Ee.propTypes={fill:he.string.isRequired};const ge=({fill:e="#FFFFFF"})=>me.createElement("g",null,me.createElement("path",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeMiterlimit:10},d:"M-111.7,160.9c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5C-96.2,154-103.1,160.9-111.7,160.9z"}),me.createElement("path",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeMiterlimit:10},d:"M-112,159.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-104,159.5-112,159.5z"}),me.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:e}));ge.propTypes={fill:he.string};const be=({children:e,size:t})=>{const n=x(t),i={height:n,width:n,display:"inline-block",position:"relative"};return me.createElement("div",{style:i},me.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-129 128 34 34"},e))};be.propTypes={children:he.oneOfType([he.arrayOf(he.node),he.node]).isRequired,size:he.oneOfType([he.string,he.number])};class ye extends me.Component{render(){const{iconSet:e,open:t,fg:n="#1a9cff",bg:i="#bce2ff",border:r="#bbe3fd"}=this.props,s=me.createElement(fe,{fill:n}),o={check:me.createElement(be,{size:this.props.size},me.createElement(ge,null),s,me.createElement(Ee,{fill:r})),emoji:me.createElement(be,{size:this.props.size},me.createElement(ge,null),s,me.createElement(Ee,{fill:r})),open:{check:me.createElement(be,{size:this.props.size},me.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),me.createElement(fe,{fill:i}),me.createElement(Ee,{fill:"#FFFFFF"})),emoji:me.createElement(be,{size:this.props.size},me.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),me.createElement(fe,{fill:i}),me.createElement(Ee,{fill:r}))}};return!0===t?o.open[e]:o[e]}}function ve(){return ve=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},ve.apply(null,arguments)}function xe(e,t){if(null==e)return{};var n={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(-1!==t.indexOf(i))continue;n[i]=e[i]}return n}function Ce(e,t){return Ce=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ce(e,t)}function _e(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ce(e,t)}function ke(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}ye.propTypes={iconSet:he.oneOf(["emoji","check"]),open:he.bool,fg:he.string,bg:he.string,border:he.string,size:he.oneOfType([he.string,he.number])},ye.defaultProps={iconSet:"check",open:!1,fg:"#1a9cff",bg:"#bce2ff",border:"#bbe3fd",size:30};var Re=!1;var Te=i.createContext(null),Oe=function(e){return e.scrollTop};const Se=i,Ae=t;var Ne="unmounted",Me="exited",De="entering",Fe="entered",Be="exiting",Le=function(e){function t(t,n){var i;i=e.call(this,t,n)||this;var r,s=n&&!n.isMounting?t.enter:t.appear;return i.appearStatus=null,t.in?s?(r=Me,i.appearStatus=De):r=Fe:r=t.unmountOnExit||t.mountOnEnter?Ne:Me,i.state={status:r},i.nextCallback=null,i}_e(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Ne?{status:Me}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==De&&n!==Fe&&(t=De):n!==De&&n!==Fe||(t=Be)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,i=this.props.timeout;return e=t=n=i,null!=i&&"number"!=typeof i&&(e=i.exit,t=i.enter,n=void 0!==i.appear?i.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===De){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Ae.findDOMNode(this);n&&Oe(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Me&&this.setState({status:Ne})},n.performEnter=function(e){var t=this,n=this.props.enter,i=this.context?this.context.isMounting:e,r=this.props.nodeRef?[i]:[Ae.findDOMNode(this),i],s=r[0],o=r[1],a=this.getTimeouts(),l=i?a.appear:a.enter;!e&&!n||Re?this.safeSetState({status:Fe},function(){t.props.onEntered(s)}):(this.props.onEnter(s,o),this.safeSetState({status:De},function(){t.props.onEntering(s,o),t.onTransitionEnd(l,function(){t.safeSetState({status:Fe},function(){t.props.onEntered(s,o)})})}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),i=this.props.nodeRef?void 0:Ae.findDOMNode(this);t&&!Re?(this.props.onExit(i),this.safeSetState({status:Be},function(){e.props.onExiting(i),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:Me},function(){e.props.onExited(i)})})})):this.safeSetState({status:Me},function(){e.props.onExited(i)})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(i){n&&(n=!1,t.nextCallback=null,e(i))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:Ae.findDOMNode(this),i=null==e&&!this.props.addEndListener;if(n&&!i){if(this.props.addEndListener){var r=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],s=r[0],o=r[1];this.props.addEndListener(s,o)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===Ne)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var i=xe(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Se.createElement(Te.Provider,{value:null},"function"==typeof n?n(e,i):Se.cloneElement(Se.Children.only(n),i))},t}(Se.Component);function we(){}Le.contextType=Te,Le.propTypes={},Le.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:we,onEntering:we,onEntered:we,onExit:we,onExiting:we,onExited:we},Le.UNMOUNTED=Ne,Le.EXITED=Me,Le.ENTERING=De,Le.ENTERED=Fe,Le.EXITING=Be;var Ie=Le;const ze=i;var Pe=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return i=t,void((n=e).classList?n.classList.add(i):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,i)||("string"==typeof n.className?n.className=n.className+" "+i:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+i)));var n,i})},qe=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return i=t,void((n=e).classList?n.classList.remove(i):"string"==typeof n.className?n.className=ke(n.className,i):n.setAttribute("class",ke(n.className&&n.className.baseVal||"",i)));var n,i})},je=function(e){function t(){for(var t,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(t=e.call.apply(e,[this].concat(i))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var i=t.resolveArguments(e,n),r=i[0],s=i[1];t.removeClasses(r,"exit"),t.addClass(r,s?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var i=t.resolveArguments(e,n),r=i[0],s=i[1]?"appear":"enter";t.addClass(r,s,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var i=t.resolveArguments(e,n),r=i[0],s=i[1]?"appear":"enter";t.removeClasses(r,s),t.addClass(r,s,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,i="string"==typeof n,r=i?""+(i&&n?n+"-":"")+e:n[e];return{baseClassName:r,activeClassName:i?r+"-active":n[e+"Active"],doneClassName:i?r+"-done":n[e+"Done"]}},t}_e(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var i=this.getClassNames(t)[n+"ClassName"],r=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&r&&(i+=" "+r),"active"===n&&e&&Oe(e),i&&(this.appliedClasses[t][n]=i,Pe(e,i))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],i=n.base,r=n.active,s=n.done;this.appliedClasses[t]={},i&&qe(e,i),r&&qe(e,r),s&&qe(e,s)},n.render=function(){var e=this.props;e.classNames;var t=xe(e,["classNames"]);return ze.createElement(Ie,ve({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(ze.Component);je.defaultProps={classNames:""},je.propTypes={};var He=je;const{Children:Ye}=i,{cloneElement:Ue}=i,{isValidElement:$e}=i;function Ke(e,t){var n=Object.create(null);return e&&Ye.map(e,function(e){return e}).forEach(function(e){n[e.key]=function(e){return t&&$e(e)?t(e):e}(e)}),n}function We(e,t,n){return null!=n[t]?n[t]:e.props[t]}function Ge(e,t,n){var i=Ke(e.children),r=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var i,r=Object.create(null),s=[];for(var o in e)o in t?s.length&&(r[o]=s,s=[]):s.push(o);var a={};for(var l in t){if(r[l])for(i=0;i<r[l].length;i++){var c=r[l][i];a[r[l][i]]=n(c)}a[l]=n(l)}for(i=0;i<s.length;i++)a[s[i]]=n(s[i]);return a}(t,i);return Object.keys(r).forEach(function(s){var o=r[s];if($e(o)){var a=s in t,l=s in i,c=t[s],d=$e(c)&&!c.props.in;!l||a&&!d?l||!a||d?l&&a&&$e(c)&&(r[s]=Ue(o,{onExited:n.bind(null,o),in:c.props.in,exit:We(o,"exit",e),enter:We(o,"enter",e)})):r[s]=Ue(o,{in:!1}):r[s]=Ue(o,{onExited:n.bind(null,o),in:!0,exit:We(o,"exit",e),enter:We(o,"enter",e)})}}),r}const Ve=i;var Je=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Xe=function(e){function t(t,n){var i,r=(i=e.call(this,t,n)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(i));return i.state={contextValue:{isMounting:!0},handleExited:r,firstRender:!0},i}_e(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,i,r=t.children,s=t.handleExited;return{children:t.firstRender?(n=e,i=s,Ke(n.children,function(e){return Ue(e,{onExited:i.bind(null,e),in:!0,appear:We(e,"appear",n),enter:We(e,"enter",n),exit:We(e,"exit",n)})})):Ge(e,r,s),firstRender:!1}},n.handleExited=function(e,t){var n=Ke(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=ve({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,i=xe(e,["component","childFactory"]),r=this.state.contextValue,s=Je(this.state.children).map(n);return delete i.appear,delete i.enter,delete i.exit,null===t?Ve.createElement(Te.Provider,{value:r},s):Ve.createElement(Te.Provider,{value:r},Ve.createElement(t,i,s))},t}(Ve.Component);Xe.propTypes={},Xe.defaultProps={component:"div",childFactory:function(e){return e}};var Qe=Xe;const Ze={TEXT:"black",DISABLED:"grey",DISABLED_SECONDARY:"#ABABAB",CORRECT:l[500],CORRECT_SECONDARY:l[50],CORRECT_TERTIARY:"#0EA449",CORRECT_WITH_ICON:"#087D38",INCORRECT:c[500],INCORRECT_SECONDARY:d[50],INCORRECT_WITH_ICON:"#BF0D00",MISSING:d[700],MISSING_WITH_ICON:"#6A78A1",PRIMARY:p[500],PRIMARY_LIGHT:p[200],PRIMARY_DARK:p[800],SECONDARY:u.A400,SECONDARY_LIGHT:u[200],SECONDARY_DARK:u[900],TERTIARY:"#146EB3",TERTIARY_LIGHT:"#D0E2F0",BACKGROUND:"rgba(255,255,255,0)",BACKGROUND_DARK:"#ECEDF1",DROPDOWN_BACKGROUND:"#E0E1E6",SECONDARY_BACKGROUND:"rgba(241,241,241,1)",BORDER:"#9A9A9A",BORDER_LIGHT:"#D1D1D1",BORDER_DARK:"#646464",BORDER_GRAY:"#7E8494",BLACK:"#000000",WHITE:"#ffffff",TRANSPARENT:"transparent",FOCUS_CHECKED:"#BBDEFB",FOCUS_CHECKED_BORDER:"#1565C0",FOCUS_UNCHECKED:"#E0E0E0",FOCUS_UNCHECKED_BORDER:"#757575",BLUE_GREY100:"#F3F5F7",BLUE_GREY300:"#C0C3CF",BLUE_GREY600:"#7E8494",BLUE_GREY900:"#152452",FADED_PRIMARY:"#DCDAFB",KEYPAD_BUTTON:"rgb(188, 194, 229)",KEYPAD_BUTTON_OPERATOR:"rgb(255, 159, 192)",KEYPAD_EMPTY_PLACEHOLDER:"rgba(245, 0, 87, 0.4)",KEYPAD_BUTTON_HOVER:"rgb(214, 218, 239)",KEYPAD_BUTTON_OPERATOR_HOVER:"rgb(255, 197, 217)",BUTTON_BORDER:"rgba(0, 0, 0, 0.23)",BUTTON_HOVER_BG:"rgba(0, 0, 0, 0.08)"};Object.freeze(Ze);const et=(tt="pie",(...e)=>{const t=e.pop();return e.reduceRight((e,t)=>`var(--${tt}-${t}, ${e})`,t)});var tt;const nt=()=>et("text",Ze.TEXT),it=()=>et("background",Ze.BACKGROUND),rt=i,st=n,{styled:ot}=r,at=ot("div")({transformOrigin:"0% 0px 0px",width:"100%",display:"block",overflow:"hidden","&.incorrect":{color:"#946202"}}),lt=ot("div")({WebkitFontSmoothing:"antialiased",backgroundColor:`var(--feedback-bg-color, ${et("disabled",Ze.DISABLED)})`,borderRadius:"4px",lineHeight:"25px",margin:"0px",padding:"10px",verticalAlign:"middle",color:"var(--feedback-color, white)","&.correct":{backgroundColor:`var(--feedback-correct-bg-color, ${et("correct",Ze.CORRECT)})`},"&.incorrect":{backgroundColor:`var(--feedback-incorrect-bg-color, ${et("incorrect",Ze.INCORRECT)})`}}),ct=ot("div")({"&.feedback-enter":{height:"1px"},"&.feedback-enter-active":{height:"45px",transition:"height 500ms"},"&.feedback-exit":{height:"45px"},"&.feedback-exit-active":{height:"1px",transition:"height 200ms"}});class dt extends rt.Component{constructor(...e){super(...e),dt.prototype.__init.call(this)}static __initStatic(){this.propTypes={correctness:st.string,feedback:st.string}}__init(){this.nodeRef=rt.createRef()}renderFeedback(){const{correctness:e,feedback:t}=this.props;return e&&t?rt.createElement(He,{key:"hasFeedback",nodeRef:this.nodeRef,timeout:{enter:500,exit:200},classNames:"feedback"},rt.createElement(ct,{ref:this.nodeRef},rt.createElement(at,null,rt.createElement(lt,{className:e,dangerouslySetInnerHTML:{__html:t}})))):null}render(){return rt.createElement("div",null,rt.createElement(Qe,null,this.renderFeedback()))}}dt.__initStatic();const pt=i,ut=n,{Popover:ht}=s,{styled:mt}=r,ft=o("pie-libs:render-ui:response-indicators"),Et=mt("div")(({hasFeedback:e})=>({cursor:e?"pointer":"default"})),gt=mt(ht)({cursor:"pointer"}),bt=mt("div")({padding:"0",borderRadius:"4px"}),yt=(e,t)=>{class n extends pt.Component{constructor(e){super(e),n.prototype.__init.call(this),n.prototype.__init2.call(this),this.state={}}__init(){this.handlePopoverOpen=e=>{ft("[handlePopoverOpen]",e.target),this.setState({anchorEl:e.target})}}__init2(){this.handlePopoverClose=()=>{this.setState({anchorEl:null})}}render(){const{feedback:n}=this.props,{anchorEl:i}=this.state;return pt.createElement(Et,{hasFeedback:!!n},pt.createElement("span",{ref:e=>this.icon=e,onClick:this.handlePopoverOpen},pt.createElement(e,null)),n&&pt.createElement(gt,{PaperComponent:bt,open:!!i,anchorEl:i,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:this.handlePopoverClose},pt.createElement(dt,{feedback:n,correctness:t})))}}return n.propTypes={feedback:ut.string},n};yt(I,"correct"),yt(U,"incorrect"),yt(ue,"partially-correct"),yt(ae,"nothing-submitted");const vt=i,{styled:xt}=r,Ct=a,_t=n,{renderMath:kt}=e,Rt=xt("span")(({theme:e})=>({color:e.palette.primary.light,borderBottom:`1px dotted ${e.palette.primary.light}`,cursor:"pointer"})),Tt=xt(Ct)(({theme:e})=>({paddingTop:e.spacing(2)}));class Ot extends vt.Component{constructor(...e){super(...e),Ot.prototype.__init.call(this),Ot.prototype.__init2.call(this)}static __initStatic(){this.propTypes={className:_t.string,children:_t.object,labels:_t.shape({visible:_t.string,hidden:_t.string})}}static __initStatic2(){this.defaultProps={labels:{}}}__init(){this.state={expanded:!1}}__init2(){this.toggleExpanded=()=>{this.setState(e=>({expanded:!e.expanded}))}}componentDidMount(){kt(this.root)}componentDidUpdate(){kt(this.root)}render(){const{labels:e,children:t,className:n}=this.props,i=this.state.expanded?e.visible||"Hide":e.hidden||"Show";return vt.createElement("div",{className:n,ref:e=>this.root=e},vt.createElement("div",{onClick:this.toggleExpanded},vt.createElement(Rt,null,i)),vt.createElement(Tt,{in:this.state.expanded,timeout:{enter:225,exit:195},unmountOnExit:!0},t))}}Ot.__initStatic(),Ot.__initStatic2();const{Button:St}=s,{styled:At}=r;At("div")({display:"flex",flexDirection:"column"}),At("div")({display:"flex",alignItems:"center",justifyContent:"center"}),At("div")(({theme:e})=>({width:"24px",height:"24px",color:"gray",marginRight:e.spacing(1),display:"flex",alignItems:"center"})),At(St)(({theme:e})=>({display:"flex",alignItems:"center",marginLeft:e.spacing(3),marginRight:e.spacing(3)}));const Nt=i,{createTheme:Mt}=r,{styled:Dt}=r,{StyledEngineProvider:Ft}=r,{ThemeProvider:Bt}=r,Lt=n;const wt=Mt({typography:{fontFamily:"inherit"},palette:{action:{disabled:"rgba(0, 0, 0, 0.54);"}},components:{MuiTypography:{styleOverrides:{root:{fontFamily:"inherit"}}},MuiButton:{styleOverrides:{contained:{backgroundColor:"#e0e0e0",color:"#000000","&:hover":{backgroundColor:"#bdbdbd"}}}}}}),It=Dt("div")({"& table, th, td":{fontSize:"inherit"}});class zt extends Nt.Component{static __initStatic(){this.propTypes={className:Lt.string,children:Lt.array,extraCSSRules:Lt.shape({names:Lt.arrayOf(Lt.string),rules:Lt.string}),fontSizeFactor:Lt.number}}static __initStatic2(){this.defaultProps={extraCSSRules:{},fontSizeFactor:1}}constructor(e){super(e),this.classesSheet=document.createElement("style")}computeStyle(e){const t=e=>parseFloat(getComputedStyle(e).fontSize),n=t(document.documentElement),i=t(document.body),r=Math.max(n,i),s=null!=e&&"number"==typeof e?e:1;return 1!==s?{fontSize:r*s+"px"}:null}render(){const{children:e,className:t,fontSizeFactor:n,...i}=this.props,{extraCSSRules:r,...s}=i,o=this.computeStyle(n);return Nt.createElement(Ft,{injectFirst:!0},Nt.createElement(Bt,{theme:wt},function(e){let t,n=e[0],i=1;for(;i<e.length;){const r=e[i],s=e[i+1];if(i+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=s(n)):"call"!==r&&"optionalCall"!==r||(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}([r,"optionalAccess",e=>e.rules])?Nt.createElement("style",{dangerouslySetInnerHTML:{__html:`.extraCSSRules { ${r.rules} }`}}):null,Nt.createElement(It,{className:`${t} extraCSSRules`,...s,...o&&{style:o}},e)))}}zt.__initStatic(),zt.__initStatic2();const Pt=i,{styled:qt}=r,jt=n,Ht=qt(zt)({display:"flex",flexDirection:"column",position:"relative"});class Yt extends Pt.Component{static __initStatic(){this.propTypes={ariaLabel:jt.string,children:jt.oneOfType([jt.arrayOf(jt.node),jt.node]).isRequired,role:jt.string,extraCSSRules:jt.shape({names:jt.arrayOf(jt.string),rules:jt.string}),fontSizeFactor:jt.number}}render(){const{children:e,ariaLabel:t,role:n,extraCSSRules:i,fontSizeFactor:r,classes:s}=this.props,o=t?{"aria-label":t,role:n}:{};return Pt.createElement(Ht,{...o,extraCSSRules:i,fontSizeFactor:r,classes:s},e)}}Yt.__initStatic();const Ut=i,$t=n;class Kt extends Ut.Component{static __initStatic(){this.propTypes={tag:$t.string,className:$t.string,html:$t.string}}static __initStatic2(){this.defaultProps={tag:"div",html:""}}render(){const{tag:e,className:t,html:n}=this.props,i=e||"div";return Ut.createElement(i,{ref:e=>this.node=e,className:t,dangerouslySetInnerHTML:{__html:n}})}}Kt.__initStatic(),Kt.__initStatic2();const{InputLabel:Wt}=s,{FormControl:Gt}=s,Vt=n,{styled:Jt}=r;Jt(Gt)(({theme:e})=>({margin:0,padding:0,flex:"1 0 auto",minWidth:e.spacing(4)})),Jt(Wt)(()=>({fontSize:"inherit",whiteSpace:"nowrap",margin:0,padding:0,alignSelf:"flex-start",position:"absolute",top:0,left:0,transformOrigin:"top left",pointerEvents:"none","&.MuiInputLabel-shrink":{transform:"scale(0.75) translate(0, -0.75em)"},"&:not(.MuiInputLabel-shrink)":{transform:"translate(0, 0)"}})),Vt.oneOfType([Vt.string,Vt.object]).isRequired,Vt.string,Vt.oneOfType([Vt.arrayOf(Vt.node),Vt.node]).isRequired;const Xt=i,{Component:Qt}=i,{styled:Zt}=r,en=n,{renderMath:tn}=e,nn=Zt("div")(({theme:e,tagName:t})=>({"&:not(.MathJax) > table":{borderCollapse:"collapse"},"&:not(.MathJax) > table:has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)":{backgroundColor:"#f6f8fa",color:e.palette.common.black},"&:not(.MathJax) > table:has(tbody tr > td:first-child) tbody tr:nth-child(even) td":{backgroundColor:"#f6f8fa",color:e.palette.common.black},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"},"&:not(.MathJax) > table td > p.kds-indent":{textAlign:"initial"},"&.prompt":{verticalAlign:"middle",color:nt()},"&.legend":{width:"100%",fontSize:"inherit !important"},"&.rationale":{paddingLeft:e.spacing(4),paddingBottom:e.spacing(1)},"&.prompt-label":{color:`${nt()} !important`,display:"flex",flexDirection:"column",verticalAlign:"middle",cursor:"pointer","& > p":{margin:"0 0 0 0 !important"}}})),rn=/\\embed\{newLine\}\[\]/g;class sn extends Qt{constructor(...e){super(...e),sn.prototype.__init.call(this)}static __initStatic(){this.propTypes={prompt:en.string,tagName:en.string,className:en.string,onClick:en.func,defaultClassName:en.string,autoplayAudioEnabled:en.bool,customAudioButton:{playImage:en.string,pauseImage:en.string}}}static __initStatic2(){this.defaultProps={onClick:()=>{}}}__init(){this.parsedText=e=>{const{customAudioButton:t}=this.props,n=document.createElement("div");n.innerHTML=e;const i=n.querySelector("audio");if(i){const e=document.createElement("source");if(e.setAttribute("type","audio/mp3"),e.setAttribute("src",i.getAttribute("src")),i.removeAttribute("src"),i.setAttribute("id","pie-prompt-audio-player"),i.appendChild(e),t){i.style.display="none";const e=document.createElement("div");e.id="play-audio-button",Object.assign(e.style,{cursor:"pointer",display:"block",width:"128px",height:"128px",backgroundImage:`url(${t.pauseImage})`,backgroundSize:"cover",borderRadius:"50%",border:"1px solid #326295"}),i.parentNode.insertBefore(e,i)}}return n.innerHTML}}addCustomAudioButtonControls(){const{autoplayAudioEnabled:e,customAudioButton:t}=this.props,n=document.getElementById("play-audio-button"),i=document.getElementById("pie-prompt-audio-player");if(e&&i&&i.play().then(()=>{n&&t&&i.addEventListener("ended",s)}).catch(e=>{console.error("Error playing audio",e)}),!n||!i||!t)return;const r=()=>{i.paused&&(n.style.backgroundImage.includes(t.pauseImage)||i.play())},s=()=>{n.style.backgroundImage=`url(${t.playImage})`},o=()=>{Object.assign(n.style,{backgroundImage:`url(${t.pauseImage})`,border:"1px solid #ccc"})},a=()=>{Object.assign(n.style,{backgroundImage:`url(${t.playImage})`,border:"1px solid #326295"})};n.addEventListener("click",r),i.addEventListener("play",o),i.addEventListener("pause",a),i.addEventListener("ended",s),this._handlePlayClick=r,this._handleAudioPlay=o,this._handleAudioPause=a,this._handleAudioEnded=s}removeCustomAudioButtonListeners(){const e=document.getElementById("play-audio-button"),t=document.querySelector("audio");e&&t&&(e.removeEventListener("click",this._handlePlayClick),t.removeEventListener("play",this._handleAudioPlay),t.removeEventListener("pause",this._handleAudioPause),t.removeEventListener("ended",this._handleAudioEnded))}componentDidMount(){this.alignImages(),this.addCustomAudioButtonControls(),this.setupMathRendering()}componentDidUpdate(e){this.alignImages(),e.prompt!==this.props.prompt&&this.renderMathContent()}componentWillUnmount(){this.removeCustomAudioButtonListeners()}setupMathRendering(){this.renderMathContent()}renderMathContent(){const e=document.getElementById("preview-prompt");e&&"function"==typeof tn&&tn(e)}alignImages(){document.querySelectorAll("#preview-prompt").forEach(e=>{const t=e.getElementsByTagName("img");if(t&&t.length)for(let e of t)if(e.attributes&&e.attributes.alignment&&e.attributes.alignment.value){const t=e.attributes.alignment.value,n="center"===t?"center":"right"===t?"flex-end":"flex-start",i=e.parentElement;if("DIV"===i.tagName&&"flex"===i.style.display&&"100%"===i.style.width)i.style.justifyContent=n;else{const t=document.createElement("div");t.style.display="flex",t.style.width="100%",t.style.justifyContent=n;const r=e.cloneNode(!0);t.appendChild(r),i.replaceChild(t,e)}}})}render(){const{prompt:e,tagName:t,className:n,onClick:i,defaultClassName:r}=this.props,s=`${n||""} ${r||""} ${"legend"===t?"legend":""}`.trim();return Xt.createElement(nn,{as:t||"div",id:"preview-prompt",onClick:i,className:s,tagName:t,dangerouslySetInnerHTML:{__html:this.parsedText(e||"").replace(rn,"\\newline ")}})}}sn.__initStatic(),sn.__initStatic2();const on=n;on.node,on.bool;const an=n,ln=i,cn=e=>ln.createElement(ln.Fragment,null,ln.Children.map(e.children,t=>ln.cloneElement(t,{"data-pie-purpose":e.purpose})));cn.propTypes={children:an.node,purpose:an.string},"undefined"!=typeof window&&new DOMParser,"undefined"!=typeof window&&new DOMParser;const dn=i,pn=n,{Tabs:un}=s,{Tab:hn}=s,{styled:mn}=r;const fn=mn("div")({flexGrow:1,backgroundColor:it(),color:nt(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"}}),En=mn("div")(({theme:e})=>({backgroundColor:it(),color:nt(),padding:e.spacing(2),"& blockquote":{background:"#f9f9f9",borderLeft:"5px solid #ccc",margin:"1.5em 10px",padding:".5em 10px"}})),gn=mn("div")({fontSize:"1.75rem"}),bn=mn("div")({fontSize:"1.5rem"}),yn=mn("div")({fontSize:"1.25rem"}),vn=mn(hn)(({theme:e})=>({background:e.palette.common.white,fontSize:"inherit",fontFamily:"Roboto, sans-serif",opacity:.7,color:e.palette.common.black,"&.Mui-selected":{opacity:1,color:e.palette.common.black}}));class xn extends dn.Component{constructor(...e){super(...e),xn.prototype.__init.call(this),xn.prototype.__init2.call(this),xn.prototype.__init3.call(this),xn.prototype.__init4.call(this)}__init(){this.state={activeTab:0}}__init2(){this.handleChange=(e,t)=>{this.setState(()=>({activeTab:t})),setTimeout(()=>{const e=new CustomEvent("pie-ui-passage-tabChanged",{detail:{tab:t}});window.dispatchEvent(e)})}}__init3(){this.handleKeyDown=(e,t)=>{const{key:n}=e,{tabs:i}=this.props;let r=-1;const s=i.findIndex(e=>e.id===t);switch(n){case"ArrowRight":r=(s+1)%i.length;break;case"ArrowLeft":r=(s-1+i.length)%i.length;break;case"Home":r=0;break;case"End":r=i.length-1;break;case"Enter":case" ":r=s}-1!==r&&(e.preventDefault(),e.stopPropagation(),this.handleChange(e,i[r].id),document.getElementById(`button-${i[r].id}`).focus())}}__init4(){this.parsedText=(e="")=>{const t=document.createElement("div");t.innerHTML=e.replace(/(<br\/>\n)/g,"<br/>");const n=t.querySelector("audio");if(n){const e=document.createElement("source");e.setAttribute("type","audio/mp3"),e.setAttribute("src",n.getAttribute("src")),n.removeAttribute("src"),n.appendChild(e)}return t.innerHTML}}renderInstructions(e,t=!1){if(!e)return;const n=dn.createElement(sn,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:e});return t?n:dn.createElement(Ot,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},n)}renderTab(e,t){return dn.createElement(En,{key:e.id,id:`tabpanel-${e.id}`,role:"tabpanel","aria-labelledby":`button-${e.id}`},this.renderInstructions(e.teacherInstructions,t),(e.title||e.subtitle)&&dn.createElement("h2",null,e.title&&dn.createElement(cn,{purpose:"passage-title"},dn.createElement(gn,{dangerouslySetInnerHTML:{__html:this.parsedText(e.title)}})),e.subtitle&&dn.createElement(cn,{purpose:"passage-subtitle"},dn.createElement(bn,{dangerouslySetInnerHTML:{__html:this.parsedText(e.subtitle)}}))),e.author&&dn.createElement(cn,{purpose:"passage-author"},dn.createElement(yn,{className:"author",dangerouslySetInnerHTML:{__html:this.parsedText(e.author)}})),e.text&&dn.createElement(cn,{purpose:"passage-text"},dn.createElement("div",{key:e.id,className:"text",dangerouslySetInnerHTML:{__html:this.parsedText(e.text)}})))}render(){const{model:e,tabs:t,disabledTabs:n}=this.props,{activeTab:i}=this.state;if(!function(e){let t,n=e[0],i=1;for(;i<e.length;){const r=e[i],s=e[i+1];if(i+=2,("optionalAccess"===r||"optionalCall"===r)&&null==n)return;"access"===r||"optionalAccess"===r?(t=n,n=s(n)):"call"!==r&&"optionalCall"!==r||(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}([t,"optionalAccess",e=>e.length]))return;const{extraCSSRules:r}=e||{},s=(t||[]).find(e=>e.id===i);return dn.createElement(zt,{extraCSSRules:r},dn.createElement(fn,{className:"passages"},n||1===t.length?t.map(e=>this.renderTab(e,n)):dn.createElement(dn.Fragment,null,dn.createElement(un,{sx:{position:"sticky",top:0,background:it(),color:nt(),fontFamily:"Roboto, sans-serif","& .MuiTabs-indicator":{backgroundColor:"#f50057"}},value:i,onChange:this.handleChange},t.map(e=>dn.createElement(vn,{key:e.id,id:`button-${e.id}`,label:dn.createElement(cn,{purpose:"passage-label"},dn.createElement("span",{dangerouslySetInnerHTML:{__html:this.parsedText(e.label)}})),value:e.id,tabIndex:i===e.id?0:-1,"aria-controls":`tabpanel-${e.id}`,"aria-selected":i===e.id,onKeyDown:t=>this.handleKeyDown(t,e.id)}))),s?this.renderTab(s,n):null)))}}xn.propTypes={tabs:pn.arrayOf(pn.shape({id:pn.number.isRequired,label:pn.string.isRequired,title:pn.string.isRequired,subtitle:pn.string,author:pn.string,text:pn.string.isRequired,teacherInstructions:pn.string}).isRequired).isRequired,disabledTabs:pn.bool,model:pn.object};const{renderMath:Cn}=e,_n=i;class kn extends HTMLElement{constructor(){super(),kn.prototype.__init.call(this),this._model={passages:[]},this._session=null,this._root=null,this._mathObserver=null,this._mathRenderPending=!1}setLangAttribute(){const e=this._model&&(this._model.language,1)?this._model.language:"",t=e?e.slice(0,2):"en";this.setAttribute("lang",t)}__init(){this._scheduleMathRender=()=>{this._mathRenderPending||(this._mathRenderPending=!0,requestAnimationFrame(()=>{this._mathObserver&&this._mathObserver.disconnect(),Cn(this),this._mathRenderPending=!1,setTimeout(()=>{this._mathObserver&&this._mathObserver.observe(this,{childList:!0,subtree:!0})},50)}))}}_initMathObserver(){this._mathObserver||(this._mathObserver=new MutationObserver(this._scheduleMathRender),this._mathObserver.observe(this,{childList:!0,subtree:!0}))}_disconnectMathObserver(){this._mathObserver&&(this._mathObserver.disconnect(),this._mathObserver=null)}set model(e){this._model=e,this.dispatchEvent(new f(this.tagName.toLowerCase(),this._session,!!this._model)),this.setLangAttribute(),this._render()}set session(e){this._session=e}connectedCallback(){this.setAttribute("aria-label","Passage"),this.setAttribute("role","region"),this._initMathObserver(),this._render()}_render(){const{passages:e=[]}=this._model;if(this._model.passages.length>0){const t=e.map((e,t)=>({id:t,...e})),n=_n.createElement(xn,{tabs:t});this._root||(this._root=g(this)),this._root.render(n),this._initMathObserver()}}disconnectedCallback(){this._disconnectMathObserver(),this._root&&this._root.unmount()}}export{kn as default};
package/module/index.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/passage@6.2.0-next.5</title>
5
+ <title>@pie-element/passage@6.2.0-next.7</title>
6
6
  <script
7
7
  type="module"
8
8
  src="https://cdn.jsdelivr.net/npm/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "@pie-element/passage",
3
- "version": "6.2.0-next.5",
3
+ "version": "6.2.0-next.7",
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/shared-module",
7
7
  "version": "^4.1.0"
8
+ },
9
+ {
10
+ "name": "@pie-lib/math-rendering-module",
11
+ "version": "^4.1.0"
8
12
  }
9
13
  ]
10
14
  }
package/module/print.html CHANGED
@@ -2,7 +2,7 @@
2
2
  <!doctype html>
3
3
  <html>
4
4
  <head>
5
- <title>@pie-element/passage@6.2.0-next.5</title>
5
+ <title>@pie-element/passage@6.2.0-next.7</title>
6
6
  <link
7
7
  href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
8
8
  rel="stylesheet"
package/module/print.js CHANGED
@@ -1 +1 @@
1
- import{_dll_react_dom as e,_dll_react as t,_dll_prop_types as n,_dll_mui__material as r,_dll_mui__material_styles as a,_dll_pie_lib__render_ui as i,_dll_debug as o}from"../../../@pie-lib/shared-module@^4.1.0/module/index.js";var s,l=e;s=l.createRoot,l.hydrateRoot;var c="object"==typeof global&&global&&global.Object===Object&&global,u="object"==typeof self&&self&&self.Object===Object&&self,d=c||u||Function("return this")(),p=d.Symbol,b=Object.prototype,h=b.hasOwnProperty,m=b.toString,f=p?p.toStringTag:void 0;var g=Object.prototype.toString;var v=p?p.toStringTag:void 0;function y(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":v&&v in Object(e)?function(e){var t=h.call(e,f),n=e[f];try{e[f]=void 0;var r=!0}catch(e){}var a=m.call(e);return r&&(t?e[f]=n:delete e[f]),a}(e):function(e){return g.call(e)}(e)}var _=/\s/;var x=/^\s+/;function E(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&_.test(e.charAt(t)););return t}(e)+1).replace(x,""):e}function T(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var k=/^[-+]0x[0-9a-f]+$/i,S=/^0b[01]+$/i,C=/^0o[0-7]+$/i,I=parseInt;function w(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==y(e)}(e))return NaN;if(T(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=T(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=E(e);var n=S.test(e);return n||C.test(e)?I(e.slice(2),n?2:8):k.test(e)?NaN:+e}var j=function(){return d.Date.now()},M=Math.max,R=Math.min;function A(e,t,n){var r,a,i,o,s,l,c=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function b(t){var n=r,i=a;return r=a=void 0,c=t,o=e.apply(i,n)}function h(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function m(){var e=j();if(h(e))return f(e);s=setTimeout(m,function(e){var n=t-(e-l);return d?R(n,i-(e-c)):n}(e))}function f(e){return s=void 0,p&&r?b(e):(r=a=void 0,o)}function g(){var e=j(),n=h(e);if(r=arguments,a=this,l=e,n){if(void 0===s)return function(e){return c=e,s=setTimeout(m,t),u?b(e):o}(l);if(d)return clearTimeout(s),s=setTimeout(m,t),b(l)}return void 0===s&&(s=setTimeout(m,t)),o}return t=w(t)||0,T(n)&&(u=!!n.leading,i=(d="maxWait"in n)?M(w(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),g.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=a=s=void 0},g.flush=function(){return void 0===s?o:f(j())},g}const L=t,N=n,{Tabs:O}=r,{Tab:H}=r,{styled:$}=a,{Collapsible:q}=i,{color:P}=i,{PreviewPrompt:D}=i,{Purpose:z}=i,{UiLayout:F}=i;const J=$("div")({flexGrow:1,backgroundColor:P.background(),color:P.text(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"}}),K=$("div")(({theme:e})=>({backgroundColor:P.background(),color:P.text(),padding:e.spacing(2),"& blockquote":{background:"#f9f9f9",borderLeft:"5px solid #ccc",margin:"1.5em 10px",padding:".5em 10px"}})),U=$("div")({fontSize:"1.75rem"}),W=$("div")({fontSize:"1.5rem"}),B=$("div")({fontSize:"1.25rem"}),G=$(H)(({theme:e})=>({background:e.palette.common.white,fontSize:"inherit",fontFamily:"Roboto, sans-serif",opacity:.7,color:e.palette.common.black,"&.Mui-selected":{opacity:1,color:e.palette.common.black}}));class Q extends L.Component{constructor(...e){super(...e),Q.prototype.__init.call(this),Q.prototype.__init2.call(this),Q.prototype.__init3.call(this),Q.prototype.__init4.call(this)}__init(){this.state={activeTab:0}}__init2(){this.handleChange=(e,t)=>{this.setState(()=>({activeTab:t})),setTimeout(()=>{const e=new CustomEvent("pie-ui-passage-tabChanged",{detail:{tab:t}});window.dispatchEvent(e)})}}__init3(){this.handleKeyDown=(e,t)=>{const{key:n}=e,{tabs:r}=this.props;let a=-1;const i=r.findIndex(e=>e.id===t);switch(n){case"ArrowRight":a=(i+1)%r.length;break;case"ArrowLeft":a=(i-1+r.length)%r.length;break;case"Home":a=0;break;case"End":a=r.length-1;break;case"Enter":case" ":a=i}-1!==a&&(e.preventDefault(),e.stopPropagation(),this.handleChange(e,r[a].id),document.getElementById(`button-${r[a].id}`).focus())}}__init4(){this.parsedText=(e="")=>{const t=document.createElement("div");t.innerHTML=e.replace(/(<br\/>\n)/g,"<br/>");const n=t.querySelector("audio");if(n){const e=document.createElement("source");e.setAttribute("type","audio/mp3"),e.setAttribute("src",n.getAttribute("src")),n.removeAttribute("src"),n.appendChild(e)}return t.innerHTML}}renderInstructions(e,t=!1){if(!e)return;const n=L.createElement(D,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:e});return t?n:L.createElement(q,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},n)}renderTab(e,t){return L.createElement(K,{key:e.id,id:`tabpanel-${e.id}`,role:"tabpanel","aria-labelledby":`button-${e.id}`},this.renderInstructions(e.teacherInstructions,t),(e.title||e.subtitle)&&L.createElement("h2",null,e.title&&L.createElement(z,{purpose:"passage-title"},L.createElement(U,{dangerouslySetInnerHTML:{__html:this.parsedText(e.title)}})),e.subtitle&&L.createElement(z,{purpose:"passage-subtitle"},L.createElement(W,{dangerouslySetInnerHTML:{__html:this.parsedText(e.subtitle)}}))),e.author&&L.createElement(z,{purpose:"passage-author"},L.createElement(B,{className:"author",dangerouslySetInnerHTML:{__html:this.parsedText(e.author)}})),e.text&&L.createElement(z,{purpose:"passage-text"},L.createElement("div",{key:e.id,className:"text",dangerouslySetInnerHTML:{__html:this.parsedText(e.text)}})))}render(){const{model:e,tabs:t,disabledTabs:n}=this.props,{activeTab:r}=this.state;if(!function(e){let t,n=e[0],r=1;for(;r<e.length;){const a=e[r],i=e[r+1];if(r+=2,("optionalAccess"===a||"optionalCall"===a)&&null==n)return;"access"===a||"optionalAccess"===a?(t=n,n=i(n)):"call"!==a&&"optionalCall"!==a||(n=i((...e)=>n.call(t,...e)),t=void 0)}return n}([t,"optionalAccess",e=>e.length]))return;const{extraCSSRules:a}=e||{},i=(t||[]).find(e=>e.id===r);return L.createElement(F,{extraCSSRules:a},L.createElement(J,{className:"passages"},n||1===t.length?t.map(e=>this.renderTab(e,n)):L.createElement(L.Fragment,null,L.createElement(O,{sx:{position:"sticky",top:0,background:P.background(),color:P.text(),fontFamily:"Roboto, sans-serif","& .MuiTabs-indicator":{backgroundColor:"#f50057"}},value:r,onChange:this.handleChange},t.map(e=>L.createElement(G,{key:e.id,id:`button-${e.id}`,label:L.createElement(z,{purpose:"passage-label"},L.createElement("span",{dangerouslySetInnerHTML:{__html:this.parsedText(e.label)}})),value:e.id,tabIndex:r===e.id?0:-1,"aria-controls":`tabpanel-${e.id}`,"aria-selected":r===e.id,onKeyDown:t=>this.handleKeyDown(t,e.id)}))),i?this.renderTab(i,n):null)))}}Q.propTypes={tabs:N.arrayOf(N.shape({id:N.number.isRequired,label:N.string.isRequired,title:N.string.isRequired,subtitle:N.string,author:N.string,text:N.string.isRequired,teacherInstructions:N.string}).isRequired).isRequired,disabledTabs:N.bool,model:N.object};const V=t,X=o("pie-element:passage:print"),Y=(e,t)=>(e=>null!=e)(e)?e:t;class Z extends HTMLElement{constructor(){super(),this._model=null,this._options=null,this._session=[],this._root=null,this._rerender=A(()=>{if(this._model&&this._session){if(this._model.passages&&this._model.passages.length>0){const e=((e,t)=>{const n="instructor"===t.role,r=Y(e.teacherInstructionsEnabled,!0),a=Y(e.titleEnabled,!0),i=Y(e.authorEnabled,!1),o=Y(e.subtitleEnabled,!0),s=Y(e.textEnabled,!0);return e.passages.map((e,t)=>({id:t,teacherInstructions:Y(e.teacherInstructionsEnabled,r)&&n&&e.teacherInstructions||"",label:e.title||`Passage ${t+1}`,title:Y(e.titleEnabled,a)&&e.title||"",author:Y(e.authorEnabled,i)&&e.author||"",subtitle:Y(e.subtitleEnabled,o)&&e.subtitle||"",text:Y(e.textEnabled,s)&&e.text||""}))})(this._model,this._options),t=V.createElement(Q,{disabledTabs:!0,tabs:e});this._root||(this._root=s(this)),this._root.render(t)}}else X("skip")},50,{leading:!1,trailing:!0})}set model(e){this._model=e,this._rerender()}set options(e){this._options=e}connectedCallback(){}disconnectedCallback(){this._root&&this._root.unmount()}}export{Z as default};
1
+ import{_dll_react_dom as e,_dll_prop_types as t,_dll_react as n,_dll_mui__material_styles as r,_dll_mui__material as i,_dll_debug as o,_dll_mui__material_collapse as s}from"../../../@pie-lib/shared-module@^4.1.0/module/index.js";import{green as a,orange as l,red as c,indigo as p,pink as d}from"@mui/material/colors";import{_dll_pie_lib__math_rendering as u}from"../../../@pie-lib/math-rendering-module@^4.1.0/module/index.js";var h,m=e;h=m.createRoot,m.hydrateRoot;var f="object"==typeof global&&global&&global.Object===Object&&global,E="object"==typeof self&&self&&self.Object===Object&&self,g=f||E||Function("return this")(),b=g.Symbol,y=Object.prototype,v=y.hasOwnProperty,x=y.toString,C=b?b.toStringTag:void 0;var _=Object.prototype.toString;var k=b?b.toStringTag:void 0;function T(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":k&&k in Object(e)?function(e){var t=v.call(e,C),n=e[C];try{e[C]=void 0;var r=!0}catch(e){}var i=x.call(e);return r&&(t?e[C]=n:delete e[C]),i}(e):function(e){return _.call(e)}(e)}var R=/\s/;var S=/^\s+/;function O(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&R.test(e.charAt(t)););return t}(e)+1).replace(S,""):e}function A(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var N=/^[-+]0x[0-9a-f]+$/i,M=/^0b[01]+$/i,D=/^0o[0-7]+$/i,F=parseInt;function I(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&"[object Symbol]"==T(e)}(e))return NaN;if(A(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=A(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=O(e);var n=M.test(e);return n||D.test(e)?F(e.slice(2),n?2:8):N.test(e)?NaN:+e}var B=function(){return g.Date.now()},w=Math.max,L=Math.min;function z(e,t,n){var r,i,o,s,a,l,c=0,p=!1,d=!1,u=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var n=r,o=i;return r=i=void 0,c=t,s=e.apply(o,n)}function m(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=o}function f(){var e=B();if(m(e))return E(e);a=setTimeout(f,function(e){var n=t-(e-l);return d?L(n,o-(e-c)):n}(e))}function E(e){return a=void 0,u&&r?h(e):(r=i=void 0,s)}function g(){var e=B(),n=m(e);if(r=arguments,i=this,l=e,n){if(void 0===a)return function(e){return c=e,a=setTimeout(f,t),p?h(e):s}(l);if(d)return clearTimeout(a),a=setTimeout(f,t),h(l)}return void 0===a&&(a=setTimeout(f,t)),s}return t=I(t)||0,A(n)&&(p=!!n.leading,o=(d="maxWait"in n)?w(I(n.maxWait)||0,t):o,u="trailing"in n?!!n.trailing:u),g.cancel=function(){void 0!==a&&clearTimeout(a),c=0,r=l=i=a=void 0},g.flush=function(){return void 0===a?s:E(B())},g}const j=n,P=t,q=e=>"string"==typeof e?e:"number"==typeof e?`${e}px`:"30px",H=({size:e,children:t})=>{const n={height:e=q(e),width:e,display:"inline-block",position:"relative"};return j.createElement("div",{style:n},t)};H.propTypes={size:P.number,children:P.oneOfType([P.arrayOf(P.node),P.node]).isRequired};const $=n,U=t,Y=({size:e,children:t,sx:n})=>$.createElement(H,{size:e},$.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"0 0 44 40",style:{enableBackground:"new 0 0 44 40",...n}},t));Y.propTypes={size:U.oneOfType([U.string,U.number]),children:U.oneOfType([U.arrayOf(U.node),U.node]).isRequired,sx:U.object},U.string.isRequired;const W=({fill:e})=>$.createElement("polygon",{transform:"translate(2, 0)",points:"34.1,28.6 34.1,2.2 2,2.2 2,34.3 40.1,34.3",fill:e});W.propTypes={fill:U.string.isRequired};const K=({fill:e})=>$.createElement("path",{transform:"translate(1, 0)",d:"M31.2,29.1v-0.3c2.2-2.8,3.6-6.3,3.6-10.1c0-8.9-7.2-16.1-16.1-16.1c-8.8,0.1-16,7.3-16,16.2 s7.2,16.1,16.1,16.1h18.5L31.2,29.1z",fill:e});K.propTypes={fill:U.string.isRequired};const G=({fill:e})=>$.createElement("circle",{transform:"translate(-3,0)",cx:"23",cy:"20.4",r:"16",fill:e});G.propTypes={fill:U.string.isRequired};const V=({fill:e})=>$.createElement("rect",{x:"3.6",y:"4.1",width:"32",height:"32",fill:e});V.propTypes={fill:U.string.isRequired};const J=t,X=n;var Q=(e,t)=>{class n extends X.Component{static __initStatic(){this.propTypes={iconSet:J.oneOf(["emoji","check"]),shape:J.oneOf(["round","square"]),category:J.oneOf(["feedback",void 0]),open:J.bool,size:J.oneOfType([J.number,J.string]),fg:J.string,bg:J.string}}static __initStatic2(){this.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,size:30,fg:"#4aaf46",bg:"#f8ffe2"}}render(){const{iconSet:n,shape:r,category:i,open:o,size:s,fg:a,bg:l}=this.props,c="check"===n?X.createElement(e,{fill:a}):X.createElement(t,{fill:a}),p="check"===n?X.createElement(e,{fill:l}):X.createElement(t,{fill:l});return o?X.createElement(Y,{size:s},p):X.createElement(Y,{size:s},"feedback"===i?"round"===r?X.createElement(K,{fill:l}):X.createElement(W,{fill:l}):"round"===r?X.createElement(G,{fill:l}):X.createElement(V,{fill:l}),c)}}return n.__initStatic(),n.__initStatic2(),n};const Z=t,ee=n,te=({fill:e})=>ee.createElement("g",{transform:"translate(1, 0)"},ee.createElement("path",{d:"M24.7,22.1c-1.5,1.7-3.6,2.7-5.8,2.7s-4.5-1.1-5.8-2.7l-2.8,1.6c2,2.7,5.2,4.2,8.7,4.2 c3.4,0,6.6-1.6,8.7-4.2L24.7,22.1z",fill:e}),ee.createElement("rect",{x:"21.1",y:"13.1",width:"3.7",height:"4.7",fill:e}),ee.createElement("rect",{x:"12.7",y:"13.1",width:"3.7",height:"4.7",fill:e}));te.propTypes={fill:Z.string.isRequired};const ne=({fill:e,x:t=0,y:n=0})=>ee.createElement("polygon",{transform:`translate(${t}, ${n})`,points:"19.1,28.6 11.8,22.3 14.4,19.2 17.9,22.1 23.9,11.4 27.5,13.4",fill:e});ne.propTypes={fill:Z.string.isRequired,x:Z.number,y:Z.number};const re=Q(ne,te);re.propTypes={iconSet:Z.oneOf(["emoji","check"]),shape:Z.oneOf(["round","square"]),category:Z.oneOf(["feedback",void 0]),open:Z.bool,fg:Z.string,bg:Z.string,size:Z.oneOfType([Z.string,Z.number])},re.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#f8ffe2",size:30};const ie=t,{styled:oe}=r;ie.string.isRequired,ie.string.isRequired,ie.string.isRequired,ie.string.isRequired,ie.string.isRequired,oe("div")(({size:e})=>({width:e||"25px",height:e||"25px"})),ie.bool,ie.string;const se=t,ae=n,le=({fill:e})=>ae.createElement("g",{transform:"translate(0.5, 0.5)"},ae.createElement("rect",{x:"11",y:"17.3",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.852 19.2507)",width:"16.6",height:"3.7",fill:e}),ae.createElement("rect",{x:"17.4",y:"10.7",transform:"matrix(0.7071 -0.7071 0.7071 0.7071 -7.8175 19.209)",width:"3.7",height:"16.6",fill:e}));le.propTypes={fill:se.string.isRequired};const ce=({fill:e})=>ae.createElement("g",{transform:"translate(1,0)"},ae.createElement("rect",{x:"21",y:"12.9",width:"3.7",height:"4.7",fill:e}),ae.createElement("rect",{x:"12.7",y:"12.9",width:"3.7",height:"4.7",fill:e}),ae.createElement("rect",{x:"12.2",y:"22.5",width:"13",height:"3.3",fill:e}));ce.propTypes={fill:se.string.isRequired};const pe=Q(le,ce);pe.propTypes={iconSet:se.oneOf(["emoji","check"]),shape:se.oneOf(["round","square"]),category:se.oneOf(["feedback",void 0]),open:se.bool,fg:se.string,bg:se.string,size:se.oneOfType([se.string,se.number])},pe.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#fcb733",bg:"#fbf2e3",size:30};const de=t,ue=n,he=()=>{const e={fill:"none",stroke:"#BCE2FF",strokeWidth:2,strokeMiterlimit:10};return ue.createElement("g",null,ue.createElement("line",{style:e,x1:"-98",y1:"142",x2:"-114.6",y2:"142"}),ue.createElement("line",{style:e,x1:"-98",y1:"146.3",x2:"-114.6",y2:"146.3"}),ue.createElement("line",{style:e,x1:"-104",y1:"150.7",x2:"-114.6",y2:"150.7"}))},me=({children:e,size:t})=>ue.createElement(H,{size:t},ue.createElement("svg",{version:"1.1",viewBox:"-128 129 31 31",style:{enableBackground:"new -128 129 31 31"}},e));me.propTypes={children:de.oneOfType([de.arrayOf(de.node),de.node]).isRequired,size:de.number};const fe=()=>ue.createElement("g",null,ue.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),ue.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),ue.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),ue.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),ue.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#7FABC6"},width:"4.1",height:"4.1"}),ue.createElement("polygon",{style:{fill:"#7FABC6"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "})),Ee=()=>ue.createElement("g",null,ue.createElement("rect",{x:"-123.9",y:"135.3",style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),ue.createElement("polygon",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeLinejoin:"round",strokeMiterlimit:10},points:"-119.8,150.4 -119.8,142.2 -125,142.2 -125,144.9 -122.6,144.9 -122.6,150.4 -125.6,150.4 -125.6,153.2 -116.8,153.2 -116.8,150.4 "}),ue.createElement("rect",{x:"-124.7",y:"134.7",style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},width:"4.1",height:"4.1"}),ue.createElement("polygon",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10},points:"-120.6,149.8 -120.6,141.5 -125.8,141.5 -125.8,144.3 -123.3,144.3 -123.3,149.8 -126.4,149.8 -126.4,152.5 -117.6,152.5 -117.6,149.8 "}),ue.createElement("rect",{x:"-125.5",y:"134",style:{fill:"#1A9CFF"},width:"4.1",height:"4.1"}),ue.createElement("polygon",{style:{fill:"#1A9CFF"},points:"-121.4,149.1 -121.4,140.9 -126.5,140.9 -126.5,143.6 -124.1,143.6 -124.1,149.1 -127.1,149.1 -127.1,151.9 -118.4,151.9 -118.4,149.1 "}));class ge extends ue.Component{constructor(e){super(e)}render(){return!0===this.props.open?ue.createElement(me,null,ue.createElement(fe,null),ue.createElement(he,null)):ue.createElement(me,null,ue.createElement(Ee,null),ue.createElement(he,null))}}ge.propTypes={open:de.bool},ge.defaultProps={open:!1};const be=t,ye=n,ve=({fill:e})=>ye.createElement("path",{fill:e,d:"M-130.4,142.1c0-2.1,1.7-3.9,3.9-3.9c0.3,0,0.5,0,0.8,0.1c-0.6-0.8-1.5-1.3-2.6-1.3c-1.8,0-3.3,1.5-3.3,3.3c0,1.1,0.5,2,1.3,2.6C-130.4,142.6-130.4,142.4-130.4,142.1z"});ve.propTypes={fill:be.string};class xe extends ye.Component{static __initStatic(){this.propTypes={classes:be.object.isRequired,size:be.number}}render(){const{size:e}=this.props;return!0===this.props.open?ye.createElement(H,{size:e},ye.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 32"},ye.createElement("path",{fill:"#BCE2FF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),ye.createElement("path",{fill:"#BCE2FF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),ye.createElement(ve,{fill:"#1A9CFF"}))):ye.createElement(H,{size:e},ye.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-135 129 16 31"},ye.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-120.7,142.4c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-121.6,146-120.7,144.3-120.7,142.4z"}),ye.createElement("path",{fill:"#D0CAC5",stroke:"#E6E3E0",className:"st0",d:"M-124.4,154.3h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-123.6,153.9-123.9,154.3-124.4,154.3z"}),ye.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-121.3,141.8c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.2,145.3-121.3,143.7-121.3,141.8z"}),",",ye.createElement("path",{fill:"#B3ABA4",stroke:"#CDC7C2",className:"st1",d:"M-125,153.7h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.2,153.3-124.6,153.7-125,153.7z"}),ye.createElement("path",{fill:"#1A9CFF",d:"M-122,141.1c0-3.7-3.3-6.6-7.1-5.8c-2.4,0.5-4.3,2.4-4.7,4.8c-0.4,2.3,0.6,4.4,2.2,5.7c0.4,0.3,0.6,0.8,0.6,1.3v1.9h6.1v-1.9c0-0.5,0.2-1,0.6-1.3C-122.8,144.7-122,143-122,141.1z"}),ye.createElement("path",{fill:"#1A9CFF",d:"M-125.7,153h-4.5c-0.4,0-0.8-0.4-0.8-0.8v-1.6h6.1v1.6C-124.9,152.7-125.2,153-125.7,153z"}),ye.createElement(ve,{fill:"1A9CFF"})))}}xe.__initStatic(),xe.propTypes={open:be.bool},xe.defaultProps={open:!1};const Ce=t,_e=n,ke=({fill:e})=>_e.createElement("g",null,_e.createElement("rect",{x:"19.3",y:"10.3",width:"4.5",height:"12.7",fill:e}),_e.createElement("rect",{x:"19.3",y:"26.2",width:"4.5",height:"4.5",fill:e}));ke.propTypes={fill:Ce.string.isRequired};const Te=({fill:e})=>_e.createElement("polygon",{points:"14.8,4.5 5.6,13.8 5.6,27 14.8,36.5 28.1,36.5 37.6,27 37.6,13.8 28.1,4.5",fill:e});Te.propTypes={fill:Ce.string.isRequired};const Re=({fill:e})=>_e.createElement("g",null,_e.createElement("rect",{x:"23.8",y:"15",width:"3.5",height:"4.4",fill:e}),_e.createElement("rect",{x:"16",y:"15",width:"3.5",height:"4.4",fill:e}),_e.createElement("path",{d:"M24.2,27.1h-5.1c-0.8,0-1.5-0.7-1.5-1.5v0c0-0.8,0.7-1.5,1.5-1.5h5.1c0.8,0,1.5,0.7,1.5,1.5v0 C25.7,26.4,25,27.1,24.2,27.1z",fill:e}));Re.propTypes={fill:Ce.string.isRequired};class Se extends _e.Component{constructor(e){super(e);const{fg:t="#464146",bg:n="white"}=this.props;this.icons={check:_e.createElement(Y,null,_e.createElement(Te,{fill:n}),_e.createElement(ke,{fill:t})),emoji:_e.createElement(Y,null,_e.createElement(Te,{fill:n}),_e.createElement(Re,{fill:t})),feedback:{check:_e.createElement(Y,null,_e.createElement(Te,{fill:n}),_e.createElement(Re,{fill:t})),emoji:_e.createElement(Y,null,_e.createElement(Te,{fill:n}),_e.createElement(Re,{fill:t})),square:{check:_e.createElement(Y,null,_e.createElement(Te,{fill:n}),_e.createElement(ke,{fill:t})),emoji:_e.createElement(Y,null,_e.createElement(Te,{fill:n}),_e.createElement(Re,{fill:t})),open:{check:_e.createElement(Y,null,_e.createElement(ke,{fill:n})),emoji:_e.createElement(Y,null,_e.createElement(Re,{fill:n}))}}}}}render(){const{iconSet:e,category:t,shape:n,open:r}=this.props;return void 0===t?this.icons[e]:void 0===n?this.icons.feedback[e]:!0===r?this.icons.feedback.square.open[e]:this.icons.feedback.square[e]}}Se.propTypes={iconSet:Ce.oneOf(["emoji","check",void 0]),shape:Ce.oneOf(["square",void 0]),category:Ce.oneOf(["feedback",void 0]),open:Ce.bool,fg:Ce.string,bg:Ce.string},Se.defaultProps={iconSet:"check",shape:void 0,category:void 0,open:!1,fg:"#464146",bg:"white"};const Oe=t,Ae=n,Ne=({fill:e})=>Ae.createElement("g",{transform:"translate(0, 0)"},Ae.createElement("polygon",{points:"27.5,13.4 23.9,11.4 15.9,25.8 19.1,28.6",fill:e}),Ae.createElement("polygon",{points:"16.2,20.6 14.4,19.2 11.8,22.3 14.1,24.3",fill:e}));Ne.propTypes={fill:Oe.string.isRequired};const Me=({fill:e})=>Ae.createElement("g",{transform:"translate(2, 0)"},Ae.createElement("rect",{x:"20.6",y:"11.8",width:"4",height:"5",fill:e}),Ae.createElement("rect",{x:"11.5",y:"11.8",width:"4",height:"5",fill:e}),Ae.createElement("rect",{x:"10.9",y:"22.9",transform:"matrix(0.9794 -0.2019 0.2019 0.9794 -4.6237 4.1559)",width:"14.3",height:"3.7",fill:e}));Me.propTypes={fill:Oe.string.isRequired};const De=Q(Ne,Me);De.propTypes={iconSet:Oe.oneOf(["emoji","check"]),shape:Oe.oneOf(["round","square"]),category:Oe.oneOf(["feedback",void 0]),open:Oe.bool,fg:Oe.string,bg:Oe.string,size:Oe.oneOfType([Oe.string,Oe.number])},De.defaultProps={iconSet:"check",shape:"round",category:void 0,open:!1,fg:"#4aaf46",bg:"#c1e1ac",size:30};const Fe=t,Ie=n,Be=({fill:e})=>Ie.createElement("g",null,Ie.createElement("rect",{x:"-115",y:"136.7",width:"3",height:"3",fill:e}),Ie.createElement("polygon",{points:"-112,147.7 -112,141.7 -115.8,141.7 -115.8,143.7 -114,143.7 -114,147.7 -116.2,147.7 -116.2,149.7 -109.8,149.7 -109.8,147.7",fill:e}));Be.propTypes={fill:Fe.string.isRequired};const we=({fill:e})=>Ie.createElement("path",{d:"M-113,158.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105,158.5-113,158.5z M-113,130.5c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-105.6,130.5-113,130.5z",fill:e});we.propTypes={fill:Fe.string.isRequired};const Le=({fill:e="#FFFFFF"})=>Ie.createElement("g",null,Ie.createElement("path",{style:{fill:"#D0CAC5",stroke:"#E6E3E0",strokeWidth:.75,strokeMiterlimit:10},d:"M-111.7,160.9c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5C-96.2,154-103.1,160.9-111.7,160.9z"}),Ie.createElement("path",{style:{fill:"#B3ABA4",stroke:"#CDC7C2",strokeWidth:.5,strokeMiterlimit:10},d:"M-112,159.5c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-104,159.5-112,159.5z"}),Ie.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:e}));Le.propTypes={fill:Fe.string};const ze=({children:e,size:t})=>{const n=q(t),r={height:n,width:n,display:"inline-block",position:"relative"};return Ie.createElement("div",{style:r},Ie.createElement("svg",{preserveAspectRatio:"xMinYMin meet",viewBox:"-129 128 34 34"},e))};ze.propTypes={children:Fe.oneOfType([Fe.arrayOf(Fe.node),Fe.node]).isRequired,size:Fe.oneOfType([Fe.string,Fe.number])};class je extends Ie.Component{render(){const{iconSet:e,open:t,fg:n="#1a9cff",bg:r="#bce2ff",border:i="#bbe3fd"}=this.props,o=Ie.createElement(Be,{fill:n}),s={check:Ie.createElement(ze,{size:this.props.size},Ie.createElement(Le,null),o,Ie.createElement(we,{fill:i})),emoji:Ie.createElement(ze,{size:this.props.size},Ie.createElement(Le,null),o,Ie.createElement(we,{fill:i})),open:{check:Ie.createElement(ze,{size:this.props.size},Ie.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),Ie.createElement(Be,{fill:r}),Ie.createElement(we,{fill:"#FFFFFF"})),emoji:Ie.createElement(ze,{size:this.props.size},Ie.createElement("circle",{cx:"-113",cy:"144",r:"14",fill:"#FFFFFF"}),Ie.createElement(Be,{fill:r}),Ie.createElement(we,{fill:i}))}};return!0===t?s.open[e]:s[e]}}function Pe(){return Pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Pe.apply(null,arguments)}function qe(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}function He(e,t){return He=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},He(e,t)}function $e(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,He(e,t)}function Ue(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}je.propTypes={iconSet:Fe.oneOf(["emoji","check"]),open:Fe.bool,fg:Fe.string,bg:Fe.string,border:Fe.string,size:Fe.oneOfType([Fe.string,Fe.number])},je.defaultProps={iconSet:"check",open:!1,fg:"#1a9cff",bg:"#bce2ff",border:"#bbe3fd",size:30};var Ye=!1;var We=n.createContext(null),Ke=function(e){return e.scrollTop};const Ge=n,Ve=e;var Je="unmounted",Xe="exited",Qe="entering",Ze="entered",et="exiting",tt=function(e){function t(t,n){var r;r=e.call(this,t,n)||this;var i,o=n&&!n.isMounting?t.enter:t.appear;return r.appearStatus=null,t.in?o?(i=Xe,r.appearStatus=Qe):i=Ze:i=t.unmountOnExit||t.mountOnEnter?Je:Xe,r.state={status:i},r.nextCallback=null,r}$e(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===Je?{status:Xe}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(e){var t=null;if(e!==this.props){var n=this.state.status;this.props.in?n!==Qe&&n!==Ze&&(t=Qe):n!==Qe&&n!==Ze||(t=et)}this.updateStatus(!1,t)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var e,t,n,r=this.props.timeout;return e=t=n=r,null!=r&&"number"!=typeof r&&(e=r.exit,t=r.enter,n=void 0!==r.appear?r.appear:t),{exit:e,enter:t,appear:n}},n.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===Qe){if(this.props.unmountOnExit||this.props.mountOnEnter){var n=this.props.nodeRef?this.props.nodeRef.current:Ve.findDOMNode(this);n&&Ke(n)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Xe&&this.setState({status:Je})},n.performEnter=function(e){var t=this,n=this.props.enter,r=this.context?this.context.isMounting:e,i=this.props.nodeRef?[r]:[Ve.findDOMNode(this),r],o=i[0],s=i[1],a=this.getTimeouts(),l=r?a.appear:a.enter;!e&&!n||Ye?this.safeSetState({status:Ze},function(){t.props.onEntered(o)}):(this.props.onEnter(o,s),this.safeSetState({status:Qe},function(){t.props.onEntering(o,s),t.onTransitionEnd(l,function(){t.safeSetState({status:Ze},function(){t.props.onEntered(o,s)})})}))},n.performExit=function(){var e=this,t=this.props.exit,n=this.getTimeouts(),r=this.props.nodeRef?void 0:Ve.findDOMNode(this);t&&!Ye?(this.props.onExit(r),this.safeSetState({status:et},function(){e.props.onExiting(r),e.onTransitionEnd(n.exit,function(){e.safeSetState({status:Xe},function(){e.props.onExited(r)})})})):this.safeSetState({status:Xe},function(){e.props.onExited(r)})},n.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},n.setNextCallback=function(e){var t=this,n=!0;return this.nextCallback=function(r){n&&(n=!1,t.nextCallback=null,e(r))},this.nextCallback.cancel=function(){n=!1},this.nextCallback},n.onTransitionEnd=function(e,t){this.setNextCallback(t);var n=this.props.nodeRef?this.props.nodeRef.current:Ve.findDOMNode(this),r=null==e&&!this.props.addEndListener;if(n&&!r){if(this.props.addEndListener){var i=this.props.nodeRef?[this.nextCallback]:[n,this.nextCallback],o=i[0],s=i[1];this.props.addEndListener(o,s)}null!=e&&setTimeout(this.nextCallback,e)}else setTimeout(this.nextCallback,0)},n.render=function(){var e=this.state.status;if(e===Je)return null;var t=this.props,n=t.children;t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef;var r=qe(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Ge.createElement(We.Provider,{value:null},"function"==typeof n?n(e,r):Ge.cloneElement(Ge.Children.only(n),r))},t}(Ge.Component);function nt(){}tt.contextType=We,tt.propTypes={},tt.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:nt,onEntering:nt,onEntered:nt,onExit:nt,onExiting:nt,onExited:nt},tt.UNMOUNTED=Je,tt.EXITED=Xe,tt.ENTERING=Qe,tt.ENTERED=Ze,tt.EXITING=et;var rt=tt;const it=n;var ot=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return r=t,void((n=e).classList?n.classList.add(r):function(e,t){return e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")}(n,r)||("string"==typeof n.className?n.className=n.className+" "+r:n.setAttribute("class",(n.className&&n.className.baseVal||"")+" "+r)));var n,r})},st=function(e,t){return e&&t&&t.split(" ").forEach(function(t){return r=t,void((n=e).classList?n.classList.remove(r):"string"==typeof n.className?n.className=Ue(n.className,r):n.setAttribute("class",Ue(n.className&&n.className.baseVal||"",r)));var n,r})},at=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1];t.removeClasses(i,"exit"),t.addClass(i,o?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,n)},t.onEntering=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1]?"appear":"enter";t.addClass(i,o,"active"),t.props.onEntering&&t.props.onEntering(e,n)},t.onEntered=function(e,n){var r=t.resolveArguments(e,n),i=r[0],o=r[1]?"appear":"enter";t.removeClasses(i,o),t.addClass(i,o,"done"),t.props.onEntered&&t.props.onEntered(e,n)},t.onExit=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"appear"),t.removeClasses(n,"enter"),t.addClass(n,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var n=t.resolveArguments(e)[0];t.addClass(n,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var n=t.resolveArguments(e)[0];t.removeClasses(n,"exit"),t.addClass(n,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,n){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,n]},t.getClassNames=function(e){var n=t.props.classNames,r="string"==typeof n,i=r?""+(r&&n?n+"-":"")+e:n[e];return{baseClassName:i,activeClassName:r?i+"-active":n[e+"Active"],doneClassName:r?i+"-done":n[e+"Done"]}},t}$e(t,e);var n=t.prototype;return n.addClass=function(e,t,n){var r=this.getClassNames(t)[n+"ClassName"],i=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===n&&i&&(r+=" "+i),"active"===n&&e&&Ke(e),r&&(this.appliedClasses[t][n]=r,ot(e,r))},n.removeClasses=function(e,t){var n=this.appliedClasses[t],r=n.base,i=n.active,o=n.done;this.appliedClasses[t]={},r&&st(e,r),i&&st(e,i),o&&st(e,o)},n.render=function(){var e=this.props;e.classNames;var t=qe(e,["classNames"]);return it.createElement(rt,Pe({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(it.Component);at.defaultProps={classNames:""},at.propTypes={};var lt=at;const{Children:ct}=n,{cloneElement:pt}=n,{isValidElement:dt}=n;function ut(e,t){var n=Object.create(null);return e&&ct.map(e,function(e){return e}).forEach(function(e){n[e.key]=function(e){return t&&dt(e)?t(e):e}(e)}),n}function ht(e,t,n){return null!=n[t]?n[t]:e.props[t]}function mt(e,t,n){var r=ut(e.children),i=function(e,t){function n(n){return n in t?t[n]:e[n]}e=e||{},t=t||{};var r,i=Object.create(null),o=[];for(var s in e)s in t?o.length&&(i[s]=o,o=[]):o.push(s);var a={};for(var l in t){if(i[l])for(r=0;r<i[l].length;r++){var c=i[l][r];a[i[l][r]]=n(c)}a[l]=n(l)}for(r=0;r<o.length;r++)a[o[r]]=n(o[r]);return a}(t,r);return Object.keys(i).forEach(function(o){var s=i[o];if(dt(s)){var a=o in t,l=o in r,c=t[o],p=dt(c)&&!c.props.in;!l||a&&!p?l||!a||p?l&&a&&dt(c)&&(i[o]=pt(s,{onExited:n.bind(null,s),in:c.props.in,exit:ht(s,"exit",e),enter:ht(s,"enter",e)})):i[o]=pt(s,{in:!1}):i[o]=pt(s,{onExited:n.bind(null,s),in:!0,exit:ht(s,"exit",e),enter:ht(s,"enter",e)})}}),i}const ft=n;var Et=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},gt=function(e){function t(t,n){var r,i=(r=e.call(this,t,n)||this).handleExited.bind(function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(r));return r.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},r}$e(t,e);var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(e,t){var n,r,i=t.children,o=t.handleExited;return{children:t.firstRender?(n=e,r=o,ut(n.children,function(e){return pt(e,{onExited:r.bind(null,e),in:!0,appear:ht(e,"appear",n),enter:ht(e,"enter",n),exit:ht(e,"exit",n)})})):mt(e,i,o),firstRender:!1}},n.handleExited=function(e,t){var n=ut(this.props.children);e.key in n||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState(function(t){var n=Pe({},t.children);return delete n[e.key],{children:n}}))},n.render=function(){var e=this.props,t=e.component,n=e.childFactory,r=qe(e,["component","childFactory"]),i=this.state.contextValue,o=Et(this.state.children).map(n);return delete r.appear,delete r.enter,delete r.exit,null===t?ft.createElement(We.Provider,{value:i},o):ft.createElement(We.Provider,{value:i},ft.createElement(t,r,o))},t}(ft.Component);gt.propTypes={},gt.defaultProps={component:"div",childFactory:function(e){return e}};var bt=gt;const yt={TEXT:"black",DISABLED:"grey",DISABLED_SECONDARY:"#ABABAB",CORRECT:a[500],CORRECT_SECONDARY:a[50],CORRECT_TERTIARY:"#0EA449",CORRECT_WITH_ICON:"#087D38",INCORRECT:l[500],INCORRECT_SECONDARY:c[50],INCORRECT_WITH_ICON:"#BF0D00",MISSING:c[700],MISSING_WITH_ICON:"#6A78A1",PRIMARY:p[500],PRIMARY_LIGHT:p[200],PRIMARY_DARK:p[800],SECONDARY:d.A400,SECONDARY_LIGHT:d[200],SECONDARY_DARK:d[900],TERTIARY:"#146EB3",TERTIARY_LIGHT:"#D0E2F0",BACKGROUND:"rgba(255,255,255,0)",BACKGROUND_DARK:"#ECEDF1",DROPDOWN_BACKGROUND:"#E0E1E6",SECONDARY_BACKGROUND:"rgba(241,241,241,1)",BORDER:"#9A9A9A",BORDER_LIGHT:"#D1D1D1",BORDER_DARK:"#646464",BORDER_GRAY:"#7E8494",BLACK:"#000000",WHITE:"#ffffff",TRANSPARENT:"transparent",FOCUS_CHECKED:"#BBDEFB",FOCUS_CHECKED_BORDER:"#1565C0",FOCUS_UNCHECKED:"#E0E0E0",FOCUS_UNCHECKED_BORDER:"#757575",BLUE_GREY100:"#F3F5F7",BLUE_GREY300:"#C0C3CF",BLUE_GREY600:"#7E8494",BLUE_GREY900:"#152452",FADED_PRIMARY:"#DCDAFB",KEYPAD_BUTTON:"rgb(188, 194, 229)",KEYPAD_BUTTON_OPERATOR:"rgb(255, 159, 192)",KEYPAD_EMPTY_PLACEHOLDER:"rgba(245, 0, 87, 0.4)",KEYPAD_BUTTON_HOVER:"rgb(214, 218, 239)",KEYPAD_BUTTON_OPERATOR_HOVER:"rgb(255, 197, 217)",BUTTON_BORDER:"rgba(0, 0, 0, 0.23)",BUTTON_HOVER_BG:"rgba(0, 0, 0, 0.08)"};Object.freeze(yt);const vt=(xt="pie",(...e)=>{const t=e.pop();return e.reduceRight((e,t)=>`var(--${xt}-${t}, ${e})`,t)});var xt;const Ct=()=>vt("text",yt.TEXT),_t=()=>vt("background",yt.BACKGROUND),kt=n,Tt=t,{styled:Rt}=r,St=Rt("div")({transformOrigin:"0% 0px 0px",width:"100%",display:"block",overflow:"hidden","&.incorrect":{color:"#946202"}}),Ot=Rt("div")({WebkitFontSmoothing:"antialiased",backgroundColor:`var(--feedback-bg-color, ${vt("disabled",yt.DISABLED)})`,borderRadius:"4px",lineHeight:"25px",margin:"0px",padding:"10px",verticalAlign:"middle",color:"var(--feedback-color, white)","&.correct":{backgroundColor:`var(--feedback-correct-bg-color, ${vt("correct",yt.CORRECT)})`},"&.incorrect":{backgroundColor:`var(--feedback-incorrect-bg-color, ${vt("incorrect",yt.INCORRECT)})`}}),At=Rt("div")({"&.feedback-enter":{height:"1px"},"&.feedback-enter-active":{height:"45px",transition:"height 500ms"},"&.feedback-exit":{height:"45px"},"&.feedback-exit-active":{height:"1px",transition:"height 200ms"}});class Nt extends kt.Component{constructor(...e){super(...e),Nt.prototype.__init.call(this)}static __initStatic(){this.propTypes={correctness:Tt.string,feedback:Tt.string}}__init(){this.nodeRef=kt.createRef()}renderFeedback(){const{correctness:e,feedback:t}=this.props;return e&&t?kt.createElement(lt,{key:"hasFeedback",nodeRef:this.nodeRef,timeout:{enter:500,exit:200},classNames:"feedback"},kt.createElement(At,{ref:this.nodeRef},kt.createElement(St,null,kt.createElement(Ot,{className:e,dangerouslySetInnerHTML:{__html:t}})))):null}render(){return kt.createElement("div",null,kt.createElement(bt,null,this.renderFeedback()))}}Nt.__initStatic();const Mt=n,Dt=t,{Popover:Ft}=i,{styled:It}=r,Bt=o("pie-libs:render-ui:response-indicators"),wt=It("div")(({hasFeedback:e})=>({cursor:e?"pointer":"default"})),Lt=It(Ft)({cursor:"pointer"}),zt=It("div")({padding:"0",borderRadius:"4px"}),jt=(e,t)=>{class n extends Mt.Component{constructor(e){super(e),n.prototype.__init.call(this),n.prototype.__init2.call(this),this.state={}}__init(){this.handlePopoverOpen=e=>{Bt("[handlePopoverOpen]",e.target),this.setState({anchorEl:e.target})}}__init2(){this.handlePopoverClose=()=>{this.setState({anchorEl:null})}}render(){const{feedback:n}=this.props,{anchorEl:r}=this.state;return Mt.createElement(wt,{hasFeedback:!!n},Mt.createElement("span",{ref:e=>this.icon=e,onClick:this.handlePopoverOpen},Mt.createElement(e,null)),n&&Mt.createElement(Lt,{PaperComponent:zt,open:!!r,anchorEl:r,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},onClose:this.handlePopoverClose},Mt.createElement(Nt,{feedback:n,correctness:t})))}}return n.propTypes={feedback:Dt.string},n};jt(re,"correct"),jt(pe,"incorrect"),jt(De,"partially-correct"),jt(Se,"nothing-submitted");const Pt=n,{styled:qt}=r,Ht=s,$t=t,{renderMath:Ut}=u,Yt=qt("span")(({theme:e})=>({color:e.palette.primary.light,borderBottom:`1px dotted ${e.palette.primary.light}`,cursor:"pointer"})),Wt=qt(Ht)(({theme:e})=>({paddingTop:e.spacing(2)}));class Kt extends Pt.Component{constructor(...e){super(...e),Kt.prototype.__init.call(this),Kt.prototype.__init2.call(this)}static __initStatic(){this.propTypes={className:$t.string,children:$t.object,labels:$t.shape({visible:$t.string,hidden:$t.string})}}static __initStatic2(){this.defaultProps={labels:{}}}__init(){this.state={expanded:!1}}__init2(){this.toggleExpanded=()=>{this.setState(e=>({expanded:!e.expanded}))}}componentDidMount(){Ut(this.root)}componentDidUpdate(){Ut(this.root)}render(){const{labels:e,children:t,className:n}=this.props,r=this.state.expanded?e.visible||"Hide":e.hidden||"Show";return Pt.createElement("div",{className:n,ref:e=>this.root=e},Pt.createElement("div",{onClick:this.toggleExpanded},Pt.createElement(Yt,null,r)),Pt.createElement(Wt,{in:this.state.expanded,timeout:{enter:225,exit:195},unmountOnExit:!0},t))}}Kt.__initStatic(),Kt.__initStatic2();const{Button:Gt}=i,{styled:Vt}=r;Vt("div")({display:"flex",flexDirection:"column"}),Vt("div")({display:"flex",alignItems:"center",justifyContent:"center"}),Vt("div")(({theme:e})=>({width:"24px",height:"24px",color:"gray",marginRight:e.spacing(1),display:"flex",alignItems:"center"})),Vt(Gt)(({theme:e})=>({display:"flex",alignItems:"center",marginLeft:e.spacing(3),marginRight:e.spacing(3)}));const Jt=n,{createTheme:Xt}=r,{styled:Qt}=r,{StyledEngineProvider:Zt}=r,{ThemeProvider:en}=r,tn=t;const nn=Xt({typography:{fontFamily:"inherit"},palette:{action:{disabled:"rgba(0, 0, 0, 0.54);"}},components:{MuiTypography:{styleOverrides:{root:{fontFamily:"inherit"}}},MuiButton:{styleOverrides:{contained:{backgroundColor:"#e0e0e0",color:"#000000","&:hover":{backgroundColor:"#bdbdbd"}}}}}}),rn=Qt("div")({"& table, th, td":{fontSize:"inherit"}});class on extends Jt.Component{static __initStatic(){this.propTypes={className:tn.string,children:tn.array,extraCSSRules:tn.shape({names:tn.arrayOf(tn.string),rules:tn.string}),fontSizeFactor:tn.number}}static __initStatic2(){this.defaultProps={extraCSSRules:{},fontSizeFactor:1}}constructor(e){super(e),this.classesSheet=document.createElement("style")}computeStyle(e){const t=e=>parseFloat(getComputedStyle(e).fontSize),n=t(document.documentElement),r=t(document.body),i=Math.max(n,r),o=null!=e&&"number"==typeof e?e:1;return 1!==o?{fontSize:i*o+"px"}:null}render(){const{children:e,className:t,fontSizeFactor:n,...r}=this.props,{extraCSSRules:i,...o}=r,s=this.computeStyle(n);return Jt.createElement(Zt,{injectFirst:!0},Jt.createElement(en,{theme:nn},function(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}([i,"optionalAccess",e=>e.rules])?Jt.createElement("style",{dangerouslySetInnerHTML:{__html:`.extraCSSRules { ${i.rules} }`}}):null,Jt.createElement(rn,{className:`${t} extraCSSRules`,...o,...s&&{style:s}},e)))}}on.__initStatic(),on.__initStatic2();const sn=n,{styled:an}=r,ln=t,cn=an(on)({display:"flex",flexDirection:"column",position:"relative"});class pn extends sn.Component{static __initStatic(){this.propTypes={ariaLabel:ln.string,children:ln.oneOfType([ln.arrayOf(ln.node),ln.node]).isRequired,role:ln.string,extraCSSRules:ln.shape({names:ln.arrayOf(ln.string),rules:ln.string}),fontSizeFactor:ln.number}}render(){const{children:e,ariaLabel:t,role:n,extraCSSRules:r,fontSizeFactor:i,classes:o}=this.props,s=t?{"aria-label":t,role:n}:{};return sn.createElement(cn,{...s,extraCSSRules:r,fontSizeFactor:i,classes:o},e)}}pn.__initStatic();const dn=n,un=t;class hn extends dn.Component{static __initStatic(){this.propTypes={tag:un.string,className:un.string,html:un.string}}static __initStatic2(){this.defaultProps={tag:"div",html:""}}render(){const{tag:e,className:t,html:n}=this.props,r=e||"div";return dn.createElement(r,{ref:e=>this.node=e,className:t,dangerouslySetInnerHTML:{__html:n}})}}hn.__initStatic(),hn.__initStatic2();const{InputLabel:mn}=i,{FormControl:fn}=i,En=t,{styled:gn}=r;gn(fn)(({theme:e})=>({margin:0,padding:0,flex:"1 0 auto",minWidth:e.spacing(4)})),gn(mn)(()=>({fontSize:"inherit",whiteSpace:"nowrap",margin:0,padding:0,alignSelf:"flex-start",position:"absolute",top:0,left:0,transformOrigin:"top left",pointerEvents:"none","&.MuiInputLabel-shrink":{transform:"scale(0.75) translate(0, -0.75em)"},"&:not(.MuiInputLabel-shrink)":{transform:"translate(0, 0)"}})),En.oneOfType([En.string,En.object]).isRequired,En.string,En.oneOfType([En.arrayOf(En.node),En.node]).isRequired;const bn=n,{Component:yn}=n,{styled:vn}=r,xn=t,{renderMath:Cn}=u,_n=vn("div")(({theme:e,tagName:t})=>({"&:not(.MathJax) > table":{borderCollapse:"collapse"},"&:not(.MathJax) > table:has(tbody tr > th:first-child):not(:has(tbody tr > td:first-child)) tbody td:nth-child(even)":{backgroundColor:"#f6f8fa",color:e.palette.common.black},"&:not(.MathJax) > table:has(tbody tr > td:first-child) tbody tr:nth-child(even) td":{backgroundColor:"#f6f8fa",color:e.palette.common.black},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"},"&:not(.MathJax) > table td > p.kds-indent":{textAlign:"initial"},"&.prompt":{verticalAlign:"middle",color:Ct()},"&.legend":{width:"100%",fontSize:"inherit !important"},"&.rationale":{paddingLeft:e.spacing(4),paddingBottom:e.spacing(1)},"&.prompt-label":{color:`${Ct()} !important`,display:"flex",flexDirection:"column",verticalAlign:"middle",cursor:"pointer","& > p":{margin:"0 0 0 0 !important"}}})),kn=/\\embed\{newLine\}\[\]/g;class Tn extends yn{constructor(...e){super(...e),Tn.prototype.__init.call(this)}static __initStatic(){this.propTypes={prompt:xn.string,tagName:xn.string,className:xn.string,onClick:xn.func,defaultClassName:xn.string,autoplayAudioEnabled:xn.bool,customAudioButton:{playImage:xn.string,pauseImage:xn.string}}}static __initStatic2(){this.defaultProps={onClick:()=>{}}}__init(){this.parsedText=e=>{const{customAudioButton:t}=this.props,n=document.createElement("div");n.innerHTML=e;const r=n.querySelector("audio");if(r){const e=document.createElement("source");if(e.setAttribute("type","audio/mp3"),e.setAttribute("src",r.getAttribute("src")),r.removeAttribute("src"),r.setAttribute("id","pie-prompt-audio-player"),r.appendChild(e),t){r.style.display="none";const e=document.createElement("div");e.id="play-audio-button",Object.assign(e.style,{cursor:"pointer",display:"block",width:"128px",height:"128px",backgroundImage:`url(${t.pauseImage})`,backgroundSize:"cover",borderRadius:"50%",border:"1px solid #326295"}),r.parentNode.insertBefore(e,r)}}return n.innerHTML}}addCustomAudioButtonControls(){const{autoplayAudioEnabled:e,customAudioButton:t}=this.props,n=document.getElementById("play-audio-button"),r=document.getElementById("pie-prompt-audio-player");if(e&&r&&r.play().then(()=>{n&&t&&r.addEventListener("ended",o)}).catch(e=>{console.error("Error playing audio",e)}),!n||!r||!t)return;const i=()=>{r.paused&&(n.style.backgroundImage.includes(t.pauseImage)||r.play())},o=()=>{n.style.backgroundImage=`url(${t.playImage})`},s=()=>{Object.assign(n.style,{backgroundImage:`url(${t.pauseImage})`,border:"1px solid #ccc"})},a=()=>{Object.assign(n.style,{backgroundImage:`url(${t.playImage})`,border:"1px solid #326295"})};n.addEventListener("click",i),r.addEventListener("play",s),r.addEventListener("pause",a),r.addEventListener("ended",o),this._handlePlayClick=i,this._handleAudioPlay=s,this._handleAudioPause=a,this._handleAudioEnded=o}removeCustomAudioButtonListeners(){const e=document.getElementById("play-audio-button"),t=document.querySelector("audio");e&&t&&(e.removeEventListener("click",this._handlePlayClick),t.removeEventListener("play",this._handleAudioPlay),t.removeEventListener("pause",this._handleAudioPause),t.removeEventListener("ended",this._handleAudioEnded))}componentDidMount(){this.alignImages(),this.addCustomAudioButtonControls(),this.setupMathRendering()}componentDidUpdate(e){this.alignImages(),e.prompt!==this.props.prompt&&this.renderMathContent()}componentWillUnmount(){this.removeCustomAudioButtonListeners()}setupMathRendering(){this.renderMathContent()}renderMathContent(){const e=document.getElementById("preview-prompt");e&&"function"==typeof Cn&&Cn(e)}alignImages(){document.querySelectorAll("#preview-prompt").forEach(e=>{const t=e.getElementsByTagName("img");if(t&&t.length)for(let e of t)if(e.attributes&&e.attributes.alignment&&e.attributes.alignment.value){const t=e.attributes.alignment.value,n="center"===t?"center":"right"===t?"flex-end":"flex-start",r=e.parentElement;if("DIV"===r.tagName&&"flex"===r.style.display&&"100%"===r.style.width)r.style.justifyContent=n;else{const t=document.createElement("div");t.style.display="flex",t.style.width="100%",t.style.justifyContent=n;const i=e.cloneNode(!0);t.appendChild(i),r.replaceChild(t,e)}}})}render(){const{prompt:e,tagName:t,className:n,onClick:r,defaultClassName:i}=this.props,o=`${n||""} ${i||""} ${"legend"===t?"legend":""}`.trim();return bn.createElement(_n,{as:t||"div",id:"preview-prompt",onClick:r,className:o,tagName:t,dangerouslySetInnerHTML:{__html:this.parsedText(e||"").replace(kn,"\\newline ")}})}}Tn.__initStatic(),Tn.__initStatic2();const Rn=t;Rn.node,Rn.bool;const Sn=t,On=n,An=e=>On.createElement(On.Fragment,null,On.Children.map(e.children,t=>On.cloneElement(t,{"data-pie-purpose":e.purpose})));An.propTypes={children:Sn.node,purpose:Sn.string},"undefined"!=typeof window&&new DOMParser,"undefined"!=typeof window&&new DOMParser;const Nn=n,Mn=t,{Tabs:Dn}=i,{Tab:Fn}=i,{styled:In}=r;const Bn=In("div")({flexGrow:1,backgroundColor:_t(),color:Ct(),"&:not(.MathJax) table":{borderCollapse:"collapse"},"&:not(.MathJax) table td, &:not(.MathJax) table th":{padding:".6em 1em",textAlign:"left"}}),wn=In("div")(({theme:e})=>({backgroundColor:_t(),color:Ct(),padding:e.spacing(2),"& blockquote":{background:"#f9f9f9",borderLeft:"5px solid #ccc",margin:"1.5em 10px",padding:".5em 10px"}})),Ln=In("div")({fontSize:"1.75rem"}),zn=In("div")({fontSize:"1.5rem"}),jn=In("div")({fontSize:"1.25rem"}),Pn=In(Fn)(({theme:e})=>({background:e.palette.common.white,fontSize:"inherit",fontFamily:"Roboto, sans-serif",opacity:.7,color:e.palette.common.black,"&.Mui-selected":{opacity:1,color:e.palette.common.black}}));class qn extends Nn.Component{constructor(...e){super(...e),qn.prototype.__init.call(this),qn.prototype.__init2.call(this),qn.prototype.__init3.call(this),qn.prototype.__init4.call(this)}__init(){this.state={activeTab:0}}__init2(){this.handleChange=(e,t)=>{this.setState(()=>({activeTab:t})),setTimeout(()=>{const e=new CustomEvent("pie-ui-passage-tabChanged",{detail:{tab:t}});window.dispatchEvent(e)})}}__init3(){this.handleKeyDown=(e,t)=>{const{key:n}=e,{tabs:r}=this.props;let i=-1;const o=r.findIndex(e=>e.id===t);switch(n){case"ArrowRight":i=(o+1)%r.length;break;case"ArrowLeft":i=(o-1+r.length)%r.length;break;case"Home":i=0;break;case"End":i=r.length-1;break;case"Enter":case" ":i=o}-1!==i&&(e.preventDefault(),e.stopPropagation(),this.handleChange(e,r[i].id),document.getElementById(`button-${r[i].id}`).focus())}}__init4(){this.parsedText=(e="")=>{const t=document.createElement("div");t.innerHTML=e.replace(/(<br\/>\n)/g,"<br/>");const n=t.querySelector("audio");if(n){const e=document.createElement("source");e.setAttribute("type","audio/mp3"),e.setAttribute("src",n.getAttribute("src")),n.removeAttribute("src"),n.appendChild(e)}return t.innerHTML}}renderInstructions(e,t=!1){if(!e)return;const n=Nn.createElement(Tn,{tagName:"div",className:"prompt",defaultClassName:"teacher-instructions",prompt:e});return t?n:Nn.createElement(Kt,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},n)}renderTab(e,t){return Nn.createElement(wn,{key:e.id,id:`tabpanel-${e.id}`,role:"tabpanel","aria-labelledby":`button-${e.id}`},this.renderInstructions(e.teacherInstructions,t),(e.title||e.subtitle)&&Nn.createElement("h2",null,e.title&&Nn.createElement(An,{purpose:"passage-title"},Nn.createElement(Ln,{dangerouslySetInnerHTML:{__html:this.parsedText(e.title)}})),e.subtitle&&Nn.createElement(An,{purpose:"passage-subtitle"},Nn.createElement(zn,{dangerouslySetInnerHTML:{__html:this.parsedText(e.subtitle)}}))),e.author&&Nn.createElement(An,{purpose:"passage-author"},Nn.createElement(jn,{className:"author",dangerouslySetInnerHTML:{__html:this.parsedText(e.author)}})),e.text&&Nn.createElement(An,{purpose:"passage-text"},Nn.createElement("div",{key:e.id,className:"text",dangerouslySetInnerHTML:{__html:this.parsedText(e.text)}})))}render(){const{model:e,tabs:t,disabledTabs:n}=this.props,{activeTab:r}=this.state;if(!function(e){let t,n=e[0],r=1;for(;r<e.length;){const i=e[r],o=e[r+1];if(r+=2,("optionalAccess"===i||"optionalCall"===i)&&null==n)return;"access"===i||"optionalAccess"===i?(t=n,n=o(n)):"call"!==i&&"optionalCall"!==i||(n=o((...e)=>n.call(t,...e)),t=void 0)}return n}([t,"optionalAccess",e=>e.length]))return;const{extraCSSRules:i}=e||{},o=(t||[]).find(e=>e.id===r);return Nn.createElement(on,{extraCSSRules:i},Nn.createElement(Bn,{className:"passages"},n||1===t.length?t.map(e=>this.renderTab(e,n)):Nn.createElement(Nn.Fragment,null,Nn.createElement(Dn,{sx:{position:"sticky",top:0,background:_t(),color:Ct(),fontFamily:"Roboto, sans-serif","& .MuiTabs-indicator":{backgroundColor:"#f50057"}},value:r,onChange:this.handleChange},t.map(e=>Nn.createElement(Pn,{key:e.id,id:`button-${e.id}`,label:Nn.createElement(An,{purpose:"passage-label"},Nn.createElement("span",{dangerouslySetInnerHTML:{__html:this.parsedText(e.label)}})),value:e.id,tabIndex:r===e.id?0:-1,"aria-controls":`tabpanel-${e.id}`,"aria-selected":r===e.id,onKeyDown:t=>this.handleKeyDown(t,e.id)}))),o?this.renderTab(o,n):null)))}}qn.propTypes={tabs:Mn.arrayOf(Mn.shape({id:Mn.number.isRequired,label:Mn.string.isRequired,title:Mn.string.isRequired,subtitle:Mn.string,author:Mn.string,text:Mn.string.isRequired,teacherInstructions:Mn.string}).isRequired).isRequired,disabledTabs:Mn.bool,model:Mn.object};const Hn=n,$n=o("pie-element:passage:print"),Un=(e,t)=>(e=>null!=e)(e)?e:t;class Yn extends HTMLElement{constructor(){super(),this._model=null,this._options=null,this._session=[],this._root=null,this._rerender=z(()=>{if(this._model&&this._session){if(this._model.passages&&this._model.passages.length>0){const e=((e,t)=>{const n="instructor"===t.role,r=Un(e.teacherInstructionsEnabled,!0),i=Un(e.titleEnabled,!0),o=Un(e.authorEnabled,!1),s=Un(e.subtitleEnabled,!0),a=Un(e.textEnabled,!0);return e.passages.map((e,t)=>({id:t,teacherInstructions:Un(e.teacherInstructionsEnabled,r)&&n&&e.teacherInstructions||"",label:e.title||`Passage ${t+1}`,title:Un(e.titleEnabled,i)&&e.title||"",author:Un(e.authorEnabled,o)&&e.author||"",subtitle:Un(e.subtitleEnabled,s)&&e.subtitle||"",text:Un(e.textEnabled,a)&&e.text||""}))})(this._model,this._options),t=Hn.createElement(qn,{disabledTabs:!0,tabs:e});this._root||(this._root=h(this)),this._root.render(t)}}else $n("skip")},50,{leading:!1,trailing:!0})}set model(e){this._model=e,this._rerender()}set options(e){this._options=e}connectedCallback(){}disconnectedCallback(){this._root&&this._root.unmount()}}export{Yn as default};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/passage",
3
3
  "repository": "pie-framework/pie-elements",
4
- "version": "6.2.0-next.6",
4
+ "version": "6.2.0-next.8",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -15,12 +15,12 @@
15
15
  "@mui/material": "^7.3.4",
16
16
  "@pie-framework/pie-player-events": "^0.1.0",
17
17
  "@pie-lib/math-rendering": "4.2.0-next.3",
18
- "@pie-lib/render-ui": "5.2.0-next.7",
18
+ "@pie-lib/render-ui": "5.2.0-next.8",
19
19
  "prop-types": "^15.8.1",
20
20
  "react": "18.3.1",
21
21
  "react-dom": "18.3.1"
22
22
  },
23
- "gitHead": "e9c9eb021e31f961170c60e147b17fc6a9f56957",
23
+ "gitHead": "8c88ef381fb968e335518ffdc7f37790859ee415",
24
24
  "scripts": {
25
25
  "postpublish": "../../scripts/postpublish"
26
26
  },