2020-09-08 23:35:47 +00:00
|
|
|
var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function commonjsRequire(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}var check=function(t){return t&&t.Math==Math&&t},e=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof t&&t)||Function("return this")(),fails=function(t){try{return!!t()}catch(t){return!0}},r=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i={f:o&&!n.call({1:2},1)?function propertyIsEnumerable(t){var e=o(this,t);return!!e&&e.enumerable}:n},createPropertyDescriptor=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},a={}.toString,classofRaw=function(t){return a.call(t).slice(8,-1)},c="".split,u=fails((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==classofRaw(t)?c.call(t,""):Object(t)}:Object,requireObjectCoercible=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},toIndexedObject=function(t){return u(requireObjectCoercible(t))},isObject=function(t){return"object"==typeof t?null!==t:"function"==typeof t},toPrimitive=function(t,e){if(!isObject(t))return t;var r,n;if(e&&"function"==typeof(r=t.toString)&&!isObject(n=r.call(t)))return n;if("function"==typeof(r=t.valueOf)&&!isObject(n=r.call(t)))return n;if(!e&&"function"==typeof(r=t.toString)&&!isObject(n=r.call(t)))return n;throw TypeError("Can't convert object to primitive value")},f={}.hasOwnProperty,has=function(t,e){return f.call(t,e)},s=e.document,l=isObject(s)&&isObject(s.createElement),documentCreateElement=function(t){return l?s.createElement(t):{}},h=!r&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),p=Object.getOwnPropertyDescriptor,d={f:r?p:function getOwnPropertyDescriptor(t,e){if(t=toIndexedObject(t),e=toPrimitive(e,!0),h)try{return p(t,e)}catch(t){}if(has(t,e))return createPropertyDescriptor(!i.f.call(t,e),t[e])}},anObject=function(t){if(!isObject(t))throw TypeError(String(t)+" is not an object");return t},y=Object.defineProperty,v={f:r?y:function defineProperty(t,e,r){if(anObject(t),e=toPrimitive(e,!0),anObject(r),h)try{return y(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},g=r?function(t,e,r){return v.f(t,e,createPropertyDescriptor(1,r))}:function(t,e,r){return t[e]=r,t},setGlobal=function(t,r){try{g(e,t,r)}catch(n){e[t]=r}return r},m=e["__core-js_shared__"]||setGlobal("__core-js_shared__",{}),b=Function.toString;"function"!=typeof m.inspectSource&&(m.inspectSource=function(t){return b.call(t)});var w,x,S,j=m.inspectSource,O=e.WeakMap,_="function"==typeof O&&/native code/.test(j(O)),E=createCommonjsModule((function(t){(t.exports=function(t,e){return m[t]||(m[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),P=0,k=Math.random(),uid=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++P+k).toString(36)},A=E("keys"),sharedKey=function(t){return A[t]||(A[t]=uid(t))},T={},M=e.WeakMap;if(_){var L=new M,I=L.get,G=L.has,C=L.set;w=function(t,e){return C.call(L,t,e),e},x=function(t){return I.call(L,t)||{}},S=function(t){return G.call(L,t)}}else{var N=sharedKey("state");T[N]=!0,w=function(t,e){return g(t,N,e),e},x=function(t){return has(t,N)?t[N]:{}},S=function(t){return has(t,N)}}var R,D={set:w,get:x,has:S,enforce:function(t){return S(t)?x(t):w(t,{})},getterFor:function(t){return function(e){var r;if(!isObject(e)||(r=x(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}},J=createCommonjsModule((function(t){var r=D.get,n=D.enforce,
|
2020-09-08 23:35:47 +00:00
|
|
|
*/var Un={name:"mathjax",init:function init(t){var e=this;return _asyncToGenerator(regeneratorRuntime.mark((function _callee2(){var r,n,o,i,a,c,u,f,s,l,h,p;return regeneratorRuntime.wrap((function _callee2$(d){for(;;)switch(d.prev=d.next){case 0:return h=function _saveMath(){var t=r("#mathjax_code_textarea").val();MathJax.Hub.queue.Push(["Text",u,"\\displaystyle{"+t+"}"]),MathJax.Hub.queue.Push((function(){var t=r(".MathJax_SVG"),e=r(t.html());e.find("use").each((function(){var t=r(this).attr("href")?r(this).attr("href").slice(1):r(this).attr("xlink:href").slice(1),e=r("#"+t).clone().removeAttr("id"),n=r(this).attr("x"),o=r(this).attr("y"),i=r(this).attr("transform");i&&(n||o)?e.attr("transform",i+" translate("+n+","+o+")"):i?e.attr("transform",i):(n||o)&&e.attr("transform","translate("+n+","+o+")"),r(this).replaceWith(e)})),e.removeAttr("style"),e.attr("xmlns","http://www.w3.org/2000/svg"),a.importSvgString(r("<div>").append(e.clone()).html(),!0),a.ungroupSelectedElement(),a.moveSelectedElements(f,s,!0)}))},r=t.$,n=e,d.next=5,import("./locale/".concat(n.curPrefs.lang,".js"));case 5:return o=d.sent,i=o.default,a=n.canvas,"mathjax/MathJax.min.js?config=TeX-AMS-MML_SVG.js",c=n.uiStrings,l=!1,r.extend(c,{mathjax:{embed_svg:"Save as mathematics",embed_mathml:"Save as figure",svg_save_warning:"The math will be transformed into a figure is manipulatable like everything else. You will not be able to manipulate the TeX-code anymore.",mathml_save_warning:"Advised. The math will be saved as a figure.",title:"Mathematics code editor"}}),p=[{id:"tool_mathjax",type:"mode",icon:"mathjax.png",events:{click:function click(){return _asyncToGenerator(regeneratorRuntime.mark((function _callee(){return regeneratorRuntime.wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:if(a.setMode("mathjax"),!1!==l){t.next=17;break}return r('<div id="mathjax">\x3c!-- Here is where MathJax creates the math --\x3e<div id="mathjax_creator" class="tex2jax_process" style="display:none">$${}$$</div><div id="mathjax_overlay"></div><div id="mathjax_container"><div id="tool_mathjax_back" class="toolbar_button"><button id="tool_mathjax_save">OK</button><button id="tool_mathjax_cancel">Cancel</button></div><fieldset><legend id="mathjax_legend">Mathematics Editor</legend><label><span id="mathjax_explication">Please type your mathematics in <a href="https://en.wikipedia.org/wiki/Help:Displaying_a_formula" target="_blank">TeX</a> code.</span></label><textarea id="mathjax_code_textarea" spellcheck="false"></textarea></fieldset></div></div>').insertAfter("#svg_prefs").hide(),r("#mathjax_container").draggable({cancel:"button,fieldset",containment:"window"}),r("#tool_mathjax_cancel").prepend(r.getSvgIcon("cancel",!0)).on("click touched",(function(){r("#mathjax").hide()})),r("#tool_mathjax_save").prepend(r.getSvgIcon("ok",!0)).on("click touched",(function(){h(),r("#mathjax").hide()})),r("body").addClass("tex2jax_ignore"),t.prev=7,t.next=10,import("mathjax/MathJax.min.js?config=TeX-AMS-MML_SVG.js");case 10:MathJax.Hub.queue.Push((function(){u=MathJax.Hub.getAllJax("#mathjax_creator")[0],console.log(u),l=!0,console.log("MathJax Loaded")})),t.next=17;break;case 13:t.prev=13,t.t0=t.catch(7),console.log("Failed loading MathJax."),r.alert("Failed loading MathJax. You will not be able to change the mathematics.");case 17:case"end":return t.stop()}}),_callee,null,[[7,13]])})))()}}}],d.abrupt("return",{name:i.name,svgicons:"mathjax-icons.xml",buttons:i.buttons.map((function(t,e){return Object.assign(p[e],t)})),mouseDown:function mouseDown(){if("mathjax"===a.getMode())return{started:!0}},mouseUp:function mouseUp(t){if("mathjax"===a.getMode()){var e=a.getZoom();return f=t.mouse_x/e,s=t.mouse_y/e,r("#mathjax").show(),{started:!1}}},callback:function callback(){r("<style>").text("#mathjax fieldset{padding: 5px;margin: 5px;border: 1px solid #DDD;}#mathjax label{display: block;margin: .5em;}#mathjax legend {max-width:195px;}#mathjax_overlay {position: absolute;top: 0;left: 0;right: 0;bottom: 0;background-color: black;opacity: 0.6;z-index: 20000;}#mathjax_container {position
|