-
Notifications
You must be signed in to change notification settings - Fork 1
/
template.html
36 lines (30 loc) · 21.1 KB
/
template.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<title>Castle Game Template</title>
<style></style>
</head>
<body>
<tw-story tags></tw-story>
<tw-storydata name="Castle Game Template" startnode="1" creator="Twine" creator-version="2.3.5" ifid="9518FFEF-087A-456A-B47D-EAF4049C8990" zoom="1" format="twine-wonder" format-version="0.9.1" options="" hidden><style role="stylesheet" id="twine-user-stylesheet" type="text/twine-css"> body {
background: black;
}
.text {
background: beige;
padding: 12px;
margin-top: 400px;
}
.page {
background: url(img/image-castle-web.jpg) no-repeat;
background-size: cover;
}
</style>
<script role="script" id="twine-user-script" type="text/twine-javascript"></script><tw-passagedata pid="1" name="EnterTheCastle" tags="" position="912,53" size="100,100">Вы прибыли к замку поздно ночью. Крупные нетопыри уже летали над башнями в свете полной луны. Их противный писк был слышен за сотни шагов.
[[Достать арбалет|entry-fight]]
[[- Да ну на... (развернуться и убежать)|run]]
[[Посвистеть нетопырям в ответ|whistle]]
</tw-passagedata><tw-passagedata pid="2" name="entry-fight" tags="" position="702,197" size="100,100">Double-click this passage to edit it.</tw-passagedata><tw-passagedata pid="3" name="run" tags="" position="907,195" size="100,100">Double-click this passage to edit it.</tw-passagedata><tw-passagedata pid="4" name="whistle" tags="" position="1106,205" 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=6)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.STORY_SELECTOR="tw-storydata",t.PASSAGE_SELECTOR="tw-passagedata",t.WONDER={contentId:"wonder-content",pageClass:"page",pageContentClass:"page-content",textClass:"text",choiceClass:"choice",linkClass:"link",linkInlineClass:"inline",noSelectClass:"noselect",selectClass:"select",paramClass:"params",template:{text:"<text/>",choices:"<choices/>",choiceStart:"<choice>",choiceEnd:"</choice>",choiceText:"<choice-text/>",choiceId:"<choice-id/>"},passages:{config:"wonder.config",pageFormat:"wonder.format.page",choiceFormat:"wonder.format.choice",textFormat:"wonder.format.text"},markLang:{varStart:"var",commandSplitter:":"},inlineStart:"="},t.COMMON_CSS={displayNone:"displayNone",pointerOver:"pointerOver"},t.REGEXP={exeScript:new RegExp("{{([\\s\\S]*?)}}","g"),twineLink:new RegExp("\\[\\[(.*?)\\]\\]","g")},t.PAGE_TEMPLATE='<div class="'+t.WONDER.noSelectClass+" "+t.WONDER.pageClass+'"></div>',t.LINK_TEMPLATE='<div class="'+t.WONDER.linkClass+'" data-id="'+t.WONDER.template.choiceId+'">'+t.WONDER.template.choiceText+"</div>",t.LINK_INLINE_TEMPLATE='<span class="'+t.WONDER.linkClass+" "+t.WONDER.linkInlineClass+'" data-id="'+t.WONDER.template.choiceId+'">'+t.WONDER.template.choiceText+"</span>",t.PASSAGE_TEMPLATE='<div class="'+t.WONDER.pageContentClass+'">\n<div class="'+t.WONDER.paramClass+'" ><div id="gold"></div></div>\n<div class="'+t.WONDER.selectClass+" "+t.WONDER.textClass+'"><text/></div>\n</div>',t.DEFAULT_STYLE='\n\n .noselect {\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Safari */\n -khtml-user-select: none; /* Konqueror HTML */\n -moz-user-select: none; /* Old versions of Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none; /* Non-prefixed version, currently\n supported by Chrome, Opera and Firefox */\n }\n \n .select {\n -webkit-touch-callout: default; /* iOS Safari */\n -webkit-user-select: text; /* Safari */\n -khtml-user-select: text; /* Konqueror HTML */\n -moz-user-select: text; /* Old versions of Firefox */\n -ms-user-select: text; /* Internet Explorer/Edge */\n user-select: text; /* Non-prefixed version, currently\n supported by Chrome, Opera and Firefox */\n }\n \n .page .displayNone, .displayNone {\n display: none; \n }\n \n .pointerOver {\n cursor: pointer;\n }\n \n ul, li {\n margin: 0;\n padding: 0;\n list-style: none;\n }\n \n body {\n margin: 0;\n padding: 0;\n background: #ceceb7;\n font-family: "Verdana", "Roboto", "Open Sans", sans-serif;\n }\n \n .'+t.WONDER.pageClass+" {\n width: 800px;\n margin: 15px auto;\n padding: 12px; \n background: beige;\n border-radius: 8px;\n }\n \n ."+t.WONDER.pageContentClass+" {\n display: flex;\n flex-direction: column;\n }\n \n ."+t.WONDER.paramClass+"{\n margin-bottom: 12px;\n }\n \n \n ."+t.WONDER.textClass+" {\n margin: 0;\n font-size: 18px;\n line-height: 1.2em;\n }\n \n ."+t.WONDER.linkClass+"{\n cursor: pointer;\n margin: 16px 0;\n text-decoration: underline;\n }\n \n ."+t.WONDER.linkClass+":hover{\n color: #313298;\n }\n \n @media screen and (max-width: 800px){\n ."+t.WONDER.pageClass+" {\n width: 100%;\n margin: 0;\n border-radius: 0;\n }\n }\n"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),o=n(4),a=function(){function e(){this.listeners={}}return e.prototype.getListeners=function(e){return this.listeners[e]},e.prototype.initListeners=function(e){return this.listeners[e]=[],this.listeners[e]},e.getInstance=function(){return null==e.instance&&(e.instance=new e),e.instance},e.addListener=function(t,n){(e.getInstance().getListeners(t)||e.getInstance().initListeners(t)).push(n)},e.prototype.sub=function(e,t){return(this.getListeners(e)||this.initListeners(e)).push(t),this},e.prototype.unsub=function(e,t){var n=this.getListeners(e);if(null!=n)return o.ArrayUtils.removeChild(n,t),this},e.emit=function(t,n){var o=e.getInstance().getListeners(t);o&&o.forEach((function(e){r.Task.order((function(){e(t,n)}))}))},e}();t.EventBus=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.onStoryLoaded="onStoryLoaded",e.onPageFormatLoaded="onPageFormatLoaded",e.onContentFormatLoaded="onPassageFormatLoaded",e.onCssLoaded="onCssLoaded",e.preparePassage="preparePassage",e.onPassagePrepared="onPassagePrepared",e.showPassage="showPassage",e.onLinkClick="onLinkClick"}(t.GameEvents||(t.GameEvents={}));var r=function(e,t,n){this.passage=e,this.state=t,this.config=n};t.PageViewData=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(){}return e.divWith=function(e){var t=document.createElement("div");return t.innerHTML=e,t},e.elementFromTemplate=function(t){return e.divWith(t).firstChild},e.addChildBefore=function(e,t,n){var r,o=!0,a=e.children;if(null!=n&&0!=n.length){for(var i=0;i<a.length;i++)if((r=a[i]).id==n)return e.insertBefore(t,r),void(o=!1);o&&e.appendChild(t)}else e.appendChild(t)},e.remove=function(e){e.parentNode&&e.parentNode.removeChild(e)},e.addChildIfNot=function(e,t){t.parentNode!=e&&e.appendChild(t)},e.bringToTop=function(e){e.parentNode&&e.parentNode.appendChild(e)},e.matches=function(e,t){return o.call(e,t)},e.copyToClipboard=function(e){var t=document.createElement("textarea");t.value=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)},e.getBlobURL=function(e,t){var n=new Blob([e],{type:t});return URL.createObjectURL(n)},e.getHtmlBlobUrl=function(t){return e.getBlobURL(t,"text/html")},e.removeAllChildren=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},e.getTextMetrics=function(t,n){null==e.canvas&&(e.canvas=document.createElement("canvas"));var r=e.canvas.getContext("2d");return r.font=n,r.measureText(t)},e.getTextWidth=function(t,n){return e.getTextMetrics(t,n).width},e.isFullScreenEnabled=function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled},e.closest=function(t,n){var r=t,o=0;do{if(null==r)return null;if(e.matches(r,n))return r;r=r.parentElement}while(o++<1e4);console.warn(" "+o+" loops - check code for errors!")},e.prepend=function(e,t){e.insertBefore(t,e.firstChild)},e}();t.DomUtils=r;var o=Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype.webkitMatchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(){}return e.getRandom=function(e,t){void 0===t&&(t=1);var n=new Array(t),r=e.length,o=new Array(r);if(t>r)throw new RangeError("getRandom: more elements taken than available");for(;t--;){var a=Math.floor(Math.random()*r);n[t]=e[a in o?o[a]:a],o[a]=--r in o?o[r]:r}return n},e.pushUnique=function(e,t){return e.indexOf(t)<0&&e.push(t),e},e.removeChild=function(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)},e.remove=function(e,t){return t>-1?e.splice(t,1)[0]:null},e.removeLast=function(e,t){for(;t-- >0;)e.pop()},e.shuffleWithSeed=function(e,t){var n,r;void 0===t&&(t=17);var o,a=e.length;for(n=0;n<a;n++)r=e[o=(t*n+31)%a],e[o]=e[n],e[n]=r;return e},e.shuffle=function(t,n){switch(void 0===n&&(n=r.random),n){case r.same:return t;case r.chaos:return t.sort((function(e,t){return Math.random()-.5}));case r.random:return e.shuffleWithSeed(t,13)}},e.updateArray=function(e,t,n,r){var o,a;(void 0===r&&(r=!0),null!=e&&null!=t&&0!=t.length)&&e.forEach((function(e,r){o=r<t.length?t[r]:a,n(e,o),a=o}))},e}();t.ArrayUtils=o,function(e){e.random="random",e.same="same",e.chaos="chaos"}(r=t.ArrayShuffleOrder||(t.ArrayShuffleOrder={}))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){};t.GameState=r;var o=function(){this.uiParams=[]};t.GameConfig=o;var a=function(e,t){this.name=e,this.label=t};t.VisibleParameter=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(7),o=n(8),a=n(11),i=n(0);console.log(".............................."),console.log("Twine Wonder parser game version 0.9.1"),console.log("..............................");var s=r.parseTwineData();console.log("story parsed = ",s);var c=new o.GameLogic,u=new a.GameView;u.injectStyle(i.DEFAULT_STYLE),u.injectStyle(s.style),c.loadStory(s)},function(e,t,n){"use strict";function r(e){for(var t,n,r,o,a={},i=0,s=e.attributes,c=s.length;i<c;i++)a[(t=s[i].name,n=void 0,r=void 0,o=void 0,n=t.split("-"),r=n.map((function(e,t){return t?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():e})),o=r.join(""),o)]=s[i].value;return a}Object.defineProperty(t,"__esModule",{value:!0}),t.parseTwineData=function(){var e=document.body.querySelector("tw-storydata"),t=r(e);t.style=document.querySelector("#twine-user-stylesheet").innerHTML.trim(),t.script=document.querySelector("#twine-user-script").innerHTML.trim();var n=Array.prototype.slice.call(e.querySelectorAll("tw-passagedata"));return t.passageHash={},t.passages=n.map((function(e){var n,o,a=r(e);return t.passageHash[a.pid]&&console.warn("duplicate passage id "+a.pid),t.passageHash[a.name]=a,t.startnode==a.pid&&(t.startPassageName=a.name),a.content=(n=e.innerHTML.trim(),(o=document.createElement("textarea")).innerHTML=n,0===o.childNodes.length?"":o.childNodes[0].nodeValue),a})),t}},function(e,t,n){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),a=n(2),i=n(0),s=n(5),c=n(10),u=function(){function e(){var e=this;this.gameConfig=new s.GameConfig,this.gameState={},o.EventBus.getInstance().sub(a.GameEvents.onPassagePrepared,(function(t,n){return e.onPassagePrepared(n)})).sub(a.GameEvents.onLinkClick,(function(t,n){return e.onLinkClick(n)}))}return e.prototype.loadStory=function(e){this.story=e,this.exeScript(e.script),console.log("loadStory 1"),c.WonderStoryParser.parse(e,this.gameState,this.gameConfig),console.log("loadStory 2"),o.EventBus.emit(a.GameEvents.onStoryLoaded,e),o.EventBus.emit(a.GameEvents.preparePassage,this.getViewPassage(this.story.startPassageName))},e.prototype.onPassagePrepared=function(e){this.showPassage(e)},e.prototype.showPassage=function(e){o.EventBus.emit(a.GameEvents.showPassage,e)},e.prototype.onLinkClick=function(e){o.EventBus.emit(a.GameEvents.preparePassage,this.getViewPassage(e))},e.prototype.exeScript=function(e){return new Function(e).bind(this.gameState)()},e.prototype.getViewPassage=function(e){var t=r({},this.story.passageHash[e]);return this.execScripts(t),new a.PageViewData(t,this.gameState,this.gameConfig)},e.prototype.execScripts=function(e){var t=this;console.log("execScripts........"),console.log("viewPassage.content",e.content),e.content=e.content.replace(i.REGEXP.exeScript,(function(e,n){var r=n.trim(),o=r[0]==i.WONDER.inlineStart;o&&(r="return "+r.substring(1));var a=t.exeScript(r);return o?a:""})),console.log("....... /execScripts")},e}();t.GameLogic=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=requestAnimationFrame?function(e){return requestAnimationFrame(e)}:function(e){return setTimeout(e,0)};t.Task={order:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),o=n(0),a=function(){function e(){}return e.parse=function(e,t,n){!function(e,t,n){if(null==e)return;var a=(i=e.content,i.split("\n"));var i;console.log("parseConfig "),a.forEach((function(e){0!=(e=e.trim()).length&&(console.log("str = ",e),function(e,t,n){if(0==function(e,t){return 0==e.indexOf(t)}(e,o.WONDER.markLang.varStart))return;console.log("has var",e);var a=e.split(o.WONDER.markLang.commandSplitter);console.log("parts",a);var i=a[1].trim(),s=a[2]||"0",c=a[3];t[i]=parseFloat(s),console.log("varLabel ",c),console.log("parts ",a),c&&n.uiParams.push(new r.VisibleParameter(i,c))}(e,t,n))}))}(e.passageHash[o.WONDER.passages.config],t,n)},e}();t.WonderStoryParser=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(2),a=n(0),i=n(12),s=n(3),c=function(){function e(){var e=this;this.el=document.createElement("div"),this.el.id=a.WONDER.contentId,document.body.appendChild(this.el),this.el.addEventListener("click",this),this.pageView=new i.WonderPageView(this.el),r.EventBus.getInstance().sub(o.GameEvents.onStoryLoaded,(function(t,n){return e.onStoryLoaded(n)})).sub(o.GameEvents.preparePassage,(function(t,n){return e.preparePassage(n)})).sub(o.GameEvents.showPassage,(function(t,n){return e.showPassage(n)}))}return e.prototype.handleEvent=function(e){var t=s.DomUtils.closest(e.target,"."+a.WONDER.linkClass);if(t){var n=t.dataset.id;r.EventBus.emit(o.GameEvents.onLinkClick,n)}},e.prototype.injectStyle=function(e){if(0!=e.length){var t=document.createElement("style");t.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(t)}},e.prototype.onStoryLoaded=function(e){console.log("onStoryLoaded",e)},e.prototype.preparePassage=function(e){var t=e.passage;console.log("preparePassage",t);var n=this.pageView.addNextPage(t);this.injectParams(n,e.config.uiParams,e.state),r.EventBus.emit(o.GameEvents.onPassagePrepared,t)},e.prototype.showPassage=function(e){console.log("showPassage",e),this.pageView.showNextPage()},e.prototype.injectParams=function(e,t,n){t.forEach((function(t){console.log("uP",t);var r=t.name,o=n[t.name],a=e.querySelector(t.name);a&&(a.innerHTML=r+":"+o)}))},e}();t.GameView=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(13),o=n(1),a=n(2),i=n(16),s=n(0),c=n(17),u=function(){function e(e){var t=this;this.parent=e,this.pageView=new r.PagePairView,this.pageBuilder=new i.ViewBuilder(s.PAGE_TEMPLATE),this.contentBuilder=new i.ViewBuilder(s.PASSAGE_TEMPLATE),this.contentBuilder.setContentFormatter(c.twinePassageFormatter),o.EventBus.getInstance().sub(a.GameEvents.onPageFormatLoaded,(function(e,n){return t.pageBuilder.setTemplate(n)})).sub(a.GameEvents.onContentFormatLoaded,(function(e,n){return t.contentBuilder.setTemplate(n)}))}return e.prototype.addNextPage=function(e){var t=this.buildPageView(e);return this.pageView.addPage(t),t},e.prototype.showNextPage=function(){this.pageView.next()},e.prototype.buildPageView=function(e){var t=e.content,n=this.contentBuilder.build(t),r=this.pageBuilder.build();return r.classList.add(s.COMMON_CSS.displayNone),r.appendChild(n),this.parent.appendChild(r),r},e}();t.WonderPageView=u},function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.limit=2,t}return o(t,e),t.prototype.addPage=function(t){e.prototype.addPage.call(this,t),this.pages.length>this.limit&&(this.currentPage--,this.dropPage(0))},t}(n(14).PageView);t.PagePairView=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(15),o=n(4),a=n(3),i=function(){function e(){this.pages=[],this.currentPage=-1,this.animator=new r.PageAnimator}return e.prototype.setAnimator=function(e){this.animator=e},e.prototype.addPage=function(e){this.pages.push(e)},e.prototype.next=function(){var e=this.getCurrent();this.currentPage++,this.setCurrent(this.currentPage);var t=this.getCurrent();this.switch(e,t)},e.prototype.previous=function(){var e=this.getCurrent();this.currentPage--,this.setCurrent(this.currentPage);var t=this.getCurrent();this.switch(e,t)},e.prototype.switch=function(e,t){e&&this.animator.hide(e),this.animator.show(t)},e.prototype.getCurrent=function(){return this.pages[this.currentPage]},e.prototype.setCurrent=function(e){if(0==this.pages.length)throw"setCurrent error - void pages";var t=this.pages.length-1;e>t?e=0:e<0&&(e=t),this.currentPage=e},e.prototype.dropPage=function(e){var t=o.ArrayUtils.remove(this.pages,e);null!=t?a.DomUtils.remove(t):console.warn("dropPage: try to remove undefined page")},e}();t.PageView=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=function(){function e(){}return e.prototype.show=function(e,t){void 0===t&&(t=0),console.log("show el",e),e.classList.remove(r.COMMON_CSS.displayNone)},e.prototype.hide=function(e,t){void 0===t&&(t=0),console.log("hide el",e),e.classList.add(r.COMMON_CSS.displayNone)},e}();t.PageAnimator=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),o=function(){function e(e){this.template=e,this.contentFormatter=function(e,t){return t}}return e.prototype.setTemplate=function(e){this.template=e},e.prototype.setContentFormatter=function(e){this.contentFormatter=e},e.prototype.build=function(e){void 0===e&&(e="");var t=this.contentFormatter(e,this.template);return r.DomUtils.elementFromTemplate(t)},e}();t.ViewBuilder=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.twinePassageFormatter=function(e,t){console.log("twinePassageFormatter....");var n=r.WONDER.template,a=function(e,t,n){var r,o,a=[],i=0;for(;i<e.length;){if(-1===(r=e.indexOf(t,i)))return a;-1===(o=e.indexOf(n,r))&&(o=void 0),a.push(e.substring(r+t.length,o)),i=o+n.length}return a}(t,n.choiceStart,n.choiceEnd)[0];t=t.replace(a,n.choiceText).replace(n.choiceStart,"").replace(n.choiceEnd,""),e=e.replace(r.REGEXP.twineLink,(function(e,t){var n=(t=t.trim())[0]==r.WONDER.inlineStart,a=n?r.LINK_INLINE_TEMPLATE:r.LINK_TEMPLATE;return n&&(t=t.substring(1)),function(e,t){return t.replace(r.WONDER.template.choiceId,e.id).replace(r.WONDER.template.choiceText,e.text)}(function(e){var t=e.split("|");t[0]=t[0].trim(),null==t[1]&&(t[1]=t[0]);return new o(t[0],t[1])}(t),a)})).trim();var i=t;return i=i.replace(n.text,e.trim())};var o=function(e,t){this.text=e,this.id=t}}]);</script> </body>
</html>