@pie-element/select-text 12.0.0-beta.1 → 12.0.0-next.43

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.
@@ -11,12 +11,12 @@
11
11
  "@mui/icons-material": "^7.3.4",
12
12
  "@mui/material": "^7.3.4",
13
13
  "@pie-framework/pie-configure-events": "^1.3.0",
14
- "@pie-lib/config-ui": "12.1.0-next.5",
15
- "@pie-lib/editable-html-tip-tap": "1.1.0-next.5",
16
- "@pie-lib/text-select": "2.1.0-next.5",
17
- "debug": "^3.1.0",
14
+ "@pie-lib/config-ui": "12.1.1-next.0",
15
+ "@pie-lib/editable-html-tip-tap": "1.1.1-next.0",
16
+ "@pie-lib/text-select": "2.1.1-next.0",
17
+ "debug": "^4.1.1",
18
18
  "lodash": "^4.17.15",
19
- "prop-types": "^15.6.2",
19
+ "prop-types": "^15.8.1",
20
20
  "react": "18.2.0",
21
21
  "react-dom": "18.2.0"
22
22
  },
@@ -6,9 +6,9 @@
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
8
8
  "dependencies": {
9
- "@pie-lib/controller-utils": "1.1.0-next.4",
10
- "@pie-lib/feedback": "1.1.0-next.4",
11
- "debug": "^3.1.0",
9
+ "@pie-lib/controller-utils": "1.1.1-next.0",
10
+ "@pie-lib/feedback": "1.1.1-next.0",
11
+ "debug": "^4.1.1",
12
12
  "lodash": "^4.17.15"
13
13
  },
14
14
  "devDependencies": {
@@ -0,0 +1 @@
1
+ import{_dll_react_dom as e,_dll_react as t,_dll_prop_types as u,_dll_mui__material as n,_dll_mui__material_styles as o,_dll_pie_lib__render_ui as i,_dll_lodash as s,_dll_debug as r,_dll_classnames as a,_dll_mui__icons_material as l}from"../../../@pie-lib/shared-module@^3.0.5/module/index.js";import{_dll_pie_lib__config_ui as c}from"../../../@pie-lib/config-module@^3.0.0/module/index.js";import{_dll_pie_lib__editable_html_tip_tap as p}from"../../../@pie-lib/editable-html-module@^6.0.5/module/index.js";var d,D=e;d=D.createRoot,D.hydrateRoot;const h=t,g=u,{Button:C}=n,{Switch:F}=n,{FormControlLabel:f}=n,{styled:E}=o,{color:m}=i,A=E("div")(()=>({display:"flex",alignItems:"center",justifyContent:"space-between"})),b=E(C)(({theme:e})=>({marginRight:e.spacing(1)})),y=E(F)(()=>({"& .MuiSwitch-thumb":{"&.Mui-checked":{color:`${m.tertiary()} !important`}},"& .MuiSwitch-track":{"&.Mui-checked":{backgroundColor:`${m.tertiaryLight()} !important`}}}));class B extends h.Component{static __initStatic(){this.propTypes={onClear:g.func.isRequired,onWords:g.func.isRequired,onSentences:g.func.isRequired,onParagraphs:g.func.isRequired,setCorrectMode:g.bool.isRequired,onToggleCorrectMode:g.func.isRequired}}static __initStatic2(){this.defaultProps={}}render(){const{onClear:e,onWords:t,onSentences:u,onParagraphs:n,setCorrectMode:o,onToggleCorrectMode:i}=this.props;return h.createElement(A,null,h.createElement("div",null,h.createElement(b,{onClick:t,size:"small",color:"primary",disabled:o},"Words"),h.createElement(b,{onClick:u,size:"small",color:"primary",disabled:o},"Sentences"),h.createElement(b,{onClick:n,size:"small",color:"primary",disabled:o},"Paragraphs"),h.createElement(b,{size:"small",color:"secondary",onClick:e,disabled:o},"Clear")),h.createElement(f,{control:h.createElement(y,{checked:o,onChange:i}),label:"Set correct answers"}))}}B.__initStatic(),B.__initStatic2();var x=function e(t,u){var n,o,i,s=u||"";if(!t||!("length"in t)&&!t.type)throw new Error("Expected node, not `"+t+"`");if("string"==typeof t.value)return t.value;if(1===(o=(i="length"in t?t:t.children).length)&&"value"in i[0])return i[0].value;for(n=[];o--;)n[o]=e(i[o],s);return n.join(s)},S=function(e){return function(t){var u=-1,n=t&&t.children;if(!n)throw new Error("Missing children in `parent` for `visitor`");for(;++u in n;)e(n[u],u,t)}},v=function(e,t,u){var n,o=-1;if(!e)throw new Error("Iterate requires that |this| not be "+e);if(!k.call(e,"length"))throw new Error("Iterate requires that |this| has a `length`");if("function"!=typeof t)throw new Error("`callback` must be a function");for(;++o<e.length;)o in e&&"number"==typeof(n=t.call(u,e[o],o,e))&&(n<0&&(o=0),o=n-1)},k={}.hasOwnProperty,w=v,_=x,N={affixSymbol:/^([!"').?\u0F3B\u0F3D\u169C\u2019\u201D\u2026\u203A\u203D\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63\xBB\]}])\1*$/,newLine:/^[ \t]*((\r?\n|\r)[\t ]*)+$/,newLineMulti:/^[ \t]*((\r?\n|\r)[\t ]*){2,}$/,terminalMarker:/^([!.?\u2026\u203D]+)$/,wordSymbolInner:/^([&'\-.:=?@\xAD\xB7\u2010\u2011\u2019\u2027]|_+)$/,numerical:/^(?:[\d\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])+$/,digitStart:/^\d/,lowerInitial:/^(?:[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7BB\uA7BD\uA7BF\uA7C3\uA7C8\uA7CA\uA7F6\uA7FA\uAB30-\uAB5A\uAB60-\uAB68\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]|\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43])/,surrogates:/[\uD800-\uDFFF]/,punctuation:/[!"'-),-/:;?[-\]_{}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u201F\u2022-\u2027\u2032-\u203A\u203C-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDFFF]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,word:/[\dA-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u08D3-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09F4-\u09F9\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71-\u0B77\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BF2\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7E\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D63\u0D66-\u0D78\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u17F0-\u17F9\u180B-\u180D\u1810-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1AC0\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u20D0-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA827\uA82C\uA830-\uA835\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE6\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD27\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEAB\uDEAC\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC52-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD44-\uDD47\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDCE-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5E-\uDC61\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF3B]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3\uDFE4\uDFF0\uDFF1]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]|\uDB40[\uDD00-\uDDEF]/,whiteSpace:/[\t-\r \x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/},L=v,P=function(e){return function(e){return function(t){var u=t&&t.children;if(!u)throw new Error("Missing children in `parent` for `modifier`");L(u,e,t)}}(function(e){return function(t,u){return e(t,u,this)}}(e))},O=x,R=P(function(e,t,u){var n,o;if(("SymbolNode"===e.type||"PunctuationNode"===e.type)&&"&"===O(e)&&(o=(n=u.children)[t+1],(0===t||"WordNode"!==n[t-1].type)&&o&&"WordNode"===o.type))return n.splice(t,1),o.children.unshift(e),o.position&&e.position&&(o.position.start=e.position.start),t-1}),T=x,$=P(function(e,t,u){var n,o,i;if(0!==t&&("SymbolNode"===e.type||"PunctuationNode"===e.type)&&"-"===T(e)&&(o=(n=u.children)[t-1],(!(i=n[t+1])||"WordNode"!==i.type)&&o&&"WordNode"===o.type))return n.splice(t,1),o.children.push(e),o.position&&e.position&&(o.position.end=e.position.end),t}),I=x,M=N,j=P(function(e,t,u){var n,o,i,s,r,a,l;if(0!==t&&("SymbolNode"===e.type||"PunctuationNode"===e.type)&&(i=(n=u.children)[t-1])&&"WordNode"===i.type){for(r=t-1,a=[],l=[];n[++r];)if("WordNode"===(o=n[r]).type)a=a.concat(l,o.children),l=[];else{if("SymbolNode"!==o.type&&"PunctuationNode"!==o.type||!z.test(I(o)))break;l.push(o)}if(0!==a.length)return 0!==l.length&&(r-=l.length),n.splice(t,r-t),i.children=i.children.concat(a),s=a[a.length-1],i.position&&s.position&&(i.position.end=s.position.end),t}}),z=M.wordSymbolInner,W=x,H=P(function(e,t,u){var n,o,i,s,r,a,l,c=u.children;if(n=c[t-1],o=c[t+1],n&&"WordNode"===n.type&&("SymbolNode"===e.type||"PunctuationNode"===e.type)&&W(e)===V&&(i=W(n),a=e,r=[e],l=1,o&&"WordNode"===o.type&&(s=W(o),a=o,r=r.concat(o.children),l++),i.length<3&&(!s||s.length<3)))return n.children=n.children.concat(r),c.splice(t,l),n.position&&a.position&&(n.position.end=a.position.end),t}),V="/",q=x,U=N,K=P(function(e,t,u){var n,o,i,s,r,a,l,c;if(0!==t&&"."===q(e)&&(s=(i=(o=(n=u.children)[t-1]).children)&&i.length,"WordNode"===o.type&&1!==s&&s%2!=0)){for(r=s,l=!0;i[--r];)if(a=i[r],c=q(a),r%2==0){if(c.length>1)return;Y.test(c)||(l=!1)}else if("."!==c){if(r<s-2)break;return}if(!l)return n.splice(t,1),i.push(e),o.position&&e.position&&(o.position.end=e.position.end),t}}),Y=U.numerical,G=P(function(e,t,u){var n,o=u.children;if("WordNode"===e.type&&(n=o[t+1])&&"WordNode"===n.type)return o.splice(t+1,1),e.children=e.children.concat(n.children),n.position&&e.position&&(e.position.end=n.position.end),t}),J=S(function(e,t,u){var n=u.children;e.position&&(0!==t||u.position&&u.position.start||(Q(u),u.position.start=e.position.start),t!==n.length-1||u.position&&u.position.end||(Q(u),u.position.end=e.position.end))});function Q(e){e.position||(e.position={})}var Z=P(function(e,t,u){for(var n,o,i=e.children,s=-1;i[++s];)if("WordNode"===i[s].type)return;if(n=u.children[t-1])return n.children=n.children.concat(i),u.children.splice(t,1),n.position&&e.position&&(n.position.end=e.position.end),t;(o=u.children[t+1])&&(o.children=i.concat(o.children),o.position&&e.position&&(o.position.start=e.position.start),u.children.splice(t,1))}),X=x,ee=N,te=P(function(e,t,u){var n,o,i,s=e.children;if(s&&0!==s.length&&0!==t&&(n=s[0],o=s[1],i=u.children[t-1],("SymbolNode"===n.type||"PunctuationNode"===n.type)&&ue.test(X(n))))return i.children.push(s.shift()),n.position&&i.position&&(i.position.end=n.position.end),o&&o.position&&e.position&&(e.position.start=o.position.start),t-1}),ue=ee.affixSymbol,ne=x,oe=N,ie=P(function(e,t,u){var n,o,i,s,r=e.children;if(r&&0!==r.length&&0!==t)for(n=-1;r[++n];){if("WordNode"===(o=r[n]).type){if(!se.test(ne(o)))return;return(s=(i=u.children)[t-1]).children=s.children.concat(r),i.splice(t,1),s.position&&e.position&&(s.position.end=e.position.end),t}if("SymbolNode"===o.type||"PunctuationNode"===o.type)return}}),se=oe.lowerInitial,re=x,ae=N,le=P(function(e,t,u){var n=e.children,o=u.children,i=o[t-1],s=n[0];if(i&&s&&"WordNode"===s.type&&ce.test(re(s)))return i.children=i.children.concat(n),o.splice(t,1),i.position&&e.position&&(i.position.end=e.position.end),t}),ce=ae.digitStart,pe=x,de=P(function(e,t,u){var n,o,i,s=e.children;if(s&&s.length>1&&(n=s[s.length-1])&&"."===pe(n)&&(o=s[s.length-2])&&"WordNode"===o.type&&De.test(pe(o).toLowerCase())&&(o.children.push(n),s.pop(),n.position&&o.position&&(o.position.end=n.position.end),i=u.children[t+1]))return e.children=s.concat(i.children),u.children.splice(t+1,1),i.position&&e.position&&(e.position.end=i.position.end),t-1}),De=new RegExp("^([0-9]{1,3}|[a-z]|al|ca|cap|cca|cent|cf|cit|con|cp|cwt|ead|etc|ff|fl|ibid|id|nem|op|pro|seq|sic|stat|tem|viz)$"),he=x,ge=P(function(e,t,u){var n,o,i,s,r=e.children;if(r&&0!==r.length&&0!==t)for(o=-1;r[++o];){if("WordNode"===(n=r[o]).type)return;if("SymbolNode"===n.type||"PunctuationNode"===n.type){if(","!==(i=he(n))&&";"!==i)return;return(s=u.children[t-1]).children=s.children.concat(r),s.position&&e.position&&(s.position.end=e.position.end),u.children.splice(t,1),t}}}),Ce=x,Fe=N,fe=S(function(e){for(var t,u,n,o,i=e.children,s=i.length,r=!1;i[--s];)if("SymbolNode"===(t=i[s]).type||"PunctuationNode"===t.type){if(Ee.test(Ce(t)))if(r){if("."===Ce(t))if(u=i[s-1],n=i[s+1],u&&"WordNode"===u.type){if(o=i[s+2],n&&o&&"WhiteSpaceNode"===n.type&&"."===Ce(o))continue;i.splice(s,1),u.children.push(t),t.position&&u.position&&(u.position.end=t.position.end),s--}else n&&"WordNode"===n.type&&(i.splice(s,1),n.children.unshift(t),t.position&&n.position&&(n.position.start=t.position.start))}else r=!0}else"WordNode"===t.type&&(r=!0)}),Ee=Fe.terminalMarker,me=S(function(e,t,u){var n,o=e.children;o&&0!==o.length&&"WhiteSpaceNode"===o[0].type&&(u.children.splice(t,0,o.shift()),(n=o[0])&&n.position&&e.position&&(e.position.start=n.position.start))}),Ae=P(function(e,t,u){var n,o=e.children;if(o&&0!==o.length&&"WhiteSpaceNode"===o[o.length-1].type)return u.children.splice(t+1,0,e.children.pop()),(n=o[o.length-1])&&n.position&&e.position&&(e.position.end=n.position.end),t}),be=x,ye=N,Be=P(function(e,t,u){var n,o,i,s,r,a,l,c;if("SentenceNode"===e.type)for(i=(n=e.children).length-1,o=0;++o<i;)if("WhiteSpaceNode"===(c=n[o]).type&&xe.test(be(c)))return e.children=n.slice(0,o),l={type:"SentenceNode",children:n.slice(o+1)},s=n[o-1],r=n[o+1],u.children.splice(t+1,0,c,l),e.position&&s.position&&r.position&&(a=e.position.end,e.position.end=s.position.end,l.position={start:r.position.start,end:a}),t+1}),xe=ye.newLineMulti,Se=P(function(e,t,u){if("children"in e&&0===e.children.length)return u.children.splice(t,1),t}),ve=function(e){var t=e.type,u=e.tokenizer,n=e.delimiter,o=n&&function(e,t){return function(u){for(var n,o,i,s=[],r=u.children,a=u.type,l=r.length,c=-1,p=l-1,d=0;++c<l;)(c===p||r[c].type===e&&t.test(_(r[c])))&&(n=r[d],o=r[c],i={type:a,children:r.slice(d,c+1)},n.position&&o.position&&(i.position={start:n.position.start,end:o.position.end}),s.push(i),d=c+1);return s}}(e.delimiterType,n);return function(e){var n=this[u](e);return{type:t,children:o?o(n):n}}},ke=N,we=_e;function _e(e,t){var u=t||e;if(!(this instanceof _e))return new _e(e,t);this.doc=u?String(u):null}var Ne=_e.prototype;function Le(e){return e+="Node",function(t,u,n){return null==t&&(t=""),(u||je)(t)({type:e,value:String(t)},n)}}function Pe(e,t,u){e.prototype[t]=function(){return this.run(t,u.apply(this,arguments))}}function Oe(e){return function(t,u){var n,o=this;if(!(t in o))throw new Error("Illegal Invocation: Unsupported `key` for `use(key, plugins)`. Make sure `key` is a supported function");u&&(n=t+"Plugins",u="function"==typeof u?[u]:u.concat(),o[n]||(o[n]=[]),e(o,n,u))}}Ne.position=!0,Ne.tokenizeSymbol=Le("Symbol"),Ne.tokenizeWhiteSpace=Le("WhiteSpace"),Ne.tokenizePunctuation=Le("Punctuation"),Ne.tokenizeSource=Le("Source"),Ne.tokenizeText=Le("Text"),Ne.run=function(e,t){var u=this[e+"Plugins"],n=-1;if(u)for(;u[++n];)u[n](t);return t},Ne.use=Oe(function(e,t,u){e[t]=e[t].concat(u)}),Ne.useFirst=Oe(function(e,t,u){e[t]=u.concat(e[t])}),Ne.parse=function(e){return this.tokenizeRoot(e||this.doc)},Ne.tokenize=function(e){return function(e,t){var u,n,o,i,s,r,a,l,c,p,d,D;if(null==t?t="":t instanceof String&&(t=t.toString()),"string"!=typeof t){if("length"in t&&(!t[0]||t[0].type))return t;throw new Error("Illegal invocation: '"+t+"' is not a valid argument for 'ParseLatin'")}if(u=[],!t)return u;for(s=0,n=0,o=1,i=1,D=e.position?function(e){var t=function(){var e=F();function t(t){return t.position=new C(e),t}return t}();return function(e){var t=e.length,u=-1,s=-1;for(n+=t;++u<t;)"\n"===e.charAt(u)&&(s=u,o++);-1===s?i+=t:i=t-s}(e),function(){return t(g.apply(null,arguments))}}:function(){return function(){return g.apply(null,arguments)}},r=t.length,c="",l="";s<r;)a=t.charAt(s),d=Ie.test(a)?"WhiteSpace":$e.test(a)?"Punctuation":Re.test(a)?"Word":"Symbol",h(),c=a,a="",p=d,d=null,s++;return h(),u;function h(){p!==d||"Word"!==p&&"WhiteSpace"!==p&&a!==c&&!Te.test(a)?(l&&e["tokenize"+p](l,D),l=a):l+=a}function g(e,t){return t?t.children.push(e):u.push(e),e}function C(e){this.start=e,this.end=F()}function F(){return{line:o,column:i,offset:n}}}(this,e)},Pe(_e,"tokenizeWord",function(e,t){var u=(t||je)(""),n={type:"WordNode",children:[]};return this.tokenizeText(e,t,n),u(n)}),Pe(_e,"tokenizeSentence",ve({type:"SentenceNode",tokenizer:"tokenize"})),Pe(_e,"tokenizeParagraph",ve({type:"ParagraphNode",delimiter:ke.terminalMarker,delimiterType:"PunctuationNode",tokenizer:"tokenizeSentence"})),Pe(_e,"tokenizeRoot",ve({type:"RootNode",delimiter:ke.newLine,delimiterType:"WhiteSpaceNode",tokenizer:"tokenizeParagraph"})),Ne.use("tokenizeSentence",[R,$,j,H,K,G,J]),Ne.use("tokenizeParagraph",[Z,te,ie,le,de,ge,fe,me,Ae,Be,Se,J]),Ne.use("tokenizeRoot",[me,Ae,Se,J]);var Re=ke.word,Te=ke.surrogates,$e=ke.punctuation,Ie=ke.whiteSpace;function Me(e,t){return t&&t.children.push(e),e}function je(){return Me}var ze=x,We=S,He=function(e){return function(e){return function(t){var u=t&&t.children;if(!u)throw new Error("Missing children in `parent` for `modifier`");return w(u,e,t)}}(function(e){return function(t,u){return e(t,u,this)}}(e))},Ve=we,qe=Z,Ue=te,Ke=ie,Ye=le,Ge=ge,Je=fe,Qe=me,Ze=Ae,Xe=Be,et=Se,tt=J,ut=ot;it.prototype=Ve.prototype;var nt=new it;function ot(e,t){if(!(this instanceof ot))return new ot(e,t);Ve.apply(this,arguments)}function it(){}ot.prototype=nt,nt.tokenizeSentencePlugins=[We(function(e,t,u){var n,o,i,s,r;if("PunctuationNode"===e.type||"SymbolNode"===e.type)if(s=(n=u.children).length,"/"===(r=ze(e)))(o=n[t-1])&&"w"===pt(ze(o))&&(n.splice(t,1),o.children.push(e),o.position&&e.position&&(o.position.end=e.position.end));else if(ct.test(r)){if(o=n[t-1],t>2&&t<s-1&&"WordNode"===o.type&&"WhiteSpaceNode"===n[t-2].type&&"WhiteSpaceNode"===n[t+1].type&&at.test(pt(ze(o))))return n.splice(t,1),o.children.push(e),void(o.position&&e.position&&(o.position.end=e.position.end));t===s-1||"WordNode"!==n[t+1].type||0!==t&&"WordNode"===n[t-1].type||(o=n[t+1],r=pt(ze(o)),lt.test(r)?(n.splice(t,1),o.children=[e].concat(o.children),o.position&&e.position&&(o.position.start=e.position.start)):"n"===r&&t<s-2&&ct.test(ze(n[t+2]))&&(i=n[t+2],n.splice(t,1),n.splice(t+1,1),o.children=[e].concat(o.children,i),o.position&&(e.position&&(o.position.start=e.position.start),i.position&&(o.position.end=i.position.end))))}})].concat(nt.tokenizeSentencePlugins),nt.tokenizeParagraphPlugins=[He(function(e,t,u){var n,o,i=e.children,s=i[i.length-1],r=i[i.length-2];if(s&&"."===ze(s)&&r&&"WordNode"===r.type&&(n=ze(r),(st.test(pt(n))||rt.test(n))&&(r.children.push(s),i.pop(),s.position&&r.position&&(r.position.end=s.position.end),o=u.children[t+1])))return e.children=i.concat(o.children),u.children.splice(t+1,1),o.position&&e.position&&(e.position.end=o.position.end),t-1})].concat([qe,Ue,Ke,Ye,Ge,Je,Qe,Ze,Xe,et,tt]);var st=new RegExp("^(al|ca|cap|cca|cent|cf|cit|con|cp|cwt|ead|etc|ff|fl|ibid|id|nem|op|pro|seq|sic|stat|tem|vizinc|ltd|bbls?|cu|doz|fl|ft|gal|gr|gro|in|kt|lbs?|mi|oz|pt|qt|sq|tbsp|tsp|yds?|sec|min|hr|mon|tue|tues|wed|thu|thurs|fri|sat|sun|jan|feb|mar|apr|jun|jul|aug|sep|sept|oct|nov|dec)$"),rt=new RegExp("^(Mr|Mrs|Miss|Ms|Mss|Mses|Mlle|Mme|M|Messrs|Mmes|Jr|Sr|Snr|Dr|Mgr|Atty|Prof|Hon|Rev|Fr|Msgr|Sr|Br|St|Pres|Supt|Rep|Sen|Gov|Amb|Treas|Sec|Amd|Brig|Gen|Cdr|Col|Capt|Lt|Maj|Sgt|Po|Wo|Ph|Ave|Blvd|Mt|Rd|Bldgs?|Nat|Natl|Rt|Rte|Co|Pk|Sq|Dr|Pt|St|Ft|Pen|Terr|Hwy|Fwy|Pkwy|Ala|Ariz|Ark|Cal|Calif|Col|Colo|Conn|Del|Fla|Ga|Ida|Id|Ill|Ind|Ia|Kan|Kans|Ken|Ky|La|Me|Md|Mass|Mich|Minn|Miss|Mo|Mont|Neb|Nebr|Nev|Mex|Dak|Okla|Ok|Ore|Penna|Penn|Pa|Tenn|Tex|Ut|Vt|Va|Wash|Wis|Wisc|Wyo|Alta|Man|Ont|Qué|Que|Sask|Yuk|Beds|Berks|Bucks|Cambs|Ches|Corn|Cumb|Derbys|Derbs|Dev|Dor|Dur|Glos|Hants|Here|Heref|Herts|Hunts|Lancs|Leics|Lincs|Mx|Middx|Mddx|Norf|Northants|Northumb|Northd|Notts|Oxon|Rut|Shrops|Salop|Som|Staffs|Staf|Suff|Sy|Sx|Ssx|Warks|War|Warw|Westm|Wilts|Worcs|Yorks)$"),at=new RegExp("^(o|ol)$"),lt=new RegExp("^(im|er|em|cause|twas|tis|twere|\\d\\ds?)$"),ct=/^['\u2019]$/;function pt(e){return e.toLowerCase()}const{compact:dt}=s,{clone:Dt}=s,ht=(e,t)=>t.children?t.children.reduce(ht,e):t.value?e+t.value:e,gt=e=>ht("",e),Ct=e=>(new ut).parse(e).children.reduce((e,t)=>{if("ParagraphNode"===t.type){const n={text:(u=t,ht("",u)),start:t.position.start.offset,end:t.position.end.offset};return e.concat([n])}return e;var u},[]),Ft=e=>(new ut).parse(e).children.reduce((e,t)=>"ParagraphNode"===t.type?t.children.reduce((e,t)=>{if("SentenceNode"===t.type){const u=((e,t)=>{const u=[];let n=e.children.reduce(function(e,t){if("WhiteSpaceNode"===t.type&&"\n"===t.value){if(u.length){const n=u[0],o={text:u.map(e=>gt(e)).join(""),start:n.position.start.offset,end:t.position.start.offset};return u.splice(0,u.length),e.concat([o])}}else u.push(t);return e},t);if(u.length){const e=u[0],t=u[u.length-1],o={text:u.map(e=>gt(e)).join(""),start:e.position.start.offset,end:t.position.end.offset};n=n.concat([o]),u.splice(0,u.length)}return n})(t,e);return u||e}return e},e):e,[]),ft=e=>(new ut).parse(e).children.reduce((e,t)=>"ParagraphNode"===t.type?t.children.reduce((e,t)=>"SentenceNode"===t.type?t.children.reduce((e,t)=>{if("WordNode"===t.type){const n={text:(u=t,ht("",u)),start:t.position.start.offset,end:t.position.end.offset};return e.concat([n])}return e;var u},e):e,e):e,[]);class Et{constructor(e){this.results=e}get hasOverlap(){return this.results.filter(e=>"overlap"===e.type).length>0}get surroundedTokens(){return this.results.filter(e=>"within-selection"===e.type).map(e=>e.token)}}const mt=(e,t)=>{const u=e||"";if(!Array.isArray(t)||0===t.length)return[{text:u,start:0,end:u.length}];const n=(e=>{if(Array.isArray(e)){const t=Dt(e);return t.sort((e,t)=>{const u=e.start<t.start?-1:e.start>t.start?1:0,n=e.end<t.end?-1:e.end>t.end?1:0;if(-1===u&&-1!==n)throw new Error(`sort does not support intersecting tokens. a: ${e.start}-${e.end}, b: ${t.start}-${t.end}`);return u}),t}return e})(t).reduce((e,t,n,o)=>{let i=[];const s=e.lastIndex;if(t.start===s?i=[{text:u.substring(s,t.end),start:s,end:t.end,predefined:!0,correct:t.correct,isMissing:t.isMissing}]:s<t.start&&(i=[{text:u.substring(s,t.start),start:s,end:t.start},{text:u.substring(t.start,t.end),start:t.start,end:t.end,predefined:!0,correct:t.correct,isMissing:t.isMissing}]),n===o.length-1&&t.end<u.length){const e={text:u.substring(t.end),start:t.end,end:u.length};i.push(e)}return{lastIndex:i.length?i[i.length-1].end:s,result:e.result.concat(i)}},{result:[],lastIndex:0});return n.result},At=()=>{document.getSelection?(document.getSelection().removeAllRanges(),document.getSelection().addRange(document.createRange())):window.getSelection?window.getSelection().removeAllRanges?(window.getSelection().removeAllRanges(),window.getSelection().addRange(document.createRange())):window.getSelection().empty&&window.getSelection().empty():document.selection&&document.selection.empty()};var bt="#4caf50",yt="#fff9c4",Bt="#fbc02d";const xt=t,St=u,{styled:vt}=o,kt=a,wt=r("@pie-lib:text-select:token-text"),_t=vt("span")(()=>({"&.predefined":{cursor:"pointer",backgroundColor:yt,border:`dashed 0px ${Bt}`,"& *":{cursor:"pointer",backgroundColor:yt,border:`dashed 0px ${Bt}`}},"&.correct":{backgroundColor:bt,"& *":{backgroundColor:bt}}})),Nt=({text:e,predefined:t,onClick:u,correct:n})=>{const o=(e||"").replace(/\n/g,"<br>");if(t){const e=kt("predefined",n&&"correct");return xt.createElement(_t,{onClick:u,className:e,dangerouslySetInnerHTML:{__html:o}})}return xt.createElement("span",{dangerouslySetInnerHTML:{__html:o}})},Lt=["\n"," ","\t"];class Pt extends xt.Component{constructor(...e){super(...e),Pt.prototype.__init.call(this)}static __initStatic(){this.propTypes={text:St.string.isRequired,tokens:St.array.isRequired,onTokenClick:St.func.isRequired,onSelectToken:St.func.isRequired,className:St.string}}__init(){this.onClick=e=>{const{onSelectToken:t,text:u,tokens:n}=this.props;if(e.preventDefault(),"undefined"==typeof window)return;const o=window.getSelection().toString();if(o.length>0&&Lt.indexOf(o)<0&&this.root){let e=(e=>{var t,u=0,n=e.ownerDocument||e.document,o=n.defaultView||n.parentWindow;if(void 0!==o.getSelection){if((t=o.getSelection()).rangeCount>0){var i=o.getSelection().getRangeAt(0),s=i.toString().length,r=i.cloneRange();r.selectNodeContents(e),r.setEnd(i.endContainer,i.endOffset),u=s?r.toString().length-s:r.toString().length}}else if((t=n.selection)&&"Control"!==t.type){var a=t.createRange(),l=n.body.createTextRange();l.moveToElementText(e),l.setEndPoint("EndToEnd",a),u=l.text.length}return u})(this.root);if(e+=u.slice(e).indexOf(o),void 0!==e){const i=e+o.length;if(i<=u.length){const u=((e,t)=>{const{start:u,end:n}=e,o=t.map(e=>u===e.start&&n===e.end?{token:e,type:"exact-fit"}:u<=e.start&&n>=e.end?{token:e,type:"within-selection"}:(e=>u>=e.start&&u<e.end)(e)||(e=>n>e.start&&n<=e.end)(e)?{token:e,type:"overlap"}:void 0);return new Et(dt(o))})({start:e,end:i},n);u.hasOverlap?(wt("hasOverlap - do nothing"),At()):(t({text:o,start:e,end:i},u.surroundedTokens),At())}}}}}render(){const{text:e,tokens:t,className:u,onTokenClick:n}=this.props,o=mt(e,t);return xt.createElement("div",{className:u,ref:e=>this.root=e,onClick:this.onClick},o.map((e,t)=>xt.createElement(Nt,{key:t,...e,onClick:()=>n(e)})))}}Pt.__initStatic();const Ot=t,Rt=u,{styled:Tt}=o,{clone:$t}=s,{isEqual:It}=s,{differenceWith:Mt}=s,jt=Tt("div")(({disabled:e})=>({whiteSpace:"pre-wrap",...e&&{cursor:"default",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"}}));class zt extends Ot.Component{static __initStatic(){this.propTypes={text:Rt.string.isRequired,tokens:Rt.arrayOf(Rt.shape({text:Rt.string,correct:Rt.bool,start:Rt.number,end:Rt.number})),onChange:Rt.func.isRequired}}static __initStatic2(){this.defaultProps={}}constructor(e){super(e),zt.prototype.__init.call(this),zt.prototype.__init2.call(this),zt.prototype.__init3.call(this),zt.prototype.__init4.call(this),zt.prototype.__init5.call(this),zt.prototype.__init6.call(this),zt.prototype.__init7.call(this),zt.prototype.__init8.call(this),zt.prototype.__init9.call(this),this.state={setCorrectMode:!1,mode:""}}__init(){this.onChangeHandler=(e,t)=>{this.props.onChange(e,t),this.setState({mode:t})}}__init2(){this.toggleCorrectMode=()=>this.setState({setCorrectMode:!this.state.setCorrectMode})}__init3(){this.clear=()=>{this.onChangeHandler([],"")}}__init4(){this.buildTokens=(e,t)=>{const{text:u}=this.props,n=t(u);this.onChangeHandler(n,e)}}__init5(){this.selectToken=(e,t)=>{const{tokens:u}=this.props,n=Mt($t(u),t,It);n.push(e),this.onChangeHandler(n,this.state.mode)}}__init6(){this.tokenClick=e=>{const{setCorrectMode:t}=this.state;t?this.setCorrect(e):this.removeToken(e)}}__init7(){this.tokenIndex=e=>{const{tokens:t}=this.props;return t.findIndex(t=>t.text==e.text&&t.start==e.start&&t.end==e.end)}}__init8(){this.setCorrect=e=>{const{tokens:t}=this.props,u=this.tokenIndex(e);if(-1!==u){const e=t[u];e.correct=!e.correct;const n=$t(t);n.splice(u,1,e),this.onChangeHandler(n,this.state.mode)}}}__init9(){this.removeToken=e=>{const{tokens:t}=this.props,u=this.tokenIndex(e);if(-1!==u){const e=$t(t);e.splice(u,1),this.onChangeHandler(e,this.state.mode)}}}render(){const{text:e,tokens:t}=this.props,{setCorrectMode:u}=this.state;return Ot.createElement("div",null,Ot.createElement(B,{onClear:this.clear,onWords:()=>this.buildTokens("words",ft),onSentences:()=>this.buildTokens("sentence",Ft),onParagraphs:()=>this.buildTokens("paragraphs",Ct),setCorrectMode:u,onToggleCorrectMode:this.toggleCorrectMode}),Ot.createElement(jt,{disabled:u,as:Pt,text:e,tokens:t,onTokenClick:this.tokenClick,onSelectToken:this.selectToken}))}}zt.__initStatic(),zt.__initStatic2();const Wt=t,Ht=u,{styled:Vt}=o,qt=a,{Check:Ut}=l,{Close:Kt}=l,{color:Yt}=i,Gt=Vt("span")(({theme:e})=>({cursor:"pointer",textIndent:0,"&.disabled":{cursor:"inherit",color:Yt.disabled()},"&.disabledBlack":{cursor:"inherit",pointerEvents:"none"},"&.disabledAndSelected":{backgroundColor:Yt.blueGrey100()},[`@media (min-width: ${e.breakpoints.values.md}px)`]:{"&.selectable:hover":{backgroundColor:Yt.blueGrey300(),color:e.palette.common.black,"& > *":{backgroundColor:Yt.blueGrey300()}}},"&.selected":{backgroundColor:Yt.blueGrey100(),color:e.palette.common.black,lineHeight:3.2*parseFloat(e.spacing(1))+"px",border:`solid 2px ${Yt.blueGrey900()}`,borderRadius:"4px","& > *":{backgroundColor:Yt.blueGrey100()}},"&.highlight":{border:`dashed 2px ${Yt.blueGrey600()}`,borderRadius:"4px",lineHeight:3.2*parseFloat(e.spacing(1))+"px"},"&.print":{border:`dashed 2px ${Yt.blueGrey600()}`,borderRadius:"4px",lineHeight:3.2*parseFloat(e.spacing(1))+"px",color:Yt.text()},"&.custom":{display:"initial"}})),Jt=Vt("span")(({theme:e})=>({position:"relative",borderRadius:"4px",color:e.palette.common.black,lineHeight:3.4*parseFloat(e.spacing(1))+2+"px",padding:"2px"})),Qt=Vt(Jt)(()=>({border:`${Yt.correctTertiary()} solid 2px`})),Zt=Vt(Jt)(()=>({border:`${Yt.incorrectWithIcon()} solid 2px`})),Xt=Vt(Jt)(()=>({border:`${Yt.incorrectWithIcon()} dashed 2px`})),eu={color:Yt.white(),position:"absolute",top:"-8px",left:"-8px",borderRadius:"50%",fontSize:"12px",padding:"2px",display:"inline-block"},tu=Vt(Ut)(()=>({...eu,backgroundColor:Yt.correctTertiary()})),uu=Vt(Kt)(()=>({...eu,backgroundColor:Yt.incorrectWithIcon()})),nu=({useWrapper:e,children:t,Container:u,Icon:n})=>e?Wt.createElement(u,null,t,n?Wt.createElement(n,null):null):t;nu.propTypes={useWrapper:Ht.bool,Container:Ht.elementType,Icon:Ht.elementType,children:Ht.node};const ou={text:Ht.string,selectable:Ht.bool};class iu extends Wt.Component{constructor(...e){super(...e),iu.prototype.__init.call(this)}static __initStatic(){this.rootClassName="tokenRootClass"}static __initStatic2(){this.propTypes={...ou,text:Ht.string.isRequired,className:Ht.string,disabled:Ht.bool,highlight:Ht.bool,correct:Ht.bool}}static __initStatic3(){this.defaultProps={selectable:!1,text:""}}__init(){this.getClassAndIconConfig=()=>{const{selectable:e,selected:t,className:u,disabled:n,highlight:o,correct:i,animationsDisabled:s,isMissing:r}=this.props,a="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,l=iu.rootClassName;if(void 0===i&&t&&n)return{className:qt(l,"selected","disabledBlack",u),Component:Gt};if(void 0!==i){const e=!0===i;return{className:qt(l,"custom",u),Component:Gt,Container:e?Qt:Zt,Icon:e?tu:uu}}return r?{className:qt(l,"custom","missing",u),Component:Gt,Container:Xt,Icon:uu}:{className:qt(l,n&&"disabled",e&&!n&&!a&&"selectable",t&&!n&&"selected",t&&n&&"disabledAndSelected",o&&e&&!n&&!t&&"highlight",s&&"print",u),Component:Gt,Container:void 0,Icon:void 0}}}render(){const{text:e,index:t,correct:u,isMissing:n}=this.props,{className:o,Component:i,Container:s,Icon:r}=this.getClassAndIconConfig(),a=i||Gt;return Wt.createElement(nu,{useWrapper:void 0!==u||n,Container:s,Icon:r},Wt.createElement(a,{className:o,dangerouslySetInnerHTML:{__html:(e||"").replace(/\n/g,"<br>")},"data-indexkey":t}))}}iu.__initStatic(),iu.__initStatic2(),iu.__initStatic3();const su=t,ru=u,{styled:au}=o,{clone:lu}=s,{isEqual:cu}=s;function pu(e){let t,u=e[0],n=1;for(;n<e.length;){const o=e[n],i=e[n+1];if(n+=2,("optionalAccess"===o||"optionalCall"===o)&&null==u)return;"access"===o||"optionalAccess"===o?(t=u,u=i(u)):"call"!==o&&"optionalCall"!==o||(u=i((...e)=>u.call(t,...e)),t=void 0)}return u}const du=r("@pie-lib:text-select:token-select"),Du=au("div")(()=>({backgroundColor:"none",whiteSpace:"pre",cursor:"default",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none","& p":{whiteSpace:"break-spaces",margin:0}})),hu=e=>e?e.replace(/<[^>]+>/g,""):e;class gu extends su.Component{constructor(...e){super(...e),gu.prototype.__init.call(this),gu.prototype.__init2.call(this),gu.prototype.__init3.call(this),gu.prototype.__init4.call(this)}static __initStatic(){this.propTypes={tokens:ru.arrayOf(ru.shape(ou)).isRequired,className:ru.string,onChange:ru.func.isRequired,disabled:ru.bool,highlightChoices:ru.bool,animationsDisabled:ru.bool,maxNoOfSelections:ru.number}}static __initStatic2(){this.defaultProps={highlightChoices:!1,maxNoOfSelections:0,tokens:[]}}__init(){this.selectedCount=()=>this.props.tokens.filter(e=>e.selected).length}__init2(){this.canSelectMore=e=>{const{maxNoOfSelections:t}=this.props;return 1===t||(du("[canSelectMore] maxNoOfSelections: ",t,"selectedCount: ",e),t<=0||isFinite(t)&&e<t)}}__init3(){this.toggleToken=e=>{const{target:t}=e,{tokens:u,animationsDisabled:n}=this.props,o=lu(u),i=pu([t,"access",e=>e.closest,"optionalCall",e=>e(`.${iu.rootClassName}`)]),s=pu([i,"optionalAccess",e=>e.dataset,"optionalAccess",e=>e.indexkey]),r=void 0!==s?o[s]:void 0;if(r&&void 0===r.correct&&!n&&!r.isMissing){const{onChange:e,maxNoOfSelections:t}=this.props,n=!r.selected;if(1===t&&1===this.selectedCount()){const t=(u||[]).filter(e=>e.selected),i=o.map(e=>cu(e,t[0])?{...e,selected:!1}:{...e,selectable:!0}),a={...r,selected:n};i.splice(s,1,a),e(i)}else{if(n&&t>0&&this.selectedCount()>=t)return void du("skip toggle max reached");const u={...r,selected:n};o.splice(s,1,u),e(o)}}}}__init4(){this.generateTokensNodes=()=>{const{tokens:e,disabled:t,highlightChoices:u,animationsDisabled:n}=this.props,o=this.selectedCount(),i=[];let s=[];const r=()=>{i.push(su.createElement("p",{key:`p-${i.length}`},s)),s=[]};return(e||[]).forEach((e,i)=>{const a=e.selected||e.selectable&&this.canSelectMore(o),l=void 0!==e.correct&&(e.selectable||e.selected);"\n\n"!==e.text?(e=>"\n"===e)(e.text)?s.push(su.createElement("br",{key:`br-${i}`})):a&&!t||l||e.selected||e.isMissing||n&&e.predefined?s.push(su.createElement(iu,{key:i,disabled:t,index:i,...e,text:hu(e.text),selectable:a,highlight:u,animationsDisabled:n})):s.push(su.createElement(su.Fragment,{key:i},hu(e.text))):r()}),r(),i}}render(){const{className:e}=this.props,t=this.generateTokensNodes();return su.createElement(Du,{className:e,onClick:this.toggleToken},t)}}gu.__initStatic(),gu.__initStatic2();const Cu=t,Fu=u,fu=r("@pie-lib:text-select");class Eu extends Cu.Component{constructor(...e){super(...e),Eu.prototype.__init.call(this)}static __initStatic(){this.propTypes={onChange:Fu.func,disabled:Fu.bool,tokens:Fu.arrayOf(Fu.shape(ou)).isRequired,selectedTokens:Fu.arrayOf(Fu.shape(ou)).isRequired,text:Fu.string.isRequired,className:Fu.string,highlightChoices:Fu.bool,animationsDisabled:Fu.bool,maxNoOfSelections:Fu.number}}__init(){this.change=e=>{const{onChange:t}=this.props;t&&t(e.filter(e=>e.selected).map(e=>({start:e.start,end:e.end})))}}render(){const{text:e,disabled:t,tokens:u,selectedTokens:n,className:o,highlightChoices:i,maxNoOfSelections:s,animationsDisabled:r}=this.props,a=mt(e,u);fu("normalized: ",a);const l=a.map(e=>{const u=-1!==n.findIndex(t=>t.start===e.start&&t.end===e.end),o=u?e.correct:void 0,i=e.isMissing;return{...e,selectable:!t&&e.predefined,selected:u,correct:o,isMissing:i}});return Cu.createElement(gu,{highlightChoices:!t&&i,className:o,tokens:l,disabled:t,onChange:this.change,maxNoOfSelections:s,animationsDisabled:r})}}function mu(e,t){return null!=e?e:t()}function Au(e){let t,u=e[0],n=1;for(;n<e.length;){const o=e[n],i=e[n+1];if(n+=2,("optionalAccess"===o||"optionalCall"===o)&&null==u)return;"access"===o||"optionalAccess"===o?(t=u,u=i(u)):"call"!==o&&"optionalCall"!==o||(u=i((...e)=>u.call(t,...e)),t=void 0)}return u}Eu.__initStatic();const bu=e=>"string"==typeof e,yu=()=>{let e,t;const u=new Promise((u,n)=>{e=u,t=n});return u.resolve=e,u.reject=t,u},Bu=e=>null==e?"":""+e,xu=/###/g,Su=e=>e&&e.indexOf("###")>-1?e.replace(xu,"."):e,vu=e=>!e||bu(e),ku=(e,t,u)=>{const n=bu(t)?t.split("."):t;let o=0;for(;o<n.length-1;){if(vu(e))return{};const t=Su(n[o]);!e[t]&&u&&(e[t]=new u),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return vu(e)?{}:{obj:e,k:Su(n[o])}},wu=(e,t,u)=>{const{obj:n,k:o}=ku(e,t,Object);if(void 0!==n||1===t.length)return void(n[o]=u);let i=t[t.length-1],s=t.slice(0,t.length-1),r=ku(e,s,Object);for(;void 0===r.obj&&s.length;)i=`${s[s.length-1]}.${i}`,s=s.slice(0,s.length-1),r=ku(e,s,Object),Au([r,"optionalAccess",e=>e.obj])&&void 0!==r.obj[`${r.k}.${i}`]&&(r.obj=void 0);r.obj[`${r.k}.${i}`]=u},_u=(e,t)=>{const{obj:u,k:n}=ku(e,t);if(u&&Object.prototype.hasOwnProperty.call(u,n))return u[n]},Nu=(e,t,u)=>{for(const n in t)"__proto__"!==n&&"constructor"!==n&&(n in e?bu(e[n])||e[n]instanceof String||bu(t[n])||t[n]instanceof String?u&&(e[n]=t[n]):Nu(e[n],t[n],u):e[n]=t[n]);return e},Lu=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Pu={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Ou=e=>bu(e)?e.replace(/[&<>"'\/]/g,e=>Pu[e]):e,Ru=[" ",",","?","!",";"],Tu=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const u=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,u),this.regExpQueue.push(e),u}}(20),$u=(e,t,u=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const n=t.split(u);let o=e;for(let e=0;e<n.length;){if(!o||"object"!=typeof o)return;let t,i="";for(let s=e;s<n.length;++s)if(s!==e&&(i+=u),i+=n[s],t=o[i],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&s<n.length-1)continue;e+=s-e+1;break}o=t}return o},Iu=e=>Au([e,"optionalAccess",e=>e.replace,"call",e=>e("_","-")]),Mu={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){Au([console,"optionalAccess",t=>t[e],"optionalAccess",e=>e.apply,"optionalCall",e=>e(console,t)])}};class ju{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Mu,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,u,n){return n&&!this.debug?null:(bu(e[0])&&(e[0]=`${u}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new ju(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new ju(this.logger,e)}}var zu=new ju;class Wu{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const u=this.observers[e].get(t)||0;this.observers[e].set(t,u+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([e,u])=>{for(let n=0;n<u;n++)e(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([u,n])=>{for(let o=0;o<n;o++)u.apply(u,[e,...t])})}}class Hu extends Wu{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,u,n={}){const o=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,i=void 0!==n.ignoreJSONStructure?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,t],u&&(Array.isArray(u)?s.push(...u):bu(u)&&o?s.push(...u.split(o)):s.push(u)));const r=_u(this.data,s);return!r&&!t&&!u&&e.indexOf(".")>-1&&(e=s[0],t=s[1],u=s.slice(2).join(".")),!r&&i&&bu(u)?$u(Au([this,"access",e=>e.data,"optionalAccess",t=>t[e],"optionalAccess",e=>e[t]]),u,o):r}addResource(e,t,u,n,o={silent:!1}){const i=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let s=[e,t];u&&(s=s.concat(i?u.split(i):u)),e.indexOf(".")>-1&&(s=e.split("."),n=t,t=s[1]),this.addNamespaces(t),wu(this.data,s,n),o.silent||this.emit("added",e,t,u,n)}addResources(e,t,u,n={silent:!1}){for(const n in u)(bu(u[n])||Array.isArray(u[n]))&&this.addResource(e,t,n,u[n],{silent:!0});n.silent||this.emit("added",e,t,u)}addResourceBundle(e,t,u,n,o,i={silent:!1,skipCopy:!1}){let s=[e,t];e.indexOf(".")>-1&&(s=e.split("."),n=u,u=t,t=s[1]),this.addNamespaces(t);let r=_u(this.data,s)||{};i.skipCopy||(u=JSON.parse(JSON.stringify(u))),n?Nu(r,u,o):r={...r,...u},wu(this.data,s,r),i.silent||this.emit("added",e,t,u)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var Vu={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,u,n,o){return e.forEach(e=>{t=mu(Au([this,"access",e=>e.processors,"access",t=>t[e],"optionalAccess",e=>e.process,"call",e=>e(t,u,n,o)]),()=>t)}),t}};const qu=Symbol("i18next/PATH_KEY");function Uu(e,t){const{[qu]:u}=e(function(){const e=[],t=Object.create(null);let u;return t.get=(n,o)=>(Au([u,"optionalAccess",e=>e.revoke,"optionalCall",e=>e()]),o===qu?e:(e.push(o),u=Proxy.revocable(n,t),u.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return u.join(mu(Au([t,"optionalAccess",e=>e.keySeparator]),()=>"."))}const Ku={},Yu=e=>!bu(e)&&"boolean"!=typeof e&&"number"!=typeof e;class Gu extends Wu{constructor(e,t={}){var u,n;super(),u=e,n=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{u[e]&&(n[e]=u[e])}),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=zu.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const u={...t};if(null==e)return!1;const n=this.resolve(e,u);if(void 0===Au([n,"optionalAccess",e=>e.res]))return!1;const o=Yu(n.res);return!1!==u.returnObjects||!o}extractFromKey(e,t){let u=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===u&&(u=":");const n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const i=u&&e.indexOf(u)>-1,s=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,u)=>{t=t||"",u=u||"";const n=Ru.filter(e=>t.indexOf(e)<0&&u.indexOf(e)<0);if(0===n.length)return!0;const o=Tu.getRegExp(`(${n.map(e=>"?"===e?"\\?":e).join("|")})`);let i=!o.test(e);if(!i){const t=e.indexOf(u);t>0&&!o.test(e.substring(0,t))&&(i=!0)}return i})(e,u,n));if(i&&!s){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:bu(o)?[o]:o};const i=e.split(u);(u!==n||u===n&&this.options.ns.indexOf(i[0])>-1)&&(o=i.shift()),e=i.join(n)}return{key:e,namespaces:bu(o)?[o]:o}}translate(e,t,u){let n="object"==typeof t?{...t}:t;if("object"!=typeof n&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof n&&(n={...n}),n||(n={}),null==e)return"";"function"==typeof e&&(e=Uu(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]);const o=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,i=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,{key:s,namespaces:r}=this.extractFromKey(e[e.length-1],n),a=r[r.length-1];let l=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===l&&(l=":");const c=n.lng||this.language,p=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===Au([c,"optionalAccess",e=>e.toLowerCase,"call",e=>e()]))return p?o?{res:`${a}${l}${s}`,usedKey:s,exactUsedKey:s,usedLng:c,usedNS:a,usedParams:this.getUsedParamsDetails(n)}:`${a}${l}${s}`:o?{res:s,usedKey:s,exactUsedKey:s,usedLng:c,usedNS:a,usedParams:this.getUsedParamsDetails(n)}:s;const d=this.resolve(e,n);let D=Au([d,"optionalAccess",e=>e.res]);const h=Au([d,"optionalAccess",e=>e.usedKey])||s,g=Au([d,"optionalAccess",e=>e.exactUsedKey])||s,C=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,F=!this.i18nFormat||this.i18nFormat.handleAsObject,f=void 0!==n.count&&!bu(n.count),E=Gu.hasDefaultValue(n),m=f?this.pluralResolver.getSuffix(c,n.count,n):"",A=n.ordinal&&f?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",b=f&&!n.ordinal&&0===n.count,y=b&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${m}`]||n[`defaultValue${A}`]||n.defaultValue;let B=D;F&&!D&&E&&(B=y);const x=Yu(B),S=Object.prototype.toString.apply(B);if(!(F&&B&&x&&["[object Number]","[object Function]","[object RegExp]"].indexOf(S)<0)||bu(C)&&Array.isArray(B))if(F&&bu(C)&&Array.isArray(D))D=D.join(C),D&&(D=this.extendTranslation(D,e,n,u));else{let t=!1,o=!1;!this.isValidLookup(D)&&E&&(t=!0,D=y),this.isValidLookup(D)||(o=!0,D=s);const r=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:D,p=E&&y!==D&&this.options.updateMissing;if(o||t||p){if(this.logger.log(p?"updateKey":"missingKey",c,a,s,p?y:D),i){const e=this.resolve(s,{...n,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let u=0;u<t.length;u++)e.push(t[u]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(n.lng||this.language):e.push(n.lng||this.language);const u=(e,t,u)=>{const o=E&&u!==D?u:r;this.options.missingKeyHandler?this.options.missingKeyHandler(e,a,t,o,p,n):Au([this,"access",e=>e.backendConnector,"optionalAccess",e=>e.saveMissing])&&this.backendConnector.saveMissing(e,a,t,o,p,n),this.emit("missingKey",e,a,t,D)};this.options.saveMissing&&(this.options.saveMissingPlurals&&f?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,n);b&&n[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{u([e],s+t,n[`defaultValue${t}`]||y)})}):u(e,s,y))}D=this.extendTranslation(D,e,n,d,u),o&&D===s&&this.options.appendNamespaceToMissingKey&&(D=`${a}${l}${s}`),(o||t)&&this.options.parseMissingKeyHandler&&(D=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}${l}${s}`:s,t?D:void 0,n))}else{if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,B,{...n,ns:r}):`key '${s} (${this.language})' returned an object instead of string.`;return o?(d.res=e,d.usedParams=this.getUsedParamsDetails(n),d):e}if(i){const e=Array.isArray(B),t=e?[]:{},u=e?g:h;for(const e in B)if(Object.prototype.hasOwnProperty.call(B,e)){const o=`${u}${i}${e}`;t[e]=E&&!D?this.translate(o,{...n,defaultValue:Yu(y)?y[e]:void 0,joinArrays:!1,ns:r}):this.translate(o,{...n,joinArrays:!1,ns:r}),t[e]===o&&(t[e]=B[e])}D=t}}return o?(d.res=D,d.usedParams=this.getUsedParamsDetails(n),d):D}extendTranslation(e,t,u,n,o){if(Au([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.parse]))e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...u},u.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!u.skipInterpolation){u.interpolation&&this.interpolator.init({...u,interpolation:{...this.options.interpolation,...u.interpolation}});const i=bu(e)&&(void 0!==Au([u,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?u.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let s;if(i){const t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let r=u.replace&&!bu(u.replace)?u.replace:u;if(this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),e=this.interpolator.interpolate(e,r,u.lng||this.language||n.usedLng,u),i){const t=e.match(this.interpolator.nestingRegexp);s<(t&&t.length)&&(u.nest=!1)}!u.lng&&n&&n.res&&(u.lng=this.language||n.usedLng),!1!==u.nest&&(e=this.interpolator.nest(e,(...e)=>Au([o,"optionalAccess",e=>e[0]])!==e[0]||u.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),u)),u.interpolation&&this.interpolator.reset()}const i=u.postProcess||this.options.postProcess,s=bu(i)?[i]:i;return null!=e&&Au([s,"optionalAccess",e=>e.length])&&!1!==u.applyPostProcessor&&(e=Vu.handle(s,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(u)},...u}:u,this)),e}resolve(e,t={}){let u,n,o,i,s;return bu(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(u))return;const r=this.extractFromKey(e,t),a=r.key;n=a;let l=r.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const c=void 0!==t.count&&!bu(t.count),p=c&&!t.ordinal&&0===t.count,d=void 0!==t.context&&(bu(t.context)||"number"==typeof t.context)&&""!==t.context,D=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(e=>{this.isValidLookup(u)||(s=e,Ku[`${D[0]}-${e}`]||!Au([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||Au([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(s)])||(Ku[`${D[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${D.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),D.forEach(n=>{if(this.isValidLookup(u))return;i=n;const s=[a];if(Au([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.addLookupKeys]))this.i18nFormat.addLookupKeys(s,a,n,e,t);else{let e;c&&(e=this.pluralResolver.getSuffix(n,t.count,t));const u=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(t.ordinal&&0===e.indexOf(o)&&s.push(a+e.replace(o,this.options.pluralSeparator)),s.push(a+e),p&&s.push(a+u)),d){const n=`${a}${this.options.contextSeparator||"_"}${t.context}`;s.push(n),c&&(t.ordinal&&0===e.indexOf(o)&&s.push(n+e.replace(o,this.options.pluralSeparator)),s.push(n+e),p&&s.push(n+u))}}let r;for(;r=s.pop();)this.isValidLookup(u)||(o=r,u=this.getResource(n,e,r,t))}))})}),{res:u,usedKey:n,exactUsedKey:o,usedLng:i,usedNS:s}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,u,n={}){return Au([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.getResource])?this.i18nFormat.getResource(e,t,u,n):this.resourceStore.getResource(e,t,u,n)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],u=e.replace&&!bu(e.replace);let n=u?e.replace:e;if(u&&void 0!==e.count&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!u){n={...n};for(const e of t)delete n[e]}return n}static hasDefaultValue(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}class Ju{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=zu.create("languageUtils")}getScriptPartFromCode(e){if(!(e=Iu(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=Iu(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(bu(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const u=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(u)||(t=u)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const u=this.getScriptPartFromCode(e);if(this.isSupportedCode(u))return t=u;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find(e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:e.indexOf("-")>0&&n.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===n||0===e.indexOf(n)&&n.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),bu(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let u=e[t];return u||(u=e[this.getScriptPartFromCode(t)]),u||(u=e[this.formatLanguageCode(t)]),u||(u=e[this.getLanguagePartFromCode(t)]),u||(u=e.default),u||[]}toResolveHierarchy(e,t){const u=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),n=[],o=e=>{e&&(this.isSupportedCode(e)?n.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return bu(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):bu(e)&&o(this.formatLanguageCode(e)),u.forEach(e=>{n.indexOf(e)<0&&o(this.formatLanguageCode(e))}),n}}const Qu={zero:0,one:1,two:2,few:3,many:4,other:5},Zu={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Xu{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=zu.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const u=Iu("dev"===e?"en":e),n=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:u,type:n});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let i;try{i=new Intl.PluralRules(u,{type:n})}catch(u){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Zu;if(!e.match(/-|_/))return Zu;const n=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(n,t)}return this.pluralRulesCache[o]=i,i}needsPlural(e,t={}){let u=this.getRule(e,t);return u||(u=this.getRule("dev",t)),Au([u,"optionalAccess",e=>e.resolvedOptions,"call",e=>e(),"access",e=>e.pluralCategories,"access",e=>e.length])>1}getPluralFormsOfKey(e,t,u={}){return this.getSuffixes(e,u).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let u=this.getRule(e,t);return u||(u=this.getRule("dev",t)),u?u.resolvedOptions().pluralCategories.sort((e,t)=>Qu[e]-Qu[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,u={}){const n=this.getRule(e,u);return n?`${this.options.prepend}${u.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,u))}}const en=(e,t,u,n=".",o=!0)=>{let i=((e,t,u)=>{const n=_u(e,u);return void 0!==n?n:_u(t,u)})(e,t,u);return!i&&o&&bu(u)&&(i=$u(e,u,n),void 0===i&&(i=$u(t,u,n))),i},tn=e=>e.replace(/\$/g,"$$$$");class un{constructor(e={}){this.logger=zu.create("interpolator"),this.options=e,this.format=Au([e,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.format])||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:u,useRawValueToEscape:n,prefix:o,prefixEscaped:i,suffix:s,suffixEscaped:r,formatSeparator:a,unescapeSuffix:l,unescapePrefix:c,nestingPrefix:p,nestingPrefixEscaped:d,nestingSuffix:D,nestingSuffixEscaped:h,nestingOptionsSeparator:g,maxReplaces:C,alwaysFormat:F}=e.interpolation;this.escape=void 0!==t?t:Ou,this.escapeValue=void 0===u||u,this.useRawValueToEscape=void 0!==n&&n,this.prefix=o?Lu(o):i||"{{",this.suffix=s?Lu(s):r||"}}",this.formatSeparator=a||",",this.unescapePrefix=l?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=p?Lu(p):d||Lu("$t("),this.nestingSuffix=D?Lu(D):h||Lu(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=C||1e3,this.alwaysFormat=void 0!==F&&F,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>Au([e,"optionalAccess",e=>e.source])===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,u,n){let o,i,s;const r=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},a=e=>{if(e.indexOf(this.formatSeparator)<0){const o=en(t,r,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,u,{...n,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),i=o.shift().trim(),s=o.join(this.formatSeparator).trim();return this.format(en(t,r,i,this.options.keySeparator,this.options.ignoreJSONStructure),s,u,{...n,...t,interpolationkey:i})};this.resetRegExp();const l=Au([n,"optionalAccess",e=>e.missingInterpolationHandler])||this.options.missingInterpolationHandler,c=void 0!==Au([n,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>tn(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?tn(this.escape(e)):tn(e)}].forEach(t=>{for(s=0;o=t.regex.exec(e);){const u=o[1].trim();if(i=a(u),void 0===i)if("function"==typeof l){const t=l(e,o,n);i=bu(t)?t:""}else if(n&&Object.prototype.hasOwnProperty.call(n,u))i="";else{if(c){i=o[0];continue}this.logger.warn(`missed to pass in variable ${u} for interpolating ${e}`),i=""}else bu(i)||this.useRawValueToEscape||(i=Bu(i));const r=t.safeValue(i);if(e=e.replace(o[0],r),c?(t.regex.lastIndex+=i.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,t,u={}){let n,o,i;const s=(e,t)=>{const u=this.nestingOptionsSeparator;if(e.indexOf(u)<0)return e;const n=e.split(new RegExp(`${u}[ ]*{`));let o=`{${n[1]}`;e=n[0],o=this.interpolate(o,i);const s=o.match(/'/g),r=o.match(/"/g);(mu(Au([s,"optionalAccess",e=>e.length]),()=>0)%2==0&&!r||r.length%2!=0)&&(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),t&&(i={...t,...i})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${u}${o}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,e};for(;n=this.nestingRegexp.exec(e);){let r=[];i={...u},i=i.replace&&!bu(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;const a=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(-1!==a&&(r=n[1].slice(a).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),n[1]=n[1].slice(0,a)),o=t(s.call(this,n[1].trim(),i),i),o&&n[0]===e&&!bu(o))return o;bu(o)||(o=Bu(o)),o||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),o=""),r.length&&(o=r.reduce((e,t)=>this.format(e,t,u.lng,{...u,interpolationkey:n[1].trim()}),o.trim())),e=e.replace(n[0],o),this.regexp.lastIndex=0}return e}}const nn=e=>{const t={};return(u,n,o)=>{let i=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(i={...i,[o.interpolationkey]:void 0});const s=n+JSON.stringify(i);let r=t[s];return r||(r=e(Iu(n),o),t[s]=r),r(u)}},on=e=>(t,u,n)=>e(Iu(u),n)(t);class sn{constructor(e={}){this.logger=zu.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const u=t.cacheInBuiltFormats?nn:on;this.formats={number:u((e,t)=>{const u=new Intl.NumberFormat(e,{...t});return e=>u.format(e)}),currency:u((e,t)=>{const u=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>u.format(e)}),datetime:u((e,t)=>{const u=new Intl.DateTimeFormat(e,{...t});return e=>u.format(e)}),relativetime:u((e,t)=>{const u=new Intl.RelativeTimeFormat(e,{...t});return e=>u.format(e,t.range||"day")}),list:u((e,t)=>{const u=new Intl.ListFormat(e,{...t});return e=>u.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=nn(t)}format(e,t,u,n={}){const o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(e=>e.indexOf(")")>-1)){const e=o.findIndex(e=>e.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}return o.reduce((e,t)=>{const{formatName:o,formatOptions:i}=(e=>{let t=e.toLowerCase().trim();const u={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const o=n[1].substring(0,n[1].length-1);"currency"===t&&o.indexOf(":")<0?u.currency||(u.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?u.range||(u.range=o.trim()):o.split(";").forEach(e=>{if(e){const[t,...n]=e.split(":"),o=n.join(":").trim().replace(/^'+|'+$/g,""),i=t.trim();u[i]||(u[i]=o),"false"===o&&(u[i]=!1),"true"===o&&(u[i]=!0),isNaN(o)||(u[i]=parseInt(o,10))}})}return{formatName:t,formatOptions:u}})(t);if(this.formats[o]){let t=e;try{const s=Au([n,"optionalAccess",e=>e.formatParams,"optionalAccess",e=>e[n.interpolationkey]])||{},r=s.locale||s.lng||n.locale||n.lng||u;t=this.formats[o](e,r,{...i,...n,...s})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e)}}class rn extends Wu{constructor(e,t,u,n={}){super(),this.backend=e,this.store=t,this.services=u,this.languageUtils=u.languageUtils,this.options=n,this.logger=zu.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],Au([this,"access",e=>e.backend,"optionalAccess",e=>e.init,"optionalCall",e=>e(u,n.backend,n)])}queueLoad(e,t,u,n){const o={},i={},s={},r={};return e.forEach(e=>{let n=!0;t.forEach(t=>{const s=`${e}|${t}`;!u.reload&&this.store.hasResourceBundle(e,t)?this.state[s]=2:this.state[s]<0||(1===this.state[s]?void 0===i[s]&&(i[s]=!0):(this.state[s]=1,n=!1,void 0===i[s]&&(i[s]=!0),void 0===o[s]&&(o[s]=!0),void 0===r[t]&&(r[t]=!0)))}),n||(s[e]=!0)}),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(r)}}loaded(e,t,u){const n=e.split("|"),o=n[0],i=n[1];t&&this.emit("failedLoading",o,i,t),!t&&u&&this.store.addResourceBundle(o,i,u,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&u&&(this.state[e]=0);const s={};this.queue.forEach(u=>{((e,t,u)=>{const{obj:n,k:o}=ku(e,t,Object);n[o]=n[o]||[],n[o].push(u)})(u.loaded,[o],i),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(u,e),t&&u.errors.push(t),0!==u.pendingCount||u.done||(Object.keys(u.loaded).forEach(e=>{s[e]||(s[e]={});const t=u.loaded[e];t.length&&t.forEach(t=>{void 0===s[e][t]&&(s[e][t]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(e=>!e.done)}read(e,t,u,n=0,o=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:u,tried:n,wait:o,callback:i});this.readingCalls++;const s=(s,r)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}s&&r&&n<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,u,n+1,2*o,i)},o):i(s,r)},r=this.backend[u].bind(this.backend);if(2!==r.length)return r(e,t,s);try{const u=r(e,t);u&&"function"==typeof u.then?u.then(e=>s(null,e)).catch(s):s(null,u)}catch(e){s(e)}}prepareLoading(e,t,u={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();bu(e)&&(e=this.languageUtils.toResolveHierarchy(e)),bu(t)&&(t=[t]);const o=this.queueLoad(e,t,u,n);if(!o.toLoad.length)return o.pending.length||n(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,u){this.prepareLoading(e,t,{},u)}reload(e,t,u){this.prepareLoading(e,t,{reload:!0},u)}loadOne(e,t=""){const u=e.split("|"),n=u[0],o=u[1];this.read(n,o,"read",void 0,void 0,(u,i)=>{u&&this.logger.warn(`${t}loading namespace ${o} for language ${n} failed`,u),!u&&i&&this.logger.log(`${t}loaded namespace ${o} for language ${n}`,i),this.loaded(e,u,i)})}saveMissing(e,t,u,n,o,i={},s=()=>{}){if(!Au([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||Au([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(t)])){if(null!=u&&""!==u){if(Au([this,"access",e=>e.backend,"optionalAccess",e=>e.create])){const r={...i,isUpdate:o},a=this.backend.create.bind(this.backend);if(a.length<6)try{let o;o=5===a.length?a(e,t,u,n,r):a(e,t,u,n),o&&"function"==typeof o.then?o.then(e=>s(null,e)).catch(s):s(null,o)}catch(e){s(e)}else a(e,t,u,n,s,r)}e&&e[0]&&this.store.addResource(e[0],t,u,n)}}else this.logger.warn(`did not save key "${u}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const an=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),bu(e[1])&&(t.defaultValue=e[1]),bu(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const u=e[3]||e[2];Object.keys(u).forEach(e=>{t[e]=u[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ln=e=>(bu(e.ns)&&(e.ns=[e.ns]),bu(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),bu(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),Au([e,"access",e=>e.supportedLngs,"optionalAccess",e=>e.indexOf,"optionalCall",e=>e("cimode")])<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),cn=()=>{};class pn extends Wu{constructor(e={},t){var u;if(super(),this.options=ln(e),this.services={},this.logger=zu,this.modules={external:[]},u=this,Object.getOwnPropertyNames(Object.getPrototypeOf(u)).forEach(e=>{"function"==typeof u[e]&&(u[e]=u[e].bind(u))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(bu(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const u=an();var n;this.options={...u,...this.options,...ln(e)},this.options.interpolation={...u.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=u.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||Au([n=this,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||Au([n,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||Au([n,"optionalAccess",e=>e.options,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.backends])&&n.options.backend.backends.some(e=>Au([e,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0||Au([e,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0)||"undefined"!=typeof console&&void 0!==console.info&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const o=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?zu.init(o(this.modules.logger),this.options):zu.init(null,this.options),e=this.modules.formatter?this.modules.formatter:sn;const t=new Ju(this.options);this.store=new Hu(this.options.resources,this.options);const n=this.services;n.logger=zu,n.resourceStore=this.store,n.languageUtils=t,n.pluralResolver=new Xu(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==u.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!e||this.options.interpolation.format&&this.options.interpolation.format!==u.interpolation.format||(n.formatter=o(e),n.formatter.init&&n.formatter.init(n,this.options),this.options.interpolation.format=n.formatter.format.bind(n.formatter)),n.interpolator=new un(this.options),n.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},n.backendConnector=new rn(o(this.modules.backend),n.resourceStore,n,this.options),n.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(n.languageDetector=o(this.modules.languageDetector),n.languageDetector.init&&n.languageDetector.init(n,this.options.detection,this.options)),this.modules.i18nFormat&&(n.i18nFormat=o(this.modules.i18nFormat),n.i18nFormat.init&&n.i18nFormat.init(this)),this.translator=new Gu(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=cn),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const i=yu(),s=()=>{const e=(e,u)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),i.resolve(u),t(e,u)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?s():setTimeout(s,0),i}loadResources(e,t=cn){let u=t;const n=bu(e)?e:this.language;if("function"==typeof e&&(u=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===Au([n,"optionalAccess",e=>e.toLowerCase,"call",e=>e()])&&(!this.options.preload||0===this.options.preload.length))return u();const e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};n?t(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),Au([this,"access",e=>e.options,"access",e=>e.preload,"optionalAccess",e=>e.forEach,"optionalCall",e=>e(e=>t(e))]),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),u(e)})}else u(null)}reloadResources(e,t,u){const n=yu();return"function"==typeof e&&(u=e,e=void 0),"function"==typeof t&&(u=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),u||(u=cn),this.services.backendConnector.reload(e,t,e=>{n.resolve(),u(e)}),n}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Vu.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const u=yu();this.emit("languageChanging",e);const n=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(o,i)=>{i?this.isLanguageChangingTo===e&&(n(i),this.translator.changeLanguage(i),this.isLanguageChangingTo=void 0,this.emit("languageChanged",i),this.logger.log("languageChanged",i)):this.isLanguageChangingTo=void 0,u.resolve((...e)=>this.t(...e)),t&&t(o,(...e)=>this.t(...e))},i=t=>{e||t||!this.services.languageDetector||(t=[]);const u=bu(t)?t:t&&t[0],i=this.store.hasLanguageSomeTranslations(u)?u:this.services.languageUtils.getBestMatchFromCodes(bu(t)?[t]:t);i&&(this.language||n(i),this.translator.language||this.translator.changeLanguage(i),Au([this,"access",e=>e.services,"access",e=>e.languageDetector,"optionalAccess",e=>e.cacheUserLanguage,"optionalCall",e=>e(i)])),this.loadResources(i,e=>{o(e,i)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),u}getFixedT(e,t,u){const n=(e,t,...o)=>{let i;i="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(o)):{...t},i.lng=i.lng||n.lng,i.lngs=i.lngs||n.lngs,i.ns=i.ns||n.ns,""!==i.keyPrefix&&(i.keyPrefix=i.keyPrefix||u||n.keyPrefix);const s=this.options.keySeparator||".";let r;return i.keyPrefix&&Array.isArray(e)?r=e.map(e=>("function"==typeof e&&(e=Uu(e,{...this.options,...t})),`${i.keyPrefix}${s}${e}`)):("function"==typeof e&&(e=Uu(e,{...this.options,...t})),r=i.keyPrefix?`${i.keyPrefix}${s}${e}`:e),this.t(r,i)};return bu(e)?n.lng=e:n.lngs=e,n.ns=t,n.keyPrefix=u,n}t(...e){return Au([this,"access",e=>e.translator,"optionalAccess",e=>e.translate,"call",t=>t(...e)])}exists(...e){return Au([this,"access",e=>e.translator,"optionalAccess",e=>e.exists,"call",t=>t(...e)])}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const u=t.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===u.toLowerCase())return!0;const i=(e,t)=>{const u=this.services.backendConnector.state[`${e}|${t}`];return-1===u||0===u||2===u};if(t.precheck){const e=t.precheck(this,i);if(void 0!==e)return e}return!(!this.hasResourceBundle(u,e)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!i(u,e)||n&&!i(o,e)))}loadNamespaces(e,t){const u=yu();return this.options.ns?(bu(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{u.resolve(),t&&t(e)}),u):(t&&t(),Promise.resolve())}loadLanguages(e,t){const u=yu();bu(e)&&(e=[e]);const n=this.options.preload||[],o=e.filter(e=>n.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=n.concat(o),this.loadResources(e=>{u.resolve(),t&&t(e)}),u):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(Au([this,"access",e=>e.languages,"optionalAccess",e=>e.length])>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=Au([this,"access",e=>e.services,"optionalAccess",e=>e.languageUtils])||new Ju(an());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const u=new pn(e,t);return u.createInstance=pn.createInstance,u}cloneInstance(e={},t=cn){const u=e.forkResourceStore;u&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},o=new pn(n);if(void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e)),["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},u){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((u,n)=>(u[n]={...e[t][n]},u),e[t]),e),{});o.store=new Hu(e,n),o.services.resourceStore=o.store}if(e.interpolation){const t={...an().interpolation,...this.options.interpolation,...e.interpolation},u={...n,interpolation:t};o.services.interpolator=new un(u)}return o.translator=new Gu(o.services,n),o.translator.on("*",(e,...t)=>{o.emit(e,...t)}),o.init(n,t),o.translator.options=n,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const dn=pn.createInstance();dn.createInstance,dn.dir,dn.init,dn.loadResources,dn.reloadResources,dn.use,dn.changeLanguage,dn.getFixedT,dn.t,dn.exists,dn.setDefaultNamespace,dn.hasLoadedNamespace,dn.loadNamespaces,dn.loadLanguages,dn.init({fallbackLng:"en",lng:"en",debug:!0,resources:{en:{translation:{categorize:{limitMaxChoicesPerCategory:"You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",maxChoicesPerCategoryRestriction:"To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s]."},ebsr:{part:"Part {{index}}"},numberLine:{addElementLimit_one:"You can only add {{count}} element",addElementLimit_other:"You can only add {{count}} elements",clearAll:"Clear all"},imageClozeAssociation:{reachedLimit_one:"You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.",reachedLimit_other:"Full"},drawingResponse:{fillColor:"Fill color",outlineColor:"Outline color",noFill:"No fill",lightblue:"Light blue",lightyellow:"Light yellow",red:"Red",orange:"Orange",yellow:"Yellow",violet:"Violet",blue:"Blue",green:"Green",white:"White",black:"Black",onDoubleClick:"Double click to edit this text. Press Enter to submit."},charting:{addCategory:"Add category",actions:"Actions",add:"Add",delete:"Delete",newLabel:"New label",reachedLimit_other:"There can't be more than {{count}} categories.",keyLegend:{incorrectAnswer:"Student incorrect answer",correctAnswer:"Student correct answer",correctKeyAnswer:"Answer key correct"}},graphing:{point:"Point",circle:"Circle",line:"Line",parabola:"Parabola",absolute:"Absolute Value",exponential:"Exponential",polygon:"Polygon",ray:"Ray",segment:"Segment",sine:"Sine",vector:"Vector",label:"Label",redo:"Redo",reset:"Reset"},mathInline:{primaryCorrectWithAlternates:"Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct."},multipleChoice:{minSelections:"Select at least {{minSelections}}.",maxSelections_one:"Only {{maxSelections}} answer is allowed.",maxSelections_other:"Only {{maxSelections}} answers are allowed.",minmaxSelections_equal:"Select {{minSelections}}.",minmaxSelections_range:"Select between {{minSelections}} and {{maxSelections}}."},selectText:{correctAnswerSelected:"Correct",correctAnswerNotSelected:"Correct Answer Not Selected",incorrectSelection:"Incorrect Selection",key:"Key"}},common:{undo:"Undo",clearAll:"Clear all",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Show correct answer",hideCorrectAnswer:"Hide correct answer",commonCorrectAnswerWithAlternates:"Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.",warning:"Warning",showNote:"Show Note",hideNote:"Hide Note",cancel:"Cancel"}},es:{translation:{categorize:{limitMaxChoicesPerCategory:"Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",maxChoicesPerCategoryRestriction:"Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta"},ebsr:{part:"Parte {{index}}"},numberLine:{addElementLimit_one:"Solo puedes agregar {{count}} elemento",addElementLimit_other:"Solo puedes agregar {{count}} elementos",clearAll:"Borrar todo"},imageClozeAssociation:{reachedLimit_one:"Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",reachedLimit_other:"Lleno"},drawingResponse:{fillColor:"Color de relleno",outlineColor:"Color del contorno",noFill:"Sin relleno",lightblue:"Azul claro",lightyellow:"Amarillo claro",red:"Rojo",orange:"Naranja",yellow:"Amarillo",violet:"Violeta",blue:"Azul",green:"Verde",white:"Blanco",black:"Negro",onDoubleClick:"Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar"},charting:{addCategory:"Añadir categoría",actions:"Acciones",add:"Añadir",delete:"Eliminar",newLabel:"Nueva etiqueta",reachedLimit_other:"No puede haber más de {{count}} categorías.",keyLegend:{incorrectAnswer:"Respuesta incorrecta del estudiante",correctAnswer:"Respuesta correcta del estudiante",correctKeyAnswer:"Clave de respuesta correcta"}},graphing:{point:"Punto",circle:"Circulo",line:"Línea",parabola:"Parábola",absolute:"Valor absoluto",exponential:"Exponencial",polygon:"Polígono",ray:"Semirrecta",segment:"Segmento ",sine:"Seno",vector:"Vector",label:"Etiqueta",redo:"Rehacer",reset:"Reiniciar"},mathInline:{primaryCorrectWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas."},multipleChoice:{minSelections:"Seleccione al menos {{minSelections}}.",maxSelections_one:"Sólo se permite {{maxSelections}} respuesta.",maxSelections_other:"Sólo se permiten {{maxSelections}} respuestas.",minmaxSelections_equal:"Seleccione {{minSelections}}.",minmaxSelections_range:"Seleccione entre {{minSelections}} y {{maxSelections}}."},selectText:{correctAnswerSelected:"Respuesta Correcta",correctAnswerNotSelected:"Respuesta Correcta No Seleccionada",incorrectSelection:"Selección Incorrecta",key:"Clave"}},common:{undo:"Deshacer",clearAll:"Borrar todo",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Mostrar respuesta correcta",hideCorrectAnswer:"Ocultar respuesta correcta",commonCorrectAnswerWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.",warning:"Advertencia",showNote:"Mostrar Nota",hideNote:"Ocultar Nota",cancel:"Cancelar"}}}});const{styled:Dn}=o,{Check:hn}=l,{Close:gn}=l,{color:Cn}=i;Dn("div")(({theme:e})=>({display:"flex",flexDirection:"row",alignItems:"center",gap:e.spacing(2),borderBottom:"1px solid lightgrey",borderTop:"1px solid lightgrey",paddingBottom:e.spacing(1),paddingTop:e.spacing(1),marginBottom:e.spacing(1)})),Dn("span")(({theme:e})=>({fontSize:"14px",fontWeight:"bold",color:Cn.black(),marginLeft:e.spacing(1)}));const Fn=Dn("div")(()=>({position:"relative",padding:"4px",fontSize:"14px",borderRadius:"4px"}));Dn(Fn)(()=>({border:`${Cn.correctTertiary()} solid 2px`})),Dn(Fn)(()=>({border:`${Cn.incorrectWithIcon()} solid 2px`})),Dn(Fn)(()=>({border:`${Cn.incorrectWithIcon()} dashed 2px`}));const fn={color:Cn.white(),position:"absolute",top:"-8px",left:"-8px",borderRadius:"50%",fontSize:"12px",padding:"2px"};Dn(hn)(()=>({...fn,backgroundColor:Cn.correctTertiary()})),Dn(gn)(()=>({...fn,backgroundColor:Cn.incorrectWithIcon()}));var En=function(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("div");return t.innerHTML=e.trim(),t}(e),u=document.createElement("div");return u.innerHTML="<div separator='true'>".concat(t.innerHTML,"</div>"),t=u,0===Array.from(t.querySelectorAll("*")).length?e:function(e){var t=e.querySelectorAll("div[separator=true]"),u="";return t.forEach(function(e,n){var o;u+=(o=e,n===t.length-1?o.innerHTML:"".concat(o.innerHTML,"\n\n"))}),u||null}(t)};const mn=t,An=u,{TextField:bn}=n,{Chip:yn}=n,{Tooltip:Bn}=n,{styled:xn}=o,{cloneDeep:Sn}=s,{debounce:vn}=s,{Info:kn}=l,wn=r,{InputContainer:_n}=c,{NumberTextField:Nn}=c,{FeedbackConfig:Ln}=c,{settings:Pn}=c,{layout:On}=c,Rn=p;function Tn(e){let t,u=e[0],n=1;for(;n<e.length;){const o=e[n],i=e[n+1];if(n+=2,("optionalAccess"===o||"optionalCall"===o)&&null==u)return;"access"===o||"optionalAccess"===o?(t=u,u=i(u)):"call"!==o&&"optionalCall"!==o||(u=i((...e)=>u.call(t,...e)),t=void 0)}return u}const{Panel:$n,toggle:In,radio:Mn,dropdown:jn}=Pn,zn=xn(_n)(({theme:e})=>({width:"100%",paddingTop:e.spacing(2),marginBottom:e.spacing(2)})),Wn=xn(Rn)({width:"100%"}),Hn=xn("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing(1)})),Vn=xn(bn)({width:"100%"}),qn=xn(_n)(({theme:e})=>({paddingRight:0,marginRight:0,position:"relative","&:after":{position:"absolute",bottom:0,left:0,right:0,height:"1px",content:'""',backgroundColor:e.palette.primary.main},marginBottom:e.spacing(1)})),Un=xn(Bn)(({theme:e})=>({"& .MuiTooltip-tooltip":{fontSize:e.typography.fontSize-2,whiteSpace:"pre",maxWidth:"500px"}})),Kn=xn(zt)(({theme:e})=>({marginTop:e.spacing(2)})),Yn=xn(yn)(({theme:e})=>({marginTop:e.spacing(.5),marginRight:e.spacing(2)})),Gn=xn("div")(({theme:e})=>({display:"flex",alignItems:"center",flexWrap:"wrap",marginBottom:e.spacing(2.5)})),Jn=xn(Nn)(({theme:e})=>({width:"180px",margin:`${e.spacing(.5)}px auto 0`})),Qn=wn("@pie-element:select-text:configure");class Zn extends mn.Component{static __initStatic(){this.propTypes={model:An.object.isRequired,configuration:An.object.isRequired,onModelChanged:An.func.isRequired,onConfigurationChanged:An.func.isRequired,imageSupport:An.shape({add:An.func.isRequired,delete:An.func.isRequired}),uploadSoundSupport:An.object}}static __initStatic2(){this.defaultProps={}}constructor(e){super(e),Zn.prototype.__init.call(this),Zn.prototype.__init2.call(this),Zn.prototype.__init3.call(this),Zn.prototype.__init4.call(this),Zn.prototype.__init5.call(this),Zn.prototype.__init6.call(this),Zn.prototype.__init7.call(this),Zn.prototype.__init8.call(this),Zn.prototype.__init9.call(this),Zn.prototype.__init10.call(this);const{model:t}=this.props;this.state={text:t&&t.text||""}}UNSAFE_componentWillReceiveProps(e){const{model:t}=e;t&&t.text&&this.setState({text:t.text})}__init(){this.updateText=vn(e=>{this.apply(t=>{t.text=e,t.tokens=[]})},200)}__init2(){this.changeText=e=>this.updateText(e.target.value)}__init3(){this.changeTokens=(e,t)=>{this.apply(u=>{u.tokens=e,u.mode=t;const n=e.filter(e=>e.correct).length,o=isFinite(u.maxSelections)?u.maxSelections:0;u.maxSelections=Math.max(o,n)})}}__init4(){this.changeMaxSelections=(e,t)=>{this.apply(e=>e.maxSelections=t)}}__init5(){this.apply=e=>{const{onModelChanged:t,model:u}=this.props,n=Sn(u);e(n),t(n)}}__init6(){this.changeFeedback=e=>{this.apply(t=>t.feedback=e)}}__init7(){this.changePartialScoring=e=>{const{onModelChanged:t,model:u}=this.props,n=Sn(u);n.partialScoring=e,t(n)}}__init8(){this.onPromptChanged=e=>{const{onModelChanged:t,model:u}=this.props,n=Sn(u);n.prompt=e,t(n)}}__init9(){this.onTeacherInstructionsChanged=e=>{const{onModelChanged:t,model:u}=this.props,n=Sn(u);n.teacherInstructions=e,t(n)}}__init10(){this.onRationaleChanged=e=>{const{onModelChanged:t,model:u}=this.props;t({...u,rationale:e})}}render(){const{text:e}=this.state,{configuration:t,imageSupport:u,model:n,onConfigurationChanged:o,onModelChanged:i,uploadSoundSupport:s}=this.props,{baseInputConfiguration:r={},correctAnswer:a={},contentDimensions:l={},feedback:c={},highlightChoices:p={},mode:d={},partialScoring:D={},prompt:h={},rationale:g={},selectionCount:C={},selections:F={},settingsPanelDisabled:f,scoringType:E={},spellCheck:m={},studentInstructions:A={},teacherInstructions:b={},text:y={},tokens:B={},maxImageWidth:x={},maxImageHeight:S={},withRubric:v={},mathMlOptions:k={},language:w={},languageChoices:_={}}=t||{},{errors:N,extraCSSRules:L,feedbackEnabled:P,promptEnabled:O,rationaleEnabled:R,spellCheckEnabled:T,teacherInstructionsEnabled:$,toolbarEditorPosition:I}=n||{},{prompt:M,rationale:j,selectionsError:z,teacherInstructions:W,tokensError:H}=N||{},V=(e=>{const{minTokens:t,maxTokens:u,maxSelections:n}=e;return`Validation requirements:\nThere should be at least ${t} `+(u?`and at most ${u} `:"")+"tokens defined.\nThere should be at least 1 "+(n?`and at most ${n} `:"")+"token"+(n?"s":"")+" selected."})(t),q=x&&x.prompt,U=S&&S.prompt;let{tokens:K}=n;K=K||[];const Y={position:"top"===I?"top":"bottom"};Qn("[render] maxSelections:",n.maxSelections);const G={partialScoring:D.settings&&In(D.label),highlightChoices:p.settings&&In(p.label),feedbackEnabled:c.settings&&In(c.label),"language.enabled":w.settings&&In(w.label,!0),language:w.settings&&w.enabled&&jn(_.label,_.options)},J={teacherInstructionsEnabled:b.settings&&In(b.label),studentInstructionsEnabled:A.settings&&In(A.label),promptEnabled:h.settings&&In(h.label),rationaleEnabled:g.settings&&In(g.label),spellCheckEnabled:m.settings&&In(m.label),scoringType:E.settings&&Mn(E.label,["auto","rubric"]),rubricEnabled:Tn([v,"optionalAccess",e=>e.settings])&&In(Tn([v,"optionalAccess",e=>e.label]))},Q=(e={})=>({...r,...e});return mn.createElement(On.ConfigLayout,{extraCSSRules:L,dimensions:l,hideSettings:f,settings:mn.createElement($n,{model:n,configuration:t,onChangeModel:e=>i(e),onChangeConfiguration:o,groups:{Settings:G,Properties:J}})},$&&mn.createElement(zn,{label:b.label},mn.createElement(Wn,{markup:n.teacherInstructions||"",onChange:this.onTeacherInstructionsChanged,imageSupport:u,nonEmpty:!1,error:W,toolbarOpts:Y,pluginProps:Q(Tn([t,"optionalAccess",e=>e.teacherInstructions,"optionalAccess",e=>e.inputConfiguration])),spellCheck:T,maxImageWidth:x&&x.teacherInstructions||q,maxImageHeight:S&&S.teacherInstructions||U,uploadSoundSupport:s,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:k}),W&&mn.createElement(Hn,null,W)),O&&mn.createElement(zn,{label:h.label||""},mn.createElement(Wn,{markup:n.prompt,onChange:this.onPromptChanged,imageSupport:u,error:M,toolbarOpts:Y,pluginProps:Q(Tn([t,"optionalAccess",e=>e.prompt,"optionalAccess",e=>e.inputConfiguration])),spellCheck:T,maxImageWidth:q,maxImageHeight:U,uploadSoundSupport:s,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:k}),M&&mn.createElement(Hn,null,M)),y.settings&&mn.createElement(zn,{label:y.label||""},mn.createElement(Vn,{variant:"standard",multiline:!0,defaultValue:e,onChange:this.changeText,spellCheck:T})),B.settings&&mn.createElement(qn,{label:B.label||""},mn.createElement(Un,{disableFocusListener:!0,disableTouchListener:!0,placement:"right",title:V},mn.createElement(kn,{fontSize:"small",color:"primary",style:{position:"absolute",left:"48px",top:"-3px"}})),mn.createElement(Kn,{text:n.text,tokens:K,onChange:this.changeTokens})),H&&mn.createElement(Hn,null,H),z&&mn.createElement(Hn,null,z),mn.createElement(Gn,null,d.settings&&mn.createElement(Yn,{label:`${d.label}: ${n.mode?n.mode:"None"}`}),F.settings&&mn.createElement(Yn,{label:`${F.label}: ${K.length}`}),a.settings&&mn.createElement(Yn,{label:`${a.label}: ${K.filter(e=>e.correct).length}`}),C.settings&&mn.createElement(Jn,{min:K.filter(e=>e.correct).length||0,label:`${C.label} (0:any)`,max:K.length,value:n.maxSelections,onChange:this.changeMaxSelections})),R&&mn.createElement(zn,{label:g.label||""},mn.createElement(Wn,{markup:n.rationale||"",onChange:this.onRationaleChanged,imageSupport:u,error:j,toolbarOpts:Y,pluginProps:Q(Tn([t,"optionalAccess",e=>e.rationale,"optionalAccess",e=>e.inputConfiguration])),spellCheck:T,maxImageWidth:x&&x.rationale||q,maxImageHeight:S&&S.rationale||U,uploadSoundSupport:s,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:k}),j&&mn.createElement(Hn,null,j)),P&&mn.createElement(Ln,{feedback:n.feedback,onChange:this.changeFeedback,toolbarOpts:Y}))}}Zn.__initStatic(),Zn.__initStatic2();var Xn={};Object.defineProperty(Xn,"__esModule",{value:!0});class eo extends CustomEvent{constructor(e,t=!1){super(eo.TYPE,{bubbles:!0,detail:{update:e,reset:t}}),this.update=e,this.reset=t}}eo.TYPE="model.updated";var to=Xn.ModelUpdatedEvent=eo;class uo extends CustomEvent{constructor(e,t){super(uo.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}uo.TYPE="delete.image";var no=Xn.DeleteImageEvent=uo;class oo extends CustomEvent{constructor(e){super(oo.TYPE,{bubbles:!0,detail:e}),this.handler=e}}oo.TYPE="insert.image";var io=Xn.InsertImageEvent=oo;class so extends CustomEvent{constructor(e,t){super(so.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}so.TYPE="delete.sound";var ro=Xn.DeleteSoundEvent=so;class ao extends CustomEvent{constructor(e){super(ao.TYPE,{bubbles:!0,detail:e}),this.handler=e}}ao.TYPE="insert.sound";var lo=Xn.InsertSoundEvent=ao,co={feedbackEnabled:!1,highlightChoices:!1,maxSelections:0,mode:"sentence",partialScoring:!1,prompt:"",promptEnabled:!0,rationale:"",rationaleEnabled:!0,scoringType:"auto",studentInstructionsEnabled:!0,teacherInstructions:"",teacherInstructionsEnabled:!0,text:"",tokens:[],toolbarEditorPosition:"bottom"},po={baseInputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}},selectionCount:{settings:!0,label:"Selection count"},correctAnswer:{settings:!0,label:"Correct Answers"},selections:{settings:!0,label:"Selections Available"},highlightChoices:{settings:!0,label:"Highlight choices"},rationale:{settings:!0,label:"Rationale",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},scoringType:{settings:!1,label:"Scoring Type"},studentInstructions:{settings:!1,label:"Student Instructions"},teacherInstructions:{settings:!0,label:"Teacher Instructions",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},prompt:{label:"Prompt",settings:!0,inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},text:{settings:!0,label:"Content"},tokens:{settings:!0,label:"Tokens"},feedback:{settings:!0,label:"Feedback"},spellCheck:{label:"Spellcheck",settings:!1,enabled:!0},partialScoring:{settings:!1,label:"Allow Partial Scoring"},mode:{settings:!0,label:"Mode"},minTokens:2,maxImageWidth:{teacherInstructions:300,prompt:300,rationale:300},maxImageHeight:{teacherInstructions:300,prompt:300,rationale:300},withRubric:{settings:!1,label:"Add Rubric"},mathMlOptions:{mmlOutput:!1,mmlEditing:!1},language:{settings:!1,label:"Specify Language",enabled:!1},languageChoices:{label:"Language Choices",options:[]}};const Do=t;function ho(e){let t,u=e[0],n=1;for(;n<e.length;){const o=e[n],i=e[n+1];if(n+=2,("optionalAccess"===o||"optionalCall"===o)&&null==u)return;"access"===o||"optionalAccess"===o?(t=u,u=i(u)):"call"!==o&&"optionalCall"!==o||(u=i((...e)=>u.call(t,...e)),t=void 0)}return u}class go extends HTMLElement{static __initStatic(){this.createDefaultModel=(e={})=>(e=>{if(!e)return e;const t=En(e.text||""),u=(e.tokens||[]).reduce((u,n={})=>{const o=En((e.text||"").slice(n.start,n.end));if(!o)return[...u,n];const i=u[u.length-1],s=(e=>{let u=e;for(;u>=0;){let e=t.slice(u).indexOf(o);if(e>=0)return e+u;u--}return 0})(i?i.end:n.start),r=s+o.length;return[...u,{...n,text:o,start:s,end:r,oldStart:n.start,oldEnd:n.end}]},[]);return{...e,tokens:u,text:t}})({...co,...e})}constructor(){super(),this._root=null,this._model=go.createDefaultModel(),this._configuration=po}set model(e){this._model=go.createDefaultModel(e),this.render()}set configuration(e){const t={...po,...e};this._configuration=t,ho([t,"optionalAccess",e=>e.language,"optionalAccess",e=>e.enabled])?ho([t,"optionalAccess",e=>e.languageChoices,"optionalAccess",e=>e.options,"optionalAccess",e=>e.length])&&(this._model.language=ho([t,"optionalAccess",e=>e.languageChoices,"access",e=>e.options,"access",e=>e[0],"access",e=>e.value])):t.language.settings&&this._model.language?(this._configuration.language.enabled=!0,this._configuration.languageChoices.options&&this._configuration.languageChoices.options.length||(this._configuration.languageChoices.options=[]),this._configuration.languageChoices.options.find(e=>e.value===this._model.language)||this._configuration.languageChoices.options.push({value:this._model.language,label:this._model.language})):delete this._model.language,this.render()}connectedCallback(){this.render()}modelChanged(e){this._model=e,this.dispatchEvent(new to(this._model),!0),this.render()}onConfigurationChanged(e){this._configuration=e,this._model&&this.dispatchEvent(new to(this._model),!1),this.render()}insertImage(e){this.dispatchEvent(new io(e))}onDeleteImage(e,t){this.dispatchEvent(new no(e,t))}insertSound(e){this.dispatchEvent(new lo(e))}onDeleteSound(e,t){this.dispatchEvent(new ro(e,t))}render(){if(this._model){const e=Do.createElement(Zn,{model:this._model,configuration:this._configuration,onModelChanged:this.modelChanged.bind(this),onConfigurationChanged:this.onConfigurationChanged.bind(this),imageSupport:{add:this.insertImage.bind(this),delete:this.onDeleteImage.bind(this)},uploadSoundSupport:{add:this.insertSound.bind(this),delete:this.onDeleteSound.bind(this)}});this._root||(this._root=d(this)),this._root.render(e)}}disconnectedCallback(){this._root&&this._root.unmount()}}go.__initStatic();export{go as default};