diff --git a/compiler/data/data_contents.ml b/compiler/data/data_contents.ml index 9bbc19e..5461ca2 100644 --- a/compiler/data/data_contents.ml +++ b/compiler/data/data_contents.ml @@ -20,6 +20,8 @@ module Internal = struct let d_04fecb198a81e6949747641cd4045e53 = "egin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{\nbegin:/%[qQwWx]?\\|/,end:/\\|/},{begin:/\\B\\?(\\\\\\d{1,3})/},{\nbegin:/\\B\\?(\\\\x[A-Fa-f0-9]{1,2})/},{begin:/\\B\\?(\\\\u\\{?[A-Fa-f0-9]{1,6}\\}?)/},{\nbegin:/\\B\\?(\\\\M-\\\\C-|\\\\M-\\\\c|\\\\c\\\\M-|\\\\M-|\\\\C-\\\\M-)[\\x20-\\x7e]/},{\nbegin:/\\B\\?\\\\(c|C-)[\\x20-\\x7e]/},{begin:/\\B\\?\\\\?\\S/},{\nbegin:n.concat(/<<[-~]?'?/,n.lookahead(/(\\w+)(?=\\W)[^\\n]*\\n(?:[^\\n]*\\n)*?\\s*\\1\\b/)),\ncontains:[e.END_SAME_AS_BEGIN({begin:/(\\w+)/,end:/(\\w+)/,\ncontains:[e.BACKSLASH_ESCAPE,c]})]}]},g=\"[0-9](_?[0-9])*\",u={className:\"number\",\nrelevance:0,variants:[{\nbegin:`\\\\b([1-9](_?[0-9])*|0)(\\\\.(${g}))?([eE][+-]?(${g})|r)?i?\\\\b`},{\nbegin:\"\\\\b0[dD][0-9](_?[0-9])*r?i?\\\\b\"},{begin:\"\\\\b0[bB][0-1](_?[0-1])*r?i?\\\\b\"\n},{begin:\"\\\\b0[oO][0-7](_?[0-7])*r?i?\\\\b\"},{\nbegin:\"\\\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\\\b\"},{\nbegin:\"\\\\b0(_?[0-7])+r?i?\\\\b\"}]},b={variants:[{match:/\\(\\)/},{\nclassName:\"params\",begin:/\\(/,end:/(?=\\))/,excludeBegin:!0,endsParent:!0,\nkeywords:r}]},m=[d,{variants:[{match:[/class\\s+/,i,/\\s+<\\s+/,i]},{\nmatch:[/\\b(class|module)\\s+/,i]}],scope:{2:\"title.class\",\n4:\"title.class.inherited\"},keywords:r},{match:[/(include|extend)\\s+/,i],scope:{\n2:\"title.class\"},keywords:r},{relevance:0,match:[i,/\\.new[. (]/],scope:{\n1:\"title.class\"}},{relevance:0,match:/\\b[A-Z][A-Z_0-9]+\\b/,\nclassName:\"variable.constant\"},{relevance:0,match:a,scope:\"title.class\"},{\nmatch:[/def/,/\\s+/,t],scope:{1:\"keyword\",3:\"title.function\"},contains:[b]},{\nbegin:e.IDENT_RE+\"::\"},{className:\"symbol\",\nbegin:e.UNDERSCORE_IDENT_RE+\"(!|\\\\?)?:\",relevance:0},{className:\"symbol\",\nbegin:\":(?!\\\\s)\",contains:[d,{begin:t}],relevance:0},u,{className:\"variable\",\nbegin:\"(\\\\$\\\\W)|((\\\\$|@@?)(\\\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])\"},{\nclassName:\"params\",begin:/\\|/,end:/\\|/,excludeBegin:!0,excludeEnd:!0,\nrelevance:0,keywords:r},{begin:\"(\"+e.RE_STARTERS_RE+\"|unless)\\\\s*\",\nkeywords:\"unless\",contains:[{className:\"regexp\",contains:[e.BACKSLASH_ESCAPE,c],\nillegal:/\\n/,variants:[{begin:\"/\",end:\"/[a-z]*\"},{begin:/%r\\{/,end:/\\}[a-z]*/},{\nbegin:\"%r\\\\(\",end:\"\\\\)[a-z]*\"},{begin:\"%r!\",end:\"![a-z]*\"},{begin:\"%r\\\\[\",\nend:\"\\\\][a-z]*\"}]}].concat(o,l),relevance:0}].concat(o,l)\n;c.contains=m,b.contains=m;const p=[{begin:/^\\s*=>/,starts:{end:\"$\",contains:m}\n},{className:\"meta.prompt\",\nbegin:\"^([>?]>|[\\\\w#]+\\\\(\\\\w+\\\\):\\\\d+:\\\\d+[>*]|(\\\\w+-)?\\\\d+\\\\.\\\\d+\\\\.\\\\d+(p\\\\d+)?[^\\\\d][^>]+>)(?=[ ])\",\nstarts:{end:\"$\",keywords:r,contains:m}}];return l.unshift(o),{name:\"Ruby\",\naliases:[\"rb\",\"gemspec\",\"podspec\",\"thor\",\"irb\"],keywords:r,illegal:/\\/\\*/,\ncontains:[e.SHEBANG({binary:\"ruby\"})].concat(p).concat(l).concat(m)}},\ngrmr_rust:e=>{const n=e.regex,t={className:\"title.function.invoke\",relevance:0,\nbegin:n.concat(/\\b/,/(?!let|for|while|if|else|match\\b)/,e.IDENT_RE,n.lookahead(/\\s*\\(/))\n},a=\"([ui](8|16|32|64|128|size)|f(32|64))?\",i=[\"drop \",\"Copy\",\"Send\",\"Sized\",\"Sync\",\"Drop\",\"Fn\",\"FnMut\",\"FnOnce\",\"ToOwned\",\"Clone\",\"Debug\",\"PartialEq\",\"PartialOrd\",\"Eq\",\"Ord\",\"AsRef\",\"AsMut\",\"Into\",\"From\",\"Default\",\"Iterator\",\"Extend\",\"IntoIterator\",\"DoubleEndedIterator\",\"ExactSizeIterator\",\"SliceConcatExt\",\"ToString\",\"assert!\",\"assert_eq!\",\"bitflags!\",\"bytes!\",\"cfg!\",\"col!\",\"concat!\",\"concat_idents!\",\"debug_assert!\",\"debug_assert_eq!\",\"env!\",\"eprintln!\",\"panic!\",\"file!\",\"format!\",\"format_args!\",\"include_bytes!\",\"include_str!\",\"line!\",\"local_data_key!\",\"module_path!\",\"option_env!\",\"print!\",\"println!\",\"select!\",\"stringify!\",\"try!\",\"unimplemented!\",\"unreachable!\",\"vec!\",\"write!\",\"writeln!\",\"macro_rules!\",\"assert_ne!\",\"debug_assert_ne!\"],r=[\"i8\",\"i16\",\"i32\",\"i64\",\"i128\",\"isize\",\"u8\",\"u16\",\"u32\",\"u64\",\"u128\",\"usize\",\"f32\",\"f64\",\"str\",\"char\",\"bool\",\"Box\",\"Option\",\"Result\",\"String\",\"Vec\"]\n;return{name:\"Rust\",aliases:[\"rs\"],keywords:{$pattern:e.IDENT_RE+\"!?\",type:r,\nkeyword:[\"abstract\",\"as\",\"async\",\"await\",\"become\",\"box\",\"break\",\"const\",\"continue\",\"crate\",\"do\",\"dyn\",\"else\",\"enum\",\"extern\",\"false\",\"final\",\"fn\",\"for\",\"if\",\"impl\",\"in\",\"let\",\"loop\",\"macro\",\"match\",\"mod\",\"move\",\"mut\",\"override\",\"priv\",\"pub\",\"ref\",\"return\",\"self\",\"Self\",\"static\",\"struct\",\"super\",\"trait\",\"true\",\"try\",\"type\",\"typeof\",\"unsafe\",\"unsized\",\"use\",\"virtual\",\"where\",\"wh" + let d_074319dd77b0074a0675ead9812aa734 = ".max(t,e)),0)},e=t(document.body);for(let t=0;t{this.placeSlips()}),0),this.placeOpenWindow=function(){s=window.innerHeight,a=window.innerWidth,s/3{this.placeOpenWindow(),this.moveWindow(l,h,c,u,0)})),this.countersToString=t=>{let e=\"\";e+=v(t[0]+1,0);for(let i=1;it.getActionIndex())),e=t.join(\",\");window.parent!==window?this.send_stage&&window.parent.postMessage({id:this.id,kind:\"state\",data:e},\"*\"):window.history.replaceState(null,null,\"#\"+e),document.querySelector(\".cpt-slip\").innerHTML=this.countersToString(t)},this.enter=t=>{this.gotoSlip(t),this.push(t),this.next()},this.next=()=>{\"\"==document.querySelector(\".toc-slip\").innerHTML&&this.showToC();let t=this.getCurrentSlip(),e=t.next();if(this.updateCounter(),e instanceof y)return this.enter(e),!0;if(!e){this.pop();let t=this.getCurrentSlip();return t.nextStageNeedGoto()&&this.gotoSlip(t),A.length>1||t.getActionIndex()=t.getMaxNext()&&(this.previous(),!1)},this.nextSlip=function(){for(;!this.next(););},this.previous=t=>{let e=this.getCurrentSlip(),i=e.previous();if(i instanceof y){for(;i.getCurrentSubSlip()instanceof y;)this.push(i),i=i.getCurrentSubSlip();return this.push(i),this.gotoSlip(i,t),this.updateCounter(),!0}if(!i){this.pop();let i=this.getCurrentSlip();return A.length>1||i.getActionIndex()>-1?this.previous({delay:e.currentDelay?e.currentDelay:e.delay}):this.gotoSlip(i,t),this.updateCounter(),!(\"SLIP-SLIPSHOW\"==e.element.tagName&&e.getActionIndex()<=0)||(this.next(),!0)}return t&&setTimeout((()=>{this.gotoSlip(e,t)}),0),setTimeout((()=>{this.gotoSlip(e,t)}),0),this.updateCounter(),!1},this.previousSlip=function(){for(;!this.previous(););},this.getCoordinateInUniverse=function(t){let e=1,i=function(t){return\"none\"==t?1:parseFloat(t.split(\"(\")[1].split(\",\")[0])},s=t=>{let n=(t=>({x:t.offsetLeft,y:t.offsetTop}))(t);if(!t.offsetParent)return{x:0,y:0,centerX:0,centerY:0,width:0,height:0,scale:0};if(t.offsetParent.classList.contains(\"universe\"))return n;let a,r=s(t.offsetParent),o=window.getComputedStyle(t.offsetParent);return a=i(o.transform),e*=a,{x:r.x+n.x*e,y:r.y+n.y*e}},n=s(t),a=window.getComputedStyle(t),r=i(a.transform);return e*=r,{x:n.x/1440,y:n.y/1080,centerX:n.x/1440+.5*t.offsetWidth/1440*e,centerY:n.y/1080+.5*t.offsetHeight/1080*e,width:t.offsetWidth/1440*e,height:t.offsetHeight/1080*e,scale:e}},this.moveToElement=function(t,e){let i=this.getCoordinateInUniverse(t);t.offsetWidth,i.scale,t.offsetHeight,i.scale,e&&this.moveWindow(i.centerX,i.centerY,Math.max(i.width,i.height),0,e.delay?e.delay:1)},this.gotoSlip=function(t,e){e=e||{},\"SLIP-SLIP\"==t.element.tagName?setTimeout((()=>{let i=t.findSlipCoordinate();void 0!==t.currentX&&void 0!==t.currentY&&void 0!==t.currentScale?this.moveWindow(t.currentX,t.currentY,t.currentScale,t.rotate,void 0!==e.delay?e.delay:void 0!==t.currentDelay?t.currentDelay:t.delay):(t.currentX=i.x,t.currentY=i.y,t.currentDelay=t.delay,this.moveWindow(i.x,i.y,i.scale,t.rotate,void 0!==e.delay?e.delay:void 0!==t.currentDelay?t.currentDela" + let d_075ab6abf2a7aee3a28b06f37e1ae261 = "t]}};const s=[\"superscript\",\"subscript\",\"overscore\",\"underscore\"];function a(t){for(;t;){if(\"unit\"===t.getAttribute(\"role\"))return!0;const e=t.tagName,r=o.evalXPath(\"children/*\",t);t=-1!==s.indexOf(e)?r[0]:r[r.length-1]}return!1}function l(t){for(;t;){if(\"unit\"===t.getAttribute(\"role\"))return!0;t=o.evalXPath(\"children/*\",t)[0]}return!1}e.rightMostUnit=a,e.leftMostUnit=l,e.oneLeft=function(t){for(;t;){if(\"number\"===t.tagName&&\"1\"===t.textContent)return[t];if(\"infixop\"!==t.tagName||\"multiplication\"!==t.getAttribute(\"role\")&&\"implicit\"!==t.getAttribute(\"role\"))return[];t=o.evalXPath(\"children/*\",t)[0]}return[]}},3284:function(t,e,r){Object.defineProperty(e,\"__esModule\",{value:!0}),e.AbstractWalker=void 0;const n=r(7052),o=r(8290),i=r(5740),s=r(4440),a=r(6828),l=r(8496),c=r(2298),u=r(4356),p=r(2105),h=r(5656),f=r(9552),d=r(9543),m=r(8504),y=r(7730),g=r(1214),b=r(179),v=r(1204),_=r(5274);class S{constructor(t,e,r,n){this.node=t,this.generator=e,this.highlighter=r,this.modifier=!1,this.keyMapping=new Map([[l.KeyCode.UP,this.up.bind(this)],[l.KeyCode.DOWN,this.down.bind(this)],[l.KeyCode.RIGHT,this.right.bind(this)],[l.KeyCode.LEFT,this.left.bind(this)],[l.KeyCode.TAB,this.repeat.bind(this)],[l.KeyCode.DASH,this.expand.bind(this)],[l.KeyCode.SPACE,this.depth.bind(this)],[l.KeyCode.HOME,this.home.bind(this)],[l.KeyCode.X,this.summary.bind(this)],[l.KeyCode.Z,this.detail.bind(this)],[l.KeyCode.V,this.virtualize.bind(this)],[l.KeyCode.P,this.previous.bind(this)],[l.KeyCode.U,this.undo.bind(this)],[l.KeyCode.LESS,this.previousRules.bind(this)],[l.KeyCode.GREATER,this.nextRules.bind(this)]]),this.cursors=[],this.xml_=null,this.rebuilt_=null,this.focus_=null,this.active_=!1,this.node.id?this.id=this.node.id:this.node.hasAttribute(S.SRE_ID_ATTR)?this.id=this.node.getAttribute(S.SRE_ID_ATTR):(this.node.setAttribute(S.SRE_ID_ATTR,S.ID_COUNTER.toString()),this.id=S.ID_COUNTER++),this.rootNode=v.getSemanticRoot(t),this.rootId=this.rootNode.getAttribute(c.Attribute.ID),this.xmlString_=n,this.moved=b.WalkerMoves.ENTER}getXml(){return this.xml_||(this.xml_=i.parseInput(this.xmlString_)),this.xml_}getRebuilt(){return this.rebuilt_||this.rebuildStree(),this.rebuilt_}isActive(){return this.active_}activate(){this.isActive()||(this.generator.start(),this.toggleActive_())}deactivate(){this.isActive()&&(b.WalkerState.setState(this.id,this.primaryId()),this.generator.end(),this.toggleActive_())}getFocus(t=!1){return this.focus_||(this.focus_=this.singletonFocus(this.rootId)),t&&this.updateFocus(),this.focus_}setFocus(t){this.focus_=t}getDepth(){return this.levels.depth()-1}isSpeech(){return this.generator.modality===c.Attribute.SPEECH}focusDomNodes(){return this.getFocus().getDomNodes()}focusSemanticNodes(){return this.getFocus().getSemanticNodes()}speech(){const t=this.focusDomNodes();if(!t.length)return\"\";const e=this.specialMove();if(null!==e)return e;switch(this.moved){case b.WalkerMoves.DEPTH:return this.depth_();case b.WalkerMoves.SUMMARY:return this.summary_();case b.WalkerMoves.DETAIL:return this.detail_();default:{const e=[],r=this.focusSemanticNodes();for(let n=0,o=t.length;n0){var a=s.parent;if(a.childNodes.splice(a.childIndex(s),1),n.removeFromList(s.kind,[s]),s.isKind(\"mrow\")){var l=s.childNodes[0];n.removeFromList(\"mstyle\",[l]),n.removeFromList(\"mspace\",l.childNodes[0].childNodes)}}else s.isKind(\"mrow\")&&(s.parent.replaceChild(s.childNodes[0],s),n.removeFromList(\"mrow\",[s]))}}catch(t){e={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}},-4]]})},1181:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Class extends value \"+String(e)+\" is not a constructor or null\");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__read||function(t,e){var r=\"function\"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},s=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o{b=t,A=[b]},this.getRootSlip=()=>b,this.send_stage=!1,this.start=async(t,e)=>{if(this.id=e,A=[b],window.location.hash||t){let e;e=window.location.hash?window.location.hash.slice(1).split(\",\").map((t=>parseInt(t))):t,this.setAlwaysMoveFast(!0),console.log(\"alwaysMoveFast\",this.getAlwaysMoveFast());let i=()=>new Promise((function(t){setTimeout(t,0)})),s=-1,n=0,a=1,r=function(){let t=A.map((t=>t.getActionIndex())),i=s;return e.forEach(((e,r)=>{i==s&&(et[r]&&(i=n))})),i};for(;r()==n;)await i(),await this.next();this.setAlwaysMoveFast(!1)}else this.next();return this.send_stage=!0,window.parent!==window&&window.parent.postMessage({id:e,kind:\"ready\",data:e},\"*\"),this},this.restart=()=>{A=[b],b.refreshAll(),this.next()};let x=new r(this);this.getController=()=>x,window.addEventListener(\"message\",(t=>{console.log(t),this.restart();let e=t.data.split(\",\").map((t=>parseInt(t)));this.setAlwaysMoveFast(!0),console.log(\"alwaysMoveFast\",this.getAlwaysMoveFast());let i=function(){let t=A.map((t=>t.getActionIndex())),i=-1;return e.forEach(((e,s)=>{-1==i&&(et[s]&&(i=0))})),i};for(;0==i();)this.next();this.setAlwaysMoveFast(!1)}))},b=r,A=y,S=a;return t.Controller=b,t.Engine=w,t.Slip=A,t.Util=S,t.startSlipshow=async(t,e)=>{let i;return\"undefined\"!=typeof MathJax?MathJax.startup.promise.then((()=>(i=new w(document.querySelector(\"slip-slipshow\")).start(t,e),Promise.resolve(i)))):(i=new w(document.querySelector(\"slip-slipshow\")).start(t,e),Promise.resolve(i))},t}({});\n//# sourceMappingURL=slipshow.cdn.min.js.map\n" - let d_12db84fb411131c7686f8971f32e08cf = "_esModule\",{value:!0}),e.MmlMstyle=void 0;var s=r(9007),a=r(91),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),Object.defineProperty(e.prototype,\"kind\",{get:function(){return\"mstyle\"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,\"notParent\",{get:function(){return this.childNodes[0]&&1===this.childNodes[0].childNodes.length},enumerable:!1,configurable:!0}),e.prototype.setChildInheritedAttributes=function(t,e,r,n){var o=this.attributes.getExplicit(\"scriptlevel\");null!=o&&((o=o.toString()).match(/^\\s*[-+]/)?r+=parseInt(o):r=parseInt(o),n=!1);var i=this.attributes.getExplicit(\"displaystyle\");null!=i&&(e=!0===i,n=!1);var s=this.attributes.getExplicit(\"data-cramped\");null!=s&&(n=s),t=this.addInheritedAttributes(t,this.attributes.getAllAttributes()),this.childNodes[0].setInheritedAttributes(t,e,r,n)},e.defaults=i(i({},s.AbstractMmlLayoutNode.defaults),{scriptlevel:a.INHERIT,displaystyle:a.INHERIT,scriptsizemultiplier:1/Math.sqrt(2),scriptminsize:\"8px\",mathbackground:a.INHERIT,mathcolor:a.INHERIT,dir:a.INHERIT,infixlinebreakstyle:\"before\"}),e}(s.AbstractMmlLayoutNode);e.MmlMstyle=l},4461:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Class extends value \"+String(e)+\" is not a constructor or null\");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;rn.getBySemanticId(i,t),a=r.nodeDict,l=s(t),c=e.map(s),u=e.map((function(t){return a[t]})),p=new o(u,a[t]);return p.domNodes=c,p.domPrimary_=l,p.allNodes=o.generateAllVisibleNodes_(e,c,a,i),p}static generateAllVisibleNodes_(t,e,r,i){const s=t=>n.getBySemanticId(i,t);let a=[];for(let n=0,l=t.length;n{this.placeOpenWindow(),this.moveWindow(l,h,c,u,0)})),this.countersToString=t=>{let e=\"\";e+=v(t[0]+1,0);for(let i=1;it.getActionIndex())),e=t.join(\",\");window.parent!==window?this.send_stage&&window.parent.postMessage({id:this.id,kind:\"state\",data:e},\"*\"):window.history.replaceState(null,null,\"#\"+e),document.querySelector(\".cpt-slip\").innerHTML=this.countersToString(t)},this.enter=t=>{this.gotoSlip(t),this.push(t),this.next()},this.next=()=>{\"\"==document.querySelector(\".toc-slip\").innerHTML&&this.showToC();let t=this.getCurrentSlip().next();if(this.updateCounter(),t instanceof y)return this.enter(t),!0;if(!t){this.pop();let t=this.getCurrentSlip();return t.nextStageNeedGoto()&&this.gotoSlip(t),A.length>1||t.getActionIndex(){let e=this.getCurrentSlip(),i=e.previous();if(i instanceof y){for(;i.getCurrentSubSlip()instanceof y;)this.push(i),i=i.getCurrentSubSlip();return this.push(i),this.gotoSlip(i,t),this.updateCounter(),!0}if(!i){this.pop();let i=this.getCurrentSlip();return A.length>1||i.getActionIndex()>-1?this.previous({delay:e.currentDelay?e.currentDelay:e.delay}):this.gotoSlip(i,t),this.updateCounter(),!0}return t&&setTimeout((()=>{this.gotoSlip(e,t)}),0),setTimeout((()=>{this.gotoSlip(e,t)}),0),this.updateCounter(),!1},this.previousSlip=function(){for(;!this.previous(););},this.getCoordinateInUniverse=function(t){let e=1,i=function(t){return\"none\"==t?1:parseFloat(t.split(\"(\")[1].split(\",\")[0])},s=t=>{let n=(t=>({x:t.offsetLeft,y:t.offsetTop}))(t);if(!t.offsetParent)return{x:0,y:0,centerX:0,centerY:0,width:0,height:0,scale:0};if(t.offsetParent.classList.contains(\"universe\"))return n;let a,r=s(t.offsetParent),o=window.getComputedStyle(t.offsetParent);return a=i(o.transform),e*=a,{x:r.x+n.x*e,y:r.y+n.y*e}},n=s(t),a=window.getComputedStyle(t),r=i(a.transform);return e*=r,{x:n.x/1440,y:n.y/1080,centerX:n.x/1440+.5*t.offsetWidth/1440*e,centerY:n.y/1080+.5*t.offsetHeight/1080*e,width:t.offsetWidth/1440*e,height:t.offsetHeight/1080*e,scale:e}},this.moveToElement=function(t,e){let i=this.getCoordinateInUniverse(t);t.offsetWidth,i.scale,t.offsetHeight,i.scale,e&&this.moveWindow(i.centerX,i.centerY,Math.max(i.width,i.height),0,e.delay?e.delay:1)},this.gotoSlip=function(t,e){e=e||{},\"SLIP-SLIP\"==t.element.tagName?setTimeout((()=>{let i=t.findSlipCoordinate();void 0!==t.currentX&&void 0!==t.currentY&&void 0!==t.currentScale?this.moveWindow(t.currentX,t.currentY,t.currentScale,t.rotate,void 0!==e.delay?e.delay:void 0!==t.currentDelay?t.currentDelay:t.delay):(t.currentX=i.x,t.currentY=i.y,t.currentDelay=t.delay,this.moveWindow(i.x,i.y,i.scale,t.rotate,void 0!==e.delay?e.delay:void 0!==t.currentDelay?t.currentDelay:t.delay))}),0):setTimeout((()=>{let i=this.getCoordinateInUniverse(t.element);this.moveWindow(i.centerX,i.centerY,Math.max(i.width,i.height),0,void 0!==e.delay?e.delay:" - let d_1463575c0be0b0338af432a87f931edb = "atus){var i=n.body(n.document);e.status=n.append(i,t.html(\"mjx-status\",{},[t.text(o)]))}r.stopPropagation()})),t.setEventHandler(\"mouseout\",(function(t){e.status&&(n.remove(e.status),e.status=null),t.stopPropagation()}))}},{status:null}]]]),e}((0,s.CommonMactionMixin)(i.CHTMLWrapper));e.CHTMLmaction=c},804:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Class extends value \"+String(e)+\" is not a constructor or null\");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__read||function(t,e){var r=\"function\"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s};Object.defineProperty(e,\"__esModule\",{value:!0}),e.CHTMLmath=void 0;var s=r(5355),a=r(7490),l=r(3233),c=r(6469),u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.toCHTML=function(e){t.prototype.toCHTML.call(this,e);var r=this.chtml,n=this.adaptor;\"block\"===this.node.attributes.get(\"display\")?(n.setAttribute(r,\"display\",\"true\"),n.setAttribute(e,\"display\",\"true\"),this.handleDisplay(e)):this.handleInline(e),n.addClass(r,\"MJX-TEX\")},e.prototype.handleDisplay=function(t){var e=this.adaptor,r=i(this.getAlignShift(),2),n=r[0],o=r[1];if(\"center\"!==n&&e.setAttribute(t,\"justify\",n),this.bbox.pwidth===c.BBox.fullWidth){if(e.setAttribute(t,\"width\",\"full\"),this.jax.table){var s=this.jax.table.getOuterBBox(),a=s.L,l=s.w,u=s.R;\"right\"===n?u=Math.max(u||-o,-o):\"left\"===n?a=Math.max(a||o,o):\"center\"===n&&(l+=2*Math.abs(o));var p=this.em(Math.max(0,a+l+u));e.setStyle(t,\"min-width\",p),e.setStyle(this.jax.table.chtml,\"min-width\",p)}}else this.setIndent(this.chtml,n,o)},e.prototype.handleInline=function(t){var e=this.adaptor,r=e.getStyle(this.chtml,\"margin-right\");r&&(e.setStyle(this.chtml,\"margin-right\",\"\"),e.setStyle(t,\"margin-right\",r),e.setStyle(t,\"width\",\"0\"))},e.prototype.setChildPWidths=function(e,r,n){return void 0===r&&(r=null),void 0===n&&(n=!0),!!this.parent&&t.prototype.setChildPWidths.call(this,e,r,n)},e.kind=l.MmlMath.prototype.kind,e.styles={\"mjx-math\":{\"line-height\":0,\"text-align\":\"left\",\"text-indent\":0,\"font-style\":\"normal\",\"font-weight\":\"normal\",\"font-size\":\"100%\",\"font-size-adjust\":\"none\",\"letter-spacing\":\"normal\",\"border-collapse\":\"collapse\",\"word-wrap\":\"normal\",\"word-spacing\":\"normal\",\"white-space\":\"nowrap\",direction:\"ltr\",padding:\"1px 0\"},'mjx-container[jax=\"CHTML\"][display=\"true\"]':{display:\"block\",\"text-align\":\"center\",margin:\"1em 0\"},'mjx-container[jax=\"CHTML\"][display=\"true\"][width=\"full\"]':{display:\"flex\"},'mjx-container[jax=\"CHTML\"][display=\"true\"] mjx-math':{padding:0},'mjx-container[jax=\"CHTML\"][justify=\"left\"]':{\"text-align\":\"left\"},'mjx-container[jax=\"CHTML\"][justify=\"right\"]':{\"text-align\":\"right\"}},e}((0,a.CommonMathMixin)(s.CHTMLWrapper));e.CHTMLmath=u},8147:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Class extends value \"+String(e)+\" is not a constructor or null\");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!(\"get\"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),s=this&&this.__setModuleDefaul" let d_154322252f4f2624938aeaa2901d9fec = "medium\",this.getLineWidth=()=>[\"highlighting\",\"highlighting-erase\"].includes(this.getTool())?this.lineWidthHighlight:[\"drawing\"].includes(this.getTool())?this.lineWidth:[\"drawing-erase\"].includes(this.getTool())?this.lineWidthErase:\"no-line-width\",this.setLineWidth=t=>{if([\"highlighting\",\"highlighting-erase\"].includes(this.getTool()))switch(this.lineWidthHighlight=t,t){case\"small\":this.sketchpadHighlight.weight=10;break;case\"medium\":this.sketchpadHighlight.weight=30;break;case\"large\":this.sketchpadHighlight.weight=90}else if([\"drawing\"].includes(this.getTool()))switch(this.lineWidth=t,t){case\"small\":this.sketchpad.weight=.25;break;case\"medium\":this.sketchpad.weight=1;break;case\"large\":this.sketchpad.weight=5}else if([\"drawing-erase\"].includes(this.getTool()))switch(this.lineWidthErase=t,t){case\"small\":this.sketchpad.weight=5;break;case\"medium\":this.sketchpad.weight=20;break;case\"large\":this.sketchpad.weight=80}};let c=r;this.getEngine=()=>c,this.setEngine=t=>c=t,this.element=\"string\"==typeof t?document.querySelector(\"#\"==t[0]?t:\"#\"+t):t,this.scale=parseFloat(this.element.getAttribute(\"scale\")),(void 0===this.scale||isNaN(this.scale))&&(this.scale=1),this.rotate=parseFloat(this.element.getAttribute(\"rotate\"))||0,this.delay=isNaN(parseFloat(this.element.getAttribute(\"delay\")))?0:parseFloat(this.element.getAttribute(\"delay\"));var u=this;let d,p=this.element;this.reloadCanvas=()=>{var t=this;let e=this.element;setTimeout((function(){let i=e.firstChild,s=document.createElement(\"canvas\");s.classList.add(\"sketchpad\",\"drawing\"),s.style.opacity=\"1\",t.sketchpadCanvas=s;let n=t.queryAll(\".sketchpad\");n[0].replaceWith(s);let a=new v(s);a.smoothing=.2,a.color=\"blue\",t.sketchpad=a;let r=document.createElement(\"canvas\");r.classList.add(\"sketchpad\",\"sketchpad-highlighting\"),r.style.opacity=\"0.5\",t.sketchpadCanvasHighlight=r,n[1].replaceWith(r),t.sketchpadHighlight=new v(r),t.sketchpadHighlight.color=\"yellow\",t.sketchpadHighlight.weight=30,t.sketchpadHighlight.smoothing=.2,t.resizeObserver=new ResizeObserver((e=>{s.height=t.element.firstChild.offsetHeight/t.scale,s.width=t.element.firstChild.offsetWidth/t.scale,r.height=t.element.firstChild.offsetHeight/t.scale,r.width=t.element.firstChild.offsetWidth/t.scale,t.sketchpad.smoothing=.2,t.sketchpad.color=\"blue\",t.sketchpadHighlight.color=\"yellow\",t.sketchpadHighlight.weight=30,t.sketchpadHighlight.smoothing=.2})),i&&i.classList&&i.classList.contains(\"slip-scale-container\")&&t.resizeObserver.observe(i)}),0)},setTimeout((function(){let t=document.createElement(\"canvas\");t.classList.add(\"sketchpad\",\"drawing\"),u.sketchpadCanvas=t,p&&p.firstChild&&p.firstChild.firstChild?p.firstChild.firstChild.appendChild(t):p.appendChild(t);let e=document.createElement(\"canvas\");e.classList.add(\"sketchpad\",\"sketchpad-highlighting\"),u.sketchpadCanvasHighlight=e,p&&p.firstChild&&p.firstChild.firstChild?p.firstChild.firstChild.appendChild(e):p.appendChild(e),setTimeout((function(){u.reloadCanvas()}),0)}),0),this.name=\"string\"==typeof t?t:t.id,\"string\"==typeof e?this.fullName=e:this.element.hasAttribute(\"toc-title\")?this.fullName=this.element.getAttribute(\"toc-title\"):this.fullName=this.name,\"undefined\"!=typeof MathJax?MathJax.startup.promise.then((()=>{setTimeout((()=>{d=s(this.element)}),0)})):setTimeout((()=>{d=s(this.element)}),0),this.getCloned=()=>d,this.setCloned=t=>d=t;let g=this.findSlipCoordinate();this.x=g.x,this.y=g.y,this.init(this,c),this.addSubSlips(),this.generatePauseFlowSlipList=function(){let t=[],e=this.queryAll(\"[pause], [step], [auto-enter], [immediate-enter]\"),i=1;return e.forEach((e=>{if(e.hasAttribute(\"auto-enter\")&&(t[i]=new y(e,e.getAttribute(\"toc-title\")||\"\",[],r,{}),i++),e.hasAttribute(\"immediate-enter\")&&(t[i-1]=new y(e,e.getAttribute(\"toc-title\")||\"\",[],r,{}),i++),e.hasAttribute(\"step\")){if(e.hasAttribute(\"enter-at-unpause\"))if(\"\"!=e.getAttribute(\"enter-at-unpause\")){let s=this.query(\"#\"+e.getAttribute(\"enter-at-unpause\"));t[i]=new y(s,s.getAttribute(\"toc-title\")||\"\",[],r,{})}else t[i+(parseInt(e.getAttribute(\"step\"))||1)-1]=new y(e,e.getAttribute(\"toc-title\")||\"\",[],r,{});i+=parseIn" @@ -320,8 +318,6 @@ module Internal = struct let d_7da58dfcf753ce458414dc2aa9734a5d = "h.pow(10,36))return t.toString();let r=0,n=\"\";for(;t>0;){const i=t%1e3;if(i){const s=o(t%1e3,!r&&e);!r&&e&&(e=!e),n=s+(r?\" \"+a.large[r]+(r>1&&i>1?\"er\":\"\")+(n?\" \":\"\"):\"\")+n}t=Math.floor(t/1e3),r++}return e?n+(n.match(/tusen$/)?\"de\":\"te\"):n}(t,e);return r}a.wordOrdinal=s,a.numericOrdinal=function(t){return t.toString()+\".\"},a.numberToWords=u,a.numberToOrdinal=function(t,e){return s(t)},e.default=a},3898:function(t,e,r){Object.defineProperty(e,\"__esModule\",{value:!0});function n(t){let e=t%1e3,r=\"\";const n=Math.floor(e/100);return r+=s.ones[n]?(1===n?\"\":s.ones[n]+s.numSep)+\"hundra\":\"\",e%=100,e&&(r+=r?s.numSep:\"\",r+=s.ones[e]||s.tens[Math.floor(e/10)]+(e%10?s.numSep+s.ones[e%10]:\"\")),r}function o(t,e=!1){if(0===t)return s.zero;if(t>=Math.pow(10,36))return t.toString();let r=0,o=\"\";for(;t>0;){const i=t%1e3;if(i){const a=s.large[r],l=i>1&&r>1&&!e?\"er\":\"\";o=(1===r&&1===i?\"\":(r>1&&1===i?\"en\":n(t%1e3))+(r>1?\" \":\"\"))+(r?a+l+(r>1?\" \":\"\"):\"\")+o}t=Math.floor(t/1e3),r++}return o.replace(/ $/,\"\")}function i(t){let e=o(t,!0);return e.match(/^noll$/)?e=\"nollte\":e.match(/ett$/)?e=e.replace(/ett$/,\"f\\xf6rsta\"):e.match(/tv\\xe5$/)?e=e.replace(/tv\\xe5$/,\"andra\"):e.match(/tre$/)?e=e.replace(/tre$/,\"tredje\"):e.match(/fyra$/)?e=e.replace(/fyra$/,\"fj\\xe4rde\"):e.match(/fem$/)?e=e.replace(/fem$/,\"femte\"):e.match(/sex$/)?e=e.replace(/sex$/,\"sj\\xe4tte\"):e.match(/sju$/)?e=e.replace(/sju$/,\"sjunde\"):e.match(/\\xe5tta$/)?e=e.replace(/\\xe5tta$/,\"\\xe5ttonde\"):e.match(/nio$/)?e=e.replace(/nio$/,\"nionde\"):e.match(/tio$/)?e=e.replace(/tio$/,\"tionde\"):e.match(/elva$/)?e=e.replace(/elva$/,\"elfte\"):e.match(/tolv$/)?e=e.replace(/tolv$/,\"tolfte\"):e.match(/tusen$/)?e=e.replace(/tusen$/,\"tusonde\"):e.match(/jard$/)||e.match(/jon$/)?e+=\"te\":e+=\"de\",e}const s=(0,r(7549).NUMBERS)();s.wordOrdinal=i,s.numericOrdinal=function(t){const e=t.toString();return e.match(/11$|12$/)?e+\":e\":e+(e.match(/1$|2$/)?\":a\":\":e\")},s.numberToWords=o,s.numberToOrdinal=function(t,e){if(1===t)return\"hel\";if(2===t)return e?\"halva\":\"halv\";let r=i(t);return r=r.match(/de$/)?r.replace(/de$/,\"\"):r,r+(e?\"delar\":\"del\")},e.default=s},4977:function(t,e){function r(t,e=\"\"){if(!t.childNodes||!t.childNodes[0]||!t.childNodes[0].childNodes||t.childNodes[0].childNodes.length<2||\"number\"!==t.childNodes[0].childNodes[0].tagName||\"integer\"!==t.childNodes[0].childNodes[0].getAttribute(\"role\")||\"number\"!==t.childNodes[0].childNodes[1].tagName||\"integer\"!==t.childNodes[0].childNodes[1].getAttribute(\"role\"))return{convertible:!1,content:t.textContent};const r=t.childNodes[0].childNodes[1].textContent,n=t.childNodes[0].childNodes[0].textContent,o=Number(r),i=Number(n);return isNaN(o)||isNaN(i)?{convertible:!1,content:`${n} ${e} ${r}`}:{convertible:!0,enumerator:i,denominator:o}}Object.defineProperty(e,\"__esModule\",{value:!0}),e.vulgarFractionSmall=e.convertVulgarFraction=e.Combiners=e.siCombiner=e.identityTransformer=e.pluralCase=void 0,e.pluralCase=function(t,e){return t.toString()},e.identityTransformer=function(t){return t.toString()},e.siCombiner=function(t,e){return t+e.toLowerCase()},e.Combiners={},e.Combiners.identityCombiner=function(t,e,r){return t+e+r},e.Combiners.prefixCombiner=function(t,e,r){return t=r?r+\" \"+t:t,e?e+\" \"+t:t},e.Combiners.postfixCombiner=function(t,e,r){return t=r?r+\" \"+t:t,e?t+\" \"+e:t},e.Combiners.romanceCombiner=function(t,e,r){return t=r?t+\" \"+r:t,e?t+\" \"+e:t},e.convertVulgarFraction=r,e.vulgarFractionSmall=function(t,e,n){const o=r(t);if(o.convertible){const t=o.enumerator,r=o.denominator;return t>0&&t0&&rt.classList.remove(\"active-slip\"))),t.tocElem&&t.tocElem.classList.add(\"active-slip\"),t.element.classList.add(\"active-true-slip\"),A.length>0&&A[A.length-1].element.classList.remove(\"active-true-slip\"),A.push(t)},this.pop=function(){this.getToC().querySelectorAll(\".toc-slip .active-slip\").forEach((t=>t.classList.remove(\"active-slip\")));let t=A.pop();return t.element.classList.remove(\"active-true-slip\"),0==A.length&&A.push(t),A[A.length-1].element.classList.add(\"active-true-slip\"),A[A.length-1].tocElem&&A[A.length-1].tocElem.classList.add(\"active-slip\"),t},this.getCurrentSlip=function(){return A[A.length-1]},this.getSlipTree=function(t){return(t=t||b)instanceof y?{name:t.name,slip:t,subslips:t.getActionList().map((t=>this.getSlipTree(t)))}:{function:!0}},this.goToState=function(t){let e=t=>{if(0!=t.length)for(e(t[0]);t[1].getActionIndex(){let s=document.createElement(\"div\"),n=document.createElement(\"div\");if(n.innerText=t.slip.fullName,s.appendChild(n),t.subslips.length>0){let n=document.createElement(\"ul\");t.subslips.forEach(((s,a)=>{let r=[e,t.slip,a],o=document.createElement(\"li\");if(s.function){let t=e=>0==e.length?[]:t(e[0]).concat([e[2]]);o.innerText=this.countersToString(t(r)),o.classList.add(\"toc-function\")}else o.appendChild(i(s,r));o.addEventListener(\"click\",(t=>{t.target==o&&this.goToState(r)})),n.appendChild(o)})),s.appendChild(n),t.slip.setTocElem(s)}return s};t.innerHTML=\"\",t.appendChild(i(e,[]))},this.getTool=()=>this.getCurrentSlip().getTool(),this.setTool=t=>{this.getCurrentSlip().setTool(t),this.updateToolClasses()},this.getColor=()=>this.getCurrentSlip().getColor(),this.setColor=t=>{this.getCurrentSlip().setColor(t),this.updateToolClasses()},this.setLineWidth=t=>{this.getCurrentSlip().setLineWidth(t),this.updateToolClasses()},this.getLineWidth=()=>this.getCurrentSlip().getLineWidth(),this.reloadCanvas=()=>{this.getCurrentSlip().reloadCanvas()};let S=this;this.updateToolClasses=()=>{document.querySelector(\".slip-toolbar-tool\").classList.remove(\"drawing\",\"highlighting\",\"drawing-erase\",\"highlighting-erase\",\"no-tool\"),\"no-tool\"==this.getTool()||\"cursor\"==this.getTool()?document.querySelector(\".slip-writing-toolbar\").classList.remove(\"active\"):document.querySelector(\".slip-writing-toolbar\").classList.add(\"active\"),document.querySelector(\".slip-toolbar-tool\").classList.add(this.getTool()),document.querySelector(\".slip-toolbar-color\").classList.remove(\"black\",\"blue\",\"red\",\"green\",\"yellow\"),document.querySelector(\".slip-toolbar-color\").classList.add(this.getColor()),document.querySelector(\".slip-toolbar-width\").classList.remove(\"small\",\"medium\",\"large\"),document.querySelector(\".slip-toolbar-width\").classList.add(this.getLineWidth())},setTimeout((function(){document.querySelector(\".slip-toolbar-pen\").addEventListener(\"click\",(function(t){S.setTool(\"drawing\")})),document.querySelector(\".slip-toolbar-cursor\").addEventListener(\"click\",(function(t){S.setTool(\"no-tool\")})),document.querySelector(\".slip-toolbar-eraser\").addEventListener(\"click\",(function(t){switch(S.getTool()){case\"drawing-erase\":S.setTool(\"drawing\");break;case\"highlighting\":S.setTool(\"highlighting-erase\");break;case\"highlighting-erase\":S.setTool(\"highlighting\");break;case\"no-tool\":S.setTool(\"no-tool\");break;case\"drawing\":S.setTool(\"drawing-erase\")}})),document.querySelector(\".slip-toolbar-highlighter\").addEventListener(\"click\",(function(t){S.setTool(\"highlighting\")})),document.querySelector(\".slip-toolbar-black\").addEventListener(\"click\",(function(t){S.setColor(\"black\")})),document.querySelector(\".slip-toolbar-blue\").addEventListener(\"click\",(function(t){S.setColor(\"blue\")})),document.querySelector(\".slip-toolbar-red\").addEventList" - let d_84140e09113783c2e6e20049964285de = "ONFIG.versionWarnings&&n.isLoaded&&!t.versions.has(a.Package.resolvePath(r))&&console.warn(\"No version information available for component \".concat(r))})))};try{for(var u=i(o),p=u.next();!p.done;p=u.next()){var h=p.value;c(h)}}catch(t){r={error:t}}finally{try{p&&!p.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return a.Package.loadAll(),Promise.all(l)},t.preLoad=function(){for(var t,r,n=[],o=0;o=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")},s=this&&this.__read||function(t,e){var r=\"function\"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},a=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o mjx-box\":{\"border-top\":\".07em solid\"},\"mjx-sqrt.mjx-tall > mjx-box\":{\"padding-left\":\".3em\",\"margin-left\":\"-.3em\"}},e}((0,a.CommonMsqrtMixin)(s.CHTMLWrapper));e.CHTMLmsqrt=c},4300:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Class extends value \"+String(e)+\" is not a constructor or null\");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__read||function(t,e){var r=\"function\"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s};Object.defineProperty(e,\"__esModule\",{value:!0}),e.CHTMLmsubsup=e.CHTMLmsup=e.CHTMLmsub=void 0;var s=r(8650),a=r(905),l=r(905),c=r(905),u=r(4461),p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.kind=u.MmlMsub.prototype.kind,e}((0,a.CommonMsubMixin)(s.CHTMLscriptbase));e.CHTMLmsub=p;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.kind=u.MmlMsup.prototype.kind,e}((0,l.CommonMsupMixin)(s.CHTMLscriptbase));e.CHTMLmsup=h;var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.toCHTML=function(t){var e=this.adaptor,r=this.standardCHTMLnode(t),n=i([this.baseChild,this.supChild,this.subChild],3),o=n[0],s=n[1],a=n[2],l=i(this.getUVQ(),3),c=l[1],u=l[2],p={\"vertical-align\":this.em(c)};o.toCHTML(r);var h=e.append(r,this.html(\"mjx-script\",{style:p}));s.toCHTML(h),e.append(h,this.html(\"mjx-spacer\",{style:{\"margin-top\":this.em(u)}})),a.toCHTML(h);var f=this.getAdjustedIc();f&&e.setStyle(s.chtml,\"marginLeft\",this.em(f/s.bbox.rscale)),this.baseRemoveIc&&e.setStyle(h,\"marginLeft\",this.em(-this.baseIc))},e.kind=u.MmlMsubsup.prototype.kind,e.styles={\"mjx-script\":{display:\"inline-block\",\"padding-right\":\".05em\",\"padding-left\":\".033em\"},\"mjx-script > mjx-spacer\":{display:\"block\"}},e}((0,c.CommonMsubsupMixin)(s.CHTMLscriptbase));e.CHTMLmsubsup=f},8002:function(t,e,r){var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if(\"function\"!=typeof e&&null!==e)throw new TypeError(\"Class extends value \"+String(e)+\" is not a constructor or null\");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__values||function(t){var e=\"function\"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&\"number\"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")},s=this&&this.__read||function(t,e){var r=\"function\"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s};Object.defineProperty(e,\"__esModule\",{value:!0}),e.CHTMLmtable=void 0;var a=r(5355),l=r(6237),c=r(1349),u=r(505),p=function(t){function e(e,r,n){void 0===n&&(n=null);var o=t.call(this,e,r,n)||this;return o.itable=o.html(\"mjx-itable\"),o.labels=o.html(\"mjx-itable\"),o}return o(e,t),e.prototype.getAlignShift=function(){var e=t.prototype.getAlignShift.call(this);return this.isTop||(e[1]=0),e},e.prototype.toCHTML=function(t){var e,r,n=this.standardCHTMLnode(t);this.adaptor.append(n" @@ -456,6 +452,8 @@ module Internal = struct let d_b787590a5265132383bf9b8e25c2bb58 = "h(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},i=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},s=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o{b=t,A=[b]},this.getRootSlip=()=>b,this.send_stage=!1,this.start=async(t,e)=>{if(this.id=e,A=[b],window.location.hash||t){let e;e=window.location.hash?window.location.hash.slice(1).split(\",\").map((t=>parseInt(t))):t,this.setAlwaysMoveFast(!0),console.log(\"alwaysMoveFast\",this.getAlwaysMoveFast());let i=()=>new Promise((function(t){setTimeout(t,0)})),s=-1,n=0,a=1,r=function(){let t=A.map((t=>t.getActionIndex())),i=s;return e.forEach(((e,r)=>{i==s&&(et[r]&&(i=n))})),i};for(;r()==n;)await i(),await this.next();this.setAlwaysMoveFast(!1)}else this.next();return this.send_stage=!0,window.parent!==window&&window.parent.postMessage({id:e,kind:\"ready\",data:e},\"*\"),this},this.restart=()=>{A=[b],b.refreshAll(),this.next()};let x=new r(this);this.getController=()=>x,window.addEventListener(\"message\",(t=>{console.log(t),this.restart();let e=t.data.split(\",\").map((t=>parseInt(t)));this.setAlwaysMoveFast(!0),console.log(\"alwaysMoveFast\",this.getAlwaysMoveFast());let i=function(){let t=A.map((t=>t.getActionIndex())),i=-1;return e.forEach(((e,s)=>{-1==i&&(et[s]&&(i=0))})),i};for(;0==i();)this.next();this.setAlwaysMoveFast(!1)}))},b=r,A=y,S=a;return t.Controller=b,t.Engine=w,t.Slip=A,t.Util=S,t.startSlipshow=async(t,e)=>{let i;return\"undefined\"!=typeof MathJax?MathJax.startup.promise.then((()=>(i=new w(document.querySelector(\"slip-slipshow\")).start(t,e),Promise.resolve(i)))):(i=new w(document.querySelector(\"slip-slipshow\")).start(t,e),Promise.resolve(i))},t}({});\n//# sourceMappingURL=slipshow.cdn.min.js.map\n" + let d_b881c0d7d9af2b88359d41c9e60e9cbe = "t(e.getAttribute(\"step\"))||1}if(e.hasAttribute(\"pause\")){if(e.hasAttribute(\"enter-at-unpause\"))if(\"\"!=e.getAttribute(\"enter-at-unpause\")){let s=this.query(e.getAttribute(\"enter-at-unpause\"));t[i+(parseInt(e.getAttribute(\"step\"))||1)-1]=new y(s,s.getAttribute(\"toc-title\")||\"\",[],r,{})}else t[i+(parseInt(e.getAttribute(\"step\"))||1)-1]=new y(e,e.getAttribute(\"toc-title\")||\"\",[],r,{});i+=parseInt(e.getAttribute(\"pause\"))||1}})),t},this.pauseSlipList=this.generatePauseFlowSlipList()}const w=function(t){\"string\"==typeof t?(\"#\"!=t[0]&&(t=\"#\"+t),t=document.querySelector(t)):void 0===t&&(t=document.querySelector(\"slip-slipshow\")),function(t){let e=document.createElement(\"div\");e.innerHTML='\\t\\n\\t
\\n
\\n\\t
0
\\n\\t
\\n
\\n
\\n\\n
\\n
\\n\\n
\\n
\\n\\n
\\n
\\n0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},o=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o1;)e.shift(),r.push(e.shift());return r}function l(t){var e,n,o=a(this.styles[t]);0===o.length&&o.push(\"\"),1===o.length&&o.push(o[0]),2===o.length&&o.push(o[0]),3===o.length&&o.push(o[1]);try{for(var i=r(v.connect[t].children),s=i.next();!s.done;s=i.next()){var l=s.value;this.setStyle(this.childName(t,l),o.shift())}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}function c(t){var e,n,o=v.connect[t].children,i=[];try{for(var s=r(o),a=s.next();!a.done;a=s.next()){var l=a.value,c=this.styles[t+\"-\"+l];if(!c)return void delete this.styles[t];i.push(c)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(e)throw e.error}}i[3]===i[1]&&(i.pop(),i[2]===i[0]&&(i.pop(),i[1]===i[0]&&i.pop())),this.styles[t]=i.join(\" \")}function u(t){var e,n;try{for(var o=r(v.connect[t].children),i=o.next();!i.done;i=o.next()){var s=i.value;this.setStyle(this.childName(t,s),this.styles[t])}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}function p(t){var e,i,s=o([],n(v.connect[t].children),!1),a=this.styles[this.childName(t,s.shift())];try{for(var l=r(s),c=l.next();!c.done;c=l.next()){var u=c.value;if(this.styles[this.childName(t,u)]!==a)return void delete this.styles[t]}}catch(t){e={error:t}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(e)throw e.error}}this.styles[t]=a}var h=/^(?:[\\d.]+(?:[a-z]+)|thin|medium|thick|inherit|initial|unset)$/,f=/^(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|inherit|initial|unset)$/;function d(t){var e,n,o,i,s={width:\"\",style:\"\",color:\"\"};try{for(var l=r(a(this.styles[t])),c=l.next();!c.done;c=l.next()){var u=c.value;u.match(h)&&\"\"===s.width?s.width=u:u.match(f)&&\"\"===s.style?s.style=u:s.color=u}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}try{for(var p=r(v.connect[t].children),d=p.next();!d.done;d=p.next()){var m=d.value;this.setStyle(this.childName(t,m),s[m])}}catch(t){o={error:t}}finally{try{d&&!d.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}}function m(t){var e,n,o=[];try{for(var i=r(v.connect[t].children),s=i.next();!s.done;s=i.next()){var a=s.value,l=this.styles[this.childName(t,a)];l&&o.push(l)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}o.length?this.styles[t]=o.join(\" \"):delete this.styles[t]}var y={style:/^(?:normal|italic|oblique|inherit|initial|unset)$/,variant:new RegExp(\"^(?:\"+[\"normal|none\",\"inherit|initial|unset\",\"common-ligatures|no-common-ligatures\",\"discretionary-ligatures|no-discretionary-ligatures\",\"historical-ligatures|no-historical-ligatures\",\"contextual|no-contextual\",\"(?:stylistic|character-variant|swash|ornaments|annotation)\\\\([^)]*\\\\)\",\"small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps\",\"lining-nums|oldstyle-nums|proportional-nums|tabular-nums\",\"diagonal-fractions|stacked-fractions\",\"ordinal|slashed-zero\",\"jis78|jis83|jis90|jis04|simplified|traditional\",\"full-width|proportional-width\",\"ruby\"].join(\"|\")+\")$\"),weight:/^(?:normal|bold|bolder|lighter|[1-9]00|inherit|initial|unset)$/,stretch:new RegExp(\"^(?:\"+[\"normal\",\"(?:(" + let d_e8b6b9ccd03b942dd2866fc92c828cee = "y:t.delay))}),0):setTimeout((()=>{let i=this.getCoordinateInUniverse(t.element);this.moveWindow(i.centerX,i.centerY,Math.max(i.width,i.height),0,void 0!==e.delay?e.delay:t.delay)}),0)};let w,b=new y(t,\"Presentation\",[],this,{}),A=[b];this.push=function(t){this.getToC().querySelectorAll(\".toc-slip .active-slip\").forEach((t=>t.classList.remove(\"active-slip\"))),t.tocElem&&t.tocElem.classList.add(\"active-slip\"),t.element.classList.add(\"active-true-slip\"),A.length>0&&A[A.length-1].element.classList.remove(\"active-true-slip\"),A.push(t)},this.pop=function(){this.getToC().querySelectorAll(\".toc-slip .active-slip\").forEach((t=>t.classList.remove(\"active-slip\")));let t=A.pop();return t.element.classList.remove(\"active-true-slip\"),0==A.length&&A.push(t),A[A.length-1].element.classList.add(\"active-true-slip\"),A[A.length-1].tocElem&&A[A.length-1].tocElem.classList.add(\"active-slip\"),t},this.getCurrentSlip=function(){return A[A.length-1]},this.getSlipTree=function(t){return(t=t||b)instanceof y?{name:t.name,slip:t,subslips:t.getActionList().map((t=>this.getSlipTree(t)))}:{function:!0}},this.goToState=function(t){let e=t=>{if(0!=t.length)for(e(t[0]);t[1].getActionIndex(){let s=document.createElement(\"div\"),n=document.createElement(\"div\");if(n.innerText=t.slip.fullName,s.appendChild(n),t.subslips.length>0){let n=document.createElement(\"ul\");t.subslips.forEach(((s,a)=>{let r=[e,t.slip,a],o=document.createElement(\"li\");if(s.function){let t=e=>0==e.length?[]:t(e[0]).concat([e[2]]);o.innerText=this.countersToString(t(r)),o.classList.add(\"toc-function\")}else o.appendChild(i(s,r));o.addEventListener(\"click\",(t=>{t.target==o&&this.goToState(r)})),n.appendChild(o)})),s.appendChild(n),t.slip.setTocElem(s)}return s};t.innerHTML=\"\",t.appendChild(i(e,[]))},this.getTool=()=>this.getCurrentSlip().getTool(),this.setTool=t=>{this.getCurrentSlip().setTool(t),this.updateToolClasses()},this.getColor=()=>this.getCurrentSlip().getColor(),this.setColor=t=>{this.getCurrentSlip().setColor(t),this.updateToolClasses()},this.setLineWidth=t=>{this.getCurrentSlip().setLineWidth(t),this.updateToolClasses()},this.getLineWidth=()=>this.getCurrentSlip().getLineWidth(),this.reloadCanvas=()=>{this.getCurrentSlip().reloadCanvas()};let S=this;this.updateToolClasses=()=>{document.querySelector(\".slip-toolbar-tool\").classList.remove(\"drawing\",\"highlighting\",\"drawing-erase\",\"highlighting-erase\",\"no-tool\"),\"no-tool\"==this.getTool()||\"cursor\"==this.getTool()?document.querySelector(\".slip-writing-toolbar\").classList.remove(\"active\"):document.querySelector(\".slip-writing-toolbar\").classList.add(\"active\"),document.querySelector(\".slip-toolbar-tool\").classList.add(this.getTool()),document.querySelector(\".slip-toolbar-color\").classList.remove(\"black\",\"blue\",\"red\",\"green\",\"yellow\"),document.querySelector(\".slip-toolbar-color\").classList.add(this.getColor()),document.querySelector(\".slip-toolbar-width\").classList.remove(\"small\",\"medium\",\"large\"),document.querySelector(\".slip-toolbar-width\").classList.add(this.getLineWidth())},setTimeout((function(){document.querySelector(\".slip-toolbar-pen\").addEventListener(\"click\",(function(t){S.setTool(\"drawing\")})),document.querySelector(\".slip-toolbar-cursor\").addEventListener(\"click\",(function(t){S.setTool(\"no-tool\")})),document.querySelector(\".slip-toolbar-eraser\").addEventListener(\"click\",(function(t){switch(S.getTool()){case\"drawing-erase\":S.setTool(\"drawing\");break;case\"highlighting\":S.setTool(\"highlighting-erase\");break;case\"highlighting-erase\":S.setTool(\"highlighting\");break;case\"no-tool\":S.setTool(\"no-tool\");break;case\"drawing\":S.setTool(\"drawing-erase\")}})),document.querySelector(\".slip-toolbar-highlighter\").addEventListener(\"click\",(function(t){S.setTool(\"highlighting\")})),document.querySelector(\".slip-toolbar-black\").addEventListener(\"click\",(function(t){S.setColor(\"bl" + let d_ec92fbb6f31641708459454778593ee8 = "endArray(\"columnspacing\",this.maxrow-1)},e.prototype.extendArray=function(t,e){if(this.arraydef[t]){var r=this.arraydef[t].split(/ /),n=s([],i(r),!1);if(n.length>1){for(;n.length-1||p(t,n))return s;if(e.indexOf(t.tagName)>-1&&s++,!t.childNodes||0===t.childNodes.length)return s;const a=o.toArray(t.childNodes);return Math.max.apply(null,a.map((function(t){return h(t,e,r,n,i,s)})))}function f(t){return u(\"fraction\",t,[\"fraction\"],e.nestingBarriers,{},s.LOCALE.FUNCTIONS.fracNestDepth)}function d(t,e,r){const n=f(t),o=Array(n).fill(e);return r&&o.push(r),o.join(s.LOCALE.MESSAGES.regexp.JOINER_FRAC)}function m(t,e,r){for(;t.parentNode;){const n=t.parentNode,o=n.parentNode;if(!o)break;const i=t.getAttribute&&t.getAttribute(\"role\");(\"subscript\"===o.tagName&&t===n.childNodes[1]||\"tensor\"===o.tagName&&i&&(\"leftsub\"===i||\"rightsub\"===i))&&(e=r.sub+s.LOCALE.MESSAGES.regexp.JOINER_SUBSUPER+e),(\"superscript\"===o.tagName&&t===n.childNodes[1]||\"tensor\"===o.tagName&&i&&(\"leftsuper\"===i||\"rightsuper\"===i))&&(e=r.sup+s.LOCALE.MESSAGES.regexp.JOINER_SUBSUPER+e),t=o}return e.trim()}function y(t){return u(\"radical\",t,[\"sqrt\",\"root\"],e.nestingBarriers,{})}function g(t,e,r){const n=y(t),o=b(t);return r=o?s.LOCALE.FUNCTIONS.combineRootIndex(r,o):r,1===n?r:s.LOCALE.FUNCTIONS.combineNestedRadical(e,s.LOCALE.FUNCTIONS.radicalNestDepth(n-1),r)}function b(t){const e=\"sqrt\"===t.tagName?\"2\":i.evalXPath(\"children/*[1]\",t)[0].textContent.trim();return s.LOCALE.MESSAGES.MSroots[e]||\"\"}function v(t){return u(\"underscore\",t,[\"underscore\"],e.nestingBarriers,{},(function(t){return t.tagName&&\"underscore\"===t.tagName&&\"underaccent\"===t.childNodes[0].childNodes[1].getAttribute(\"role\")}))}function _(t){return u(\"overscore\",t,[\"overscore\"],e.nestingBarriers,{},(function(t){return t.tagName&&\"overscore\"===t.tagName&&\"overaccent\"===t.childNodes[0].childNodes[1].getAttribute(\"role\")}))}e.spaceoutText=function(t){return Array.from(t.textContent).join(\" \")},e.spaceoutNodes=c,e.spaceoutNumber=function(t){return c(t,(function(t){t.textContent.match(/\\W/)||(t.type=\"number\")}))},e.spaceoutIdentifier=function(t){return c(t,(function(t){t.font=\"unknown\",t.type=\"identifier\"}))},e.nestingBarriers=[\"cases\",\"cell\",\"integral\",\"line\",\"matrix\",\"multiline\",\"overscore\",\"root\",\"row\",\"sqrt\",\"subscript\",\"superscript\",\"table\",\"underscore\",\"vector\"],e.resetNestingDepth=function(t){return l={},[t]},e.getNestingDepth=u,e.containsAttr=p,e.computeNestingDepth_=h,e.fractionNestingDepth=f,e.nestedFraction=d,e.openingFractionVerbose=function(t){return d(t,s.LOCALE.MESSAGES.MS.START,s.LOCALE.MESSAGES.MS.FRAC_V)},e.closingFractionVerbose=function(t){return d(t,s.LOCALE.MESSAGES.MS.END,s.LOCALE.MESSAGES.MS.FRAC_V)},e.overFractionVerbose=function(t){return d(t,s.LOCALE.MESSAGES.MS.FRAC_OVER)},e.openingFractionBrief=function(t){return d(t,s.LOCALE.MESSAGES.MS.START,s.LOCALE.MESSAGES.MS.FRAC_B)},e.closingFractionBrief=function(t){return d(t,s.LOCALE.MESSAGES.MS.END,s.LOCALE.MESSAGES.MS.FRAC_B)},e.openingFractionSbrief=function(t){const e=f(t);return 1===e?s.LOCALE.MESSAGES.MS.FRAC_S:s.LOCALE.FUNCTIONS.combineNestedFraction(s.LOCALE.MESSAGES.MS.NEST_FRAC,s.LOCALE.FUNCTIONS.radicalNestDepth(e-1),s.LOCALE.MESSAGES.MS.FRAC_S)},e.closingFractionSbrief=function(t){const e=f(t);return 1===e?s.LOCALE.MESSAGES.MS.ENDFRAC:s.LOCALE.FUNCTIONS.combineNestedFraction(s.LOCALE.MESSAGES.MS.NEST_FRAC,s.LOCALE.F" @@ -671,7 +671,7 @@ module Internal = struct | "highlight-js.js.crunch" | "/highlight-js.js.crunch" -> Some [ d_9dd01eaa25592e9338b02973b955b4ac; d_776cc33de41362cac7eb8343c780060e; d_551e49c8b6261f11b291dd68b5ab1392; d_68d14d1af40bcd27f82659474060bffa; d_519f7d37a56893cc10f93469c870b53e; d_6d96b1e22e0698d445791c602cac3633; d_f4f4812a222323cc8740a1fb61eb6f97; d_bf0c2c239ea6b17ce4562f7ea67be610; d_fe1d08008233efe3b015ccda70bc5e1a; d_65a39c9a927e6cb37e1a79a7a857465f; d_ad2cd3b04c252d4b7e0fecafba3d57eb; d_626ed612d8b0bafda53dae94b10e7d2d; d_565ec18b8ea2f0285ac1cf5a43b272e6; d_2ed6aeb740707bfc369d2bd9626743f0; d_312ed993f93c3fb6c53207fa7219c898; d_c34d43fa53f4b80c9c8f0d74cb7143b4; d_9a048156983d9fba738b9c1f8ee17c56; d_bf8ee45665760373020a2834cd39452d; d_acc0a89cd41c7e5dc659f115f5a08afa; d_90c02e1c30bdf726c2f42800a2e56322; d_4bf68ec4dccae26e98917878c5ac4c3d; d_f7cb024bb94ca7ec991d61c9cc3cc78b; d_5e785ce0f73d7034385b37fafcd5e9ed; d_04fecb198a81e6949747641cd4045e53; d_87d6e01594df507c7e8401aa91d2b244; d_8789a883460c71d3903e8b42aee4e1fb; d_b361cf52197e64d188e5c8384dd6ff4c; d_75772cf3efca1955d5ddd0446eba3f60; d_74f019c5826d7b34084c786916d955a5; d_3e4a722c2f037aa8f8820d2e48365dfa; ] | "highlight-js.ocaml.js.crunch" | "/highlight-js.ocaml.js.crunch" -> Some [ d_58fc515405552b3ca68122d22ed1b6dc; ] | "slip.css.crunch" | "/slip.css.crunch" -> Some [ d_dee4f1867f9f5915ba09975d021a9a46; d_aa5644add33a4a746b5efb7a6a4f8a2f; d_3893025bb7b8aba7c18d359184939741; ] - | "slipshow.cdn.min.js.crunch" | "/slipshow.cdn.min.js.crunch" -> Some [ d_741557919f2e098b3a248bff4e465ca0; d_4c14d42cc3d0d3e27a8c195af409bc2a; d_2b5d5de595817876e47375f75f5663d2; d_fab7fbadc988d503eff2304e14f3c9c5; d_c31e1db93c4a625f619df41ad8427804; d_a99d1b8123a1bac6c34ad21e84f8cfc2; d_154322252f4f2624938aeaa2901d9fec; d_b881c0d7d9af2b88359d41c9e60e9cbe; d_e646cd8a4d1959433a93568c8a2f353c; d_142afebb76c9b67367b2701f217409c6; d_7f01d66970a249832ff6f7cfc78c3284; d_10e883bea28cb6a8790954c26ec481d0; ] + | "slipshow.cdn.min.js.crunch" | "/slipshow.cdn.min.js.crunch" -> Some [ d_741557919f2e098b3a248bff4e465ca0; d_4c14d42cc3d0d3e27a8c195af409bc2a; d_2b5d5de595817876e47375f75f5663d2; d_fab7fbadc988d503eff2304e14f3c9c5; d_c31e1db93c4a625f619df41ad8427804; d_a99d1b8123a1bac6c34ad21e84f8cfc2; d_154322252f4f2624938aeaa2901d9fec; d_b881c0d7d9af2b88359d41c9e60e9cbe; d_e646cd8a4d1959433a93568c8a2f353c; d_074319dd77b0074a0675ead9812aa734; d_e8b6b9ccd03b942dd2866fc92c828cee; d_b86ca8db00fb7a86364d66a87e3af4f2; ] | "tex-chtml.js.crunch" | "/tex-chtml.js.crunch" -> Some [ d_4744536d74fd7144213d6bef93e35593; d_247792447a091f445bb319590d3de0d6; d_bd2b9eeaca5644ba1bc60a05b89c6758; d_31f62bc3834543bed192a2f9e99491f7; d_84140e09113783c2e6e20049964285de; d_4139dad3d8ceae1f145bac117a7b5b8d; d_f231b6d4f9216557688129dfdf04589c; d_a53731929bbcd2b5af497c7f3ce93a3a; d_757b7979765dc9823426ed1c9dab7980; d_d5226f70e68db05ab2b59c09f2d296aa; d_9a12786923aa33d065f66fc3af9b438c; d_a79d07cd02dcb2767df91f4b12c376ed; d_dcf07069e19c950adf33b2c92a618e23; d_495e6257e16666bf1ee4f8ea21e1cc30; d_72c31bb78a42148d1c3b3b30ab5784ef; d_22dfa1146a12a3d49a425dd339051e6a; d_5a3155a58c07ce4b9a8037da38d1866a; d_9dff81643e2245793fe70cbdbcaa030e; d_f1117d613a3e9b936d496ab1eaab3348; d_3351e76121c03d947d4f507d3eac252f; d_a31df9317a2264c457c5941e10f6464e; d_d084f838692ff0140f2a0a5431c93c3d; d_612b567ee5fdd7c70d26379e347d675c; d_a70fddd1bac5f033c601eb8a75236fbf; d_7555c6c0ad50bc81912849d9963b855b; d_3a5e0161ca0f1f8e3964f8b553f39533; d_47af374847c34041c1d2e5e220747aae; d_e7f9897da3578222f3ab886feebb0812; d_d515b33892cb36e94a5c38e9431e4ac9; d_31fa9d37b314abfdd1d89e3b6bc83ce9; d_12db84fb411131c7686f8971f32e08cf; d_495480683db0bb508fc3ba0a8b3b3da0; d_dd3ef7152e155dbd09cb8a679ca40cf5; d_3a48d5e94f0ad9d4a23a5e6636db9085; d_e84ae6de1fed6a678fb1e1d41e99d7aa; d_f9e9bb4a928ae9065bd8d474bf98dd66; d_5dcae4d5359aa273116e4d8ac23f8fc7; d_d76934764cdcfd3146dc7c72691c293c; d_452657530a54a34fae9e3b14295823b8; d_0b90addab1c03dc5f54a24f07c476749; d_0b83c32ea28a48104efea5cb4f95d484; d_22aefbda0d24e3f2554e71860ee639cc; d_b94522ceabe800b35864454d899b7c42; d_105d6f43c5b9121516f1ab9bf353c556; d_719cdcf2f6eed2b2c8aab8e72b91b9c8; d_b787590a5265132383bf9b8e25c2bb58; d_c938155469cd6c413fb6d42a36a8ec2e; d_d51f61e93b4d3287db79f33e312e8be4; d_6050d6f49a0e80ec6ac9899d1c221f34; d_534757ec6b77e07cb3372a580924da93; d_f3b932ef19d9349096affba4a6df516c; d_22bd5b1bcb7d07feadaf8bcc573b0988; d_fc4cd05851299fcf9d7ca5bbf26029c0; d_1a65137172d14be50977ffc559213373; d_c83a31dd992ae6c10d61bf89d42d39ed; d_6abf29ea7b3b9c290d5fa04c5272a444; d_326a3796664e7b44a4756f120f9aa27b; d_caaf91a42a515964d646894770ad5474; d_0da68935342e5533ee92eac12a5411fa; d_d8cc27c132f1eedf4f4853f5c5a064ca; d_ecfd1e468662fd9142c16bbd96ab73b0; d_37a33750e62c03dcdbd0a8d8cf34cbe3; d_9c9580c84e05998ed8110310aa6953fc; d_af1935eb5df4300bd69eff8d6e2d4fc0; d_57eb50682b5d1265f37b627e1216a889; d_8439b2ffff60bb0b658ff1eca3346980; d_dc8a08b7a1f983bde7484238796a62c6; d_b4386870d49459e2a6fc6700d8fb9a67; d_e05517ee68be932ddbb0aaa108575999; d_1c19e1a0013c51eb3506f2f375b4faaf; d_8f2b73f8cad4d92c939996c6afafa80e; d_fc7dfaa39e84f9c327331c797d99a70a; d_37ff7dc4e3e96780e9497f5311285e3a; d_10818ffb7423476bd940c66ac4d97c57; d_41efc6a9400dd459614bb3d84fd2c7c3; d_cc75d4e43da8e84c1a7d913d6db0863b; d_1cd0f7786e6196851837c72cef80ab7c; d_cec4cbac1033040827440a555a3e8f1b; d_ec92fbb6f31641708459454778593ee8; d_0f23998c0f274503335701c0197819c9; d_6773bc1b580bb731691f1d6cc51a00ad; d_f778cb600e0ae3fcf75fddbbca82312e; d_77b05daf81d15ff0ec3e4e7fdb097d15; d_bca7aeb7801ad0ce35c643cbcd5e1975; d_6c307f098c79e73daf4f1a6a41782370; d_90ec6caeef22660bc688507f67972ddb; d_c25221527aaa610020cc080dd4d135e9; d_b65e4e380c77fe3326a334a11668d378; d_73af963ffa4923e837a085a5794dbcc6; d_469604937a7600b246c77053e930f15f; d_fed5a4689d059d472eff2b711f3412b7; d_8ba7cd16eeef10cd5cb750e61c5f4871; d_6dc2c538b12dd2aba124b0b971433b84; d_6c91d043983803231c965a0d90058f53; d_85440948384e75bb5e3a18fa8dc4586c; d_4316088982c87bd5dde7c180c4e3a598; d_ca0ab75a8fa51420f8a5e07a3c327702; d_788e8f0a601accebc93f69f84696fdda; d_04571e1cbbe237b24d3e77ea6453104b; d_1463575c0be0b0338af432a87f931edb; d_98cf42ea49dddb9854aa915f8ab9604c; d_022f1d4b1ae4efb70bc00e4201715f63; d_e4930dd792920a4be9ee8ced0afa14b5; d_96dcb701524feda314a82a76c83f82bc; d_5e6b47897efdf6d2b81153f26268071e; d_a4bac3d5ea340506219c580344ae8d74; d_3afc14b6a9d61ebeb0f27a076104a6e7; d_f0c1be87b7db694b3ad793c373a4b706; d_8422dd15ab0c31401db7080e524c5274; d_4e14b41c1bcfa015bd960e713b00f169; d_cb8160618a6641848ae103f7512e52f6; d_ae7c2c6f026c568112b3df32d62e7e14; d_207b9bbb73dae2f1f1e608bedd7f7175; d_2b7c5b64fefada9e355f5a0dc5050e11; d_1726fc2be59f1066ea120fa1c65bcc75; d_dee2516b01a30f5e9a15b34da7f2ee5d; d_da63fc69f27ec763f33994873c9b5834; d_5bdd761d9617cf229fa37c0b53efdec2; d_9f677567e5eacb4bee35eaa9f5eb3153; d_d028a16cf21176c20aaf4e57da5a969a; d_9b23822654bba0a88747460c115d9dc9; d_4f0bce2d1deec45d34859b84472da5cf; d_71b66890c6facca6e1d677946e7925c3; d_d25707c64e6c64809121ddab1cb61ee6; d_1b634e450e54f8815333d14434e64003; d_5f5354ddb2df4aaeee4467a675e899ec; d_722c4a4b271827a6ff0b9a667dedfed8; d_260c723dd31b56f2fdb04dabd4b06077; d_17df17e355ef3cee27db246d4f02323c; d_4d5648f898fda928072c7f8a920d43da; d_2ded1881a79e76841440f70c88e3bbcf; d_a989d806bc872bcb59c355a1d291e560; d_ce36809502858b3bd258768c2a82fdae; d_5ff75b58616e5fd23920bfbc3145df24; d_65a4783ad8f34c661f3f44013456a9b0; d_3522e1605c0d10fd3d1662f2b0d507f8; d_85ef11b1b467826034f43e792e3688fb; d_f3c4c9d25675c67c6de00df733874dc9; d_b3733fd21194ce52e746285cb26efe76; d_0c0839d89166b1abd413b866b943e6e7; d_f63ccb984701b7caa41e962d4c034b5e; d_a672506ea23145c17b4c83e996e4e26c; d_72c63e77d424685c10f3620435024481; d_75331ab897248be03cdb341e1382001b; d_cdb058251dc1a92d72531c4b91240522; d_f9493c518d342f709b6d0145fafeb7a3; d_4a57db04183c7c4e678501b5e7d8d1bb; d_271bd494543762ec65964c6cc89b0bf0; d_c6ff7cd17ee4952883bf3a938e9f43e3; d_9ae68171e63af8291b31602cabbf52de; d_ff02ca50f39ae7f0b6af08eab1ce31fc; d_c11abab736693d6b9ba53873e84edc2f; d_cf39ed1111d15fddaa821ea89763e0b3; d_df15c7de5fd4def0411bf06e82a441dd; d_ca090d079ec58d2a827e3bb52143f472; d_0852485976a7f76481eda7818e6424f7; d_c956482f603b0f76d36975b312cddb69; d_6ae5a89c2c566871580c87f4c49ec4c2; d_2e3ff7166cdcc61c29538e609b0ce7ce; d_d77e73c2b6f4ac7c5ae40fe5f843197c; d_9edf619d57c51ad07bca2bde37ecb353; d_9ff735344e23aa7be3350cff27d07a19; d_ffa8a3d28ab5b3cc3feb5fdb03283f97; d_b6c3a76c1461d4a6b20ce7b8ad623d0e; d_e4455cca8420c185a537b18a807c2853; d_affddacc60e071618a20e9a9d12a1206; d_61ec73556693aacc1ad10134e95da688; d_a7d69f68e1fff927d0283adc188ee002; d_3e9b07e86b42df79e8d7b31e629ebde0; d_aedb6fdad6d22bc213c80dd4739a9d26; d_84f244fbff0a9141b5b3b311a402bb6f; d_1a09570cb58ed16751ae61ef0d35bed4; d_540404b3622094f12af7c142dc6f3b68; d_d2491c0582608efeb048705af4f39574; d_cefa9ee335b9f54675e2f0f8277063ba; d_5c1dd2c8251e321d99ffc1b8d558eda5; d_debb7f7ef1de7cf276443ba3ba8cb08b; d_c400fb633ab7f221eaf554e5818264d7; d_bdd3a50c34434e350dd4eb2c2fe02ce2; d_5a2ed6852247c52ca0eca3e83c45f370; d_04a0bf82132e6d6cc044ea081dfffadf; d_a114d093abb0d3709a1d3fce20315c62; d_e885fdb2729b9bde176a524ea9d5fc21; d_bd26979b3f600589548bcf1eb9207763; d_5b9d881a30909f8fdaa30a6cd88944df; d_632b87c3b42558f3559aa17a16dc44ee; d_ff36f0267b75475da831092f84cafc37; d_9288de816ccfdf84354dd58390ef94f8; d_f32898741f3994ad2ae2406ed9dcb6ed; d_bcf4a08694f4b2e63261c5d4e000fb89; d_342167014463b2408da60a4de1071ca6; d_8a211a739a4e10206795cac5c28b9f66; d_01c5f6430deaf9da7dc03a692c5a2813; d_0378faeb43e4775e7b39477acdfd0775; d_8c8b3e56cbac27cd73088417bccd653c; d_033df69243d11d5889594d19f0b6a91c; d_9d422f4368ef5eb372bd255390638ecb; d_e057b2581fc72d5fda8db883368cf609; d_ed8ae9d57824d6d8fbbba2043d5818a2; d_274b899fff0fc59b5c0847c4d3bafdfa; d_882b4bf0500e442864c11a24c506c9f3; d_cc33262bab497b35a4249dac104c3c71; d_c272a8941f9df10b149ac3e1cf2e7308; d_0d02326b3abbf3e8d959951e59ad03ba; d_ffa3fabfdd740e5edd7c73bb9fe05ab5; d_786a2e1200e95bdd262ab1bd6dbb57c5; d_b64794d74419a78978e607a1321d2938; d_971bc94f365c287d7a641a6b59d231c8; d_949a8beca0ffcf66cc48603d809ae755; d_f3b27eb45a67247a3df1a0dfe8792310; d_75db6df891b487f358aded16665f8534; d_a15cfd5c868ad41fb815cd4600597c8d; d_5fb4c77135b3d5eec35b3a8283a535fa; d_5797905710be4f5dabf61faae73396b6; d_c889830de2990cf6b5e3fa6cee890ec8; d_1c5c221025cb75286b0802f128665c41; d_4f2c83703a0bd13afa391971a6113eb2; d_ba804c416eecd7575d966d4b87255e8e; d_d0d64fabc2563ef298d499ce903108ff; d_92c5c72f4037786f901e55bb7fc8b96b; d_388d481d453ff68e65fd65d05c4910bd; d_6b72c787f1123af075ab6a043014077f; d_286d86be5bd2931f58bbe50a1f54edb1; d_fea8715a8fdbbd71a40b61a3a495e305; d_30e4802f68da54db08d6dec0a41ea5d9; d_7da58dfcf753ce458414dc2aa9734a5d; d_bba87f44310dcb050f40f4bcce7885d1; d_d5cb12d535569090168df49ebbe3736f; d_c33fd378605dd65b089c11cde065405e; d_33d384d3f7680c296d0bb42043c87595; d_ca4913dd16d8599ea9303042e5886848; d_57dcdd526b6dbd333d7702b90e4fccd9; d_6b9993eec0e944b8add26b30bfc0be81; d_6b5f6c18d7db5da2e1f8527f65298f2d; d_2691dc87a655aacd929e9c67167e8dc2; d_28d531c22c8e912941f7568abadc2826; d_0a75844d23a09404305c2d7c2cc6765f; d_138a3ca9ce403c8e7402ed87574ff71b; d_cc5229422bdd91e02c069d2129bca813; d_7c97874acb2b10095bfe84ea6f3f8442; d_dec78626c3d1144a537a0a6b5012f4b1; d_3f4f91da65709eecc850eaf8b91eadf4; d_d943625db23c2ecf75b62e0783b40b11; d_a1dd97a0d4b67323960947baee691b38; d_646848ba04e7da76002166b84d806779; d_9cb1e31fdfc724a567df61d56128f18e; d_bdbb3a9dc0b525f2d7c9dafbe6e18d0e; d_34bc4ce709c2f7d4e1cc9ef984ff3983; d_2c691213aecc371b29b28ddde8ec277c; d_e2a956fa31e10ed8fd436d73d04fe995; d_bd26bcbe67c61f184838722e1c8f9bfc; d_57e8bdc47cb6aa11dfaaa1d087e96832; d_488cc576dc8d8a205f5afcee490503cb; d_ad875fe8b30a9ebec278478ed6bd42e5; d_5cc82e15d41d456c5c3dc545659dfdf8; d_b985f7fd6b4189995a1bea74cdb00c12; d_fc0ecfc4ae304473e9a25f84766bf409; d_56c66839f79a4d631c89f08d9d969497; d_aa75072ae380ca566ae382563851ce93; d_31654ce68ea02c239ba5a311f378f78b; d_303a138e476511edac9291d59217afde; d_64a4bb4ce18cf371e5252394c937c8c5; d_d55910eeec605114a81785651811bee9; d_b144d6fc52b325470aa884381680d697; d_b8d7aec32ffa5db0eb2484126a24da34; d_b4251ae568b1b3d74df260857793a2d0; d_02699771a55dfa73d57492b1baa90e85; d_5d809ea6a67cde43424a18e8d6f493c7; d_edf3fe4c2e39658d1fe5971fb85a3d33; d_ecd6f8f3cd3d13c934688378f71365d9; d_abe09ca0bdee77ebebd890d170c6bd15; d_180d662224763a7f1412683f167c0b64; d_2990dcf0a89541d81513b794767b5d6a; d_075ab6abf2a7aee3a28b06f37e1ae261; d_7a35c30bc5ed182b074864452a8adff1; d_13bcec22439e2e599f285e9c403c101b; d_a5a0c1856f1091267b1fb505b7b648d6; d_049d2324b2d000a65bfff79298a32b58; d_dcaafc07b83b62653fca7f2df74d2b2c; d_98b8d083857e398245b810db7c1d529e; d_d0f1824a1b9f25ea9c431bd56401c88b; d_bd88005a47eea981eda948fc57ed4a2d; d_fca431878e1fafb10cc1c212464eb94c; d_277398d8845aebe1afb8e4ba89e99804; ] | "theorem.css.crunch" | "/theorem.css.crunch" -> Some [ d_28409ee1dbaeee045e1cdbfe03c215d2; ] | _ -> None @@ -691,7 +691,7 @@ let hash = function | "highlight-js.js.crunch" | "/highlight-js.js.crunch" -> Some "1ba1ea897d65b202b5450f6e55d043ef" | "highlight-js.ocaml.js.crunch" | "/highlight-js.ocaml.js.crunch" -> Some "58fc515405552b3ca68122d22ed1b6dc" | "slip.css.crunch" | "/slip.css.crunch" -> Some "dfeb80657d4bd833eedc1bbb8961f540" - | "slipshow.cdn.min.js.crunch" | "/slipshow.cdn.min.js.crunch" -> Some "3343f479ebc0c326201f09c8166db704" + | "slipshow.cdn.min.js.crunch" | "/slipshow.cdn.min.js.crunch" -> Some "119409f0d84a0a8aac010e1d4f3a0264" | "tex-chtml.js.crunch" | "/tex-chtml.js.crunch" -> Some "1d4e370eb01c3768d4304e3245b0afa6" | "theorem.css.crunch" | "/theorem.css.crunch" -> Some "28409ee1dbaeee045e1cdbfe03c215d2" | _ -> None @@ -701,7 +701,7 @@ let size = function | "highlight-js.js.crunch" | "/highlight-js.js.crunch" -> Some 121727 | "highlight-js.ocaml.js.crunch" | "/highlight-js.ocaml.js.crunch" -> Some 1330 | "slip.css.crunch" | "/slip.css.crunch" -> Some 8569 - | "slipshow.cdn.min.js.crunch" | "/slipshow.cdn.min.js.crunch" -> Some 47335 + | "slipshow.cdn.min.js.crunch" | "/slipshow.cdn.min.js.crunch" -> Some 47505 | "tex-chtml.js.crunch" | "/tex-chtml.js.crunch" -> Some 1160989 | "theorem.css.crunch" | "/theorem.css.crunch" -> Some 3948 | _ -> None diff --git a/compiler/data/slipshow.cdn.min.js.crunch b/compiler/data/slipshow.cdn.min.js.crunch index c1b5932..c7e0ce2 100644 --- a/compiler/data/slipshow.cdn.min.js.crunch +++ b/compiler/data/slipshow.cdn.min.js.crunch @@ -1,2 +1,2 @@ -var Slipshow=function(t){"use strict";class e extends HTMLImageElement{static get observedAttributes(){return["figure-name"]}constructor(){super(),void 0===this.internalStep&&(this.internalStep=0),this.img=[],this.maxStep=0,this.figureName=this.getAttribute("figure-name"),this.promise=this.preloadImages(0).then((()=>{this.updateSRC()}))}preloadImage(t){return new Promise(((e,i)=>{this.img[t]=new Image,this.img[t].onload=()=>e(),this.img[t].onerror=i,this.img[t].src=this.getURL(t)}))}preloadImages(t){return new Promise(((e,i)=>{this.preloadImage(t).then((()=>{this.preloadImages(t+1).then((()=>{e()}))})).catch((()=>{this.maxStep=t-1,e()}))}))}connectedCallback(){}getURL(t){return"figures/"+this.figureName+"/"+this.figureName+"_"+t+".svg"}updateSRC(){this.src=this.getURL(this.figureStep)}set figureStep(t){this.promise=this.promise.then((()=>{t>this.maxStep?this.internalStep=this.maxStep:this.internalStep=t<0?0:t,this.updateSRC()}))}get figureStep(){return this.internalStep}attributeChangedCallback(t,e,i){"figure-name"==t&&(this.figureName=i,this.promise=this.promise.then((()=>{this.preloadImages(0).then((()=>{this.updateSRC()}))})))}nextFigure(){this.figuresStep++}}customElements.define("slip-figure",e,{extends:"img"});let i=(t,e,i)=>{i=i||"slip-slip",t.id||(t.id="_"+Math.random().toString(36).substr(2,15));let s=Array.from(t.querySelectorAll(e)),n=e.split(",").map((e=>"#"+t.id+" "+i+" "+e)).join(),a=Array.from(t.querySelectorAll(n));return s.filter((t=>!a.includes(t)))};function s(t){let e=t.cloneNode(!1);return t.childNodes.forEach((t=>{if(t.tagName&&"SLIP-SLIP"==t.tagName){let i=document.createElement(t.tagName);["pause","step","auto-enter","immediate-enter"].forEach((e=>{t.hasAttribute(e)&&i.setAttribute(e,t.getAttribute(e))})),i.classList.add("toReplace"),e.appendChild(i)}else if(t.tagName&&"CANVAS"==t.tagName&&t.classList.contains("sketchpad")){let i=document.createElement(t.tagName);i.classList.add("toReplaceSketchpad"),e.appendChild(i)}else e.appendChild(s(t))})),e}function n(t,e,s,n){let a=i(t,".toReplace");e.forEach(((t,e)=>{["pause","step","auto-enter","immediate-enter"].forEach((i=>{a[e].hasAttribute(i)&&t.setAttribute(i,a[e].getAttribute(i))})),a[e].replaceWith(t)}));let r=i(t,".toReplaceSketchpad");r[0]&&r[0].replaceWith(s),r[1]&&r[1].replaceWith(n)}window.myQueryAll=i;var a=Object.freeze({__proto__:null,cloneNoSubslip:s,myQueryAll:i,replaceSubslips:n});function r(t){let e=t;this.getEngine=()=>this.engine,this.setEngine=t=>this.engine=t;let i=!0;this.activate=()=>{i=!0},this.deactivate=()=>{i=!1};let s=["k"],n=["m"],a=["o"],r=["l"],o=["i"],l=["p"],h=["z"],c=["Z"],u=["T"],d=["t"],p=["ArrowRight","ArrowDown"],g=["ArrowLeft","ArrowUp"],m=["r"],f=["f"],v=[],y=["w"],w=["W"],b=["h"],A=["H"],S=["x"],x=["X"],k=["C"],L=["#"],E=1;document.addEventListener("keypress",(t=>{f.includes(t.key)&&i&&(E=(E+4)%30+1),m.includes(t.key)&&i&&e.getCurrentSlip().refresh(),y.includes(t.key)&&i&&e.setTool("drawing"),w.includes(t.key)&&i&&e.setTool("drawing-erase"),b.includes(t.key)&&i&&e.setTool("highlighting"),A.includes(t.key)&&i&&e.setTool("highlighting-erase"),S.includes(t.key)&&i&&e.setTool("no-tool"),x.includes(t.key)&&i&&e.setTool("clear-all"),k.includes(t.key)&&i&&e.reloadCanvas(),L.includes(t.key)&&i&&(document.querySelectorAll("slip-slip").forEach((t=>{t.style.zIndex="-1"})),document.querySelectorAll(".background-canvas").forEach((t=>{t.style.zIndex="1"})))})),document.addEventListener("keydown",(t=>{let m=e.getOpenWindowHeight(),f=e.getOpenWindowWidth();r.includes(t.key)&&i&&e.moveWindowRelative(0,E/m,0,0,.1),a.includes(t.key)&&i&&e.moveWindowRelative(0,-E/m,0,0,.1),s.includes(t.key)&&i&&e.moveWindowRelative(-E/f,0,0,0,.1),n.includes(t.key)&&i&&e.moveWindowRelative(E/f,0,0,0,.1),o.includes(t.key)&&i&&e.moveWindowRelative(0,0,0,1,.1),l.includes(t.key)&&i&&e.moveWindowRelative(0,0,0,-1,.1),h.includes(t.key)&&i&&e.moveWindowRelative(0,0,.01,0,.1),c.includes(t.key)&&i&&e.moveWindowRelative(0,0,-.01,0,.1),u.includes(t.key)&&i&&e.showToC(),d.includes(t.key)&&i&&(document.querySelector(".toc-slip").style.display="none"==document.querySelector(".toc-slip").style.display?"block":"none"),p.includes(t.key)&&i?t.shiftKey?e.nextSlip():e.next():g.includes(t.key)&&i?t.shiftKey?e.previousSlip():e.previous():v.includes(t.key)&&i&&e.pop()}))}class o{constructor(t,e){this.x=t,this.y=e}set(t,e){this.x=t,this.y=e}}class l extends o{constructor(){super(0,0),this.down=!1,this.previous=new o(0,0)}}class h{constructor(){this.eventListeners=new Map}addEventListener(t,e){const i=this.eventListeners.get(t)||new Set;i.add(e),this.eventListeners.set(t,i)}removeEventListener(t,e){const i=this.eventListeners.get(t);i&&i.delete(e)}dispatchEvent(t,e){const i=this.eventListeners.get(t);i&&[...i].forEach((t=>t(e)))}}const c=(t,e,i,s)=>{const n=(i-t)**2,a=(s-e)**2;return Math.sqrt(n+a)},u=(t,e,i,s,n)=>a=>{const r=t[a],o=t[a+1],l=t[a+2],h=t[a+3];return r===e&&o===i&&l===s&&h===n},d="draw",p="erase",g="fill",m="disabled",f=[d,p];class v extends h{constructor(t,e={}){if("undefined"==typeof window)throw new Error("Looks like we're not running in a browser");if(super(),t instanceof window.Node&&"CANVAS"===t.tagName)this.canvas=t;else{if("string"!=typeof t)throw new Error(`can't look for canvas based on '${t}'`);this.canvas=document.querySelector(t)}if(!this.canvas)throw new Error("canvas not found");this.canvas.width=e.width||this.canvas.width,this.canvas.height=e.height||this.canvas.height,this.mouse=new l;const i=t=>{t.cancelable&&t.preventDefault();const e=this.canvas.getBoundingClientRect(),i=t.changedTouches&&t.changedTouches[0]||t;let s=i.offsetX,n=i.offsetY;void 0===s&&(s=i.clientX-e.left),void 0===n&&(n=i.clientY-e.top);const{mouse:a}=this;if(a.down&&f.includes(this.modeInternal)){const{x:t,y:e}=this.draw(s,n,a.previous.x,a.previous.y);this.dirty||this.modeInternal!==d||s===a.x&&n===a.y||(this.dirty=!0,this.fireDirty()),a.set(s,n),a.previous.set(t,e)}else a.set(s,n)},s=t=>{if(t.cancelable&&t.preventDefault(),i(t),this.mode===g)return void this.fill();const{mouse:e}=this;e.previous.set(e.x,e.y),e.down=!0,this.beginStroke(e.previous.x,e.previous.y)},n=t=>{if(this.mode===g)return;const{mouse:e}=this;if(!e.down)return;const i=t.changedTouches&&t.changedTouches[0]||t,s=i.offsetX,n=i.offsetY;if(e.down=!1,e.x===s&&e.y===n&&f.includes(this.mode)){const{x:t,y:i}=this.draw(e.x,e.y,e.previous.x,e.previous.y);e.previous.set(t,i)}this.endStroke(e.x,e.y)};this.canvas.addEventListener("mousemove",i),this.canvas.addEventListener("mousedown",s),document.addEventListener("mouseup",n),this.canvas.addEventListener("touchstart",s),this.canvas.addEventListener("touchend",n),this.canvas.addEventListener("touchmove",i),this.destroy=()=>{this.clear(),this.canvas.removeEventListener("mousemove",i),this.canvas.removeEventListener("mousedown",s),document.removeEventListener("mouseup",n),this.canvas.removeEventListener("touchstart",s),this.canvas.removeEventListener("touchend",n),this.canvas.removeEventListener("touchmove",i)},this.context=this.canvas.getContext("2d"),this.context.globalCompositeOperation="source-over",this.context.globalAlpha=1,this.context.strokeStyle=e.color||"rgba(0,0,0,1)",this.context.lineCap="round",this.context.lineJoin="round",this.context.translate(.5,.5),this.filling=!1,this.fillStack=[],this.recordStrokes=!1,this.strokeMemory=[],this.smoothing=.85,this.thickness=2,this.targetThickness=this.thickness,this.weightInternal=this.thickness,this.maxWeight=this.thickness+10,this.modeInternal=d,this.adaptiveStroke=!0,["weight","smoothing","adaptiveStroke","mode"].forEach((t=>{void 0!==e[t]&&(this[t]=e[t])}))}beginStroke(t,e){this.context.beginPath(),this.context.moveTo(t,e),this.recordStrokes&&(this.strokeTimestamp=performance.now(),this.strokeMemory.push({point:new o(t,e),time:performance.now()-this.strokeTimestamp})),this.dispatchEvent("strokestart",{x:t,y:e})}endStroke(t,e){this.context.closePath(),this.recordStrokes&&this.strokeMemory.push({point:new o(t,e),time:performance.now()-this.strokeTimestamp}),this.dispatchEvent("strokeend",{x:t,y:e}),this.recordStrokes&&this.dispatchEvent("strokerecorded",{stroke:this.currentStroke}),this.strokeMemory=[],delete this.strokeTimestamp}draw(t,e,i,s){this.recordStrokes&&(this.strokeMemory.push({point:new o(t,e),time:performance.now()-this.strokeTimestamp}),this.dispatchEvent("pointdrawn",{stroke:this.currentStroke}));const{context:n}=this,a=c(t,e,i,s),r=Math.min(.87,this.smoothing+(a-60)/3e3),l=t-(t-i)*r,h=e-(e-s)*r,u=c(l,h,i,s);return this.adaptiveStroke?(this.targetThickness=(u-1)/49*(this.maxWeight-this.weightInternal)+this.weightInternal,this.thickness>this.targetThickness?this.thickness-=.5:this.thickness{this.floodFill(t.x,t.y,i)}),100)}}floodFill(t,e,i){const{context:s}=this,n=Math.floor(t),a=Math.floor(e),r=s.canvas.width,o=s.canvas.height,l=[[n,a]],h=(t=>{const e=t.match(/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]})(this.color),c=s.getImageData(0,0,s.canvas.width,s.canvas.height),d=Math.min(10*s.globalAlpha*255,255),p=((t,e,i,s,n,a)=>{const r=u(t,...n);return n=>{t[n]=e,t[n+1]=i,t[n+2]=s,t[n+3]=a,r(n+4)||(t[n+4]=.01*t[n+4]+.99*e,t[n+4+1]=.01*t[n+4+1]+.99*i,t[n+4+2]=.01*t[n+4+2]+.99*s,t[n+4+3]=.01*t[n+4+3]+.99*a),r(n-4)||(t[n-4]=.01*t[n-4]+.99*e,t[n-4+1]=.01*t[n-4+1]+.99*i,t[n-4+2]=.01*t[n-4+2]+.99*s,t[n-4+3]=.01*t[n-4+3]+.99*a)}})(c.data,...h,i,d),g=u(c.data,...i);if(u(c.data,...h,255)(4*(a*s.canvas.width+n)))return this.filling=!1,void this.dispatchEvent("fillend",{});for(;l.length;){const t=l.pop(),e=t[0];let i=t[1],s=4*(i*r+e);for(;i-- >=0&&g(s);)s-=4*r;s+=4*r,++i;let n=!1,a=!1;for(;i++0&&(g(s-4)?n||(l.push([e-1,i]),n=!0):n&&(n=!1)),e{t[e.getAttribute("enter-at")]=new y(e,"",[],r,{})})),t},this.addSubSlips=function(){return this.queryAll("slip-slip[enter-at]").forEach((t=>{this.setNthAction(t.getAttribute("enter-at"),new y(t,"",[],r,{}))})),[]};let l=a;this.setAction=t=>{l=t},this.getActionList=()=>{let t=[];for(let e=0;e<=this.getMaxNext();e++)this.pauseSlipList[e]instanceof y?t[e]=this.pauseSlipList[e]:"function"==typeof l[e]||l[e]instanceof y?t[e]=l[e]:t[e]=()=>{};return t},this.setNthAction=(t,e)=>{l[t]=e},this.getCurrentSubSlip=()=>l[this.getActionIndex()]instanceof y?l[this.getActionIndex()]:this.pauseSlipList[this.getActionIndex()]instanceof y&&this.pauseSlipList[this.getActionIndex()],this.nextStageNeedGoto=()=>!(l[this.getActionIndex()+1]instanceof y)&&(!(this.pauseSlipList[this.getActionIndex()+1]instanceof y)&&!(this.getActionIndex()>=this.getMaxNext())),this.getSubSlipList=function(){return this.getActionList().filter((t=>t instanceof y))};let h=-1;this.setActionIndex=t=>h=t,this.getActionIndex=()=>h,this.getMaxNext=()=>{if(this.maxNext)return this.maxNext;let t=l.length;["mk-visible-at","mk-hidden-at","mk-emphasize-at","mk-unemphasize-at","emphasize-at","chg-visib-at","up-at","down-at","center-at","static-at","exec-at","enter-at","focus-at","unfocus-at","figure-next-at","figure-previous-at"].forEach((e=>{this.queryAll("*["+e+"]").forEach((i=>{i.getAttribute(e).split(" ").forEach((e=>{t=Math.max(Math.abs(parseInt(e)),t)}))}))}));let e=this.queryAll("[pause], [step], [auto-enter], [immediate-enter]").map((t=>t.hasAttribute("pause")&&""!=t.getAttribute("pause")?parseInt(t.getAttribute("pause")):t.hasAttribute("step")&&""!=t.getAttribute("step")?parseInt(t.getAttribute("step")):1));return t=Math.max(t,e.reduce(((t,e)=>t+e),0)),this.maxNext=t,t},this.queryAll=t=>i(this.element,t),this.query=t=>"string"!=typeof t?t:this.queryAll(t)[0],this.findSubslipByID=t=>{let e=this.getSubSlipList().find((e=>e.name==t?1:e.findSubslipByID(t)));return!!e&&(e.name==t?e:e.findSubslipByID(t))},this.findSlipCoordinate=()=>{let t=c.getCoordinateInUniverse(this.element);return t.scale*=this.scale,t.y=t.y+.5*t.scale,t.x=t.centerX,t},this.updatePauseAncestors=()=>{this.queryAll(".pauseAncestor").forEach((t=>{t.classList.remove("pauseAncestor")}));let t=this.query("[pause]");for(;t&&"SLIP-SLIP"!=t.tagName;)t.classList.add("pauseAncestor"),t=t.parentElement},this.unpause=t=>{if(t.hasAttribute("static-at-unpause")&&(""==t.getAttribute("static-at-unpause")?this.makeStatic(t):t.getAttribute("static-at-unpause").split(" ").map((t=>{this.makeStatic("#"+t)}))),t.hasAttribute("unstatic-at-unpause")&&(""==t.getAttribute("unstatic-at-unpause")?this.makeUnStatic(t):t.getAttribute("unstatic-at-unpause").split(" ").map((t=>{this.makeUnStatic("#"+t)}))),t.hasAttribute("down-at-unpause")&&(""==t.getAttribute("down-at-unpause")?this.moveDownTo(t,1):this.moveDownTo("#"+t.getAttribute("down-at-unpause"),1)),t.hasAttribute("up-at-unpause")&&(""==t.getAttribute("up-at-unpause")?this.moveUpTo(t,1):this.moveUpTo("#"+t.getAttribute("up-at-unpause"),1)),t.hasAttribute("center-at-unpause")&&(""==t.getAttribute("center-at-unpause")?this.moveCenterTo(t,1):this.moveCenterTo("#"+t.getAttribute("center-at-unpause"),1)),t.hasAttribute("exec-at-unpause")&&(""==t.getAttribute("exec-at-unpause")?this.executeScript(t):t.getAttribute("exec-at-unpause").split(" ").map((t=>{this.executeScript("#"+t)}))),t.hasAttribute("reveal-at-unpause")&&(""==t.getAttribute("reveal-at-unpause")?this.reveal(t):t.getAttribute("reveal-at-unpause").split(" ").map((t=>{this.reveal("#"+t)}))),t.hasAttribute("hide-at-unpause")&&(""==t.getAttribute("hide-at-unpause")?this.hide(t):t.getAttribute("hide-at-unpause").split(" ").map((t=>{this.hide("#"+t)}))),t.hasAttribute("figure-set-at-unpause")){let[e,i]=t.getAttribute("figure-set-at-unpause").split(" ");this.query("#"+e).figureStep=i}t.hasAttribute("figure-next-at-unpause")&&t.getAttribute("figure-next-at-unpause").split(" ").map((t=>{this.query("#"+t).figureStep++})),t.hasAttribute("figure-previous-at-unpause")&&t.getAttribute("figure-previous-at-unpause").split(" ").map((t=>{this.query("#"+t).figureStep--})),t.hasAttribute("focus-at-unpause")&&(""==t.getAttribute("focus-at-unpause")?this.focus(t):this.focus("#"+t.getAttribute("focus-at-unpause"))),t.hasAttribute("emph-at-unpause")&&(""==t.getAttribute("emph-at-unpause")?this.makeEmph(t):t.getAttribute("emph-at-unpause").split(" ").map((t=>{this.makeEmph("#"+t)}))),t.hasAttribute("unemph-at-unpause")&&(""==t.getAttribute("unemph-at-unpause")?this.makeUnEmph(t):t.getAttribute("unemph-at-unpause").split(" ").map((t=>{this.makeUnEmph("#"+t)}))),t.hasAttribute("unfocus-at-unpause")&&(""==t.getAttribute("unfocus-at-unpause")?this.unfocus(t):this.unfocus("#"+t.getAttribute("unfocus-at-unpause")))},this.incrPause=()=>{let t=this.query('[pause], [auto-enter]:not([auto-enter="0"]), [immediate-enter]:not([immediate-enter="0"]), [step]');if(t){if(t.hasAttribute("step")){t.getAttribute("step")||t.setAttribute("step",1);let e=t.getAttribute("step");e<=1?(t.removeAttribute("step"),this.unpause(t)):t.setAttribute("step",e-1)}if(t.hasAttribute("auto-enter")&&(t.setAttribute("auto-enter",0),this.unpause(t)),t.hasAttribute("immediate-enter")&&(t.setAttribute("immediate-enter",0),this.unpause(t)),t.hasAttribute("pause")){t.getAttribute("pause")||t.setAttribute("pause",1);let e=t.getAttribute("pause");e<=1?(t.removeAttribute("pause"),this.unpause(t)):t.setAttribute("pause",e-1),this.updatePauseAncestors()}}},this.doAttributes=()=>{this.queryAll("*[mk-hidden-at]").forEach((t=>{t.getAttribute("mk-hidden-at").split(" ").map((t=>parseInt(t))).includes(h)&&(t.style.opacity="0")})),this.queryAll("*[mk-visible-at]").forEach((t=>{t.getAttribute("mk-visible-at").split(" ").map((t=>parseInt(t))).includes(h)&&(t.style.opacity="1")})),this.queryAll("*[mk-emphasize-at]").forEach((t=>{t.getAttribute("mk-emphasize-at").split(" ").map((t=>parseInt(t))).includes(h)&&t.classList.add("emphasize")})),this.queryAll("*[mk-unemphasize-at]").forEach((t=>{t.getAttribute("mk-unemphasize-at").split(" ").map((t=>parseInt(t))).includes(h)&&t.classList.remove("emphasize")})),this.queryAll("*[emphasize-at]").forEach((t=>{t.getAttribute("emphasize-at").split(" ").map((t=>parseInt(t))).includes(h)?t.classList.add("emphasize"):t.classList.remove("emphasize")})),this.queryAll("*[chg-visib-at]").forEach((t=>{let e=t.getAttribute("chg-visib-at").split(" ").map((t=>parseInt(t)));e.includes(h)&&(t.style.opacity="1"),e.includes(-h)&&(t.style.opacity="0")})),this.queryAll("*[static-at]").forEach((t=>{let e=t.getAttribute("static-at").split(" ").map((t=>parseInt(t)));h<0||(e.includes(-h)?this.makeUnStatic(t):e.includes(h)&&this.makeStatic(t))})),this.queryAll("*[down-at]").forEach((t=>{t.getAttribute("down-at").split(" ").map((t=>parseInt(t))).includes(h)&&this.moveDownTo(t,1)})),this.queryAll("*[up-at]").forEach((t=>{t.getAttribute("up-at").split(" ").map((t=>parseInt(t))).includes(h)&&this.moveUpTo(t,1)})),this.queryAll("*[center-at]").forEach((t=>{t.getAttribute("center-at").split(" ").map((t=>parseInt(t))).includes(h)&&this.moveCenterTo(t,1)})),this.queryAll("*[focus-at]").forEach((t=>{t.getAttribute("focus-at").split(" ").map((t=>parseInt(t))).includes(h)&&this.focus(t,1)})),this.queryAll("*[unfocus-at]").forEach((t=>{t.getAttribute("unfocus-at").split(" ").map((t=>parseInt(t))).includes(h)&&this.unfocus(t,1)})),this.queryAll("*[exec-at]").forEach((t=>{t.getAttribute("exec-at").split(" ").map((t=>parseInt(t))).includes(h)&&this.executeScript(t)})),this.queryAll("*[figure-next-at]").forEach((t=>{t.getAttribute("figure-next-at").split(" ").map((t=>parseInt(t))).includes(h)&&t.figureStep++})),this.queryAll("*[figure-previous-at]").forEach((t=>{t.getAttribute("figure-previous-at").split(" ").map((t=>parseInt(t))).includes(h)&&t.figureStep--}))},this.incrIndex=()=>{h+=1,this.doAttributes(),h>0&&this.incrPause(),this.updateToC()},this.next=function(){return!(h>=this.getMaxNext())&&(this.incrIndex(),"function"==typeof l[h]&&l[h](this),l[h]instanceof y?l[h]:!(this.pauseSlipList[h]instanceof y)||this.pauseSlipList[h])},this.previous=()=>{let t=this.getActionIndex();this.currentDelay,this.getEngine().setDoNotMove(!0);let e,i=this.element.className;if(this.doRefresh(),this.element.className=i,-1==t)return!1;for(;this.getActionIndex(){this.getEngine().setDoNotMove(!1)}),0),e},this.setTocElem=t=>{this.tocElem=t},this.updateToC=()=>{if(!this.tocElem)return;let t;for(this.ToCList||(this.ToCList=i(this.tocElem,"li","li")),t=0;t{this.updateToC(),o.firstVisit&&o.firstVisit(this)},this.init=()=>{this.queryAll("*[chg-visib-at]").forEach((t=>{t.style.opacity="0"})),this.updatePauseAncestors(),o.init&&o.init(this)},this.refresh=()=>{l[h]instanceof y?l[h].refresh():this.doRefresh()},this.refreshAll=()=>{l.filter((t=>t instanceof y)).forEach((t=>{t.refreshAll()})),this.pauseSlipList.filter((t=>t instanceof y)).forEach((t=>{t.refreshAll()})),this.doRefresh()},this.doRefresh=()=>{this.setActionIndex(-1);let t=i(this.element,"slip-slip"),e=d.cloneNode(!0);n(e,t,this.sketchpadCanvas,this.sketchpadCanvasHighlight),this.element.replaceWith(e),this.element=e,this.init(),this.firstVisit(),delete this.currentX,delete this.currentY,delete this.currentDelay,this.getEngine().gotoSlip(this),setTimeout((()=>{this.reObserve()}),0)},this.reObserve=()=>{let t=this.element.firstChild;t&&t.classList&&t.classList.contains("slip-scale-container")&&this.resizeObserver.observe(t),this.getSubSlipList().forEach((t=>{t.reObserve()}))},this.makeUnStatic=(t,e,i)=>{let s=this.query(t);s.style.position="absolute",s.style.visibility="hidden"},this.makeStatic=t=>{let e=this.query(t);e.style.position="static",e.style.visibility="visible"},this.makeEmph=t=>{this.query(t).classList.add("emphasize")},this.makeUnEmph=t=>{this.query(t).classList.remove("emphasize")},this.unfocus=t=>{this.getEngine().gotoSlip(this,{delay:1})},this.focus=t=>{let e=this.query(t);this.getEngine().moveToElement(e,{})},this.executeScript=t=>{let e;e="string"==typeof t?this.query(t):t,new Function("slip",e.innerHTML)(this)},this.moveUpTo=(t,e,i)=>{setTimeout((()=>{let s;s="string"==typeof t?this.query(t):t,void 0===i&&(i=.0125);let n=this.findSlipCoordinate(),a=(s.offsetTop/1080-i)*n.scale;this.moveWindow(n.x,n.y+a,n.scale,this.rotate,e)}),0)},this.moveDownTo=(t,e,i)=>{setTimeout((()=>{let s;s="string"==typeof t?this.query(t):t,void 0===i&&(i=.0125);let n=this.findSlipCoordinate(),a=((s.offsetTop+s.offsetHeight)/1080-1+i)*n.scale;this.moveWindow(n.x,n.y+a,n.scale,this.rotate,e)}),0)},this.moveCenterTo=(t,e,i)=>{setTimeout((()=>{let s;s="string"==typeof t?this.query(t):t,void 0===i&&(i=0);let n=this.findSlipCoordinate(),a=((s.offsetTop+s.offsetHeight/2)/1080-.5+i)*n.scale;this.moveWindow(n.x,n.y+a,n.scale,this.rotate,e)}),0)},this.restoreWindow=()=>{this.getEngine},this.moveWindow=(t,e,i,s,n)=>{this.currentX=t,this.currentY=e,this.currentScale=i,this.currentDelay=n,this.getEngine().moveWindow(t,e,i,s,n)},this.reveal=t=>{let e;e="string"==typeof t?this.query(t):t,e.style.opacity="1"},this.revealAll=t=>{this.queryAll(t).forEach((t=>{t.style.opacity="1"}))},this.hide=t=>{this.query(t).style.opacity="0"},this.hideAll=t=>{this.queryAll(t).forEach((t=>{t.style.opacity="0"}))},this.tool="no-tool",this.getTool=t=>this.tool,this.setTool=t=>{if("clear-all"==t)return this.sketchpad.clear(),void this.sketchpadHighlight.clear();this.tool=t,this.element.classList.remove("drawing","highlighting"),"highlighting"==t?(this.element.classList.add("highlighting"),this.sketchpadHighlight.mode="draw"):"highlighting-erase"==t?(this.element.classList.add("highlighting"),this.sketchpadHighlight.mode="erase"):"drawing"==t?(this.element.classList.add("drawing"),this.sketchpad.mode="draw",this.sketchpad.weight=1):"drawing-erase"==t&&(this.element.classList.add("drawing"),this.sketchpad.weight=20,this.sketchpad.mode="erase")},this.color="blue",this.colorHighlight="yellow",this.getColor=()=>["highlighting","highlighting-erase"].includes(this.getTool())?this.colorHighlight:["drawing","drawing-erase"].includes(this.getTool())?this.color:"no-color",this.setColor=t=>{switch(this.getTool()){case"highlighting":case"highlighting-erase":this.colorHighlight=t,this.sketchpadHighlight.color=t;break;case"drawing":case"drawing-erase":this.color=t,this.sketchpad.color=t}},this.lineWidth="medium",this.lineWidthErase="medium",this.lineWidthHighlight="medium",this.getLineWidth=()=>["highlighting","highlighting-erase"].includes(this.getTool())?this.lineWidthHighlight:["drawing"].includes(this.getTool())?this.lineWidth:["drawing-erase"].includes(this.getTool())?this.lineWidthErase:"no-line-width",this.setLineWidth=t=>{if(["highlighting","highlighting-erase"].includes(this.getTool()))switch(this.lineWidthHighlight=t,t){case"small":this.sketchpadHighlight.weight=10;break;case"medium":this.sketchpadHighlight.weight=30;break;case"large":this.sketchpadHighlight.weight=90}else if(["drawing"].includes(this.getTool()))switch(this.lineWidth=t,t){case"small":this.sketchpad.weight=.25;break;case"medium":this.sketchpad.weight=1;break;case"large":this.sketchpad.weight=5}else if(["drawing-erase"].includes(this.getTool()))switch(this.lineWidthErase=t,t){case"small":this.sketchpad.weight=5;break;case"medium":this.sketchpad.weight=20;break;case"large":this.sketchpad.weight=80}};let c=r;this.getEngine=()=>c,this.setEngine=t=>c=t,this.element="string"==typeof t?document.querySelector("#"==t[0]?t:"#"+t):t,this.scale=parseFloat(this.element.getAttribute("scale")),(void 0===this.scale||isNaN(this.scale))&&(this.scale=1),this.rotate=parseFloat(this.element.getAttribute("rotate"))||0,this.delay=isNaN(parseFloat(this.element.getAttribute("delay")))?0:parseFloat(this.element.getAttribute("delay"));var u=this;let d,p=this.element;this.reloadCanvas=()=>{var t=this;let e=this.element;setTimeout((function(){let i=e.firstChild,s=document.createElement("canvas");s.classList.add("sketchpad","drawing"),s.style.opacity="1",t.sketchpadCanvas=s;let n=t.queryAll(".sketchpad");n[0].replaceWith(s);let a=new v(s);a.smoothing=.2,a.color="blue",t.sketchpad=a;let r=document.createElement("canvas");r.classList.add("sketchpad","sketchpad-highlighting"),r.style.opacity="0.5",t.sketchpadCanvasHighlight=r,n[1].replaceWith(r),t.sketchpadHighlight=new v(r),t.sketchpadHighlight.color="yellow",t.sketchpadHighlight.weight=30,t.sketchpadHighlight.smoothing=.2,t.resizeObserver=new ResizeObserver((e=>{s.height=t.element.firstChild.offsetHeight/t.scale,s.width=t.element.firstChild.offsetWidth/t.scale,r.height=t.element.firstChild.offsetHeight/t.scale,r.width=t.element.firstChild.offsetWidth/t.scale,t.sketchpad.smoothing=.2,t.sketchpad.color="blue",t.sketchpadHighlight.color="yellow",t.sketchpadHighlight.weight=30,t.sketchpadHighlight.smoothing=.2})),i&&i.classList&&i.classList.contains("slip-scale-container")&&t.resizeObserver.observe(i)}),0)},setTimeout((function(){let t=document.createElement("canvas");t.classList.add("sketchpad","drawing"),u.sketchpadCanvas=t,p&&p.firstChild&&p.firstChild.firstChild?p.firstChild.firstChild.appendChild(t):p.appendChild(t);let e=document.createElement("canvas");e.classList.add("sketchpad","sketchpad-highlighting"),u.sketchpadCanvasHighlight=e,p&&p.firstChild&&p.firstChild.firstChild?p.firstChild.firstChild.appendChild(e):p.appendChild(e),setTimeout((function(){u.reloadCanvas()}),0)}),0),this.name="string"==typeof t?t:t.id,"string"==typeof e?this.fullName=e:this.element.hasAttribute("toc-title")?this.fullName=this.element.getAttribute("toc-title"):this.fullName=this.name,"undefined"!=typeof MathJax?MathJax.startup.promise.then((()=>{setTimeout((()=>{d=s(this.element)}),0)})):setTimeout((()=>{d=s(this.element)}),0),this.getCloned=()=>d,this.setCloned=t=>d=t;let g=this.findSlipCoordinate();this.x=g.x,this.y=g.y,this.init(this,c),this.addSubSlips(),this.generatePauseFlowSlipList=function(){let t=[],e=this.queryAll("[pause], [step], [auto-enter], [immediate-enter]"),i=1;return e.forEach((e=>{if(e.hasAttribute("auto-enter")&&(t[i]=new y(e,e.getAttribute("toc-title")||"",[],r,{}),i++),e.hasAttribute("immediate-enter")&&(t[i-1]=new y(e,e.getAttribute("toc-title")||"",[],r,{}),i++),e.hasAttribute("step")){if(e.hasAttribute("enter-at-unpause"))if(""!=e.getAttribute("enter-at-unpause")){let s=this.query("#"+e.getAttribute("enter-at-unpause"));t[i]=new y(s,s.getAttribute("toc-title")||"",[],r,{})}else t[i+(parseInt(e.getAttribute("step"))||1)-1]=new y(e,e.getAttribute("toc-title")||"",[],r,{});i+=parseInt(e.getAttribute("step"))||1}if(e.hasAttribute("pause")){if(e.hasAttribute("enter-at-unpause"))if(""!=e.getAttribute("enter-at-unpause")){let s=this.query(e.getAttribute("enter-at-unpause"));t[i+(parseInt(e.getAttribute("step"))||1)-1]=new y(s,s.getAttribute("toc-title")||"",[],r,{})}else t[i+(parseInt(e.getAttribute("step"))||1)-1]=new y(e,e.getAttribute("toc-title")||"",[],r,{});i+=parseInt(e.getAttribute("pause"))||1}})),t},this.pauseSlipList=this.generatePauseFlowSlipList()}const w=function(t){"string"==typeof t?("#"!=t[0]&&(t="#"+t),t=document.querySelector(t)):void 0===t&&(t=document.querySelector("slip-slipshow")),function(t){let e=document.createElement("div");e.innerHTML='\t\n\t\n
\n\t
0
\n\t
\n
\n
\n\n
\n
\n\n
\n
\n\n
\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n
\n \x3c!--
✓
--\x3e\n
✗
\n
\n
\n\t
\n\t
\n\t\t
\n\t\t
\n\t\t\t
\n
\n\t\t
\n\t\t
\n
\n\t
\n\t
',t.replaceWith(e),e.querySelector(".placeHolder").replaceWith(t),t.querySelectorAll("slip-slip").forEach((t=>{setTimeout((()=>{var e=document.createElement("div"),i=document.createElement("div");let s;for(e.classList.add("slip-scale-container"),i.classList.add("slip-container");s=t.firstChild;)i.appendChild(s);e.appendChild(i),t.appendChild(e),setTimeout((()=>{}),0)}),0)})),t.style.width="unset",t.style.height="unset"}(t),document.body.style.cursor="auto";let e=[];document.body.addEventListener("mousemove",(t=>{e.forEach((t=>{clearTimeout(t)})),document.body.style.cursor="auto",e.push(setTimeout((()=>{document.body.style.cursor="none"}),5e3))}));let s,n,a,o,l,h,c,u,d=document.querySelector("#open-window"),p=document.querySelector("#universe"),g=p.querySelectorAll("slip-slip:not(slip-slipshow)");this.getOpenWindowHeight=()=>o,this.getOpenWindowWidth=()=>n,this.getCoord=()=>({x:l,y:h,scale:c});let m=!1;this.setDoNotMove=t=>m=t,this.getDoNotMove=t=>m;let f=!1;function v(t,e){if(1==e||e>3)return t.toString();let i,s="",n=[1e3,900,500,400,100,90,50,40,10,9,5,4,1];i=0==e?["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]:["m","cm","d","cd","c","xc","l","xl","x","ix","v","iv","i"];for(var a=0;a<=n.length;a++)for(;t%n[a]{setTimeout((()=>{f=t}),0)},this.getAlwaysMoveFast=t=>f,this.moveWindow=function(t,e,i,s,n){if(this.getDoNotMove())return;let a=n;this.getAlwaysMoveFast()&&(a="0"),c=i,u=s,l=t,h=e,setTimeout((()=>{document.querySelector(".scale-container").style.transitionDuration=a+"s",document.querySelector(".rotate-container").style.transitionDuration=a+"s",p.style.transitionDuration=a+"s, "+a+"s",setTimeout((()=>{p.style.left=-(1440*t-720)+"px",p.style.top=-(1080*e-540)+"px",document.querySelector(".scale-container").style.transform="scale("+1/i+")",document.querySelector(".rotate-container").style.transform="rotate("+s+"deg)"}),0)}),0)},this.moveWindowRelative=function(t,e,i,s,n){this.moveWindow(l+t,h+e,c+i,u+s,n)},this.placeSlip=function(t){let e=parseFloat(t.getAttribute("scale")),i=t.querySelector(".slip-scale-container");e=isNaN(e)?1:e,i.style.transform="scale("+e+")";new ResizeObserver((s=>{t.style.width=Math.max(i.offsetWidth,1440)*e+"px",t.style.height=Math.max(i.offsetHeight,1080)*e+"px"})).observe(i)},this.placeSlips=function(){let t=function(e){return 1+i(e,"slip-slip").map(t).reduce(((t,e)=>Math.max(t,e)),0)},e=t(document.body);for(let t=0;t{this.placeSlips()}),0),this.placeOpenWindow=function(){s=window.innerHeight,a=window.innerWidth,s/3
{this.placeOpenWindow(),this.moveWindow(l,h,c,u,0)})),this.countersToString=t=>{let e="";e+=v(t[0]+1,0);for(let i=1;it.getActionIndex())),e=t.join(",");window.parent!==window?this.send_stage&&window.parent.postMessage({id:this.id,kind:"state",data:e},"*"):window.history.replaceState(null,null,"#"+e),document.querySelector(".cpt-slip").innerHTML=this.countersToString(t)},this.enter=t=>{this.gotoSlip(t),this.push(t),this.next()},this.next=()=>{""==document.querySelector(".toc-slip").innerHTML&&this.showToC();let t=this.getCurrentSlip().next();if(this.updateCounter(),t instanceof y)return this.enter(t),!0;if(!t){this.pop();let t=this.getCurrentSlip();return t.nextStageNeedGoto()&&this.gotoSlip(t),A.length>1||t.getActionIndex(){let e=this.getCurrentSlip(),i=e.previous();if(i instanceof y){for(;i.getCurrentSubSlip()instanceof y;)this.push(i),i=i.getCurrentSubSlip();return this.push(i),this.gotoSlip(i,t),this.updateCounter(),!0}if(!i){this.pop();let i=this.getCurrentSlip();return A.length>1||i.getActionIndex()>-1?this.previous({delay:e.currentDelay?e.currentDelay:e.delay}):this.gotoSlip(i,t),this.updateCounter(),!0}return t&&setTimeout((()=>{this.gotoSlip(e,t)}),0),setTimeout((()=>{this.gotoSlip(e,t)}),0),this.updateCounter(),!1},this.previousSlip=function(){for(;!this.previous(););},this.getCoordinateInUniverse=function(t){let e=1,i=function(t){return"none"==t?1:parseFloat(t.split("(")[1].split(",")[0])},s=t=>{let n=(t=>({x:t.offsetLeft,y:t.offsetTop}))(t);if(!t.offsetParent)return{x:0,y:0,centerX:0,centerY:0,width:0,height:0,scale:0};if(t.offsetParent.classList.contains("universe"))return n;let a,r=s(t.offsetParent),o=window.getComputedStyle(t.offsetParent);return a=i(o.transform),e*=a,{x:r.x+n.x*e,y:r.y+n.y*e}},n=s(t),a=window.getComputedStyle(t),r=i(a.transform);return e*=r,{x:n.x/1440,y:n.y/1080,centerX:n.x/1440+.5*t.offsetWidth/1440*e,centerY:n.y/1080+.5*t.offsetHeight/1080*e,width:t.offsetWidth/1440*e,height:t.offsetHeight/1080*e,scale:e}},this.moveToElement=function(t,e){let i=this.getCoordinateInUniverse(t);t.offsetWidth,i.scale,t.offsetHeight,i.scale,e&&this.moveWindow(i.centerX,i.centerY,Math.max(i.width,i.height),0,e.delay?e.delay:1)},this.gotoSlip=function(t,e){e=e||{},"SLIP-SLIP"==t.element.tagName?setTimeout((()=>{let i=t.findSlipCoordinate();void 0!==t.currentX&&void 0!==t.currentY&&void 0!==t.currentScale?this.moveWindow(t.currentX,t.currentY,t.currentScale,t.rotate,void 0!==e.delay?e.delay:void 0!==t.currentDelay?t.currentDelay:t.delay):(t.currentX=i.x,t.currentY=i.y,t.currentDelay=t.delay,this.moveWindow(i.x,i.y,i.scale,t.rotate,void 0!==e.delay?e.delay:void 0!==t.currentDelay?t.currentDelay:t.delay))}),0):setTimeout((()=>{let i=this.getCoordinateInUniverse(t.element);this.moveWindow(i.centerX,i.centerY,Math.max(i.width,i.height),0,void 0!==e.delay?e.delay:t.delay)}),0)};let w,b=new y(t,"Presentation",[],this,{}),A=[b];this.push=function(t){this.getToC().querySelectorAll(".toc-slip .active-slip").forEach((t=>t.classList.remove("active-slip"))),t.tocElem&&t.tocElem.classList.add("active-slip"),t.element.classList.add("active-true-slip"),A.length>0&&A[A.length-1].element.classList.remove("active-true-slip"),A.push(t)},this.pop=function(){this.getToC().querySelectorAll(".toc-slip .active-slip").forEach((t=>t.classList.remove("active-slip")));let t=A.pop();return t.element.classList.remove("active-true-slip"),0==A.length&&A.push(t),A[A.length-1].element.classList.add("active-true-slip"),A[A.length-1].tocElem&&A[A.length-1].tocElem.classList.add("active-slip"),t},this.getCurrentSlip=function(){return A[A.length-1]},this.getSlipTree=function(t){return(t=t||b)instanceof y?{name:t.name,slip:t,subslips:t.getActionList().map((t=>this.getSlipTree(t)))}:{function:!0}},this.goToState=function(t){let e=t=>{if(0!=t.length)for(e(t[0]);t[1].getActionIndex(){let s=document.createElement("div"),n=document.createElement("div");if(n.innerText=t.slip.fullName,s.appendChild(n),t.subslips.length>0){let n=document.createElement("ul");t.subslips.forEach(((s,a)=>{let r=[e,t.slip,a],o=document.createElement("li");if(s.function){let t=e=>0==e.length?[]:t(e[0]).concat([e[2]]);o.innerText=this.countersToString(t(r)),o.classList.add("toc-function")}else o.appendChild(i(s,r));o.addEventListener("click",(t=>{t.target==o&&this.goToState(r)})),n.appendChild(o)})),s.appendChild(n),t.slip.setTocElem(s)}return s};t.innerHTML="",t.appendChild(i(e,[]))},this.getTool=()=>this.getCurrentSlip().getTool(),this.setTool=t=>{this.getCurrentSlip().setTool(t),this.updateToolClasses()},this.getColor=()=>this.getCurrentSlip().getColor(),this.setColor=t=>{this.getCurrentSlip().setColor(t),this.updateToolClasses()},this.setLineWidth=t=>{this.getCurrentSlip().setLineWidth(t),this.updateToolClasses()},this.getLineWidth=()=>this.getCurrentSlip().getLineWidth(),this.reloadCanvas=()=>{this.getCurrentSlip().reloadCanvas()};let S=this;this.updateToolClasses=()=>{document.querySelector(".slip-toolbar-tool").classList.remove("drawing","highlighting","drawing-erase","highlighting-erase","no-tool"),"no-tool"==this.getTool()||"cursor"==this.getTool()?document.querySelector(".slip-writing-toolbar").classList.remove("active"):document.querySelector(".slip-writing-toolbar").classList.add("active"),document.querySelector(".slip-toolbar-tool").classList.add(this.getTool()),document.querySelector(".slip-toolbar-color").classList.remove("black","blue","red","green","yellow"),document.querySelector(".slip-toolbar-color").classList.add(this.getColor()),document.querySelector(".slip-toolbar-width").classList.remove("small","medium","large"),document.querySelector(".slip-toolbar-width").classList.add(this.getLineWidth())},setTimeout((function(){document.querySelector(".slip-toolbar-pen").addEventListener("click",(function(t){S.setTool("drawing")})),document.querySelector(".slip-toolbar-cursor").addEventListener("click",(function(t){S.setTool("no-tool")})),document.querySelector(".slip-toolbar-eraser").addEventListener("click",(function(t){switch(S.getTool()){case"drawing-erase":S.setTool("drawing");break;case"highlighting":S.setTool("highlighting-erase");break;case"highlighting-erase":S.setTool("highlighting");break;case"no-tool":S.setTool("no-tool");break;case"drawing":S.setTool("drawing-erase")}})),document.querySelector(".slip-toolbar-highlighter").addEventListener("click",(function(t){S.setTool("highlighting")})),document.querySelector(".slip-toolbar-black").addEventListener("click",(function(t){S.setColor("black")})),document.querySelector(".slip-toolbar-blue").addEventListener("click",(function(t){S.setColor("blue")})),document.querySelector(".slip-toolbar-red").addEventListener("click",(function(t){S.setColor("red")})),document.querySelector(".slip-toolbar-green").addEventListener("click",(function(t){S.setColor("green")})),document.querySelector(".slip-toolbar-yellow").addEventListener("click",(function(t){S.setColor("yellow")})),document.querySelector(".slip-toolbar-small").addEventListener("click",(function(t){S.setLineWidth("small")})),document.querySelector(".slip-toolbar-medium").addEventListener("click",(function(t){S.setLineWidth("medium")})),document.querySelector(".slip-toolbar-large").addEventListener("click",(function(t){S.setLineWidth("large")})),document.querySelector(".slip-toolbar-clear").addEventListener("click",(function(t){S.setTool("clear-all")}))}),0),this.setRootSlip=t=>{b=t,A=[b]},this.getRootSlip=()=>b,this.send_stage=!1,this.start=async(t,e)=>{if(this.id=e,A=[b],window.location.hash||t){let e;e=window.location.hash?window.location.hash.slice(1).split(",").map((t=>parseInt(t))):t,this.setAlwaysMoveFast(!0),console.log("alwaysMoveFast",this.getAlwaysMoveFast());let i=()=>new Promise((function(t){setTimeout(t,0)})),s=-1,n=0,a=1,r=function(){let t=A.map((t=>t.getActionIndex())),i=s;return e.forEach(((e,r)=>{i==s&&(et[r]&&(i=n))})),i};for(;r()==n;)await i(),await this.next();this.setAlwaysMoveFast(!1)}else this.next();return this.send_stage=!0,window.parent!==window&&window.parent.postMessage({id:e,kind:"ready",data:e},"*"),this},this.restart=()=>{A=[b],b.refreshAll(),this.next()};let x=new r(this);this.getController=()=>x,window.addEventListener("message",(t=>{console.log(t),this.restart();let e=t.data.split(",").map((t=>parseInt(t)));this.setAlwaysMoveFast(!0),console.log("alwaysMoveFast",this.getAlwaysMoveFast());let i=function(){let t=A.map((t=>t.getActionIndex())),i=-1;return e.forEach(((e,s)=>{-1==i&&(et[s]&&(i=0))})),i};for(;0==i();)this.next();this.setAlwaysMoveFast(!1)}))},b=r,A=y,S=a;return t.Controller=b,t.Engine=w,t.Slip=A,t.Util=S,t.startSlipshow=async(t,e)=>{let i;return"undefined"!=typeof MathJax?MathJax.startup.promise.then((()=>(i=new w(document.querySelector("slip-slipshow")).start(t,e),Promise.resolve(i)))):(i=new w(document.querySelector("slip-slipshow")).start(t,e),Promise.resolve(i))},t}({}); +var Slipshow=function(t){"use strict";class e extends HTMLImageElement{static get observedAttributes(){return["figure-name"]}constructor(){super(),void 0===this.internalStep&&(this.internalStep=0),this.img=[],this.maxStep=0,this.figureName=this.getAttribute("figure-name"),this.promise=this.preloadImages(0).then((()=>{this.updateSRC()}))}preloadImage(t){return new Promise(((e,i)=>{this.img[t]=new Image,this.img[t].onload=()=>e(),this.img[t].onerror=i,this.img[t].src=this.getURL(t)}))}preloadImages(t){return new Promise(((e,i)=>{this.preloadImage(t).then((()=>{this.preloadImages(t+1).then((()=>{e()}))})).catch((()=>{this.maxStep=t-1,e()}))}))}connectedCallback(){}getURL(t){return"figures/"+this.figureName+"/"+this.figureName+"_"+t+".svg"}updateSRC(){this.src=this.getURL(this.figureStep)}set figureStep(t){this.promise=this.promise.then((()=>{t>this.maxStep?this.internalStep=this.maxStep:this.internalStep=t<0?0:t,this.updateSRC()}))}get figureStep(){return this.internalStep}attributeChangedCallback(t,e,i){"figure-name"==t&&(this.figureName=i,this.promise=this.promise.then((()=>{this.preloadImages(0).then((()=>{this.updateSRC()}))})))}nextFigure(){this.figuresStep++}}customElements.define("slip-figure",e,{extends:"img"});let i=(t,e,i)=>{i=i||"slip-slip",t.id||(t.id="_"+Math.random().toString(36).substr(2,15));let s=Array.from(t.querySelectorAll(e)),n=e.split(",").map((e=>"#"+t.id+" "+i+" "+e)).join(),a=Array.from(t.querySelectorAll(n));return s.filter((t=>!a.includes(t)))};function s(t){let e=t.cloneNode(!1);return t.childNodes.forEach((t=>{if(t.tagName&&"SLIP-SLIP"==t.tagName){let i=document.createElement(t.tagName);["pause","step","auto-enter","immediate-enter"].forEach((e=>{t.hasAttribute(e)&&i.setAttribute(e,t.getAttribute(e))})),i.classList.add("toReplace"),e.appendChild(i)}else if(t.tagName&&"CANVAS"==t.tagName&&t.classList.contains("sketchpad")){let i=document.createElement(t.tagName);i.classList.add("toReplaceSketchpad"),e.appendChild(i)}else e.appendChild(s(t))})),e}function n(t,e,s,n){let a=i(t,".toReplace");e.forEach(((t,e)=>{["pause","step","auto-enter","immediate-enter"].forEach((i=>{a[e].hasAttribute(i)&&t.setAttribute(i,a[e].getAttribute(i))})),a[e].replaceWith(t)}));let r=i(t,".toReplaceSketchpad");r[0]&&r[0].replaceWith(s),r[1]&&r[1].replaceWith(n)}window.myQueryAll=i;var a=Object.freeze({__proto__:null,cloneNoSubslip:s,myQueryAll:i,replaceSubslips:n});function r(t){let e=t;this.getEngine=()=>this.engine,this.setEngine=t=>this.engine=t;let i=!0;this.activate=()=>{i=!0},this.deactivate=()=>{i=!1};let s=["k"],n=["m"],a=["o"],r=["l"],o=["i"],l=["p"],h=["z"],c=["Z"],u=["T"],d=["t"],p=["ArrowRight","ArrowDown"],g=["ArrowLeft","ArrowUp"],m=["r"],f=["f"],v=[],y=["w"],w=["W"],b=["h"],A=["H"],S=["x"],x=["X"],k=["C"],L=["#"],E=1;document.addEventListener("keypress",(t=>{f.includes(t.key)&&i&&(E=(E+4)%30+1),m.includes(t.key)&&i&&e.getCurrentSlip().refresh(),y.includes(t.key)&&i&&e.setTool("drawing"),w.includes(t.key)&&i&&e.setTool("drawing-erase"),b.includes(t.key)&&i&&e.setTool("highlighting"),A.includes(t.key)&&i&&e.setTool("highlighting-erase"),S.includes(t.key)&&i&&e.setTool("no-tool"),x.includes(t.key)&&i&&e.setTool("clear-all"),k.includes(t.key)&&i&&e.reloadCanvas(),L.includes(t.key)&&i&&(document.querySelectorAll("slip-slip").forEach((t=>{t.style.zIndex="-1"})),document.querySelectorAll(".background-canvas").forEach((t=>{t.style.zIndex="1"})))})),document.addEventListener("keydown",(t=>{let m=e.getOpenWindowHeight(),f=e.getOpenWindowWidth();r.includes(t.key)&&i&&e.moveWindowRelative(0,E/m,0,0,.1),a.includes(t.key)&&i&&e.moveWindowRelative(0,-E/m,0,0,.1),s.includes(t.key)&&i&&e.moveWindowRelative(-E/f,0,0,0,.1),n.includes(t.key)&&i&&e.moveWindowRelative(E/f,0,0,0,.1),o.includes(t.key)&&i&&e.moveWindowRelative(0,0,0,1,.1),l.includes(t.key)&&i&&e.moveWindowRelative(0,0,0,-1,.1),h.includes(t.key)&&i&&e.moveWindowRelative(0,0,.01,0,.1),c.includes(t.key)&&i&&e.moveWindowRelative(0,0,-.01,0,.1),u.includes(t.key)&&i&&e.showToC(),d.includes(t.key)&&i&&(document.querySelector(".toc-slip").style.display="none"==document.querySelector(".toc-slip").style.display?"block":"none"),p.includes(t.key)&&i?t.shiftKey?e.nextSlip():e.next():g.includes(t.key)&&i?t.shiftKey?e.previousSlip():e.previous():v.includes(t.key)&&i&&e.pop()}))}class o{constructor(t,e){this.x=t,this.y=e}set(t,e){this.x=t,this.y=e}}class l extends o{constructor(){super(0,0),this.down=!1,this.previous=new o(0,0)}}class h{constructor(){this.eventListeners=new Map}addEventListener(t,e){const i=this.eventListeners.get(t)||new Set;i.add(e),this.eventListeners.set(t,i)}removeEventListener(t,e){const i=this.eventListeners.get(t);i&&i.delete(e)}dispatchEvent(t,e){const i=this.eventListeners.get(t);i&&[...i].forEach((t=>t(e)))}}const c=(t,e,i,s)=>{const n=(i-t)**2,a=(s-e)**2;return Math.sqrt(n+a)},u=(t,e,i,s,n)=>a=>{const r=t[a],o=t[a+1],l=t[a+2],h=t[a+3];return r===e&&o===i&&l===s&&h===n},d="draw",p="erase",g="fill",m="disabled",f=[d,p];class v extends h{constructor(t,e={}){if("undefined"==typeof window)throw new Error("Looks like we're not running in a browser");if(super(),t instanceof window.Node&&"CANVAS"===t.tagName)this.canvas=t;else{if("string"!=typeof t)throw new Error(`can't look for canvas based on '${t}'`);this.canvas=document.querySelector(t)}if(!this.canvas)throw new Error("canvas not found");this.canvas.width=e.width||this.canvas.width,this.canvas.height=e.height||this.canvas.height,this.mouse=new l;const i=t=>{t.cancelable&&t.preventDefault();const e=this.canvas.getBoundingClientRect(),i=t.changedTouches&&t.changedTouches[0]||t;let s=i.offsetX,n=i.offsetY;void 0===s&&(s=i.clientX-e.left),void 0===n&&(n=i.clientY-e.top);const{mouse:a}=this;if(a.down&&f.includes(this.modeInternal)){const{x:t,y:e}=this.draw(s,n,a.previous.x,a.previous.y);this.dirty||this.modeInternal!==d||s===a.x&&n===a.y||(this.dirty=!0,this.fireDirty()),a.set(s,n),a.previous.set(t,e)}else a.set(s,n)},s=t=>{if(t.cancelable&&t.preventDefault(),i(t),this.mode===g)return void this.fill();const{mouse:e}=this;e.previous.set(e.x,e.y),e.down=!0,this.beginStroke(e.previous.x,e.previous.y)},n=t=>{if(this.mode===g)return;const{mouse:e}=this;if(!e.down)return;const i=t.changedTouches&&t.changedTouches[0]||t,s=i.offsetX,n=i.offsetY;if(e.down=!1,e.x===s&&e.y===n&&f.includes(this.mode)){const{x:t,y:i}=this.draw(e.x,e.y,e.previous.x,e.previous.y);e.previous.set(t,i)}this.endStroke(e.x,e.y)};this.canvas.addEventListener("mousemove",i),this.canvas.addEventListener("mousedown",s),document.addEventListener("mouseup",n),this.canvas.addEventListener("touchstart",s),this.canvas.addEventListener("touchend",n),this.canvas.addEventListener("touchmove",i),this.destroy=()=>{this.clear(),this.canvas.removeEventListener("mousemove",i),this.canvas.removeEventListener("mousedown",s),document.removeEventListener("mouseup",n),this.canvas.removeEventListener("touchstart",s),this.canvas.removeEventListener("touchend",n),this.canvas.removeEventListener("touchmove",i)},this.context=this.canvas.getContext("2d"),this.context.globalCompositeOperation="source-over",this.context.globalAlpha=1,this.context.strokeStyle=e.color||"rgba(0,0,0,1)",this.context.lineCap="round",this.context.lineJoin="round",this.context.translate(.5,.5),this.filling=!1,this.fillStack=[],this.recordStrokes=!1,this.strokeMemory=[],this.smoothing=.85,this.thickness=2,this.targetThickness=this.thickness,this.weightInternal=this.thickness,this.maxWeight=this.thickness+10,this.modeInternal=d,this.adaptiveStroke=!0,["weight","smoothing","adaptiveStroke","mode"].forEach((t=>{void 0!==e[t]&&(this[t]=e[t])}))}beginStroke(t,e){this.context.beginPath(),this.context.moveTo(t,e),this.recordStrokes&&(this.strokeTimestamp=performance.now(),this.strokeMemory.push({point:new o(t,e),time:performance.now()-this.strokeTimestamp})),this.dispatchEvent("strokestart",{x:t,y:e})}endStroke(t,e){this.context.closePath(),this.recordStrokes&&this.strokeMemory.push({point:new o(t,e),time:performance.now()-this.strokeTimestamp}),this.dispatchEvent("strokeend",{x:t,y:e}),this.recordStrokes&&this.dispatchEvent("strokerecorded",{stroke:this.currentStroke}),this.strokeMemory=[],delete this.strokeTimestamp}draw(t,e,i,s){this.recordStrokes&&(this.strokeMemory.push({point:new o(t,e),time:performance.now()-this.strokeTimestamp}),this.dispatchEvent("pointdrawn",{stroke:this.currentStroke}));const{context:n}=this,a=c(t,e,i,s),r=Math.min(.87,this.smoothing+(a-60)/3e3),l=t-(t-i)*r,h=e-(e-s)*r,u=c(l,h,i,s);return this.adaptiveStroke?(this.targetThickness=(u-1)/49*(this.maxWeight-this.weightInternal)+this.weightInternal,this.thickness>this.targetThickness?this.thickness-=.5:this.thickness{this.floodFill(t.x,t.y,i)}),100)}}floodFill(t,e,i){const{context:s}=this,n=Math.floor(t),a=Math.floor(e),r=s.canvas.width,o=s.canvas.height,l=[[n,a]],h=(t=>{const e=t.match(/^#?([\da-f]{2})([\da-f]{2})([\da-f]{2})$/i);return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]})(this.color),c=s.getImageData(0,0,s.canvas.width,s.canvas.height),d=Math.min(10*s.globalAlpha*255,255),p=((t,e,i,s,n,a)=>{const r=u(t,...n);return n=>{t[n]=e,t[n+1]=i,t[n+2]=s,t[n+3]=a,r(n+4)||(t[n+4]=.01*t[n+4]+.99*e,t[n+4+1]=.01*t[n+4+1]+.99*i,t[n+4+2]=.01*t[n+4+2]+.99*s,t[n+4+3]=.01*t[n+4+3]+.99*a),r(n-4)||(t[n-4]=.01*t[n-4]+.99*e,t[n-4+1]=.01*t[n-4+1]+.99*i,t[n-4+2]=.01*t[n-4+2]+.99*s,t[n-4+3]=.01*t[n-4+3]+.99*a)}})(c.data,...h,i,d),g=u(c.data,...i);if(u(c.data,...h,255)(4*(a*s.canvas.width+n)))return this.filling=!1,void this.dispatchEvent("fillend",{});for(;l.length;){const t=l.pop(),e=t[0];let i=t[1],s=4*(i*r+e);for(;i-- >=0&&g(s);)s-=4*r;s+=4*r,++i;let n=!1,a=!1;for(;i++0&&(g(s-4)?n||(l.push([e-1,i]),n=!0):n&&(n=!1)),e{t[e.getAttribute("enter-at")]=new y(e,"",[],r,{})})),t},this.addSubSlips=function(){return this.queryAll("slip-slip[enter-at]").forEach((t=>{this.setNthAction(t.getAttribute("enter-at"),new y(t,"",[],r,{}))})),[]};let l=a;this.setAction=t=>{l=t},this.getActionList=()=>{let t=[];for(let e=0;e<=this.getMaxNext();e++)this.pauseSlipList[e]instanceof y?t[e]=this.pauseSlipList[e]:"function"==typeof l[e]||l[e]instanceof y?t[e]=l[e]:t[e]=()=>{};return t},this.setNthAction=(t,e)=>{l[t]=e},this.getCurrentSubSlip=()=>l[this.getActionIndex()]instanceof y?l[this.getActionIndex()]:this.pauseSlipList[this.getActionIndex()]instanceof y&&this.pauseSlipList[this.getActionIndex()],this.nextStageNeedGoto=()=>!(l[this.getActionIndex()+1]instanceof y)&&(!(this.pauseSlipList[this.getActionIndex()+1]instanceof y)&&!(this.getActionIndex()>=this.getMaxNext())),this.getSubSlipList=function(){return this.getActionList().filter((t=>t instanceof y))};let h=-1;this.setActionIndex=t=>h=t,this.getActionIndex=()=>h,this.getMaxNext=()=>{if(this.maxNext)return this.maxNext;let t=l.length;["mk-visible-at","mk-hidden-at","mk-emphasize-at","mk-unemphasize-at","emphasize-at","chg-visib-at","up-at","down-at","center-at","static-at","exec-at","enter-at","focus-at","unfocus-at","figure-next-at","figure-previous-at"].forEach((e=>{this.queryAll("*["+e+"]").forEach((i=>{i.getAttribute(e).split(" ").forEach((e=>{t=Math.max(Math.abs(parseInt(e)),t)}))}))}));let e=this.queryAll("[pause], [step], [auto-enter], [immediate-enter]").map((t=>t.hasAttribute("pause")&&""!=t.getAttribute("pause")?parseInt(t.getAttribute("pause")):t.hasAttribute("step")&&""!=t.getAttribute("step")?parseInt(t.getAttribute("step")):1));return t=Math.max(t,e.reduce(((t,e)=>t+e),0)),this.maxNext=t,t},this.queryAll=t=>i(this.element,t),this.query=t=>"string"!=typeof t?t:this.queryAll(t)[0],this.findSubslipByID=t=>{let e=this.getSubSlipList().find((e=>e.name==t?1:e.findSubslipByID(t)));return!!e&&(e.name==t?e:e.findSubslipByID(t))},this.findSlipCoordinate=()=>{let t=c.getCoordinateInUniverse(this.element);return t.scale*=this.scale,t.y=t.y+.5*t.scale,t.x=t.centerX,t},this.updatePauseAncestors=()=>{this.queryAll(".pauseAncestor").forEach((t=>{t.classList.remove("pauseAncestor")}));let t=this.query("[pause]");for(;t&&"SLIP-SLIP"!=t.tagName;)t.classList.add("pauseAncestor"),t=t.parentElement},this.unpause=t=>{if(t.hasAttribute("static-at-unpause")&&(""==t.getAttribute("static-at-unpause")?this.makeStatic(t):t.getAttribute("static-at-unpause").split(" ").map((t=>{this.makeStatic("#"+t)}))),t.hasAttribute("unstatic-at-unpause")&&(""==t.getAttribute("unstatic-at-unpause")?this.makeUnStatic(t):t.getAttribute("unstatic-at-unpause").split(" ").map((t=>{this.makeUnStatic("#"+t)}))),t.hasAttribute("down-at-unpause")&&(""==t.getAttribute("down-at-unpause")?this.moveDownTo(t,1):this.moveDownTo("#"+t.getAttribute("down-at-unpause"),1)),t.hasAttribute("up-at-unpause")&&(""==t.getAttribute("up-at-unpause")?this.moveUpTo(t,1):this.moveUpTo("#"+t.getAttribute("up-at-unpause"),1)),t.hasAttribute("center-at-unpause")&&(""==t.getAttribute("center-at-unpause")?this.moveCenterTo(t,1):this.moveCenterTo("#"+t.getAttribute("center-at-unpause"),1)),t.hasAttribute("exec-at-unpause")&&(""==t.getAttribute("exec-at-unpause")?this.executeScript(t):t.getAttribute("exec-at-unpause").split(" ").map((t=>{this.executeScript("#"+t)}))),t.hasAttribute("reveal-at-unpause")&&(""==t.getAttribute("reveal-at-unpause")?this.reveal(t):t.getAttribute("reveal-at-unpause").split(" ").map((t=>{this.reveal("#"+t)}))),t.hasAttribute("hide-at-unpause")&&(""==t.getAttribute("hide-at-unpause")?this.hide(t):t.getAttribute("hide-at-unpause").split(" ").map((t=>{this.hide("#"+t)}))),t.hasAttribute("figure-set-at-unpause")){let[e,i]=t.getAttribute("figure-set-at-unpause").split(" ");this.query("#"+e).figureStep=i}t.hasAttribute("figure-next-at-unpause")&&t.getAttribute("figure-next-at-unpause").split(" ").map((t=>{this.query("#"+t).figureStep++})),t.hasAttribute("figure-previous-at-unpause")&&t.getAttribute("figure-previous-at-unpause").split(" ").map((t=>{this.query("#"+t).figureStep--})),t.hasAttribute("focus-at-unpause")&&(""==t.getAttribute("focus-at-unpause")?this.focus(t):this.focus("#"+t.getAttribute("focus-at-unpause"))),t.hasAttribute("emph-at-unpause")&&(""==t.getAttribute("emph-at-unpause")?this.makeEmph(t):t.getAttribute("emph-at-unpause").split(" ").map((t=>{this.makeEmph("#"+t)}))),t.hasAttribute("unemph-at-unpause")&&(""==t.getAttribute("unemph-at-unpause")?this.makeUnEmph(t):t.getAttribute("unemph-at-unpause").split(" ").map((t=>{this.makeUnEmph("#"+t)}))),t.hasAttribute("unfocus-at-unpause")&&(""==t.getAttribute("unfocus-at-unpause")?this.unfocus(t):this.unfocus("#"+t.getAttribute("unfocus-at-unpause")))},this.incrPause=()=>{let t=this.query('[pause], [auto-enter]:not([auto-enter="0"]), [immediate-enter]:not([immediate-enter="0"]), [step]');if(t){if(t.hasAttribute("step")){t.getAttribute("step")||t.setAttribute("step",1);let e=t.getAttribute("step");e<=1?(t.removeAttribute("step"),this.unpause(t)):t.setAttribute("step",e-1)}if(t.hasAttribute("auto-enter")&&(t.setAttribute("auto-enter",0),this.unpause(t)),t.hasAttribute("immediate-enter")&&(t.setAttribute("immediate-enter",0),this.unpause(t)),t.hasAttribute("pause")){t.getAttribute("pause")||t.setAttribute("pause",1);let e=t.getAttribute("pause");e<=1?(t.removeAttribute("pause"),this.unpause(t)):t.setAttribute("pause",e-1),this.updatePauseAncestors()}}},this.doAttributes=()=>{this.queryAll("*[mk-hidden-at]").forEach((t=>{t.getAttribute("mk-hidden-at").split(" ").map((t=>parseInt(t))).includes(h)&&(t.style.opacity="0")})),this.queryAll("*[mk-visible-at]").forEach((t=>{t.getAttribute("mk-visible-at").split(" ").map((t=>parseInt(t))).includes(h)&&(t.style.opacity="1")})),this.queryAll("*[mk-emphasize-at]").forEach((t=>{t.getAttribute("mk-emphasize-at").split(" ").map((t=>parseInt(t))).includes(h)&&t.classList.add("emphasize")})),this.queryAll("*[mk-unemphasize-at]").forEach((t=>{t.getAttribute("mk-unemphasize-at").split(" ").map((t=>parseInt(t))).includes(h)&&t.classList.remove("emphasize")})),this.queryAll("*[emphasize-at]").forEach((t=>{t.getAttribute("emphasize-at").split(" ").map((t=>parseInt(t))).includes(h)?t.classList.add("emphasize"):t.classList.remove("emphasize")})),this.queryAll("*[chg-visib-at]").forEach((t=>{let e=t.getAttribute("chg-visib-at").split(" ").map((t=>parseInt(t)));e.includes(h)&&(t.style.opacity="1"),e.includes(-h)&&(t.style.opacity="0")})),this.queryAll("*[static-at]").forEach((t=>{let e=t.getAttribute("static-at").split(" ").map((t=>parseInt(t)));h<0||(e.includes(-h)?this.makeUnStatic(t):e.includes(h)&&this.makeStatic(t))})),this.queryAll("*[down-at]").forEach((t=>{t.getAttribute("down-at").split(" ").map((t=>parseInt(t))).includes(h)&&this.moveDownTo(t,1)})),this.queryAll("*[up-at]").forEach((t=>{t.getAttribute("up-at").split(" ").map((t=>parseInt(t))).includes(h)&&this.moveUpTo(t,1)})),this.queryAll("*[center-at]").forEach((t=>{t.getAttribute("center-at").split(" ").map((t=>parseInt(t))).includes(h)&&this.moveCenterTo(t,1)})),this.queryAll("*[focus-at]").forEach((t=>{t.getAttribute("focus-at").split(" ").map((t=>parseInt(t))).includes(h)&&this.focus(t,1)})),this.queryAll("*[unfocus-at]").forEach((t=>{t.getAttribute("unfocus-at").split(" ").map((t=>parseInt(t))).includes(h)&&this.unfocus(t,1)})),this.queryAll("*[exec-at]").forEach((t=>{t.getAttribute("exec-at").split(" ").map((t=>parseInt(t))).includes(h)&&this.executeScript(t)})),this.queryAll("*[figure-next-at]").forEach((t=>{t.getAttribute("figure-next-at").split(" ").map((t=>parseInt(t))).includes(h)&&t.figureStep++})),this.queryAll("*[figure-previous-at]").forEach((t=>{t.getAttribute("figure-previous-at").split(" ").map((t=>parseInt(t))).includes(h)&&t.figureStep--}))},this.incrIndex=()=>{h+=1,this.doAttributes(),h>0&&this.incrPause(),this.updateToC()},this.next=function(){return!(h>=this.getMaxNext())&&(this.incrIndex(),"function"==typeof l[h]&&l[h](this),l[h]instanceof y?l[h]:!(this.pauseSlipList[h]instanceof y)||this.pauseSlipList[h])},this.previous=()=>{let t=this.getActionIndex();this.currentDelay,this.getEngine().setDoNotMove(!0);let e,i=this.element.className;if(this.doRefresh(),this.element.className=i,-1==t)return!1;for(;this.getActionIndex(){this.getEngine().setDoNotMove(!1)}),0),e},this.setTocElem=t=>{this.tocElem=t},this.updateToC=()=>{if(!this.tocElem)return;let t;for(this.ToCList||(this.ToCList=i(this.tocElem,"li","li")),t=0;t{this.updateToC(),o.firstVisit&&o.firstVisit(this)},this.init=()=>{this.queryAll("*[chg-visib-at]").forEach((t=>{t.style.opacity="0"})),this.updatePauseAncestors(),o.init&&o.init(this)},this.refresh=()=>{l[h]instanceof y?l[h].refresh():this.doRefresh()},this.refreshAll=()=>{l.filter((t=>t instanceof y)).forEach((t=>{t.refreshAll()})),this.pauseSlipList.filter((t=>t instanceof y)).forEach((t=>{t.refreshAll()})),this.doRefresh()},this.doRefresh=()=>{this.setActionIndex(-1);let t=i(this.element,"slip-slip"),e=d.cloneNode(!0);n(e,t,this.sketchpadCanvas,this.sketchpadCanvasHighlight),this.element.replaceWith(e),this.element=e,this.init(),this.firstVisit(),delete this.currentX,delete this.currentY,delete this.currentDelay,this.getEngine().gotoSlip(this),setTimeout((()=>{this.reObserve()}),0)},this.reObserve=()=>{let t=this.element.firstChild;t&&t.classList&&t.classList.contains("slip-scale-container")&&this.resizeObserver.observe(t),this.getSubSlipList().forEach((t=>{t.reObserve()}))},this.makeUnStatic=(t,e,i)=>{let s=this.query(t);s.style.position="absolute",s.style.visibility="hidden"},this.makeStatic=t=>{let e=this.query(t);e.style.position="static",e.style.visibility="visible"},this.makeEmph=t=>{this.query(t).classList.add("emphasize")},this.makeUnEmph=t=>{this.query(t).classList.remove("emphasize")},this.unfocus=t=>{this.getEngine().gotoSlip(this,{delay:1})},this.focus=t=>{let e=this.query(t);this.getEngine().moveToElement(e,{})},this.executeScript=t=>{let e;e="string"==typeof t?this.query(t):t,new Function("slip",e.innerHTML)(this)},this.moveUpTo=(t,e,i)=>{setTimeout((()=>{let s;s="string"==typeof t?this.query(t):t,void 0===i&&(i=.0125);let n=this.findSlipCoordinate(),a=(s.offsetTop/1080-i)*n.scale;this.moveWindow(n.x,n.y+a,n.scale,this.rotate,e)}),0)},this.moveDownTo=(t,e,i)=>{setTimeout((()=>{let s;s="string"==typeof t?this.query(t):t,void 0===i&&(i=.0125);let n=this.findSlipCoordinate(),a=((s.offsetTop+s.offsetHeight)/1080-1+i)*n.scale;this.moveWindow(n.x,n.y+a,n.scale,this.rotate,e)}),0)},this.moveCenterTo=(t,e,i)=>{setTimeout((()=>{let s;s="string"==typeof t?this.query(t):t,void 0===i&&(i=0);let n=this.findSlipCoordinate(),a=((s.offsetTop+s.offsetHeight/2)/1080-.5+i)*n.scale;this.moveWindow(n.x,n.y+a,n.scale,this.rotate,e)}),0)},this.restoreWindow=()=>{this.getEngine},this.moveWindow=(t,e,i,s,n)=>{this.currentX=t,this.currentY=e,this.currentScale=i,this.currentDelay=n,this.getEngine().moveWindow(t,e,i,s,n)},this.reveal=t=>{let e;e="string"==typeof t?this.query(t):t,e.style.opacity="1"},this.revealAll=t=>{this.queryAll(t).forEach((t=>{t.style.opacity="1"}))},this.hide=t=>{this.query(t).style.opacity="0"},this.hideAll=t=>{this.queryAll(t).forEach((t=>{t.style.opacity="0"}))},this.tool="no-tool",this.getTool=t=>this.tool,this.setTool=t=>{if("clear-all"==t)return this.sketchpad.clear(),void this.sketchpadHighlight.clear();this.tool=t,this.element.classList.remove("drawing","highlighting"),"highlighting"==t?(this.element.classList.add("highlighting"),this.sketchpadHighlight.mode="draw"):"highlighting-erase"==t?(this.element.classList.add("highlighting"),this.sketchpadHighlight.mode="erase"):"drawing"==t?(this.element.classList.add("drawing"),this.sketchpad.mode="draw",this.sketchpad.weight=1):"drawing-erase"==t&&(this.element.classList.add("drawing"),this.sketchpad.weight=20,this.sketchpad.mode="erase")},this.color="blue",this.colorHighlight="yellow",this.getColor=()=>["highlighting","highlighting-erase"].includes(this.getTool())?this.colorHighlight:["drawing","drawing-erase"].includes(this.getTool())?this.color:"no-color",this.setColor=t=>{switch(this.getTool()){case"highlighting":case"highlighting-erase":this.colorHighlight=t,this.sketchpadHighlight.color=t;break;case"drawing":case"drawing-erase":this.color=t,this.sketchpad.color=t}},this.lineWidth="medium",this.lineWidthErase="medium",this.lineWidthHighlight="medium",this.getLineWidth=()=>["highlighting","highlighting-erase"].includes(this.getTool())?this.lineWidthHighlight:["drawing"].includes(this.getTool())?this.lineWidth:["drawing-erase"].includes(this.getTool())?this.lineWidthErase:"no-line-width",this.setLineWidth=t=>{if(["highlighting","highlighting-erase"].includes(this.getTool()))switch(this.lineWidthHighlight=t,t){case"small":this.sketchpadHighlight.weight=10;break;case"medium":this.sketchpadHighlight.weight=30;break;case"large":this.sketchpadHighlight.weight=90}else if(["drawing"].includes(this.getTool()))switch(this.lineWidth=t,t){case"small":this.sketchpad.weight=.25;break;case"medium":this.sketchpad.weight=1;break;case"large":this.sketchpad.weight=5}else if(["drawing-erase"].includes(this.getTool()))switch(this.lineWidthErase=t,t){case"small":this.sketchpad.weight=5;break;case"medium":this.sketchpad.weight=20;break;case"large":this.sketchpad.weight=80}};let c=r;this.getEngine=()=>c,this.setEngine=t=>c=t,this.element="string"==typeof t?document.querySelector("#"==t[0]?t:"#"+t):t,this.scale=parseFloat(this.element.getAttribute("scale")),(void 0===this.scale||isNaN(this.scale))&&(this.scale=1),this.rotate=parseFloat(this.element.getAttribute("rotate"))||0,this.delay=isNaN(parseFloat(this.element.getAttribute("delay")))?0:parseFloat(this.element.getAttribute("delay"));var u=this;let d,p=this.element;this.reloadCanvas=()=>{var t=this;let e=this.element;setTimeout((function(){let i=e.firstChild,s=document.createElement("canvas");s.classList.add("sketchpad","drawing"),s.style.opacity="1",t.sketchpadCanvas=s;let n=t.queryAll(".sketchpad");n[0].replaceWith(s);let a=new v(s);a.smoothing=.2,a.color="blue",t.sketchpad=a;let r=document.createElement("canvas");r.classList.add("sketchpad","sketchpad-highlighting"),r.style.opacity="0.5",t.sketchpadCanvasHighlight=r,n[1].replaceWith(r),t.sketchpadHighlight=new v(r),t.sketchpadHighlight.color="yellow",t.sketchpadHighlight.weight=30,t.sketchpadHighlight.smoothing=.2,t.resizeObserver=new ResizeObserver((e=>{s.height=t.element.firstChild.offsetHeight/t.scale,s.width=t.element.firstChild.offsetWidth/t.scale,r.height=t.element.firstChild.offsetHeight/t.scale,r.width=t.element.firstChild.offsetWidth/t.scale,t.sketchpad.smoothing=.2,t.sketchpad.color="blue",t.sketchpadHighlight.color="yellow",t.sketchpadHighlight.weight=30,t.sketchpadHighlight.smoothing=.2})),i&&i.classList&&i.classList.contains("slip-scale-container")&&t.resizeObserver.observe(i)}),0)},setTimeout((function(){let t=document.createElement("canvas");t.classList.add("sketchpad","drawing"),u.sketchpadCanvas=t,p&&p.firstChild&&p.firstChild.firstChild?p.firstChild.firstChild.appendChild(t):p.appendChild(t);let e=document.createElement("canvas");e.classList.add("sketchpad","sketchpad-highlighting"),u.sketchpadCanvasHighlight=e,p&&p.firstChild&&p.firstChild.firstChild?p.firstChild.firstChild.appendChild(e):p.appendChild(e),setTimeout((function(){u.reloadCanvas()}),0)}),0),this.name="string"==typeof t?t:t.id,"string"==typeof e?this.fullName=e:this.element.hasAttribute("toc-title")?this.fullName=this.element.getAttribute("toc-title"):this.fullName=this.name,"undefined"!=typeof MathJax?MathJax.startup.promise.then((()=>{setTimeout((()=>{d=s(this.element)}),0)})):setTimeout((()=>{d=s(this.element)}),0),this.getCloned=()=>d,this.setCloned=t=>d=t;let g=this.findSlipCoordinate();this.x=g.x,this.y=g.y,this.init(this,c),this.addSubSlips(),this.generatePauseFlowSlipList=function(){let t=[],e=this.queryAll("[pause], [step], [auto-enter], [immediate-enter]"),i=1;return e.forEach((e=>{if(e.hasAttribute("auto-enter")&&(t[i]=new y(e,e.getAttribute("toc-title")||"",[],r,{}),i++),e.hasAttribute("immediate-enter")&&(t[i-1]=new y(e,e.getAttribute("toc-title")||"",[],r,{}),i++),e.hasAttribute("step")){if(e.hasAttribute("enter-at-unpause"))if(""!=e.getAttribute("enter-at-unpause")){let s=this.query("#"+e.getAttribute("enter-at-unpause"));t[i]=new y(s,s.getAttribute("toc-title")||"",[],r,{})}else t[i+(parseInt(e.getAttribute("step"))||1)-1]=new y(e,e.getAttribute("toc-title")||"",[],r,{});i+=parseInt(e.getAttribute("step"))||1}if(e.hasAttribute("pause")){if(e.hasAttribute("enter-at-unpause"))if(""!=e.getAttribute("enter-at-unpause")){let s=this.query(e.getAttribute("enter-at-unpause"));t[i+(parseInt(e.getAttribute("step"))||1)-1]=new y(s,s.getAttribute("toc-title")||"",[],r,{})}else t[i+(parseInt(e.getAttribute("step"))||1)-1]=new y(e,e.getAttribute("toc-title")||"",[],r,{});i+=parseInt(e.getAttribute("pause"))||1}})),t},this.pauseSlipList=this.generatePauseFlowSlipList()}const w=function(t){"string"==typeof t?("#"!=t[0]&&(t="#"+t),t=document.querySelector(t)):void 0===t&&(t=document.querySelector("slip-slipshow")),function(t){let e=document.createElement("div");e.innerHTML='\t\n\t\n
\n\t
0
\n\t
\n
\n
\n\n
\n
\n\n
\n
\n\n
\n
\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n\n
\n
\n
\n
\n
\n
\n \x3c!--
✓
--\x3e\n
✗
\n
\n
\n\t
\n\t
\n\t\t
\n\t\t
\n\t\t\t
\n
\n\t\t
\n\t\t
\n
\n\t
\n\t
',t.replaceWith(e),e.querySelector(".placeHolder").replaceWith(t),t.querySelectorAll("slip-slip").forEach((t=>{setTimeout((()=>{var e=document.createElement("div"),i=document.createElement("div");let s;for(e.classList.add("slip-scale-container"),i.classList.add("slip-container");s=t.firstChild;)i.appendChild(s);e.appendChild(i),t.appendChild(e),setTimeout((()=>{}),0)}),0)})),t.style.width="unset",t.style.height="unset"}(t),document.body.style.cursor="auto";let e=[];document.body.addEventListener("mousemove",(t=>{e.forEach((t=>{clearTimeout(t)})),document.body.style.cursor="auto",e.push(setTimeout((()=>{document.body.style.cursor="none"}),5e3))}));let s,n,a,o,l,h,c,u,d=document.querySelector("#open-window"),p=document.querySelector("#universe"),g=p.querySelectorAll("slip-slip:not(slip-slipshow)");this.getOpenWindowHeight=()=>o,this.getOpenWindowWidth=()=>n,this.getCoord=()=>({x:l,y:h,scale:c});let m=!1;this.setDoNotMove=t=>m=t,this.getDoNotMove=t=>m;let f=!1;function v(t,e){if(1==e||e>3)return t.toString();let i,s="",n=[1e3,900,500,400,100,90,50,40,10,9,5,4,1];i=0==e?["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]:["m","cm","d","cd","c","xc","l","xl","x","ix","v","iv","i"];for(var a=0;a<=n.length;a++)for(;t%n[a]{setTimeout((()=>{f=t}),0)},this.getAlwaysMoveFast=t=>f,this.moveWindow=function(t,e,i,s,n){if(this.getDoNotMove())return;let a=n;this.getAlwaysMoveFast()&&(a="0"),c=i,u=s,l=t,h=e,setTimeout((()=>{document.querySelector(".scale-container").style.transitionDuration=a+"s",document.querySelector(".rotate-container").style.transitionDuration=a+"s",p.style.transitionDuration=a+"s, "+a+"s",setTimeout((()=>{p.style.left=-(1440*t-720)+"px",p.style.top=-(1080*e-540)+"px",document.querySelector(".scale-container").style.transform="scale("+1/i+")",document.querySelector(".rotate-container").style.transform="rotate("+s+"deg)"}),0)}),0)},this.moveWindowRelative=function(t,e,i,s,n){this.moveWindow(l+t,h+e,c+i,u+s,n)},this.placeSlip=function(t){let e=parseFloat(t.getAttribute("scale")),i=t.querySelector(".slip-scale-container");e=isNaN(e)?1:e,i.style.transform="scale("+e+")";new ResizeObserver((s=>{t.style.width=Math.max(i.offsetWidth,1440)*e+"px",t.style.height=Math.max(i.offsetHeight,1080)*e+"px"})).observe(i)},this.placeSlips=function(){let t=function(e){return 1+i(e,"slip-slip").map(t).reduce(((t,e)=>Math.max(t,e)),0)},e=t(document.body);for(let t=0;t{this.placeSlips()}),0),this.placeOpenWindow=function(){s=window.innerHeight,a=window.innerWidth,s/3
{this.placeOpenWindow(),this.moveWindow(l,h,c,u,0)})),this.countersToString=t=>{let e="";e+=v(t[0]+1,0);for(let i=1;it.getActionIndex())),e=t.join(",");window.parent!==window?this.send_stage&&window.parent.postMessage({id:this.id,kind:"state",data:e},"*"):window.history.replaceState(null,null,"#"+e),document.querySelector(".cpt-slip").innerHTML=this.countersToString(t)},this.enter=t=>{this.gotoSlip(t),this.push(t),this.next()},this.next=()=>{""==document.querySelector(".toc-slip").innerHTML&&this.showToC();let t=this.getCurrentSlip(),e=t.next();if(this.updateCounter(),e instanceof y)return this.enter(e),!0;if(!e){this.pop();let t=this.getCurrentSlip();return t.nextStageNeedGoto()&&this.gotoSlip(t),A.length>1||t.getActionIndex()=t.getMaxNext()&&(this.previous(),!1)},this.nextSlip=function(){for(;!this.next(););},this.previous=t=>{let e=this.getCurrentSlip(),i=e.previous();if(i instanceof y){for(;i.getCurrentSubSlip()instanceof y;)this.push(i),i=i.getCurrentSubSlip();return this.push(i),this.gotoSlip(i,t),this.updateCounter(),!0}if(!i){this.pop();let i=this.getCurrentSlip();return A.length>1||i.getActionIndex()>-1?this.previous({delay:e.currentDelay?e.currentDelay:e.delay}):this.gotoSlip(i,t),this.updateCounter(),!("SLIP-SLIPSHOW"==e.element.tagName&&e.getActionIndex()<=0)||(this.next(),!0)}return t&&setTimeout((()=>{this.gotoSlip(e,t)}),0),setTimeout((()=>{this.gotoSlip(e,t)}),0),this.updateCounter(),!1},this.previousSlip=function(){for(;!this.previous(););},this.getCoordinateInUniverse=function(t){let e=1,i=function(t){return"none"==t?1:parseFloat(t.split("(")[1].split(",")[0])},s=t=>{let n=(t=>({x:t.offsetLeft,y:t.offsetTop}))(t);if(!t.offsetParent)return{x:0,y:0,centerX:0,centerY:0,width:0,height:0,scale:0};if(t.offsetParent.classList.contains("universe"))return n;let a,r=s(t.offsetParent),o=window.getComputedStyle(t.offsetParent);return a=i(o.transform),e*=a,{x:r.x+n.x*e,y:r.y+n.y*e}},n=s(t),a=window.getComputedStyle(t),r=i(a.transform);return e*=r,{x:n.x/1440,y:n.y/1080,centerX:n.x/1440+.5*t.offsetWidth/1440*e,centerY:n.y/1080+.5*t.offsetHeight/1080*e,width:t.offsetWidth/1440*e,height:t.offsetHeight/1080*e,scale:e}},this.moveToElement=function(t,e){let i=this.getCoordinateInUniverse(t);t.offsetWidth,i.scale,t.offsetHeight,i.scale,e&&this.moveWindow(i.centerX,i.centerY,Math.max(i.width,i.height),0,e.delay?e.delay:1)},this.gotoSlip=function(t,e){e=e||{},"SLIP-SLIP"==t.element.tagName?setTimeout((()=>{let i=t.findSlipCoordinate();void 0!==t.currentX&&void 0!==t.currentY&&void 0!==t.currentScale?this.moveWindow(t.currentX,t.currentY,t.currentScale,t.rotate,void 0!==e.delay?e.delay:void 0!==t.currentDelay?t.currentDelay:t.delay):(t.currentX=i.x,t.currentY=i.y,t.currentDelay=t.delay,this.moveWindow(i.x,i.y,i.scale,t.rotate,void 0!==e.delay?e.delay:void 0!==t.currentDelay?t.currentDelay:t.delay))}),0):setTimeout((()=>{let i=this.getCoordinateInUniverse(t.element);this.moveWindow(i.centerX,i.centerY,Math.max(i.width,i.height),0,void 0!==e.delay?e.delay:t.delay)}),0)};let w,b=new y(t,"Presentation",[],this,{}),A=[b];this.push=function(t){this.getToC().querySelectorAll(".toc-slip .active-slip").forEach((t=>t.classList.remove("active-slip"))),t.tocElem&&t.tocElem.classList.add("active-slip"),t.element.classList.add("active-true-slip"),A.length>0&&A[A.length-1].element.classList.remove("active-true-slip"),A.push(t)},this.pop=function(){this.getToC().querySelectorAll(".toc-slip .active-slip").forEach((t=>t.classList.remove("active-slip")));let t=A.pop();return t.element.classList.remove("active-true-slip"),0==A.length&&A.push(t),A[A.length-1].element.classList.add("active-true-slip"),A[A.length-1].tocElem&&A[A.length-1].tocElem.classList.add("active-slip"),t},this.getCurrentSlip=function(){return A[A.length-1]},this.getSlipTree=function(t){return(t=t||b)instanceof y?{name:t.name,slip:t,subslips:t.getActionList().map((t=>this.getSlipTree(t)))}:{function:!0}},this.goToState=function(t){let e=t=>{if(0!=t.length)for(e(t[0]);t[1].getActionIndex(){let s=document.createElement("div"),n=document.createElement("div");if(n.innerText=t.slip.fullName,s.appendChild(n),t.subslips.length>0){let n=document.createElement("ul");t.subslips.forEach(((s,a)=>{let r=[e,t.slip,a],o=document.createElement("li");if(s.function){let t=e=>0==e.length?[]:t(e[0]).concat([e[2]]);o.innerText=this.countersToString(t(r)),o.classList.add("toc-function")}else o.appendChild(i(s,r));o.addEventListener("click",(t=>{t.target==o&&this.goToState(r)})),n.appendChild(o)})),s.appendChild(n),t.slip.setTocElem(s)}return s};t.innerHTML="",t.appendChild(i(e,[]))},this.getTool=()=>this.getCurrentSlip().getTool(),this.setTool=t=>{this.getCurrentSlip().setTool(t),this.updateToolClasses()},this.getColor=()=>this.getCurrentSlip().getColor(),this.setColor=t=>{this.getCurrentSlip().setColor(t),this.updateToolClasses()},this.setLineWidth=t=>{this.getCurrentSlip().setLineWidth(t),this.updateToolClasses()},this.getLineWidth=()=>this.getCurrentSlip().getLineWidth(),this.reloadCanvas=()=>{this.getCurrentSlip().reloadCanvas()};let S=this;this.updateToolClasses=()=>{document.querySelector(".slip-toolbar-tool").classList.remove("drawing","highlighting","drawing-erase","highlighting-erase","no-tool"),"no-tool"==this.getTool()||"cursor"==this.getTool()?document.querySelector(".slip-writing-toolbar").classList.remove("active"):document.querySelector(".slip-writing-toolbar").classList.add("active"),document.querySelector(".slip-toolbar-tool").classList.add(this.getTool()),document.querySelector(".slip-toolbar-color").classList.remove("black","blue","red","green","yellow"),document.querySelector(".slip-toolbar-color").classList.add(this.getColor()),document.querySelector(".slip-toolbar-width").classList.remove("small","medium","large"),document.querySelector(".slip-toolbar-width").classList.add(this.getLineWidth())},setTimeout((function(){document.querySelector(".slip-toolbar-pen").addEventListener("click",(function(t){S.setTool("drawing")})),document.querySelector(".slip-toolbar-cursor").addEventListener("click",(function(t){S.setTool("no-tool")})),document.querySelector(".slip-toolbar-eraser").addEventListener("click",(function(t){switch(S.getTool()){case"drawing-erase":S.setTool("drawing");break;case"highlighting":S.setTool("highlighting-erase");break;case"highlighting-erase":S.setTool("highlighting");break;case"no-tool":S.setTool("no-tool");break;case"drawing":S.setTool("drawing-erase")}})),document.querySelector(".slip-toolbar-highlighter").addEventListener("click",(function(t){S.setTool("highlighting")})),document.querySelector(".slip-toolbar-black").addEventListener("click",(function(t){S.setColor("black")})),document.querySelector(".slip-toolbar-blue").addEventListener("click",(function(t){S.setColor("blue")})),document.querySelector(".slip-toolbar-red").addEventListener("click",(function(t){S.setColor("red")})),document.querySelector(".slip-toolbar-green").addEventListener("click",(function(t){S.setColor("green")})),document.querySelector(".slip-toolbar-yellow").addEventListener("click",(function(t){S.setColor("yellow")})),document.querySelector(".slip-toolbar-small").addEventListener("click",(function(t){S.setLineWidth("small")})),document.querySelector(".slip-toolbar-medium").addEventListener("click",(function(t){S.setLineWidth("medium")})),document.querySelector(".slip-toolbar-large").addEventListener("click",(function(t){S.setLineWidth("large")})),document.querySelector(".slip-toolbar-clear").addEventListener("click",(function(t){S.setTool("clear-all")}))}),0),this.setRootSlip=t=>{b=t,A=[b]},this.getRootSlip=()=>b,this.send_stage=!1,this.start=async(t,e)=>{if(this.id=e,A=[b],window.location.hash||t){let e;e=window.location.hash?window.location.hash.slice(1).split(",").map((t=>parseInt(t))):t,this.setAlwaysMoveFast(!0),console.log("alwaysMoveFast",this.getAlwaysMoveFast());let i=()=>new Promise((function(t){setTimeout(t,0)})),s=-1,n=0,a=1,r=function(){let t=A.map((t=>t.getActionIndex())),i=s;return e.forEach(((e,r)=>{i==s&&(et[r]&&(i=n))})),i};for(;r()==n;)await i(),await this.next();this.setAlwaysMoveFast(!1)}else this.next();return this.send_stage=!0,window.parent!==window&&window.parent.postMessage({id:e,kind:"ready",data:e},"*"),this},this.restart=()=>{A=[b],b.refreshAll(),this.next()};let x=new r(this);this.getController=()=>x,window.addEventListener("message",(t=>{console.log(t),this.restart();let e=t.data.split(",").map((t=>parseInt(t)));this.setAlwaysMoveFast(!0),console.log("alwaysMoveFast",this.getAlwaysMoveFast());let i=function(){let t=A.map((t=>t.getActionIndex())),i=-1;return e.forEach(((e,s)=>{-1==i&&(et[s]&&(i=0))})),i};for(;0==i();)this.next();this.setAlwaysMoveFast(!1)}))},b=r,A=y,S=a;return t.Controller=b,t.Engine=w,t.Slip=A,t.Util=S,t.startSlipshow=async(t,e)=>{let i;return"undefined"!=typeof MathJax?MathJax.startup.promise.then((()=>(i=new w(document.querySelector("slip-slipshow")).start(t,e),Promise.resolve(i)))):(i=new w(document.querySelector("slip-slipshow")).start(t,e),Promise.resolve(i))},t}({}); //# sourceMappingURL=slipshow.cdn.min.js.map diff --git a/example/slipIntroduction.html b/example/slipIntroduction.html index faa049f..7a759b4 100644 --- a/example/slipIntroduction.html +++ b/example/slipIntroduction.html @@ -35,7 +35,7 @@ Slip.js