@khanacademy/math-input 0.3.2 → 0.5.0
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 +8 -0
- package/README.md +1 -1
- package/{build/math-input.css → dist/es/index.css} +0 -150
- package/dist/es/index.js +2 -0
- package/dist/es/index.js.map +1 -0
- package/dist/index.css +586 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.flow +2 -0
- package/dist/index.js.map +1 -0
- package/dist/strings.js +71 -0
- package/index.html +20 -0
- package/less/echo.less +56 -0
- package/less/main.less +5 -0
- package/less/overrides.less +129 -0
- package/less/popover.less +22 -0
- package/less/tabbar.less +6 -0
- package/package.json +38 -70
- package/src/actions/index.js +57 -0
- package/src/components/__tests__/gesture-state-machine_test.js +437 -0
- package/src/components/__tests__/node-manager_test.js +89 -0
- package/src/components/__tests__/two-page-keypad_test.js +42 -0
- package/src/components/app.js +73 -0
- package/src/components/common-style.js +47 -0
- package/src/components/compute-layout-parameters.js +157 -0
- package/src/components/corner-decal.js +56 -0
- package/src/components/echo-manager.js +160 -0
- package/src/components/empty-keypad-button.js +49 -0
- package/src/components/expression-keypad.js +323 -0
- package/src/components/fraction-keypad.js +176 -0
- package/src/components/gesture-manager.js +226 -0
- package/src/components/gesture-state-machine.js +283 -0
- package/src/components/icon.js +74 -0
- package/src/components/iconography/arrow.js +22 -0
- package/src/components/iconography/backspace.js +29 -0
- package/src/components/iconography/cdot.js +29 -0
- package/src/components/iconography/cos.js +30 -0
- package/src/components/iconography/cube-root.js +36 -0
- package/src/components/iconography/dismiss.js +25 -0
- package/src/components/iconography/divide.js +34 -0
- package/src/components/iconography/down.js +16 -0
- package/src/components/iconography/equal.js +33 -0
- package/src/components/iconography/exp-2.js +29 -0
- package/src/components/iconography/exp-3.js +29 -0
- package/src/components/iconography/exp.js +29 -0
- package/src/components/iconography/frac.js +44 -0
- package/src/components/iconography/geq.js +33 -0
- package/src/components/iconography/gt.js +33 -0
- package/src/components/iconography/index.js +45 -0
- package/src/components/iconography/jump-into-numerator.js +41 -0
- package/src/components/iconography/jump-out-base.js +30 -0
- package/src/components/iconography/jump-out-denominator.js +41 -0
- package/src/components/iconography/jump-out-exponent.js +30 -0
- package/src/components/iconography/jump-out-numerator.js +41 -0
- package/src/components/iconography/jump-out-parentheses.js +33 -0
- package/src/components/iconography/left-paren.js +33 -0
- package/src/components/iconography/left.js +16 -0
- package/src/components/iconography/leq.js +33 -0
- package/src/components/iconography/ln.js +29 -0
- package/src/components/iconography/log-n.js +29 -0
- package/src/components/iconography/log.js +29 -0
- package/src/components/iconography/lt.js +33 -0
- package/src/components/iconography/minus.js +32 -0
- package/src/components/iconography/neq.js +33 -0
- package/src/components/iconography/parens.js +33 -0
- package/src/components/iconography/percent.js +49 -0
- package/src/components/iconography/period.js +26 -0
- package/src/components/iconography/plus.js +32 -0
- package/src/components/iconography/radical.js +36 -0
- package/src/components/iconography/right-paren.js +33 -0
- package/src/components/iconography/right.js +16 -0
- package/src/components/iconography/sin.js +30 -0
- package/src/components/iconography/sqrt.js +32 -0
- package/src/components/iconography/tan.js +30 -0
- package/src/components/iconography/times.js +33 -0
- package/src/components/iconography/up.js +16 -0
- package/src/components/input/__tests__/context-tracking_test.js +177 -0
- package/src/components/input/__tests__/math-wrapper.jsx +33 -0
- package/src/components/input/__tests__/mathquill_test.js +747 -0
- package/src/components/input/cursor-contexts.js +29 -0
- package/src/components/input/cursor-handle.js +137 -0
- package/src/components/input/drag-listener.js +75 -0
- package/src/components/input/math-input.js +924 -0
- package/src/components/input/math-wrapper.js +959 -0
- package/src/components/input/scroll-into-view.js +72 -0
- package/src/components/keypad/button-assets.js +492 -0
- package/src/components/keypad/button.js +106 -0
- package/src/components/keypad/button.stories.js +27 -0
- package/src/components/keypad/index.js +64 -0
- package/src/components/keypad/keypad-page-items.js +106 -0
- package/src/components/keypad/keypad-pages.stories.js +32 -0
- package/src/components/keypad/keypad.stories.js +35 -0
- package/src/components/keypad/numeric-input-page.js +100 -0
- package/src/components/keypad/pre-algebra-page.js +98 -0
- package/src/components/keypad/trigonometry-page.js +90 -0
- package/src/components/keypad-button.js +366 -0
- package/src/components/keypad-container.js +303 -0
- package/src/components/keypad.js +154 -0
- package/src/components/many-keypad-button.js +44 -0
- package/src/components/math-icon.js +65 -0
- package/src/components/multi-symbol-grid.js +182 -0
- package/src/components/multi-symbol-popover.js +59 -0
- package/src/components/navigation-pad.js +139 -0
- package/src/components/node-manager.js +129 -0
- package/src/components/popover-manager.js +76 -0
- package/src/components/popover-state-machine.js +173 -0
- package/src/components/prop-types.js +82 -0
- package/src/components/provided-keypad.js +99 -0
- package/src/components/styles.js +38 -0
- package/src/components/svg-icon.js +25 -0
- package/src/components/tabbar/__tests__/tabbar_test.js +65 -0
- package/src/components/tabbar/icons.js +69 -0
- package/src/components/tabbar/item.js +138 -0
- package/src/components/tabbar/tabbar.js +61 -0
- package/src/components/tabbar/tabbar.stories.js +60 -0
- package/src/components/tabbar/types.js +3 -0
- package/src/components/text-icon.js +52 -0
- package/src/components/touchable-keypad-button.js +146 -0
- package/src/components/two-page-keypad.js +99 -0
- package/src/components/velocity-tracker.js +76 -0
- package/src/components/z-indexes.js +9 -0
- package/src/consts.js +74 -0
- package/src/data/key-configs.js +349 -0
- package/src/data/keys.js +72 -0
- package/src/demo.js +8 -0
- package/src/fake-react-native-web/index.js +12 -0
- package/src/fake-react-native-web/text.js +56 -0
- package/src/fake-react-native-web/view.js +91 -0
- package/src/index.js +13 -0
- package/src/native-app.js +84 -0
- package/src/store/index.js +505 -0
- package/src/utils.js +18 -0
- package/tools/svg-to-react/convert.py +111 -0
- package/tools/svg-to-react/icons/math-keypad-icon-0.svg +32 -0
- package/tools/svg-to-react/icons/math-keypad-icon-1.svg +32 -0
- package/tools/svg-to-react/icons/math-keypad-icon-2.svg +32 -0
- package/tools/svg-to-react/icons/math-keypad-icon-3.svg +32 -0
- package/tools/svg-to-react/icons/math-keypad-icon-4.svg +32 -0
- package/tools/svg-to-react/icons/math-keypad-icon-5.svg +32 -0
- package/tools/svg-to-react/icons/math-keypad-icon-6.svg +32 -0
- package/tools/svg-to-react/icons/math-keypad-icon-7.svg +32 -0
- package/tools/svg-to-react/icons/math-keypad-icon-8.svg +32 -0
- package/tools/svg-to-react/icons/math-keypad-icon-9.svg +32 -0
- package/tools/svg-to-react/icons/math-keypad-icon-addition.svg +34 -0
- package/tools/svg-to-react/icons/math-keypad-icon-cos.svg +38 -0
- package/tools/svg-to-react/icons/math-keypad-icon-delete.svg +36 -0
- package/tools/svg-to-react/icons/math-keypad-icon-dismiss.svg +36 -0
- package/tools/svg-to-react/icons/math-keypad-icon-division.svg +36 -0
- package/tools/svg-to-react/icons/math-keypad-icon-equals-not.svg +50 -0
- package/tools/svg-to-react/icons/math-keypad-icon-equals.svg +48 -0
- package/tools/svg-to-react/icons/math-keypad-icon-exponent-2.svg +38 -0
- package/tools/svg-to-react/icons/math-keypad-icon-exponent-3.svg +38 -0
- package/tools/svg-to-react/icons/math-keypad-icon-exponent.svg +38 -0
- package/tools/svg-to-react/icons/math-keypad-icon-fraction.svg +42 -0
- package/tools/svg-to-react/icons/math-keypad-icon-greater-than.svg +46 -0
- package/tools/svg-to-react/icons/math-keypad-icon-jump-out-base.svg +44 -0
- package/tools/svg-to-react/icons/math-keypad-icon-jump-out-denominator.svg +48 -0
- package/tools/svg-to-react/icons/math-keypad-icon-jump-out-exponent.svg +44 -0
- package/tools/svg-to-react/icons/math-keypad-icon-jump-out-parentheses.svg +44 -0
- package/tools/svg-to-react/icons/math-keypad-icon-less-than.svg +46 -0
- package/tools/svg-to-react/icons/math-keypad-icon-log-10.svg +36 -0
- package/tools/svg-to-react/icons/math-keypad-icon-log-e.svg +36 -0
- package/tools/svg-to-react/icons/math-keypad-icon-log.svg +38 -0
- package/tools/svg-to-react/icons/math-keypad-icon-multiplication-cross.svg +40 -0
- package/tools/svg-to-react/icons/math-keypad-icon-multiplication-dot.svg +38 -0
- package/tools/svg-to-react/icons/math-keypad-icon-percent.svg +42 -0
- package/tools/svg-to-react/icons/math-keypad-icon-radical-2.svg +36 -0
- package/tools/svg-to-react/icons/math-keypad-icon-radical-3.svg +38 -0
- package/tools/svg-to-react/icons/math-keypad-icon-radical.svg +38 -0
- package/tools/svg-to-react/icons/math-keypad-icon-radix-character.svg +32 -0
- package/tools/svg-to-react/icons/math-keypad-icon-sin.svg +38 -0
- package/tools/svg-to-react/icons/math-keypad-icon-subtraction.svg +32 -0
- package/tools/svg-to-react/icons/math-keypad-icon-tan.svg +38 -0
- package/tools/svg-to-react/symbol_map.py +41 -0
- package/LICENSE.txt +0 -21
- package/build/math-input.js +0 -1
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@khanacademy/wonder-blocks-color"),t=require("@khanacademy/wonder-blocks-i18n"),n=require("aphrodite"),o=require("prop-types"),r=require("react"),i=require("react-dom"),s=require("jquery"),a=require("mathquill"),l=require("react-redux"),d=require("redux"),c=require("katex"),h=require("react-transition-group"),u=require("@khanacademy/wonder-blocks-core"),p=require("@khanacademy/wonder-blocks-clickable"),m=require("performance-now");function f(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function E(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var g=f(e),y=E(t),T=f(o),v=E(r),C=f(i),_=f(s),b=f(a),R=E(d),M=f(c),N=f(p),O=f(m);function P(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k(){return k=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},k.apply(this,arguments)}const L={PLUS:"PLUS",MINUS:"MINUS",NEGATIVE:"NEGATIVE",TIMES:"TIMES",DIVIDE:"DIVIDE",DECIMAL:"DECIMAL",PERIOD:"PERIOD",PERCENT:"PERCENT",CDOT:"CDOT",EQUAL:"EQUAL",NEQ:"NEQ",GT:"GT",LT:"LT",GEQ:"GEQ",LEQ:"LEQ",FRAC_INCLUSIVE:"FRAC_INCLUSIVE",FRAC_EXCLUSIVE:"FRAC_EXCLUSIVE",FRAC:"FRAC",EXP:"EXP",EXP_2:"EXP_2",EXP_3:"EXP_3",SQRT:"SQRT",CUBE_ROOT:"CUBE_ROOT",RADICAL:"RADICAL",LEFT_PAREN:"LEFT_PAREN",RIGHT_PAREN:"RIGHT_PAREN",LN:"LN",LOG:"LOG",LOG_N:"LOG_N",SIN:"SIN",COS:"COS",TAN:"TAN",PI:"PI",THETA:"THETA",UP:"UP",RIGHT:"RIGHT",DOWN:"DOWN",LEFT:"LEFT",BACKSPACE:"BACKSPACE",DISMISS:"DISMISS",JUMP_OUT_PARENTHESES:"JUMP_OUT_PARENTHESES",JUMP_OUT_EXPONENT:"JUMP_OUT_EXPONENT",JUMP_OUT_BASE:"JUMP_OUT_BASE",JUMP_INTO_NUMERATOR:"JUMP_INTO_NUMERATOR",JUMP_OUT_NUMERATOR:"JUMP_OUT_NUMERATOR",JUMP_OUT_DENOMINATOR:"JUMP_OUT_DENOMINATOR",NOOP:"NOOP",FRAC_MULTI:"FRAC_MULTI",MANY:"MANY"};class S extends v.Component{render(){const{numberOfLines:e,style:t}=this.props,o=n.css(A.initial,...Array.isArray(t)?t:[t],1===e&&A.singleLineStyle);return v.createElement("span",{className:o,style:this.props.dynamicStyle},this.props.children)}}const A=n.StyleSheet.create({initial:{color:"inherit",display:"inline",font:"inherit",margin:0,padding:0,textDecorationLine:"none",wordWrap:"break-word"},singleLineStyle:{maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}});class I extends v.Component{render(){const e=n.css(I.styles.initial,...Array.isArray(this.props.style)?this.props.style:[this.props.style])+(this.props.extraClassName?" ".concat(this.props.extraClassName):"");return v.createElement("div",{className:e,style:this.props.dynamicStyle,onClick:this.props.onClick,onTouchCancel:this.props.onTouchCancel,onTouchEnd:this.props.onTouchEnd,onTouchMove:this.props.onTouchMove,onTouchStart:this.props.onTouchStart,"aria-label":this.props.ariaLabel,role:this.props.role},this.props.children)}}P(I,"styles",n.StyleSheet.create({initial:{alignItems:"stretch",borderWidth:0,borderStyle:"solid",boxSizing:"border-box",display:"flex",flexBasis:"auto",flexDirection:"column",margin:0,padding:0,position:"relative",backgroundColor:"transparent",color:"inherit",font:"inherit",textAlign:"inherit",textDecorationLine:"none",listStyle:"none",maxWidth:"100%",minHeight:0,minWidth:0}}));const w=g.default.blue,x=g.default.offBlack;g.default.offBlack32;const B=g.default.offBlack16;g.default.offBlack8;const F=B,U={FRACTION:"FRACTION",EXPRESSION:"EXPRESSION"},z={EMPTY:"EMPTY",VALUE:"VALUE",OPERATOR:"OPERATOR",INPUT_NAVIGATION:"INPUT_NAVIGATION",KEYPAD_NAVIGATION:"KEYPAD_NAVIGATION",MANY:"MANY",ECHO:"ECHO"},D="LANDSCAPE",H="PORTRAIT",q="PHONE",V="TABLET",W={FULLSCREEN:"FULLSCREEN",COMPACT:"COMPACT"},K={LEFT:"LEFT",BOTTOM:"BOTTOM"},Q={LEFT:["LEFT"],BOTTOM:["BOTTOM"],ALL:["LEFT","BOTTOM"],NONE:[]},j={MATH:"MATH",SVG:"SVG",TEXT:"TEXT"},G="COMMA",X="PERIOD",J={SLIDE_AND_FADE:"SLIDE_AND_FADE",FADE_ONLY:"FADE_ONLY",LONG_FADE_ONLY:"LONG_FADE_ONLY"};let Y;Y="undefined"!=typeof window&&window.icu&&","===window.icu.getDecimalFormatSymbols().decimal_separator?G:X;const Z={[L.PLUS]:{type:z.OPERATOR,ariaLabel:y._("Plus")},[L.MINUS]:{type:z.OPERATOR,ariaLabel:y._("Minus")},[L.NEGATIVE]:{type:z.VALUE,ariaLabel:y._("Negative")},[L.TIMES]:{type:z.OPERATOR,ariaLabel:y._("Multiply")},[L.DIVIDE]:{type:z.OPERATOR,ariaLabel:y._("Divide")},[L.DECIMAL]:{type:z.VALUE,ariaLabel:y._("Decimal"),icon:Y===G?{type:j.TEXT,data:","}:{type:j.SVG,data:L.PERIOD}},[L.PERCENT]:{type:z.OPERATOR,ariaLabel:y._("Percent")},[L.CDOT]:{type:z.OPERATOR,ariaLabel:y._("Multiply")},[L.EQUAL]:{type:z.OPERATOR,ariaLabel:y._("Equals sign")},[L.NEQ]:{type:z.OPERATOR,ariaLabel:y._("Not-equals sign")},[L.GT]:{type:z.OPERATOR,ariaLabel:y._("Greater than sign")},[L.LT]:{type:z.OPERATOR,ariaLabel:y._("Less than sign")},[L.GEQ]:{type:z.OPERATOR,ariaLabel:y._("Greater than or equal to sign")},[L.LEQ]:{type:z.OPERATOR,ariaLabel:y._("Less than or equal to sign")},[L.FRAC_INCLUSIVE]:{type:z.OPERATOR,ariaLabel:y._("Fraction, with current expression in numerator")},[L.FRAC_EXCLUSIVE]:{type:z.OPERATOR,ariaLabel:y._("Fraction, excluding the current expression")},[L.FRAC]:{type:z.OPERATOR,ariaLabel:y._("Fraction, excluding the current expression")},[L.EXP]:{type:z.OPERATOR,ariaLabel:y._("Custom exponent")},[L.EXP_2]:{type:z.OPERATOR,ariaLabel:y._("Square")},[L.EXP_3]:{type:z.OPERATOR,ariaLabel:y._("Cube")},[L.SQRT]:{type:z.OPERATOR,ariaLabel:y._("Square root")},[L.CUBE_ROOT]:{type:z.OPERATOR,ariaLabel:y._("Cube root")},[L.RADICAL]:{type:z.OPERATOR,ariaLabel:y._("Radical with custom root")},[L.LEFT_PAREN]:{type:z.OPERATOR,ariaLabel:y._("Left parenthesis")},[L.RIGHT_PAREN]:{type:z.OPERATOR,ariaLabel:y._("Right parenthesis")},[L.LN]:{type:z.OPERATOR,ariaLabel:y._("Natural logarithm")},[L.LOG]:{type:z.OPERATOR,ariaLabel:y._("Logarithm with base 10")},[L.LOG_N]:{type:z.OPERATOR,ariaLabel:y._("Logarithm with custom base")},[L.SIN]:{type:z.OPERATOR,ariaLabel:y._("Sine")},[L.COS]:{type:z.OPERATOR,ariaLabel:y._("Cosine")},[L.TAN]:{type:z.OPERATOR,ariaLabel:y._("Tangent")},[L.PI]:{type:z.VALUE,ariaLabel:y._("Pi"),icon:{type:j.MATH,data:"\\pi"}},[L.THETA]:{type:z.VALUE,ariaLabel:y._("Theta"),icon:{type:j.MATH,data:"\\theta"}},[L.NOOP]:{type:z.EMPTY},[L.UP]:{type:z.INPUT_NAVIGATION,ariaLabel:y._("Up arrow")},[L.RIGHT]:{type:z.INPUT_NAVIGATION,ariaLabel:y._("Right arrow")},[L.DOWN]:{type:z.INPUT_NAVIGATION,ariaLabel:y._("Down arrow")},[L.LEFT]:{type:z.INPUT_NAVIGATION,ariaLabel:y._("Left arrow")},[L.JUMP_OUT_PARENTHESES]:{type:z.INPUT_NAVIGATION,ariaLabel:y._("Navigate right out of a set of parentheses")},[L.JUMP_OUT_EXPONENT]:{type:z.INPUT_NAVIGATION,ariaLabel:y._("Navigate right out of an exponent")},[L.JUMP_OUT_BASE]:{type:z.INPUT_NAVIGATION,ariaLabel:y._("Navigate right out of a base")},[L.JUMP_INTO_NUMERATOR]:{type:z.INPUT_NAVIGATION,ariaLabel:y._("Navigate right into the numerator of a fraction")},[L.JUMP_OUT_NUMERATOR]:{type:z.INPUT_NAVIGATION,ariaLabel:y._("Navigate right out of the numerator and into the denominator")},[L.JUMP_OUT_DENOMINATOR]:{type:z.INPUT_NAVIGATION,ariaLabel:y._("Navigate right out of the denominator of a fraction")},[L.BACKSPACE]:{type:z.INPUT_NAVIGATION,ariaLabel:y._("Delete")},[L.DISMISS]:{type:z.KEYPAD_NAVIGATION,ariaLabel:y._("Dismiss")}};Z[L.FRAC_MULTI]={childKeyIds:[L.FRAC_INCLUSIVE,L.FRAC_EXCLUSIVE]},Z[L.MANY]={type:z.MANY};const $=[0,1,2,3,4,5,6,7,8,9];for(const e of $){const t="".concat(e);Z["NUM_".concat(e)]={type:z.VALUE,ariaLabel:t,icon:{type:j.TEXT,data:t}}}const ee=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];for(const e of ee){const t=e.toLowerCase(),n=e.toUpperCase();for(const e of[t,n])Z[e]={type:z.VALUE,ariaLabel:e,icon:{type:j.MATH,data:e}}}for(const e of Object.keys(Z))Z[e]={id:e,icon:{type:j.SVG,data:e},...Z[e]};var te=Object.freeze({__proto__:null,NONE:"NONE",IN_PARENS:"IN_PARENS",IN_SUPER_SCRIPT:"IN_SUPER_SCRIPT",IN_SUB_SCRIPT:"IN_SUB_SCRIPT",IN_NUMERATOR:"IN_NUMERATOR",IN_DENOMINATOR:"IN_DENOMINATOR",BEFORE_FRACTION:"BEFORE_FRACTION"});const ne=T.default.shape({type:T.default.oneOf(Object.keys(j)).isRequired,data:T.default.string.isRequired}),oe=T.default.oneOf(Object.keys(Z)),re=T.default.shape({ariaLabel:T.default.string,id:oe.isRequired,type:T.default.oneOf(Object.keys(z)).isRequired,childKeyIds:T.default.arrayOf(oe),icon:ne.isRequired}),ie=T.default.shape({keypadType:T.default.oneOf(Object.keys(U)).isRequired,extraKeys:T.default.arrayOf(oe)}),se=T.default.shape({activate:T.default.func.isRequired,dismiss:T.default.func.isRequired,configure:T.default.func.isRequired,setCursor:T.default.func.isRequired,setKeyHandler:T.default.func.isRequired,getDOMNode:T.default.func.isRequired}),ae=T.default.arrayOf(T.default.oneOf(Object.keys(K))),le=T.default.shape({height:T.default.number,width:T.default.number,top:T.default.number,right:T.default.number,bottom:T.default.number,left:T.default.number}),de=T.default.shape({animationId:T.default.string.isRequired,animationType:T.default.oneOf(Object.keys(J)).isRequired,borders:ae,id:oe.isRequired,initialBounds:le.isRequired}),ce=T.default.oneOf(Object.keys(te)),he=T.default.shape({parentId:oe.isRequired,bounds:le.isRequired,childKeyIds:T.default.arrayOf(oe).isRequired});T.default.oneOfType([T.default.arrayOf(T.default.node),T.default.node]);class ue extends v.Component{render(){const{x:e,y:t,animateIntoPosition:n}=this.props,o=n?{msTransitionDuration:"100ms",WebkitTransitionDuration:"100ms",transitionDuration:"100ms",msTransitionProperty:"transform",WebkitTransitionProperty:"transform",transitionProperty:"transform"}:{},r="translate(".concat(e,"px, ").concat(t,"px)"),i={position:"absolute",zIndex:4,left:-22,top:0,msTransform:r,WebkitTransform:r,transform:r,width:44,height:44,touchAction:"none",...o};return v.createElement("span",{style:i,onTouchStart:this.props.onTouchStart,onTouchMove:this.props.onTouchMove,onTouchEnd:this.props.onTouchEnd,onTouchCancel:this.props.onTouchCancel},v.createElement("svg",{fill:"none",width:44,height:45.98,viewBox:"0 0 ".concat(44," ").concat(45.98)},v.createElement("filter",{id:"math-input_cursor",colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse",height:45.98*.87,width:36.08,x:"4",y:"0"},v.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),v.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),v.createElement("feOffset",{dy:"4"}),v.createElement("feGaussianBlur",{stdDeviation:"4"}),v.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.129412 0 0 0 0 0.141176 0 0 0 0 0.172549 0 0 0 0.08 0"}),v.createElement("feBlend",{in2:"BackgroundImageFix",mode:"normal",result:"effect1_dropShadow"}),v.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow",mode:"normal",result:"shape"})),v.createElement("g",{filter:"url(#math-input_cursor)"},v.createElement("path",{d:"m22 4-7.07 7.0284c-1.3988 1.3901-2.3515 3.1615-2.7376 5.09-.3861 1.9284-.1883 3.9274.5685 5.7441s2.0385 3.3694 3.6831 4.4619c1.6445 1.0925 3.5781 1.6756 5.556 1.6756s3.9115-.5831 5.556-1.6756c1.6446-1.0925 2.9263-2.6452 3.6831-4.4619s.9546-3.8157.5685-5.7441c-.3861-1.9285-1.3388-3.6999-2.7376-5.09z",fill:"#1865f2"})),v.createElement("path",{d:"m14.9301 10.4841 7.0699-7.06989 7.0699 7.06989.0001.0001c1.3988 1.3984 2.3515 3.1802 2.7376 5.1201s.1883 3.9507-.5685 5.7782c-.7568 1.8274-2.0385 3.3894-3.6831 4.4883-1.6445 1.099-3.5781 1.6855-5.556 1.6855s-3.9115-.5865-5.556-1.6855c-1.6446-1.0989-2.9263-2.6609-3.6831-4.4883-.7568-1.8275-.9546-3.8383-.5685-5.7782s1.3388-3.7217 2.7376-5.1201z",stroke:"#fff",strokeWidth:"2"})))}}P(ue,"propTypes",{animateIntoPosition:T.default.bool,onTouchCancel:T.default.func.isRequired,onTouchEnd:T.default.func.isRequired,onTouchMove:T.default.func.isRequired,onTouchStart:T.default.func.isRequired,visible:T.default.bool.isRequired,x:T.default.number.isRequired,y:T.default.number.isRequired}),P(ue,"defaultProps",{animateIntoPosition:!1,visible:!1,x:0,y:0});class pe{constructor(e,t){this._scrollListener=()=>{e()};const n={};for(let e=0;e<t.changedTouches.length;e++){const o=t.changedTouches[e];n[o.identifier]=[o.clientX,o.clientY]}this._moveListener=t=>{for(let o=0;o<t.changedTouches.length;o++){const r=t.changedTouches[o],i=n[r.identifier];if(i){const t=[r.clientX,r.clientY],n=t[0]-i[0],o=t[1]-i[1];n*n+o*o>64&&e()}}},this._endAndCancelListener=e=>{for(let t=0;t<e.changedTouches.length;t++)delete n[e.changedTouches[t].identifier]}}attach(){window.addEventListener("scroll",this._scrollListener),window.addEventListener("touchmove",this._moveListener),window.addEventListener("touchend",this._endAndCancelListener),window.addEventListener("touchcancel",this._endAndCancelListener)}detach(){window.removeEventListener("scroll",this._scrollListener),window.removeEventListener("touchmove",this._moveListener),window.removeEventListener("touchend",this._endAndCancelListener),window.removeEventListener("touchcancel",this._endAndCancelListener)}}const me="write",fe="cmd",Ee={[L.PLUS]:{str:"+",fn:me},[L.MINUS]:{str:"-",fn:me},[L.NEGATIVE]:{str:"-",fn:me},[L.TIMES]:{str:"\\times",fn:me},[L.DIVIDE]:{str:"\\div",fn:me},[L.DECIMAL]:{str:Y===G?",":".",fn:me},[L.EQUAL]:{str:"=",fn:me},[L.NEQ]:{str:"\\neq",fn:me},[L.CDOT]:{str:"\\cdot",fn:me},[L.PERCENT]:{str:"%",fn:me},[L.LEFT_PAREN]:{str:"(",fn:fe},[L.RIGHT_PAREN]:{str:")",fn:fe},[L.SQRT]:{str:"sqrt",fn:fe},[L.PI]:{str:"pi",fn:fe},[L.THETA]:{str:"theta",fn:fe},[L.RADICAL]:{str:"nthroot",fn:fe},[L.LT]:{str:"<",fn:me},[L.LEQ]:{str:"\\leq",fn:me},[L.GT]:{str:">",fn:me},[L.GEQ]:{str:"\\geq",fn:me},[L.UP]:{str:"Up",fn:"keystroke"},[L.DOWN]:{str:"Down",fn:"keystroke"},[L.FRAC_INCLUSIVE]:{str:"/",fn:fe}},ge={[L.LOG]:"log",[L.LN]:"ln",[L.SIN]:"sin",[L.COS]:"cos",[L.TAN]:"tan"},ye=["+","-","\\cdot","\\times","\\div"],Te=["=","\\neq","<","\\leq",">","\\geq"],ve=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ce=["0","1","2","3","4","5","6","7","8","9","\\theta","\\pi",...ve.map((e=>e.toLowerCase())),...ve.map((e=>e.toUpperCase()))],_e={IN_PARENS:L.JUMP_OUT_PARENTHESES,IN_SUPER_SCRIPT:L.JUMP_OUT_EXPONENT,IN_SUB_SCRIPT:L.JUMP_OUT_BASE,BEFORE_FRACTION:L.JUMP_INTO_NUMERATOR,IN_NUMERATOR:L.JUMP_OUT_NUMERATOR,IN_DENOMINATOR:L.JUMP_OUT_DENOMINATOR};class be{constructor(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.MQ=b.default.getInterface(2),this.mathField=this.MQ.MathField(e,{substituteTextarea:function(){return document.createElement("span")}}),this.callbacks=t}focus(){const e=this.mathField.__controller;e.cursor.show(),e.blurred=!1}blur(){const e=this.mathField.__controller;e.cursor.hide(),e.blurred=!0}_writeNormalFunction(e){this.mathField.write("\\".concat(e,"\\left(\\right)")),this.mathField.keystroke("Left")}pressKey(e){const t=this.mathField.__controller.cursor;if(e in Ee){const{str:t,fn:n}=Ee[e];t&&n&&this.mathField[n](t)}else if(Object.keys(ge).includes(e))this._writeNormalFunction(ge[e]);else if(e===L.FRAC_EXCLUSIVE){const e=0===t[this.MQ.L];this.mathField.cmd("\\frac"),e&&this.mathField.keystroke("Left")}else e===L.FRAC?(t[this.MQ.L],this.mathField.cmd("\\frac")):e===L.LOG_N?(this.mathField.write("log_{ }\\left(\\right)"),this.mathField.keystroke("Left"),this.mathField.keystroke("Left"),this.mathField.keystroke("Left")):e===L.CUBE_ROOT?(this.mathField.write("\\sqrt[3]{}"),this.mathField.keystroke("Left")):e===L.EXP||e===L.EXP_2||e===L.EXP_3?this._handleExponent(t,e):e===L.JUMP_OUT_PARENTHESES||e===L.JUMP_OUT_EXPONENT||e===L.JUMP_OUT_BASE||e===L.JUMP_INTO_NUMERATOR||e===L.JUMP_OUT_NUMERATOR||e===L.JUMP_OUT_DENOMINATOR?this._handleJumpOut(t,e):e===L.BACKSPACE?this._handleBackspace(t):e===L.LEFT?this._handleLeftArrow(t):e===L.RIGHT||e===L.JUMP_OUT?this._handleRightArrow(t):/^[a-zA-Z]$/.test(e)?this.mathField.write(e):/^NUM_\d/.test(e)&&this.mathField.write(e[4]);return t.selection||t.show(),this.callbacks.onSelectionChanged&&this.callbacks.onSelectionChanged(t.selection),{context:this.contextForCursor(t)}}setCursorPosition(e,t,n){const o=n||document.elementFromPoint(e,t);if(o){const n=this.getCursor();if(o.hasAttribute("mq-root-block"))n.insAtRightEnd(this.mathField.__controller.root);else{const r=this.mathField.__controller,i=e-document.body.scrollLeft,s=t-document.body.scrollTop;r.seek(_.default(o),i,s).cursor.startSelection();const a=this._maybeFindCommand(n[this.MQ.L]);a&&a.endNode&&(n.insLeftOf(a.endNode),this.mathField.keystroke("Right"))}this.callbacks.onCursorMove&&this.callbacks.onCursorMove({context:this.contextForCursor(n)})}}getCursor(){return this.mathField.__controller.cursor}getSelection(){return this.getCursor().selection}getContent(){return this.mathField.latex()}setContent(e){this.mathField.latex(e)}isEmpty(){const e=this.getCursor();return 1===e.parent.id&&0===e[1]&&0===e[-1]}_handleBackspaceInNthRoot(e){const t=0===e[this.MQ.L],n=this._isInsideEmptyNode(e.parent.parent.blocks[0].ends);t?(this._selectNode(e.parent.parent,e),n&&this.mathField.keystroke("Backspace")):this.mathField.keystroke("Backspace")}_handleJumpOut(e,t){const n=this.contextForCursor(e);if(_e[n]===t)switch(n){case"IN_PARENS":case"IN_DENOMINATOR":case"IN_SUPER_SCRIPT":e.insRightOf(e.parent.parent);break;case"BEFORE_FRACTION":let t,o=e;for(;0!==o[this.MQ.R];)this._isFraction(o[this.MQ.R])&&(t=o[this.MQ.R]),o=o[this.MQ.R];e.insLeftOf(t),this.mathField.keystroke("Right");break;case"IN_NUMERATOR":const r=e.parent.parent.blocks[1];for(;e.parent!==r;)this.mathField.keystroke("Right");break;case"IN_SUB_SCRIPT":e.insRightOf(e.parent.parent),this._isParens(e[this.MQ.R])&&this.mathField.keystroke("Right");break;default:throw new Error("Attempted to 'Jump Out' from node, but found no "+"appropriate cursor context: ".concat(n))}}_handleBackspace(e){if(e.selection)this.mathField.keystroke("Backspace");else{const t=e.parent,n=t.parent,o=e[this.MQ.L];this._isFraction(o)||this._isSquareRoot(o)||this._isNthRoot(o)?this._selectNode(o,e):this._isNthRootIndex(t)?this._handleBackspaceInRootIndex(e):"\\left("===o.ctrlSeq?this._handleBackspaceOutsideParens(e):"\\left("===n.ctrlSeq?this._handleBackspaceInsideParens(e):this._isInsideLogIndex(e)?this._handleBackspaceInLogIndex(e):"\\ge "===o.ctrlSeq||"\\le "===o.ctrlSeq?this._handleBackspaceAfterLigaturedSymbol(e):this._isNthRoot(n)&&0===o?this._handleBackspaceInNthRoot(e):this.mathField.keystroke("Backspace")}}_handleLeftArrow(e){if(0===e[this.MQ.L]){const t=e.parent.parent;if("\\left("===t.ctrlSeq){const n=this._maybeFindCommandBeforeParens(t);if(n)return void e.insLeftOf(n.startNode)}}this.mathField.keystroke("Left")}_handleRightArrow(e){const t=this._maybeFindCommand(e[this.MQ.R]);t?(e.insLeftOf(t.endNode),this.mathField.keystroke("Right")):this.mathField.keystroke("Right")}_handleExponent(e,t){const n=[...ye,...Te],o=e[this.MQ.L],r=0===o||n.includes(o.ctrlSeq.trim());switch(r&&this.mathField.write("\\left(\\right)"),t){case L.EXP:this.mathField.cmd("^");break;case L.EXP_2:case L.EXP_3:this.mathField.write("^".concat(t===L.EXP_2?2:3)),r&&(this.mathField.keystroke("Left"),this.mathField.keystroke("Left"),this.mathField.keystroke("Left"),this.mathField.keystroke("Left"));break;default:throw new Error("Invalid exponent key: ".concat(t))}}_maybeFindCommand(e){if(!e)return null;const t=/^[a-z]$/,n=/^\\[a-z]$/,o=["\\log","\\ln","\\cos","\\sin","\\tan"];let r,i,s="",a=e;for(;0!==a;){const e=a.ctrlSeq.trim();if(!t.test(e)){if(n.test(e)){s=e+s,r=a;break}break}s=e+s,a=a[this.MQ.L]}if(r){for(a=e[this.MQ.R];0!==a;){const e=a.ctrlSeq.trim();if(t.test(e))s+=e;else if("\\left("===e){i=a;break}a=a[this.MQ.R]}return o.includes(s)?{name:s,startNode:r,endNode:i}:null}return null}_maybeFindCommandBeforeParens(e){return this._maybeFindCommand(e[this.MQ.L])}_selectNode(e,t){t.insLeftOf(e),t.startSelection(),t.insRightOf(e),t.select(),t.endSelection()}_isFraction(e){return e.jQ&&e.jQ.hasClass("mq-fraction")}_isNumerator(e){return e.jQ&&e.jQ.hasClass("mq-numerator")}_isDenominator(e){return e.jQ&&e.jQ.hasClass("mq-denominator")}_isSubScript(e){return e.jQ&&(e.jQ.hasClass("mq-sub-only")||e.jQ.hasClass("mq-sub"))}_isSuperScript(e){return e.jQ&&(e.jQ.hasClass("mq-sup-only")||e.jQ.hasClass("mq-sup"))}_isParens(e){return e&&"\\left("===e.ctrlSeq}_isLeaf(e){return e&&e.ctrlSeq&&Ce.includes(e.ctrlSeq.trim())}_isSquareRoot(e){return e.blocks&&e.blocks[0].jQ&&e.blocks[0].jQ.hasClass("mq-sqrt-stem")}_isNthRoot(e){return e.blocks&&e.blocks[0].jQ&&e.blocks[0].jQ.hasClass("mq-nthroot")}_isNthRootIndex(e){return e.jQ&&e.jQ.hasClass("mq-nthroot")}_isInsideLogIndex(e){const t=e.parent.parent;if(t&&t.jQ.hasClass("mq-supsub")){const e=this._maybeFindCommandBeforeParens(t);if(e&&"\\log"===e.name)return!0}return!1}_isInsideEmptyNode(e){return 0===e[this.MQ.L]&&0===e[this.MQ.R]}_handleBackspaceInRootIndex(e){if(this._isInsideEmptyNode(e)){const t=e.parent.parent,n=t.latex(),o=t[this.MQ.L];this._selectNode(t,e);""===t.blocks[1].jQ.text()?this.mathField.keystroke("Backspace"):(this.mathField.keystroke("Backspace"),this.mathField.write(n.replace(/^\\sqrt\[\]/,"\\sqrt")),0===o?this.mathField.moveToDirEnd(this.MQ.L):e.insRightOf(o))}else 0!==e[this.MQ.L]&&this.mathField.keystroke("Backspace")}_handleBackspaceInLogIndex(e){if(this._isInsideEmptyNode(e)){const t=e.parent.parent,n=this._maybeFindCommandBeforeParens(t);e.insLeftOf(n.startNode),e.startSelection(),0!==t[this.MQ.R]?e.insRightOf(t[this.MQ.R]):e.insRightOf(t),e.select(),e.endSelection();""===t[this.MQ.R].contentjQ.text()&&this.mathField.keystroke("Backspace")}else this.mathField.keystroke("Backspace")}_handleBackspaceOutsideParens(e){const t=e[this.MQ.L],n=e[this.MQ.R],o=this._maybeFindCommandBeforeParens(t);o&&o.startNode?(e.insLeftOf(o.startNode),e.startSelection(),0===n?e.insAtRightEnd(e.parent):e.insLeftOf(n),e.select(),e.endSelection()):(e.startSelection(),e.insLeftOf(t),e.select(),e.endSelection())}_handleBackspaceInsideParens(e){if(0!==e[this.MQ.L])return void this.mathField.keystroke("Backspace");const t=e.parent.parent;if(t[this.MQ.L].sub&&t[this.MQ.L].sub.jQ.text())return void e.insAtRightEnd(t[this.MQ.L].sub);const n=this._isInsideEmptyNode(e),o=this._maybeFindCommandBeforeParens(t);e.insLeftOf(o&&o.startNode||t),e.startSelection(),e.insRightOf(t),e.select(),e.endSelection(),n&&this.mathField.keystroke("Backspace")}_handleBackspaceAfterLigaturedSymbol(e){this.mathField.keystroke("Backspace"),this.mathField.keystroke("Backspace")}contextForCursor(e){let t=e;for(;0!==t[this.MQ.R];){if(this._isFraction(t[this.MQ.R]))return"BEFORE_FRACTION";if(!this._isLeaf(t[this.MQ.R]))break;t=t[this.MQ.R]}return this._isParens(e.parent&&e.parent.parent)?"IN_PARENS":this._isNumerator(e.parent)?"IN_NUMERATOR":this._isDenominator(e.parent)?"IN_DENOMINATOR":this._isSubScript(e.parent)?"IN_SUB_SCRIPT":this._isSuperScript(e.parent)?"IN_SUPER_SCRIPT":"NONE"}_isAtTopLevel(e){return!e.parent.parent}}const Re=(e,t)=>{const n=e.getBoundingClientRect(),o=n.bottom,r=n.top,i="scrollingElement"in document?document.scrollingElement:-1!==navigator.userAgent.indexOf("WebKit")?document.body:document.documentElement;if(t){const e=window.innerHeight-(t.clientHeight+60);if(o>e){const t=Math.min(o-e+16,r);return void(i.scrollTop+=t)}}r<16&&(i.scrollTop-=n.height+16)};class Me extends v.Component{constructor(){super(...arguments),P(this,"state",{focused:!1,handle:{animateIntoPosition:!1,visible:!1,x:0,y:0}}),P(this,"_clearKeypadBoundsCache",(e=>{this._keypadBounds=null})),P(this,"_cacheKeypadBounds",(e=>{this._keypadBounds=e.getBoundingClientRect()})),P(this,"_updateInputPadding",(()=>{this._container=C.default.findDOMNode(this),this._root=this._container.querySelector(".mq-root-block");const e=this.getInputInnerPadding();this._root.style.padding="".concat(e.paddingTop,"px ").concat(e.paddingRight,"px")+" ".concat(e.paddingBottom,"px ").concat(e.paddingLeft,"px"),this._root.style.fontSize="".concat(Ne,"pt")})),P(this,"_getKeypadBounds",(()=>{if(!this._keypadBounds){const e=this.props.keypadElement.getDOMNode();this._cacheKeypadBounds(e)}return this._keypadBounds})),P(this,"_updateCursorHandle",(e=>{const t=this._container.getBoundingClientRect(),n=this._container.querySelector(".mq-cursor").getBoundingClientRect(),o=n.width,r=this.getInputInnerPadding(),i=t.right-o-r.paddingRight,s=t.left+o+r.paddingLeft;let a=n.left;n.left>i?a=i:n.left<s&&(a=s),this.setState({handle:{visible:!0,animateIntoPosition:e,x:a+o/2-t.left,y:n.bottom+2-t.top}})})),P(this,"_hideCursorHandle",(()=>{this.setState({handle:{visible:!1,x:0,y:0}})})),P(this,"_handleScroll",(()=>{!1!==this.state.handle.animateIntoPosition&&this._hideCursorHandle()})),P(this,"blur",(()=>{this.mathField.blur(),this.props.onBlur&&this.props.onBlur(),this.setState({focused:!1,handle:{visible:!1}})})),P(this,"focus",(()=>{this.props.keypadElement.setKeyHandler((e=>{const t=this.mathField.pressKey(e),n=()=>{this.setState({handle:{visible:!1}})},o=this.mathField.getContent();return this.props.value!==o?this.props.onChange(o,n):n(),t})),this.mathField.focus(),this.props.onFocus&&this.props.onFocus(),this.setState({focused:!0},(()=>{setTimeout((()=>{if(this._isMounted){const e=this.props.keypadElement&&this.props.keypadElement.getDOMNode();Re(this._container,e)}}))}))})),P(this,"_findHitNode",((e,t,n,o,r)=>{for(;n>=e.top&&n<=e.bottom;){const e=[[t-o,n+=r],[t,n],[t+o,n]].map((e=>document.elementFromPoint(...e))).filter((e=>e&&this._root.contains(e)&&(!e.classList.contains("mq-root-block")&&!e.classList.contains("mq-non-leaf")||e.classList.contains("mq-empty")||e.classList.contains("mq-hasCursor"))));let i=null;const s=[];let a=0;const l={},d={};for(const t of e){const e=t.getAttribute("mathquill-command-id");null!=e?(l[e]=(l[e]||0)+1,d[e]=t):s.push(t)}for(const[e,t]of Object.entries(l))t>a&&(a=t,i=d[e]);if(null==i&&s.length>0&&(i=s[0]),null!==i)return this.mathField.setCursorPosition(t,n,i),!0}return!1})),P(this,"_insertCursorAtClosestNode",((e,t)=>{const n=this.mathField.getCursor();if(!this._root.hasChildNodes())return void n.insAtLeftEnd(this.mathField.mathField.__controller.root);let o;t>this._containerBounds.bottom?t=this._containerBounds.bottom-10:t<this._containerBounds.top&&(t=this._containerBounds.top+10),e>this._containerBounds.right?e=this._containerBounds.right-15:e<this._containerBounds.left&&(e=this._containerBounds.left+15),o=-8;if(this._findHitNode(this._containerBounds,e,t,5,o))return;if(t=this._containerBounds.top,o=8,this._findHitNode(this._containerBounds,e,t,5,o))return;const r=this._root.firstChild.getBoundingClientRect(),i=this._root.lastChild.getBoundingClientRect(),s=r.left,a=i.right;Math.abs(e-a)<Math.abs(e-s)?n.insAtRightEnd(this.mathField.mathField.__controller.root):n.insAtLeftEnd(this.mathField.mathField.__controller.root),this.props.keypadElement&&this.props.keypadElement.setCursor({context:this.mathField.contextForCursor(n)})})),P(this,"handleTouchStart",(e=>{if(e.stopPropagation(),this._hideCursorHandle(),""!==this.mathField.getContent()){this._containerBounds=this._container.getBoundingClientRect();const t=e.changedTouches[0];this._insertCursorAtClosestNode(t.clientX,t.clientY)}this.state.focused||this.focus()})),P(this,"handleTouchMove",(e=>{if(e.stopPropagation(),""!==this.mathField.getContent()&&this.state.focused){const t=e.changedTouches[0];this._insertCursorAtClosestNode(t.clientX,t.clientY)}})),P(this,"handleTouchEnd",(e=>{e.stopPropagation(),""!==this.mathField.getContent()&&this.state.focused&&this._updateCursorHandle()})),P(this,"onCursorHandleTouchStart",(e=>{e.stopPropagation(),e.preventDefault(),this._containerBounds=this._container.getBoundingClientRect()})),P(this,"_constrainToBound",((e,t,n,o)=>e<t?t+(e-t)*o:e>n?n+(e-n)*o:e)),P(this,"onCursorHandleTouchMove",(e=>{e.stopPropagation();const t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY,o=t-this._containerBounds.left,r=n-22.99-this._containerBounds.top;this.setState({handle:{animateIntoPosition:!1,visible:!0,x:this._constrainToBound(o,0,this._containerBounds.width,.8),y:this._constrainToBound(r,0,this._containerBounds.height,.8)}});const i=n-22;this._insertCursorAtClosestNode(t,i)})),P(this,"onCursorHandleTouchEnd",(e=>{e.stopPropagation(),this._updateCursorHandle(!0)})),P(this,"onCursorHandleTouchCancel",(e=>{e.stopPropagation(),this._updateCursorHandle(!0)})),P(this,"domKeyToMathQuillKey",(e=>{const t={"+":L.PLUS,"-":L.MINUS,"*":L.TIMES,"/":L.DIVIDE,".":L.DECIMAL,"%":L.PERCENT,"=":L.EQUAL,">":L.GT,"<":L.LT,"^":L.EXP};return["0","1","2","3","4","5","6","7","8","9"].includes(e)?"NUM_".concat(e):"Backspace"===e?L.BACKSPACE:e in t?t[e]:null})),P(this,"handleKeyUp",(e=>{const t=this.domKeyToMathQuillKey(e.key);if(t){this.mathField.pressKey(t);const e=this.mathField.getContent();this.props.value!==e&&(this.mathField.setContent(this.props.value),this.props.onChange(e,!1),this._hideCursorHandle())}})),P(this,"getBorderWidthPx",(()=>this.state.focused?2:1)),P(this,"getInputInnerPadding",(()=>{const e=Oe-this.getBorderWidthPx();return{paddingTop:e-1,paddingRight:e,paddingBottom:e-3,paddingLeft:e}}))}componentDidMount(){this._isMounted=!0,this.mathField=new be(this._mathContainer,{},{onCursorMove:e=>{this.props.keypadElement&&this.props.keypadElement.setCursor(e)}}),this.mathField.mathField.__controller.container.unbind("mousedown.mathquill"),this.mathField.setContent(this.props.value),this._updateInputPadding(),this._container=C.default.findDOMNode(this),this._root=this._container.querySelector(".mq-root-block"),this._root.addEventListener("scroll",this._handleScroll),this.touchStartInitialScroll=null,this.recordTouchStartOutside=e=>{if(this.state.focused&&!this._container.contains(e.target)){let t=!1;if(this.props.keypadElement&&this.props.keypadElement.getDOMNode()){const n=this._getKeypadBounds();for(let o=0;o<e.changedTouches.length;o++){const[r,i]=[e.changedTouches[o].clientX,e.changedTouches[o].clientY];if(n.left<=r&&n.right>=r&&n.top<=i&&n.bottom>=i||n.bottom<i){t=!0;break}}}t||(this.didTouchOutside=!0,this.dragListener&&this.dragListener.detach(),this.dragListener=new pe((()=>{this.didScroll=!0,this.dragListener.detach()}),e),this.dragListener.attach())}},this.blurOnTouchEndOutside=e=>{this.state.focused&&this.didTouchOutside&&!this.didScroll&&this.blur(),this.didTouchOutside=!1,this.didScroll=!1,this.dragListener&&(this.dragListener.detach(),this.removeListeners=null)},window.addEventListener("touchstart",this.recordTouchStartOutside),window.addEventListener("touchend",this.blurOnTouchEndOutside),window.addEventListener("touchcancel",this.blurOnTouchEndOutside),window.addEventListener("resize",this._clearKeypadBoundsCache),window.addEventListener("orientationchange",this._clearKeypadBoundsCache)}UNSAFE_componentWillReceiveProps(e){this.props.keypadElement!==e.keypadElement&&this._clearKeypadBoundsCache()}componentDidUpdate(e,t){this.mathField.getContent()!==this.props.value&&this.mathField.setContent(this.props.value),t.focused!==this.state.focused&&this._updateInputPadding()}componentWillUnmount(){this._isMounted=!1,window.removeEventListener("touchstart",this.recordTouchStartOutside),window.removeEventListener("touchend",this.blurOnTouchEndOutside),window.removeEventListener("touchcancel",this.blurOnTouchEndOutside),window.removeEventListener("resize",this._clearKeypadBoundsCache()),window.removeEventListener("orientationchange",this._clearKeypadBoundsCache())}render(){const{focused:e,handle:t}=this.state,{style:n}=this.props,o={...Le.innerContainer,borderWidth:this.getBorderWidthPx(),...e?{borderColor:w}:{},...n},r=y._("Math input box")+" "+y._("Tap with one or two fingers to open keyboard");return v.createElement(I,{style:ke.input,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEnd,onClick:e=>e.stopPropagation(),role:"textbox",ariaLabel:r},v.createElement("div",{className:"keypad-input",tabIndex:"0",ref:e=>{this.inputRef=e},onKeyUp:this.handleKeyUp},v.createElement("div",{ref:e=>{this._mathContainer=C.default.findDOMNode(e)},style:o})),e&&t.visible&&v.createElement(ue,k({},t,{onTouchStart:this.onCursorHandleTouchStart,onTouchMove:this.onCursorHandleTouchMove,onTouchEnd:this.onCursorHandleTouchEnd,onTouchCancel:this.onCursorHandleTouchCancel})))}}P(Me,"propTypes",{keypadElement:se,onBlur:T.default.func,onChange:T.default.func.isRequired,onFocus:T.default.func,style:T.default.any,value:T.default.string}),P(Me,"defaultProps",{style:{},value:""});const Ne=18,Oe=12,Pe=20+2*Oe,ke=n.StyleSheet.create({input:{position:"relative",display:"inline-block",verticalAlign:"middle",maxWidth:128}}),Le={innerContainer:{backgroundColor:"white",minHeight:Pe,minWidth:64,maxWidth:128,boxSizing:"border-box",position:"relative",borderStyle:"solid",borderColor:g.default.offBlack50,borderRadius:4,color:x}},Se=(e,t,n,o)=>{let{numColumns:r,numMaxVisibleRows:i,numPages:s}=e,{pageWidthPx:a,pageHeightPx:l}=t,{deviceOrientation:d,deviceType:c}=n,{navigationPadEnabled:h,paginationEnabled:u,toolbarEnabled:p}=o;const m=u?r:r*s;let f;if(c===q){const e=d===D,t=a,n=(e?l:a/.7339449541284404)-(32+(e?88:64)+(p?60:0)+(u?16:0)),o=Math.max(Math.min(n/i,64),48);let c;if(s>1){c=t/(u?r:r*s)}else c=e?64:t/r;f={widthPx:c,heightPx:o}}else{if(c!==V)throw new Error("Invalid device type: "+c);f={widthPx:64,heightPx:64}}const E=(h?1:0)+(u?0:s-1);return{buttonDimensions:f,layoutMode:m*f.widthPx+(h?192:0)+1*E>=a?W.FULLSCREEN:W.COMPACT}},Ae={longPressWaitTimeMs:50,swipeThresholdPx:20,holdIntervalMs:250};class Ie{constructor(e,t,n,o){this.handlers=e,this.options={...Ae,...t},this.swipeDisabledNodeIds=n||[],this.multiPressableKeys=o||[],this.touchState={},this.swipeState=null}_maybeCancelLongPressForTouch(e){const{longPressTimeoutId:t}=this.touchState[e];t&&(clearTimeout(t),this.touchState[e]={...this.touchState[e],longPressTimeoutId:null})}_maybeCancelPressAndHoldForTouch(e){const{pressAndHoldIntervalId:t}=this.touchState[e];t&&(clearInterval(t),this.touchState[e]={...this.touchState[e],pressAndHoldIntervalId:null})}_cleanupTouchEvent(e){this._maybeCancelLongPressForTouch(e),this._maybeCancelPressAndHoldForTouch(e),delete this.touchState[e]}_onFocus(e,t){this._maybeCancelLongPressForTouch(t),this._maybeCancelPressAndHoldForTouch(t),this.touchState[t]={...this.touchState[t],activeNodeId:e},this.handlers.onFocus(e),e&&(this.multiPressableKeys.includes(e)?(this.handlers.onTrigger(e),this.touchState[t]={...this.touchState[t],pressAndHoldIntervalId:setInterval((()=>{this.handlers.onTrigger(e)}),this.options.holdIntervalMs)}):this.touchState[t]={...this.touchState[t],longPressTimeoutId:setTimeout((()=>{this.handlers.onLongPress(e),this.touchState[t]={...this.touchState[t],longPressTimeoutId:null}}),this.options.longPressWaitTimeMs)})}_onSwipeStart(){for(const e of Object.keys(this.touchState))this._maybeCancelLongPressForTouch(e),this._maybeCancelPressAndHoldForTouch(e);this.touchState={},this.handlers.onBlur()}onTouchStart(e,t,n){if(this.swipeState)return;if(this.touchState[t])return;const o=e();this.touchState[t]={swipeLocked:this.swipeDisabledNodeIds.includes(o),startX:n},this._onFocus(o,t)}onTouchMove(e,t,n,o){if(this.swipeState)this.swipeState.touchId===t&&this.handlers.onSwipeChange(n-this.swipeState.startX);else if(this.touchState[t]){const{activeNodeId:r,startX:i,swipeLocked:s}=this.touchState[t],a=n-i;if(o&&!s&&Math.abs(a)>this.options.swipeThresholdPx)this._onSwipeStart(),this.swipeState={touchId:t,startX:i},this.handlers.onSwipeChange(n-this.swipeState.startX);else{const n=e();n!==r&&this._onFocus(n,t)}}}onTouchEnd(e,t,n){if(this.swipeState)this.swipeState.touchId===t&&(this.handlers.onSwipeEnd(n-this.swipeState.startX),this.swipeState=null);else if(this.touchState[t]){const{activeNodeId:e,pressAndHoldIntervalId:n}=this.touchState[t];this._cleanupTouchEvent(t);!!n?this.handlers.onBlur():this.handlers.onTouchEnd(e)}}onTouchCancel(e){this.swipeState?this.swipeState.touchId===e&&(this.handlers.onSwipeEnd(0),this.swipeState=null):this.touchState[e]&&(this._cleanupTouchEvent(e),this.handlers.onBlur())}}class we{constructor(){this._nodesById={},this._bordersById={},this._orderedIds=[],this._cachedBoundingBoxesById={},window.addEventListener("resize",(()=>{this._cachedBoundingBoxesById={}}))}registerDOMNode(e,t,n,o){this._nodesById[e]=t,this._bordersById[e]=o;const r=[...n||[],e,...this._orderedIds],i=[],s={};for(const e of r)s[e]||(i.push(e),s[e]=!0);this._orderedIds=i}unregisterDOMNode(e){delete this._nodesById[e]}idForCoords(e,t){for(const n of this._orderedIds){const o=this._nodesById[n];if(o){const r=o.getBoundingClientRect();if(r.left<=e&&r.right>e&&r.top<=t&&r.bottom>t)return this._cachedBoundingBoxesById[n]=r,n}}}layoutPropsForId(e){if(!this._cachedBoundingBoxesById[e]){const t=this._nodesById[e];this._cachedBoundingBoxesById[e]=t?t.getBoundingClientRect():new DOMRect}return{initialBounds:this._cachedBoundingBoxesById[e],borders:this._bordersById[e]}}}class xe{constructor(e){this.handlers=e,this.activePopover=null,this.popovers={}}registerPopover(e,t){this.popovers[e]=t}unregisterPopover(e){delete this.popovers[e]}isPopoverVisible(){return null!=this.activePopover}onBlur(){this.activePopover=null,this.handlers.onActiveNodesChanged({popover:null,focus:null})}onFocus(e){this.activePopover?this._isNodeInsidePopover(this.activePopover,e)?this.handlers.onActiveNodesChanged({popover:{parentId:this.activePopover,childIds:this.popovers[this.activePopover]},focus:e}):this.handlers.onActiveNodesChanged({popover:{parentId:this.activePopover,childIds:this.popovers[this.activePopover]},focus:null}):(this.activePopover=null,this.handlers.onActiveNodesChanged({popover:null,focus:e}))}onLongPress(e){!this.activePopover&&this.popovers[e]&&(this.activePopover=e,this.handlers.onActiveNodesChanged({popover:{parentId:this.activePopover,childIds:this.popovers[this.activePopover]},focus:this._defaultNodeForPopover(this.activePopover)}))}onTrigger(e){this.handlers.onClick(e,e,!1)}onTouchEnd(e){const t=!!this.activePopover;if(t){if(this._isNodeInsidePopover(this.activePopover,e))this.handlers.onClick(e,e,t);else if(this.activePopover===e){const n=this._defaultNodeForPopover(e);this.handlers.onClick(n,n,t)}}else if(this.popovers[e]){const n=this._defaultNodeForPopover(e),o=e;this.handlers.onClick(n,o,t)}else null!=e&&this.onTrigger(e);this.onBlur()}_isNodeInsidePopover(e,t){return this.popovers[e].includes(t)}_defaultNodeForPopover(e){return this.popovers[e][0]}}const Be=e=>[e.changedTouches[0].clientX,e.changedTouches[0].clientY];class Fe{constructor(e,t,n,o){const{swipeEnabled:r}=e;this.swipeEnabled=r,this.trackEvents=!1,this.nodeManager=new we,this.popoverStateMachine=new xe({onActiveNodesChanged:e=>{const{popover:n,...o}=e;t.onActiveNodesChanged({popover:n&&{parentId:n.parentId,bounds:this.nodeManager.layoutPropsForId(n.parentId).initialBounds,childKeyIds:n.childIds},...o})},onClick:(e,n,o)=>{t.onClick(e,this.nodeManager.layoutPropsForId(n),o)}}),this.gestureStateMachine=new Ie({onFocus:e=>{this.popoverStateMachine.onFocus(e)},onLongPress:e=>{this.popoverStateMachine.onLongPress(e)},onTouchEnd:e=>{this.popoverStateMachine.onTouchEnd(e)},onBlur:()=>{this.popoverStateMachine.onBlur()},onSwipeChange:t.onSwipeChange,onSwipeEnd:t.onSwipeEnd,onTrigger:e=>{this.popoverStateMachine.onTrigger(e)}},{},n,o)}onTouchStart(e,t){if(!this.trackEvents)return;const[n]=Be(e);for(let o=0;o<e.changedTouches.length;o++)this.gestureStateMachine.onTouchStart((()=>t),e.changedTouches[o].identifier,n);e.preventDefault()}onTouchMove(e){if(!this.trackEvents)return;const t=this.popoverStateMachine.isPopoverVisible(),n=this.swipeEnabled&&!t,[o,r]=Be(e);for(let t=0;t<e.changedTouches.length;t++)this.gestureStateMachine.onTouchMove((()=>this.nodeManager.idForCoords(o,r)),e.changedTouches[t].identifier,o,n)}onTouchEnd(e){if(!this.trackEvents)return;const[t,n]=Be(e);for(let o=0;o<e.changedTouches.length;o++)this.gestureStateMachine.onTouchEnd((()=>this.nodeManager.idForCoords(t,n)),e.changedTouches[o].identifier,t)}onTouchCancel(e){if(this.trackEvents)for(let t=0;t<e.changedTouches.length;t++)this.gestureStateMachine.onTouchCancel(e.changedTouches[t].identifier)}registerDOMNode(e,t,n,o){this.nodeManager.registerDOMNode(e,t,n,o),this.popoverStateMachine.registerPopover(e,n)}unregisterDOMNode(e){this.nodeManager.unregisterDOMNode(e),this.popoverStateMachine.unregisterPopover(e)}enableEventTracking(){this.trackEvents=!0}disableEventTracking(){this.trackEvents=!1}}class Ue extends v.Component{render(){const{style:e}=this.props,t=[De.container,...Array.isArray(e)?e:[e]];return v.createElement(I,{style:t},v.createElement("svg",{width:ze,height:ze,viewBox:"4 4 8 8"},v.createElement("path",{fill:x,opacity:"0.3",d:"M5.29289322,5.70710678 L10.2928932,10.7071068 C10.9228581,11.3370716 12,10.8909049 12,10 L12,5 C12,4.44771525 11.5522847,4 11,4 L6,4 C5.10909515,4 4.66292836,5.07714192 5.29289322,5.70710678 Z"})))}}P(Ue,"propTypes",{style:T.default.any});const ze=7,De=n.StyleSheet.create({container:{position:"absolute",top:0,right:0,width:ze,height:ze}});var He=n.StyleSheet.create({row:{flexDirection:"row"},column:{flexDirection:"column"},oneColumn:{flexGrow:1},fullWidth:{width:"100%"},stretch:{alignItems:"stretch"},centered:{justifyContent:"center",alignItems:"center"},centeredText:{textAlign:"center"},roundedTopLeft:{borderTopLeftRadius:4},roundedTopRight:{borderTopRightRadius:4}});const{row:qe,centered:Ve}=He;class We extends v.Component{constructor(){super(...arguments),P(this,"_renderMath",(()=>{const{math:e}=this.props;M.default.render(e,C.default.findDOMNode(this))}))}componentDidMount(){this._renderMath()}componentDidUpdate(e){e.math!==this.props.math&&this._renderMath()}render(){const{style:e}=this.props,t=[qe,Ve,Ke.size,Ke.base,...Array.isArray(e)?e:[e]];return v.createElement(I,{style:t})}}P(We,"propTypes",{math:T.default.string.isRequired,style:T.default.any});const Ke=n.StyleSheet.create({size:{height:48,width:48},base:{fontSize:25}});class Qe extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{fill:"none",d:"M13 12h24v24H13z"}),v.createElement("path",{d:"M18.182 29.168c1.386 0 2.226-.602 2.674-1.232l-1.162-1.078a1.707 1.707 0 0 1-1.428.728c-1.078 0-1.834-.798-1.834-1.974s.756-1.96 1.834-1.96c.616 0 1.106.252 1.428.728l1.162-1.092c-.448-.616-1.288-1.218-2.674-1.218-2.086 0-3.584 1.47-3.584 3.542 0 2.086 1.498 3.556 3.584 3.556zm6.972 0c2.24 0 3.584-1.624 3.584-3.556 0-1.918-1.344-3.542-3.584-3.542-2.226 0-3.57 1.624-3.57 3.542 0 1.932 1.344 3.556 3.57 3.556zm0-1.582c-1.106 0-1.722-.91-1.722-1.974 0-1.05.616-1.96 1.722-1.96 1.106 0 1.736.91 1.736 1.96 0 1.064-.63 1.974-1.736 1.974zm7.336 1.582c1.876 0 2.926-.938 2.926-2.17 0-2.73-4.004-1.89-4.004-2.898 0-.378.42-.672 1.064-.672.826 0 1.596.35 2.002.784l.714-1.218c-.672-.532-1.582-.924-2.73-.924-1.778 0-2.772.994-2.772 2.128 0 2.66 4.018 1.75 4.018 2.87 0 .42-.364.728-1.134.728-.84 0-1.848-.462-2.338-.924l-.77 1.246c.714.658 1.848 1.05 3.024 1.05z",fill:this.props.color})))}}P(Qe,"propTypes",{color:T.default.string.isRequired});class je extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{d:"M16.776 29v-9.338h-1.778V29h1.778zm4.9.168c2.24 0 3.584-1.624 3.584-3.556 0-1.918-1.344-3.542-3.584-3.542-2.226 0-3.57 1.624-3.57 3.542 0 1.932 1.344 3.556 3.57 3.556zm0-1.582c-1.106 0-1.722-.91-1.722-1.974 0-1.05.616-1.96 1.722-1.96 1.106 0 1.736.91 1.736 1.96 0 1.064-.63 1.974-1.736 1.974zm7.672 4.158c1.666 0 3.654-.63 3.654-3.206v-6.3H31.21v.868c-.546-.686-1.274-1.036-2.086-1.036-1.708 0-2.982 1.232-2.982 3.444 0 2.254 1.288 3.444 2.982 3.444.826 0 1.554-.392 2.086-1.064v.686c0 1.33-1.008 1.708-1.862 1.708-.854 0-1.568-.238-2.114-.84l-.798 1.288c.854.742 1.75 1.008 2.912 1.008zm.336-4.368c-1.008 0-1.708-.7-1.708-1.862 0-1.162.7-1.862 1.708-1.862.588 0 1.232.322 1.526.77v2.184c-.294.434-.938.77-1.526.77z",fill:this.props.color})))}}P(je,"propTypes",{color:T.default.string.isRequired});class Ge extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{fill:"none",d:"M12 12h24v24H12z"}),v.createElement("path",{d:"M16 21h17M16 27h17",stroke:this.props.color,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})))}}P(Ge,"propTypes",{color:T.default.string.isRequired});class Xe extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{stroke:this.props.color,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M14 29l4 6 9-14h7"})))}}P(Xe,"propTypes",{color:T.default.string.isRequired});class Je extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{d:"M28 16.997c0-.55.453-.997.997-.997h6.006c.55 0 .997.453.997.997v6.006c0 .55-.453.997-.997.997h-6.006c-.55 0-.997-.453-.997-.997v-6.006zM30 18h4v4h-4v-4zM14 21c0-.552.456-1 1.002-1h9.996A1 1 0 0 1 26 21v14c0 .552-.456 1-1.002 1h-9.996A1 1 0 0 1 14 35V21zm2 1h8v12h-8V22z",fill:this.props.color})))}}P(Je,"propTypes",{color:T.default.string.isRequired});class Ye extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{fill:"none",d:"M12 12h24v24H12z"}),v.createElement("path",{d:"M19 33l10-18M16 21h17M16 27h17",stroke:this.props.color,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})))}}P(Ye,"propTypes",{color:T.default.string.isRequired});class Ze extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{fill:"none",d:"M12 12h24v24H12z"}),v.createElement("path",{d:"M16 33h16M16 30l16-6-16-6",stroke:this.props.color,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})))}}P(Ze,"propTypes",{color:T.default.string.isRequired});class $e extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{d:"M20.836 29v-9.338h-1.778V29h1.778zm8.106 0v-4.774c0-1.316-.714-2.156-2.198-2.156-1.106 0-1.932.532-2.366 1.05v-.882H22.6V29h1.778v-4.55c.294-.406.84-.798 1.54-.798.756 0 1.246.322 1.246 1.26V29h1.778z",fill:this.props.color})))}}P($e,"propTypes",{color:T.default.string.isRequired});class et extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{fill:"none",d:"M12 12h24v24H12z"}),v.createElement("path",{d:"M18.655 29.168c1.876 0 2.926-.938 2.926-2.17 0-2.73-4.004-1.89-4.004-2.898 0-.378.42-.672 1.064-.672.826 0 1.596.35 2.002.784l.714-1.218c-.672-.532-1.582-.924-2.73-.924-1.778 0-2.772.994-2.772 2.128 0 2.66 4.018 1.75 4.018 2.87 0 .42-.364.728-1.134.728-.84 0-1.848-.462-2.338-.924l-.77 1.246c.714.658 1.848 1.05 3.024 1.05zm5.124-7.658c.588 0 1.064-.476 1.064-1.064 0-.588-.476-1.05-1.064-1.05a1.06 1.06 0 0 0-1.064 1.05c0 .588.49 1.064 1.064 1.064zm.896 7.49v-6.762h-1.778V29h1.778zm8.106 0v-4.774c0-1.316-.714-2.156-2.198-2.156-1.106 0-1.932.532-2.366 1.05v-.882h-1.778V29h1.778v-4.55c.294-.406.84-.798 1.54-.798.756 0 1.246.322 1.246 1.26V29h1.778z",fill:this.props.color})))}}P(et,"propTypes",{color:T.default.string.isRequired});class tt extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{fill:"none",d:"M12 12h24v24H12z"}),v.createElement("path",{stroke:this.props.color,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M32 30l-16-6 16-6"})))}}P(tt,"propTypes",{color:T.default.string.isRequired});class nt extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{d:"M17.91 23.12c1.66 0 2.76-.81 2.76-1.98 0-.96-.86-1.51-1.57-1.58.79-.13 1.46-.72 1.46-1.5 0-1.1-.95-1.83-2.65-1.83-1.23 0-2.11.45-2.67 1.08l.83 1.08c.47-.42 1.05-.64 1.66-.64.64 0 1.12.19 1.12.61 0 .35-.39.52-1.08.52-.25 0-.77 0-.9-.01v1.53c.1-.01.61-.01.9-.01.91 0 1.19.18 1.19.56 0 .37-.38.65-1.12.65-.58 0-1.34-.23-1.82-.7l-.87 1.17c.52.6 1.48 1.05 2.76 1.05z",fill:this.props.color}),v.createElement("path",{stroke:this.props.color,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M14 29l4 6 9-14h7"})))}}P(nt,"propTypes",{color:T.default.string.isRequired});class ot extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{d:"M19 24h10M24 29V19",stroke:this.props.color,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})))}}P(ot,"propTypes",{color:T.default.string.isRequired});class rt extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{fill:"none",d:"M12 12h24v24H12z"}),v.createElement("path",{d:"M16.93 29.168c.742 0 1.218-.196 1.484-.434l-.378-1.344c-.098.098-.35.196-.616.196-.392 0-.616-.322-.616-.742v-3.052h1.372v-1.554h-1.372V20.39h-1.792v1.848h-1.12v1.554h1.12v3.528c0 1.204.672 1.848 1.918 1.848zM25.232 29v-4.368c0-1.946-1.414-2.562-2.954-2.562-1.064 0-2.128.336-2.954 1.064l.672 1.19c.574-.532 1.246-.798 1.974-.798.896 0 1.484.448 1.484 1.134v.91c-.448-.532-1.246-.826-2.142-.826-1.078 0-2.352.602-2.352 2.184 0 1.512 1.274 2.24 2.352 2.24.882 0 1.68-.322 2.142-.868v.7h1.778zm-3.206-1.036c-.7 0-1.274-.364-1.274-.994 0-.658.574-1.022 1.274-1.022.574 0 1.134.196 1.428.588v.84c-.294.392-.854.588-1.428.588zM33.338 29v-4.774c0-1.316-.714-2.156-2.198-2.156-1.106 0-1.932.532-2.366 1.05v-.882h-1.778V29h1.778v-4.55c.294-.406.84-.798 1.54-.798.756 0 1.246.322 1.246 1.26V29h1.778z",fill:this.props.color})))}}P(rt,"propTypes",{color:T.default.string.isRequired});const it=e=>v.createElement("g",k({fill:"none",fillRule:"evenodd"},e),v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{fill:"none",d:"M12 12h24v24H12z"}),v.createElement("path",{stroke:"#888D93",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M22 18l-6 6 6 6M16 24h16"}));class st extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{fill:"none",d:"M12 12h24v24H12z"}),v.createElement("path",{d:"M26 14c-4 6-4 14 0 20",stroke:this.props.color,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})))}}P(st,"propTypes",{color:T.default.string.isRequired});class at extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{fill:"none",d:"M12 12h24v24H12z"}),v.createElement("path",{d:"M23 14c4 6 4 14 0 20",stroke:this.props.color,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})))}}P(at,"propTypes",{color:T.default.string.isRequired});class lt extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{fill:"none",d:"M12 12h24v24H12z"}),v.createElement("path",{stroke:this.props.color,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M16 30l16-6-16-6"})))}}P(lt,"propTypes",{color:T.default.string.isRequired});class dt extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{d:"M19 24h10",stroke:this.props.color,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),v.createElement("circle",{fill:this.props.color,cx:"24",cy:"19.5",r:"1.5"}),v.createElement("circle",{fill:this.props.color,cx:"24",cy:"28.5",r:"1.5"})))}}P(dt,"propTypes",{color:T.default.string.isRequired});class ct extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("circle",{fill:this.props.color,cx:"24",cy:"30",r:"2"})))}}P(ct,"propTypes",{color:T.default.string.isRequired});class ht extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("g",{transform:"translate(12 12)"},v.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),v.createElement("path",{d:"M16 4L8 20",stroke:this.props.color,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),v.createElement("circle",{stroke:this.props.color,strokeWidth:"2",cx:"7",cy:"7",r:"3"}),v.createElement("circle",{stroke:this.props.color,strokeWidth:"2",cx:"17",cy:"17",r:"3"}))))}}P(ht,"propTypes",{color:T.default.string.isRequired});class ut extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{fill:"none",d:"M12 12h24v24H12z"}),v.createElement("path",{d:"M20 20l8 8M28 20l-8 8",stroke:this.props.color,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})))}}P(ut,"propTypes",{color:T.default.string.isRequired});class pt extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{d:"M14 21c0-.552.456-1 1.002-1h9.996A1 1 0 0 1 26 21v14c0 .552-.456 1-1.002 1h-9.996A1 1 0 0 1 14 35V21zm2 1h8v12h-8V22zM30.92 23.12c1.66 0 2.76-.81 2.76-1.98 0-.96-.86-1.51-1.57-1.58.79-.13 1.46-.72 1.46-1.5 0-1.1-.95-1.83-2.65-1.83-1.23 0-2.11.45-2.67 1.08l.83 1.08c.47-.42 1.05-.64 1.66-.64.64 0 1.12.19 1.12.61 0 .35-.39.52-1.08.52-.25 0-.77 0-.9-.01v1.53c.1-.01.61-.01.9-.01.91 0 1.19.18 1.19.56 0 .37-.38.65-1.12.65-.58 0-1.34-.23-1.82-.7l-.87 1.17c.52.6 1.48 1.05 2.76 1.05z",fill:this.props.color})))}}P(pt,"propTypes",{color:T.default.string.isRequired});class mt extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{d:"M14 21c0-.552.456-1 1.002-1h9.996A1 1 0 0 1 26 21v14c0 .552-.456 1-1.002 1h-9.996A1 1 0 0 1 14 35V21zm2 1h8v12h-8V22zM33.67 23v-1.5h-2.44c1.66-1.16 2.39-2.03 2.39-3.05 0-1.34-1.13-2.22-2.7-2.22-.93 0-1.99.33-2.7 1.11l.95 1.14c.48-.45 1.04-.73 1.78-.73.49 0 .92.24.92.7 0 .66-.54 1.12-3.43 3.21V23h5.23z",fill:this.props.color})))}}P(mt,"propTypes",{color:T.default.string.isRequired});class ft extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("g",{transform:"translate(12 12)"},v.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),v.createElement("circle",{fill:this.props.color,cx:"12",cy:"12",r:"3"}))))}}P(ft,"propTypes",{color:T.default.string.isRequired});class Et extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{d:"M30 28.997c0-.55.453-.997.997-.997h6.006c.55 0 .997.453.997.997v6.006c0 .55-.453.997-.997.997h-6.006c-.55 0-.997-.453-.997-.997v-6.006zM32 30h4v4h-4v-4zM12.776 29v-9.338h-1.778V29h1.778zm4.9.168c2.24 0 3.584-1.624 3.584-3.556 0-1.918-1.344-3.542-3.584-3.542-2.226 0-3.57 1.624-3.57 3.542 0 1.932 1.344 3.556 3.57 3.556zm0-1.582c-1.106 0-1.722-.91-1.722-1.974 0-1.05.616-1.96 1.722-1.96 1.106 0 1.736.91 1.736 1.96 0 1.064-.63 1.974-1.736 1.974zm7.672 4.158c1.666 0 3.654-.63 3.654-3.206v-6.3H27.21v.868c-.546-.686-1.274-1.036-2.086-1.036-1.708 0-2.982 1.232-2.982 3.444 0 2.254 1.288 3.444 2.982 3.444.826 0 1.554-.392 2.086-1.064v.686c0 1.33-1.008 1.708-1.862 1.708-.854 0-1.568-.238-2.114-.84l-.798 1.288c.854.742 1.75 1.008 2.912 1.008zm.336-4.368c-1.008 0-1.708-.7-1.708-1.862 0-1.162.7-1.862 1.708-1.862.588 0 1.232.322 1.526.77v2.184c-.294.434-.938.77-1.526.77z",fill:this.props.color})))}}P(Et,"propTypes",{color:T.default.string.isRequired});class gt extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{fill:"none",d:"M12 12h24v24H12z"}),v.createElement("path",{d:"M16 33h16M32 30l-16-6 16-6",stroke:this.props.color,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})))}}P(gt,"propTypes",{color:T.default.string.isRequired});class yt extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{d:"M19 24h10",stroke:this.props.color,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})))}}P(yt,"propTypes",{color:T.default.string.isRequired});class Tt extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{d:"M13 16.997c0-.55.453-.997.997-.997h6.006c.55 0 .997.453.997.997v6.006c0 .55-.453.997-.997.997h-6.006c-.55 0-.997-.453-.997-.997v-6.006zM15 18h4v4h-4v-4z",fill:this.props.color}),v.createElement("path",{stroke:this.props.color,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M14 29l4 6 9-14h7"})))}}P(Tt,"propTypes",{color:T.default.string.isRequired});class vt extends v.Component{render(){return v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("g",{transform:"translate(12 12)"},v.createElement("path",{fill:"none",d:"M0 0h24v24H0z"}),v.createElement("path",{d:"M8 16.997c0-.55.453-.997.997-.997h6.006c.55 0 .997.453.997.997v6.006c0 .55-.453.997-.997.997H8.997c-.55 0-.997-.453-.997-.997v-6.006zM10 18h4v4h-4v-4z",fill:this.props.color}),v.createElement("rect",{fill:this.props.color,x:"2",y:"11",width:"20",height:"2",rx:"1"}),v.createElement("path",{d:"M8 .997C8 .447 8.453 0 8.997 0h6.006c.55 0 .997.453.997.997v6.006c0 .55-.453.997-.997.997H8.997C8.447 8 8 7.547 8 7.003V.997zM10 2h4v4h-4V2z",fill:this.props.color}))))}}P(vt,"propTypes",{color:T.default.string.isRequired});var Ct=Object.freeze({__proto__:null,COS:Qe,LOG:je,EQUAL:Ge,BACKSPACE:()=>v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{d:"M13 24l6 6h14V18H19l-6 6zm-1.414-1.414l6-6A2 2 0 0 1 19 16h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H19a2 2 0 0 1-1.414-.586l-6-6a2 2 0 0 1 0-2.828z",fill:"#888D93"}),v.createElement("path",{d:"M23 21l6 6M29 21l-6 6",stroke:"#888D93",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))),SQRT:Xe,EXP:Je,NEQ:Ye,GEQ:Ze,LN:$e,DISMISS:()=>v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{d:"M18 21l6 6 6-6",strokeLinecap:"round",strokeWidth:"2",stroke:"#71B307",strokeLinejoin:"round"}))),SIN:et,LT:tt,CUBE_ROOT:nt,PLUS:ot,TAN:rt,LEFT:()=>v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement(it,null)),UP:()=>v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement(it,{transform:"rotate(90 24 24)"})),DOWN:()=>v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement(it,{transform:"rotate(270 24 24)"})),LEFT_PAREN:st,RIGHT_PAREN:at,GT:lt,DIVIDE:dt,PERIOD:ct,PERCENT:ht,TIMES:ut,EXP_3:pt,EXP_2:mt,RIGHT:()=>v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement(it,{transform:"rotate(180 24 24)"})),CDOT:ft,LOG_N:Et,LEQ:gt,MINUS:yt,NEGATIVE:yt,RADICAL:Tt,FRAC:vt,JUMP_OUT_PARENTHESES:()=>v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{fill:"none",d:"M12 12h24v24H12z"}),v.createElement("path",{d:"M24 18c3 3 3 9 0 12M18 18c-3 3-3 9 0 12",stroke:"#888D93",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),v.createElement("path",{stroke:"#78C008",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M32 27l3-3-3-3M22 24h12"}))),JUMP_OUT_EXPONENT:()=>v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{fill:"none",d:"M12 12h24v24H12z"}),v.createElement("path",{d:"M35 19v16M23 19l8 8M31 23v4h-4",stroke:"#78C008",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),v.createElement("path",{d:"M12 12.997c0-.55.453-.997.997-.997h6.006c.55 0 .997.453.997.997v6.006c0 .55-.453.997-.997.997h-6.006c-.55 0-.997-.453-.997-.997v-6.006zM14 14h4v4h-4v-4z",fill:"#888D93"}))),JUMP_OUT_BASE:()=>v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{fill:"none",d:"M12 12h24v24H12z"}),v.createElement("path",{d:"M12 28.997c0-.55.453-.997.997-.997h6.006c.55 0 .997.453.997.997v6.006c0 .55-.453.997-.997.997h-6.006c-.55 0-.997-.453-.997-.997v-6.006zM14 30h4v4h-4v-4z",fill:"#888D93"}),v.createElement("path",{d:"M35 13v16M23 29l8-8M27 21h4v4",stroke:"#78C008",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))),JUMP_INTO_NUMERATOR:()=>v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{fill:"none",d:"M12 12h24v24H12z"}),v.createElement("path",{d:"M13 16v16M17 22l6-6M23 20v-4h-4",stroke:"#78C008",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),v.createElement("path",{d:"M26 27.997c0-.55.453-.997.997-.997h6.006c.55 0 .997.453.997.997v6.006c0 .55-.453.997-.997.997h-6.006c-.55 0-.997-.453-.997-.997v-6.006zM28 29h4v4h-4v-4z",fill:"#888D93"}),v.createElement("path",{d:"M35 24H25",stroke:"#888D93",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),v.createElement("path",{d:"M26 13.997c0-.55.453-.997.997-.997h6.006c.55 0 .997.453.997.997v6.006c0 .55-.453.997-.997.997h-6.006c-.55 0-.997-.453-.997-.997v-6.006zM28 15h4v4h-4v-4z",fill:"#78C008"}))),JUMP_OUT_NUMERATOR:()=>v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{fill:"none",d:"M0 0h48v48H0z"}),v.createElement("path",{fill:"none",d:"M12 12h24v24H12z"}),v.createElement("path",{stroke:"#78C008",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M33 29l-3 3-3-3M30 18v14"}),v.createElement("path",{d:"M16 27.997c0-.55.453-.997.997-.997h6.006c.55 0 .997.453.997.997v6.006c0 .55-.453.997-.997.997h-6.006c-.55 0-.997-.453-.997-.997v-6.006zM18 29h4v4h-4v-4z",fill:"#78C008"}),v.createElement("path",{d:"M25 24H15",stroke:"#888D93",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),v.createElement("path",{d:"M16 13.997c0-.55.453-.997.997-.997h6.006c.55 0 .997.453.997.997v6.006c0 .55-.453.997-.997.997h-6.006c-.55 0-.997-.453-.997-.997v-6.006zM18 15h4v4h-4v-4z",fill:"#888D93"}))),JUMP_OUT_DENOMINATOR:()=>v.createElement("svg",{width:"48",height:"48",viewBox:"0 0 48 48"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("path",{d:"M0 0h48v48H0z"}),v.createElement("path",{d:"M12 12h24v24H12z"}),v.createElement("path",{d:"M35 16v16m-4-4v-4h-4m-2 6l6-6",stroke:"#78C008",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),v.createElement("path",{d:"M14 27.997c0-.55.453-.997.997-.997h6.006c.55 0 .997.453.997.997v6.006c0 .55-.453.997-.997.997h-6.006c-.55 0-.997-.453-.997-.997v-6.006zM16 29h4v4h-4v-4z",fill:"#888D93"}),v.createElement("path",{d:"M23 24H13",stroke:"#888D93",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),v.createElement("path",{d:"M14 13.997c0-.55.453-.997.997-.997h6.006c.55 0 .997.453.997.997v6.006c0 .55-.453.997-.997.997h-6.006c-.55 0-.997-.453-.997-.997v-6.006zM16 15h4v4h-4v-4z",fill:"#888D93"})))});class _t extends v.Component{render(){const{color:e,name:t}=this.props,n=Ct[t];return v.createElement(n,{color:e})}}P(_t,"propTypes",{color:T.default.string.isRequired,name:T.default.string.isRequired});const{row:bt,centered:Rt}=He;class Mt extends v.Component{render(){const{character:e,style:t}=this.props,n=[bt,Rt,Nt.size,Nt.base,...Array.isArray(t)?t:[t]];return v.createElement(I,{style:n},v.createElement(S,null,e))}}P(Mt,"propTypes",{character:T.default.string.isRequired,style:T.default.any});const Nt=n.StyleSheet.create({size:{height:48,width:48},base:{fontFamily:"Proxima Nova",fontSize:25}}),Ot=x;class Pt extends v.PureComponent{render(){const{focused:e,icon:t,style:n}=this.props,o=[e?kt.focused:kt.unfocused,...Array.isArray(n)?n:[n]];switch(t.type){case j.MATH:return v.createElement(We,{math:t.data,style:o});case j.SVG:return v.createElement(_t,{name:t.data,color:e?"#FFF":Ot});case j.TEXT:return v.createElement(Mt,{character:t.data,style:o})}throw new Error("No icon or symbol provided")}}P(Pt,"propTypes",{focused:T.default.bool,icon:ne.isRequired,style:T.default.any});const kt=n.StyleSheet.create({unfocused:{color:Ot},focused:{color:"#FFF"}}),{row:Lt,column:St,centered:At,fullWidth:It}=He;class wt extends v.Component{render(){const{focused:e,icons:t}=this.props;if(t.forEach((e=>{if(e.type!==j.MATH)throw new Error("Received invalid icon: type=".concat(e.type,", ")+"data=".concat(e.data))})),1===t.length)return v.createElement(Pt,{icon:t[0],focused:e});{const n=xt.base,o=[xt.base,xt.secondary];if(2===t.length)return v.createElement(I,{style:[Lt,xt.size]},v.createElement(I,{style:[St,At,It,xt.middleLeft]},v.createElement(Pt,{style:n,icon:t[0],focused:e})),v.createElement(I,{style:[St,At,It,xt.middleRight]},v.createElement(Pt,{style:o,icon:t[1],focused:e})));if(t.length>=3)return v.createElement(I,{style:[St,xt.size]},v.createElement(I,{style:Lt},v.createElement(I,{style:[At,It,xt.topLeft]},v.createElement(Pt,{style:n,icon:t[0],focused:e})),v.createElement(I,{style:[At,It,xt.topRight]},v.createElement(Pt,{style:o,icon:t[1],focused:e}))),v.createElement(I,{style:Lt},v.createElement(I,{style:[At,It,xt.bottomLeft]},v.createElement(Pt,{style:o,icon:t[2],focused:e})),v.createElement(I,{style:[At,It,xt.bottomRight]},t[3]&&v.createElement(Pt,{style:o,icon:t[3],focused:e}))))}throw new Error("Invalid number of icons:",t.length)}}P(wt,"propTypes",{focused:T.default.bool,icons:T.default.arrayOf(ne).isRequired});const xt=n.StyleSheet.create({size:{height:48,width:48},bottomLeft:{marginBottom:2,marginLeft:4},topLeft:{marginTop:2,marginLeft:4},topRight:{marginTop:2,marginRight:4},bottomRight:{marginBottom:2,marginRight:4},middleLeft:{marginLeft:4},middleRight:{marginRight:4},base:{fontSize:18},secondary:{opacity:.3}});class Bt extends v.PureComponent{constructor(){super(...arguments),P(this,"_preInjectStyles",(()=>{for(const e of Object.keys(z)){n.css(I.styles.initial,...this._getFocusStyle(e));for(const t of Object.values(Q))n.css(I.styles.initial,...this._getButtonStyle(e,t))}})),P(this,"_getFocusStyle",(e=>{let t;return t=e===z.INPUT_NAVIGATION||e===z.KEYPAD_NAVIGATION?Ft.light:Ft.bright,[Ft.focusBox,t]})),P(this,"_getButtonStyle",((e,t,n)=>{let o;switch(e){case z.EMPTY:o=Ft.empty;break;case z.MANY:case z.VALUE:o=Ft.value;break;case z.OPERATOR:o=Ft.operator;break;case z.INPUT_NAVIGATION:case z.KEYPAD_NAVIGATION:o=Ft.control;break;case z.ECHO:o=null}const r=[];return-1!==t.indexOf(K.LEFT)&&r.push(Ft.leftBorder),-1!==t.indexOf(K.BOTTOM)&&r.push(Ft.bottomBorder),[Ft.buttonBase,o,...r,e===z.ECHO&&Ft.echo,this.buttonSizeStyle,...Array.isArray(n)?n:[n]]}))}UNSAFE_componentWillMount(){this.buttonSizeStyle=Ut(this.props.heightPx,this.props.widthPx)}componentDidMount(){this._preInjectStyles()}UNSAFE_componentWillUpdate(e,t){e.heightPx===this.props.heightPx&&e.widthPx===this.props.widthPx||(this.buttonSizeStyle=Ut(e.heightPx,e.widthPx),this._preInjectStyles())}render(){const{ariaLabel:e,borders:t,childKeys:n,disabled:o,focused:r,icon:i,onTouchCancel:s,onTouchEnd:a,onTouchMove:l,onTouchStart:d,popoverEnabled:c,style:h,type:u}=this.props,p=!o&&r||c||u===z.ECHO,m=this._getButtonStyle(u,t,h),f=this._getFocusStyle(u),E=[Ft.iconWrapper,o&&Ft.disabled],g={onTouchCancel:s,onTouchEnd:a,onTouchMove:l,onTouchStart:d},y=p&&v.createElement(I,{style:f}),T=!p&&!o&&n&&n.length>0&&v.createElement(Ue,{style:Ft.decalInset});if(u===z.EMPTY)return v.createElement(I,k({style:m},g));if(u===z.MANY){const e={role:"button",ariaLabel:n[0].ariaLabel},t=n.map((e=>e.icon));return v.createElement(I,k({style:m},g,e),y,v.createElement(I,{style:E},v.createElement(wt,{icons:t,focused:p})),T)}{const t={role:"button",ariaLabel:e};return v.createElement(I,k({style:m},g,t),y,v.createElement(I,{style:E},v.createElement(Pt,{icon:i,focused:p})),T)}}}P(Bt,"propTypes",{ariaLabel:T.default.string,borders:ae,childKeys:T.default.arrayOf(re),disabled:T.default.bool,focused:T.default.bool,heightPx:T.default.number.isRequired,icon:ne,onTouchCancel:T.default.func,onTouchEnd:T.default.func,onTouchMove:T.default.func,onTouchStart:T.default.func,popoverEnabled:T.default.bool,style:T.default.any,type:T.default.oneOf(Object.keys(z)).isRequired,widthPx:T.default.number.isRequired}),P(Bt,"defaultProps",{borders:Q.ALL,childKeys:[],disabled:!1,focused:!1,popoverEnabled:!1});const Ft=n.StyleSheet.create({buttonBase:{"-webkit-box-flex":"1",flex:1,cursor:"pointer",userSelect:"none",justifyContent:"center",alignItems:"center",borderColor:F,borderStyle:"solid",boxSizing:"border-box"},decalInset:{top:4,right:4},echo:{borderColor:"transparent"},value:{backgroundColor:"#FFF"},operator:{backgroundColor:"#FAFAFA"},control:{backgroundColor:"#F6F7F7"},empty:{backgroundColor:"#F0F1F2",cursor:"default"},bright:{backgroundColor:w},light:{backgroundColor:"rgba(33, 36, 44, 0.1)"},iconWrapper:{zIndex:1},focusBox:{position:"absolute",zIndex:0,left:4,right:4,bottom:4,top:4,borderRadius:1},disabled:{opacity:.3},leftBorder:{borderLeftWidth:1},bottomBorder:{borderBottomWidth:1}}),Ut=(e,t)=>n.StyleSheet.create({buttonSize:{height:e,width:t,maxWidth:t}}).buttonSize;var zt=l.connect((e=>e.layout.buttonDimensions),null,null,{forwardRef:!0})(Bt);class Dt extends v.Component{render(){const{gestureManager:e,...t}=this.props;return v.createElement(zt,k({onTouchStart:t=>e.onTouchStart(t),onTouchEnd:t=>e.onTouchEnd(t),onTouchMove:t=>e.onTouchMove(t),onTouchCancel:t=>e.onTouchCancel(t)},Z.NOOP,t))}}P(Dt,"propTypes",{gestureManager:T.default.instanceOf(Fe)});var Ht=l.connect((e=>{const{gestures:t}=e;return{gestureManager:t.gestureManager}}),null,null,{forwardRef:!0})(Dt);class qt extends v.Component{shouldComponentUpdate(e){return e.id!==this.props.id||e.gestureManager!==this.props.gestureManager||e.focused!==this.props.focused||e.disabled!==this.props.disabled||e.popoverEnabled!==this.props.popoverEnabled||e.type!==this.props.type||!!e.style}componentWillUnmount(){const{gestureManager:e,id:t}=this.props;e.unregisterDOMNode(t)}render(){const{borders:e,childKeyIds:t,disabled:n,gestureManager:o,id:r,style:i,...s}=this.props,a=n?{onTouchStart:e=>e.preventDefault()}:{onTouchStart:e=>o.onTouchStart(e,r),onTouchEnd:e=>o.onTouchEnd(e),onTouchMove:e=>o.onTouchMove(e),onTouchCancel:e=>o.onTouchCancel(e)},l=[...Array.isArray(i)?i:[i],Wt.preventScrolls];return v.createElement(zt,k({ref:n=>o.registerDOMNode(r,C.default.findDOMNode(n),t,e),borders:e,disabled:n,style:l},a,s))}}P(qt,"propTypes",{borders:ae,childKeyIds:T.default.arrayOf(oe),disabled:T.default.bool,focused:T.default.bool,gestureManager:T.default.instanceOf(Fe),id:oe.isRequired,popoverEnabled:T.default.bool,style:T.default.any,type:T.default.oneOf(Object.keys(z)).isRequired});const Vt=e=>{const{ariaLabel:t,icon:n,type:o}=e;return{ariaLabel:t,icon:n,type:o}},Wt=n.StyleSheet.create({preventScrolls:{touchAction:"none"}});var Kt=l.connect(((e,t)=>{const{gestures:n}=e,{keyConfig:o,...r}=t,{id:i,childKeyIds:s,type:a}=o,l=s&&s.map((e=>Z[e])),d=a!==z.MANY&&l&&l.length>0;return{...r,childKeyIds:s,gestureManager:n.gestureManager,id:i,focused:n.focus===i,popoverEnabled:n.popover&&n.popover.parentId===i,childKeys:l,...Vt(d?l[0]:o)}}),null,null,{forwardRef:!0})(qt);class Qt extends v.Component{render(){const{keys:e,...t}=this.props;if(0===e.length)return v.createElement(Ht,t);if(1===e.length){const n=Z[e[0]];return v.createElement(Kt,k({keyConfig:n},t))}{const n={id:L.MANY,type:z.MANY,childKeyIds:e};return v.createElement(Kt,k({keyConfig:n},t))}}}P(Qt,"propTypes",{keys:T.default.arrayOf(oe).isRequired});class jt extends v.Component{componentDidMount(){const{animationDurationMs:e,onAnimationFinish:t}=this.props;setTimeout((()=>t()),e)}render(){const{borders:e,id:t,initialBounds:n}=this.props,{icon:o}=Z[t],r={zIndex:2,position:"absolute",pointerEvents:"none",...n};return v.createElement("div",{style:r},v.createElement(zt,{name:t,icon:o,type:z.ECHO,borders:e}))}}P(jt,"propTypes",{animationDurationMs:T.default.number.isRequired,borders:ae,id:oe.isRequired,initialBounds:le.isRequired,onAnimationFinish:T.default.func.isRequired});class Gt extends v.Component{constructor(){super(...arguments),P(this,"_animationConfigForType",(e=>{let t,n;switch(e){case J.SLIDE_AND_FADE:t=400,n="echo-slide-and-fade";break;case J.FADE_ONLY:t=300,n="echo-fade-only";break;case J.LONG_FADE_ONLY:t=400,n="echo-long-fade-only";break;default:throw new Error("Invalid echo animation type:",e)}return{animationDurationMs:t,animationTransitionName:n}}))}render(){const{echoes:e,onAnimationFinish:t}=this.props;return v.createElement("span",null,Object.keys(J).map((n=>{const{animationDurationMs:o,animationTransitionName:r}=this._animationConfigForType(n),i=e.filter((e=>e.animationType===n));return v.createElement(h.TransitionGroup,{key:n},i.map((e=>{const{animationId:n}=e;return v.createElement(h.CSSTransition,{classNames:r,enter:!0,exit:!1,timeout:{enter:o},key:n},v.createElement(jt,k({animationDurationMs:o,onAnimationFinish:()=>t(n)},e)))})))})))}}P(Gt,"propTypes",{echoes:T.default.arrayOf(de),onAnimationFinish:T.default.func.isRequired});class Xt extends v.Component{render(){const{keys:e}=this.props;return v.createElement(I,{style:Jt.container},e.map((e=>v.createElement(Kt,{key:e.id,keyConfig:e,borders:Q.NONE}))))}}P(Xt,"propTypes",{keys:T.default.arrayOf(re)});const Jt=n.StyleSheet.create({container:{flexDirection:"column-reverse",position:"relative",width:"100%",borderRadius:2,boxShadow:"0 2px 6px rgba(0, 0, 0, 0.3)",zIndex:1},popoverButton:{backgroundColor:"#FFF",borderWidth:0}});class Yt extends v.Component{render(){const{bounds:e,childKeys:t}=this.props,n={position:"absolute",...e};return v.createElement("div",{style:n},v.createElement(Xt,{keys:t}))}}P(Yt,"propTypes",{bounds:le.isRequired,childKeys:T.default.arrayOf(re).isRequired});class Zt extends v.Component{render(){const{popover:e}=this.props;return e?v.createElement(h.CSSTransition,{in:!0,classNames:"popover",enter:!0,exit:!1,timeout:{enter:200}},v.createElement(Yt,{key:e.childKeyIds[0],bounds:e.bounds,childKeys:e.childKeyIds.map((e=>Z[e]))})):null}}P(Zt,"propTypes",{popover:he});class $t extends v.Component{constructor(){super(...arguments),P(this,"_computeContainer",(()=>{const e=C.default.findDOMNode(this);this._container=e.getBoundingClientRect()})),P(this,"_updateSizeAndPosition",(()=>{this._container=null})),P(this,"_onResize",(()=>{null==this._resizeTimeout&&(this._resizeTimeout=setTimeout((()=>{this._resizeTimeout=null,this._isMounted&&this._updateSizeAndPosition()}),66))}))}componentDidMount(){this._isMounted=!0,window.addEventListener("resize",this._onResize),this._updateSizeAndPosition()}UNSAFE_componentWillReceiveProps(e){this._container||!e.popover&&!e.echoes.length||this._computeContainer()}componentWillUnmount(){this._isMounted=!1,window.removeEventListener("resize",this._onResize)}render(){const{children:e,echoes:t,removeEcho:n,popover:o,style:r}=this.props,i=t.map((e=>{const{initialBounds:t,...n}=e;return{...n,initialBounds:{top:t.top-this._container.top,right:t.right-this._container.left,bottom:t.bottom-this._container.top,left:t.left-this._container.left,width:t.width,height:t.height}}})),s=o&&{...o,bounds:{bottom:this._container.height-(o.bounds.bottom-this._container.top),left:o.bounds.left-this._container.left,width:o.bounds.width}};return v.createElement(I,{style:r},e,v.createElement(Gt,{echoes:i,onAnimationFinish:n}),v.createElement(Zt,{popover:s}))}}P($t,"propTypes",{children:T.default.oneOfType([T.default.arrayOf(T.default.node),T.default.node]),removeEcho:T.default.func.isRequired,style:T.default.any,active:T.default.bool,echoes:T.default.arrayOf(de).isRequired,popover:he});var en=l.connect((e=>({...e.echoes,active:e.keypad.active,popover:e.gestures.popover})),(e=>({removeEcho:t=>{e((e=>({type:"RemoveEcho",animationId:e}))(t))}})),null,{forwardRef:!0})($t);function tn(e){let{tintColor:t,type:n}=e;if("Geometry"===n)return v.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.57584 7.09442C7.92723 6.92984 8.3421 6.98339 8.64018 7.23179L26.6402 22.2318C26.9636 22.5013 27.0836 22.9446 26.9403 23.3404C26.7969 23.7363 26.421 24 26 24H8C7.44772 24 7 23.5523 7 23V8.00001C7 7.61199 7.22446 7.259 7.57584 7.09442ZM9 10.1351V17H13C13.5523 17 14 17.4477 14 18V22H23.238L9 10.1351ZM12 22V19H9V22H12Z",fill:t}));if("Operators"===n)return v.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29 6H30V7H29V6ZM27 6C27 4.89543 27.8954 4 29 4H30C31.1046 4 32 4.89543 32 6V7C32 8.10457 31.1046 9 30 9H29C27.8954 9 27 8.10457 27 7V6ZM11.1318 6.50386C11.3098 6.19229 11.6411 6 12 6H14C14.5523 6 15 6.44772 15 7C15 7.55228 14.5523 8 14 8H12.5803L8.86824 14.4961C8.68527 14.8163 8.34091 15.0098 7.97225 14.9996C7.6036 14.9894 7.2705 14.7771 7.10557 14.4472L5.10557 10.4472C4.85858 9.95324 5.05881 9.35256 5.55279 9.10557C6.04676 8.85858 6.64744 9.05881 6.89443 9.55279L8.0588 11.8815L11.1318 6.50386ZM7.70676 16.2925C8.09748 16.6829 8.09779 17.316 7.70745 17.7068C7.28543 18.1292 6.84383 18.7303 6.51157 19.3658C6.17039 20.0184 6 20.601 6 21C6 21.3789 6.17235 21.9897 6.51638 22.6649C6.85315 23.3259 7.28488 23.9121 7.66786 24.2557C8.07892 24.6246 8.11314 25.2568 7.74429 25.6679C7.37544 26.0789 6.7432 26.1131 6.33214 25.7443C5.7161 25.1915 5.14783 24.3844 4.73434 23.5728C4.32813 22.7755 3.99999 21.8345 4 21C4.00001 20.1391 4.3301 19.2217 4.73917 18.4392C5.15715 17.6397 5.71554 16.8708 6.29255 16.2932C6.68288 15.9025 7.31605 15.9022 7.70676 16.2925ZM11.2932 16.2925C11.684 15.9022 12.3171 15.9025 12.7075 16.2932C13.2845 16.8708 13.8428 17.6397 14.2608 18.4392C14.6699 19.2217 15 20.1391 15 21C15 21.8345 14.6719 22.7755 14.2657 23.5728C13.8522 24.3844 13.2839 25.1915 12.6679 25.7443C12.2568 26.1131 11.6246 26.0789 11.2557 25.6679C10.8869 25.2568 10.9211 24.6246 11.3321 24.2557C11.7151 23.9121 12.1469 23.3259 12.4836 22.6649C12.8276 21.9897 13 21.3789 13 21C13 20.601 12.8296 20.0184 12.4884 19.3658C12.1562 18.7303 11.7146 18.1292 11.2925 17.7068C10.9022 17.316 10.9025 16.6829 11.2932 16.2925ZM27.9363 17.6489C28.1302 18.166 27.8682 18.7424 27.3511 18.9363L21.848 21L27.3511 23.0637C27.8682 23.2576 28.1302 23.834 27.9363 24.3511C27.7424 24.8682 27.166 25.1302 26.6489 24.9363L18.6489 21.9363C18.2586 21.79 18 21.4168 18 21C18 20.5832 18.2586 20.21 18.6489 20.0637L26.6489 17.0637C27.166 16.8698 27.7424 17.1318 27.9363 17.6489ZM21 8V13H24V8H21ZM20 6C19.4477 6 19 6.44772 19 7V14C19 14.5523 19.4477 15 20 15H25C25.5523 15 26 14.5523 26 14V7C26 6.44772 25.5523 6 25 6H20Z",fill:t}));if("Numbers"===n)return v.createElement("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v.createElement("path",{d:"M10.4123 19.5794V21.0004H4.71434V19.5794H6.73034V14.0214C6.73034 13.9001 6.73267 13.7764 6.73734 13.6504C6.742 13.5244 6.749 13.3961 6.75834 13.2654L5.42834 14.3714C5.335 14.4414 5.244 14.4858 5.15534 14.5044C5.06667 14.5231 4.98267 14.5254 4.90334 14.5114C4.824 14.4928 4.754 14.4648 4.69334 14.4274C4.63267 14.3854 4.586 14.3434 4.55334 14.3014L3.94434 13.4824L7.06634 10.8364H8.65534V19.5794H10.4123ZM18.7924 19.2294C19.0024 19.2294 19.1658 19.2878 19.2824 19.4044C19.4038 19.5211 19.4644 19.6751 19.4644 19.8664V21.0004H12.4224V20.3704C12.4224 20.2491 12.4481 20.1184 12.4994 19.9784C12.5508 19.8338 12.6371 19.7031 12.7584 19.5864L15.7684 16.5694C16.0251 16.3128 16.2514 16.0678 16.4474 15.8344C16.6434 15.5964 16.8068 15.3654 16.9374 15.1414C17.0681 14.9128 17.1661 14.6818 17.2314 14.4484C17.2968 14.2151 17.3294 13.9701 17.3294 13.7134C17.3294 13.2608 17.2128 12.9178 16.9794 12.6844C16.7461 12.4464 16.4171 12.3274 15.9924 12.3274C15.8058 12.3274 15.6331 12.3554 15.4744 12.4114C15.3204 12.4628 15.1804 12.5351 15.0544 12.6284C14.9331 12.7218 14.8281 12.8314 14.7394 12.9574C14.6508 13.0834 14.5854 13.2211 14.5434 13.3704C14.4594 13.6038 14.3451 13.7601 14.2004 13.8394C14.0604 13.9141 13.8598 13.9304 13.5984 13.8884L12.5764 13.7064C12.6511 13.2118 12.7911 12.7778 12.9964 12.4044C13.2018 12.0311 13.4584 11.7208 13.7664 11.4734C14.0744 11.2261 14.4268 11.0418 14.8234 10.9204C15.2201 10.7944 15.6471 10.7314 16.1044 10.7314C16.5851 10.7314 17.0214 10.8038 17.4134 10.9484C17.8101 11.0884 18.1484 11.2868 18.4284 11.5434C18.7084 11.7954 18.9254 12.1011 19.0794 12.4604C19.2334 12.8198 19.3104 13.2164 19.3104 13.6504C19.3104 14.0238 19.2568 14.3691 19.1494 14.6864C19.0421 15.0038 18.8951 15.3071 18.7084 15.5964C18.5264 15.8811 18.3141 16.1588 18.0714 16.4294C17.8288 16.7001 17.5721 16.9731 17.3014 17.2484L15.1454 19.4534C15.3834 19.3834 15.6191 19.3298 15.8524 19.2924C16.0858 19.2504 16.3051 19.2294 16.5104 19.2294H18.7924ZM21.4535 13.7064C21.5282 13.2118 21.6682 12.7778 21.8735 12.4044C22.0789 12.0311 22.3355 11.7208 22.6435 11.4734C22.9515 11.2261 23.3015 11.0418 23.6935 10.9204C24.0902 10.7944 24.5172 10.7314 24.9745 10.7314C25.4599 10.7314 25.8939 10.8014 26.2765 10.9414C26.6639 11.0768 26.9905 11.2634 27.2565 11.5014C27.5225 11.7394 27.7255 12.0171 27.8655 12.3344C28.0102 12.6518 28.0825 12.9924 28.0825 13.3564C28.0825 13.6784 28.0475 13.9631 27.9775 14.2104C27.9122 14.4531 27.8119 14.6654 27.6765 14.8474C27.5459 15.0294 27.3825 15.1834 27.1865 15.3094C26.9952 15.4354 26.7735 15.5404 26.5215 15.6244C27.6882 16.0071 28.2715 16.7841 28.2715 17.9554C28.2715 18.4734 28.1759 18.9308 27.9845 19.3274C27.7932 19.7194 27.5365 20.0484 27.2145 20.3144C26.8925 20.5804 26.5169 20.7811 26.0875 20.9164C25.6629 21.0471 25.2172 21.1124 24.7505 21.1124C24.2559 21.1124 23.8195 21.0564 23.4415 20.9444C23.0635 20.8324 22.7299 20.6644 22.4405 20.4404C22.1559 20.2164 21.9109 19.9364 21.7055 19.6004C21.5002 19.2598 21.3205 18.8631 21.1665 18.4104L22.0205 18.0604C22.2445 17.9671 22.4522 17.9414 22.6435 17.9834C22.8395 18.0254 22.9795 18.1281 23.0635 18.2914C23.1569 18.4688 23.2549 18.6321 23.3575 18.7814C23.4649 18.9308 23.5839 19.0614 23.7145 19.1734C23.8452 19.2808 23.9922 19.3648 24.1555 19.4254C24.3235 19.4861 24.5149 19.5164 24.7295 19.5164C25.0002 19.5164 25.2359 19.4721 25.4365 19.3834C25.6372 19.2948 25.8052 19.1804 25.9405 19.0404C26.0759 18.8958 26.1762 18.7348 26.2415 18.5574C26.3115 18.3754 26.3465 18.1958 26.3465 18.0184C26.3465 17.7851 26.3255 17.5751 26.2835 17.3884C26.2415 17.1971 26.1435 17.0361 25.9895 16.9054C25.8402 16.7701 25.6162 16.6674 25.3175 16.5974C25.0235 16.5228 24.6222 16.4854 24.1135 16.4854V15.1274C24.5382 15.1274 24.8859 15.0924 25.1565 15.0224C25.4272 14.9524 25.6395 14.8544 25.7935 14.7284C25.9475 14.6024 26.0525 14.4508 26.1085 14.2734C26.1692 14.0961 26.1995 13.9024 26.1995 13.6924C26.1995 13.2491 26.0829 12.9108 25.8495 12.6774C25.6209 12.4441 25.2942 12.3274 24.8695 12.3274C24.6829 12.3274 24.5102 12.3554 24.3515 12.4114C24.1975 12.4628 24.0575 12.5351 23.9315 12.6284C23.8102 12.7218 23.7052 12.8314 23.6165 12.9574C23.5279 13.0834 23.4625 13.2211 23.4205 13.3704C23.3319 13.6038 23.2175 13.7601 23.0775 13.8394C22.9375 13.9141 22.7345 13.9304 22.4685 13.8884L21.4535 13.7064Z",fill:t}));throw new Error("Invalid icon type")}const nn=n.StyleSheet.create({base:{display:"flex",width:44,height:38,boxSizing:"border-box",borderRadius:3,border:"1px solid transparent",marginRight:1,marginLeft:1},hovered:{background:"linear-gradient(0deg, rgba(24, 101, 242, 0.32), rgba(24, 101, 242, 0.32)), ".concat(g.default.white),border:"1px solid #1865F2"},pressed:{background:"#1B50B3"},focused:{outline:"none",border:"2px solid ".concat(g.default.blue)},innerBox:{boxSizing:"border-box",border:"1px solid transparent",borderRadius:2,display:"flex",flex:1,justifyContent:"center",alignItems:"center"},innerBoxPressed:{border:"1px solid ".concat(g.default.white)},activeIndicator:{position:"absolute",boxSizing:"border-box",bottom:3,width:36,height:3,marginLeft:3}});class on extends v.Component{render(){const{onClick:e,itemType:t,itemState:n}=this.props;return v.createElement(N.default,{onClick:e,disabled:"disabled"===n},(e=>{let{hovered:o,focused:r,pressed:i}=e;const s=function(e,t,n,o){return"disabled"===e?g.default.offBlack64:o?g.default.white:"active"===e||t?g.default.blue:g.default.offBlack64}(n,o,0,i);return v.createElement(u.View,{style:[nn.base,"disabled"!==n&&o&&nn.hovered,r&&nn.focused,i&&nn.pressed]},v.createElement(u.View,{style:[nn.innerBox,i&&nn.innerBoxPressed]},v.createElement(tn,{type:t,tintColor:s})),"active"===n&&v.createElement(u.View,{style:[nn.activeIndicator,{backgroundColor:s}]}))}))}}const rn=n.StyleSheet.create({tabbar:{display:"flex",flexDirection:"row",background:g.default.offWhite,paddingTop:2,paddingBottom:2,borderTop:"1px solid ".concat(g.default.offBlack50),borderBottom:"1px solid ".concat(g.default.offBlack50)}});class sn extends v.Component{constructor(){super(...arguments),P(this,"state",{selectedItem:0})}render(){const{items:e,onSelect:t}=this.props;return v.createElement(u.View,{style:rn.tabbar},e.map(((e,n)=>v.createElement(on,{key:"tabbar-item-".concat(n),itemState:n===this.state.selectedItem?"active":"inactive",itemType:e,onClick:()=>{this.setState({selectedItem:n}),t(e)}}))))}}const{column:an,row:ln,fullWidth:dn}=He;class cn extends v.Component{constructor(){super(...arguments),P(this,"state",{selectedPage:"Numbers"})}render(){const{leftPage:e,paginationEnabled:t,rightPage:n}=this.props,{selectedPage:o}=this.state;return t?v.createElement(en,{style:[an,hn.keypad]},v.createElement(sn,{items:["Numbers","Operators"],onSelect:e=>{this.setState({selectedPage:e})}}),v.createElement(I,{style:hn.borderTop},"Numbers"===o&&n,"Operators"===o&&e)):v.createElement(en,{style:hn.keypad},v.createElement(I,{style:ln},v.createElement(I,{style:dn},e),v.createElement(I,{style:[hn.borderLeft,dn]},n)))}}P(cn,"propTypes",{currentPage:T.default.oneOf([0,1]).isRequired,leftPage:T.default.node.isRequired,paginationEnabled:T.default.bool.isRequired,rightPage:T.default.node.isRequired});const hn=n.StyleSheet.create({keypad:{backgroundColor:B},borderTop:{borderTop:"".concat(1,"px ").concat("solid"," ")+"".concat(F)},borderLeft:{borderLeft:"".concat(1,"px ").concat("solid"," ")+"".concat(F),boxSizing:"content-box"}});var un=l.connect((e=>({paginationEnabled:e.layout.paginationEnabled})),null,null,{forwardRef:!0})(cn);const{row:pn,column:mn,oneColumn:fn,fullWidth:En,roundedTopLeft:gn,roundedTopRight:yn}=He;class Tn extends v.Component{render(){const{currentPage:e,cursorContext:t,dynamicJumpOut:n,extraKeys:o,roundTopLeft:r,roundTopRight:i}=this.props;let s;if(n)switch(t){case"IN_PARENS":s=Z.JUMP_OUT_PARENTHESES;break;case"IN_SUPER_SCRIPT":s=Z.JUMP_OUT_EXPONENT;break;case"IN_SUB_SCRIPT":s=Z.JUMP_OUT_BASE;break;case"BEFORE_FRACTION":s=Z.JUMP_INTO_NUMERATOR;break;case"IN_NUMERATOR":s=Z.JUMP_OUT_NUMERATOR;break;case"IN_DENOMINATOR":s=Z.JUMP_OUT_DENOMINATOR;break;default:s=Z.DISMISS}else s=Z.DISMISS;const a=[pn,En,vn.rightPage,i&&yn],l=v.createElement(I,{style:a},v.createElement(I,{style:[mn,fn]},v.createElement(Kt,{keyConfig:Z.NUM_7,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.NUM_4,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.NUM_1,borders:Q.BOTTOM}),v.createElement(Qt,{keys:o,borders:Q.NONE})),v.createElement(I,{style:[mn,fn]},v.createElement(Kt,{keyConfig:Z.NUM_8,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.NUM_5,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.NUM_2,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.NUM_0,borders:Q.LEFT})),v.createElement(I,{style:[mn,fn]},v.createElement(Kt,{keyConfig:Z.NUM_9,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.NUM_6,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.NUM_3,borders:Q.BOTTOM}),v.createElement(Kt,{keyConfig:Z.DECIMAL,borders:Q.LEFT})),v.createElement(I,{style:[mn,fn]},v.createElement(Kt,{keyConfig:Z.DIVIDE,borders:Q.LEFT}),v.createElement(Kt,{keyConfig:Z.TIMES,borders:Q.LEFT}),v.createElement(Kt,{keyConfig:Z.MINUS,borders:Q.LEFT}),v.createElement(Kt,{keyConfig:Z.PLUS,borders:Q.LEFT})),v.createElement(I,{style:[mn,fn]},v.createElement(Kt,{keyConfig:Z.FRAC,style:i&&yn}),v.createElement(Kt,{keyConfig:Z.CDOT}),v.createElement(Kt,{keyConfig:Z.BACKSPACE,borders:Q.LEFT}),v.createElement(Kt,{keyConfig:s,borders:Q.LEFT}))),d=[pn,En,vn.leftPage,r&&gn],c=v.createElement(I,{style:d},v.createElement(I,{style:[mn,fn]},v.createElement(Kt,{keyConfig:Z.EXP_2,borders:Q.NONE,style:r&&gn}),v.createElement(Kt,{keyConfig:Z.SQRT,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.LOG,borders:Q.BOTTOM}),v.createElement(Kt,{keyConfig:Z.SIN,borders:Q.NONE})),v.createElement(I,{style:[mn,fn]},v.createElement(Kt,{keyConfig:Z.EXP_3,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.CUBE_ROOT,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.LN,borders:Q.BOTTOM}),v.createElement(Kt,{keyConfig:Z.COS,borders:Q.NONE})),v.createElement(I,{style:[mn,fn]},v.createElement(Kt,{keyConfig:Z.EXP,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.RADICAL,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.LOG_N,borders:Q.BOTTOM}),v.createElement(Kt,{keyConfig:Z.TAN,borders:Q.NONE})),v.createElement(I,{style:[mn,fn]},v.createElement(Kt,{keyConfig:Z.GEQ,borders:Q.LEFT}),v.createElement(Kt,{keyConfig:Z.EQUAL,borders:Q.LEFT}),v.createElement(Kt,{keyConfig:Z.LEQ}),v.createElement(Kt,{keyConfig:Z.LEFT_PAREN,borders:Q.LEFT})),v.createElement(I,{style:[mn,fn]},v.createElement(Kt,{keyConfig:Z.GT,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.NEQ,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.LT,borders:Q.BOTTOM}),v.createElement(Kt,{keyConfig:Z.RIGHT_PAREN,borders:Q.NONE})));return v.createElement(un,{currentPage:e,rightPage:l,leftPage:c})}}P(Tn,"propTypes",{currentPage:T.default.number.isRequired,cursorContext:ce.isRequired,dynamicJumpOut:T.default.bool,extraKeys:T.default.arrayOf(oe),roundTopLeft:T.default.bool,roundTopRight:T.default.bool}),P(Tn,"rows",4),P(Tn,"columns",5),P(Tn,"maxVisibleRows",4),P(Tn,"numPages",2);const vn=n.StyleSheet.create({rightPage:{backgroundColor:"#FFF"},leftPage:{backgroundColor:"#F6F7F7"}});var Cn=l.connect((e=>({currentPage:e.pager.currentPage,cursorContext:e.input.cursor.context,dynamicJumpOut:!e.layout.navigationPadEnabled})),null,null,{forwardRef:!0})(Tn);const{row:_n,roundedTopLeft:bn,roundedTopRight:Rn}=He;class Mn extends v.Component{render(){const{cursorContext:e,dynamicJumpOut:t,roundTopLeft:n,roundTopRight:o}=this.props;let r;if(t)switch(e){case"IN_PARENS":r=Z.JUMP_OUT_PARENTHESES;break;case"IN_SUPER_SCRIPT":r=Z.JUMP_OUT_EXPONENT;break;case"IN_SUB_SCRIPT":r=Z.JUMP_OUT_BASE;break;case"BEFORE_FRACTION":r=Z.JUMP_INTO_NUMERATOR;break;case"IN_NUMERATOR":r=Z.JUMP_OUT_NUMERATOR;break;case"IN_DENOMINATOR":r=Z.JUMP_OUT_DENOMINATOR;break;default:r=Z.DISMISS}else r=Z.DISMISS;return v.createElement(en,null,v.createElement(I,{style:_n},v.createElement(Kt,{keyConfig:Z.NUM_7,borders:Q.NONE,style:n&&bn}),v.createElement(Kt,{keyConfig:Z.NUM_8,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.NUM_9,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.FRAC,disabled:"IN_NUMERATOR"===e||"IN_DENOMINATOR"===e,style:o&&Rn})),v.createElement(I,{style:_n},v.createElement(Kt,{keyConfig:Z.NUM_4,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.NUM_5,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.NUM_6,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.PERCENT})),v.createElement(I,{style:_n},v.createElement(Kt,{keyConfig:Z.NUM_1,borders:Q.BOTTOM}),v.createElement(Kt,{keyConfig:Z.NUM_2,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.NUM_3,borders:Q.BOTTOM}),v.createElement(Kt,{keyConfig:Z.BACKSPACE,borders:Q.LEFT})),v.createElement(I,{style:_n},v.createElement(Kt,{keyConfig:Z.NEGATIVE,borders:Q.NONE}),v.createElement(Kt,{keyConfig:Z.NUM_0,borders:Q.LEFT}),v.createElement(Kt,{keyConfig:Z.DECIMAL,borders:Q.LEFT}),v.createElement(Kt,{keyConfig:r,borders:Q.LEFT})))}}P(Mn,"propTypes",{cursorContext:ce.isRequired,dynamicJumpOut:T.default.bool,roundTopLeft:T.default.bool,roundTopRight:T.default.bool}),P(Mn,"rows",4),P(Mn,"columns",4),P(Mn,"maxVisibleRows",5),P(Mn,"numPages",1);var Nn=l.connect((e=>({cursorContext:e.input.cursor.context,dynamicJumpOut:!e.layout.navigationPadEnabled})),null,null,{forwardRef:!0})(Mn);class On{constructor(e){this.options={velocityTimeout:100,...e},this._events=[]}push(e){this._events.push({x:e,t:O.default()})}getVelocity(){const e=this._getEvents();if(e.length<2)return 0;{const t=e[e.length-1],n=e[0],o=t.t-n.t;return(t.x-n.x)/o}}_getEvents(){const e=O.default()-this.options.velocityTimeout,t=this._events.filter((t=>t.t>e));return this._events=[],t}}const Pn={[U.FRACTION]:Nn,[U.EXPRESSION]:Cn},{row:kn,column:Ln,centered:Sn,stretch:An,roundedTopLeft:In}=He;class wn extends v.Component{render(){const{roundTopLeft:e,style:t}=this.props,n=[Ln,Sn,xn.container,e&&In,...Array.isArray(t)?t:[t]];return v.createElement(I,{style:n},v.createElement(I,{style:[kn,Sn]},v.createElement(Kt,{keyConfig:Z.UP,borders:Q.NONE,style:[xn.navigationKey,xn.topArrow]})),v.createElement(I,{style:[kn,Sn,An]},v.createElement(Kt,{keyConfig:Z.LEFT,borders:Q.NONE,style:[xn.navigationKey,xn.leftArrow]}),v.createElement(I,{style:xn.horizontalSpacer}),v.createElement(Kt,{keyConfig:Z.RIGHT,borders:Q.NONE,style:[xn.navigationKey,xn.rightArrow]})),v.createElement(I,{style:[kn,Sn]},v.createElement(Kt,{keyConfig:Z.DOWN,borders:Q.NONE,style:[xn.navigationKey,xn.bottomArrow]})))}}P(wn,"propTypes",{roundTopLeft:T.default.bool,style:T.default.any});const xn=n.StyleSheet.create({container:{backgroundColor:"#F6F7F7",width:192},navigationKey:{borderColor:B,backgroundColor:"#FFF",width:48,height:48,boxSizing:"content-box"},topArrow:{borderTopWidth:1,borderLeftWidth:1,borderRightWidth:1,borderTopLeftRadius:4,borderTopRightRadius:4},rightArrow:{borderTopWidth:1,borderRightWidth:1,borderBottomWidth:1,borderTopRightRadius:4,borderBottomRightRadius:4},bottomArrow:{borderBottomWidth:1,borderLeftWidth:1,borderRightWidth:1,borderBottomLeftRadius:4,borderBottomRightRadius:4},leftArrow:{borderTopWidth:1,borderBottomWidth:1,borderLeftWidth:1,borderTopLeftRadius:4,borderBottomLeftRadius:4},horizontalSpacer:{background:"#FFF",width:48}}),{row:Bn,centered:Fn,fullWidth:Un}=He;class zn extends v.Component{constructor(){super(...arguments),P(this,"state",{hasBeenActivated:!1,viewportWidth:"100vw"}),P(this,"_throttleResizeHandler",(()=>{null==this._resizeTimeout&&(this._resizeTimeout=setTimeout((()=>{this._resizeTimeout=null,this._onResize()}),66))})),P(this,"_onResize",(()=>{this.setState({viewportWidth:window.innerWidth}),this.props.onPageSizeChange(window.innerWidth,window.innerHeight)})),P(this,"renderKeypad",(()=>{const{extraKeys:e,keypadType:t,layoutMode:n,navigationPadEnabled:o}=this.props,r={extraKeys:e,roundTopLeft:n===W.COMPACT&&!o,roundTopRight:n===W.COMPACT};switch(t){case U.FRACTION:return v.createElement(Nn,r);case U.EXPRESSION:return v.createElement(Cn,r);default:throw new Error("Invalid keypad type: "+t)}}))}UNSAFE_componentWillMount(){this.props.active&&this.setState({hasBeenActivated:this.props.active})}componentDidMount(){this._onResize(),window.addEventListener("resize",this._throttleResizeHandler),window.addEventListener("orientationchange",this._throttleResizeHandler)}UNSAFE_componentWillReceiveProps(e){!this.state.hasBeenActivated&&e.active&&this.setState({hasBeenActivated:!0})}componentDidUpdate(e){e.active&&!this.props.active&&this.props.onDismiss&&this.props.onDismiss()}componentWillUnmount(){window.removeEventListener("resize",this._throttleResizeHandler),window.removeEventListener("orientationchange",this._throttleResizeHandler)}render(){const{active:e,layoutMode:t,navigationPadEnabled:n,onElementMounted:o,style:r}=this.props,{hasBeenActivated:i}=this.state,s={...e?Hn.active:Hn.hidden,...e||i?{}:Hn.invisible},a=[Bn,Fn,Un,Dn.keypadContainer,...Array.isArray(r)?r:[r]],l=[Bn,Dn.keypadBorder,t===W.FULLSCREEN?Dn.fullscreen:Dn.compact];return v.createElement(I,{style:a,dynamicStyle:s,extraClassName:"keypad-container"},v.createElement(I,{style:l,ref:e=>{!this.hasMounted&&e&&(this.hasMounted=!0,o(e))}},n&&v.createElement(wn,{roundTopLeft:t===W.COMPACT,style:Dn.navigationPadContainer}),v.createElement(I,{style:Dn.keypadLayout},this.renderKeypad())))}}P(zn,"propTypes",{active:T.default.bool,extraKeys:T.default.arrayOf(oe),keypadType:T.default.oneOf(Object.keys(U)).isRequired,layoutMode:T.default.oneOf(Object.keys(W)).isRequired,navigationPadEnabled:T.default.bool.isRequired,onDismiss:T.default.func,onElementMounted:T.default.func,onPageSizeChange:T.default.func.isRequired,style:T.default.any});const Dn=n.StyleSheet.create({keypadContainer:{bottom:0,left:0,right:0,position:"fixed",transition:"".concat(300,"ms ease-out"),transitionProperty:"transform",zIndex:1060},keypadBorder:{boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.1)",borderColor:"rgba(0, 0, 0, 0.2)",borderStyle:"solid"},fullscreen:{borderTopWidth:1},compact:{borderTopRightRadius:4,borderTopLeftRadius:4,borderTopWidth:1,borderRightWidth:1,borderLeftWidth:1},navigationPadContainer:{borderRight:"".concat(1,"px ").concat("solid"," ")+"".concat(F),boxSizing:"content-box"},keypadLayout:{flexGrow:1,flexBasis:"0%"}}),Hn={invisible:{visibility:"hidden"},hidden:{msTransform:"translate3d(0, 100%, 0)",WebkitTransform:"translate3d(0, 100%, 0)",transform:"translate3d(0, 100%, 0)"},active:{msTransform:"translate3d(0, 0, 0)",WebkitTransform:"translate3d(0, 0, 0)",transform:"translate3d(0, 0, 0)"}};var qn=l.connect((e=>({...e.keypad,layoutMode:e.layout.layoutMode,navigationPadEnabled:e.layout.navigationPadEnabled})),(e=>({onPageSizeChange:(t,n)=>{e(((e,t)=>({type:"SetPageSize",pageWidthPx:e,pageHeightPx:t}))(t,n))}})),null,{forwardRef:!0})(zn);class Vn extends v.Component{constructor(){super(...arguments),P(this,"mounted",void 0),P(this,"store",void 0),P(this,"activate",(()=>{this.store.dispatch({type:"ActivateKeypad"})})),P(this,"dismiss",(()=>{this.store.dispatch({type:"DismissKeypad"})})),P(this,"configure",((e,t)=>{this.store.dispatch((e=>({type:"ConfigureKeypad",configuration:e}))(e)),setTimeout((()=>t&&t()))})),P(this,"setCursor",(e=>{this.store.dispatch((e=>({type:"SetCursor",cursor:e}))(e))})),P(this,"setKeyHandler",(e=>{this.store.dispatch((e=>({type:"SetKeyHandler",keyHandler:e}))(e))})),P(this,"getDOMNode",(()=>C.default.findDOMNode(this)))}UNSAFE_componentWillMount(){this.store=(()=>{const e={keyHandler:null,cursor:{context:"NONE"}},t=U.EXPRESSION,n={extraKeys:["x","y",L.THETA,L.PI],keypadType:t,active:!1},o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"DismissKeypad":return{...e,active:!1};case"ActivateKeypad":return{...e,active:!0};case"ConfigureKeypad":return{...e,extraKeys:[],...t.configuration};case"PressKey":return Z[t.key].id===L.DISMISS?o(e,{type:"DismissKeypad"}):e;default:return e}},r=e=>e-1,i={animateToPosition:!1,currentPage:r(Pn[t].numPages),dx:0,numPages:Pn[t].numPages,pageWidthPx:0,velocityTracker:new On},s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ConfigureKeypad":const{keypadType:n}=t.configuration,{numPages:o}=Pn[n];return{...e,numPages:o,animateToPosition:!1,currentPage:r(o),dx:0};case"SetPageSize":return{...e,pageWidthPx:t.pageWidthPx};case"PressKey":const i=Z[t.key];return i.type===z.VALUE||i.type===z.OPERATOR?s(e,{type:"ResetKeypadPage"}):e;case"ResetKeypadPage":return{...e,animateToPosition:!0,currentPage:r(e.numPages),dx:0};case"PageKeypadRight":const a=Math.min(e.currentPage+1,e.numPages-1);return{...e,animateToPosition:!0,currentPage:a,dx:0};case"PageKeypadLeft":const l=Math.max(e.currentPage-1,0);return{...e,animateToPosition:!0,currentPage:l,dx:0};case"OnSwipeChange":return e.velocityTracker.push(t.dx),{...e,animateToPosition:!1,dx:t.dx};case"OnSwipeEnd":const{pageWidthPx:d,velocityTracker:c}=e,{dx:h}=t,u=c.getVelocity(),p=.1,m=10,f=h>d/2||u>p&&h>m;return h<-d/2||u<-p&&h<-m?s(e,{type:"PageKeypadRight"}):f?s(e,{type:"PageKeypadLeft"}):{...e,animateToPosition:!0,dx:0};default:return e}},a=e=>new Fe({swipeEnabled:e},{onSwipeChange:e=>{m.dispatch({type:"OnSwipeChange",dx:e})},onSwipeEnd:e=>{m.dispatch({type:"OnSwipeEnd",dx:e})},onActiveNodesChanged:e=>{m.dispatch({type:"SetActiveNodes",activeNodes:e})},onClick:(e,t,n)=>{m.dispatch({type:"PressKey",key:e,...t,inPopover:n})}},[],[L.BACKSPACE,L.UP,L.RIGHT,L.DOWN,L.LEFT]),l={popover:null,focus:null,gestureManager:a(Pn[t].numPages>1)};let d=0;const c={echoes:[]},h={gridDimensions:{numRows:Pn[t].rows,numColumns:Pn[t].columns,numMaxVisibleRows:Pn[t].maxVisibleRows,numPages:Pn[t].numPages},buttonDimensions:{widthPx:48,heightPx:48},pageDimensions:{pageWidthPx:0,pageHeightPx:0},layoutMode:W.FULLSCREEN,paginationEnabled:!1,navigationPadEnabled:!1},u=(e,t)=>{const{pageWidthPx:n,pageHeightPx:o}=e,r=n>o?D:H,i=Math.min(n,o)>600?V:q,s=i===V,a=i===q&&r===H;return{...Se(t,e,{deviceOrientation:r,deviceType:i},{navigationPadEnabled:s,paginationEnabled:a,toolbarEnabled:!0}),navigationPadEnabled:s,paginationEnabled:a}},p=R.combineReducers({input:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"SetKeyHandler":return{...t,keyHandler:n.keyHandler};case"PressKey":const e=Z[n.key];return e.type!==z.KEYPAD_NAVIGATION?{...t,cursor:t.keyHandler(e.id)}:t;case"SetCursor":return{...t,cursor:n.cursor};default:return t}},keypad:o,pager:s,gestures:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"DismissKeypad":return e.gestureManager.disableEventTracking(),e;case"ActivateKeypad":return e.gestureManager.enableEventTracking(),e;case"SetActiveNodes":return{...e,...t.activeNodes};case"ConfigureKeypad":const{keypadType:n}=t.configuration,{numPages:o}=Pn[n];return{popover:null,focus:null,gestureManager:a(o>1)};default:return e}},echoes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"PressKey":const n=Z[t.key];return n.type===z.VALUE||n.type===z.OPERATOR?{...e,echoes:[...e.echoes,{animationId:""+d++,animationType:t.inPopover?J.LONG_FADE_ONLY:J.FADE_ONLY,borders:t.borders,id:n.id,initialBounds:t.initialBounds}]}:e;case"RemoveEcho":const o=e.echoes.filter((e=>e.animationId!==t.animationId));return{...e,echoes:o};default:return e}},layout:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ConfigureKeypad":const{keypadType:n}=t.configuration,o={numRows:Pn[n].rows,numColumns:Pn[n].columns,numMaxVisibleRows:Pn[n].maxVisibleRows,numPages:Pn[n].numPages};return{...e,...u(e.pageDimensions,o),gridDimensions:o};case"SetPageSize":const{pageWidthPx:r,pageHeightPx:i}=t,s={pageWidthPx:r,pageHeightPx:i};return{...e,...u(s,e.gridDimensions),pageDimensions:s};default:return e}}}),m=R.createStore(p);return m})()}componentDidMount(){this.mounted=!0}componentWillUnmount(){this.mounted=!1}render(){const{onElementMounted:e,...t}=this.props;return v.createElement(l.Provider,{store:this.store},v.createElement(qn,k({onElementMounted:t=>{const n={...t,activate:this.activate,dismiss:this.dismiss,configure:this.configure,setCursor:this.setCursor,setKeyHandler:this.setKeyHandler,getDOMNode:this.getDOMNode};e&&e(n)}},t)))}}exports.Keypad=Vn,exports.KeypadInput=Me,exports.KeypadTypes=U,exports.keypadConfigurationPropType=ie,exports.keypadElementPropType=se;
|
|
2
|
+
//# sourceMappingURL=index.js.map
|