extwee 1.6.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +25 -0
- package/.github/workflows/nodejs.yml +24 -25
- package/.travis.yml +13 -13
- package/CODE_OF_CONDUCT.md +82 -0
- package/LICENSE +21 -21
- package/README.md +36 -205
- package/SECURITY.md +12 -0
- package/babel.config.json +22 -0
- package/bin/extwee.js +49 -0
- package/index.js +31 -26
- package/package.json +59 -37
- package/src/FileReader.js +33 -36
- package/src/HTMLParser.js +343 -206
- package/src/HTMLWriter.js +227 -177
- package/src/Passage.js +202 -20
- package/src/Story.js +461 -148
- package/src/StoryFormat.js +300 -41
- package/src/StoryFormatParser.js +142 -65
- package/src/TweeParser.js +161 -255
- package/src/TweeWriter.js +98 -111
- package/story-formats/chapbook-1.2.0/format.js +1 -0
- package/story-formats/chapbook-1.2.0/logo.svg +1 -0
- package/story-formats/harlowe-1.2.4/format.js +1 -0
- package/story-formats/harlowe-1.2.4/icon.svg +78 -0
- package/story-formats/harlowe-2.1.0/format.js +2 -0
- package/story-formats/harlowe-2.1.0/icon.svg +78 -0
- package/story-formats/harlowe-3.1.0/format.js +3 -0
- package/story-formats/harlowe-3.1.0/icon.svg +78 -0
- package/story-formats/paperthin-1.0.0/format.js +1 -0
- package/story-formats/paperthin-1.0.0/icon.svg +5 -0
- package/story-formats/snowman-1.4.0/format.js +1 -0
- package/story-formats/snowman-1.4.0/icon.svg +436 -0
- package/story-formats/snowman-2.0.2/format.js +1 -0
- package/story-formats/snowman-2.0.2/icon.svg +436 -0
- package/story-formats/sugarcube-1.0.35/LICENSE +23 -0
- package/story-formats/sugarcube-1.0.35/format.js +1 -0
- package/story-formats/sugarcube-1.0.35/icon.svg +56 -0
- package/story-formats/sugarcube-2.31.1/LICENSE +22 -0
- package/story-formats/sugarcube-2.31.1/format.js +1 -0
- package/story-formats/sugarcube-2.31.1/icon.svg +56 -0
- package/test/{HTMLWriter/example7.twee → CLI/example6.twee} +16 -16
- package/test/CLI/harlowe.js +3 -0
- package/test/CLI/input.html +47 -0
- package/test/CLI/test.twee +18 -0
- package/test/CLI/test2.html +47 -0
- package/test/CLI/tweeExample.twee +17 -0
- package/test/CLI/twineExample.html +15 -0
- package/test/CLI.test.js +30 -0
- package/test/FileReader.test.js +14 -0
- package/test/HTMLParser/Example1.html +53 -0
- package/test/HTMLParser/Tags.html +15 -0
- package/test/HTMLParser/lyingStartnode.html +15 -0
- package/test/HTMLParser/lyingTagColors.html +48 -0
- package/test/HTMLParser/missingCreator.html +11 -0
- package/test/HTMLParser/missingCreatorVersion.html +11 -0
- package/test/HTMLParser/missingFormat.html +11 -0
- package/test/HTMLParser/missingFormatVersion.html +11 -0
- package/test/HTMLParser/missingIFID.html +11 -0
- package/test/HTMLParser/missingName.html +33 -0
- package/test/HTMLParser/missingPID.html +15 -0
- package/test/HTMLParser/missingPassageName.html +15 -0
- package/test/HTMLParser/missingPassageTags.html +15 -0
- package/test/HTMLParser/missingPosition.html +15 -0
- package/test/HTMLParser/missingScript.html +14 -0
- package/test/HTMLParser/missingSize.html +35 -0
- package/test/HTMLParser/missingStartnode.html +11 -0
- package/test/HTMLParser/missingStyle.html +14 -0
- package/test/HTMLParser/missingZoom.html +11 -0
- package/test/HTMLParser/tagColors.html +31 -0
- package/test/HTMLParser/twineExample.html +15 -46
- package/test/HTMLParser/twineExample2.html +15 -0
- package/test/HTMLParser/twineExample3.html +15 -0
- package/test/HTMLParser.test.js +177 -0
- package/test/HTMLWriter/TestTags.html +42 -0
- package/test/HTMLWriter/{test10.html → creator.html} +8 -5
- package/test/HTMLWriter/example6.twee +16 -16
- package/test/HTMLWriter/{example.twee → missingStoryTitle.twee} +29 -29
- package/test/HTMLWriter/test11.html +123 -0
- package/test/HTMLWriter/test2.html +15 -12
- package/test/HTMLWriter/test3.html +7 -13
- package/test/HTMLWriter/test4.html +8 -5
- package/test/HTMLWriter/test6.html +7 -5
- package/test/HTMLWriter.test.js +289 -0
- package/test/Passage.test.js +104 -0
- package/test/Roundtrip/Example1.html +64 -0
- package/test/Roundtrip/example1.twee +21 -0
- package/test/Roundtrip/example2.twee +18 -0
- package/test/Roundtrip/harlowe.js +3 -0
- package/test/Roundtrip/round.html +50 -0
- package/test/Roundtrip.test.js +48 -0
- package/test/Story/startmeta.twee +29 -29
- package/test/Story/test.twee +25 -25
- package/test/Story.test.js +282 -0
- package/test/StoryFormat.test.js +152 -0
- package/test/StoryFormatParser/example.js +3 -0
- package/test/StoryFormatParser/{test2.js → example2.js} +3 -3
- package/test/StoryFormatParser/format_doublename.js +1 -0
- package/test/StoryFormatParser/harlowe.js +2 -2
- package/test/StoryFormatParser/missingAuthor.js +1 -0
- package/test/StoryFormatParser/missingDescription.js +1 -0
- package/test/StoryFormatParser/missingImage.js +1 -0
- package/test/StoryFormatParser/missingLicense.js +1 -0
- package/test/StoryFormatParser/missingName.js +1 -0
- package/test/StoryFormatParser/missingProofing.js +1 -0
- package/test/StoryFormatParser/missingSource.js +1 -0
- package/test/StoryFormatParser/missingURL.js +1 -0
- package/test/StoryFormatParser/missingVersion.js +1 -0
- package/test/StoryFormatParser/versionWrong.js +1 -0
- package/test/StoryFormatParser.test.js +91 -0
- package/test/TweeParser/emptytags.twee +2 -2
- package/test/TweeParser/example.twee +32 -29
- package/test/TweeParser/missing.twee +19 -0
- package/test/{HTMLWriter/example5.twee → TweeParser/multipleScriptPassages.twee} +19 -13
- package/test/{HTMLWriter/example4.twee → TweeParser/multipleStyleTag.twee} +19 -13
- package/test/TweeParser/multipletags.twee +10 -2
- package/test/TweeParser/noTitle.twee +2 -0
- package/test/TweeParser/notes.twee +16 -0
- package/test/TweeParser/pasagemetadataerror.twee +2 -2
- package/test/{HTMLWriter/example2.twee → TweeParser/scriptPassage.twee} +16 -13
- package/test/TweeParser/singletag.twee +13 -2
- package/test/TweeParser/startMetadata.twee +14 -0
- package/test/TweeParser/storydataerror.twee +25 -25
- package/test/{HTMLWriter/example3.twee → TweeParser/stylePassage.twee} +16 -13
- package/test/TweeParser/test.twee +25 -25
- package/test/TweeParser.test.js +79 -0
- package/test/TweeWriter/test1.twee +14 -9
- package/test/TweeWriter/test3.twee +7 -10
- package/test/TweeWriter/test4.twee +14 -0
- package/test/TweeWriter/test5.twee +20 -0
- package/test/TweeWriter.test.js +85 -0
- package/main.js +0 -106
- package/src/DirectoryReader.js +0 -107
- package/src/DirectoryWatcher.js +0 -92
- package/test/DirectoryReader/css/test.css +0 -3
- package/test/DirectoryReader1/js/Site.js +0 -1
- package/test/DirectoryReader2/error.js +0 -1
- package/test/DirectoryReader2/example.css +0 -3
- package/test/DirectoryReader2/index.twee +0 -6
- package/test/DirectoryReader3/twee/index.twee +0 -6
- package/test/DirectoryWatcher/example.txt +0 -0
- package/test/DirectoryWatcher/test.txt +0 -0
- package/test/DirectoryWatcher/test1.txt +0 -0
- package/test/HTMLWriter/test5.html +0 -48
- package/test/HTMLWriter/test7.html +0 -48
- package/test/HTMLWriter/test8.html +0 -48
- package/test/HTMLWriter/test9.html +0 -48
- package/test/StoryFormatParser/test.js +0 -2
- package/test/TweeParser/test.twee3 +0 -11
- package/test/TweeWriter/metatest.twee +0 -12
- package/test/TweeWriter/test2.twee +0 -15
- package/test/test.js +0 -722
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<!DOCTYPE html><html><head><title>Example1</title><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><style>.small-caps{text-transform:uppercase;font-size:70%;letter-spacing:.075em}#backstage .panel h2{margin:0}#backstage .panel h2 button{text-align:left;background:none;border:none;width:100%;font-weight:400;text-transform:uppercase;font-size:70%;letter-spacing:.075em;font-size:11px;padding:0 8px}#backstage .panel h2 button:before{content:"\25BA";display:inline-block;width:1.25em}#backstage .panel h2 button:hover{color:#495057}#backstage .panel.open h2 button:before{content:"\25BC"}
|
|
2
|
+
#backstage table.history td.actions{width:2.5em}#backstage table.history td.go{border-right:1px solid #000}
|
|
3
|
+
#backstage ul.tabs{list-style:none;margin:8px;padding:0;display:flex;border:1px solid #000;font-size:12px}#backstage ul.tabs li{flex-grow:1;border-right:1px solid #000;text-align:center}#backstage ul.tabs li:last-child{border-right:none}#backstage ul.tabs li button{color:#000;text-decoration:none;display:block;width:100%;height:28px;padding:8px;border:none;border-radius:0}#backstage ul.tabs li button.active{background:#000;color:#dee2e6}#backstage .tab-content{max-height:calc(100vh - $backstage-tab-height);overflow:auto}
|
|
4
|
+
.small-caps{text-transform:uppercase;font-size:70%;letter-spacing:.075em}body.backstage-visible #backdrop{justify-content:flex-start;max-width:67vw}#backstage{position:fixed;top:0;right:0;bottom:0;width:33vw;max-height:100vh;font-size:18px;background:#dee2e6;color:#000;transform:translateX(100%);box-shadow:inset 2px 0 3px rgba(0,0,0,.25);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu Cantarell,Helvetica Neue,sans-serif;font-size:80%}#backstage:before{content:"";position:absolute;z-index:2;top:calc(50% - 25px);right:calc(100% - 4px);height:50px;width:4px;background:#dee2e6}@media screen and (max-width:425px){#backstage{width:calc(100vw - 25px)}}#backstage.open{transform:none}#backstage .toggle-visibility{position:absolute;z-index:1;top:calc(50% - 25px);right:100%;width:25px;height:50px;padding:0;background:#dee2e6;color:#000;border:none;border-top-left-radius:25px;border-bottom-left-radius:25px;border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:inset 2px 0 3px rgba(0,0,0,.25);font-size:18px}#backstage button{color:#000;background:transparent;padding:8px;border-radius:16px;border:1px solid #000}#backstage button:hover{background:#e9ecef}#backstage p{padding:0 8px}#backstage li,#backstage p,#backstage td{font-size:12px}#backstage input,#backstage select{color:#000;background:transparent;border:1px solid #000;padding:8px}#backstage table{background:transparent;table-layout:fixed;border-collapse:collapse;width:calc(100% - 16px);margin:8px}#backstage th{text-align:left}#backstage td{position:relative;border:1px solid #000;padding:8px;vertical-align:top}#backstage td:first-child{border-left:none}#backstage td:last-child{border-right:none}#backstage td button,#backstage td input{background:none;border:none;border-radius:0;position:absolute;top:0;left:0;bottom:0;width:100%;padding:8px}#backstage textarea{background:transparent;border:1px solid #000;color:#000;padding:8px;width:100%;height:7.75em}#backstage .block{display:block;margin:8px;width:calc(100% - 16px)}#backstage .disabled{color:#868e96}#backstage .indented-input{margin-left:calc(10em + 8px);font-size:12px}#backstage .input-group{display:flex;align-items:center}#backstage .input-group label:first-child{text-align:right;margin-right:8px;width:10em}#backstage .input-group input,#backstage .input-group select{flex-grow:1}#backstage .segmented-button{display:flex}#backstage .segmented-button button{border-left:none;border-radius:0;margin:0;flex-grow:1}#backstage .segmented-button button:first-child{border-left:1px solid #000;border-top-left-radius:16px;border-bottom-left-radius:16px}#backstage .segmented-button button:last-child{border-top-right-radius:16px;border-bottom-right-radius:16px}#backstage .segmented-button .fixed{flex-grow:0;min-width:24px}#backstage .tab-content{max-height:calc(100vh - 28px);overflow:auto}
|
|
5
|
+
.fade-in{opacity:0;animation:fade-in 1s ease-out forwards}.fade-out{animation:fade-in 1s ease-out reverse forwards}.skip-animation{animation-delay:0s!important}@keyframes fade-in{0%{opacity:0}to{opacity:1}}
|
|
6
|
+
#page .warnings{list-style-type:none;padding-left:0;margin-left:0}
|
|
7
|
+
.small-caps{text-transform:uppercase;font-size:70%;letter-spacing:.075em}#backdrop{min-height:100vh;align-items:center}#backdrop,#page{display:flex;justify-content:center}#page{flex-direction:column;width:40em;min-height:calc(100vh - 2em);max-width:calc(100vw - 2em);line-height:150%;margin:1em;padding:4em 4em 2em;position:relative}#page article{flex-grow:1;display:flex}#page article>:first-child{margin-top:0;width:100%}#page footer,#page header{display:flex}#page footer>div,#page header>div{flex-grow:1}#page footer p,#page header p{margin:.5em 0 0}#page footer .center,#page header .center{text-align:center}#page footer .right p,#page header .right p{text-align:right}#page header{margin-top:0}#page header.has-content{border-bottom:1px solid #000}#page header.has-content+article>article>div>p:first-child,#page header.has-content+article>div>p:first-child{margin-top:1em}#page footer{margin-bottom:0}#page footer.has-content{border-top:1px solid #000}#page hr{border:none}#page hr:after{content:"* \A0 * \A0 *";display:block;text-align:center}#page .error,#page .warning{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu Cantarell,Helvetica Neue,sans-serif;font-size:80%;background:#fff5f5;color:#c92a2a;padding:.5em;border-left:4px solid #ffa8a8;position:relative;margin-bottom:1em;overflow:auto}#page .error :first-child,#page .warning :first-child{margin-top:0}#page .error :last-child,#page .warning :last-child{margin-bottom:0}#page .error a,#page .warning a{color:#c92a2a}#page .warning{background:#fff9db;color:#e67700}#page .warning a{color:#e67700}#page .fork p{display:flex;flex-direction:column;width:100%}#page .fork p a{display:block;flex-grow:1;text-align:center;padding:.5em}@media screen and (max-width:768px){#page{margin:0;width:100vw;max-width:100vw;min-height:100vh;padding:1em}}#spinner{position:absolute;bottom:0;right:0;opacity:0;transition:opacity .25s ease-in-out;pointer-events:none}#spinner.visible{display:block;opacity:1}
|
|
8
|
+
*{box-sizing:border-box}body{margin:0;padding:0}img{max-width:100%;height:auto}input[type=text],select{padding:.25em}pre{white-space:pre-wrap}tw-storydata{display:none}</style></head><body><form id="cb-validation" action="javascript:void(0)"><button id="cb-validation-tester" hidden></button> <button id="cb-block-enter-key" hidden></button><div id="backdrop"><div id="page" aria-live="polite"><header><div class="left"></div><div class="center"></div><div class="right"></div></header><article></article><ul class="warnings"></ul><footer><div class="left"></div><div class="center"></div><div class="right"></div></footer><div id="spinner"><img src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgICB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgdmlld0JveD0iMCAwIDEwMCAxMDAiPgogICAgPHJlY3QgeD0iMzEiIHk9IjE0IiB3aWR0aD0iMzgiIGhlaWdodD0iNzIiIHJ4PSI0IiBmaWxsPSJ3aGl0ZSIgLz4KICAgIDxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjI4IiBmaWxsPSJ3aGl0ZSIgLz4KCTxyZWN0IHg9IjM1IiB5PSIxOCIgd2lkdGg9IjMwIiBoZWlnaHQ9IjY0IiByeD0iNCIgZmlsbD0id2hpdGUiIHN0cm9rZS13aWR0aD0iMnB4IiBzdHJva2U9ImJsYWNrIiAvPgogICAgPGNpcmNsZSBjeD0iNTAiIGN5PSI1MCIgcj0iMjAiIHN0cm9rZT0iYmxhY2siIGZpbGw9IndoaXRlIiBzdHJva2Utd2lkdGg9IjJweCIgLz4KCTxsaW5lIHgxPSI1MCIgeTE9IjUwIiB4Mj0iNTAiIHkyPSIzNyIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIycHgiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+CiAgICAgICAgPGFuaW1hdGVUcmFuc2Zvcm0KICAgICAgICAgICAgYXR0cmlidXRlTmFtZT0idHJhbnNmb3JtIgogICAgICAgICAgICBiZWdpbj0iMHMiCiAgICAgICAgICAgIGR1cj0iMjBzIgogICAgICAgICAgICB0eXBlPSJyb3RhdGUiCiAgICAgICAgICAgIGZyb209IjAgNTAgNTAiCiAgICAgICAgICAgIHRvPSIzNjAgNTAgNTAiCiAgICAgICAgICAgIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIgogICAgICAgIC8+Cgk8L2xpbmU+Cgk8bGluZSB4MT0iNTAiIHkxPSI1MCIgeDI9IjQyIiB5Mj0iNTAiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMnB4IiBzdHJva2UtbGluZWNhcD0icm91bmQiPgogICAgICAgIDxhbmltYXRlVHJhbnNmb3JtCiAgICAgICAgICAgIGF0dHJpYnV0ZU5hbWU9InRyYW5zZm9ybSIKICAgICAgICAgICAgYmVnaW49IjBzIgogICAgICAgICAgICBkdXI9IjEyMHMiCiAgICAgICAgICAgIHR5cGU9InJvdGF0ZSIKICAgICAgICAgICAgZnJvbT0iMCA1MCA1MCIKICAgICAgICAgICAgdG89IjM2MCA1MCA1MCIKICAgICAgICAgICAgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiCiAgICAgICAgLz4KCTwvbGluZT4KPC9zdmc+" width="40" height="40" alt=""></div></div></div></form><tw-storydata name="Example1" startnode="1" creator="Twine" creator-version="2.3.9" ifid="E70FC479-01D9-4E44-AC6A-AFF9F5E1C475" zoom="1" format="Chapbook" format-version="1.1.0" options="" hidden><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"></style><script role="script" id="twine-user-script" type="text/twine-javascript"></script><tw-passagedata pid="1" name="Untitled Passage" tags="" position="200,102" size="100,100">[[Another passage]]</tw-passagedata><tw-passagedata pid="2" name="Another passage" tags="" position="200,252" size="100,100">[[A third]]</tw-passagedata><tw-passagedata pid="3" name="A third" tags="" position="200,402" size="100,100">Double-click this passage to edit it.</tw-passagedata></tw-storydata><script>!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=28)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.get=t.set=t.defaults=void 0;var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.init=function(){var e=(0,u.ifid)(),t=(0,u.name)();if(void 0===t)throw new Error("Cannot set up state: the story has no name");d="chapbook-state-"+t+"-"+e},t.reset=v,t.sameObject=function(e,t){for(var n=e.split("."),r=t.split("."),o=0;o<n.length&&o<r.length;o++)if(n[o]!==r[o])return!1;return!0},t.setDefault=function(e,t){var n=y(e);f('Defaulting "'+e+'" to '+JSON.stringify(t)),(0,i.default)(h,e,t),m(window,e),null==n&&a.default.emit("state-change",{name:e,value:t,previous:n})},t.setLookup=function(e,t){var n=y(e);f("Adding lookup variable "+e),(0,i.default)(g,e,t),function(e,t){if(!e[t]){for(var n=t.split("."),r=n[n.length-1],o=0;o<n.length-1;o++)e[n[o]]=e[n[o]]||{},e=e[n[o]];Object.defineProperty(e,r,{get:function(){return y(t)},set:function(){throw new Error("Chapbook lookup variables may only be read.")},configurable:!0})}}(window,e),null==n&&a.default.emit("state-change",{name:e,value:y(e),previous:n})},t.saveToObject=w,t.restoreFromObject=_,t.canSaveToStorage=x,t.saveToStorage=k,t.canRestoreFromStorage=function(){return x()&&null!==window.localStorage.getItem(d)},t.restoreFromStorage=function(){f("Restoring variables from local storage"),_(JSON.parse(window.localStorage.getItem(d))),f("Restore complete")},t.purgeFromStorage=function(e){e||f("Purging variables from local storage");_(JSON.parse(window.localStorage.getItem(d))),e||f("Purge complete")},t.varNames=function(e){function t(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return Object.keys(e).reduce(function(o,i){if("object"===r(e[i])&&e[i]&&!Array.isArray(e[i]))t(e[i],n?n+"."+i:i,o);else{var s=n?n+"."+i:i;-1===o.indexOf(s)&&o.push(s)}return o},o)}if(e)return t(h,null,t(p,null)).sort();return t(p).sort()};var o=c(n(34)),i=c(n(35)),s=c(n(37)),a=c(n(1)),l=c(n(4)),u=n(6);function c(e){return e&&e.__esModule?e:{default:e}}var f=(0,l.default)("state").log,d=void 0,p={},h={},g={};function m(e,t){if(!e[t]){Object.defineProperty(e,t,{get:function(){return y(t)},set:function(e){b(t,e)},configurable:!0});var n=t.split(".");n.length>1&&(n.pop(),m(e,n.join(".")))}}function v(){!function e(t,n){Object.keys(t).forEach(function(o){var i,l,u=""===n?o:n+"."+o;if("object"!==r(t[o])||Array.isArray(t[o])){var c=t[o];delete t[o],i=window,l=n,(0,s.default)(i,l),a.default.emit("state-change",{name:u,value:y(u),previous:c})}else e(t[o],u)})}(p,""),a.default.emit("state-reset"),y("config.state.autosave")&&k()}function b(e,t){var n=y(e);(0,i.default)(p,e,t),m(window,e),t!==n&&a.default.emit("state-change",{name:e,previous:n,value:t}),y("config.state.autosave")&&k()}function y(e){var t=(0,o.default)(g,e);if("function"==typeof t)return t(y,b);var n=(0,o.default)(p,e);return null==n?(0,o.default)(h,e):n}function w(){return Object.assign({},p)}function _(e){v(),Object.keys(e).forEach(function(t){return b(t,e[t])})}function x(){try{return window.localStorage.setItem("chapbook-test","a"),window.localStorage.removeItem("chapbook-test"),!0}catch(e){return!1}}function k(){f("Saving to local storage: "+JSON.stringify(w())),window.localStorage.setItem(d,JSON.stringify(w())),f("Save complete")}t.defaults={"config.state.autosave":!0},t.set=b,t.get=y},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(30),i=(r=o)&&r.__esModule?r:{default:r};t.default=(0,i.default)()},function(e,t,n){"use strict";n.r(t),n.d(t,"h",function(){return a}),n.d(t,"createElement",function(){return a}),n.d(t,"cloneElement",function(){return f}),n.d(t,"createRef",function(){return q}),n.d(t,"Component",function(){return D}),n.d(t,"render",function(){return R}),n.d(t,"rerender",function(){return g}),n.d(t,"options",function(){return o});var r=function(){},o={},i=[],s=[];function a(e,t){var n,a,l,u,c=s;for(u=arguments.length;u-- >2;)i.push(arguments[u]);for(t&&null!=t.children&&(i.length||i.push(t.children),delete t.children);i.length;)if((a=i.pop())&&void 0!==a.pop)for(u=a.length;u--;)i.push(a[u]);else"boolean"==typeof a&&(a=null),(l="function"!=typeof e)&&(null==a?a="":"number"==typeof a?a=String(a):"string"!=typeof a&&(l=!1)),l&&n?c[c.length-1]+=a:c===s?c=[a]:c.push(a),n=l;var f=new r;return f.nodeName=e,f.children=c,f.attributes=null==t?void 0:t,f.key=null==t?void 0:t.key,void 0!==o.vnode&&o.vnode(f),f}function l(e,t){for(var n in t)e[n]=t[n];return e}function u(e,t){null!=e&&("function"==typeof e?e(t):e.current=t)}var c="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function f(e,t){return a(e.nodeName,l(l({},e.attributes),t),arguments.length>2?[].slice.call(arguments,2):e.children)}var d=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,p=[];function h(e){!e._dirty&&(e._dirty=!0)&&1==p.push(e)&&(o.debounceRendering||c)(g)}function g(){for(var e;e=p.pop();)e._dirty&&$(e)}function m(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function v(e){var t=l({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var r in n)void 0===t[r]&&(t[r]=n[r]);return t}function b(e){var t=e.parentNode;t&&t.removeChild(e)}function y(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)u(n,null),u(r,e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===d.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var s=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,w,s):e.removeEventListener(t,w,s),(e._listeners||(e._listeners={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e){try{e[t]=null==r?"":r}catch(e){}null!=r&&!1!==r||"spellcheck"==t||e.removeAttribute(t)}else{var a=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function w(e){return this._listeners[e.type](o.event&&o.event(e)||e)}var _=[],x=0,k=!1,S=!1;function j(){for(var e;e=_.shift();)o.afterMount&&o.afterMount(e),e.componentDidMount&&e.componentDidMount()}function O(e,t,n,r,o,i){x++||(k=null!=o&&void 0!==o.ownerSVGElement,S=null!=e&&!("__preactattr_"in e));var s=C(e,t,n,r,i);return o&&s.parentNode!==o&&o.appendChild(s),--x||(S=!1,i||j()),s}function C(e,t,n,r,o){var i=e,s=k;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||o)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),M(e,!0))),i.__preactattr_=!0,i;var a,l,u=t.nodeName;if("function"==typeof u)return function(e,t,n,r){var o=e&&e._component,i=o,s=e,a=o&&e._componentConstructor===t.nodeName,l=a,u=v(t);for(;o&&!l&&(o=o._parentComponent);)l=o.constructor===t.nodeName;o&&l&&(!r||o._component)?(N(o,u,3,n,r),e=o.base):(i&&!a&&(T(i),e=s=null),o=L(t.nodeName,u,n),e&&!o.nextBase&&(o.nextBase=e,s=null),N(o,u,1,n,r),e=o.base,s&&e!==s&&(s._component=null,M(s,!1)));return e}(e,t,n,r);if(k="svg"===u||"foreignObject"!==u&&k,u=String(u),(!e||!m(e,u))&&(a=u,(l=k?document.createElementNS("http://www.w3.org/2000/svg",a):document.createElement(a)).normalizedNodeName=a,i=l,e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),M(e,!0)}var c=i.firstChild,f=i.__preactattr_,d=t.children;if(null==f){f=i.__preactattr_={};for(var p=i.attributes,h=p.length;h--;)f[p[h].name]=p[h].value}return!S&&d&&1===d.length&&"string"==typeof d[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=d[0]&&(c.nodeValue=d[0]):(d&&d.length||null!=c)&&function(e,t,n,r,o){var i,s,a,l,u,c=e.childNodes,f=[],d={},p=0,h=0,g=c.length,v=0,y=t?t.length:0;if(0!==g)for(var w=0;w<g;w++){var _=c[w],x=_.__preactattr_,k=y&&x?_._component?_._component.__key:x.key:null;null!=k?(p++,d[k]=_):(x||(void 0!==_.splitText?!o||_.nodeValue.trim():o))&&(f[v++]=_)}if(0!==y)for(var w=0;w<y;w++){l=t[w],u=null;var k=l.key;if(null!=k)p&&void 0!==d[k]&&(u=d[k],d[k]=void 0,p--);else if(h<v)for(i=h;i<v;i++)if(void 0!==f[i]&&(S=s=f[i],O=o,"string"==typeof(j=l)||"number"==typeof j?void 0!==S.splitText:"string"==typeof j.nodeName?!S._componentConstructor&&m(S,j.nodeName):O||S._componentConstructor===j.nodeName)){u=s,f[i]=void 0,i===v-1&&v--,i===h&&h++;break}u=C(u,l,n,r),a=c[w],u&&u!==e&&u!==a&&(null==a?e.appendChild(u):u===a.nextSibling?b(a):e.insertBefore(u,a))}var S,j,O;if(p)for(var w in d)void 0!==d[w]&&M(d[w],!1);for(;h<=v;)void 0!==(u=f[v--])&&M(u,!1)}(i,d,n,r,S||null!=f.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||y(e,r,n[r],n[r]=void 0,k);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||y(e,r,n[r],n[r]=t[r],k)}(i,t.attributes,f),k=s,i}function M(e,t){var n=e._component;n?T(n):(null!=e.__preactattr_&&u(e.__preactattr_.ref,null),!1!==t&&null!=e.__preactattr_||b(e),E(e))}function E(e){for(e=e.lastChild;e;){var t=e.previousSibling;M(e,!0),e=t}}var A=[];function L(e,t,n){var r,o=A.length;for(e.prototype&&e.prototype.render?(r=new e(t,n),D.call(r,t,n)):((r=new D(t,n)).constructor=e,r.render=P);o--;)if(A[o].constructor===e)return r.nextBase=A[o].nextBase,A.splice(o,1),r;return r}function P(e,t,n){return this.constructor(e,n)}function N(e,t,n,r,i){e._disable||(e._disable=!0,e.__ref=t.ref,e.__key=t.key,delete t.ref,delete t.key,void 0===e.constructor.getDerivedStateFromProps&&(!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,r)),r&&r!==e.context&&(e.prevContext||(e.prevContext=e.context),e.context=r),e.prevProps||(e.prevProps=e.props),e.props=t,e._disable=!1,0!==n&&(1!==n&&!1===o.syncComponentUpdates&&e.base?h(e):$(e,1,i)),u(e.__ref,e))}function $(e,t,n,r){if(!e._disable){var i,s,a,u=e.props,c=e.state,f=e.context,d=e.prevProps||u,p=e.prevState||c,h=e.prevContext||f,g=e.base,m=e.nextBase,b=g||m,y=e._component,w=!1,k=h;if(e.constructor.getDerivedStateFromProps&&(c=l(l({},c),e.constructor.getDerivedStateFromProps(u,c)),e.state=c),g&&(e.props=d,e.state=p,e.context=h,2!==t&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(u,c,f)?w=!0:e.componentWillUpdate&&e.componentWillUpdate(u,c,f),e.props=u,e.state=c,e.context=f),e.prevProps=e.prevState=e.prevContext=e.nextBase=null,e._dirty=!1,!w){i=e.render(u,c,f),e.getChildContext&&(f=l(l({},f),e.getChildContext())),g&&e.getSnapshotBeforeUpdate&&(k=e.getSnapshotBeforeUpdate(d,p));var S,C,E=i&&i.nodeName;if("function"==typeof E){var A=v(i);(s=y)&&s.constructor===E&&A.key==s.__key?N(s,A,1,f,!1):(S=s,e._component=s=L(E,A,f),s.nextBase=s.nextBase||m,s._parentComponent=e,N(s,A,0,f,!1),$(s,1,n,!0)),C=s.base}else a=b,(S=y)&&(a=e._component=null),(b||1===t)&&(a&&(a._component=null),C=O(a,i,f,n||!g,b&&b.parentNode,!0));if(b&&C!==b&&s!==y){var P=b.parentNode;P&&C!==P&&(P.replaceChild(C,b),S||(b._component=null,M(b,!1)))}if(S&&T(S),e.base=C,C&&!r){for(var D=e,R=e;R=R._parentComponent;)(D=R).base=C;C._component=D,C._componentConstructor=D.constructor}}for(!g||n?_.push(e):w||(e.componentDidUpdate&&e.componentDidUpdate(d,p,k),o.afterUpdate&&o.afterUpdate(e));e._renderCallbacks.length;)e._renderCallbacks.pop().call(e);x||r||j()}}function T(e){o.beforeUnmount&&o.beforeUnmount(e);var t=e.base;e._disable=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?T(n):t&&(null!=t.__preactattr_&&u(t.__preactattr_.ref,null),e.nextBase=t,b(t),A.push(e),E(t)),u(e.__ref,null)}function D(e,t){this._dirty=!0,this.context=t,this.props=e,this.state=this.state||{},this._renderCallbacks=[]}function R(e,t,n){return O(n,e,{},!1,t,!1)}function q(){return{}}l(D.prototype,{setState:function(e,t){this.prevState||(this.prevState=this.state),this.state=l(l({},this.state),"function"==typeof e?e(this.state,this.props):e),t&&this._renderCallbacks.push(t),h(this)},forceUpdate:function(e){e&&this._renderCallbacks.push(e),$(this,2)},render:function(){}});var z={h:a,createElement:a,cloneElement:f,createRef:q,Component:D,render:R,rerender:g,options:o};t.default=z},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.warn=t.log=t.defaults=void 0,t.default=function(e){return{log:function(t){l(e,t)},warn:function(t){u(e,t)}}};var r,o=n(1),i=(r=o)&&r.__esModule?r:{default:r},s=n(0);t.defaults={"config.logger.show.parse":!1,"config.logger.show.render":!1,"config.logger.show.sound":!1,"config.logger.show.state":!1,"config.logger.show.story":!1,"config.logger.show.style":!1};function a(e){return e+": "}function l(e,t){(0,s.get)("config.logger.show."+e)&&console.log(a(e)+t),i.default.emit("log",{source:e,message:t})}function u(e,t){console.warn(a(e)+t),i.default.emit("log-warning",{source:e,message:t})}t.log=l,t.warn=u,window.logger={log:l,warn:u}},function(e,t,n){"use strict";function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=document.createElement(e);return Object.keys(t).forEach(function(e){void 0!==t[e]&&r.setAttribute(e,t[e])}),n.forEach(function(e){"string"==typeof e?r.appendChild(document.createTextNode(e)):r.appendChild(e)}),r}Object.defineProperty(t,"__esModule",{value:!0}),t.domify=r,t.default=function(){return r.apply(void 0,arguments).outerHTML}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.passages=void 0,t.loadFromData=function(e){["name","creator","ifid","options"].forEach(function(t){return u[t]=e.getAttribute(t)}),u.startNode=parseInt(e.getAttribute("startnode")),u.creatorVersion=e.getAttribute("creator-version");var t=function(e){return e.map(function(e){return e.textContent})};u.customScripts=t((0,s.selectAll)(e,'[type="text/twine-javascript"]')),u.customStyles=t((0,s.selectAll)(e,'[type="text/twine-css"]')),c=(0,s.selectAll)(e,"tw-passagedata").map(function(e){var t={id:parseInt(e.getAttribute("pid")),name:e.getAttribute("name"),source:e.textContent},n=e.getAttribute("tags");return t.tags=n?n.split(" "):[],t})},t.init=function(){(0,a.setDefault)("trail",[d().name]),(0,a.setDefault)("config.testing","string"==typeof u.options&&-1!==u.options.indexOf("debug")||!1),document.title=u.name},t.runCustomScripts=function(){l.log("Running custom scripts ("+u.customScripts.length+")"),u.customScripts.forEach(function(e){new Function(e).apply(window)})},t.addCustomStyles=function(){l.log("Adding custom styles ("+u.customStyles.length+")"),u.customStyles.forEach(function(e){var t=document.createElement("style");t.innerHTML=e,document.head.appendChild(t)})},t.ifid=function(){return u.ifid},t.name=function(){return u.name},t.exportedPassages=f,t.startPassage=d,t.passageNamed=function(e){return c.find(function(t){return t.name===e})},t.passageWithId=function(e){return c.find(function(t){return t.id===e})};var r,o=n(4),i=(r=o)&&r.__esModule?r:{default:r},s=n(7),a=n(0);var l=(0,i.default)("story"),u={customScripts:[],customStyles:[]},c=[];function f(){return c}function d(){return c.find(function(e){return e.id===u.startNode})}t.passages=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.select=function(e,t){return e.querySelector(t)},t.selectAll=function(e,t){return Array.from(e.querySelectorAll(t))}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);n(46);t.default=class extends r.Component{constructor(e){super(e),this.state={open:void 0===this.props.initiallyOpen||this.props.initiallyOpen}}toggle(){this.setState({open:!this.state.open})}render(){return(0,r.h)("div",{class:"panel"+(this.state.open?" open":"")},(0,r.h)("h2",null,(0,r.h)("button",{onClick:()=>this.toggle()},this.props.title)),this.state.open&&(0,r.h)("div",{class:"content"},this.props.children))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaults=void 0,t.render=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,s.default)((0,i.default)(e),(0,a.get)("config.template.inserts")||[],(0,a.get)("config.template.modifiers")||[],t)};var r=l(n(60)),o=l(n(84)),i=l(n(94)),s=l(n(96)),a=n(0);function l(e){return e&&e.__esModule?e:{default:e}}t.defaults={"config.template.inserts":r.default,"config.template.modifiers":o.default}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaults=void 0,t.init=function(){(0,a.init)(),(0,l.init)(),h=document.querySelector("#page article"),m=document.querySelector("#page #spinner"),g={},["header","footer"].forEach(function(e){g[e]={container:document.querySelector("#page "+e)},["left","center","right"].forEach(function(t){g[e][t]=document.querySelector("#page "+e+" ."+t)})}),o.default.on("state-change",function(e){var t=e.name;return y("trail"===t)}),["change","click"].forEach(function(e){document.body.addEventListener(e,function(e){for(var t=e.target;t;)t.dataset&&Object.keys(t.dataset).some(function(e){return/^cb[A-Z]/.test(e)})&&o.default.emit("dom-"+e.type,t),t=t.parentNode})})},t.changeBody=function(e){(0,d.selectAll)(h,"input").forEach(function(e){e.setAttribute("value",e.value)}),(0,d.selectAll)(h,"select").forEach(function(e){for(var t=0;t<e.options.length;t++)t===e.options.selectedIndex?e.options[t].setAttribute("selected",""):e.options[t].removeAttribute("selected")});var t={x:window.scrollX,y:window.scrollY},n=h.innerHTML,r=document.createElement("div");for(;h.firstChild;)r.insertBefore(h.firstChild,r.firstChild);h.innerHTML=n,e(r),window.scrollX=t.x,window.scrollY=t.y,b(h,r.innerHTML,(0,s.get)("config.body.transition.name"),(0,s.get)("config.body.transition.duration"))};var r=p(n(20)),o=p(n(1)),i=n(64),s=n(0),a=n(66),l=n(69),u=n(6),c=n(11),f=p(n(71));n(72);var d=n(7);function p(e){return e&&e.__esModule?e:{default:e}}var h=void 0,g=void 0,m=void 0,v={crossfade:i.crossfade,fadeInOut:i.fadeInOut,none:i.none};t.defaults={"config.body.transition.name":"crossfade","config.body.transition.duration":"500ms","config.header.left":"","config.header.center":"","config.header.right":"","config.header.transition.name":"none","config.header.transition.duration":"500ms","config.footer.left":"_{story.name}_","config.footer.center":"","config.footer.right":"{restart link}","config.footer.transition.name":"none","config.footer.transition.duration":"500ms"};function b(e,t,n,r){v[n]?v[n](e,t,r):v.none(e,t)}var y=(0,r.default)(function(e){if(e.some(function(e){return e[0]})){var t=(0,s.get)("trail"),n=(0,u.passageNamed)(t[t.length-1]);if(!n)throw new Error('There is no passage named "'+t[t.length-1]+'".');window.scrollTo(0,0),b(h,(0,c.render)(n.source),(0,s.get)("config.body.transition.name"),(0,s.get)("config.body.transition.duration")),(0,f.default)(h,m)}["header","footer"].forEach(function(e){g[e].container.classList.remove("has-content"),["left","center","right"].forEach(function(t){var n=(0,c.render)((0,s.get)("config."+e+"."+t));""!==n&&g[e].container.classList.add("has-content"),b(g[e][t],n,(0,s.get)("config."+e+".transition.name"),(0,s.get)("config."+e+".transition.duration"))})})})},function(e,t,n){"use strict";e.exports=function(e,t,n){n=Object.assign({},r,n||{});let o=0,s=function(e){let t={ms:.001,s:1,m:60,h:3600};return t.d=e.hoursPerDay*t.h,t.w=e.daysPerWeek*t.d,t.mth=e.daysPerYear/e.monthsPerYear*t.d,t.y=e.daysPerYear*t.d,t}(n),a=e.toLowerCase().replace(/[^.\w+-]+/g,"").match(/[-+]?[0-9.]+[a-z]+/g);null!==a&&a.forEach(e=>{let t=e.match(/[0-9.]+/g)[0],n=e.match(/[a-z]+/g)[0];o+=function(e,t,n){return e*n[i(t)]}(t,n,s)});if(t)return function(e,t,n){return e/n[i(t)]}(o,t,s);return o};const r={hoursPerDay:24,daysPerWeek:7,weeksPerMonth:4,monthsPerYear:12,daysPerYear:365.25},o={ms:["ms","milli","millisecond","milliseconds"],s:["s","sec","secs","second","seconds"],m:["m","min","mins","minute","minutes"],h:["h","hr","hrs","hour","hours"],d:["d","day","days"],w:["w","week","weeks"],mth:["mon","mth","mths","month","months"],y:["y","yr","yrs","year","years"]};function i(e){for(let t of Object.keys(o))if(o[t].indexOf(e)>-1)return t;throw new Error(`The unit [${e}] is not supported by timestring`)}},function(e,t){function n(e,t){if(!e)throw new Error(t||"AssertionError")}n.notEqual=function(e,t,r){n(e!=t,r)},n.notOk=function(e,t){n(!e,t)},n.equal=function(e,t,r){n(e==t,r)},n.ok=n,e.exports=n},function(e,t,n){"use strict";
|
|
9
|
+
/*!
|
|
10
|
+
* isobject <https://github.com/jonschlinkert/isobject>
|
|
11
|
+
*
|
|
12
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
13
|
+
* Released under the MIT License.
|
|
14
|
+
*/e.exports=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.renderLink=s,t.default=function(e){return e.replace(/\[\[(.*?)\]\]/g,function(e,t){var n=t,r=t.indexOf("|");if(-1!==r)n=t.substr(0,r),t=t.substr(r+1);else{var o=t.indexOf("->");if(-1!==o)n=t.substr(0,o),t=t.substr(o+2);else{var i=t.indexOf("<-");-1!==i&&(n=t.substr(i+2),t=t.substr(0,i))}}return s(t,n||t)})};var r,o=n(5),i=(r=o)&&r.__esModule?r:{default:r};function s(e,t){return/^\w+:\/\/\/?\w/i.test(e)?(0,i.default)("a",{href:e},[t||e]):(0,i.default)("a",{href:"javascript:void(0)","data-cb-go":e},[t||e])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.history=t.defaults=void 0,t.rewindTo=function(e){if(!a[e])throw new Error("There is no history at index "+e+" to rewind to.");l=!1,(0,s.restoreFromObject)(a[e].state),a.length=e+1,l=!0,i.default.emit("backstage-recorder-update")},t.init=function(){i.default.on("state-change",c),i.default.on("state-reset",u)};var r,o=n(1),i=(r=o)&&r.__esModule?r:{default:r},s=n(0);t.defaults={"config.backstage.trail.maxLength":100};var a=t.history=[],l=!0;function u(){l&&(t.history=a=[],i.default.emit("backstage-recorder-update"))}function c(e){var t=e.name,n=e.value;l&&(a.length===(0,s.get)("config.backstage.trail.maxLength")&&a.shift(),a.push({change:{name:t,value:n},state:(0,s.saveToObject)()}),i.default.emit("backstage-recorder-update"))}},function(e,t,n){(function(t){var n=1/0,r="[object Symbol]",o=/[&<>"'`]/g,i=RegExp(o.source),s="object"==typeof t&&t&&t.Object===Object&&t,a="object"==typeof self&&self&&self.Object===Object&&self,l=s||a||Function("return this")();var u,c=(u={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},function(e){return null==u?void 0:u[e]}),f=Object.prototype.toString,d=l.Symbol,p=d?d.prototype:void 0,h=p?p.toString:void 0;function g(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&f.call(e)==r}(e))return h?h.call(e):"";var t=e+"";return"0"==t&&1/e==-n?"-0":t}e.exports=function(e){var t;return(e=null==(t=e)?"":g(t))&&i.test(e)?e.replace(o,c):e}}).call(this,n(16))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=[],n=!1;return function(){for(var r=arguments.length,o=Array(r),i=0;i<r;i++)o[i]=arguments[i];n||(n=!0,Promise.resolve().then(function(){try{e(t)}catch(e){window.setTimeout(function(){throw e},0)}t=[],n=!1})),t.push(o)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="<span"+Object.keys(t).reduce(function(e,n){return e+" "+n+'="'+t[n]+'"'},"")+">",r=n+e.replace(/[\r\n]{2,}/g,"</span>$&"+n)+"</span>";return r=r.replace(/(<span.*?>)\s*(#+)/gi,"$2 $1")}},function(e,t,n){(function(t){!function(t){"use strict";var n={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:m,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:m,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:m,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/,text:/^[^\n]+/};function r(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||_.defaults,this.rules=n.normal,this.options.pedantic?this.rules=n.pedantic:this.options.gfm&&(this.options.tables?this.rules=n.tables:this.rules=n.gfm)}n._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,n._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,n.def=d(n.def).replace("label",n._label).replace("title",n._title).getRegex(),n.bullet=/(?:[*+-]|\d{1,9}\.)/,n.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,n.item=d(n.item,"gm").replace(/bull/g,n.bullet).getRegex(),n.list=d(n.list).replace(/bull/g,n.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+n.def.source+")").getRegex(),n._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",n._comment=/<!--(?!-?>)[\s\S]*?-->/,n.html=d(n.html,"i").replace("comment",n._comment).replace("tag",n._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),n.paragraph=d(n.paragraph).replace("hr",n.hr).replace("heading",n.heading).replace("lheading",n.lheading).replace("tag",n._tag).getRegex(),n.blockquote=d(n.blockquote).replace("paragraph",n.paragraph).getRegex(),n.normal=v({},n),n.gfm=v({},n.normal,{fences:/^ {0,3}(`{3,}|~{3,})([^`\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),n.gfm.paragraph=d(n.paragraph).replace("(?!","(?!"+n.gfm.fences.source.replace("\\1","\\2")+"|"+n.list.source.replace("\\1","\\3")+"|").getRegex(),n.tables=v({},n.gfm,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),n.pedantic=v({},n.normal,{html:d("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",n._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),r.rules=n,r.lex=function(e,t){return new r(t).lex(e)},r.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},r.prototype.token=function(e,t){var r,o,i,s,a,l,u,c,f,d,p,h,g,m,v,w;for(e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:y(i,"\n")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2]?i[2].trim():i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if((i=this.rules.nptable.exec(e))&&(l={type:"table",header:b(i[1].replace(/^ *| *\| *$/g,"")),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3]?i[3].replace(/\n$/,"").split("\n"):[]}).header.length===l.align.length){for(e=e.substring(i[0].length),p=0;p<l.align.length;p++)/^ *-+: *$/.test(l.align[p])?l.align[p]="right":/^ *:-+: *$/.test(l.align[p])?l.align[p]="center":/^ *:-+ *$/.test(l.align[p])?l.align[p]="left":l.align[p]=null;for(p=0;p<l.cells.length;p++)l.cells[p]=b(l.cells[p],l.header.length);this.tokens.push(l)}else if(i=this.rules.hr.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"hr"});else if(i=this.rules.blockquote.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"blockquote_start"}),i=i[0].replace(/^ *> ?/gm,""),this.token(i,t),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),u={type:"list_start",ordered:m=(s=i[2]).length>1,start:m?+s:"",loose:!1},this.tokens.push(u),c=[],r=!1,g=(i=i[0].match(this.rules.item)).length,p=0;p<g;p++)d=(l=i[p]).length,~(l=l.replace(/^ *([*+-]|\d+\.) */,"")).indexOf("\n ")&&(d-=l.length,l=this.options.pedantic?l.replace(/^ {1,4}/gm,""):l.replace(new RegExp("^ {1,"+d+"}","gm"),"")),p!==g-1&&(a=n.bullet.exec(i[p+1])[0],(s.length>1?1===a.length:a.length>1||this.options.smartLists&&a!==s)&&(e=i.slice(p+1).join("\n")+e,p=g-1)),o=r||/\n\n(?!\s*$)/.test(l),p!==g-1&&(r="\n"===l.charAt(l.length-1),o||(o=r)),o&&(u.loose=!0),w=void 0,(v=/^\[[ xX]\] /.test(l))&&(w=" "!==l[1],l=l.replace(/^\[[ xX]\] +/,"")),f={type:"list_item_start",task:v,checked:w,loose:o},c.push(f),this.tokens.push(f),this.token(l,!1),this.tokens.push({type:"list_item_end"});if(u.loose)for(g=c.length,p=0;p<g;p++)c[p].loose=!0;this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),i[3]&&(i[3]=i[3].substring(1,i[3].length-1)),h=i[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[h]||(this.tokens.links[h]={href:i[2],title:i[3]});else if((i=this.rules.table.exec(e))&&(l={type:"table",header:b(i[1].replace(/^ *| *\| *$/g,"")),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3]?i[3].replace(/\n$/,"").split("\n"):[]}).header.length===l.align.length){for(e=e.substring(i[0].length),p=0;p<l.align.length;p++)/^ *-+: *$/.test(l.align[p])?l.align[p]="right":/^ *:-+: *$/.test(l.align[p])?l.align[p]="center":/^ *:-+ *$/.test(l.align[p])?l.align[p]="left":l.align[p]=null;for(p=0;p<l.cells.length;p++)l.cells[p]=b(l.cells[p].replace(/^ *\| *| *\| *$/g,""),l.header.length);this.tokens.push(l)}else if(i=this.rules.lheading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:"="===i[2]?1:2,text:i[1]});else if(t&&(i=this.rules.paragraph.exec(e)))e=e.substring(i[0].length),this.tokens.push({type:"paragraph",text:"\n"===i[1].charAt(i[1].length-1)?i[1].slice(0,-1):i[1]});else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"text",text:i[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0));return this.tokens};var o={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:m,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s"<\[][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:m,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/};function i(e,t){if(this.options=t||_.defaults,this.links=e,this.rules=o.normal,this.renderer=this.options.renderer||new s,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.pedantic?this.rules=o.pedantic:this.options.gfm&&(this.options.breaks?this.rules=o.breaks:this.rules=o.gfm)}function s(e){this.options=e||_.defaults}function a(){}function l(e){this.tokens=[],this.token=null,this.options=e||_.defaults,this.options.renderer=this.options.renderer||new s,this.renderer=this.options.renderer,this.renderer.options=this.options,this.slugger=new u}function u(){this.seen={}}function c(e,t){if(t){if(c.escapeTest.test(e))return e.replace(c.escapeReplace,function(e){return c.replacements[e]})}else if(c.escapeTestNoEncode.test(e))return e.replace(c.escapeReplaceNoEncode,function(e){return c.replacements[e]});return e}function f(e){return e.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function d(e,t){return e=e.source||e,t=t||"",{replace:function(t,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),e=e.replace(t,n),this},getRegex:function(){return new RegExp(e,t)}}}function p(e,t,n){if(e){try{var r=decodeURIComponent(f(n)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return null}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return null}t&&!g.test(n)&&(n=function(e,t){h[" "+e]||(/^[^:]+:\/*[^/]*$/.test(e)?h[" "+e]=e+"/":h[" "+e]=y(e,"/",!0));return e=h[" "+e],"//"===t.slice(0,2)?e.replace(/:[\s\S]*/,":")+t:"/"===t.charAt(0)?e.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}o._punctuation="!\"#$%&'()*+,\\-./:;<=>?@\\[^_{|}~",o.em=d(o.em).replace(/punctuation/g,o._punctuation).getRegex(),o._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,o._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,o._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,o.autolink=d(o.autolink).replace("scheme",o._scheme).replace("email",o._email).getRegex(),o._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,o.tag=d(o.tag).replace("comment",n._comment).replace("attribute",o._attribute).getRegex(),o._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|`(?!`)|[^\[\]\\`])*?/,o._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*)/,o._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,o.link=d(o.link).replace("label",o._label).replace("href",o._href).replace("title",o._title).getRegex(),o.reflink=d(o.reflink).replace("label",o._label).getRegex(),o.normal=v({},o),o.pedantic=v({},o.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:d(/^!?\[(label)\]\((.*?)\)/).replace("label",o._label).getRegex(),reflink:d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",o._label).getRegex()}),o.gfm=v({},o.normal,{escape:d(o.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),o.gfm.url=d(o.gfm.url,"i").replace("email",o.gfm._extended_email).getRegex(),o.breaks=v({},o.gfm,{br:d(o.br).replace("{2,}","*").getRegex(),text:d(o.gfm.text).replace(/\{2,\}/g,"*").getRegex()}),i.rules=o,i.output=function(e,t,n){return new i(t,n).output(e)},i.prototype.output=function(e){for(var t,n,r,o,s,a,l="";e;)if(s=this.rules.escape.exec(e))e=e.substring(s[0].length),l+=c(s[1]);else if(s=this.rules.tag.exec(e))!this.inLink&&/^<a /i.test(s[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(s[0])&&(this.inLink=!1),!this.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(s[0])?this.inRawBlock=!0:this.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(s[0])&&(this.inRawBlock=!1),e=e.substring(s[0].length),l+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):c(s[0]):s[0];else if(s=this.rules.link.exec(e)){var u=w(s[2],"()");if(u>-1){var f=s[0].length-(s[2].length-u)-(s[3]||"").length;s[2]=s[2].substring(0,u),s[0]=s[0].substring(0,f).trim(),s[3]=""}e=e.substring(s[0].length),this.inLink=!0,r=s[2],this.options.pedantic?(t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r))?(r=t[1],o=t[3]):o="":o=s[3]?s[3].slice(1,-1):"",r=r.trim().replace(/^<([\s\S]*)>$/,"$1"),l+=this.outputLink(s,{href:i.escapes(r),title:i.escapes(o)}),this.inLink=!1}else if((s=this.rules.reflink.exec(e))||(s=this.rules.nolink.exec(e))){if(e=e.substring(s[0].length),t=(s[2]||s[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){l+=s[0].charAt(0),e=s[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(s,t),this.inLink=!1}else if(s=this.rules.strong.exec(e))e=e.substring(s[0].length),l+=this.renderer.strong(this.output(s[4]||s[3]||s[2]||s[1]));else if(s=this.rules.em.exec(e))e=e.substring(s[0].length),l+=this.renderer.em(this.output(s[6]||s[5]||s[4]||s[3]||s[2]||s[1]));else if(s=this.rules.code.exec(e))e=e.substring(s[0].length),l+=this.renderer.codespan(c(s[2].trim(),!0));else if(s=this.rules.br.exec(e))e=e.substring(s[0].length),l+=this.renderer.br();else if(s=this.rules.del.exec(e))e=e.substring(s[0].length),l+=this.renderer.del(this.output(s[1]));else if(s=this.rules.autolink.exec(e))e=e.substring(s[0].length),r="@"===s[2]?"mailto:"+(n=c(this.mangle(s[1]))):n=c(s[1]),l+=this.renderer.link(r,null,n);else if(this.inLink||!(s=this.rules.url.exec(e))){if(s=this.rules.text.exec(e))e=e.substring(s[0].length),this.inRawBlock?l+=this.renderer.text(s[0]):l+=this.renderer.text(c(this.smartypants(s[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else{if("@"===s[2])r="mailto:"+(n=c(s[0]));else{do{a=s[0],s[0]=this.rules._backpedal.exec(s[0])[0]}while(a!==s[0]);n=c(s[0]),r="www."===s[1]?"http://"+n:n}e=e.substring(s[0].length),l+=this.renderer.link(r,null,n)}return l},i.escapes=function(e){return e?e.replace(i.rules._escapes,"$1"):e},i.prototype.outputLink=function(e,t){var n=t.href,r=t.title?c(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,c(e[1]))},i.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},i.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,o=0;o<r;o++)t=e.charCodeAt(o),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},s.prototype.code=function(e,t,n){var r=(t||"").match(/\S*/)[0];if(this.options.highlight){var o=this.options.highlight(e,r);null!=o&&o!==e&&(n=!0,e=o)}return r?'<pre><code class="'+this.options.langPrefix+c(r,!0)+'">'+(n?e:c(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:c(e,!0))+"</code></pre>"},s.prototype.blockquote=function(e){return"<blockquote>\n"+e+"</blockquote>\n"},s.prototype.html=function(e){return e},s.prototype.heading=function(e,t,n,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(n)+'">'+e+"</h"+t+">\n":"<h"+t+">"+e+"</h"+t+">\n"},s.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},s.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+r+">\n"},s.prototype.listitem=function(e){return"<li>"+e+"</li>\n"},s.prototype.checkbox=function(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},s.prototype.paragraph=function(e){return"<p>"+e+"</p>\n"},s.prototype.table=function(e,t){return t&&(t="<tbody>"+t+"</tbody>"),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"},s.prototype.tablerow=function(e){return"<tr>\n"+e+"</tr>\n"},s.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"</"+n+">\n"},s.prototype.strong=function(e){return"<strong>"+e+"</strong>"},s.prototype.em=function(e){return"<em>"+e+"</em>"},s.prototype.codespan=function(e){return"<code>"+e+"</code>"},s.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},s.prototype.del=function(e){return"<del>"+e+"</del>"},s.prototype.link=function(e,t,n){if(null===(e=p(this.options.sanitize,this.options.baseUrl,e)))return n;var r='<a href="'+c(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+n+"</a>"},s.prototype.image=function(e,t,n){if(null===(e=p(this.options.sanitize,this.options.baseUrl,e)))return n;var r='<img src="'+e+'" alt="'+n+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">"},s.prototype.text=function(e){return e},a.prototype.strong=a.prototype.em=a.prototype.codespan=a.prototype.del=a.prototype.text=function(e){return e},a.prototype.link=a.prototype.image=function(e,t,n){return""+n},a.prototype.br=function(){return""},l.parse=function(e,t){return new l(t).parse(e)},l.prototype.parse=function(e){this.inline=new i(e.links,this.options),this.inlineText=new i(e.links,v({},this.options,{renderer:new a})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},l.prototype.next=function(){return this.token=this.tokens.pop()},l.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},l.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},l.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,f(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,o="",i="";for(n="",e=0;e<this.token.header.length;e++)n+=this.renderer.tablecell(this.inline.output(this.token.header[e]),{header:!0,align:this.token.align[e]});for(o+=this.renderer.tablerow(n),e=0;e<this.token.cells.length;e++){for(t=this.token.cells[e],n="",r=0;r<t.length;r++)n+=this.renderer.tablecell(this.inline.output(t[r]),{header:!1,align:this.token.align[r]});i+=this.renderer.tablerow(n)}return this.renderer.table(o,i);case"blockquote_start":for(i="";"blockquote_end"!==this.next().type;)i+=this.tok();return this.renderer.blockquote(i);case"list_start":i="";for(var s=this.token.ordered,a=this.token.start;"list_end"!==this.next().type;)i+=this.tok();return this.renderer.list(i,s,a);case"list_item_start":i="";var l=this.token.loose,u=this.token.checked,c=this.token.task;for(this.token.task&&(i+=this.renderer.checkbox(u));"list_item_end"!==this.next().type;)i+=l||"text"!==this.token.type?this.tok():this.parseText();return this.renderer.listitem(i,c,u);case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText());default:var d='Token with "'+this.token.type+'" type was not found.';if(!this.options.silent)throw new Error(d);console.log(d)}},u.prototype.slug=function(e){var t=e.toLowerCase().trim().replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){var n=t;do{this.seen[n]++,t=n+"-"+this.seen[n]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t},c.escapeTest=/[&<>"']/,c.escapeReplace=/[&<>"']/g,c.replacements={"&":"&","<":"<",">":">",'"':""","'":"'"},c.escapeTestNoEncode=/[<>"']|&(?!#?\w+;)/,c.escapeReplaceNoEncode=/[<>"']|&(?!#?\w+;)/g;var h={},g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(){}function v(e){for(var t,n,r=1;r<arguments.length;r++)for(n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function b(e,t){var n=e.replace(/\|/g,function(e,t,n){for(var r=!1,o=t;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"}).split(/ \|/),r=0;if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,"|");return n}function y(e,t,n){if(0===e.length)return"";for(var r=0;r<e.length;){var o=e.charAt(e.length-r-1);if(o!==t||n){if(o===t||!n)break;r++}else r++}return e.substr(0,e.length-r)}function w(e,t){if(-1===e.indexOf(t[1]))return-1;for(var n=0,r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&--n<0)return r;return-1}function _(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if(n||"function"==typeof t){n||(n=t,t=null);var o,i,s=(t=v({},_.defaults,t||{})).highlight,a=0;try{o=r.lex(e,t)}catch(e){return n(e)}i=o.length;var u=function(e){if(e)return t.highlight=s,n(e);var r;try{r=l.parse(o,t)}catch(t){e=t}return t.highlight=s,e?n(e):n(null,r)};if(!s||s.length<3)return u();if(delete t.highlight,!i)return u();for(;a<o.length;a++)!function(e){"code"!==e.type?--i||u():s(e.text,e.lang,function(t,n){return t?u(t):null==n||n===e.text?--i||u():(e.text=n,e.escaped=!0,void(--i||u()))})}(o[a])}else try{return t&&(t=v({},_.defaults,t)),l.parse(r.lex(e,t),t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",(t||_.defaults).silent)return"<p>An error occurred:</p><pre>"+c(e.message+"",!0)+"</pre>";throw e}}m.exec=m,_.options=_.setOptions=function(e){return v(_.defaults,e),_},_.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new s,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},_.defaults=_.getDefaults(),_.Parser=l,_.parser=l.parse,_.Renderer=s,_.TextRenderer=a,_.Lexer=r,_.lexer=r.lex,_.InlineLexer=i,_.inlineLexer=i.output,_.Slugger=u,_.parse=_,e.exports=_}(this||"undefined"!=typeof window&&window)}).call(this,n(16))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaults=void 0,t.init=function(){(p=document.createElement("div")).setAttribute("hidden",!0),p.dataset.cbSounds="",document.body.appendChild(p),i.default.on("state-change",function(e){var t=e.name,n=e.value,o=(0,a.sameObject)(t,"sound.ambient"),i=(0,a.sameObject)(t,"sound.effect");if(o){var s=(0,a.get)("sound.ambient");s&&Object.keys(s).forEach(function(e){s[e].url&&h(e,s[e].url,!1),s[e].volume&&v(e,s[e].volume),void 0!==s[e].muted&&b(e,s[e].muted),s[e].playing&&g(e,!0).catch(function(t){return f('Could not resume playing ambient sound "'+e+'" ('+t.message+")")})})}if(i){var l=(0,a.get)("sound.effect");l&&Object.keys(l).forEach(function(e){l[e].url&&h(e,l[e].url,!0),l[e].volume&&v(e,l[e].volume),void 0!==l[e].muted&&b(e,l[e].muted),l[e].playing&&g(e,!1).then(function(){return(0,a.set)("sound.effect."+e+".playing",!1)}).catch(function(t){return f('Could not resume playing sound effect "'+e+'" ('+t.message)})})}if(!o&&!i){var u=/^sound\.(ambient|effect)\.(.+?)\.(.+)$/i.exec(t);if(u)switch(u[3].toLowerCase()){case"playing":n?"ambient"===u[1]?g(u[2],!0,(0,r.default)((0,a.get)(u[2]+".transitionDuration")||(0,a.get)("sound.transitionDuration")||"0s","ms")):g(u[2],!1).then(function(){return(0,a.set)(t,!1)}):"ambient"===u[1]?m(u[2],(0,r.default)((0,a.get)(u[2]+".transitionDuration")||(0,a.get)("sound.transitionDuration")||"0s","ms")):m(u[2]);break;case"url":h(u[2],n,"effect"===u[1]);break;case"volume":v(u[2],n)}}})};var r=l(n(13)),o=l(n(4)),i=l(n(1)),s=l(n(99)),a=n(0);function l(e){return e&&e.__esModule?e:{default:e}}var u=(0,o.default)("sound"),c=u.log,f=u.warn,d={},p=void 0;t.defaults={"sound.mute":!1,"sound.volume":1,"sound.transitionDuration":"1s"};function h(e,t,n){d[e]?(d[e].setAttribute("src",t),n?d[e].setAttribute("preload","auto"):d[e].removeAttribute("preload"),c('Updated <audio> element in sound bank for "'+e+'" to use '+t)):(d[e]=document.createElement("audio"),d[e].setAttribute("src",t),n&&d[e].setAttribute("preload","auto"),p.appendChild(d[e]),c('Added new <audio> element to sound bank for "'+e+'" for '+t))}function g(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!d[e])throw new Error("There is no sound loaded named "+e+".");return c('Playing sound "'+e+'" (looping: '+t+")"),n>0&&(d[e].volume=0,(0,s.default)(d[e],1,n)),t?(d[e].loop=!0,d[e].play()):(d[e].loop=!1,new Promise(function(t,n){try{d[e].addEventListener("ended",function n(){d[e].removeEventListener("ended",n),t()}),d[e].play().catch(function(e){return n(e)})}catch(e){n(e)}}))}function m(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!d[e])throw new Error("There is no sound loaded named "+e+".");if(t<=0)d[e].pause(),d[e].currentTime=0;else{var n=d[e].volume;(0,s.default)(d[e],0,t).then(function(){d[e].pause(),d[e].volume=n,d[e].currentTime=0})}}function v(e,t){if(!d[e])throw new Error("There is no sound loaded named "+e+".");if(t<0||t>1)throw new Error("A sound volume must be between 0 and 1.");d[e].volume=t}function b(e,t){if(!d[e])throw new Error("There is no sound loaded named "+e+".");d[e].muted=t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaults=void 0,t.default=function(e){e("random.coinFlip",function(){var e=l();return(0,o.default)(u),e>.5}),e("random.fraction",function(){var e=l();return(0,o.default)(u),e}),[4,5,6,8,10,12,20,25,50,100,1e3].forEach(function(t){e("random.d"+t,function(){var e=1+Math.round(l()*(t-1));return(0,o.default)(u),e})})};var r=a(n(106)),o=a(n(20)),i=a(n(1)),s=n(0);function a(e){return e&&e.__esModule?e:{default:e}}t.defaults={"config.random.seed":function(){return new Date},"config.random.privateState":null};var l=(0,r.default)(new Date,{state:!0});function u(){(0,s.set)("config.random.privateState",l.state())}i.default.on("state-change",function(e){var t=e.name,n=e.value;"config.random.seed"===t&&(l=(0,r.default)(n,{state:!0}))})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaults=void 0,t.style=d,t.init=function(){(0,s.init)(),f.dataset.cbAuthorStyles="",document.head.appendChild(f),o.default.on("state-change",function(e){var t=e.name,n=e.value;if((0,i.sameObject)(t,"config.style.backdrop")&&(u("Setting backdrop color"),d("#backdrop",{"background-color":(0,a.parseColor)((0,i.get)("config.style.backdrop")).color})),(0,i.sameObject)(t,"config.style.page.fork.divider.color")&&(u("Setting fork divider color"),d("#page .fork p a + a",{"border-top-color":(0,a.parseColor)((0,i.get)("config.style.page.fork.divider.color")).color})),(0,i.sameObject)(t,"config.style.page.fork.divider.size")&&(u("Setting fork divider size"),d("#page .fork p a + a",{"border-top-width":(0,i.get)("config.style.page.fork.divider.size")+"px"})),(0,i.sameObject)(t,"config.style.page.fork.divider.style")&&(u("Setting fork divider style"),d("#page .fork p a + a",{"border-top-style":(0,i.get)("config.style.page.fork.divider.style")})),(0,i.sameObject)(t,"config.style.page.style")||(0,i.sameObject)(t,"config.style.page.style.borderColor"))switch(u("Setting page style"),(0,i.get)("config.style.page.style")){case"none":d("#page",{border:"none","box-shadow":"none"});break;case"shadow":d("#page",{border:"none","box-shadow":"0 4px 8px hsla(0, 0%, 0%, 0.25)"});break;case"thick-line":d("#page",{border:"4px solid "+(0,a.parseColor)((0,i.get)("config.style.page.style.borderColor")).color,"box-shadow":"none"});break;case"thin-line":d("#page",{border:"1px solid "+(0,a.parseColor)((0,i.get)("config.style.page.style.borderColor")).color,"box-shadow":"none"})}if((0,i.sameObject)(t,"config.style.page.verticalAlign"))switch(u("Setting page vertical alignment"),(0,i.get)("config.style.page.verticalAlign")){case"top":d("#page article",{"align-items":"flex-start"});break;case"center":d("#page article",{"align-items":"center"});break;case"bottom":d("#page article",{"align-items":"flex-end"})}if(/^config\.style\.page\..*\.((line)?color|font)$/i.test(t)&&p(t,n),(0,i.sameObject)(t,"config.style.page")){["config.style.page","config.style.page.header","config.style.page.footer"].forEach(function(e){var t=(0,i.get)(e);t&&function(e,t){["color","font","lineColor"].forEach(function(n){t[n]&&p(e+"."+n,t[n]),t.link&&(t.link[n]&&p(e+".link."+n,t.link[n]),t.link.active&&t.link.active[n]&&p(e+".link.active."+n,t.link.active[n]))})}(e,t)})}})};var r=l(n(4)),o=l(n(1)),i=n(0),s=n(117),a=n(118);function l(e){return e&&e.__esModule?e:{default:e}}var u=(0,r.default)("style").log,c=(t.defaults={"config.style.backdrop":"gray-0","config.style.page.style":"shadow","config.style.page.style.borderColor":"gray-2","config.style.page.font":"Iowan Old Style/Constantia/Georgia/serif 18","config.style.page.color":"gray-9 on white","config.style.page.fork.divider.color":"gray-3","config.style.page.fork.divider.style":"dashed","config.style.page.fork.divider.size":1,"config.style.page.link.color":"gray-9","config.style.page.link.lineColor":"red-8","config.style.page.link.font":"underline","config.style.page.link.active.color":"red-8 on red-0","config.style.page.verticalAlign":"center","config.style.page.header.font":"16","config.style.page.header.link.font":"small caps","config.style.page.footer.font":"16","config.style.page.footer.link.font":"small caps"},{}),f=document.createElement("style");function d(e,t){c[e]=c[e]||{},Object.assign(c[e],t),function(){f.innerHTML=Object.keys(c).reduce(function(e,t){return e+(n=t,r=c[t],n+"{"+Object.keys(r).sort().reduce(function(e,t){return r[t]?e+t+":"+r[t].toString()+";":e},"")+"}");var n,r},"")}()}function p(e,t){var n="#page",r=e.replace(/^config\.style\.page\./i,"").split(".");switch("header"===r[0].toLowerCase()?(n+=" header",r.shift()):"footer"===r[0].toLowerCase()&&(n+=" footer",r.shift()),"link"===r[0].toLowerCase()&&(n+=" a",r.shift()),"active"===r[0].toLowerCase()&&(n=n+":hover, "+n+":active",r.shift()),r[0].toLowerCase()){case"color":u("Setting color for "+n),d(n,(0,a.parseColor)(t));break;case"linecolor":u("Setting line color for "+n);var o=(0,a.parseColor)(t).color;d(n,{"text-decoration-color":o,"-webkit-text-decoration-color":o});break;case"font":u("Setting font for "+n),d(n,(0,a.parseFont)(t))}}},function(e,t){var n=/-?\d+(\.\d+)?%?/g;e.exports=function(e){return e.match(n)}},function(e,t){e.exports=function(e,t,n){return Math.min(Math.max(e,t),n)}},function(e,t,n){"use strict";var r=n(29),o=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(n(44)),i=p(n(59)),s=n(0),a=n(23),l=p(n(100)),u=p(n(116)),c=n(12),f=n(6),d=n(25);function p(e){return e&&e.__esModule?e:{default:e}}n(126),(0,f.loadFromData)(document.querySelector("tw-storydata")),(0,i.default)(),(0,s.init)(),Object.assign(window,{go:r.go,restart:r.restart}),(0,d.init)(),(0,u.default)(),(0,l.default)(),(0,c.init)(),(0,a.init)(),(0,f.init)(),o&&(0,s.get)("config.testing")&&o.init(),!(0,s.get)("config.testing")&&(0,s.canRestoreFromStorage)()&&(0,s.restoreFromStorage)(),(0,f.addCustomStyles)(),(0,f.runCustomScripts)()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.go=f,t.restart=d;var r,o=n(1),i=(r=o)&&r.__esModule?r:{default:r},s=n(0),a=n(4),l=n(6),u=n(43);function c(e){(0,a.log)("actions",e)}function f(e){c('Going to passage "'+e+'"');var t=(0,l.passageNamed)(e);if(!t)throw new Error('There is no passage with the name "'+e+'"');(0,u.transferToState)(),(0,s.set)("trail",(0,s.get)("trail").concat(t.name))}function d(){c("Restarting"),(0,s.reset)(),window.location.reload()}i.default.on("dom-click",function(e){e.dataset.cbGo&&(0,u.validate)().then(function(){return f(e.dataset.cbGo)})}),i.default.on("dom-click",function(e){e.dataset.cbRestart&&d()})},function(e,t,n){var r=n(31),o=n(32),i=n(14);function s(e){if(!(this instanceof s))return new s(e);this._name=e||"nanobus",this._starListeners=[],this._listeners={}}e.exports=s,s.prototype.emit=function(e){i.ok("string"==typeof e||"symbol"==typeof e,"nanobus.emit: eventName should be type string or symbol");for(var t=[],n=1,r=arguments.length;n<r;n++)t.push(arguments[n]);var s=o(this._name+"('"+e.toString()+"')"),a=this._listeners[e];return a&&a.length>0&&this._emit(this._listeners[e],t),this._starListeners.length>0&&this._emit(this._starListeners,e,t,s.uuid),s(),this},s.prototype.on=s.prototype.addListener=function(e,t){return i.ok("string"==typeof e||"symbol"==typeof e,"nanobus.on: eventName should be type string or symbol"),i.equal(typeof t,"function","nanobus.on: listener should be type function"),"*"===e?this._starListeners.push(t):(this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)),this},s.prototype.prependListener=function(e,t){return i.ok("string"==typeof e||"symbol"==typeof e,"nanobus.prependListener: eventName should be type string or symbol"),i.equal(typeof t,"function","nanobus.prependListener: listener should be type function"),"*"===e?this._starListeners.unshift(t):(this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].unshift(t)),this},s.prototype.once=function(e,t){i.ok("string"==typeof e||"symbol"==typeof e,"nanobus.once: eventName should be type string or symbol"),i.equal(typeof t,"function","nanobus.once: listener should be type function");var n=this;return this.on(e,function r(){t.apply(n,arguments);n.removeListener(e,r)}),this},s.prototype.prependOnceListener=function(e,t){i.ok("string"==typeof e||"symbol"==typeof e,"nanobus.prependOnceListener: eventName should be type string or symbol"),i.equal(typeof t,"function","nanobus.prependOnceListener: listener should be type function");var n=this;return this.prependListener(e,function r(){t.apply(n,arguments);n.removeListener(e,r)}),this},s.prototype.removeListener=function(e,t){return i.ok("string"==typeof e||"symbol"==typeof e,"nanobus.removeListener: eventName should be type string or symbol"),i.equal(typeof t,"function","nanobus.removeListener: listener should be type function"),"*"===e?(this._starListeners=this._starListeners.slice(),n(this._starListeners,t)):(void 0!==this._listeners[e]&&(this._listeners[e]=this._listeners[e].slice()),n(this._listeners[e],t));function n(e,t){if(e){var n=e.indexOf(t);return-1!==n?(r(e,n,1),!0):void 0}}},s.prototype.removeAllListeners=function(e){return e?"*"===e?this._starListeners=[]:this._listeners[e]=[]:(this._starListeners=[],this._listeners={}),this},s.prototype.listeners=function(e){var t="*"!==e?this._listeners[e]:this._starListeners,n=[];if(t)for(var r=t.length,o=0;o<r;o++)n.push(t[o]);return n},s.prototype._emit=function(e,t,n,r){if(void 0!==e&&0!==e.length){void 0===n&&(n=t,t=null),t&&(n=void 0!==r?[t].concat(n,r):[t].concat(n));for(var o=e.length,i=0;i<o;i++){var s=e[i];s.apply(s,n)}}}},function(e,t,n){"use strict";e.exports=function(e,t,n){var r,o=e.length;if(!(t>=o||0===n)){var i=o-(n=t+n>o?o-t:n);for(r=t;r<i;++r)e[r]=e[r+n];e.length=i}}},function(e,t,n){var r,o=n(33)(),i=n(14);s.disabled=!0;try{r=window.performance,s.disabled="true"===window.localStorage.DISABLE_NANOTIMING||!r.mark}catch(e){}function s(e){if(i.equal(typeof e,"string","nanotiming: name should be type string"),s.disabled)return a;var t=(1e4*r.now()).toFixed()%Number.MAX_SAFE_INTEGER,n="start-"+t+"-"+e;function l(i){var s="end-"+t+"-"+e;r.mark(s),o.push(function(){var o=null;try{var a=e+" ["+t+"]";r.measure(a,n,s),r.clearMarks(n),r.clearMarks(s)}catch(e){o=e}i&&i(o,e)})}return r.mark(n),l.uuid=t,l}function a(e){e&&o.push(function(){e(new Error("nanotiming: performance API unavailable"))})}e.exports=s},function(e,t,n){var r=n(14),o="undefined"!=typeof window;function i(e){this.hasWindow=e,this.hasIdle=this.hasWindow&&window.requestIdleCallback,this.method=this.hasIdle?window.requestIdleCallback.bind(window):this.setTimeout,this.scheduled=!1,this.queue=[]}i.prototype.push=function(e){r.equal(typeof e,"function","nanoscheduler.push: cb should be type function"),this.queue.push(e),this.schedule()},i.prototype.schedule=function(){if(!this.scheduled){this.scheduled=!0;var e=this;this.method(function(t){for(;e.queue.length&&t.timeRemaining()>0;)e.queue.shift()(t);e.scheduled=!1,e.queue.length&&e.schedule()})}},i.prototype.setTimeout=function(e){setTimeout(e,0,{timeRemaining:function(){return 1}})},e.exports=function(){var e;return o?(window._nanoScheduler||(window._nanoScheduler=new i(!0)),e=window._nanoScheduler):e=new i,e}},function(e,t,n){
|
|
15
|
+
/*!
|
|
16
|
+
* get-value <https://github.com/jonschlinkert/get-value>
|
|
17
|
+
*
|
|
18
|
+
* Copyright (c) 2014-2018, Jon Schlinkert.
|
|
19
|
+
* Released under the MIT License.
|
|
20
|
+
*/
|
|
21
|
+
const r=n(15);function o(e,t,n){return"function"==typeof n.join?n.join(e):e[0]+t+e[1]}function i(e,t,n){return"function"!=typeof n.isValid||n.isValid(e,t)}function s(e){return r(e)||Array.isArray(e)||"function"==typeof e}e.exports=function(e,t,n){if(r(n)||(n={default:n}),!s(e))return void 0!==n.default?n.default:e;"number"==typeof t&&(t=String(t));const a=Array.isArray(t),l="string"==typeof t,u=n.separator||".",c=n.joinChar||("string"==typeof u?u:".");if(!l&&!a)return e;if(l&&t in e)return i(t,e,n)?e[t]:n.default;let f=a?t:function(e,t,n){if("function"==typeof n.split)return n.split(e);return e.split(t)}(t,u,n),d=f.length,p=0;do{let t=f[p];for("number"==typeof t&&(t=String(t));t&&"\\"===t.slice(-1);)t=o([t.slice(0,-1),f[++p]||""],c,n);if(t in e){if(!i(t,e,n))return n.default;e=e[t]}else{let r=!1,s=p+1;for(;s<d;)if(r=(t=o([t,f[s++]],c,n))in e){if(!i(t,e,n))return n.default;e=e[t],p=s-1;break}if(!r)return n.default}}while(++p<d&&s(e));return p===d?e:n.default}},function(e,t,n){"use strict";
|
|
22
|
+
/*!
|
|
23
|
+
* set-value <https://github.com/jonschlinkert/set-value>
|
|
24
|
+
*
|
|
25
|
+
* Copyright (c) 2014-2018, Jon Schlinkert.
|
|
26
|
+
* Released under the MIT License.
|
|
27
|
+
*/const r=n(36);function o(e,t,n,r){if(!a(e))return e;let l=r||{};const u=Array.isArray(t);if(!u&&"string"!=typeof t)return e;let c=l.merge;c&&"function"!=typeof c&&(c=Object.assign);const f=(u?t:function(e,t){const n=function(e,t){let n=e;if(void 0===t)return n+"";const r=Object.keys(t);for(let e=0;e<r.length;e++){const o=r[e];n+=";"+o+"="+String(t[o])}return n}(e,t);if(o.memo[n])return o.memo[n];const r=t&&t.separator?t.separator:".";let i=[],s=[];i=t&&"function"==typeof t.split?t.split(e):e.split(r);for(let e=0;e<i.length;e++){let t=i[e];for(;t&&"\\"===t.slice(-1)&&i[e+1];)t=t.slice(0,-1)+r+i[++e];s.push(t)}return o.memo[n]=s,s}(t,l)).filter(s),d=f.length,p=e;if(!r&&1===f.length)return i(e,f[0],n,c),e;for(let t=0;t<d;t++){let r=f[t];if(a(e[r])||(e[r]={}),t===d-1){i(e,r,n,c);break}e=e[r]}return p}function i(e,t,n,o){o&&r(e[t])&&r(n)?e[t]=o({},e[t],n):e[t]=n}function s(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e}function a(e){return null!==e&&("object"==typeof e||"function"==typeof e)}o.memo={},e.exports=o},function(e,t,n){"use strict";
|
|
28
|
+
/*!
|
|
29
|
+
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
30
|
+
*
|
|
31
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
32
|
+
* Released under the MIT License.
|
|
33
|
+
*/var r=n(15);function o(e){return!0===r(e)&&"[object Object]"===Object.prototype.toString.call(e)}e.exports=function(e){var t,n;return!1!==o(e)&&("function"==typeof(t=e.constructor)&&(!1!==o(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf")))}},function(e,t,n){"use strict";
|
|
34
|
+
/*!
|
|
35
|
+
* unset-value <https://github.com/jonschlinkert/unset-value>
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) 2015, 2017, Jon Schlinkert.
|
|
38
|
+
* Released under the MIT License.
|
|
39
|
+
*/var r=n(15),o=n(38);e.exports=function(e,t){if(!r(e))throw new TypeError("expected an object.");if(e.hasOwnProperty(t))return delete e[t],!0;if(o(e,t)){for(var n=t.split("."),i=n.pop();n.length&&"\\"===n[n.length-1].slice(-1);)i=n.pop().slice(0,-1)+"."+i;for(;n.length;)e=e[t=n.shift()];return delete e[i]}return!0}},function(e,t,n){"use strict";
|
|
40
|
+
/*!
|
|
41
|
+
* has-value <https://github.com/jonschlinkert/has-value>
|
|
42
|
+
*
|
|
43
|
+
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
44
|
+
* Licensed under the MIT License.
|
|
45
|
+
*/var r=n(39),o=n(41),i=n(42);e.exports=function(e,t,n){return r(e)?o(i(e,t),n):o(e,t)}},function(e,t,n){"use strict";
|
|
46
|
+
/*!
|
|
47
|
+
* isobject <https://github.com/jonschlinkert/isobject>
|
|
48
|
+
*
|
|
49
|
+
* Copyright (c) 2014-2015, Jon Schlinkert.
|
|
50
|
+
* Licensed under the MIT License.
|
|
51
|
+
*/var r=n(40);e.exports=function(e){return null!=e&&"object"==typeof e&&!1===r(e)}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";
|
|
52
|
+
/*!
|
|
53
|
+
* has-values <https://github.com/jonschlinkert/has-values>
|
|
54
|
+
*
|
|
55
|
+
* Copyright (c) 2014-2015, Jon Schlinkert.
|
|
56
|
+
* Licensed under the MIT License.
|
|
57
|
+
*/e.exports=function(e,t){if(null==e)return!1;if("boolean"==typeof e)return!0;if("number"==typeof e)return 0!==e||!0!==t;if(void 0!==e.length)return 0!==e.length;for(var n in e)if(e.hasOwnProperty(n))return!0;return!1}},function(e,t){function n(e){return e?Array.isArray(e)?e.join("."):e:""}
|
|
58
|
+
/*!
|
|
59
|
+
* get-value <https://github.com/jonschlinkert/get-value>
|
|
60
|
+
*
|
|
61
|
+
* Copyright (c) 2014-2015, Jon Schlinkert.
|
|
62
|
+
* Licensed under the MIT License.
|
|
63
|
+
*/
|
|
64
|
+
e.exports=function(e,t,r,o,i){if(null===(s=e)||"object"!=typeof s&&"function"!=typeof s||!t)return e;var s;if(t=n(t),r&&(t+="."+n(r)),o&&(t+="."+n(o)),i&&(t+="."+n(i)),t in e)return e[t];for(var a=t.split("."),l=a.length,u=-1;e&&++u<l;){for(var c=a[u];"\\"===c[c.length-1];)c=c.slice(0,-1)+"."+a[++u];e=e[c]}return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validate=function(){var e=document.querySelector("form#cb-validation"),t=(0,r.selectAll)(e,"input, select");return new Promise(function(n,r){var o=function n(){e.removeEventListener("submit",i),t.forEach(function(e){return e.removeEventListener("invalid",n)}),r()},i=function r(){e.removeEventListener("submit",r),t.forEach(function(e){return e.removeEventListener("invalid",o)}),n()};t.forEach(function(e){return e.addEventListener("invalid",o)}),e.addEventListener("submit",i),document.querySelector("button#cb-validation-tester").click()})},t.transferToState=function(){(0,r.selectAll)(document,"[data-cb-set]").forEach(function(e){var t=e.dataset.set;switch(e.nodeName){case"INPUT":(0,o.set)(t,e.value);break;case"SELECT":(0,o.set)(t,e.options[e.selectedIndex].value);break;default:(0,o.set)(t,e.textContent)}})};var r=n(7),o=n(0)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Backstage=void 0,t.init=function(){(0,o.init)(),(0,r.render)((0,r.h)(f,null),document.body)};var r=n(2),o=n(18),i=c(n(45)),s=c(n(48)),a=c(n(49)),l=c(n(52)),u=c(n(56));function c(e){return e&&e.__esModule?e:{default:e}}n(58);class f extends r.Component{constructor(e){super(e),this.state={open:!0}}setBodyClass(){this.state.open?document.body.classList.add("backstage-visible"):document.body.classList.remove("backstage-visible")}toggle(){this.setState({open:!this.state.open})}render(){const e=this.state.open?{icon:"→",text:"Close"}:{icon:"←",text:"Open"};return(0,r.h)("div",{id:"backstage",class:this.state.open&&"open"},(0,r.h)("button",{onClick:e=>this.toggle(),title:e.text+" backstage panel",class:"toggle-visibility"},e.icon),(0,r.h)(u.default,null,(0,r.h)(a.default,{label:"State"}),(0,r.h)(i.default,{label:"History"}),(0,r.h)(l.default,{label:"Style"}),(0,r.h)(s.default,{label:"Notes"})))}componentDidMount(){this.setBodyClass()}componentDidUpdate(){this.setBodyClass()}}t.Backstage=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=l(n(10)),i=l(n(1)),s=n(18),a=n(0);function l(e){return e&&e.__esModule?e:{default:e}}function u(e){if(0===e.length)return[];const t=[];let n,r=[];return e.forEach(({change:e},o)=>{"trail"===e.name?(t.push({historyIndex:o-1,passage:n,varChanges:r}),r=[],n=e.value[e.value.length-1]):r.push({name:e.name,value:e.value})}),t.push({historyIndex:e.length-1,passage:n,varChanges:r}),console.log("Parsed",e,t),t}function c({historyIndex:e,passage:t,varChanges:n}){const o=[(0,r.h)("tr",null,(0,r.h)("td",{class:"actions",rowspan:n.length+1},(0,r.h)("button",{onClick:e>=0?()=>(0,s.rewindTo)(e):a.reset},"↪")),(0,r.h)("td",{class:"go",rowspan:n.length+1,colspan:n.length>0?1:2},t?`Go to "${t}"`:"Startup"))];return n.forEach(e=>{o.push((0,r.h)("tr",null,(0,r.h)("td",null,e.name," ← ",JSON.stringify(e.value))))}),o}n(47);t.default=class extends r.Component{constructor(e){super(e),this.state={history:u(s.history)},this.updateBound=(()=>this.update())}update(){this.setState({history:u(s.history)})}render(){let e;return e=this.state.history.length>0?(0,r.h)("table",{class:"history"},this.state.history.map(c)):(0,r.h)("table",{class:"history"},(0,r.h)("tr",null,(0,r.h)("td",{class:"actions"},(0,r.h)("button",{onClick:a.reset},"↪")),(0,r.h)("td",{class:"go"},"Startup"))),(0,r.h)(o.default,{title:"History"},e)}componentDidMount(){i.default.on("backstage-recorder-update",this.updateBound)}componentDidUnmount(){i.default.removeEventListener("backstage-recorder-update",this.updateBound)}}},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=l(n(19)),o=n(2),i=l(n(1)),s=n(7),a=n(0);function l(e){return e&&e.__esModule?e:{default:e}}t.default=class extends o.Component{constructor(e){super(e);const t=(0,a.get)("trail");this.state={currentPassage:t[t.length-1],notes:{}},this.restore(),this.syncBound=(e=>this.sync(e))}sync({name:e,value:t}){"trail"===e&&this.setState({currentPassage:t[t.length-1]})}restore(){const e=window.localStorage.getItem(`cb-passage-notes-${(0,a.get)("config.state.saveKey")}`);e&&this.setState({notes:JSON.parse(e)})}save(){window.localStorage.setItem(`cb-passage-notes-${(0,a.get)("config.state.saveKey")}`,JSON.stringify(this.state.notes))}saveNote(e,t){const n=Object.assign({},this.state.notes);n[e]=t,this.setState({notes:n}),this.save()}export(){const e=Object.keys(this.state.notes).reduce((e,t)=>e+`<li class="note"><span class="passage">${(0,r.default)(t)}</span><pre>${(0,r.default)(this.state.notes[t])}</pre></li>`,""),t=document.createElement("a");t.setAttribute("download",`${(0,a.get)("story.name")} Notes - ${(new Date).toDateString()} ${(new Date).toTimeString()}.html`),t.setAttribute("href","data:text/html;base64,"+window.btoa(`<style>body {font-family: sans-serif}</style><h1>Notes for “${(0,r.default)((0,a.get)("story.name"))}”</h1><ul data-cb-backstage-notes data-cb-version="${(0,a.get)("engine.version")}">${e}</ul>`)),document.body.appendChild(t),t.click(),document.body.removeChild(t)}startImport(){this.upload.click()}import(e){const t=this.upload.files[0];if(!t)return;const n=new FileReader(t);n.onload=(e=>{const t=document.createElement("div"),n=Object.assign({},this.state.notes);let r=0;t.innerHTML=e.target.result;const o=(0,s.selectAll)(t,"ul[data-cb-backstage-notes] li");0!==o.length?(o.forEach(e=>{const t=(0,s.select)(e,"span.passage"),o=(0,s.select)(e,"pre");t&&o&&(n[t.textContent]=(n[t.textContent]||"")+"\n\n"+o.textContent,r++)}),this.setState({notes:n}),this.save(),window.alert(`${r} note(s) were imported.`)):window.alert("No notes were found in this file.")}),n.readAsText(t)}deleteAll(){window.confirm("Are you sure? This will delete all text entered in the Notes panel of Backstage, and cannot be undone.")&&(this.setState({notes:{}}),this.save())}render(){return(0,o.h)("div",null,(0,o.h)("p",null,(0,o.h)("label",null,"Notes on “",this.state.currentPassage,"”")),(0,o.h)("p",null,(0,o.h)("textarea",{value:this.state.notes[this.state.currentPassage],onInput:e=>this.saveNote(this.state.currentPassage,e.target.value)})),(0,o.h)("p",null,(0,o.h)("button",{onClick:()=>this.export()},"Export All Notes"),(0,o.h)("button",{onClick:()=>this.startImport()},"Import Notes From File"),(0,o.h)("button",{onClick:()=>this.deleteAll()},"Delete All Notes")),(0,o.h)("input",{type:"file",hidden:!0,ref:e=>this.upload=e,onChange:()=>this.import()}))}componentDidMount(){i.default.on("state-change",this.syncBound)}componentDidUnmount(){i.default.removeListener("state-change",this.syncBound)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return(0,r.h)("div",null,(0,r.h)(i.default,null),(0,r.h)(o.default,null))};var r=n(2),o=s(n(50)),i=s(n(51));function s(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(2),i=n(0),s=n(10),a=(r=s)&&r.__esModule?r:{default:r};t.default=class extends o.Component{constructor(e){super(e),this.state={snapshots:[]},this.restore()}addSnapshot(){const e=window.prompt("Enter a name for this snapshot:");e&&this.setState({snapshots:this.state.snapshots.concat({name:e,state:(0,i.saveToObject)()})})}loadSnapshot(e){(0,i.restoreFromObject)(this.state.snapshots[e].state)}deleteSnapshot(e){window.confirm(`Are you sure you want to delete the snapshot "${this.state.snapshots[e].name}"? This cannot be undone.`)&&this.setState({snapshots:this.state.snapshots.filter((t,n)=>n!==e)})}save(){window.localStorage.setItem(`cb-snapshots-${(0,i.get)("config.state.saveKey")}`,JSON.stringify(this.state.snapshots))}restore(){const e=window.localStorage.getItem(`cb-snapshots-${(0,i.get)("config.state.saveKey")}`);e&&this.setState({snapshots:JSON.parse(e)})}render(){const e=this.state.snapshots.map((e,t)=>(0,o.h)("div",{class:"segmented-button block"},(0,o.h)("button",{onClick:()=>this.loadSnapshot(t),title:'Load snapshot "{s.name}"'},e.name),(0,o.h)("button",{onClick:()=>this.deleteSnapshot(t),class:"fixed",title:'Delete snapshot "{s.name}"'},(0,o.h)("strong",null,"×"))));return(0,o.h)(a.default,{title:"Snapshots"},e,(0,o.h)("button",{class:"block",onClick:()=>this.addSnapshot()},"Add Snapshot"))}componentDidUpdate(){this.save()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=a(n(10)),i=n(0),s=a(n(1));function a(e){return e&&e.__esModule?e:{default:e}}t.default=class extends r.Component{constructor(e){super(e),this.state={varNames:[],showDefaults:!1},this.syncBound=(()=>this.syncWithState())}syncWithState(){this.setState({varNames:(0,i.varNames)(this.state.showDefaults)})}onChangeDefaults(e){this.setState({showDefaults:e.target.checked})}onChangeVar(e,t){(0,i.set)(t,JSON.parse(e.target.value))}render(){return(0,r.h)(o.default,{title:"Variables"},(0,r.h)("p",null,(0,r.h)("input",{type:"checkbox",id:"cb-backstage-show-defaults",checked:this.state.showDefaults,onChange:e=>this.onChangeDefaults(e)}),(0,r.h)("label",{for:"cb-backstage-show-defaults"},"Show Defaults")),(0,r.h)("table",null,this.state.varNames.map(e=>(0,r.h)("tr",null,(0,r.h)("td",null,e),(0,r.h)("td",null,(0,r.h)("input",{type:"text",value:JSON.stringify((0,i.get)(e)),onChange:t=>this.onChangeVar(t,e)}))))))}componentWillMount(){this.syncWithState(),s.default.on("state-change",this.syncBound)}componentDidUpdate(e,t){t.showDefaults!==this.state.showDefaults&&this.syncWithState()}componentWillUnmount(){s.default.removeListener("state-change",this.syncBound)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return(0,r.h)("div",null,(0,r.h)(o.default,null),(0,r.h)(i.default,{title:"Page",prefix:"page"}),(0,r.h)(i.default,{title:"Header",prefix:"page.header"}),(0,r.h)(i.default,{title:"Footer",prefix:"page.footer"}))};var r=n(2),o=s(n(53)),i=s(n(54));function s(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=n(0),i=a(n(10)),s=a(n(1));function a(e){return e&&e.__esModule?e:{default:e}}const l=["page","page.header","page.footer"].reduce((e,t)=>e.concat([`config.style.${t}.font`,`config.style.${t}.color`,`config.style.${t}.link.font`,`config.style.${t}.link.color`,`config.style.${t}.link.lineColor`,`config.style.${t}.link.active.font`,`config.style.${t}.link.active.color`,`config.style.${t}.link.active.lineColor`]),[]);t.default=class extends r.Component{constructor(e){super(e),this.state=l.reduce((e,t)=>(e[t]=(0,o.get)(t),e),{}),this.onStateChangeBound=(({name:e,value:t})=>this.onStateChange(e,t))}onStateChange(e,t){this.state[e]&&this.setState({[e]:t})}render(){const e=Object.keys(this.state).reduce((e,t)=>{const n=(0,o.get)(t);return n?e+`${t}: ${JSON.stringify(n)}\n`:e},"").trim();return(0,r.h)(i.default,{title:"Config"},(0,r.h)("p",null,(0,r.h)("label",{for:"cb-backstage-style-config"},"Enter this code into your first passage’s vars section to permanently use this style:")),(0,r.h)("p",null,(0,r.h)("textarea",{readonly:!0,id:"cb-backstage-style-config",onClick:e=>e.target.select()},e)))}componentWillMount(){s.default.on("state-change",this.onStateChangeBound)}componentWillUnmount(){s.default.removeListener("state-change",this.onStateChangeBound)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({title:e,prefix:t}){return(0,r.h)(o.default,{title:e,initiallyOpen:!1},(0,r.h)(i.default,{label:"Font",binding:`config.style.${t}.font`}),(0,r.h)(i.default,{label:"Color",binding:`config.style.${t}.color`}),(0,r.h)(i.default,{label:"Link Font",binding:`config.style.${t}.link.font`}),(0,r.h)(i.default,{label:"Link Color",binding:`config.style.${t}.link.color`}),(0,r.h)(i.default,{label:"Link Line Color",binding:`config.style.${t}.link.lineColor`}),(0,r.h)(i.default,{label:"Active Link Font",binding:`config.style.${t}.link.active.font`}),(0,r.h)(i.default,{label:"Active Link Color",binding:`config.style.${t}.link.active.color`}),(0,r.h)(i.default,{label:"Active Link Line Color",binding:`config.style.${t}.link.active.lineColor`}))};var r=n(2),o=s(n(10)),i=s(n(55));function s(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({label:e,binding:t}){return(0,r.h)("p",{class:"input-group"},(0,r.h)("label",{for:`cb-backstage-${t}`},e),(0,r.h)("input",{type:"text",id:`cb-backstage-${t}`,value:(0,o.get)(t),onChange:e=>(0,o.set)(t,e.target.value)}))};var r=n(2),o=n(0)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2);n(57);t.default=class extends r.Component{constructor(e){super(e),this.state={selected:0}}select(e){this.setState({selected:e})}render(){const e=this.props.children.map((e,t)=>(0,r.h)("li",null,(0,r.h)("button",{onClick:()=>this.select(t),class:t===this.state.selected&&"active"},e.attributes.label)));return(0,r.h)("div",null,(0,r.h)("ul",{class:"tabs"},e),(0,r.h)("div",{class:"tab-content"},this.props.children[this.state.selected]))}}},function(e,t,n){},function(e,t,n){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){window.engine={extend:function(e,t){var n=s.get("engine.version"),r=d(e),o=d(n);o[0]<r[0]?f("The current engine version ("+n+") has a lower major version than requested ("+e+"); skipping"):(o[0]>r[0]?f("The current engine version ("+n+") has a higher major version than requested ("+e+"); running code but you may encounter problems"):(o[1]<r[1]&&f("The current engine version ("+n+") has a lower minor version than requested ("+e+"); running code but you may encounter problems"),o[1]===r[1]&&o[2]<r[2]&&f("The current engine version ("+n+") has a lower patch version than requested ("+e+"); running code but you may encounter problems")),t())},event:r.default,log:o.log,render:l.render,state:s,story:a,warn:o.warn}};var r=c(n(1)),o=n(4),i=c(o),s=u(n(0)),a=u(n(6)),l=n(11);function u(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function c(e){return e&&e.__esModule?e:{default:e}}var f=(0,i.default)("extensibility").warn;function d(e){return e.split(".").map(window.parseInt)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=v(n(61)),o=v(n(62)),i=v(n(63)),s=v(n(73)),a=v(n(74)),l=v(n(75)),u=v(n(76)),c=v(n(77)),f=v(n(78)),d=v(n(79)),p=v(n(80)),h=v(n(81)),g=v(n(82)),m=v(n(83));function v(e){return e&&e.__esModule?e:{default:e}}t.default=[r.default,o.default,i.default,s.default,a.default,l.default,u.default,c.default,f.default,d.default,p.default,h.default,g.default,m.default]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.default={match:/^(no )?ambient\s+sound/i,render:function(e,t){var n=(0,r.get)("sound.ambient");if(n&&Object.keys(n).forEach(function(t){t!==e&&n[t].playing&&(0,r.set)("sound.ambient."+t+".playing",!1)}),e){var o=(0,r.get)("sound.ambient."+e+".description")||"";return t.volume&&(0,r.set)("sound.ambient."+e+".volume",t.volume),(0,r.set)("sound.ambient."+e+".playing",!0),"<audio>"+o+"</audio>"}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(17),o=n(0);t.default={match:/^back\s+link/i,render:function(e,t){var n=(0,o.get)("trail");return(0,r.renderLink)(n.length>1?n[n.length-2]:n[0],t.label||"Back")}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),o=n(0),i=a(n(1)),s=a(n(5));function a(e){return e&&e.__esModule?e:{default:e}}t.default={match:/^cycling\s+link(\s+for)?/i,render:function(e,t){var n=void 0;return e?void 0===(n=(0,o.get)(e))&&((0,o.set)(e,t.choices[0]),n=t.choices[0]):n=t.choices[0],(0,s.default)("a",{href:"javascript:void(0)","data-cb-cycle-set":e||void 0,"data-cb-cycle-choices":JSON.stringify(t.choices)},[n])}},i.default.on("dom-click",function(e){if(e.dataset.cbCycleChoices){var t=JSON.parse(e.dataset.cbCycleChoices),n=t.indexOf(e.textContent)+1;n===t.length&&(n=0),(0,r.changeBody)(function(){return e.textContent=t[n]}),e.dataset.cbCycleSet&&(0,o.set)(e.dataset.cbCycleSet,t[n])}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.none=function(e,t){return new Promise(function(n){e.innerHTML="<div>"+t+"</div>",n()})},t.fadeInOut=function(e,t,n){return new Promise(function(r){var o=e.style.pointerEvents,s=(0,i.default)(n,"s")/2;a(e),e.style.pointerEvents="none";var u=document.createElement("div");if(u.innerHTML=t,u.style.visibility="hidden",u.style.animationDuration=s+"s",u.addEventListener("animationend",function t(){u.removeEventListener("animationend",t),u.className="",u.style.animationDuration=s+"s",e.style.pointerEvents=o,r()}),""!==e.innerHTML.trim()){var c=l(e);c.style.position="absolute",c.style.top="0",c.style.left="0",c.className="fade-out",c.style.animationDuration=s+"s",c.addEventListener("animationend",function e(){c.removeEventListener("animationend",e),c.parentNode.removeChild(c),u.style.visibility="visible",u.className="fade-in"}),e.innerHTML="",e.appendChild(u),e.appendChild(c)}else u.className="fade-in",u.animationDuration=2*s,u.style.visibility="visible",u.className="fade-in",e.appendChild(u)})},t.crossfade=function(e,t,n){return new Promise(function(r){var o=e.style.pointerEvents,s=(0,i.default)(n,"s");a(e),e.style.pointerEvents="none";var u=document.createElement("div");if(u.innerHTML=t,u.className="fade-in",u.style.animationDuration=s+"s",u.addEventListener("animationend",function t(){u.removeEventListener("animationend",t),u.style.animationDuration=null,u.className="",e.style.pointerEvents=o,r()}),""!==e.innerHTML.trim()){var c=l(e);c.style.position="absolute",c.style.top="0",c.style.left="0",c.className="fade-out",c.style.animationDuration=s+"s",c.addEventListener("animationend",function e(){c.removeEventListener("animationend",e),c.style.opacity=.5,c.parentNode.removeChild(c)}),e.innerHTML="",e.appendChild(u),e.appendChild(c)}else e.innerHTML="",e.appendChild(u)})};var r,o=n(13),i=(r=o)&&r.__esModule?r:{default:r},s=n(7);function a(e){"static"===window.getComputedStyle(e).position&&(e.style.position="relative")}function l(e){var t=document.createElement(e.nodeName.toLowerCase());return t.innerHTML=e.innerHTML,t.style.width=e.clientWidth+"px",t.style.height=e.clientHeight+"px",t.setAttribute("aria-hidden",!0),t.style.pointerEvents="none",(0,s.selectAll)(t,"audio").forEach(function(e){return e.parentNode.removeChild(e)}),t}n(65)},function(e,t,n){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.init=function(){window.addEventListener("error",a),window.addEventListener("unhandledrejection",function(e){return a(e.reason)})};var r,o=n(67),i=(r=o)&&r.__esModule?r:{default:r},s=n(0);function a(e){try{var t="";t=(t=e.error&&e.error.stack?e.message+"\n\nStack trace:\n"+e.error.stack:e.message+"\n\n[No stack trace available]").replace("\nPlease report this to https://github.com/chjj/marked.","");var n=document.createElement("div"),r=document.querySelector("#page article"),o=(0,s.get)("trail");n.className="error",n.innerHTML="\n\t\t\t<p>\n\t\t\tAn unexpected error has occurred.\n\t\t\t</p>\n\t\t\t<pre>"+((0,s.get)("config.testing")?t:"")+'</pre>\n\t\t\t<ul>\n\t\t\t\t<li>\n\t\t\t\t\t<a href="javascript:void(0)" '+(o.length>1?"data-cb-back":"data-cb-refresh")+'>Go back</a> to the previous passage.\n\t\t\t\t</li>\n\t\t\t\t<li>\n\t\t\t\t\t<a href="javascript:void(0)" data-cb-hard-restart>Hard restart</a>, clearing all progress and beginning from the start.\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t',n.addEventListener("click",function(e){if((0,i.default)(e.target,"[data-cb-back]",!0)){var t=(0,s.get)("trail");Array.isArray(t)?(0,s.set)("trail",t.slice(0,t.length-1)):window.alert("Sorry, going back was not successful. Please try hard restarting.")}else{if((0,i.default)(e.target,"[data-cb-refresh]",!0))(0,s.set)("trail",[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}((0,s.get)("trail"))));else(0,i.default)(e.target,"[data-cb-hard-restart]",!0)&&((0,s.purgeFromStorage)(!0),window.location.reload())}}),r.innerHTML="",r.appendChild(n)}catch(e){console.error(e)}}},function(e,t,n){var r=n(68);e.exports=function(e,t,n){for(var o=n?e:e.parentNode;o&&o!==document;){if(r(o,t))return o;o=o.parentNode}}},function(e,t){var n=Element.prototype,r=n.matchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector;e.exports=function(e,t){if(r)return r.call(e,t);for(var n=e.parentNode.querySelectorAll(t),o=0;o<n.length;++o)if(n[o]==e)return!0;return!1}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.init=function(){var e=window.console.warn,t=document.querySelector("#page .warnings");console.warn=function(){for(var n=arguments.length,i=Array(n),s=0;s<n;s++)i[s]=arguments[s];if((0,o.get)("config.testing"))try{t.removeAttribute("hidden"),i.forEach(function(e){var n=document.createElement("li");n.className="warning",n.innerHTML="Warning: "+(0,r.default)(e),t.appendChild(n)})}catch(e){}e.apply(window.console,i)},i.default.on("state-change",function(e){var n=e.name;"trail"===n&&(t.setAttribute("hidden",""),t.innerHTML="")})};var r=s(n(19)),o=n(0),i=s(n(1));function s(e){return e&&e.__esModule?e:{default:e}}n(70)},function(e,t,n){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n=Date.now(),r=void 0,o=(0,s.selectAll)(e,"[data-cb-skippable]").map(function(e){return{el:e,delay:1e3*(0,i.default)(window.getComputedStyle(e).animationDelay)}}).sort(function(e,t){return e.delay-t.delay});if(0===o.length)return;function a(){var e=Date.now()-n,t=Object.assign({},o.find(function(t){return t.delay>e}));t?(o.forEach(function(e){e.delay<=t.delay?(e.delay=0,e.el.classList.add("skip-animation")):(e.delay-=t.delay,e.el.style.animationDelay=e.delay+"ms")}),n=Date.now(),window.clearTimeout(r),l()):u()}function l(){r&&window.clearTimeout(r),r=window.setTimeout(u,o[o.length-1].delay)}function u(){t.classList.remove("visible"),document.body.removeEventListener("click",a),document.body.removeEventListener("keyup",a)}t.classList.add("visible"),l(),window.setTimeout(function(){document.body.addEventListener("click",a),document.body.addEventListener("keyup",a)},50)};var r,o=n(13),i=(r=o)&&r.__esModule?r:{default:r},s=n(7)},function(e,t,n){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(5),i=(r=o)&&r.__esModule?r:{default:r};t.default={match:/^embed\s+flickr(\s+image)?/i,render:function(e,t){return(0,i.default)("img",Object.assign({},t,{src:/img src="(.+?)"/.exec(e)[1]}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(5),i=(r=o)&&r.__esModule?r:{default:r};t.default={match:/^embed\s+image?/i,render:function(e,t){return(0,i.default)("img",Object.assign({},t,{src:e}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(6),o=n(11);t.default={match:/^embed\s+passage(\s+named)?/i,render:function(e){return(0,o.render)((0,r.passageNamed)(e).source)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(5),i=(r=o)&&r.__esModule?r:{default:r};t.default={match:/^embed\s+unsplash(\s+image)?/i,render:function(e,t){return(0,i.default)("img",Object.assign({},t,{src:"https://source.unsplash.com/"+e.replace(/.*\//,"")+"/"+t.width+"x"+t.height}))}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(5),i=(r=o)&&r.__esModule?r:{default:r};t.default={match:/^embed\s+youtube(\s+video)?/i,render:function(e,t){var n="https://www.youtube-nocookie.com/embed/"+e.replace(/.*\?v=/,"")+"?modestbranding=1&rel=0&controls="+(t.controls?1:0)+"&";return t.autoplay&&(n+="autoplay=1&"),t.loop&&(n+="loop=1&"),(0,i.default)("div",{style:"position: relative; height: 0; padding-bottom: 56.25%; margin-bottom: 1em"},[(0,o.domify)("iframe",{src:n,frameBorder:0,style:"position: absolute; top: 0; left: 0; width: 100%; height: 100%"})])}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(17);t.default={match:/^link\s+to/i,render:function(e,t){return(0,r.renderLink)(e,t.label)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(1)),o=n(0),i=n(5),s=a(i);function a(e){return e&&e.__esModule?e:{default:e}}t.default={match:/^dropdown menu(\s+for)?/i,render:function(e,t){var n=void 0;return e&&void 0===(n=(0,o.get)(e))&&((0,o.set)(e,t.choices[0]),n=t.choices[0]),(0,s.default)("select",{"data-cb-menu-set":e||void 0},t.choices.map(function(t){var r={value:t};return e&&n===t&&(r.selected=""),(0,i.domify)("option",r,[t])}))}},r.default.on("dom-change",function(e){e.dataset.cbMenuSet&&(0,o.set)(e.dataset.cbMenuSet,e.querySelectorAll("option")[e.selectedIndex].value)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(5),i=(r=o)&&r.__esModule?r:{default:r};t.default={match:/^restart\s+link/i,render:function(e,t){return(0,i.default)("a",{href:"javascript:void(0)","data-cb-restart":!0},[t.label||"Restart"])}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(12),o=l(n(1)),i=l(n(5)),s=n(6),a=n(11);function l(e){return e&&e.__esModule?e:{default:e}}t.default={match:/^reveal\s+link/i,render:function(e,t){return t.text?(0,i.default)("a",{href:"javascript:void(0)","data-cb-reveal-text":t.text},[e]):t.passage?(0,i.default)("a",{href:"javascript:void(0)","data-cb-reveal-passage":t.passage},[e]):void 0}},o.default.on("dom-click",function(e){var t=e.dataset.cbRevealText;if(e.dataset.cbRevealPassage&&(t=(0,s.passageNamed)(e.dataset.cbRevealPassage).source),t){var n=document.createElement("div");n.innerHTML=(0,a.render)(t).trim(),(0,r.changeBody)(function(){var t=n.children.length;if(t>0){var r=document.createElement("span");if(r.innerHTML=n.firstChild.innerHTML,e.parentNode.insertBefore(r,e),n.removeChild(n.firstChild),t>1){for(var o=n.lastChild;n.lastChild;)e.parentNode.parentNode.insertBefore(n.lastChild,e.parentNode.nextSibling);for(;e.nextSibling;)o.insertBefore(e.nextSibling,null)}}e.parentNode.removeChild(e)})}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.default={match:/^sound\s+effect/i,render:function(e,t){var n=(0,r.get)("sound.effect."+e+".description")||"";return t.volume&&(0,r.set)("sound.effect."+e+".volume",t.volume),(0,r.set)("sound.effect."+e+".playing",!0),"<audio>"+n+"</audio>"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=s(n(1)),o=n(0),i=s(n(5));function s(e){return e&&e.__esModule?e:{default:e}}t.default={match:/^text\s+input(\s+for)?/i,render:function(e,t){return(0,i.default)("input",{type:"text",value:e?(0,o.get)(e):"","data-cb-text-field-set":e||void 0,required:!1!==t.required?"":void 0})}},r.default.on("dom-change",function(e){e.dataset.cbTextFieldSet&&(0,o.set)(e.dataset.cbTextFieldSet,e.value)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=f(n(85)),o=f(n(86)),i=f(n(87)),s=f(n(88)),a=f(n(89)),l=f(n(90)),u=f(n(91)),c=f(n(93));function f(e){return e&&e.__esModule?e:{default:e}}t.default=[r.default,o.default,i.default,s.default,a.default,l.default,u.default,c.default]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(n(13)),o=i(n(21));function i(e){return e&&e.__esModule?e:{default:e}}t.default={match:/^after\s/i,process:function(e,t){var n=t.invocation,i=(0,r.default)(n.replace(/^after\s/i,""),"ms");e.text=(0,o.default)(e.text,{"data-cb-skippable":"",class:"fade-in",style:"animation-delay: "+i+"ms"})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(21),i=(r=o)&&r.__esModule?r:{default:r};t.default={match:/^align\s+(left|right|center)/i,process:function(e,t){var n=t.invocation.replace(/^align\s+/i,"");e.text=(0,i.default)(e.text,{style:"display: block; text-align: "+n})}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={match:/^append$/i,process:function(e){e.startsNewParagraph=!1}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={match:/^if(always|never)?\s|else$|unless\s/i,processRaw:function(e,t){var n=t.invocation,r=t.state,o=n.replace(/\s.*/,"").toLowerCase(),i=void 0;switch("else"!==o&&(i=new Function("return "+n.replace(/.*?\s/,""))),o){case"if":r.conditionEval=i.apply(window);break;case"ifalways":r.conditionEval=!0;break;case"ifnever":r.conditionEval=!1;break;case"unless":r.conditionEval=!i.apply(window);break;case"else":if(void 0===r.conditionEval)throw new Error("There was no matching if modifier for an else modifier.");r.conditionEval=!r.conditionEval}r.conditionEval||(e.text="")}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={match:/^continued?|cont('d)?$/i,process:function(){}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={match:/^css$/i,process:function(e){e.text="<style>"+e.text+"</style>"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(92),i=(r=o)&&r.__esModule?r:{default:r},s=n(0);t.default={match:/^javascript$/i,process:function(e){try{var t=new Function("\n\t\t\t\t\t\tfunction write() { write.__out += write.__join.call(arguments, ''); }\n\t\t\t\t\t\twrite.__out = '';\n\t\t\t\t\t\twrite.__join = Array.prototype.join;\n\t\t\t\t\t\t"+(0,i.default)(e.text)+";\n\t\t\t\t\t\treturn write.__out;\n\t\t\t\t\t");e.text=t.apply(window)}catch(t){if(!(0,s.get)("config.testing"))throw t;var n="unknown error";n=t.error&&t.error.stack?t.error.stack:t.message+"\n[No stack trace available]",e.text='<div class="error">An error occured evaluating:<pre>'+e.text+"</pre><p><pre>"+n+"</pre></p></div>"}}}},function(e,t,n){(function(t){var n=1/0,r="[object Symbol]",o=/&(?:amp|lt|gt|quot|#39|#96);/g,i=RegExp(o.source),s="object"==typeof t&&t&&t.Object===Object&&t,a="object"==typeof self&&self&&self.Object===Object&&self,l=s||a||Function("return this")();var u,c=(u={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},function(e){return null==u?void 0:u[e]}),f=Object.prototype.toString,d=l.Symbol,p=d?d.prototype:void 0,h=p?p.toString:void 0;function g(e){if("string"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&f.call(e)==r}(e))return h?h.call(e):"";var t=e+"";return"0"==t&&1/e==-n?"-0":t}e.exports=function(e){var t;return(e=null==(t=e)?"":g(t))&&i.test(e)?e.replace(o,c):e}}).call(this,n(16))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={match:/^(note(\s+to\s+self)?|n?b?|todo|fixme)$/i,process:function(e){e.text=""}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var s,a=e[Symbol.iterator]();!(r=(s=a.next()).done)&&(n.push(s.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.default=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u,n={vars:[],blocks:[]},i=e.split(t.varsSep,2),s=void 0,c=void 0;if(2===i.length){a("Detected vars section");var f=r(i,2);s=f[0],c=f[1],(0,o.default)(s).forEach(function(e){if(""!==e.trim()){var t=e.indexOf(":");if(-1!==t){var r=e.substr(0,t).trim(),o=e.substr(t+1).trim(),i={name:r,value:new Function("return ("+o+")")},s=r.match(/\(.+\)/);s?(i.condition=new Function("return ("+s[0]+")"),i.name=(i.name.substr(0,s.index)+i.name.substr(s.index+s[0].length)).trim(),a('Setting variable "'+i.name+'" to "'+o+'" with condition ('+s[0]+")")):a('Setting variable "'+r+'" to "'+o+'" without condition'),n.vars.push(i)}else l('The line "'+e+'" in the vars section is missing a colon. It was ignored.')}})}else a("No vars section detected"),c=i[0];var d=function(e,t){var r=t.trim();""!==r&&(a("Creating '"+e+"' block with content: \""+r+'"'),n.blocks.push({type:e,content:r}))},p=new RegExp(t.modifierPattern),h=0,g=p.exec(c);for(;g;){d("text",c.substring(h,g.index));for(var m=g[1],v="",b=0;b<m.length;b++)switch(m[b]){case'"':for(v+='"',b+=1;b<m.length&&(v+=m[b],'"'!==m[b]||"\\"===m[b-1]);b++);break;case";":d("modifier",v),v="";break;default:v+=m[b]}d("modifier",v),h=p.lastIndex,g=p.exec(c)}return d("text",c.substring(h)),n};var o=i(n(95));function i(e){return e&&e.__esModule?e:{default:e}}var s=(0,i(n(4)).default)("parse"),a=s.log,l=s.warn,u={varsSep:/^--$/m,modifierPattern:/^\[([^[].+[^\]])\]$/gm}},function(e,t,n){"use strict";e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("Expected a string in the first argument, got "+typeof e);if(!(t&&t.preserveNewlines))return e.split(/\r?\n/);for(var n=e.split(/(\r?\n)/),r=[],o=0;o<n.length;o+=2)r.push(n[o]+(n[o+1]||""));return r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.markedOptions=void 0,t.default=function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e.vars)throw new Error("The renderer was given an object with no vars property.");if(!e.blocks)throw new Error("The renderer was given an object with no blocks property.");var i="";o||(c("Setting vars ("+e.vars.length+")"),e.vars.forEach(function(e){if(e.condition){var t=e.condition();t?(c('Setting var "'+name+'" (condition is currently true)'),(0,l.set)(e.name,e.value())):c('Not setting var "'+name+'" (condition is currently false)')}else c('Setting var "'+name+'"'),(0,l.set)(e.name,e.value())}));var u=[],d={};return e.blocks.forEach(function(e){switch(e.type){case"text":var r={text:e.content,startsNewParagraph:!0},o=u.filter(function(e){return!!e.mod.processRaw});c("Running "+o.length+" modifiers on raw source block"),o.forEach(function(e){e.mod.processRaw(r,{state:d[e.mod],invocation:e.invocation})}),r.text=(0,s.default)((0,a.default)(r.text),t);var l=u.filter(function(e){return!!e.mod.process});c("Running "+l.length+" modifiers on source block"),l.forEach(function(e){return e.mod.process(r,{state:d[e.mod],invocation:e.invocation})}),c("Output after modifiers: "+JSON.stringify(r)),""!==r.text.trim()&&(""!==i&&(i+=r.startsNewParagraph?"\n\n":" "),i+=r.text),u=[];break;case"modifier":var f=n.filter(function(t){return t.match.test(e.content)});if(1===f.length){var p=f[0];c('Activated "'+p.name+'" modifier matching ['+e.content+"]"),d[p]=d[p]||{},u.push({mod:p,invocation:e.content})}else 0===f.length?i+="\n\n["+e.content+"]\n\n":(console.warn('More than one modifier matched "['+e.content+']".'),i+="\n\n["+e.content+"]\n\n");break;default:throw new Error("Don't know how to render a block with type \""+e.type+'".')}}),r.default.setOptions(f),c("Final Markdown:\n"+i),(0,r.default)(i)};var r=u(n(22)),o=u(n(4)),i=u(n(97)),s=u(n(98)),a=u(n(17)),l=n(0);function u(e){return e&&e.__esModule?e:{default:e}}var c=(0,o.default)("render").log,f=t.markedOptions={renderer:i.default,smartypants:!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=n(22);var i=new((r=o)&&r.__esModule?r:{default:r}).default.Renderer;Object.assign(i,{blockquote:function(e){return'<div class="fork">'+e+"</div>"},del:function(e){return'<span class="small-caps">'+e+"</span>"}}),t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n="",r=0,i=e.indexOf("{");if(-1===i)return e;for(var s=!1,a=void 0,l=i+1;l<e.length;l++)switch(e[l]){case"{":i=l,s=!1;break;case'"':case"'":l>0&&"\\"!==e[l-1]&&(s?s&&a===e[l]&&(s=!1):(s=!0,a=e[l]));break;case"}":if(!s){var u=e.substring(i,l+1),c="";try{c=o(u,t)}catch(e){console.warn('An error occurred while rendering "'+u+'": '+e.message),c=u}void 0===c&&(c=""),n+=e.substring(r,i)+c,r=l+1,-1===(i=e.indexOf("{",r))&&(l=e.index)}}return n+e.substring(r)};var r=n(0);function o(e,t){var n=e.substr(1,e.length-2).trim();if(/\s/.test(n)){var o=n.match(/^[^:,]+/)[0],i=t.find(function(e){return e.match.test(o)});if(i){var s=n.replace(o,"");if(":"===s[0]){var a=new Function('return {"'+o+'" '+s+"}")(),l=a[o];return delete a[o],i.render(l,a,n)}if(","===s[0]){var u=new Function("return {"+s.substr(1)+"}")();return i.render(null,u,n)}if(""===s)return i.render(null,{},n)}}else{var c=(0,r.get)(n);if(void 0!==c)return c}return e}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,n){var r=e.volume,o=t-r,i=void 0,s=0;return new Promise(function(t){return window.requestAnimationFrame(function(a){i=a,window.requestAnimationFrame(function a(l){s+=l-i;e.volume=function(e,t,n,r){if((e/=r/2)<1)return n/2*e*e+t;return-n/2*(--e*(e-2)-1)+t}(s,r,o,n);s<n?(i=l,window.requestAnimationFrame(a)):t()})})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){(0,r.default)(u.setLookup),(0,o.default)(u.setLookup),(0,i.default)(u.setLookup),(0,s.default)(u.setLookup),(0,a.default)(u.setLookup),(0,l.default)(u.setLookup)};var r=c(n(101)),o=c(n(102)),i=c(n(104)),s=c(n(105)),a=c(n(24)),l=c(n(115)),u=n(0);function c(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e("browser.height",function(){return window.innerHeight}),e("browser.online",function(){return window.navigator.onLine}),e("browser.width",function(){return window.innerWidth})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e("engine.version",function(){return i.default.version})};var r,o=n(103),i=(r=o)&&r.__esModule?r:{default:r}},function(e){e.exports={name:"Chapbook",author:"Chris Klimas <chris@twinery.org>",description:'A Twine story format emphasizing ease of authoring, multimedia, and playability on many different types of devices. Visit the <a href="https://klembot.github.io/chapbook/guide/">guide</a> for more information.',version:"1.2.0",main:"index.js",license:"MIT",devDependencies:{"@commitlint/cli":"^8.3.5","@commitlint/config-conventional":"^8.3.4","babel-core":"^6.26.0","babel-loader":"^7.1.4","babel-preset-env":"^1.6.1","babel-preset-preact":"^1.1.0","child-process-promise":"^2.2.1",cpy:"^7.2.0","cpy-cli":"^2.0.0","cross-env":"^5.2.0","css-loader":"^0.28.11",eslint:"^4.14.0","eslint-config-prettier":"^6.11.0","gitbook-cli":"^2.3.2","html-webpack-plugin":"^3.2.0",husky:"^4.2.5",jest:"^24.7.1","jest-localstorage-mock":"^2.2.0",jsdoc:"^3.6.2","jstransformer-marked":"^1.0.3","lodash.escape":"^4.0.1","mini-css-extract-plugin":"^0.4.0","mock-local-storage":"^1.0.5","node-sass":"^4.12.0","npm-run-all":"^4.1.3",prettier:"^2.0.5",pug:"^2.0.3",rimraf:"^2.6.3","rollup-plugin-uglify":"^3.0.0","sass-loader":"^7.0.3","title-case":"^2.1.1","twine-utils":"^1.2.6","url-loader":"^1.1.2",webpack:"^4.28.2","webpack-cli":"^3.1.2","webpack-dev-server":"^3.1.12",yargs:"^11.0.0"},dependencies:{closest:"^0.0.1","get-value":"^3.0.1","lodash.unescape":"^4.0.1",marked:"^0.6.2",nanobus:"^4.3.3","open-color":"^1.6.3",preact:"^8.2.9","pure-color":"^1.3.0",seedrandom:"^2.4.3","set-value":"^3.0.1","split-lines":"^1.1.0",timestring:"^5.0.0","unset-value":"^1.0.0"},scripts:{start:"webpack-dev-server",build:"npm-run-all --parallel build:main build:micro --serial build:format clean","build:format":"node scripts/build-format.js","build:main":"cross-env NODE_ENV=production webpack","build:micro":"cross-env NODE_ENV=production CHAPBOOK_MICRO=y webpack",clean:"rimraf dist/full; rimraf dist/micro",examples:"node scripts/build-examples.js",guide:"gitbook serve guide","guide:init":"cd guide && gitbook install && cd ..","guide:release":"cd guide && gitbook build",lint:"eslint src/",prettier:'prettier --write "src/**/*.{js,scss}"',release:"run-s -l build examples guide:release website",test:"jest","test:watch":"jest --watch","test:coverage":"jest --coverage",website:"node scripts/build-website.js"},config:{commitizen:{path:"cz-conventional-changelog"}},husky:{hooks:{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},jest:{setupFiles:["jest-localstorage-mock"]}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e("now.second",function(){return(new Date).getSeconds()}),e("now.minute",function(){return(new Date).getMinutes()}),e("now.hour",function(){return(new Date).getHours()}),e("now.day",function(){return(new Date).getDate()}),e("now.weekday",function(){return(new Date).getDay()+1}),e("now.weekdayName",function(){return(new Date).toLocaleString(navigator.language,{weekday:"long"})}),e("now.month",function(){return(new Date).getMonth()+1}),e("now.monthName",function(){return(new Date).toLocaleString(navigator.language,{month:"long"})}),e("now.year",function(){return(new Date).getFullYear()}),e("now.timestamp",function(){return(new Date).toLocaleString(navigator.language,{hour:"numeric",minute:"numeric",second:"numeric"})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e("passage.name",function(){var e=(0,r.get)("trail");if(e)return e[e.length-1]}),e("passage.visits",function(){var e=(0,r.get)("trail"),t=(0,r.get)("passage.name");if(e)return e.reduce(function(e,n){return n===t?e+1:e},0)})};var r=n(0)},function(e,t,n){var r=n(107),o=n(108),i=n(109),s=n(110),a=n(111),l=n(112),u=n(113);u.alea=r,u.xor128=o,u.xorwow=i,u.xorshift7=s,u.xor4096=a,u.tychei=l,e.exports=u},function(e,t,n){(function(e){var r;!function(e,o,i){function s(e){var t,n=this,r=(t=4022871197,function(e){e=e.toString();for(var n=0;n<e.length;n++){var r=.02519603282416938*(t+=e.charCodeAt(n));r-=t=r>>>0,t=(r*=t)>>>0,t+=4294967296*(r-=t)}return 2.3283064365386963e-10*(t>>>0)});n.next=function(){var e=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=e-(n.c=0|e)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(e),n.s0<0&&(n.s0+=1),n.s1-=r(e),n.s1<0&&(n.s1+=1),n.s2-=r(e),n.s2<0&&(n.s2+=1),r=null}function a(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function l(e,t){var n=new s(e),r=t&&t.state,o=n.next;return o.int32=function(){return 4294967296*n.next()|0},o.double=function(){return o()+1.1102230246251565e-16*(2097152*o()|0)},o.quick=o,r&&("object"==typeof r&&a(r,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=l:n(3)&&n(9)?void 0===(r=function(){return l}.call(t,n,t,o))||(o.exports=r):this.alea=l}(0,e,n(3))}).call(this,n(8)(e))},function(e,t,n){(function(e){var r;!function(e,o,i){function s(e){var t=this,n="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:n+=e;for(var r=0;r<n.length+64;r++)t.x^=0|n.charCodeAt(r),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t}function l(e,t){var n=new s(e),r=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,r&&("object"==typeof r&&a(r,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=l:n(3)&&n(9)?void 0===(r=function(){return l}.call(t,n,t,o))||(o.exports=r):this.xor128=l}(0,e,n(3))}).call(this,n(8)(e))},function(e,t,n){(function(e){var r;!function(e,o,i){function s(e){var t=this,n="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,t.v=0,e===(0|e)?t.x=e:n+=e;for(var r=0;r<n.length+64;r++)t.x^=0|n.charCodeAt(r),r==n.length&&(t.d=t.x<<10^t.x>>>4),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function l(e,t){var n=new s(e),r=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,r&&("object"==typeof r&&a(r,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=l:n(3)&&n(9)?void 0===(r=function(){return l}.call(t,n,t,o))||(o.exports=r):this.xorwow=l}(0,e,n(3))}).call(this,n(8)(e))},function(e,t,n){(function(e){var r;!function(e,o,i){function s(e){var t=this;t.next=function(){var e,n,r=t.x,o=t.i;return e=r[o],n=(e^=e>>>7)^e<<24,n^=(e=r[o+1&7])^e>>>10,n^=(e=r[o+3&7])^e>>>3,n^=(e=r[o+4&7])^e<<7,e=r[o+7&7],n^=(e^=e<<13)^e<<9,r[o]=n,t.i=o+1&7,n},function(e,t){var n,r=[];if(t===(0|t))r[0]=t;else for(t=""+t,n=0;n<t.length;++n)r[7&n]=r[7&n]<<15^t.charCodeAt(n)+r[n+1&7]<<13;for(;r.length<8;)r.push(0);for(n=0;n<8&&0===r[n];++n);for(8==n?r[7]=-1:r[n],e.x=r,e.i=0,n=256;n>0;--n)e.next()}(t,e)}function a(e,t){return t.x=e.x.slice(),t.i=e.i,t}function l(e,t){null==e&&(e=+new Date);var n=new s(e),r=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,r&&(r.x&&a(r,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=l:n(3)&&n(9)?void 0===(r=function(){return l}.call(t,n,t,o))||(o.exports=r):this.xorshift7=l}(0,e,n(3))}).call(this,n(8)(e))},function(e,t,n){(function(e){var r;!function(e,o,i){function s(e){var t=this;t.next=function(){var e,n,r=t.w,o=t.X,i=t.i;return t.w=r=r+1640531527|0,n=o[i+34&127],e=o[i=i+1&127],n^=n<<13,e^=e<<17,n^=n>>>15,e^=e>>>12,n=o[i]=n^e,t.i=i,n+(r^r>>>16)|0},function(e,t){var n,r,o,i,s,a=[],l=128;for(t===(0|t)?(r=t,t=null):(t+="\0",r=0,l=Math.max(l,t.length)),o=0,i=-32;i<l;++i)t&&(r^=t.charCodeAt((i+32)%t.length)),0===i&&(s=r),r^=r<<10,r^=r>>>15,r^=r<<4,r^=r>>>13,i>=0&&(s=s+1640531527|0,o=0==(n=a[127&i]^=r+s)?o+1:0);for(o>=128&&(a[127&(t&&t.length||0)]=-1),o=127,i=512;i>0;--i)r=a[o+34&127],n=a[o=o+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,a[o]=r^n;e.w=s,e.X=a,e.i=o}(t,e)}function a(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function l(e,t){null==e&&(e=+new Date);var n=new s(e),r=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,r&&(r.X&&a(r,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=l:n(3)&&n(9)?void 0===(r=function(){return l}.call(t,n,t,o))||(o.exports=r):this.xor4096=l}(0,e,n(3))}).call(this,n(8)(e))},function(e,t,n){(function(e){var r;!function(e,o,i){function s(e){var t=this,n="";t.next=function(){var e=t.b,n=t.c,r=t.d,o=t.a;return e=e<<25^e>>>7^n,n=n-r|0,r=r<<24^r>>>8^o,o=o-e|0,t.b=e=e<<20^e>>>12^n,t.c=n=n-r|0,t.d=r<<16^n>>>16^o,t.a=o-e|0},t.a=0,t.b=0,t.c=-1640531527,t.d=1367130551,e===Math.floor(e)?(t.a=e/4294967296|0,t.b=0|e):n+=e;for(var r=0;r<n.length+20;r++)t.b^=0|n.charCodeAt(r),t.next()}function a(e,t){return t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t}function l(e,t){var n=new s(e),r=t&&t.state,o=function(){return(n.next()>>>0)/4294967296};return o.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},o.int32=n.next,o.quick=o,r&&("object"==typeof r&&a(r,n),o.state=function(){return a(n,{})}),o}o&&o.exports?o.exports=l:n(3)&&n(9)?void 0===(r=function(){return l}.call(t,n,t,o))||(o.exports=r):this.tychei=l}(0,e,n(3))}).call(this,n(8)(e))},function(e,t,n){var r;!function(o,i){var s,a=(0,eval)("this"),l=256,u=6,c="random",f=i.pow(l,u),d=i.pow(2,52),p=2*d,h=l-1;function g(e,t,n){var r=[],h=b(function e(t,n){var r,o=[],i=typeof t;if(n&&"object"==i)for(r in t)try{o.push(e(t[r],n-1))}catch(e){}return o.length?o:"string"==i?t:t+"\0"}((t=1==t?{entropy:!0}:t||{}).entropy?[e,y(o)]:null==e?function(){try{var e;return s&&(e=s.randomBytes)?e=e(l):(e=new Uint8Array(l),(a.crypto||a.msCrypto).getRandomValues(e)),y(e)}catch(e){var t=a.navigator,n=t&&t.plugins;return[+new Date,a,n,a.screen,y(o)]}}():e,3),r),g=new m(r),w=function(){for(var e=g.g(u),t=f,n=0;e<d;)e=(e+n)*l,t*=l,n=g.g(1);for(;e>=p;)e/=2,t/=2,n>>>=1;return(e+n)/t};return w.int32=function(){return 0|g.g(4)},w.quick=function(){return g.g(4)/4294967296},w.double=w,b(y(g.S),o),(t.pass||n||function(e,t,n,r){return r&&(r.S&&v(r,g),e.state=function(){return v(g,{})}),n?(i[c]=e,t):e})(w,h,"global"in t?t.global:this==i,t.state)}function m(e){var t,n=e.length,r=this,o=0,i=r.i=r.j=0,s=r.S=[];for(n||(e=[n++]);o<l;)s[o]=o++;for(o=0;o<l;o++)s[o]=s[i=h&i+e[o%n]+(t=s[o])],s[i]=t;(r.g=function(e){for(var t,n=0,o=r.i,i=r.j,s=r.S;e--;)t=s[o=h&o+1],n=n*l+s[h&(s[o]=s[i=h&i+t])+(s[i]=t)];return r.i=o,r.j=i,n})(l)}function v(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function b(e,t){for(var n,r=e+"",o=0;o<r.length;)t[h&o]=h&(n^=19*t[h&o])+r.charCodeAt(o++);return y(t)}function y(e){return String.fromCharCode.apply(0,e)}if(i["seed"+c]=g,b(i.random(),o),e.exports){e.exports=g;try{s=n(114)}catch(e){}}else void 0===(r=function(){return g}.call(t,n,t,e))||(e.exports=r)}([],Math)},function(e,t){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){e("story.name",r.name)};var r=n(6)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){[r.defaults,o.defaults,i.defaults,s.defaults,a.defaults,l.defaults,u.defaults].forEach(function(e){return Object.keys(e).forEach(function(t){"function"==typeof e[t]?(0,a.setDefault)(t,e[t]()):(0,a.setDefault)(t,e[t])})})};var r=n(12),o=n(4),i=n(24),s=n(23),a=n(0),l=n(25),u=n(11)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.init=function(){l.dataset.cbGoogleFontLoader="",l.setAttribute("hidden",!0),u.dataset.cbTypekitFontLoader="",u.setAttribute("hidden",!0),c.dataset.cbUrlFontLoader="",c.setAttribute("hidden",!0),document.body.appendChild(l),document.body.appendChild(u),document.body.appendChild(c),o.default.on("state-change",function(e){var t=e.name,n="config"===t||"config.style"===t||"config.style.fonts"===t;if(n){var r=(0,i.get)("config.style.fonts");if(!r)return;Object.keys(r).forEach(function(e){var t=r[e].name,n=r[e].url;t&&n&&d(e,n,t)})}else{var o=t.match(/^config\.style\.fonts\.([^.]+)/i);if(o){var s=o[1],c=(0,i.get)("config.style.fonts."+s+".name"),f=(0,i.get)("config.style.fonts."+s+".url");return void(f&&c&&(a("Adding font from URL ("+c+")"),d(s,f,c)))}}(0,i.sameObject)(t,"config.style.googleFont")&&(a("Adding Google font"),l.innerHTML=(0,i.get)("config.style.googleFont")),(0,i.sameObject)(t,"config.style.typekitFont")&&(a("Adding Typekit font"),u.innerHTML=(0,i.get)("config.style.typekitFont"))})};var r=s(n(4)),o=s(n(1)),i=n(0);function s(e){return e&&e.__esModule?e:{default:e}}var a=(0,r.default)("style").log,l=document.createElement("div"),u=document.createElement("div"),c=document.createElement("div"),f={};function d(e,t,n){var r=t.match(/\.(.+)$/);if(r&&r[1]){var o=r[1],i=f[e]||document.createElement("style");i.dataset.cbFontLoader=e,i.innerHTML='@font-face { font-family: "'+n+'"; src: url("'+t+'") format("'+o+'"); }',i.parentNode||c.appendChild(i)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.autopx=function(e){if("number"==typeof e)return e+"px";return e},t.parseColorValue=a,t.parseColor=function(e){if(void 0===e)return{"background-color":"inherit",color:"inherit"};if("string"!=typeof e)throw new Error("Only strings can be parsed as colors.");var t={color:"inherit","background-color":"inherit"},n=e.split(/ on /i);t.color=a(n[0].trim().toLowerCase()),2===n.length&&(t["background-color"]=a(n[1].trim().toLowerCase()));return t},t.parseFont=function(e){var t={"font-family":"inherit","font-size":"inherit","font-style":"inherit","font-weight":"inherit","letter-spacing":"inherit","text-decoration":"inherit","text-transform":"inherit"};if(void 0===e)return t;if("string"!=typeof e)throw new Error("Only strings can be parsed as fonts.");function n(e,t){e["font-family"]=t.split("/").map(function(e){var t=e;return'"'!==t[0]&&(t='"'+t),'"'!==t[t.length-1]&&(t+='"'),t}).join(",")}function r(e){e["font-weight"]="bold"}function o(e){e["font-style"]="italic"}function i(e){e["font-style"]="none",e["font-weight"]="normal",e["letter-spacing"]="normal",e["text-decoration"]="none",e["text-transform"]="none"}function s(e){e["letter-spacing"]="0.075em",e["text-transform"]="uppercase",e["font-size"]&&"inherit"!==e["font-size"]?e["font-size"]="calc(0.7 * "+e["font-size"]+")":e["font-size"]="70%"}function a(e){e["text-decoration"]="underline"}var l=/\b\d+(?:\.\d+)?(ch|cm|ex|in|mm|pc|pt|px|r?em|vh|vmax|vmin|vw|%)?/i.exec(e);if(l){/^\d+$/.test(l[0])?t["font-size"]=l[0]+"px":t["font-size"]=l[0],0!==l.index&&n(t,e.substr(0,l.index).trim());var u=e.substr(l.index);/\bregular\b/i.test(u)?(t["font-style"]="none",t["font-weight"]="normal",t["letter-spacing"]="normal",t["text-decoration"]="none",t["text-transform"]="none"):(/\bbold\b/.test(u)&&r(t),/\bitalics?\b/.test(u)&&o(t),/\bunderlined?/.test(u)&&a(t),/\bsmall caps?\b/.test(u)&&s(t))}else{for(var c=void 0,f=e;c=/(bold|italics?|regular|small caps|underlined?)$/.exec(f);){switch(c[0]){case"bold":r(t);break;case"italic":case"italics":o(t);break;case"regular":i(t);break;case"small caps":s(t);break;case"underline":case"underlined":a(t)}f=f.substr(0,c.index).trim()}""!==f.trim()&&n(t,f)}return t};var r=s(n(119)),o=s(n(120)),i=s(n(125));function s(e){return e&&e.__esModule?e:{default:e}}function a(e){if("string"!=typeof e)throw new Error("Only strings can be parsed as color values.");r.default[e]&&(e=Array.isArray(r.default[e])?r.default[e][r.default[e].length-1]:r.default[e]);var t=/^(\w+)-(\d)$/.exec(e);t&&r.default[t[1]]&&(e=r.default[t[1]][t[2]]);var n=(0,o.default)(e),s=(0,i.default)(n);return s[3]=void 0!==n[3]?n[3]:1,"hsla("+s[0]+", "+s[1]+"%, "+s[2]+"%, "+s[3]+")"}},function(e){e.exports={white:"#ffffff",black:"#000000",gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]}},function(e,t,n){var r=n(121),o=n(122),i=n(123),s=n(124);var a={"#":o,hsl:function(e){var t=r(e),n=s(t);return 4===t.length&&n.push(t[3]),n},rgb:i};function l(e){for(var t in a)if(0===e.indexOf(t))return a[t](e)}l.rgb=i,l.hsl=r,l.hex=o,e.exports=l},function(e,t,n){var r=n(26),o=n(27);function i(e,t){switch(e=parseFloat(e),t){case 0:return o(e,0,360);case 1:case 2:return o(e,0,100);case 3:return o(e,0,1)}}e.exports=function(e){return r(e).map(i)}},function(e,t){e.exports=function(e){4!==e.length&&5!==e.length||(e=function(e){for(var t="#",n=1;n<e.length;n++){var r=e.charAt(n);t+=r+r}return t}(e));var t=[parseInt(e.substring(1,3),16),parseInt(e.substring(3,5),16),parseInt(e.substring(5,7),16)];if(9===e.length){var n=parseFloat((parseInt(e.substring(7,9),16)/255).toFixed(2));t.push(n)}return t}},function(e,t,n){var r=n(26),o=n(27);function i(e,t){return t<3?-1!=e.indexOf("%")?Math.round(255*o(parseInt(e,10),0,100)/100):o(parseInt(e,10),0,255):o(parseFloat(e),0,1)}e.exports=function(e){return r(e).map(i)}},function(e,t){e.exports=function(e){var t,n,r,o,i,s=e[0]/360,a=e[1]/100,l=e[2]/100;if(0==a)return[i=255*l,i,i];t=2*l-(n=l<.5?l*(1+a):l+a-l*a),o=[0,0,0];for(var u=0;u<3;u++)(r=s+1/3*-(u-1))<0&&r++,r>1&&r--,i=6*r<1?t+6*(n-t)*r:2*r<1?n:3*r<2?t+(n-t)*(2/3-r)*6:t,o[u]=255*i;return o}},function(e,t){e.exports=function(e){var t,n,r=e[0]/255,o=e[1]/255,i=e[2]/255,s=Math.min(r,o,i),a=Math.max(r,o,i),l=a-s;return a==s?t=0:r==a?t=(o-i)/l:o==a?t=2+(i-r)/l:i==a&&(t=4+(r-o)/l),(t=Math.min(60*t,360))<0&&(t+=360),n=(s+a)/2,[t,100*(a==s?0:n<=.5?l/(a+s):l/(2-a-s)),100*n]}},function(e,t,n){}]);</script></body></html>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
:: StoryData
|
|
2
|
+
{
|
|
3
|
+
"ifid": "E70FC479-01D9-4E44-AC6A-AFF9F5E1C475",
|
|
4
|
+
"format": "Chapbook",
|
|
5
|
+
"format-version": "1.1.0",
|
|
6
|
+
"zoom": 1,
|
|
7
|
+
"start": "StoryTitle"
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
:: StoryTitle
|
|
11
|
+
Example1
|
|
12
|
+
|
|
13
|
+
:: Untitled Passage {"position":"200,102","size":"100,100"}
|
|
14
|
+
[[Another passage]]
|
|
15
|
+
|
|
16
|
+
:: Another passage {"position":"200,252","size":"100,100"}
|
|
17
|
+
[[A third]]
|
|
18
|
+
|
|
19
|
+
:: A third {"position":"200,402","size":"100,100"}
|
|
20
|
+
Double-click this passage to edit it.
|
|
21
|
+
|