Closed lpagliari closed 5 years ago
Exemplo de arquivo minimizado:
module.exports=function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=97)}([function(t,e,n){n(58);var i=window.$.noConflict(!0);e.jQuery=e.$=i},function(t,e,n){t.exports=n(60)},function(t,e,n){(function(t){var i,o,r=n(1),a=n(6),s=n(3),c=function(){return i=i||t('iframe[name="ace_outer"]').contents()};e.getPadOuter=c;var u=function(){return o=o||c().find('iframe[name="ace_inner"]').contents()};e.getPadInner=u,e.getLineNumberFromDOMLine=function(t,e){var n=t.attr("id");return e.lines.indexOfKey(n)},e.getDOMLineFromLineNumber=function(t,e){return e.lines.atIndex(t).lineNode},e.checkIfHasSceneMark=function(t){return t.find(s.SCENE_MARK_TAGS_SELECTOR).length>0};var l=e.checkIfHasSceneMark;e.checkIfHasSceneMarkTitle=function(t){return t.find(s.SCENE_MARK_TITLES_SELECTOR).length>0},e.performNonUnduableEvent=function(t,e){var n=t.editEvent.eventType;t.startNewEvent(s.NON_UNDOABLE_EVENT),e(),t.startNewEvent(n)},e.lineNumberContainsSceneMark=function(t){var e=u().find("div").eq(t);return l(e)},e.lineIsAVisibleSceneMark=function(t){var e=u().find("div").eq(t),n=l(e),i=0===e.get(0).getBoundingClientRect().height;return n&&!i},e.lineIsAHiddenSceneMark=function(t){var e=u().find("div").eq(t),n=l(e),i=0===e.get(0).getBoundingClientRect().height;return n&&i},e.lineIsSceneMark=function(t,e){return void 0!==d(t,e)};var d=function(t,e){return r.find(s.SCENE_MARK_KEYS,function(n){return""!==e.getAttributeOnLine(t,n)})};e.getSceneMarkAttribValueOfLine=function(t,e){var n=d(t,e);return n?e.getAttributeOnLine(t,n):""},e.selectionStartsOnASceneMark=function(){return a.getFirstLineOfSelection().hasClass("sceneMark")},e.isMultiLineSelected=function(){return a.isMultipleLineSelected()},e.lineTypeIsSceneMark=function(t){return r.contains(s.SCENE_MARK_TAGS,t)},e.isSceneMarkTitle=function(t){return r.contains(s.SCENE_MARK_TITLES,t)},e.typeOf=function(t){return(t.find(s.LINE_ELEMENTS_SELECTOR).prop("tagName")||"general").toLowerCase()};e.placeCaretOnLine=function(t,e,n){var i=[t,1];e.ace_performSelectionChange(i,i,!0),e.ace_updateBrowserSelectionFromRep()},e.synchronizeEditorWithUserSelection=function(t){t.ace_fastIncorp()},e.getFirstSceneMarkOfScene=function(t,n){var i=u().find("div").eq(t).prevUntil("div:not(.sceneMark)").andSelf().first();return e.getLineNumberFromDOMLine(i,n)},e.isLineHeadingOrSceneMark=function(t){var n="heading"===t,i=e.lineTypeIsSceneMark(t);return n||i},e.getFirstSceneMarkTagOfSet=function(t){var e=t.prevUntil("div:not(.sceneMark)").addBack().first();return r.filter(s.SCENE_MARK_TITLES,function(t){return 1===e.find(t).length})[0]}}).call(this,n(0).$)},function(t,e,n){var i=n(1),o=n(12).tags;e.SM_KEYS_LEVELS=["episode","act","sequence","synopsis"],e.SM_LEVELS=["episode","act","sequence","scene"],e.SCENE_MARK_KEYS=i.flatten(i.map(e.SM_KEYS_LEVELS,function(t){return[t+"_scene_mark"]})),e.SCENE_MARK_TAGS=i.flatten(i.map(e.SM_LEVELS,function(t){return[t+"_name",t+"_summary"]})),e.SCENE_MARK_TITLES=i.map(e.SM_LEVELS,function(t){return t+"_name"}),e.SCENE_MARK_SUMMARIES=i.map(e.SM_LEVELS,function(t){return t+"_summary"}),e.SMS_SETS=e.SCENE_MARK_TAGS.concat("heading"),e.SCENE_MARK_ICONS=i.map(e.SM_LEVELS,function(t){return[".scene_mark_button--"+t.slice(0,3)]}).join(","),e.SHOW_SCENE_MARK_ATTRIB="show_scene_mark",e.LINE_ELEMENTS_TAGS=i.union(o,e.SCENE_MARK_TAGS),e.LINE_ELEMENTS_SELECTOR=e.LINE_ELEMENTS_TAGS.join(", "),e.SCENE_MARK_TAGS_SELECTOR=e.SCENE_MARK_TAGS.join(", "),e.SCENE_MARK_TITLES_SELECTOR=e.SCENE_MARK_TITLES.join(", "),e.NON_UNDOABLE_EVENT="nonundoable",e.SCENE_MARK_ADD_EVENT="sceneMarkAdded",e.SCENE_MARK_REMOVE_EVENT="sceneMarkRemoved",e.DEFAULT_LINE_ATTRIBS=["author","lmkr","insertorder","start"],e.TEKSTO_SHORTCUT_BASE={mac:["cmd","ctrl"],windows:["ctrl","alt"]}},function(t,e,n){var i=n(0).$,o=n(1),r=n(3).SCENE_MARK_TAGS,a=n(12).tags,s=o.union(a,r).join(", ");e.BUTTON_SELECTED_CLASS="button__toggle-view--selected",e.BUTTON_DISABLED_CLASS="button__toggle-view--disabled",e.TOGGLE_VISUALIZER_ID="#toggleVisualizer",e.NOT_EDITABLE_COLOR_CLASS="editorNotEditable";e.SCRIPT_ELEMENT_TYPE="script",e.INITIAL_EASC_MODE=["script"],e.EASC_CHANGED_EVENT="easc_changed";var c=["script"].concat(["scene","sequence","act","episode"]),u=o.range(1,6);e.SHORTCUTS_TARGET_LINE_TYPE=o.object(u,c),e.EASC_MODE_CLASS={episode:"easc_mode--epi",act:"easc_mode--act",sequence:"easc_mode--seq",scene:"easc_mode--syn"};var l,d={episode:".withEpi",act:".withAct",sequence:".withSeq",scene:".withSceneSynopsis"};e.SCENE_MARK_CLASS_NAME=d,e.getPadOuter=function(){return l=l||i('iframe[name="ace_outer"]').contents()};var f,h=e.getPadOuter;e.getPadInner=function(){return f=f||h().find('iframe[name="ace_inner"]').contents()};var p=e.getPadInner,g=function(t){return(t.find(s).prop("tagName")||"general").toLowerCase()};e.typeOf=g;e.isButtonEnabled=function(t){return!t.hasClass(e.BUTTON_DISABLED_CLASS)};e.isButtonSelected=function(t){return t.hasClass(e.BUTTON_SELECTED_CLASS)},e.getTagTypeFromDomLine=function(t){var e=g(t);return m(e)};var m=function(t){var e=t.match(/(.*)_(name|summary)/);return null===e?"script":e[1]};e.getLineNumberFromDOMLine=function(t,e){var n=t.attr("id");return e.lines.indexOfKey(n)},e.isModifierKeyPressed=function(t,e){var n=v(t,e),i=browser.msie||browser.safari||browser.chrome?"keydown"===t.type:"keypress"===t.type;return n&&i};var v=function(t,e){var n=browser.mac?"mac":"windows",i=_(t);return e[n].length===i.length&&0===o.difference(i,e[n]).length},_=function(t){var e={ctrl:t.ctrlKey,alt:t.altKey,cmd:t.metaKey,shift:t.shiftKey},n=o.map(e,function(t,e){if(t)return e});return o.compact(o.values(n))};e.isScriptButtonPressed=function(t){return"script"===t},e.getButtonsState=function(){var t=["script"],e=[];return o.each(d,function(n,i){y(n)?t.push(i):e.push(i)}),{selectable:t,disabled:e}};var y=function(t){return e.getPadInner().find(t).length};e.isEditorEditable=function(){return"on"===h().find("iframe[name='ace_inner']").get(0).contentDocument.designMode},e.getEascClassesApplied=function(){return p().find("#innerdocbody").attr("class").split(" ").filter(function(t){return t.startsWith("easc_mode")}).join(" ")}},function(t,e,n){var i,o,r=n(1),a=n(0).$,s=n(2);e.LINE_CHANGED_EVENT="LINE_CHANGED_EVENT",e.OPEN_NEW_COMMENT_MODAL_EVENT="OPEN_NEW_COMMENT_MODAL_EVENT",e.COMMENT_CLASS=".comment",e.getPadOuter=function(){return i=i||a('iframe[name="ace_outer"]').contents()},e.getPadInner=function(){return o=o||this.getPadOuter().find('iframe[name="ace_inner"]').contents()},e.getOuterWindow=function(){var t=a('iframe[name="ace_outer"]').get(0);return t&&t.contentWindow},e.waitForResizeToFinishThenCall=function(t,e){var n;a(window).on("resize",function(){clearTimeout(n),n=setTimeout(e,t)})},e.getRepliesIndexedByReplyId=function(t){return r.chain(t).pluck("replies").reduce(function(t,e){return Object.assign(t,e)},{}).value()},e.getUserInfo=function(){var t=clientVars.userName||"";return{initials:e.buildUserInitials(t),name:t}},e.buildUserInitials=function(t){var e=t.trim().split(" "),n=e.length>1;return((e[0][0]||"")+((n?e[e.length-1][0]:e[0][1])||"")).toUpperCase()},e.openSocketConnectionToRoute=function(t){var e=document.location,n=""==e.port?"https:"==e.protocol?443:80:e.port,i=e.protocol+"//"+e.hostname+":"+n+t;return io.connect(i)},e.getHeadingOfDomLine=function(t){return t.is("div.withHeading")?t:s.checkIfHasSceneMark(t)?t.nextUntil("div.withHeading").addBack().last().next():t.prevUntil("div.withHeading").addBack().first().prev()},e.setAttributeOnSelections=function(t,e,n,i){var o=i.ace_getRepFromSelector(t);c(o,e,n,i)};var c=function(t,e,n,i){r(t).each(function(t){i.ace_performSelectionChange(t[0],t[1],!0),i.ace_setAttributeOnSelection(e,n)}),u(t,i)};e.setAttributeOnRepArray=c;var u=function(t,e){if(0!==t.length){var n=t[0],i=t[t.length-1],o=n[0],r=i[1];e.ace_performSelectionChange(o,r,!0)}};e.selectFullTextOfRepArray=u,e.replaceDialogContentWith=function(t,e,n){var i="#"+n,o=e.$content.find(i),r=t.find(i);o.replaceWith(r)}},function(t,e,n){(function(t){var i=n(1),o=n(12).tags;e.SCENE_MARK_SELECTOR=n(3).SCENE_MARK_TAGS;var r,a,s=i.union(o,e.SCENE_MARK_SELECTOR).join(", "),c=i.union(o,["general"]);e.DEFAULT_LINE_ATTRIBS=["author","lmkr","insertorder","start"],e.CHANGE_ELEMENT_EVENT="insertscriptelement",e.HEADING_ADD_EVENT="headingAdded",e.getPadOuter=function(){return r=r||t('iframe[name="ace_outer"]').contents()},e.getPadInner=function(){return a=a||e.getPadOuter().find('iframe[name="ace_inner"]').contents()},e.SCENE_MARK_TYPE={0:"withEpi",1:"withEpi",2:"withAct",3:"withAct",4:"withSeq",5:"withSeq",6:"withSceneSynopsis",7:"withSceneSynopsis",8:"withHeading"},e.selectionStartsOnAScriptElement=function(){var t=e.getFirstLineOfSelection();return u(t)},e.lineIsScriptElement=function(t){var n=e.getPadInner().find("div").eq(t);return u(n)};var u=function(t){var e=d(t);return i.contains(c,e)};e.domLineIsAScriptElement=u;var l=function(t,e){return e.getAttributeOnLine(t,"script_element")};e.getLineType=l,e.lineIsHeading=function(t,e){return"heading"===l(t,e)},e.domLineIsAHeading=function(t){return"heading"===d(t)};var d=function(t){return(t.find(s).prop("tagName")||"general").toLowerCase()};e.typeOf=d,e.isMultipleLineSelected=function(){var t=f();return t.start!==t.end},e.getFirstLineOfSelection=function(){var e=f();return e.backward?t(e.end):t(e.start)};var f=function(){var t,n=e.getPadInner().get(0).getSelection(),i=n.anchorNode,o=n.focusNode,r=n.anchorOffset,a=n.focusOffset,s=h(i,r),c=h(o,a);s&&(t=2===s.compareDocumentPosition(c));return{start:s,end:c,backward:t}},h=function(t,e){var n=t;for(n&&n.tagName&&"body"===n.tagName.toLowerCase()&&(n=p(e));n&&n.parentNode&&(!n.parentNode.tagName||"body"!==n.parentNode.tagName.toLowerCase());)n=n.parentNode;return n},p=function(t){var n=e.getPadInner().find("div");return t>n.length-1&&(t=n.length-1),n.get(t)};e.getLineNumberFromDOMLine=function(t,e){var n=t.attr("id");return e.lines.indexOfKey(n)},e.getLineNumberOfCaretLine=function(t){var n=e.getFirstLineOfSelection();return e.getLineNumberFromDOMLine(n,t)}}).call(this,n(0).$)},function(t,e,n){var i,o=n(0).$,r=n(1),a=n(23),s="heading, action, character, parenthetical, dialogue, transition, shot";e.getPadOuter=function(){return i=i||o('iframe[name="ace_outer"]').contents()};var c,u=e.getPadOuter;e.getPadInner=function(){return c=c||u().find('iframe[name="ace_inner"]').contents()};e.getPadInner;e.typeOf=function(t){return(t.find(s).prop("tagName")||"general").toLowerCase()},e.getLineTypeOf=function(t,e){return e.getAttributeOnLine(t,"script_element")};var l=function(t){return t.get(0).getBoundingClientRect().bottom},d=function(t){return t.get(0).getBoundingClientRect().height};e.getMarginOf=function(t){return e.getLineHeight(t)-e.getLineHeightWithoutMargins(t)};var f,h=function(t){return 0===t.prev().length};e.getLineHeight=function(t){var e=t.find(s);return 0===e.length?d(t):function(t,e){var n;n=h(t)?d(e):l(t)-l(t.prev());return n}(t,e)},e.getLineHeightWithoutMargins=function(t){return d(t)},e.getRegularLineHeight=function(){return f=f||p()},e.updateRegularLineHeight=function(){f=p()},e.getWidthOfOneChar=function(){return u().find("#linemetricsdiv").get(0).getBoundingClientRect().width},e.getHeightOfOneLine=function(){return d(u().find("#linemetricsdiv"))};var p=e.getHeightOfOneLine;e.findCharacterNameOf=function(t){return t.prevUntil("div:not(:has(dialogue,parenthetical))").andSelf().first().prev().find("character").text().toUpperCase()||"empty"},e.performNonUnduableEvent=function(t,e){var n=t.editEvent.eventType;t.startNewEvent("nonundoable"),e(),t.startNewEvent(n)},e.buildCharacterNameToClass=function(t){var e="empty"===t?"":t;return"characterName:<"+a.escapeHTMLAttribute(e)+">"},e.buildPageBreakWithMoreAndContd=function(t,e){var n,i=m(t);return n="<more></more>",n+=g(t,e),n+='<contdLine contenteditable="false"><contd data-character="'+i+'"></contd></contdLine>'},e.buildSimplePageBreak=function(t,e){return"<"+e+"></"+e+">"+('<pagenumber contenteditable="false" data-page-number="'+v(t)+'"><calculating/></pagenumber>')};var g=e.buildSimplePageBreak,m=function(t){var e=t.match(new RegExp("(?:^| )characterName:<([^>]*)>"));return e?e[1]:""};e.pageNumberOfDOMLine=function(t){return t.find("pagenumber").attr("data-page-number")},e.buildPageNumberToClass=function(t){return"pageNumber:"+t};var v=function(t){var e=t.match(new RegExp("(?:^| )pageNumber:([0-9]*)"));return e?e[1]:""};e.getLineNumberFromDOMLine=function(t,e){var n=t.attr("id");return e.lines.indexOfKey(n)},e.getDOMLineFromLineNumber=function(t,e){return e.lines.atIndex(t).lineNode},e.getTopSceneMarkOrTargetLine=function(t){return t.prevUntil(":not(.sceneMark)").andSelf().first()},e.getNextLineIgnoringSceneMarks=function(t){return t.nextUntil(":not(.sceneMark)").andSelf().last().next()},e.nodeHasMoreAndContd=function(t){return t.find("more").length>0},e.setTextOfLine=function(t,e){var n=t.find(s),i=e.replace(/\u00a0/g," ");0===n.length?t.text(i):n.text(i)},e.createCleanCopyOf=function(t,e){var n,i=t.find(s);if(0===i.length)n=e;else{var r=i.get(0).tagName.toLowerCase();n="<"+r+">"+e+"</"+r+">"}return o("<div>"+n+"</div>")},e.cleanHelperLines=function(t){t.addClass("cloned"),t.find(b()).remove(),t.removeClass("firstHalf beforePageBreak withMoreAndContd"),t.each(function(t,e){var n=o(e),i=n.attr("id");n.attr("data-original-id",i),n.attr("id","")})};var _,y=["more","contdLine","pagenumber"];e.registerPageBreakTag=function(t){y.push(t),_=r(y).unique().join(",")};var b=function(){return _};e.getPageBreakTagsSelector=b;var T,C=function(t){return 58*(t=t||p())};e.getMaxPageHeight=function(){return T=T||C()};e.getPageBreakHeight=function(){var t=2*p();return 110+t}},function(t,e,n){var i=n(0).$,o=n(1),r=n(3);e.CLASS_OF_STYLES_DISABLED_ON_PASTE="disable-on-paste";e.PASTE_SEPARATOR="pasteSeparator";e.TARGET_FOR_MULTI_LINE_PASTE="pasteTarget";var a,s;e.getPadOuter=function(){return a=a||i('iframe[name="ace_outer"]').contents()},e.getPadInner=function(){return s=s||e.getPadOuter().find('iframe[name="ace_inner"]').contents()},e.typeOfLineWithDroppedContent=function(t){var e=t.children().not("div div").map(function(){return this.tagName.toLowerCase()});return e.push("general"),o.intersection(r.LINE_ELEMENTS_TAGS,e)[0]},e.getSelection=function(){return this.getPadInner().get(0).getSelection()},e.expandRangeSelection=function(t,e,n,i){var o=document.createRange();t&&o.setStart(t,e),n&&o.setEnd(n,i);var r=this.getSelection();r.removeAllRanges(),r.addRange(o)},e.transformParagraphsIntoRegularLines=function(t){return t.find("p").replaceWith(function(){return i("<div/>").append(i(this).contents())}),t.find("div").addBack()},e.ignoreEmptyLinesPasted=function(t){var e=t.filter(function(){var t=0===i(this).text().length,e=0===i(this).find("br").length;return t&&e});return e.replaceWith(function(){return i("<span/>").append(i(this).contents())}),t.not(e)},e.replaceTagsBySpan=function(t,e){t.find(e).replaceWith(function(){return i("<span/>").append(i(this).contents())})};e.getPastedLines=function(t){var n=function(t){var n=e.getPadInner().find(".pasteTarget");return n.length>0?n:t}(t),i=n.find("div");return c(n,i)&&(i=u(n)),i};var c=function(t,e){var n=t.is(".pasteTarget"),i=0===e.length;return n&&i},u=function(t){var e=i("<div/>");return e.append(t.contents()),t.append(e),e};e.getTextLengthIgnoringHelperTags=function(t){return t.text().length-t.find(".pasteSeparator, .pasteTarget").text().length},e.getSiblingsAboveHelperTagsOnLine=function(t){return t.find(".pasteSeparator, .pasteTarget").first().prevAll()},e.getLineBelowHelperTags=function(){return this.getPadInner().find(".pasteSeparator, .pasteTarget").last().next()},e.findTagOutOfHelperTags=function(t,e){var n=t.find(e),i=t.find(".pasteSeparator, .pasteTarget").find(e);return n.not(i)},e.getPlainTextFromHtml=function(t){var e=i(t),n=e.find("div"),o=n.length?n:e;return l(o).join("\n")};var l=function(t){return o.map(t,function(t){return t.innerText})};e.synchronizeEditorWithUserSelection=function(t){(t.ace_callWithAce||t.callWithAce)(function(t){t.ace_inCallStackIfNecessary("copyCutPasteSync",t.ace_fastIncorp)})},e.createEmptySpan=function(){return i("<span><empty/></span>")},e.forceLinesToBeCollected=function(t){t.append("<style />")},e.isMultiLineSelected=function(t){return t.selStart[0]!==t.selEnd[0]},e.removeLineTypeTags=function(t){var e=r.LINE_ELEMENTS_TAGS.map(function(t){return"<"+t+">"}).join("|"),n=r.LINE_ELEMENTS_TAGS.map(function(t){return"</"+t+">"}).join("|");return t=(t=t.replace(new RegExp(e,"gi"),"<span>")).replace(new RegExp(n,"gi"),"</span>")},e.markStylesToBeDisabledOnPaste=function(t){this.getPadInner().find("head link").filter(function(){return this.href.match(t)}).addClass(this.CLASS_OF_STYLES_DISABLED_ON_PASTE)},e.getTextNodesOf=function(t){for(var e,n=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,null,!1),i=[];e=n.nextNode();)i.push(e);return i}},function(t,e,n){var i=n(5);e.getPadOuter=i.getPadOuter,e.getPadInner=i.getPadInner,e.waitForResizeToFinishThenCall=i.waitForResizeToFinishThenCall,e.setAttributeOnSelections=i.setAttributeOnSelections,e.setAttributeOnRepArray=i.setAttributeOnRepArray,e.getHeadingOfDomLine=i.getHeadingOfDomLine,e.openSocketConnectionToRoute=i.openSocketConnectionToRoute,e.OPEN_NEW_TAG_MODAL_EVENT="OPEN_NEW_TAG_MODAL_EVENT",e.isUndoOrRedo=function(t){var e=t.type,n=t.which;return(browser.msie||browser.safari||browser.chrome?"keydown"==e:"keypress"==e)&&(t.metaKey||t.ctrlKey)&&!t.altKey&&"z"==String.fromCharCode(n).toLowerCase()},e.getPositionOfFirstVisibleCharOnPad=function(t){for(var e=t.ace_getRep(),n=e.lines.atIndex(0);n&&n.width===n.lineMarker+1;n=e.lines.next(n));return[n?e.lines.indexOfEntry(n):0,n?n.lineMarker:0]},e.normalizeString=function(t){return window.transl((t||"").toLowerCase())}},function(t,e,n){var i,o,r=n(0).$,a=n(1),s=n(2),c=n(12).tags,u=n(3).SCENE_MARK_TAGS,l=a.union(c,u).join(", ");e.DRAG_START_TAG="dragstart",e.DRAG_END_TAG="dragend",e.getPadOuter=function(){return i=i||r('iframe[name="ace_outer"]').contents()},e.getPadInner=function(){return o=o||e.getPadOuter().find('iframe[name="ace_inner"]').contents()};var d=function(t){return(t.find(l).prop("tagName")||"general").toLowerCase()};e.typeOf=d,e.typeOfLineNumber=function(t,e){var n=r(e.lines.atIndex(t).lineNode);return d(n)},e.getSelection=function(){return this.getPadInner().get(0).getSelection()},e.expandRangeSelection=function(t,e,n,i,o,r){n&&t.setStart(n,i),o&&t.setEnd(o,r),e.removeAllRanges(),e.addRange(t)},e.getLineNumberFromDOMLine=function(t,e){var n=t.attr("id");return e.lines.indexOfKey(n)},e.getDOMLineFromLineNumber=function(t,e){return e.lines.atIndex(t).lineNode},e.getRep=function(t){var e;return t.callWithAce(function(t){e=t.ace_getRep()}),e},e.synchronizeEditorWithUserSelection=function(t){t.callWithAce(function(t){t.ace_inCallStackIfNecessary("dragAndDropSelectionSync",t.ace_fastIncorp)})},e.saveNonUndoableChange=function(t){t.callWithAce(function(t){t.ace_inCallStackIfNecessary("nonundoable",t.ace_fastIncorp)})},e.changeEditorSelection=function(t,e,n){t.callWithAce(function(t){t.ace_inCallStackIfNecessary("dragAndDropSelectionChange",function(){t.ace_performSelectionChange(e,n),t.ace_updateBrowserSelectionFromRep()})})},e.isAtBeginningOfLine=function(t,e){var n=t[0],i=t[1],o=e.lines.atIndex(n).lineMarker;return 0===i||i===o},e.emptyLines=function(){var t=r(this),e=t.find("br").length>0;return 0===t.text().length&&!e},e.selectionEndsAtBeginningOfLine=function(t){return e.isAtBeginningOfLine(t.selEnd,t)},e.selectionEndsAtBeginningOfVisibleSceneMark=function(t){var n=t.selEnd[0],i=s.lineIsAVisibleSceneMark(n),o=e.isAtBeginningOfLine(t.selEnd,t);return i&&o},e.selectionStartsAtBeginningOfLine=function(t){return e.isAtBeginningOfLine(t.selStart,t)},e.linesAboveEndOfSelectionAreSceneMarks=function(t){return s.lineNumberContainsSceneMark(t.selEnd[0]-1)},e.selectionEndsAtHiddenSceneMark=function(t){return s.lineIsAHiddenSceneMark(t.selEnd[0])}},function(t,e,n){(function(t){var i=n(23);function o(t){var e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",n="";t=t||20;for(var i=0;i<t;i++){var o=Math.floor(Math.random()*e.length);n+=e.substring(o,o+1)}return n}var r={escapeHtml:function(t){return i.escapeHTML(String(t))},uniqueId:function(){function t(t,e){return(Array(e+1).join("0")+Number(t).toString(35)).slice(-e)}return[n(61).pad.getClientIp(),t(+new Date,7),t(Math.floor(1e9*Math.random()),4)].join(".")},uaDisplay:function(t){var e;function n(t){return(t=t.replace(/[^a-zA-Z0-9\.]/g,"")).length>16&&(t=t.substr(0,16)),t}function i(e){var i=t.match(RegExp(e+"\\/([\\d\\.]+)"));return i&&i.length>1?n(e+i[1]):null}if(i("Firefox"))return i("Firefox");if((e=t.match(/compatible; ([^;]+);/))&&e.length>1)return n(e[1]);if(t.match(/\(iPhone;/))return"iPhone";if(i("Chrome"))return i("Chrome");if(e=t.match(/Safari\/[\d\.]+/)){var o="?";return(e=t.match(/Version\/([\d\.]+)/))&&e.length>1&&(o=e[1]),n("Safari"+o)}return n(t.split(" ")[0])},simpleDateTime:function(t){var e=new Date(+t);return["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][e.getDay()]+" "+["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()]+" "+e.getDate()+" "+e.getFullYear()+" "+(e.getHours()+":"+("0"+e.getMinutes()).slice(-2))},findURLs:function(t){var e=new RegExp("("+/[-:@a-zA-Z0-9_.,~%+\/?=&#;()$]/.source+"|"+/[\u0030-\u0039\u0041-\u005A\u0061-\u007A\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\u0100-\u1FFF\u3040-\u9FFF\uF900-\uFDFF\uFE70-\uFEFE\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFDC]/.source+")"),n=new RegExp(/(?:(?:https?|s?ftp|ftps|file|nfs):\/\/|(about|geo|mailto|tel):)/.source+e.source+"*(?![:.,;])"+e.source,"g");return function(t){n.lastIndex=0;for(var e,i=null;e=n.exec(t);){i=i||[];var o=e.index,r=e[0];i.push([o,r])}return i}(t)},escapeHtmlWithClickableLinks:function(t,e){var n=0,o=[],a=r.findURLs(t);function s(e){e>n&&(o.push(i.escapeHTML(t.substring(n,e))),n=e)}if(a)for(var c=0;c<a.length;c++){var u=a[c][0],l=a[c][1];s(u),o.push("<a ",e?'target="'+i.escapeHTMLAttribute(e)+'" ':"",'href="',i.escapeHTMLAttribute(l),'">'),s(u+l.length),o.push("</a>")}return s(t.length),o.join("")},bindEnterAndEscape:function(t,e,n){e&&t.keypress(function(t){13==t.which&&e(t)}),n&&t.keydown(function(t){27==t.which&&n(t)})},timediff:function(t){var e=n(61).pad;function i(t,e){return(t=Math.round(t))+" "+e+(1!=t?"s":"")+" ago"}return(t=Math.max(0,(+new Date-+t-e.clientTimeOffset)/1e3))<60?i(t,"second"):(t/=60)<60?i(t,"minute"):(t/=60)<24?i(t,"hour"):i(t/=24,"day")},makeAnimationScheduler:function(t,e,n){void 0===n&&(n=1);var i=null;return{scheduleAnimation:function o(){i||(i=window.setTimeout(function(){i=null;for(var e=n,r=!0;r&&e>0;)r=t(),e--;r&&o()},e*n))}}},makeShowHideAnimator:function(t,e,n,i){var o=e?0:-2,a=1e3/n,s=a/i,c=r.makeAnimationScheduler(function(){if(o<-1||0==o)return!1;if(o<0)return(o+=s)>=0?(t(o=0),!1):(t(o),!0);if(o>0)return(o+=s)>=1?(t(o=1),o=-2,!1):(t(o),!0)},a).scheduleAnimation;return{show:function(){t(o=-1),c()},hide:function(){o>=-1&&o<=0&&(o=1e-6,c())},quickShow:function(){o=o<-1?-1:o<=0?o:Math.max(-1,Math.min(0,-o)),t(o),c()}}},_nextActionId:1,uncanceledActions:{},getCancellableAction:function(t,e){var n=r.uncanceledActions[t];n||(n={},r.uncanceledActions[t]=n);var i=r._nextActionId++;return n[i]=!0,function(){var n=r.uncanceledActions[t];n&&n[i]&&e()}},cancelActions:function(t){r.uncanceledActions[t]&&delete r.uncanceledActions[t]},makeFieldLabeledWhenEmpty:function(e,n){function i(){e.addClass("editempty"),e.val(n)}return(e=t(e)).focus(function(){e.hasClass("editempty")&&e.val(""),e.removeClass("editempty")}),e.blur(function(){e.val()||i()}),{clear:i}},getCheckbox:function(e){return t(e).is(":checked")},setCheckbox:function(e,n){n?t(e).attr("checked","checked"):t(e).removeAttr("checked")},bindCheckboxChange:function(e,n){t(e).change(n)},encodeUserId:function(t){return t.replace(/[^a-y0-9]/g,function(t){return"."==t?"-":"z"+t.charCodeAt(0)+"z"})},decodeUserId:function(t){return t.replace(/[a-y0-9]+|-|z.+?z/g,function(t){return"-"==t?".":"z"==t.charAt(0)?String.fromCharCode(Number(t.slice(1,-1))):t})}},a=void 0;r.setupGlobalExceptionHandler=function(){a||(a=function(e,n,i){var a=o(20),s=r.escapeHtml(navigator.userAgent);"none"!=t("#editorloadingbox").attr("display")&&(t("#editorloadingbox").css("padding","10px"),t("#editorloadingbox").css("padding-top","45px"),t("#editorloadingbox").html("<div style='text-align:left;color:red;font-size:16px;'><b>An error occurred</b><br>The error was reported with the following id: '"+a+"'<br><br><span style='color:black;font-weight:bold;font-size:16px'>Please press and hold Ctrl and press F5 to reload this page, if the problem persists please send this error message to your webmaster: </span><div style='color:black;font-size:14px'>'ErrorId: "+a+"<br>URL: "+r.escapeHtml(window.location.href)+"<br>UserAgent: "+s+"<br>"+e+" in "+n+" at line "+i+"'</div></div>"));var c={errorInfo:JSON.stringify({errorId:a,msg:e,url:window.location.href,linenumber:i,userAgent:navigator.userAgent})},u=document.location;return n=u.protocol+"//"+u.hostname+":"+u.port+"/"+u.pathname.substr(1,u.pathname.indexOf("/p/"))+"jserror",t.post(n,c),!1},window.onerror=a)},r.binarySearch=n(122).binarySearch,e.randomString=o,e.createCookie=function(t,e,n,i){if(n){var o=new Date;o.setTime(o.getTime()+24*n*60*60*1e3);var r="; expires="+o.toGMTString()}else r="";i||(i="/");var a="https:"==window.location.protocol?";secure":"";"Microsoft Internet Explorer"==navigator.appName||"Netscape"==navigator.appName&&null!=new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})").exec(navigator.userAgent)?document.cookie=t+"="+e+r+"; path=/"+a:document.cookie=t+"="+e+r+"; path="+i+a},e.readCookie=function(t){for(var e=t+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var o=n[i];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(e))return o.substring(e.length,o.length)}return null},e.padutils=r}).call(this,n(0).$)},function(t,e,n){var i=n(1),o=["heading","action","character","parenthetical","dialogue","transition","shot"],r=["scene-number","scene-duration","scene-temporality","scene-workstate","scene-time"],a=function(t){return i.indexOf(r,t)>=0},s=function(t){return i.indexOf(o,t)>=0};e.collectContentPre=function(t,e){var n=e.tname,i=e.state.lineAttributes;"div"!==n&&"p"!==n||delete i.script_element,s(n)?i.script_element=n:a(n)&&(i[n]=e.cls)},e.collectContentPost=function(t,e){var n=e.tname,a=e.state.lineAttributes;if(i.indexOf(o,n)>=0)for(var s=i.union(r,["script_element"]),c=0;c<s.length;c++)delete a[s[c]]},e.tags=o,e.sceneTag=r},function(t,e,n){(function(t){var i,o,r=n(1),a=n(3).SCENE_MARK_TAGS,s=n(12).tags,c=r.union(s,a).join(", ");e.FULL_LINE_REGEX=/^.*$/,e.getPadOuter=function(){return i=i||t('iframe[name="ace_outer"]').contents()},e.getPadInner=function(){return o=o||e.getPadOuter().find('iframe[name="ace_inner"]').contents()};e.extractCharacterName=function(t){var e=t.text().trim().toUpperCase();return e.replace(/\s*(\([^)]*\)\s*)*$/,"")},e.getCurrentLineText=function(t,e,n){var i=e.lines.atIndex(t).text;return n.lineHasMarker(t)&&(i=i.substr(1)),i};e.currentLineIsEmpty=function(t){var n=t.rep,i=t.documentAttributeManager,o=n.selStart[0];return 0===e.getCurrentLineText(o,n,i).trim().length},e.getCurrentColumn=function(t,e,n){var i=e.selStart[1];return n.lineHasMarker(t)&&i--,i},e.getCurrentScriptElement=function(t,e){return e.getAttributeOnLine(t,"script_element")},e.getDefaultSuggestions=function(t){var e="ep_script_autocomp."+t+".";return r.filter(html10n.translations,function(t,n){return 0===n.indexOf(e)})},e.getCustomSuggestions=function(n,i){var o=e.getPadInner().find(n),a=r.map(o,function(e){return t(e).text().trim().toUpperCase()}),s=i.documentAttributeManager,c=i.rep,u=c.selStart[0],l=e.getCurrentLineText(u,c,s).trim().toUpperCase();return a=r.reject(a,function(t){return t===l})},e.buildAndSortSuggestions=function(){var t=r.union(r.flatten(arguments));return r.sortBy(t,function(t){return t.toUpperCase().replace(/[ÀÁÄÃÂ]/g,"A").replace(/[ÈÉËÊ]/g,"E").replace(/[ÌÍÏÎ]/g,"I").replace(/[ÒÓÖÕÔ]/g,"O").replace(/[ÙÚÜÛ]/g,"U").replace(/[Ç]/g,"C")})},e.removeCurrentElement=function(t,e){return r.without(t,e)},e.lineHasSceneTimeSeparator=function(t){return/.+ - .*$/.test(t)},e.caretPosition=function(t,e,n){var i=t.selStart[0],o=t.selStart[1],r=u(i,t),a=o===(e.lineHasMarker(i)?1:0),s=o===r;!s&&n&&(s=0===function(t,e,n){return n.lines.atIndex(t).text.substr(e)}(i,o,t).trim().length);return{beginningOfLine:a,middleOfLine:!a&&!s,endOfLine:s}};var u=function(t,e){var n=t+1,i=e.lines.offsetOfIndex(t);return e.lines.offsetOfIndex(n)-i-1};e.getLineNumberFromDOMLine=function(t,e){var n=t.attr("id");return e.lines.indexOfKey(n)},e.getTypeOfLineWhereCaretIs=function(e){var n=e.selStart[0],i=l(n,e),o=t(i);return d(o)};var l=function(t,e){return e.lines.atIndex(t).lineNode},d=function(t){return(t.find(c).prop("tagName")||"general").toLowerCase()}}).call(this,n(0).$)},function(t,e,n){(function(t){var i,o=n(1);e.MOVE_CARET_TO_CLICKED_ITEM="clickOnItemOfNavigator",e.getPadOuter=function(){return i=i||t('iframe[name="ace_outer"]').contents()};var r,a=e.getPadOuter;e.getPadInner=function(){return r=r||a().find('iframe[name="ace_inner"]').contents()};var s=e.getPadInner;e.getNavigatorTree=function(){return a().find("#tree")},e.placeCaretOnLine=function(t,e){var n=[t,1];e.ace_inCallStackIfNecessary("clickOnItemOfNavigator",function(){e.ace_performSelectionChange(n,n,!0),e.ace_updateBrowserSelectionFromRep()})},e.getLineNumberFromId=function(t){var e=s().find("#innerdocbody").children(),n=o.map(e,function(t){return t.id});return o.indexOf(n,t)}}).call(this,n(0).$)},function(t,e,n){(function(t){!function(t){var e,n=t.fn.domManip,i="_tmplitem",o=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,r={},a={},s={key:0,data:{}},c=0,u=0,l=[];function d(e,n,i,o){var s={data:o||(n?n.data:{}),_wrap:n?n._wrap:null,tmpl:null,parent:n||null,nodes:[],calls:_,nest:y,wrap:b,html:T,update:C};return e&&t.extend(s,e,{nodes:[],parent:n}),i&&(s.tmpl=i,s._ctnt=s._ctnt||s.tmpl(t,s),s.key=++c,(l.length?a:r)[c]=s),s}function f(e,n,o){var r,a=o?t.map(o,function(t){return"string"==typeof t?e.key?t.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g,"$1 "+i+'="'+e.key+'" $2'):t:f(t,e,t._ctnt)}):e;return n?a:((a=a.join("")).replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,function(e,n,i,o){v(r=t(i).get()),n&&(r=h(n).concat(r)),o&&(r=r.concat(h(o)))}),r||h(a))}function h(e){var n=document.createElement("div");return n.innerHTML=e,t.makeArray(n.childNodes)}function p(e){return new Function("jQuery","$item","var $=jQuery,call,_=[],$data=$item.data;with($data){_.push('"+t.trim(e).replace(/([\\'])/g,"\\$1").replace(/[\r\t\n]/g," ").replace(/\$\{([^\}]*)\}/g,"{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,function(e,n,i,o,r,a,s){var c,u,l,d=t.tmpl.tag[i];if(!d)throw"Template command not found: "+i;return c=d._default||[],a&&!/\w$/.test(r)&&(r+=a,a=""),r?(r=m(r),s=s?","+m(s)+")":a?")":"",u=a?r.indexOf(".")>-1?r+a:"("+r+").call($item"+s:r,l=a?u:"(typeof("+r+")==='function'?("+r+").call($item):("+r+"))"):l=u=c.$1||"null",o=m(o),"');"+d[n?"close":"open"].split("$notnull_1").join(r?"typeof("+r+")!=='undefined' && ("+r+")!=null":"true").split("$1a").join(l).split("$1").join(u).split("$2").join(o?o.replace(/\s*([^\(]+)\s*(\((.*?)\))?/g,function(t,e,n,i){return(i=i?","+i+")":n?")":"")?"("+e+").call($item"+i:t}):c.$2||"")+"_.push('"})+"');}return _;")}function g(e,n){e._wrap=f(e,!0,t.isArray(n)?n:[o.test(n)?n:t(n).html()]).join("")}function m(t){return t?t.replace(/\\'/g,"'").replace(/\\\\/g,"\\"):null}function v(e){var n,o,s,l,f,h="_"+u,p={};for(s=0,l=e.length;s<l;s++)if(1===(n=e[s]).nodeType){for(f=(o=n.getElementsByTagName("*")).length-1;f>=0;f--)g(o[f]);g(n)}function g(e){var n,o,s,l,f=e;if(l=e.getAttribute(i)){for(;f.parentNode&&1===(f=f.parentNode).nodeType&&!(n=f.getAttribute(i)););n!==l&&(f=f.parentNode?11===f.nodeType?0:f.getAttribute(i)||0:0,(s=r[l])||((s=d(s=a[l],r[f]||a[f],null,!0)).key=++c,r[c]=s),u&&g(l)),e.removeAttribute(i)}else u&&(s=t.data(e,"tmplItem"))&&(g(s.key),r[s.key]=s,f=(f=t.data(e.parentNode,"tmplItem"))?f.key:0);if(s){for(o=s;o&&o.key!=f;)o.nodes.push(e),o=o.parent;delete s._ctnt,delete s._wrap,t.data(e,"tmplItem",s)}function g(t){s=p[t+=h]=p[t]||d(s,r[s.parent.key+h]||s.parent,null,!0)}}}function _(t,e,n,i){if(!t)return l.pop();l.push({_:t,tmpl:e,item:this,data:n,options:i})}function y(e,n,i){return t.tmpl(t.template(e),n,i,this)}function b(e,n){var i=e.options||{};return i.wrapped=n,t.tmpl(t.template(e.tmpl),e.data,i,e.item)}function T(e,n){var i=this._wrap;return t.map(t(t.isArray(i)?i.join(""):i).filter(e||"*"),function(t){return n?t.innerText||t.textContent:t.outerHTML||function(t){var e=document.createElement("div");return e.appendChild(t.cloneNode(!0)),e.innerHTML}(t)})}function C(){var e=this.nodes;t.tmpl(null,null,null,this).insertBefore(e[0]),t(e).remove()}t.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(n,i){t.fn[n]=function(o){var a,s,c,l,d=[],f=t(o),h=1===this.length&&this[0].parentNode;if(e=r||{},h&&11===h.nodeType&&1===h.childNodes.length&&1===f.length)f[i](this[0]),d=this;else{for(s=0,c=f.length;s<c;s++)u=s,a=(s>0?this.clone(!0):this).get(),t.fn[i].apply(t(f[s]),a),d=d.concat(a);u=0,d=this.pushStack(d,n,f.selector)}return l=e,e=null,t.tmpl.complete(l),d}}),t.fn.extend({tmpl:function(e,n,i){return t.tmpl(this[0],e,n,i)},tmplItem:function(){return t.tmplItem(this[0])},template:function(e){return t.template(e,this[0])},domManip:function(i,o,a){if(i[0]&&i[0].nodeType){for(var s,c=t.makeArray(arguments),l=i.length,d=0;d<l&&!(s=t.data(i[d++],"tmplItem")););l>1&&(c[0]=[t.makeArray(i)]),s&&u&&(c[2]=function(e){t.tmpl.afterManip(this,e,a)}),n.apply(this,c)}else n.apply(this,arguments);return u=0,!e&&t.tmpl.complete(r),this}}),t.extend({tmpl:function(e,n,i,o){var c,u=!o;if(u)o=s,e=t.template[e]||t.template(null,e),a={};else if(!e)return e=o.tmpl,r[o.key]=o,o.nodes=[],o.wrapped&&g(o,o.wrapped),t(f(o,null,o.tmpl(t,o)));return e?("function"==typeof n&&(n=n.call(o||{})),i&&i.wrapped&&g(i,i.wrapped),c=t.isArray(n)?t.map(n,function(t){return t?d(i,o,e,t):null}):[d(i,o,e,n)],u?t(f(o,null,c)):c):[]},tmplItem:function(e){var n;for(e instanceof t&&(e=e[0]);e&&1===e.nodeType&&!(n=t.data(e,"tmplItem"))&&(e=e.parentNode););return n||s},template:function(e,n){return n?("string"==typeof n?n=p(n):n instanceof t&&(n=n[0]||{}),n.nodeType&&(n=t.data(n,"tmpl")||t.data(n,"tmpl",p(n.innerHTML))),"string"==typeof e?t.template[e]=n:n):e?"string"!=typeof e?t.template(null,e):t.template[e]||t.template(null,o.test(e)?e:t(e)):null},encode:function(t){return(""+t).split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'")}}),t.extend(t.tmpl,{tag:{tmpl:{_default:{$2:"null"},open:"if($notnull_1){_=_.concat($item.nest($1,$2));}"},wrap:{_default:{$2:"null"},open:"$item.calls(_,$1,$2);_=[];",close:"call=$item.calls();_=call._.concat($item.wrap(call,_));"},each:{_default:{$2:"$index, $value"},open:"if($notnull_1){$.each($1a,function($2){with(this){",close:"}});}"},if:{open:"if(($notnull_1) && $1a){",close:"}"},else:{_default:{$1:"true"},open:"}else if(($notnull_1) && $1a){"},html:{open:"if($notnull_1){_.push($1a);}"},"=":{_default:{$1:"$data"},open:"if($notnull_1){_.push($.encode($1a));}"},"!":{open:""}},complete:function(){r={}},afterManip:function(e,n,i){var o=11===n.nodeType?t.makeArray(n.childNodes):1===n.nodeType?[n]:[];i.call(e,n),v(o),u++}})}(t)}).call(this,n(0).jQuery)},function(t,e,n){(function(t){var i=n(1),o=n(11).randomString,r=n(7),a=n(35),s=n(29),c=i.union(["author","lmkr","insertorder","start",a.PAGE_NUMBER_ATTRIB,"splitPageBreak","splitPageBreakWithMoreAndContd","splitFirstHalf","splitSecondHalf"],s.PAGE_BREAK_ATTRIBS);e.PAGE_BREAK_TAG="splitPageBreak",r.registerPageBreakTag("splitPageBreak");e.SECOND_HALF_TAG="split_second_half";var u=/^(.*[.?!;]\s+)[^.?!;]*$/,l=/^(.*\s+)[^\s]*$/;e.MERGED_LINE="merged";var d={action:2},f={action:2,transition:2,dialogue:2,parenthetical:2},h={character:38,dialogue:35,transition:16,parenthetical:25},p={general:!0,action:!0,transition:!0,dialogue:!0,parenthetical:!0,heading:!1,character:!1,shot:!1},g={dialogue:!0,parenthetical:!0};e.getSplitInfo=function(t,e,n,i,o,r,a){var s=m(t,e,o,r,a);if(_(s)){var c=y(t,i);if(c>=b(s)){var u=T(c,s,n);if(u)return u}}};var m=function(t,e,n,i,o){var a=e.attr("id"),s=o.lines.indexOfKey(a),c=v(s,i),u=c?n[1]:n[1]-1,l=n[0]===s;return{lineNumberBeforeRepagination:s,lineText:t.text(),lineHasMarker:c,typeOfLine:r.typeOf(t),$originalLine:e,caretIsAtLine:l,caretAtColumn:u,typeOfPreviousLine:function(){return r.typeOf(e.prev())},findCharacterName:function(){return r.findCharacterNameOf(e)}}},v=function(t,e){var n=e.getAttributesOnLine(t);return i.chain(n).filter(function(t){return!!t[1]}).map(function(t){return t[0]}).difference(c).size().value()>0},_=function(t){var e=t.typeOfLine;return p[e]},y=function(t,e){var n=r.getRegularLineHeight();return parseInt(e/n)},b=function(t){var e=t.typeOfLine,n=d[e]||1;"dialogue"!==e&&"parenthetical"!==e||"character"===t.typeOfPreviousLine()&&(n=2);return n},T=function(t,e,n){var i=function(t){var e=t.typeOfLine;return"general"===e||"transition"===e?w:E}(e),o=e.lineNumberBeforeRepagination+n,r=C(t,e,i);if(r){var a=r.columnToSplit,s=[o,a];return{addMoreAndContd:I(e),lineNumberAfterClean:o,start:s,caretOriginallyOnFirstHalf:e.caretIsAtLine&&e.caretAtColumn<=a,innerLinesOnFirstHalf:r.innerLinesOnFirstHalf}}},C=function(t,e,n){for(var i=r.getRegularLineHeight(),o=t,a=b(e),s=function(t){var e=t.typeOfLine;return f[e]||1}(e),c=n(o,e);c;){var u=e.lineText.substring(0,c),l=O(u,e),d=parseInt(l/i);if(d<a)break;var h=e.lineText.substring(c),p=O(h,e);if(parseInt(p/i)>=s)return e.lineHasMarker&&c++,{columnToSplit:c,innerLinesOnFirstHalf:d};c=n(--o,e)}},I=function(t){var e=t.typeOfLine;return!!g[e]&&{characterName:t.findCharacterName()}},E=function(t,e){return x(t,e,!1,u)},w=function(t,e){return x(t,e,!0,l)},x=function(t,e,n,i){e.lineHasMarker;var o=e.lineText,r=t*A(e),a=o.substring(0,r),s=n?a.length:0;if(i){var c=i.exec(a);c&&c[1]&&(s=c[1].length)}return s},A=function(t){var e=t.typeOfLine;return h[e]||61},O=function(t,e){var n=e.$originalLine,i=r.createCleanCopyOf(n,t);i.addClass("clone");var o=i.insertAfter(n).get(0).getBoundingClientRect().height;return i.remove(),o};e.atribsToClasses=function(t){if(S(t.key))return[t.key];if(k(t.key)){var e=r.buildCharacterNameToClass(t.value);return[t.key,e]}return P(t.key)||D(t.key)?[t.key,t.value]:void 0};var S=function(t){return"splitPageBreak"===t},k=function(t){return"splitPageBreakWithMoreAndContd"===t},P=function(t){return t.match("splitFirstHalf")},D=function(t){return t.match("splitSecondHalf")};e.collectContentPre=function(t,e){var n=e.tname,i=e.cls||"",o=e.state.lineAttributes;if(!(-1!==i.indexOf("ignore_pagination_attribs")))if("div"===n)delete o.splitPageBreak,delete o.splitPageBreakWithMoreAndContd,delete o.splitFirstHalf,delete o.splitSecondHalf;else if("split_first_half"===n){var r=N(e.cls);o.splitFirstHalf=r,o.splitPageBreak=!0}else if("split_with_more_and_contd_first_half"===n){r=N(e.cls);o.splitFirstHalf=r,o.splitPageBreakWithMoreAndContd=!0}else if("split_second_half"===n){r=N(e.cls);o.splitSecondHalf=r}},e.dontCollectPageBreaksOfLines=function(t){var e=["split_first_half","split_with_more_and_contd_first_half","split_second_half"];t.find(e.join(",")).addClass("ignore_pagination_attribs")},e.buildHtmlWithPageBreaks=function(t){var e=N(t);return t.match("splitPageBreakWithMoreAndContd")?{preHtml:'<split_with_more_and_contd_first_half class="'+e+'">',postHtml:r.buildPageBreakWithMoreAndContd(t,"splitPageBreak")+"</split_with_more_and_contd_first_half>"}:t.match("splitPageBreak")?{preHtml:'<split_first_half class="'+e+'">',postHtml:r.buildSimplePageBreak(t,"splitPageBreak")+"</split_first_half>"}:D(t)?{preHtml:'<split_second_half class="'+e+'">',postHtml:"</split_second_half>"}:void 0};var N=function(t){var e=/(?:^| )(split-[A-Za-z0-9]*)/.exec(t);if(e&&e[1])return e[1]};e.blockElements=function(){return["split_first_half","split_with_more_and_contd_first_half","split_second_half"]},e.cleanPageBreaks=function(t,n,i,o,r){for(var a=n;a>=t;a--)e.lineIsFirstHalfOfSplit(a,i)&&(R(a,o,i,r),M(a,i))},e.lineIsFirstHalfOfSplit=function(t,e){return e.getAttributeOnLine(t,"splitFirstHalf")},e.lineIsSecondHalfOfSplit=function(t,e){return e.getAttributeOnLine(t,"splitSecondHalf")};var M=function(t,e){e.removeAttributeOnLine(t,"splitPageBreak"),e.removeAttributeOnLine(t,"splitPageBreakWithMoreAndContd"),L(t,e)},L=function(t,e){e.removeAttributeOnLine(t,"splitFirstHalf"),e.removeAttributeOnLine(t+1,"splitSecondHalf")},R=function(t,n,i,o){e.mergeLinesWithExtraChars(t,n,i,o,0,1)};e.mergeLinesWithExtraChars=function(t,e,n,i,o,r){if(n.getAttributeOnLine(t,"splitFirstHalf")===n.getAttributeOnLine(t+1,"splitSecondHalf")){var a=[t,e.lines.atIndex(t).text.length-o],s=[t+1,r];i.ace_replaceRange(a,s,"")}},e.savePageBreak=function(t,e,n,i,o){F(t,n,i,o),B(t,e,n)};var F=function(t,e,n,i){var o=t.start[0],a=t.start[1],s=r.getLineTypeOf(o,e),c=i.selStart[0]===t.start[0]&&i.selStart[1]===t.start[1];if(n.ace_replaceRange(t.start,t.start,"\n"),c&&t.caretOriginallyOnFirstHalf){var u=[o,a];n.ace_performSelectionChange(u,u)}H(o,s,e)},H=function(t,e,n){e&&n.setAttributeOnLine(t+1,"script_element",e)},B=function(t,e,n){var i=t.start[0],r="splitPageBreak",s=!0;t.addMoreAndContd&&(r="splitPageBreakWithMoreAndContd",s=t.addMoreAndContd.characterName),n.setAttributeOnLine(i,r,s),a.savePageBreak(i,e,n);var c="split-"+o(16);n.setAttributeOnLine(i,"splitFirstHalf",c),n.setAttributeOnLine(i+1,"splitSecondHalf",c)};e.nodeHasPageBreak=function(t){return t.find("splitPageBreak").length>0},e.lineHasPageBreak=function(t,e){return e.getAttributeOnLine(t,"splitPageBreak")||e.getAttributeOnLine(t,"splitPageBreakWithMoreAndContd")},e.mergeHelperLines=function(e){for(var n=t(),i=0;i<e.length-1;i++){var o=t(e.get(i)),a=t(e.get(i+1)),s=V(o,a);!!s&&(r.setTextOfLine(o,s),o.addClass("merged"),n=n.add(a),i++)}return e.not(n)};var W=function(t,e){var n=!1;if(t.find("splitPageBreak").length>0){var i=t.find("split_first_half,split_with_more_and_contd_first_half").attr("class"),o=e.find("split_second_half").attr("class");n=N(i)===N(o)}return n};e.linesAreHalvesOfSameSplit=W;var V=function(t,e){if(W(t,e))return t.text()+e.text()}}).call(this,n(0).$)},function(module,exports,__webpack_require__){var _=__webpack_require__(1),$=__webpack_require__(0).$,$autocomp,$list;__webpack_require__(134);var autocomp={processKeyEvent:!0,processEditEvent:!0,showOnEmptyWords:!1,ignoreLatinCharacters:!1,doNotResetTargetLineOnEmptySuggestionList:!1,enableShowSuggestionWithCtrlAndSpace:!0,tagetLine:void 0,postSuggestionSelectedCallbacks:{},addPostSuggestionSelectedCallback:function(t,e){this.postSuggestionSelectedCallbacks[t]=e},resetPostSuggestionSelectedCallbacks:function(t){delete this.postSuggestionSelectedCallbacks[t]},callPostSuggestionSelectedCallbacks:function(){_.each(this.postSuggestionSelectedCallbacks,function(t,e){t()})},createAutocompHTML:function(t,e,n,i){if(t&&e){this.targetLine=i.rep.selEnd[0],$list.empty();var o=[];$.each(t,function(t,e){var r=$("<li/>",{class:"ep_autocomp-listentry",text:e.fullText}).data("complementary",e.complementaryString).data("partialWord",n);r.click(function(){$(this).siblings(".selected").removeClass("selected"),$(this).addClass("selected"),autocomp.selectSuggestion(i)}),o.push(r)}),$(o[0]).addClass("selected"),$list.append(o),$autocomp.removeClass("autocomp-hidden").scrollTop(0).css({top:e.top,left:e.left})}else console.log("insufficent attributes")},aceKeyEvent:function(t,e,n){if(autocomp.processKeyEvent&&$autocomp&&e&&clientVars.ep_autocomp.enabled){var i=!1;if(!$autocomp.hasClass("autocomp-hidden")){if(this.enterPressed(e.evt))this.selectSuggestion(e)&&(e.evt.preventDefault(),i=!0);this.upPressed(e.evt)&&(this.moveSelectionUp(),e.evt.preventDefault(),i=!0),this.downPressed(e.evt)&&(this.moveSelectionDown(),e.evt.preventDefault(),i=!0),this.escPressed(e.evt)&&(this.closeSuggestionBox(),e.evt.preventDefault(),i=!0)}return this.ctrlSpacePressed(e.evt)&&autocomp.enableShowSuggestionWithCtrlAndSpace&&($autocomp.is(":hidden")?this.updateSuggestions(e):this.closeSuggestionBox(),i=!0),i&&e.evt.preventDefault(),i}},enterPressed:function(t){return"keydown"===t.type&&13===t.keyCode},upPressed:function(t){return"keydown"===t.type&&!t.shiftKey&&38===t.keyCode},downPressed:function(t){return"keydown"===t.type&&!t.shiftKey&&40===t.keyCode},escPressed:function(t){return"keydown"===t.type&&27===t.keyCode},ctrlSpacePressed:function(t){return"keydown"===t.type&&t.ctrlKey&&32===t.keyCode},moveSelectionDown:function(){if(!$list.children().last().hasClass("selected")){$list.children(".selected").removeClass("selected").next().addClass("selected");var t=$list.children(".selected"),e=this.getIntValueOfCSSProperty(t,"padding-top"),n=t.position().top+e;n-$autocomp.height()>=0&&$autocomp.scrollTop($autocomp.scrollTop()+n)}},getIntValueOfCSSProperty:function(t,e){var n=t.css(e).replace(/[^-\d\.]/g,"");return Number(n)},moveSelectionUp:function(){if(!$list.children().first().hasClass("selected")){$list.children(".selected").removeClass("selected").prev().addClass("selected");var t=$list.children(".selected").position().top;t<0&&$autocomp.scrollTop($autocomp.scrollTop()+t)}},selectSuggestion:function(t){var e=!1,n=$list.children(".selected").eq(0),i=n.data("complementary"),o=n.data("partialWord"),r=n.text(),a=t.rep.lines.atIndex(t.rep.selEnd[0]).lineNode;if(void 0!==i){$(a).on("sendkeys",function(){$(a).off("sendkeys"),autocomp.fixReplacedText(a,r,i,o),autocomp.callPostSuggestionSelectedCallbacks()});var s=$(a).find("br");if(s.length)s.replaceWith("<span>"+i+"</span>"),this.adjustCaretPosition(a,i);else{var c=this.getNodeInfoWhereCaretIs(t).node;$(c).sendkeys(i)}this.closeSuggestionBox(),e=!0}return e},adjustCaretPosition:function(t,e){for(var n="",i=e.length-1;i>=0;i--)n+="{rightarrow}";$(t).sendkeys(n)},fixReplacedText:function(t,e,n,i){var o=e!==i+n;if(this.ignoreLatinCharacters&&o){for(var r="",a=i.length+n.length,s=1;s<a;s++)r+="{leftarrow}";for(s=0;s<i.length;s++){var c=e.charAt(s);c!==i.charAt(s)&&(r+=c,r+="{leftarrow}{backspace}",r+="{rightarrow}"),r+="{rightarrow}"}for(s=1;s<n.length;s++)r+="{rightarrow}";$(t).sendkeys(r)}},closeSuggestionBox:function(t){this.targetLine=void 0,$autocomp&&$autocomp.addClass("autocomp-hidden")},aceEditEvent:function(t,e,n){autocomp.processEditEvent&&$("#options-autocomp").is(":checked")&&autocomp.updateSuggestions(e)},update:function(t,e,n,i){console.warn("autocomp.update() is deprecated, please use autocomp.updateSuggestions() instead"),this.updateSuggestions(t,{fixedSuggestions:e,customRegex:n,customRegexIndex:i})},updateSuggestions:function(t,e){if(null!==t.rep.selStart&&autocomp.isEditByMe(t)){(e=e||{}).customRegex=e.customRegex||/[\S]*$/,e.customRegexIndex=e.customRegexIndex||0,e.showExactMatch=e.showExactMatch||!1;var n=this.getCurrentPartialWord(t,e.customRegex,e.customRegexIndex),i=0===n.length;if(this.showOnEmptyWords||!i){if(suggestions=e.fixedSuggestions||autocomp.getPossibleSuggestions(t),filteredSuggestions=autocomp.filterSuggestionList(n,suggestions,e.showExactMatch),0===filteredSuggestions.length)return this.closeSuggestionBox(),void(this.doNotResetTargetLineOnEmptySuggestionList&&(this.targetLine=t.rep.selEnd[0]));var o=autocomp.caretPosition(t);autocomp.createAutocompHTML(filteredSuggestions,o,n,t)}else this.closeSuggestionBox()}},filterSuggestionList:function(t,e,n){var i=[];return _.each(e,function(e,o,r){if("string"==typeof e){var a=0===t.length&&autocomp.showOnEmptyWords,s=autocomp.subtextOfSuggestion(e,t);if((a||s)&&(n||e!==t)){var c=e.slice(t.length);i.push({fullText:e,complementaryString:c})}}}),i},subtextOfSuggestion:function(t,e){var n=t,i=e;this.caseSensitiveMatch=!0,!1===clientVars.ep_autocomp.caseSensitiveMatch&&(this.caseSensitiveMatch=!1),this.caseSensitiveMatch||(n=n.toLowerCase(),i=i.toLowerCase());var o=0===n.indexOf(i);return!o&&this.ignoreLatinCharacters&&(o=0===(n=this.replaceLatinCharacters(n)).indexOf(i)),o},replaceLatinCharacters:function(t){return t.replace(/[àáäãâ]/g,"a").replace(/[ÀÁÄÃÂ]/g,"A").replace(/[èéëê]/g,"e").replace(/[ÈÉËÊ]/g,"E").replace(/[ìíïî]/g,"i").replace(/[ÌÍÏÎ]/g,"I").replace(/[òóöõô]/g,"o").replace(/[ÒÓÖÕÔ]/g,"O").replace(/[ùúüû]/g,"u").replace(/[ÙÚÜÛ]/g,"U").replace(/[ç]/g,"c").replace(/[Ç]/g,"C")},caretPosition:function(t){var e=this.cloneLineWithStyle(t),n=this.getNodeInfoWhereCaretIs(t,e),i=n.counter,o=n.node,r=o.text().length-(i-t.rep.selEnd[1]),a=o[0].childNodes[0].nodeValue||"",s=this.createHelperSpan(),c=a.substr(0,r),u=a.substr(r);o.text(""),o[0].appendChild(document.createTextNode(c)),o[0].appendChild(s),o[0].appendChild(document.createTextNode(u)),e.appendTo(this.getPadOuterBody());var l=$(s).offset(),d=this.getPadOuter().scrollTop();return e.remove(),{top:l.top+d,left:l.left}},getNodeInfoWhereCaretIs:function(t,e){var n=t.rep.selEnd,i=n[1],o=(e=e||$(t.rep.lines.atIndex(n[0]).domInfo.node)).find("*").contents().filter(function(){return 3===this.nodeType}),r=0,a=null;return o.each(function(t,e){if(r+=e.textContent.length,a=$(e.parentNode),r>=i)return!1}),null===a&&(a=e.find("br").parent()),{node:a,counter:r}},cloneLineWithStyle:function(t){var e=t.rep.selEnd,n=$(t.rep.lines.atIndex(e[0]).domInfo.node),i=this.getPadInner().get(0).getBoundingClientRect(),o=n.position(),r=n.clone();r.attr("id","tempPosId"),r.css({position:"absolute",top:o.top+i.top+"px",left:o.left+i.left+"px",background:"gray",color:"black",display:"block","white-space":"normal","word-wrap":"break-word"}),this.copyStyles(n[0],r[0]);for(var a=n.find("*"),s=r.find("*"),c=0;c<a.length;c++)this.copyStyles(a[c],s[c]);return r},copyStyles:function(t,e){var n=window.getComputedStyle(t);$(e).css({width:n.width,height:n.height,margin:n.margin,padding:n.padding,fontSize:n.fontSize,fontWeight:n.fontWeight,fontFamily:n.fontFamily,lineHeight:n.lineHeight})},createHelperSpan:function(){var t=document.createElement("span");return t.appendChild(document.createTextNode("\v")),t},getPadOuter:function(){return this.padOuter=this.padOuter||$('iframe[name="ace_outer"]').contents(),this.padOuter},getPadOuterBody:function(){return this.padOuterBody=this.padOuterBody||this.getPadOuter().find("#outerdocbody"),this.padOuterBody},getPadInner:function(){return this.padInner=this.padInner||this.getPadOuter().find('iframe[name="ace_inner"]'),this.padInner},getParam:function(t){var e,n=location.search.substr(location.search.indexOf("?")+1),i="";n=n.split("&");for(var o=0;o<n.length;o++)[(e=n[o].split("="))[0]]==t&&(i=e[1]);return i},isEditByMe:function(t){return!(!t||!t.callstack)&&"applyChangesToBase"!==t.callstack.editEvent.eventType},getPossibleSuggestions:function(context){var hardcodedSuggestions=clientVars.ep_autocomp.hardcodedSuggestions||[],sourceSuggestions=[];clientVars.ep_autocomp.updateFromSourceObject&&(sourceSuggestions=eval(clientVars.ep_autocomp.updateFromSourceObject));var regexToFind=eval(clientVars.ep_autocomp.regexToFind),dynamicSuggestions=[];if(context&&context.rep.alltext){var allText=context.rep.alltext;clientVars.ep_autocomp.suggestWordsInDocument||(allText=""),_.each(regexToFind,function(t){dynamicSuggestions=dynamicSuggestions.concat(allText.match(t)||[])}),dynamicSuggestions=_.map(dynamicSuggestions,function(t){return"*"===t.substr(0,1)?t.substr(1):t})}return _.uniq(hardcodedSuggestions.concat(dynamicSuggestions).concat(sourceSuggestions).sort(),!0)},getCurrentPartialWord:function(t,e,n){var i=this.getCaretColumnOnline(t),o=this.getCurrentLine(t).slice(0,i).match(e);return o?o[n]:""},hasMarker:function(t,e){return t.documentAttributeManager.lineHasMarker(e)},getCurrentLine:function(t){var e=t.rep.selEnd[0],n=t.rep.lines.atIndex(e).text;return this.hasMarker(t,e)&&(n=n.substr(1)),n},getCaretColumnOnline:function(t){var e=t.rep.selEnd[1],n=t.rep.selEnd[0];return this.hasMarker(t,n)&&e--,e}};exports.autocomp=autocomp,exports.aceEditEvent=function(t,e,n){if(!e.callstack.docTextChanged)return!1;autocomp.aceEditEvent(t,e,n)},exports.aceEditorCSS=function(t,e){return["/ep_autocomp/static/css/autocomp.css"]},exports.aceKeyEvent=function(t,e,n){return autocomp.aceKeyEvent(t,e)},exports.postAceInit=function(t,e){if(window.autocomp=autocomp,!$autocomp){var n=$('iframe[name="ace_outer"]').contents().find("#outerdocbody");$autocomp=$('<div id="autocomp" class="autocomp-hidden" style="position: absolute;z-index: 10;"><ul id="autocompItems"></ul></div>'),$list=$autocomp.find("#autocompItems"),n.append($autocomp)}!0===clientVars.ep_autocomp.enabled?$("#options-autocomp").prop("checked",!0):$("#options-autocomp").prop("checked",!1),$("#options-autocomp").on("click",function(){!1===$("#options-autocomp").is(":checked")&&$autocomp.hide()}),"true"==autocomp.getParam("autocomp")?$("#options-autocomp").attr("checked","checked"):"false"==autocomp.getParam("autocomp")&&($("#options-autocomp").attr("checked",!1),$autocomp.hide())}},function(t,e,n){var i=n(1),o=n(11).randomString;e.COMMENT_PREFIX="c-";e.FAKE_ID_PREFIX="fake-";var r=e.FAKE_ID_PREFIX;e.collectContentPre=function(t,e){s(e,"cr-","comment-reply-");var n=a(e.cls,"c-");i.each(n,function(t){var n="comment-"+t;e.cc.doAttrib(e.state,n+"::"+t)})},e.getIdsFrom=function(t,e){var n=new RegExp("(?:^| |"+r+")("+e+"[A-Za-z0-9]*)","g"),o=(t||"").match(n)||[];return o=i(o).map(function(t){var e=t.trim();return e.startsWith(r)&&(((pad||{}).plugins||{}).ep_comments_page||{}).fakeIdsMapper&&(e=pad.plugins.ep_comments_page.fakeIdsMapper.getRealIdOfFakeId(e)),e})};var a=e.getIdsFrom;e.collectAttribFrom=function(t,e,n){n=n||"";for(var i=a(t.cls,e),o=0;o<i.length;o++){var r=i[o],s=n+r,c=r;t.cc.doAttrib(t.state,s+"::"+c)}};var s=e.collectAttribFrom;e.getCommentIdsFrom=function(t){return a(t,"c-")},e.getReplyIdsFrom=function(t){return a(t,"cr-")},e.generateCommentId=function(){return"c-"+o(16)},e.generateReplyId=function(){return"cr-"+o(16)}},function(t,e){var n=function(){var t=i()?"prefs":"prefsHttp";function e(){if(!document.cookie)return null;var e=document.cookie.match(new RegExp("(?:^|;)\\s*"+t+"=([^;]*)(?:;|$)"));return e&&e[1]?e[1]:null}function n(){var n;s&&(!function(e){var n=new Date;n.setFullYear(3e3);var o=i()?";secure":"";document.cookie=t+"="+e+";expires="+n.toGMTString()+o}((n=r,escape(JSON.stringify(n)))),e()||a||(alert("Warning: it appears that your browser does not have cookies enabled. EtherPad uses cookies to keep track of unique users for the purpose of putting a quota on the number of active users. Using EtherPad without cookies may fill up your server's user quota faster than expected."),a=!0))}function i(){return"https:"==window.location.protocol}var o=!0,r={},a=!1,s=!1;return{init:function(t,i){i;var a=e();if(a){var c=function(t){try{return JSON.parse(unescape(t))}catch(t){return null}}(a);c&&(o=!1,delete c.userId,delete c.name,delete c.colorId,r=c)}for(var u in t)r[u]=t[u];s=!0,n()},wasNoCookie:function(){return o},isCookiesEnabled:function(){return!!e()},getPref:function(t){return r[t]},setPref:function(t,e){r[t]=e,n()}}}();e.padcookie=n},function(t,e,n){var i=n(110),o=n(60);e.bubbleExceptions=!0;var r=function(t,n,i,o){void 0===o&&(o=function(t){return t});var r=function(t){return void 0===t?[]:t},a=function(){return r(t.hook_fn(n,i,function(t){return o(r(t))}))};if(e.bubbleExceptions)return a();try{return a()}catch(e){console.error([n,t.part.full_name,e.stack||e])}};e.syncMapFirst=function(t,e){var n,i;for(n=0;n<t.length;n++)if((i=e(t[n])).length)return i},e.mapFirst=function(t,e,n){var i=0,o=function(){if(i>=t.length)return n(void 0);e(t[i++],function(t,e){return t?n(t):e.length?n(null,e):void o()})};o()},e.flatten=function(t){var e=[];if(null!=t&&null!=t)for(var n=0;n<t.length;n++)if(null!=t[n]&&null!=t[n])for(var i=0;i<t[n].length;i++)e.push(t[n][i]);return e},e.callAll=function(t,n){if(n||(n={}),e.plugins)return void 0===e.plugins.hooks[t]?[]:o.flatten(o.map(e.plugins.hooks[t],function(e){return r(e,t,n)}),!0)},e.aCallAll=function(t,n,a){if(n||(n={}),a||(a=function(){}),void 0===e.plugins.hooks[t])return a(null,[]);i.map(e.plugins.hooks[t],function(e,i){r(e,t,n,function(t){i(null,t)})},function(t,e){a(null,o.flatten(e,!0))})},e.callFirst=function(t,n){return n||(n={}),void 0===e.plugins.hooks[t]?[]:e.syncMapFirst(e.plugins.hooks[t],function(e){return r(e,t,n)})},e.aCallFirst=function(t,n,i){if(n||(n={}),i||(i=function(){}),void 0===e.plugins.hooks[t])return i(null,[]);e.mapFirst(e.plugins.hooks[t],function(e,i){r(e,t,n,function(t){i(null,t)})},i)},e.callAllStr=function(t,n,i,o,r){null==i&&(i=""),null==o&&(o=""),null==r&&(r="");for(var a=[],s=e.callAll(t,n),c=0,u=s.length;c<u;c++)a[c]=o+s[c]+r;return a.join(i||"")},e.clientPluginNames=function(){return e.plugins?o.uniq(e.plugins.parts.filter(function(t){return t.hasOwnProperty("client_hooks")}).map(function(t){return t.plugin})):[]}},function(t,e,n){var i=n(0).$,o=n(1),r=n(12).tags;e.SCENE_MARK_SELECTOR=n(3).SCENE_MARK_TAGS;var a,s,c=o.union(r,e.SCENE_MARK_SELECTOR).join(", "),u=["author","lmkr","insertorder","start"];e.CHANGE_ELEMENT_BY_SHORTCUT_EVENT="scriptElementChanged",e.getPadOuter=function(){return a=a||i('iframe[name="ace_outer"]').contents()},e.getPadInner=function(){return s=s||e.getPadOuter().find('iframe[name="ace_inner"]').contents()};e.getAllAttributesOfLine=function(t,e){var n=t.getAttributesOnLine(e);return o.reject(n,function(t){var e=t[0];return-1!==u.indexOf(e)})};var l=function(t){t.ace_fastIncorp()};e.synchronizeEditorWithUserSelection=l,e.multipleLineSelected=function(t,e){return l(e),t.selStart[0]!==t.selEnd[0]},e.typeOf=function(t){return(t.find(c).prop("tagName")||"general").toLowerCase()},e.getDOMLineFromLineNumber=function(t,e){return e.lines.atIndex(t).lineNode}},function(t,e,n){var i=n(1),o=n(11).randomString,r=n(18),a=r.getIdsFrom,s=r.collectAttribFrom;e.DELETED_TAG_CLASS="tag_deleted";e.TAG_OCCURRENCE_PREFIX="tag_oc-",e.DELETED_TAG_PREFIX="tag_deleted-",e.collectContentPre=function(t,e){var n=/(?:^| )(to-[A-Za-z0-9]*)/.exec(e.cls);n&&n[1]&&e.cc.doAttrib(e.state,"touchoccurrence::"+n[1]),s(e,"tag_oc-"),s(e,"tag_deleted-tag-")},e.getTagOccurrencesIdsFrom=function(t){return a(t,"tag_oc-")},e.getDeletedTagIdsFrom=function(t){var e=a(t,"tag_deleted-tag-"),n="tag_deleted-".length;return e=i(e).map(function(t){return t.substring(n)})},e.generateTagId=function(){return"tag-"+o(16)},e.generateTOId=function(){return"tag_oc-"+o(16)}},function(t,e,n){t.exports=n(105)},function(t,e,n){(function(t){var i=n(1),o=n(2),r=function(t,e,n){this.callback=t,this.rep=n,this.returnLinesNumberOfChange=e,this._startObserving()};r.prototype._startObserving=function(){var t=o.getPadInner().find("#innerdocbody");this._createObserver().observe(t.get(0),{childList:!0})},r.prototype._createObserver=function(){return new(window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver)(this._handlePadLinesChanged.bind(this))},r.prototype._handlePadLinesChanged=function(t){var e=this._getLineNodesFrom(t,"addedNodes"),n=this._getLineNodesFrom(t,"removedNodes"),o={linesAdded:i(e).difference(n),linesRemoved:i(n).difference(e)};this.returnLinesNumberOfChange&&(o.linesNumberOfChangedNodes=this._getLinesChanged(t)),this.callback(o)},r.prototype._getLinesChanged=function(t){var e=this;return i(t).chain().map(function(t){return t.previousSibling||e._getFirstLineOfScript()}).flatten().unique().filter(function(t){return i.isElement(t)}).map(function(t){return e._getLineNumberFromDOMLine(t)}).value()},r.prototype._getFirstLineOfScript=function(){return o.getPadInner().find("div").first()[0]},r.prototype._getLineNumberFromDOMLine=function(e){var n;try{var i=t(e).attr("id");n=this.rep.lines.indexOfKey(i)}catch(t){return}return n},r.prototype._getLineNodesFrom=function(t,e){return i(t).chain().map(function(t){return Array.from(t[e])}).flatten().compact().unique().value()},e.onLinesAddedOrRemoved=function(t,e,n){return new r(t,e,n)}}).call(this,n(0).$)},function(t,e,n){(function(t){n(1);var i=n(2),o=n(3),r=n(68),a="START_TOGGLE_VISIBILITY".length;e.getVisibilityClass=function(t,e){return t.startsWith(o.SHOW_SCENE_MARK_ATTRIB)?[t]:""},e.buildVisibilityClasses=function(t){return r.getSceneMarkVisibilityAttribNames(t).join(" ")},e.adjustVisibilityOf=function(t){0===t.find("."+d()).length&&t.addClass("hidden")},e.init=function(e,n,r){i.getPadInner().on("click",o.SCENE_MARK_ICONS,function(i){var o=t(i.currentTarget).closest("div");h(o,e,n,r)})},e.isInTheMiddleOfASceneMarkVisibilityToggle=function(t){return t.startsWith("START_TOGGLE_VISIBILITY")},e.getLineNumberToPlaceCaretFromEditEvent=function(t){return parseInt(t.substring(a))};var s,c=function(e,n,r,a){a.ace_inCallStackIfNecessary(o.NON_UNDOABLE_EVENT,function(){e.each(function(e){var o=i.getLineNumberFromDOMLine(t(this),r);u(o,n)})})},u=function(t,e){e.setAttributeOnLine(t,f(),!0)},l=function(t,e){e.removeAttributeOnLine(t,f())},d=function(){return s=s||o.SHOW_SCENE_MARK_ATTRIB+"-"+clientVars.userId.replace("a.","")},f=d;e.showSceneMarksAroundLine=function(e,n,o){var r=n.ace_getRep(),a=t(i.getDOMLineFromLineNumber(e,r)),s=a.prevUntil("div:not(.sceneMark)"),u=a.nextUntil("div:not(.sceneMark)"),l=s.add(a).add(u);l=l.filter(".sceneMark"),c(l,o,r,n)},e.showSceneMarksBelowLine=function(e,n,o){var r=n.ace_getRep(),a=t(i.getDOMLineFromLineNumber(e,r)).nextUntil("div:not(.sceneMark)").addBack();a=a.filter(".sceneMark"),c(a,o,r,n)},e.showSceneMarksAboveLine=function(e,n,o){var r=n.ace_getRep(),a=t(i.getDOMLineFromLineNumber(e,r)).prevUntil("div:not(.sceneMark)").addBack();a=a.filter(".sceneMark"),c(a,o,r,n)};e.hideAllSceneMarks=function(e,n,r,a){!function(e,n,r,a,s){var c=function(){e.each(function(e){var o=i.getLineNumberFromDOMLine(t(this),r);l(o,n)})};s?i.performNonUnduableEvent(s,c):a.ace_callWithAce(c,o.NON_UNDOABLE_EVENT)}(i.getPadInner().find(".sceneMark"),e,n,r,a)};var h=function(e,n,o,r){var a=e.nextUntil("div:has(heading)").andSelf(),s=function(t,e){return e.getAttributeOnLine(t,f())}(i.getLineNumberFromDOMLine(e,o),n),c=p(a,s,o),d="START_TOGGLE_VISIBILITY"+c;r.ace_callWithAce(function(){!function(e,n,o,r){var a=n?l:u;e.each(function(e){var n=i.getLineNumberFromDOMLine(t(this),r);a(n,o)})}(a,s,n,o)},d)},p=function(t,e,n){var o=t.first(),r=t.last().next(),a=e?r:o;return i.getLineNumberFromDOMLine(a,n)}}).call(this,n(0).$)},function(t,e,n){var i=n(1),o=n(4),r=n(14),a=n(93).LevelInfo;e.setActiveLevels=function(t){i(d.ALL_LEVELS).each(function(e){e.isActive=i(t).contains(e.eascTargetLineType)}),d.updateActiveLevels()},e.getActiveLevelByTag=function(t){return d.ACTIVE_LEVELS_BY_TAG_NAME[t]},e.getEditorLevelByName=function(t){return d.ALL_LEVELS_BY_LEVEL_NAME[t]},e.getAllLevels=function(){return d.ALL_LEVELS},e.getActiveLevels=function(){return d.ACTIVE_LEVELS},e.getUpperLevelLinesSelectorOnEditor=function(t){return t.upperLevelsSelector=t.upperLevelsSelector||s(t),t.upperLevelsSelector};var s=function(t){var e=c(t),n=i.map(e,function(t){return t.levelSelectorOnEditor});return i.map(n,function(t){return"div"+t}).join(", ")},c=function(t,e){for(var n=[],i=l(t);i;i=l(i))e&&!i.isActive||n.push(i);return n};e.getActiveUpperLevelsOf=function(t){return c(t,!0)};var u=e.getActiveUpperLevelsOf,l=function(t){if(t)return d.ALL_LEVELS_BY_LEVEL_NAME[t.parentLevelName]};e.getLevelNameOfActiveParentLevelOf=function(t){return d.ACTIVE_PARENTS_NAME[t.levelName]},e.getEditorLeafLevelConfig=function(){return d.EDITOR_LEAF_CONFIG},e.getActiveLeafLevelConfig=function(){return d.ACTIVE_LEAF_CONFIG},e.isActiveLeaf=function(t){return t===d.ACTIVE_LEAF_CONFIG},e.getActiveBranchLevelsConfigs=function(){return d.ACTIVE_BRANCHES_CONFIGS},e.getLinesWithNavigatorContent=function(){return r.getPadInner().contents().find(d.SELECTOR_OF_NAVIGATOR_CONTENT)};var d={init:function(){this.ALL_LEVELS=this.createAllLevelsConfig(),this.ALL_LEVELS_BY_LEVEL_NAME=this.indexLevelsBy("levelName",this.ALL_LEVELS),this.EDITOR_LEAF_CONFIG=i(this.ALL_LEVELS).findWhere({isLeaf:!0}),this.updateActiveLevels()},updateActiveLevels:function(){this.ACTIVE_LEVELS=i(this.ALL_LEVELS).where({isActive:!0}),this.ACTIVE_LEVELS_BY_TAG_NAME=this.indexLevelsBy("tagName",this.ACTIVE_LEVELS),this.ACTIVE_LEAF_CONFIG=this.findLeafOnActiveLevels(),this.ACTIVE_BRANCHES_CONFIGS=u(this.ACTIVE_LEAF_CONFIG),this.ACTIVE_PARENTS_NAME=this.buildMapOfActiveParentLevelName(),this.SELECTOR_OF_NAVIGATOR_CONTENT=this.generateContentSelectorFrom(this.ACTIVE_LEVELS)},indexLevelsBy:function(t,e){return i(e).reduce(function(e,n){return e[n[t]]=n,e},{})},findLeafOnActiveLevels:function(){for(var t=this.EDITOR_LEAF_CONFIG;t&&!t.isActive;t=l(t));return t},buildMapOfActiveParentLevelName:function(){var t=this.indexLevelsBy("levelName",this.ACTIVE_LEVELS);return i(t).mapObject(this.getLevelNameOfActiveParentLevelOf,this)},getLevelNameOfActiveParentLevelOf:function(t){if(!t)return a.ROOT_LEVEL;var e=this.ALL_LEVELS_BY_LEVEL_NAME[t.parentLevelName];return e&&e.isActive?e.levelName:this.getLevelNameOfActiveParentLevelOf(e)},generateContentSelectorFrom:function(t){var e=i(t).pluck("labelSelectorOnEditor");return i.uniq(e).join(", ")},createAllLevelsConfig:function(){var t=[];return t.push(a.createRootBranch("episode").withTag("EPISODE_NAME").withLabelSelectorOnEditor("episode_name").withLevelSelectorOnEditor(".withEpi").withEascTargetLineType("episode").withSubLevelName("act")),t.push(a.createBranch("act").asSubLevelOf("episode").withTag("ACT_NAME").withLabelSelectorOnEditor("act_name").withLevelSelectorOnEditor(".withAct").withEascTargetLineType("act").withSubLevelName("sequence")),t.push(a.createBranch("sequence").asSubLevelOf("act").withTag("SEQUENCE_NAME").withLabelSelectorOnEditor("sequence_name").withLevelSelectorOnEditor(".withSeq").withEascTargetLineType("sequence").withSubLevelName("scene")),t.push(a.createBranch("scene").asSubLevelOf("sequence").withTag("SCENE_NAME").withLabelSelectorOnEditor("scene_name").withLevelSelectorOnEditor(".withSceneSynopsis").withEascTargetLineType("scene").withSubLevelName("script")),t.push(a.createLeaf("script").asSubLevelOf("scene").withTag("HEADING").withLabelSelectorOnEditor("heading").withLevelSelectorOnEditor(".withHeading").withEascTargetLineType(o.SCRIPT_ELEMENT_TYPE)),t}};d.init()},function(t,e,n){var i,o=n(0).$;e.getPadOuter=function(){return i=i||o('iframe[name="ace_outer"]').contents()};var r,a,s=e.getPadOuter;e.getPadInner=function(){return r=r||e.getPadOuter().find('iframe[name="ace_inner"]').contents()},e.hideMouseWindow=function(){o(a).removeClass("visible").addClass("hidden")},e.showMouseWindow=function(){o(a).removeClass("hidden").addClass("visible")},e.getMouseWindow=function(){return a=a||s().find("#mouseWindow")};var c=e.getMouseWindow;e.disableMenuItem=function(t){c().find(t).addClass("nohover disable")},e.resetMouseWindowItem=function(t){c().find(t).removeClass("nohover disable")},e.lineHasMarker=function(t){return 1===t.lineMarker}},function(t,e){e.sendEvent=function(t,e,n,i){ga("send",{hitType:"event",eventCategory:t,eventAction:e,eventLabel:n,eventValue:i})},e.sendException=function(t,e){ga("send",{hitType:"exception",exDescription:t,exFatal:!!e})}},function(t,e,n){var i=n(7),o=n(35);e.PAGE_BREAK_ATTRIBS=["nonSplitPageBreak","nonSplitPageBreakWithMoreAndContd"];e.PAGE_BREAK_TAG="nonSplitPageBreak",i.registerPageBreakTag("nonSplitPageBreak");var r=[];e.addListenerOfHeadingOnTopOfPage=function(t){r.push(t)},e.atribsToClasses=function(t){if(a(t.key))return[t.key];if(s(t.key)){var e=i.buildCharacterNameToClass(t.value);return[t.key,e]}};var a=function(t){return"nonSplitPageBreak"===t},s=function(t){return"nonSplitPageBreakWithMoreAndContd"===t};e.buildHtmlWithPageBreaks=function(t){var e;if(t.match("nonSplitPageBreakWithMoreAndContd")?e=i.buildPageBreakWithMoreAndContd(t,"nonSplitPageBreak"):t.match("nonSplitPageBreak")&&(e=i.buildSimplePageBreak(t,"nonSplitPageBreak")),e)return{preHtml:"<line_with_page_break>",postHtml:e+"</line_with_page_break>"}},e.blockElements=function(){return["line_with_page_break"]},e.cleanPageBreaks=function(t,n,i){for(var o=n;o>=t;o--)e.lineHasPageBreak(o,i)&&c(o,i)},e.lineHasPageBreak=function(t,e){return e.getAttributeOnLine(t,"nonSplitPageBreak")||e.getAttributeOnLine(t,"nonSplitPageBreakWithMoreAndContd")};var c=function(t,e){e.removeAttributeOnLine(t,"nonSplitPageBreak"),e.removeAttributeOnLine(t,"nonSplitPageBreakWithMoreAndContd")};e.getNonSplitInfo=function(t,e,n){var o=t.prev(),r=function(){};if(o.next().hasClass("sceneMark")){var a=o.nextAll(".withHeading").first(),s=i.getLineNumberFromDOMLine(a,n)+e;r=function(t){u(s,t)}}var c=i.getLineNumberFromDOMLine(o,n)+e,d=l(o);return{lineNumberBeforeClean:i.getLineNumberFromDOMLine(o,n),lineNumberAfterClean:c,addMoreAndContd:d,callbackAfterSave:r}};var u=function(t,e){for(var n=0;n<r.length;n++){(0,r[n])(t,e)}},l=function(t){var e=t.has("parenthetical, dialogue").length>0,n=t.next().has("parenthetical, dialogue").length>0;return!(!e||!n)&&{characterName:i.findCharacterNameOf(t)}};e.savePageBreak=function(t,e,n){var i=t.lineNumberAfterClean,r="nonSplitPageBreak",a=!0;t.addMoreAndContd&&(r="nonSplitPageBreakWithMoreAndContd",a=t.addMoreAndContd.characterName),n.setAttributeOnLine(i,r,a),o.savePageBreak(i,e,n)},e.nodeHasPageBreak=function(t){return t.find("nonSplitPageBreak").length>0}},function(t,e,n){var i=n(13),o={};e.updateLastLineAndTypeShowedByAutoComp=function(t){var e=t.selStart[0],n=i.getTypeOfLineWhereCaretIs(t);o={lineNumber:e,typeOfLine:n}},e.suggestionsCurrentlyDisplayedForSameLineAndType=function(t,e){var n=t.selStart[0],i=o.lineNumber,r=o.typeOfLine;return n===i&&e===r}},function(t,e,n){var i=n(0).$,o=n(1),r=(n(5),n(146));e.init=function(){pad.plugins=pad.plugins||{},pad.plugins.ep_comments_page=pad.plugins.ep_comments_page||{},pad.plugins.ep_comments_page.copyPasteHelpers=pad.plugins.ep_comments_page.copyPasteHelpers||[]},e.handlePaste=function(t){var e=t.originalEvent.clipboardData;o(pad.plugins.ep_comments_page.copyPasteHelpers).each(function(t){t.saveItemsAndSubItems(e)})},e.handleCopy=function(t){var e=t.originalEvent.clipboardData,n=i(e.getData("text/html")||"<span/>"),r=o(pad.plugins.ep_comments_page.copyPasteHelpers).map(function(t){return t.addTextAndDataToClipboard(e,n)}),a=o(r).any();return a&&(e.setData("text/html",n.html()),t.preventDefault(),defaultCopyWasPrevented=!0),a||void 0},e.listenToCopyCutPasteEventsOfItems=function(t){var e=r.init(t);pad.plugins.ep_comments_page.copyPasteHelpers.push(e)}},function(t,e,n){(function(t){var n,i;e.EXPORT_HTML_TO_PDF="export_html_to_pdf",e.EXPORT_PDF_EVENT="export_pdf",e.BASE_PATH="file:///app/",e.PLUGINS_FOLDER=e.BASE_PATH+"src/css/static/plugins/",e.getPadOuter=function(){return n=n||t('iframe[name="ace_outer"]').contents()},e.getPadInner=function(){return i=i||e.getPadOuter().find('iframe[name="ace_inner"]').contents()}}).call(this,n(0).$)},function(t,e,n){var i=n(0).$,o=n(5),r=n(49),a=n(85);n(15),n(86);var s=function(){},c=function(t){this.textMarker=a.createForTarget(t.targetType,t.ace),this.$content=t.$content,this.onSubmit=t.onSubmit||s,this.beforeOpen=t.beforeOpen||s,this.ace=t.ace,this.shouldMarkText=!t.targetAlreadyMarked,this.openWithinViewport=t.openWithinViewport,this.scrollAfterOpeningDialog=!t.openWithinViewport,this._getElementOnPadOuterForDialogPosition=t.getElementOnPadOuterForDialogPosition||this._createShadowOnPadOuterOfElementOnPadInner,this._getElementOnPadInnerForDialogPosition=t.getElementOnPadInnerForDialogPosition||this._getSelectedText,this.placeDialogBelowReference=!t.getElementOnPadOuterForDialogPosition,this._buildWidget(t);var e=this;html10n.bind("localized",function(){e._localizeDialogContent()})};c.prototype._buildWidget=function(t){var e=t.customClose||this.close.bind(this),n=o.getPadOuter().find("body");this.$content.appendTo(n);var i={autoOpen:!1,resizable:!1,close:e,classes:{"ui-dialog":"ui-dialog--"+t.targetType}},r={effect:"drop",duration:500},a=t.doNotAnimate?{}:{show:r,hide:r},s=Object.assign({},i,a,t.dialogOpts||{});this.$content.dialog(s),this.widget=this.$content.dialog("widget"),this._customizeCloseButton(),this._customizeDialogTitle(t.dialogTitleL10nKey),this._localizeDialogContent()},c.prototype._customizeCloseButton=function(){var t=i("#closeButton").tmpl(),e=this.widget.find(".ui-dialog-titlebar-close");e.html(t.html()),e.attr("data-l10n-id","ep_comments_page.comments_template.close.title")},c.prototype._customizeDialogTitle=function(t){this.widget.find(".ui-dialog-title").attr("data-l10n-id",t)},c.prototype._localizeDialogContent=function(){r.localize(this.widget)},c.prototype.open=function(t,e){e=e||s;var n=this;this.$content.off("submit").submit(function(){var t=i(this);return n.ace.callWithAce(function(i){var o=n.textMarker.getMarkerSelector(),r=i.ace_getRepFromSelector(o);n.onSubmit(t,r,e)}),!1}),this.shouldMarkText&&this.textMarker.markSelectedText(t),this._localizeDialogContent(),this._resetForm(),this.beforeOpen(),this._openDialog(),this.scrollAfterOpeningDialog&&this._smoothlyScrollEditorToMakeDialogFullyVisible()},c.prototype._resetForm=function(){this.widget.find("form").each(function(){this.reset()})},c.prototype._openDialog=function(){var t=this._getElementOnPadOuterForDialogPosition(),e=this.placeDialogBelowReference?this._configsToOpenDialogBelow(t):this._configsToOpenDialogAtSamePositionOf(t);this._openDialogWithConfigs(e),this._cleanupReferenceElementOnPadOuter()},c.prototype._configsToOpenDialogAtSamePositionOf=function(t){return{my:"left top",at:"left top",of:t}},c.prototype._configsToOpenDialogBelow=function(t){return{my:"left top",at:"left bottom+3",of:t}},c.prototype._openDialogWithConfigs=function(t){var e=this.openWithinViewport?o.getOuterWindow():o.getPadOuter(),n=Object.assign({},{within:e},t);this.$content.dialog("option","position",n).dialog("open")},c.prototype._createShadowOnPadOuterOfElementOnPadInner=function(){var t=this._getElementOnPadInnerForDialogPosition(),e=t.first().get(0).getBoundingClientRect(),n=t.last().get(0).getBoundingClientRect(),r=e.top,a=n.bottom,s=Math.min(e.left,n.left),c=Math.max(e.right,n.right),u=o.getPadOuter().find('iframe[name="ace_inner"]').offset(),l=i('<span id="shadow"></span>');l.css({top:u.top+r,left:u.left+s,width:c-s,height:a-r,position:"absolute"});var d=o.getPadOuter().find("body");return l.appendTo(d),l},c.prototype._cleanupReferenceElementOnPadOuter=function(){o.getPadOuter().find("#shadow").remove()},c.prototype._getSelectedText=function(){var t=this.textMarker.getMarkerSelector(),e=o.getPadInner().find(t);return e.first().closest("div").get(0)!==e.last().closest("div").get(0)&&(e=e.first()),e},c.prototype._focusOnContainer=function(){this.$content.focus();var t=o.getOuterWindow();t&&t.focus()},c.prototype._smoothlyScrollEditorToMakeDialogFullyVisible=function(){var t=this;o.getOuterWindow().scrollIntoView(t.$content.get(0),function(){t._focusOnContainer()})},c.prototype.isOpen=function(){return this.$content.dialog("isOpen")},c.prototype.close=function(){this.$content.dialog("close"),this.shouldMarkText&&this.textMarker.unmarkSelectedText()},e.create=function(t){return new c(t)}},function(t,e,n){(function(t){var i,o,r,a,s=n(19).padcookie,c=n(11).padutils,u=(i=void 0,o=void 0,r=void 0,a={ace:null,viewZoom:100,init:function(e,s,c){i=n(113).Ace2Editor,r=(o=c).settings,a.ace=new i,a.ace.init("editorcontainer","",function(){t("#editorloadingbox").hide(),e&&e()}),a.ace.setProperty("wraps",!0),o.getIsDebugEnabled()&&a.ace.setProperty("dmesg",o.dmesg),a.initViewOptions(),a.setViewOptions(s),t("#viewbarcontents").show()},initViewOptions:function(){c.bindCheckboxChange(t("#options-linenoscheck"),function(){o.changeViewOption("showLineNumbers",c.getCheckbox(t("#options-linenoscheck")))}),c.bindCheckboxChange(t("#options-colorscheck"),function(){s.setPref("showAuthorshipColors",c.getCheckbox("#options-colorscheck")),o.changeViewOption("showAuthorColors",c.getCheckbox("#options-colorscheck"))}),c.bindCheckboxChange(t("#options-rtlcheck"),function(){o.changeViewOption("rtlIsTrue",c.getCheckbox(t("#options-rtlcheck")))}),html10n.bind("localized",function(){o.changeViewOption("rtlIsTrue","rtl"==html10n.getDirection()),c.setCheckbox(t("#options-rtlcheck"),"rtl"==html10n.getDirection())}),t("#viewfontmenu").change(function(){o.changeViewOption("padFontFamily",t("#viewfontmenu").val())}),html10n.bind("localized",function(){t("#languagemenu").val(html10n.getLanguage()),t("input[data-l10n-id]").each(function(e,n){(n=t(n)).hasClass("editempty")&&n.val(html10n.get(n.attr("data-l10n-id")))})}),t("#languagemenu").val(html10n.getLanguage()),t("#languagemenu").change(function(){o.createCookie("language",t("#languagemenu").val(),null,"/"),window.html10n.localize([t("#languagemenu").val(),"en"])})},setViewOptions:function(e){function n(t,n){var i=String(e[t]);return"true"==i||"false"!=i&&n}var i;switch(i=n("rtlIsTrue","rtl"==html10n.getDirection()),a.ace.setProperty("rtlIsTrue",i),c.setCheckbox(t("#options-rtlcheck"),i),i=n("showLineNumbers",!0),a.ace.setProperty("showslinenumbers",i),c.setCheckbox(t("#options-linenoscheck"),i),i=n("showAuthorColors",!0),a.ace.setProperty("showsauthorcolors",i),c.setCheckbox(t("#options-colorscheck"),i),!1!==r.noColors&&a.ace.setProperty("showsauthorcolors",!r.noColors),e.padFontFamily){case"monospace":a.ace.setProperty("textface","monospace");break;case"montserrat":a.ace.setProperty("textface","Montserrat");break;case"opendyslexic":a.ace.setProperty("textface","OpenDyslexic");break;case"comicsans":a.ace.setProperty("textface","'Comic Sans MS','Comic Sans',cursive");break;case"georgia":a.ace.setProperty("textface","Georgia,'Bitstream Charter',serif");break;case"impact":a.ace.setProperty("textface","Impact,Haettenschweiler,'Arial Black',sans-serif");break;case"lucida":a.ace.setProperty("textface","Lucida,'Lucida Serif','Lucida Bright',serif");break;case"lucidasans":a.ace.setProperty("textface","'Lucida Sans','Lucida Grande','Lucida Sans Unicode','Luxi Sans',sans-serif");break;case"palatino":a.ace.setProperty("textface","Palatino,'Palatino Linotype','URW Palladio L',Georgia,serif");break;case"robotomono":a.ace.setProperty("textface","RobotoMono");break;case"tahoma":a.ace.setProperty("textface","Tahoma,sans-serif");break;case"timesnewroman":a.ace.setProperty("textface","'Times New Roman',Times,serif");break;case"trebuchet":a.ace.setProperty("textface","'Trebuchet MS',sans-serif");break;case"verdana":a.ace.setProperty("textface","Verdana,'DejaVu Sans',sans-serif");break;case"symbol":a.ace.setProperty("textface","Symbol");break;case"webdings":a.ace.setProperty("textface","Webdings");break;case"wingdings":a.ace.setProperty("textface","Wingdings");break;case"sansserif":a.ace.setProperty("textface","sans-serif");break;case"serif":a.ace.setProperty("textface","serif");break;default:a.ace.setProperty("textface","")}},dispose:function(){a.ace&&(a.ace.destroy(),a.ace=null)},enable:function(){a.ace&&a.ace.setEditable(!0)},disable:function(){a.ace&&(a.ace.setProperty("grayedOut",!0),a.ace.setEditable(!1))},restoreRevisionText:function(t){o.addHistoricalAuthors(t.historicalAuthorData),a.ace.importAText(t.atext,t.apool,!0)}});e.padeditor=u}).call(this,n(0).$)},function(t,e,n){var i=n(7);e.PAGE_NUMBER_ATTRIB="pageNumber",e.cleanPageBreaks=function(t,e,n){for(var i=e;i>=t;i--)o(i,n)&&r(i,n)},e.savePageBreak=function(t,e,n){n.setAttributeOnLine(t,"pageNumber",e)};var o=function(t,e){return e.getAttributeOnLine(t,"pageNumber")},r=function(t,e){e.removeAttributeOnLine(t,"pageNumber")};e.atribsToClasses=function(t){if(a(t.key)){var e=i.buildPageNumberToClass(t.value);return[t.key,e]}};var a=function(t){return"pageNumber"===t}},function(t,e,n){var i=n(0).$,o=n(1),r=n(6),a=n(7),s=n(16),c=n(29),u=n(35),l=n(37),d=n(124),f=n(125),h=n(126),p=n(127),g=n(129),m=n(130),v=n(25).isInTheMiddleOfASceneMarkVisibilityToggle,_="div:has("+(c.PAGE_BREAK_TAG+","+s.PAGE_BREAK_TAG)+")",y=[c.cleanPageBreaks,s.cleanPageBreaks,u.cleanPageBreaks];e.addListenerOfClearPagination=function(t){y.push(t)},e.addListenerOfHeadingOnTopOfPage=c.addListenerOfHeadingOnTopOfPage,e.setMethodToCleanMarksOnHeadingsOnTopOfPages=p.setMethodToCleanMarksOnHeadingsOnTopOfPages;var b=function(){P(this)},T=function(){var t=this;t.editorInfo.ace_callWithAce(function(){z(t)},"disablePagination")};e.aceInitialized=function(t,n){n.editorInfo;e.enable=o(b).bind(n),e.disable=o(T).bind(n)},e.aceRegisterNonScrollableEditEvents=function(t,e){return[k()]},e.aceRegisterBlockElements=function(t,e){return o.union(s.blockElements(),c.blockElements(),d.blockElements())},e.aceAttribsToClasses=function(t,e){return o.union(s.atribsToClasses(e),c.atribsToClasses(e),d.atribsToClasses(e),u.atribsToClasses(e))},e.aceDomLineProcessLineAttributes=function(t,e){var n=d.buildHtmlWithTargetScroll(e.cls)||"",i=c.buildHtmlWithPageBreaks(e.cls)||s.buildHtmlWithPageBreaks(e.cls)||{preHtml:"",postHtml:"",default:!0};return n||!i.default?[{preHtml:n+i.preHtml,postHtml:i.postHtml,processedMarker:!0}]:[]},e.acePostWriteDomLineHTML=function(t,e){var n=i(e.node);g.markNodeAsChangedIfIsNotASceneMark(n);var o=s.nodeHasPageBreak(n),r=c.nodeHasPageBreak(n),u=a.nodeHasMoreAndContd(n);o&&n.addClass("firstHalf"),(o||r)&&n.addClass("beforePageBreak"),u&&n.addClass("withMoreAndContd")},e.aceEditEvent=function(t,e){var n=e.callstack.type;clientVars.plugins.plugins.ep_script_page_view.pageBreakEnabled?E(n)?(w()&&D(e),g.init(),l.reset(e.rep),m.init()):A()&&S(n)?N(e):O(n)?N(e):e.callstack.docTextChanged&&x(n)&&!v(n)&&P(e):E(n)&&z(e)};var C,I=!1,E=function(t){var e=!1;return I||(I=e="setWraps"===t),e},w=function(){return 0===a.getPadInner().find(_).length},x=function(t){return"applyChangesToBase"!==t},A=function(){return l.hasLinesChanged()},O=function(t){return t===r.CHANGE_ELEMENT_EVENT},S=function(t){return t==="pagination-"+clientVars.userId},k=function(){return"pagination-"+clientVars.userId},P=function(t){clientVars.plugins.plugins.ep_script_page_view.paginationDelay=clientVars.plugins.plugins.ep_script_page_view.paginationDelay||500;var e=t.editorInfo;clearTimeout(C),C=setTimeout(function(){e.ace_callWithAce(function(t){},k())},clientVars.plugins.plugins.ep_script_page_view.paginationDelay)},D=function(t){var e=t.callstack,n=t.documentAttributeManager,i=t.rep,o=t.editorInfo,r=i.selStart.slice(),s=p.calculatePageBreaks(0,r,n,i,!0);a.performNonUnduableEvent(e,function(){j(s.pageBreaksInfo,n,i,o)})},N=function(t){t.editorInfo.ace_getInInternationalComposition()?P(t):g.performIgnoringLineChanges(function(){M(t)})},M=function(t){var e=t.callstack,n=t.documentAttributeManager,i=t.rep,o=t.editorInfo;L(o);var r,s=i.selStart.slice(),c=R(i);if(-1===c)l.reset(i);else if(a.performNonUnduableEvent(e,function(){d.keepViewportScrollPosition(function(){r=p.calculatePageBreaks(c,s,n,i);var t=W(r,i);G(c,t,n,i,o),j(r.pageBreaksInfo,n,i,o)},n,i)}),l.reset(i),r.done)h.hideAll();else{var u=V(r,i);U(u,i),h.displayAllAfterLine(u,i),P(t)}},L=function(t){t.ace_fastIncorp()},R=function(t){var e=l.minLineChanged();if(F(e,t))return-1;if(H(e,t))return 0;for(var n=i(a.getDOMLineFromLineNumber(e,t)),o=0;o<3;o++)n=B(n);return 0===n.length?0:a.getLineNumberFromDOMLine(n,t)},F=function(t,e){return t>=e.lines.length()},H=function(t,e){return t<3},B=function(t){return a.getTopSceneMarkOrTargetLine(t.prev())},W=function(t,e){var n;if(t.done){n=e.lines.length()-1}else{var i=t.pageBreaksInfo;n=i[i.length-1].lineNumberBeforeClean}return n},V=function(t,e){var n;if(t.done){n=e.lines.length()-1}else{var i=t.pageBreaksInfo;n=i[i.length-1].lineNumberAfterClean}return n},U=function(t,e){for(var n=i(a.getDOMLineFromLineNumber(t,e)),o=0;o<3;o++)n=a.getNextLineIgnoringSceneMarks(n);var r=0===n.length?e.lines.length()+1:a.getLineNumberFromDOMLine(n,e);l.markLineAsChanged(r)},z=function(t){var e=t.documentAttributeManager,n=t.rep,i=t.editorInfo,o=n.lines.length();G(0,o,e,n,i)},G=function(t,e,n,i,o){for(var r=0;r<y.length;r++){(0,y[r])(t,e,n,i,o)}},j=function(t,e,n,i){for(var o=q(t,n),r=0;r<t.length;r++){var a=o+r,s=t[r];s.save(s.data,a,e,n,i)}f.fix(n,e)},q=function(t,e){var n=1,o=t[0];if(o){var r=o.lineNumberAfterClean,s=i(a.getDOMLineFromLineNumber(r,e)).prevAll(_);if(s.length>0){var c=s.first(),u=a.pageNumberOfDOMLine(c);n=parseInt(u||1)}}return n+1}},function(t,e,n){var i=n(1),o=n(7),r={rep:void 0,lines:{},initialized:!1,add:function(t){this.lines[t]=!0},reset:function(t){this.rep=t,this.lines={},this.initialized=!0}};e.reset=function(t){r.reset(t)},e.markNodeAsChanged=function(t){if(r.initialized){var e=o.getLineNumberFromDOMLine(t,r.rep);r.add(e)}},e.markLineAsChanged=function(t){r.initialized&&r.add(t)},e.hasLinesChanged=function(){return i(r.lines).keys().size>0},e.minLineChanged=function(){return i(i(r.lines).keys()).min()},e.lineWasChanged=function(t){return r.lines[t]}},function(t,e,n){var i=n(29),o=n(16),r=n(6);e.UNDO_FIX_ATTRIB="lineMightBeAffectedByUndo",e.UNDO_FIX_TAG="line_with_undo_fix",e.fix=function(t,e,n){var r=t>0;e?i.lineHasPageBreak(t,n)?a(t,n):o.lineHasPageBreak(t,n)?a(t,n):r&&o.lineHasPageBreak(t-1,n)&&a(t-1,n):s(t,n)?i.lineHasPageBreak(t,n)&&a(t,n):r&&s(t-1,n)&&o.lineHasPageBreak(t-1,n)&&a(t-1,n)};var a=function(t,n){n.setAttributeOnLine(t,e.UNDO_FIX_ATTRIB,!0)},s=function(t,e){return r.getLineType(t,e)}},function(t,e,n){n(13).getPadInner;var i=void 0;e.doNotDisplaySuggestionsForCurrentLineUntilReset=function(t){var e=t.selStart[0];i=e},e.resetLinesMarkedAsRecentlyAutocompleted=function(){i=void 0},e.currentLineIsRecentlyAutocompleted=function(t){return t.selStart[0]===i}},function(t,e,n){(function(t,i){var o=n(1),r=n(13),a=r.getPadInner,s=r.getCurrentLineText,c=(r.getCurrentColumn,r.getDefaultSuggestions),u=r.lineHasSceneTimeSeparator,l=r.removeCurrentElement,d=n(30);function f(t){var e,n=/.+ - (.+)$/.exec(t);return null!==n&&(e=n[1]),e}function h(t){var e,n=/(^(EXT|INT|E\/I|I\/E)\. ?)?(.*)( - )(.*)$/.exec(t);n?e=n[3]:e=/(^(EXT|INT|E\/I|I\/E)\. ?)?(.*)$/.exec(t)[3];return e}function p(){var t=a().find("heading");return o.map(t,function(t){return i(t).text().trim().toUpperCase()})}e.SCENE_EXTENSIONS=["EXT","INT","E/I","I/E"],e.showSceneSuggestion=function(n){var i,r,a,g,m,v,_=n.documentAttributeManager,y=n.rep,b=y.selStart[0],T=s(b,y,_),C=0===T.trim().length,I=d.suggestionsCurrentlyDisplayedForSameLineAndType(y,"heading");if(C&&!I)t.closeSuggestionBox(n);else{var E,w=T.toUpperCase(),x=function(t){var e=!1;null!==/(^(I|E)\/?|^(IN|EX))$/.exec(t)&&(e=!0);return e}(w),A=u(T),O=void 0,S=void 0;if(C||x)E=e.SCENE_EXTENSIONS;else if(A){O=/.* - (.*)$/,S=1;var k=f(w),P=(i=c("scene.time.main"),r=c("scene.time.periods_of_day"),a=c("scene.time.intervals"),v=p(),m=o.map(v,function(t){return f(t)}),g=o.compact(m),o.union(i,g,r,a));E=l(P,k)}else{O=/^((INT|EXT|E\/I|I\/E)\. )?(.*)$/i,S=3;var D=h(w),N=function(){return t=p(),o.map(t,function(t){return h(t)});var t}(),M=l(N,D);E=o.uniq(M)}t.updateSuggestions(n,{fixedSuggestions:E,customRegex:O,customRegexIndex:S})}}}).call(this,n(17).autocomp,n(0).$)},function(t,e,n){var i=n(0).$,o=n(8),r="div:not(."+o.PASTE_SEPARATOR+")";e.lineAndCharForPoint=function(t,e){var n;try{n=e.editorInfo.ace_getLineAndCharForPoint(e.point)}catch(t){var o=i(e.point.node),r=parseInt(o.attr("data-lastPastedLine"));n=[r,e.rep.lines.atIndex(r).text.length]}return n},e.savePasteInfo=function(t,e){var n=a(t);s(n+e)};var a=function(t){var e=t.prevAll(r).length-1,n=1;return t.find("."+o.PASTE_SEPARATOR).length>0&&(n=o.getSiblingsAboveHelperTagsOnLine(t).length),e+n},s=function(t){o.getPadInner().find("."+o.PASTE_SEPARATOR+" br").last().attr("data-lastPastedLine",t)}},function(t,e,n){(function(t){var i=n(1),o=n(8),r=n(73),a=n(41),s=n(74),c=n(3),u=n(7),l=n(16),d=n(12).tags.join(","),f="pasteOnSM,"+i.map(c.SCENE_MARK_TAGS,function(t){return".paste_on_"+t}).join(",");e.prepareLineToReceivePastedContent=function(t){s.pastedOnLineWithSceneMark(t);var e="paste_on_"+o.typeOfLineWithDroppedContent(t),n=r.getTagToAddMarkerClassOnPaste(t);n.addClass(e),n.addClass("pasteOnSM")},e.pasteStillProcessing=function(){return o.getPadInner().find(f).length>0},e.handlePastedContentIfUserPastedOnThisLine=function(t){var e=-1!==t.indexOf("pasteOnSM");if(e){var n=p(t),i=r.getTargetLine("pasteOnSM"),s=o.getPastedLines(i);s=o.transformParagraphsIntoRegularLines(s),s=o.ignoreEmptyLinesPasted(s),i.removeClass("pasteOnSM"),g(s),b(s,n),C(i,n),h(t)?(a.savePasteInfo(i,1),v(i,s,n)):a.savePasteInfo(i,s.length)}return e};var h=function(t){return/(?:^| )paste_on_[a-z]*_name/.test(t)},p=function(t){return/(?:^| )paste_on_([a-z_]*)/.exec(t)[1]},g=function(t){m(t),l.dontCollectPageBreaksOfLines(t),u.cleanHelperLines(t)},m=function(e){e.filter(":has("+l.SECOND_HALF_TAG+")").each(function(){var e=t(this),n=e.prev();l.linesAreHalvesOfSameSplit(n,e)&&(n.append(e.contents()),e.remove())})},v=function(e,n,i){var r=_(e,n,i);y(r).each(function(){0===t(this).text().length?t(this).find("br").replaceWith("<span> </span>"):t(this).append("<span> </span>")}),o.replaceTagsBySpan(e,"div"),e.find("br").remove()},_=function(t,e,n){var i="> "+n,r=":not(:has(."+o.TARGET_FOR_MULTI_LINE_PASTE+"))",a=t.find(i+r);return e.add(a)},y=function(t){var e=t.length;return t.slice(0,e-1)},b=function(e,n){T(e);var i="<"+n+"/>";e.each(function(){var e=t(i);e.append(t(this).contents()),t(this).append(e)})},T=function(t){o.replaceTagsBySpan(t,c.SCENE_MARK_TAGS_SELECTOR),o.replaceTagsBySpan(t,d)},C=function(t,e){var n=t.find("> "+e).attr("class");t.find(e).addClass(n)}}).call(this,n(0).$)},function(t,e,n){var i=n(1),o=n(6);e.removeAndProcessSelection=function(t,e,n,i,o,u){var l=t.editorInfo,d=(t.rep,t.documentAttributeManager),f="";if(u){var h=n[0];f=r(h,d)}a(e,n,l),i&&s(l),""!==f&&c(f,o,d,l)};var r=function(t,e){var n=[];if(e.lineHasMarker(t)){var r=e.getAttributesOnLine(t);n=i.reject(r,function(t){var e=t[0];return-1!==o.DEFAULT_LINE_ATTRIBS.indexOf(e)})}return n},a=function(t,e,n){n.ace_performDocumentReplaceRange(t,e,""),u(n,t)},s=function(t){return t.ace_doReturnKey()},c=function(t,e,n){n.removeAttributeOnLine(e,"script_element"),t.forEach(function(t){var i=t[0],o=t[1];n.setAttributeOnLine(e,i,o)})},u=function(t,e){t.ace_inCallStackIfNecessary("placeCaretAfterRemoveSelection",function(){t.ace_performSelectionChange(e,e,!0),t.ace_updateBrowserSelectionFromRep()})}},function(t,e,n){var i=n(2),o=n(43),r=n(6);e.processSelection=function(t){var e=t.rep,n=t.editorInfo,c=t.documentAttributeManager,u=e.selStart[0],h=e.selEnd[0];if(r.lineIsScriptElement(h))if(d(c,h)){if(f(u,h,e)){s(t,h),u=e.selStart[0];var g=e.selEnd[0];p(u,g,t),I(n,e.selStart)}else{s(t,h);var m=e.selEnd[0],v=i.getFirstSceneMarkOfScene(m,e);p(v,m,t);var _=i.getFirstSceneMarkOfScene(e.selStart[0],e);a(_,v-1,n,e)}}else{var y=_=i.getFirstSceneMarkOfScene(u,e),b=[_,0];o.removeAndProcessSelection(t,b,e.selEnd,!1,y,!0)}else if(l(u,h,c,e)){var T=i.getFirstSceneMarkOfScene(h,e);p(T,h,t);var C=i.getFirstSceneMarkOfScene(u,e);a(C,T-1,n,e)}else p(u,h,t),I(n,[u,1]);return!0};var a=function(t,e,n,i){var o=i.lines.length(),r=[0,0],a=[e,T(e,i)];if(t>0){var s=t-1;r=[s,T(s,i)]}0===t&&e<o&&(a=[e+1,0]);n.ace_performDocumentReplaceRange(r,a,"")},s=function(t,e){var n=t.rep,i=t.editorInfo,o=e-1,r=n.selStart,a=[o,T(o,n)],s=[e,1],l=n.selEnd;c(e,t,s,l),u(i,r,a)},c=function(t,e,n,i){var o=e.rep,r=e.editorInfo,a=t-1;n=n||[a,T(a,o)],i=i||[t,T(t,o)],r.ace_performDocumentReplaceRange(n,i,"")},u=function(t,e,n){t.ace_performSelectionChange(e,n,!0),t.ace_updateBrowserSelectionFromRep()},l=function(t,e,n,o){var r=h(t,o);return i.lineIsSceneMark(e,n)&&r<e},d=function(t,e){return"heading"===t.getAttributeOnLine(e,"script_element")},f=function(t,e,n){return h(t,n)===e},h=function(t,e){var n=i.getPadInner().find("div").eq(t).nextUntil("div:has(heading)").andSelf().last().next();return i.getLineNumberFromDOMLine(n,e)},p=function(t,e,n){for(var i=n.documentAttributeManager,o=n.rep,r=e;r>=t;r--)if(C(r)&&!m(r,t,e))c(r,n);else{_(r,n);var a=r+1,s=g(a,o,i);C(r)&&s&&c(a,n)}};e.cleanLinesSceneMark=p;var g=function(t,e,n){var i=T(t,e),o=e.selStart[0],r=e.selEnd[0],a=!1;if(o<t&&r>t)a=!0;else if(e.selStart[0]===t&&e.selEnd[0]===t){var s=v(t,n);e.selStart[1]!==s&&e.selEnd[1]!==i||(a=!0)}return a},m=function(t,e,n){return t===e||t===n},v=function(t,e){return e.lineHasMarker(t)},_=function(t,e){var n=e.rep,i=e.editorInfo,o=e.documentAttributeManager,r=T(t,n),a=[t,v(t,o)?1:0],s=[t,r];y(t,n)?a=[t,n.selStart[1]]:b(t,n)&&(s=[t,n.selEnd[1]]),i.ace_performDocumentReplaceRange(a,s,"")},y=function(t,e){return t===e.selStart[0]},b=function(t,e){return t===e.selEnd[0]},T=function(t,e){var n=t+1,i=e.lines.offsetOfIndex(t);return e.lines.offsetOfIndex(n)-i-1},C=function(t){var e=i.getPadInner().find("div").eq(t),n=e.next();return i.typeOf(e)===i.typeOf(n)},I=function(t,e){t.ace_inCallStackIfNecessary("placeCaretAfterRemoveSelection",function(){t.ace_performSelectionChange(e,e,!0),t.ace_updateBrowserSelectionFromRep()})}},function(t,e,n){var i,o,r,a=n(0).$;e.getPadOuterWindow=function(){return i=i||a('iframe[name="ace_outer"]').get(0).contentWindow},e.getPadOuter=function(){return o=o||a('iframe[name="ace_outer"]').contents()},e.getPadInner=function(){return r=r||this.getPadOuter().find('iframe[name="ace_inner"]').contents()}},function(t,e,n){var i=n(1),o=n(5),r=n(47),a=function(t,e){this.targetLineAlreadyChanged=!1,this.selector=t,this.callback=e,this.scheduler=r.setCallbackWhenUserStopsChangingPad(this.triggerCallbackIfNecessary.bind(this)),this.startObserving()};a.prototype.startObserving=function(){var t=o.getPadInner().find("#innerdocbody");this.createObserver().observe(t.get(0),{childList:!0})},a.prototype.createObserver=function(){return new(window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver)(this.handlePadLinesChanged.bind(this))},a.prototype.handlePadLinesChanged=function(t){this.scheduler.padChanged(),!this.targetLineAlreadyChanged&&this.mutationsAffectedATargetLine(t)&&(this.targetLineAlreadyChanged=!0)},a.prototype.mutationsAffectedATargetLine=function(t){var e=this.selector;return i(t).chain().map(function(t){var e=Array.from(t.addedNodes),n=Array.from(t.removedNodes);return e.concat(n)}).flatten().compact().unique().any(function(t){if(i.isElement(t))return t.querySelector(e)}).value()},a.prototype.triggerCallbackIfNecessary=function(){this.targetLineAlreadyChanged&&(this.targetLineAlreadyChanged=!1,this.callback())},e.onLineChanged=function(t,e){return new a(t,e)}},function(t,e){var n=function(t,e){this.timer=void 0,this.callback=t,this.timeout=e||300};n.prototype.padChanged=function(){clearTimeout(this.timer),this.timer=setTimeout(this.callback,this.timeout)},e.setCallbackWhenUserStopsChangingPad=function(t,e){return new n(t,e)}},function(t,e,n){var i=n(5),o=function(t){this.highlightId=t,this.$head=i.getPadInner().find("head")};o.prototype.highlightTargetTextOf=function(t,e){var n=this.highlightId+" "+this._getTextMarkStyleClass(t),i="."+t,o="background: "+e+" !important";this.$head.append(`<style class="${n}">${i}{${o}}</style>`)},o.prototype.removeHighlightOfTargetTextOf=function(t){var e=this._getStyleClass(t);this.$head.find(e).remove()},o.prototype.removeHighlightOfAllTextMarks=function(){var t=this._getStyleClass();this.$head.find(t).remove()},o.prototype._getStyleClass=function(t){var e="."+this.highlightId;return t&&(e+="."+this._getTextMarkStyleClass(t)),e},o.prototype._getTextMarkStyleClass=function(t){return this.highlightId+"--"+t},e.init=function(t){return new o(t)}},function(t,e){e.localize=function(t){html10n.translateElement(html10n.translations,t.get(0))}},function(t,e,n){var i=n(0).$,o=n(1),r=n(5),a=n(33);n(15);e.NON_SCROLLABLE_EVENT="selectTextMarks";var s=function(){},c=function(t){var e=t.ace;this.buildTextMarkData=t.buildTextMarkData,this.infoTemplate=t.infoTemplate,this.editTemplate=t.editTemplate,this.dialogTitleKey=t.dialogTitleKey,this.saveTextMark=t.saveTextMark,this.removeTextMark=t.removeTextMark,this.infoDialogCustomButtons=t.infoDialogCustomButtons||[],this.addAdditionalElementsOnInfoDialog=t.addAdditionalElementsOnInfoDialog||function(){},this.textMarkIdBeingDisplayed=void 0,this.targetType=t.targetType,this.infoDialog=this._createInfoDialog(e),this.editDialog=this._createEditDialog(e)};c.prototype._createInfoDialog=function(t){var e=this.infoTemplate.mainComponentSelector,n=i('<div><div id="'+e+'"></div></div>'),o=this._buildInfoDialogButtons(),r={$content:n,dialogTitleL10nKey:this.dialogTitleKey,ace:t,targetType:this.targetType,onSubmit:s,doNotAnimate:!0,openWithinViewport:!0,dialogOpts:{buttons:o}};return a.create(r)},c.prototype._buildInfoDialogButtons=function(){var t=[{buttonName:"edit",handler:this._closeInfoDialogAndShowEditDialog.bind(this)},{buttonName:"delete",handler:this._deleteTextMarkAndCloseInfoDialog.bind(this)}],e=o(t.concat(this.infoDialogCustomButtons)).compact();return o(e).map(function(t){return this._buildButton(t)},this)},c.prototype._createEditDialog=function(t){var e={$content:i(`<div><div id="${this.editTemplate.mainComponentSelector}"></div></div>`),dialogTitleL10nKey:this.dialogTitleKey,ace:t,targetType:this.targetType,targetAlreadyMarked:!0,onSubmit:this._saveTextMark.bind(this),customClose:this._closeEditDialogAndShowInfoDialog.bind(this),doNotAnimate:!0};return a.create(e)},c.prototype._buildButton=function(t){var e=this,n=t.buttonName,i=t.handler;return{text:n,"data-l10n-id":"ep_comments_page.comments_template."+n,"data-l10n-args":t.buttonL10nArgs||"{}",class:"button--"+n,click:function(t){var n=e.textMarkIdBeingDisplayed;i(n,t)}}},c.prototype._deleteTextMarkAndCloseInfoDialog=function(t){this.removeTextMark(t),this.hideTextMarkInfoDialog()},c.prototype.hideTextMarkInfoDialog=function(){this.infoDialog.isOpen()&&(this.textMarkIdBeingDisplayed=void 0,this.infoDialog.close())},c.prototype._saveTextMark=function(t){var e=this.textMarkIdBeingDisplayed;this.saveTextMark(e,t,this._closeEditDialogAndShowInfoDialog.bind(this))},c.prototype._closeEditDialogAndShowInfoDialog=function(){var t=this.textMarkIdBeingDisplayed;this.showTextMarkInfoDialogForId(t,this.currentOwner),this.editDialog.close()},c.prototype._closeInfoDialogAndShowEditDialog=function(){this._fillTextMarkContentOnEditDialog(),this.editDialog.open(),this.infoDialog.close(),this._placeFocusOnDescription()},c.prototype._placeFocusOnDescription=function(){var t=this.editTemplate.descriptionFieldId,e=this.editDialog.widget.find(t);e.focus();var n=e.val();e.val("").val(n)},c.prototype.showTextMarkInfoDialogForId=function(t,e){var n=this;this._showTextMarkInfoDialog(t,function(e){n._selectTextOfBegginingOfTextMark(t,e)},e)},c.prototype._showTextMarkInfoDialog=function(t,e,n){var i=this;this.textMarkIdBeingDisplayed=t,this.currentOwner=n,this._keepCurrentRepSelection(function(){var t=i.infoDialog;i._fillTextMarkContentOnInfoDialog(),e(t),t.open(null,s)})},c.prototype._keepCurrentRepSelection=function(t){var e=this._getCurrentRepSelection();t();this._selectTextOfRepPosition(function(){return e},this.infoDialog)},c.prototype._getCurrentRepSelection=function(){var t;return this.infoDialog.ace.callWithAce(function(e){var n=e.ace_getRep(),i=n.selStart.slice(0),o=n.selEnd.slice(0);t=[i,o]}),t},c.prototype._fillTextMarkContentOnInfoDialog=function(){this._fillTextMarkContent(this.infoDialog,this.infoTemplate.id,this.infoTemplate.mainComponentSelector,this.addAdditionalElementsOnInfoDialog)},c.prototype._fillTextMarkContentOnEditDialog=function(){this._fillTextMarkContent(this.editDialog,this.editTemplate.id,this.editTemplate.mainComponentSelector)},c.prototype._buildTextMarkInfoDataToShowOnTemplate=function(t){return this.buildTextMarkData(t)},c.prototype._fillTextMarkContent=function(t,e,n,o){var a=this.textMarkIdBeingDisplayed,s=this._buildTextMarkInfoDataToShowOnTemplate(a),c=i(e).tmpl(s);r.replaceDialogContentWith(c,t,n),o&&o(t,s)},c.prototype._selectTextOfBegginingOfTextMark=function(t,e){this._selectTextOfRepPosition(function(e){return e.ace_getRepFromSelector("."+t)[0]},e)},c.prototype._selectTextOfRepPosition=function(t,e){e.ace.callWithAce(function(e){e.ace_inCallStackIfNecessary("selectTextMarks",function(){var n=t(e);e.ace_performSelectionChange(n[0],n[1],!0),e.ace_updateBrowserSelectionFromRep()})})},c.prototype.eventTargetIsATextMarkInfoDialog=function(t){return this._elementIsATextMarkInfoDialog(t.target)},c.prototype._elementIsATextMarkInfoDialog=function(t){var e=this.infoDialog.widget.get(0),n=this.editDialog.widget.get(0),o=0!==i(t).closest(e).length,r=0!==i(t).closest(n).length;return o||r},e.init=function(t){return new c(t)}},function(t,e,n){var i=n(1),o=n(82);e.COLOR_NAMES=o.COLOR_NAMES;var r=i(o.COLOR_NAMES).shuffle(),a=r.length-1;e.getNextRandomColor=function(){return a=(a+1)%r.length,r[a]},e.getHighlightedTagColor=function(t){return o.getColorHash(t,"0.4")}},function(t,e,n){(function(t){var i=n(53),o=n(54),r=n(1);e.init=function(){var t=r.throttle(a,1e3);i.getPadOuter().scroll(function(){t()})};var a=function(){if(i.SCRIPT_ELEMENTS_ARE_VISIBLE){var t=s();o.triggerUpdateCurrentPage(t)}};e.triggerUpdateCurrentPageViaAPI=a;var s=function(t){var e=(c(t)+i.getLineDefaultSize())/i.getLineDefaultSize();return i.getPageNumberOfLinePosition(e)||1};e.getCurrentPage=s;var c=function(t){var e=t||l(),n=d(e)+i.getEditorPaddingTop();return u(e)-n},u=function(t){return i.getFirstNonSceneMarkElementOfTopOfPage(t).position().top},l=function(){return t('iframe[name="ace_outer"]').contents().find("#outerdocbody").parent().scrollTop()},d=function(t){var e=function(t){return i.getFirstNonSceneMarkElementOfTopOfPage(t).prevAll("div.sceneMark")}(t);return i.getSceneMarksHeight(e,t)}}).call(this,n(0).$)},function(t,e,n){(function(t){var i,o=n(1);e.SCRIPT_ELEMENTS_ARE_VISIBLE=!0;var r,a=function(){return i=i||t('iframe[name="ace_outer"]').contents()};e.getPadOuter=a;var s=function(){return r=r||a().find('iframe[name="ace_inner"]').contents()};e.getPadInner=s,e.getLineDefaultSize=function(){return a().find("#linemetricsdiv").get(0).getBoundingClientRect().height};e.getEditorPaddingTop=function(){return parseInt(s().find(".innerPV").css("padding-top"),10)},e.getSceneMarksHeight=function(e,n){return o.reduce(e,function(e,n){return t(n).height()>0?e+t(n).outerHeight(!0):e},0)+c(n)};var c=function(t){return 27*h(t)},u=function(t){var e;void 0!==t?e=l(t).prevAll("div.withHeading"):e=s().find("div.withHeading");return e},l=function(t){var e=d(t);return f(e)};e.getFirstNonSceneMarkElementOfTopOfPage=l;var d=function(n){var i=s()[0],o=s().find("div").first()[0].clientWidth,r=i.elementFromPoint(o/2,n),a=t(r).closest("div");if(0===a.length){var c=e.getLineDefaultSize();r=i.elementFromPoint(o/2,n+c),0===(a=t(r).closest("div")).length&&(r=i.elementFromPoint(o/2,n+2*c),a=t(r).closest("div"))}return a},f=function(t){var e=t;return t.hasClass("sceneMark")?e=t.nextUntil("div:not(.sceneMark)").addBack().next().last():(t.hasClass("innerdocbody")||0===t.length)&&(e=s().find("div:not(.sceneMark)").first()),e},h=function(e){var n=function(e){var n=u(e);return o.map(n,function(e){return t(e).prevUntil("div:not(.sceneMark)")})}(e);return o.filter(n,function(t){return p(t)>0}).length},p=function(e){return o.reduce(e,function(e,n){return e+t(n).height()},0)};e.getPageNumberOfLinePosition=function(t){var e=t/56;return Number.isInteger(e)?e:Math.floor(e)+1}}).call(this,n(0).$)},function(t,e){e.triggerUpdateEditorTotalPages=function(t){n({type:"update_editor_total_pages_event",editorTotalPages:t})},e.triggerUpdateCurrentPage=function(t){n({type:"update_editor_current_page_event",editorCurrentPage:t})};var n=function(t){(window.parent?window.parent:window).postMessage(t,"*")}},function(t,e,n){var i=n(1),o=n(25),r=n(2),a=n(3),s="synopsis",c="sequence",u="act",l="episode",d={synopsis:"withSceneSynopsis",sequence:"withSeq",act:"withAct",episode:"withEpi"};e.addSceneSynopsisToLine=function(t,e){var n=!e,i=this.editorInfo,o=this.documentAttributeManager,r=["scene_name","scene_summary"];f(t)||(E(i,o,t,r,!1),n&&C(i,o,t,r,!1),U(t))};var f=function(t){return 0!==r.getPadInner().find("div").eq(t).prevUntil("div:not(.sceneMark)").find("scene_name").length};e.addScene=function(t,e,n,i){var o=h(t),a=["scene_name","scene_summary","heading"],c=r.getPadInner().find("div").eq(t);r.isLineHeadingOrSceneMark(o)?(t=H(c,s),T(e,n,t,a,i)):(t=p(o,c,t),b(e,n,t,a,i)),U(t)},e.addEpisode=function(t,e,n,i){var a=h(t),s=["episode_name","episode_summary","act_name","act_summary","sequence_name","sequence_summary","scene_name","scene_summary","heading"],c=_(t,a,s);i&&o.showSceneMarksAroundLine(t,e,n);var u=r.getPadInner().find("div").eq(t);c?(t=H(u,l),T(e,n,t,s,i)):(s=g(a,u,s),t=p(a,u,t),b(e,n,t,s,i)),U(t)},e.addAct=function(t,e,n,i){var a=h(t),s=["act_name","act_summary","sequence_name","sequence_summary","scene_name","scene_summary","heading"],c=_(t,a,s);i&&o.showSceneMarksAroundLine(t,e,n);var l=r.getPadInner().find("div").eq(t);c?(t=H(l,u),T(e,n,t,s,i)):(s=g(a,l,s),t=p(a,l,t),b(e,n,t,s,i)),U(t)},e.addSequence=function(t,e,n,i){var a=h(t),s=["sequence_name","sequence_summary","scene_name","scene_summary","heading"],u=_(t,a,s);i&&o.showSceneMarksAroundLine(t,e,n);var l=r.getPadInner().find("div").eq(t);u?(t=H(l,c),T(e,n,t,s,i)):(s=g(a,l,s),t=p(a,l,t),b(e,n,t,s,i)),U(t)};var h=function(t){var e=r.getPadInner().find("div").eq(t);return r.typeOf(e)},p=function(t,e){var n=e,i=R(t),o="heading"===t,a=r.lineTypeIsSceneMark(t);return o||a?n=v(e):i&&(n=F(e)),y(n)},g=function(t,e,n){return r.isLineHeadingOrSceneMark(t)&&(n=m(e,n)),n},m=function(t,e){var n=[],o=r.getFirstSceneMarkTagOfSet(t),a=i.indexOf(e,o);return a>0&&(n=e.slice(0,a)),n},v=function(t){var e=r.getFirstSceneMarkTagOfSet(t),n=t;return 0===t.find(e).length&&(n=t.prevUntil("div:has("+e+")").addBack().first().prev()),n},_=function(t,e,n){var i=r.getPadInner().find("div").eq(t);return 0===g(e,i,n).length},y=function(t){var e=r.getPadInner().find("div");return i.indexOf(e,t[0])},b=function(t,e,n,i,o){E(t,e,n,i),C(t,e,n,i,o)},T=function(t,e,n,i,o){t.ace_inCallStackIfNecessary("forceScrollToLinesCreated",function(){var r=n+1;I(t,e,n,i),C(t,e,r,i,o),t.ace_fastIncorp()})},C=function(t,e,n,i,r){if(r)o.showSceneMarksAroundLine(n,t,e),N(t,[n,1]);else{var a=i.length;N(t,[n+a,1])}},I=function(t,e,n,i){t.ace_inCallStackIfNecessary("createNewLinesAndAddAttributesToTheseLines",function(){i.length;var o=t.ace_getRep(),r=n+1;L(n,t,o),A(i,t),x(r,i,e)})},E=function(t,e,n,i){t.ace_inCallStackIfNecessary("createNewLinesAndAddAttributesToTheseLines",function(){var o=i.length,r=n+o,a=t.ace_getRep();w(t,a,o,function(){M(t,a,n),A(i,t),S(n,r,e),x(n,i,e)})})},w=function(t,e,n,i){var o=e.selStart.slice(0),r=e.selEnd.slice(0);i(),o[0]=o[0]+n,r[0]=r[0]+n,N(t,o,r)},x=function(t,e,n){for(var i=0;i<e.length;i++){var o=t+i,r=e[i];k(o,n,r)}},A=function(t,e){for(var n=t.length,i=0;i<n;i++)O(e)},O=function(t){t.ace_doReturnKey()},S=function(t,e,n){var o=n.getAttributesOnLine(t);i.reject(o,function(t){var e=t[0];return-1!==a.DEFAULT_LINE_ATTRIBS.indexOf(e)}).forEach(function(i){var o=i[0],r=i[1];n.setAttributeOnLine(e,o,r),n.removeAttributeOnLine(t,o)})},k=function(t,e,n){var i=P(n);e.setAttributeOnLine(t,i,n)},P=function(t){var e="script_element";return r.lineTypeIsSceneMark(t)&&(e=D(t)),e},D=function(t){var e=i.indexOf(a.SCENE_MARK_TAGS,t),n=Math.floor(e/2);return a.SCENE_MARK_KEYS[n]},N=function(t,e,n){n=n||e,t.ace_inCallStackIfNecessary("SceneMarkPlaceCaretOnLine",function(){t.ace_performSelectionChange(e,n,!0),t.ace_updateBrowserSelectionFromRep()})},M=function(t,e,n){var i=e.lines.atIndex(n).lineMarker;N(t,[n,i])},L=function(t,e,n){var i=[t,n.lines.atIndex(t).width-1];N(e,i,i)},R=function(t){return"dialogue"===t||"parenthetical"===t},F=function(t){for(var e=t,n=t.prev(),i=r.typeOf(n),o=R(i);o;)n=n.prev(),i=r.typeOf(n),o=R(i);return 1===n.find("character").length&&(e=n),e},H=function(t,e){var n=B(t),i=W(n,e);return y(i)},B=function(t){var e=t;return V(e)&&(e=t.nextUntil("div:has(heading)").addBack().last().next()),e},W=function(t,e){var n=t.nextUntil("div."+d[e]).addBack().last();return V(n)&&(n=n.prevUntil("div:not(.sceneMark)").addBack().first().prev()),n},V=function(t){return t.hasClass("sceneMark")},U=function(t){r.getPadInner().find("#innerdocbody").trigger(a.SCENE_MARK_ADD_EVENT,[[t]])}},function(t,e,n){var i=n(1),o=n(14),r=n(234),a=n(92);e.activeLevelsId=[],e.initialize=function(t){window.addEventListener("message",function(e){f(e,t)})},e.triggerHighlightItem=function(t,e){var n=c(t)?t:e();d({type:"navigator_highlight_item",lineId:n})};var s,c=function(t){return s&&i(s.indexes.rawIds).contains(t)};e.triggerDataChanged=function(t){s=t;var e={type:"navigator_data_changed",values:u(t)};d(e)};var u=function(t){var e=t.values.itemsOnNextLevel;return l(e)},l=function(t){var e=i(t).map(function(t){return{isHelper:t.isHelper,number:t.number,type:t.type,title:t.name,lineId:t.id,eighthInfo:t.eighth,children:l(t.itemsOnNextLevel)}});return e=i(e).reject(function(t){return t.isHelper&&0===t.children.length})},d=function(t){(window.parent?window.parent:window).postMessage(t,"*")},f=function(t,e){var n=t.data.type;if("navigator_go_to_item"===n)r.setLineId(t.data.lineId,e),h();else if("navigator_item_position_changed"===n){var i=t.data,o=i.elementType,s=parseInt(i.fromPosition),c=parseInt(i.toPosition);a.moveItemAndMarkLineToPlaceCaret(o,s,c,e)}},h=function(){o.getPadOuter().find('iframe[name="ace_inner"]').get(0).contentWindow.focus()}},function(t,e){e.init=function(t){window.addEventListener("message",function(e){n(e,t)})};var n=function(t,e){"easc_mode_changed"===t.data.type&&i(e,t.data.activeButtons)},i=function(t,e){t.callWithAce(function(t){t.ace_handleEascModeChanged(e)})};e.triggerEascSelectableButtonsChanged=function(t){o({type:"easc_selectable_buttons_changed",buttonsActivated:t})},e.sendMessageToToggleButton=function(t){o({type:"TOGGLE_EASC_BUTTON",buttonName:t})};var o=function(t){(window.parent?window.parent:window).postMessage(t,"*")}},function(t,e,n){var i; /*! * jQuery JavaScript Library v1.9.1 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-2-4 */ /*! * jQuery JavaScript Library v1.9.1 * http://jquery.com/ * * Includes Sizzle.js * http://sizzlejs.com/ * * Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors * Released under the MIT license * http://jquery.org/license * * Date: 2013-2-4 */ !function(o,r){var a,s,c=typeof r,u=o.document,l=o.location,d=o.jQuery,f=o.$,h={},p=[],g=p.concat,m=p.push,v=p.slice,_=p.indexOf,y=h.toString,b=h.hasOwnProperty,T="1.9.1".trim,C=function(t,e){return new C.fn.init(t,e,s)},I=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,E=/\S+/g,w=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,x=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,O=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,k=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,P=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,N=/-([\da-z])/gi,M=function(t,e){return e.toUpperCase()},L=function(t){(u.addEventListener||"load"===t.type||"complete"===u.readyState)&&(R(),C.ready())},R=function(){u.addEventListener?(u.removeEventListener("DOMContentLoaded",L,!1),o.removeEventListener("load",L,!1)):(u.detachEvent("onreadystatechange",L),o.detachEvent("onload",L))};function F(t){var e=t.length,n=C.type(t);return!C.isWindow(t)&&(!(1!==t.nodeType||!e)||("array"===n||"function"!==n&&(0===e||"number"==typeof e&&e>0&&e-1 in t)))}C.fn=C.prototype={jquery:"1.9.1",constructor:C,init:function(t,e,n){var i,o;if(!t)return this;if("string"==typeof t){if(!(i="<"===t.charAt(0)&&">"===t.charAt(t.length-1)&&t.length>=3?[null,t,null]:x.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof C?e[0]:e,C.merge(this,C.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:u,!0)),A.test(i[1])&&C.isPlainObject(e))for(i in e)C.isFunction(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}if((o=u.getElementById(i[2]))&&o.parentNode){if(o.id!==i[2])return n.find(t);this.length=1,this[0]=o}return this.context=u,this.selector=t,this}return t.nodeType?(this.context=this[0]=t,this.length=1,this):C.isFunction(t)?n.ready(t):(t.selector!==r&&(this.selector=t.selector,this.context=t.context),C.makeArray(t,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return v.call(this)},get:function(t){return null==t?this.toArray():t<0?this[this.length+t]:this[t]},pushStack:function(t){var e=C.merge(this.constructor(),t);return e.prevObject=this,e.context=this.context,e},each:function(t,e){return C.each(this,t,e)},ready:function(t){return C.ready.promise().done(t),this},slice:function(){return this.pushStack(v.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},map:function(t){return this.pushStack(C.map(this,function(e,n){return t.call(e,n,e)}))},end:function(){return this.prevObject||this.constructor(null)},push:m,sort:[].sort,splice:[].splice},C.fn.init.prototype=C.fn,C.extend=C.fn.extend=function(){var t,e,n,i,o,a,s=arguments[0]||{},c=1,u=arguments.length,l=!1;for("boolean"==typeof s&&(l=s,s=arguments[1]||{},c=2),"object"==typeof s||C.isFunction(s)||(s={}),u===c&&(s=this,--c);c<u;c++)if(null!=(o=arguments[c]))for(i in o)t=s[i],s!==(n=o[i])&&(l&&n&&(C.isPlainObject(n)||(e=C.isArray(n)))?(e?(e=!1,a=t&&C.isArray(t)?t:[]):a=t&&C.isPlainObject(t)?t:{},s[i]=C.extend(l,a,n)):n!==r&&(s[i]=n));return s},C.extend({noConflict:function(t){return o.$===C&&(o.$=f),t&&o.jQuery===C&&(o.jQuery=d),C},isReady:!1,readyWait:1,holdReady:function(t){t?C.readyWait++:C.ready(!0)},ready:function(t){if(!0===t?!--C.readyWait:!C.isReady){if(!u.body)return setTimeout(C.ready);C.isReady=!0,!0!==t&&--C.readyWait>0||(a.resolveWith(u,[C]),C.fn.trigger&&C(u).trigger("ready").off("ready"))}},isFunction:function(t){return"function"===C.type(t)},isArray:Array.isArray||function(t){return"array"===C.type(t)},isWindow:function(t){return null!=t&&t==t.window},isNumeric:function(t){return!isNaN(parseFloat(t))&&isFinite(t)},type:function(t){return null==t?String(t):"object"==typeof t||"function"==typeof t?h[y.call(t)]||"object":typeof t},isPlainObject:function(t){if(!t||"object"!==C.type(t)||t.nodeType||C.isWindow(t))return!1;try{if(t.constructor&&!b.call(t,"constructor")&&!b.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}var e;for(e in t);return e===r||b.call(t,e)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},error:function(t){throw new Error(t)},parseHTML:function(t,e,n){if(!t||"string"!=typeof t)return null;"boolean"==typeof e&&(n=e,e=!1),e=e||u;var i=A.exec(t),o=!n&&[];return i?[e.createElement(i[1])]:(i=C.buildFragment([t],e,o),o&&C(o).remove(),C.merge([],i.childNodes))},parseJSON:function(t){return o.JSON&&o.JSON.parse?o.JSON.parse(t):null===t?t:"string"==typeof t&&(t=C.trim(t))&&O.test(t.replace(k,"@").replace(P,"]").replace(S,""))?new Function("return "+t)():void C.error("Invalid JSON: "+t)},parseXML:function(t){var e;if(!t||"string"!=typeof t)return null;try{o.DOMParser?e=(new DOMParser).parseFromString(t,"text/xml"):((e=new ActiveXObject("Microsoft.XMLDOM")).async="false",e.loadXML(t))}catch(t){e=r}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length||C.error("Invalid XML: "+t),e},noop:function(){},globalEval:function(t){t&&C.trim(t)&&(o.execScript||function(t){o.eval.call(o,t)})(t)},camelCase:function(t){return t.replace(D,"ms-").replace(N,M)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e,n){var i=0,o=t.length,r=F(t);if(n){if(r)for(;i<o&&!1!==e.apply(t[i],n);i++);else for(i in t)if(!1===e.apply(t[i],n))break}else if(r)for(;i<o&&!1!==e.call(t[i],i,t[i]);i++);else for(i in t)if(!1===e.call(t[i],i,t[i]))break;return t},trim:T&&!T.call("\ufeff ")?function(t){return null==t?"":T.call(t)}:function(t){return null==t?"":(t+"").replace(w,"")},makeArray:function(t,e){var n=e||[];return null!=t&&(F(Object(t))?C.merge(n,"string"==typeof t?[t]:t):m.call(n,t)),n},inArray:function(t,e,n){var i;if(e){if(_)return _.call(e,t,n);for(i=e.length,n=n?n<0?Math.max(0,i+n):n:0;n<i;n++)if(n in e&&e[n]===t)return n}return-1},merge:function(t,e){var n=e.length,i=t.length,o=0;if("number"==typeof n)for(;o<n;o++)t[i++]=e[o];else for(;e[o]!==r;)t[i++]=e[o++];return t.length=i,t},grep:function(t,e,n){var i=[],o=0,r=t.length;for(n=!!n;o<r;o++)n!==!!e(t[o],o)&&i.push(t[o]);return i},map:function(t,e,n){var i,o=0,r=t.length,a=[];if(F(t))for(;o<r;o++)null!=(i=e(t[o],o,n))&&(a[a.length]=i);else for(o in t)null!=(i=e(t[o],o,n))&&(a[a.length]=i);return g.apply([],a)},guid:1,proxy:function(t,e){var n,i,o;return"string"==typeof e&&(o=t[e],e=t,t=o),C.isFunction(t)?(n=v.call(arguments,2),(i=function(){return t.apply(e||this,n.concat(v.call(arguments)))}).guid=t.guid=t.guid||C.guid++,i):r},access:function(t,e,n,i,o,a,s){var c=0,u=t.length,l=null==n;if("object"===C.type(n))for(c in o=!0,n)C.access(t,e,c,n[c],!0,a,s);else if(i!==r&&(o=!0,C.isFunction(i)||(s=!0),l&&(s?(e.call(t,i),e=null):(l=e,e=function(t,e,n){return l.call(C(t),n)})),e))for(;c<u;c++)e(t[c],n,s?i:i.call(t[c],c,e(t[c],n)));return o?t:l?e.call(t):u?e(t[0],n):a},now:function(){return(new Date).getTime()}}),C.ready.promise=function(t){if(!a)if(a=C.Deferred(),"complete"===u.readyState)setTimeout(C.ready);else if(u.addEventListener)u.addEventListener("DOMContentLoaded",L,!1),o.addEventListener("load",L,!1);else{u.attachEvent("onreadystatechange",L),o.attachEvent("onload",L);var e=!1;try{e=null==o.frameElement&&u.documentElement}catch(t){}e&&e.doScroll&&function t(){if(!C.isReady){try{e.doScroll("left")}catch(e){return setTimeout(t,50)}R(),C.ready()}}()}return a.promise(t)},C.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){h["[object "+e+"]"]=e.toLowerCase()}),s=C(u);var H={};C.Callbacks=function(t){t="string"==typeof t?H[t]||function(t){var e=H[t]={};return C.each(t.match(E)||[],function(t,n){e[n]=!0}),e}(t):C.extend({},t);var e,n,i,o,a,s,c=[],u=!t.once&&[],l=function(r){for(n=t.memory&&r,i=!0,a=s||0,s=0,o=c.length,e=!0;c&&a<o;a++)if(!1===c[a].apply(r[0],r[1])&&t.stopOnFalse){n=!1;break}e=!1,c&&(u?u.length&&l(u.shift()):n?c=[]:d.disable())},d={add:function(){if(c){var i=c.length;!function e(n){C.each(n,function(n,i){var o=C.type(i);"function"===o?t.unique&&d.has(i)||c.push(i):i&&i.length&&"string"!==o&&e(i)})}(arguments),e?o=c.length:n&&(s=i,l(n))}return this},remove:function(){return c&&C.each(arguments,function(t,n){for(var i;(i=C.inArray(n,c,i))>-1;)c.splice(i,1),e&&(i<=o&&o--,i<=a&&a--)}),this},has:function(t){return t?C.inArray(t,c)>-1:!(!c||!c.length)},empty:function(){return c=[],this},disable:function(){return c=u=n=r,this},disabled:function(){return!c},lock:function(){return u=r,n||d.disable(),this},locked:function(){return!u},fireWith:function(t,n){return n=[t,(n=n||[]).slice?n.slice():n],!c||i&&!u||(e?u.push(n):l(n)),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!i}};return d},C.extend({Deferred:function(t){var e=[["resolve","done",C.Callbacks("once memory"),"resolved"],["reject","fail",C.Callbacks("once memory"),"rejected"],["notify","progress",C.Callbacks("memory")]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},then:function(){var t=arguments;return C.Deferred(function(n){C.each(e,function(e,r){var a=r[0],s=C.isFunction(t[e])&&t[e];o[r[1]](function(){var t=s&&s.apply(this,arguments);t&&C.isFunction(t.promise)?t.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===i?n.promise():this,s?[t]:arguments)})}),t=null}).promise()},promise:function(t){return null!=t?C.extend(t,i):i}},o={};return i.pipe=i.then,C.each(e,function(t,r){var a=r[2],s=r[3];i[r[1]]=a.add,s&&a.add(function(){n=s},e[1^t][2].disable,e[2][2].lock),o[r[0]]=function(){return o[r[0]+"With"](this===o?i:this,arguments),this},o[r[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(t){var e,n,i,o=0,r=v.call(arguments),a=r.length,s=1!==a||t&&C.isFunction(t.promise)?a:0,c=1===s?t:C.Deferred(),u=function(t,n,i){return function(o){n[t]=this,i[t]=arguments.length>1?v.call(arguments):o,i===e?c.notifyWith(n,i):--s||c.resolveWith(n,i)}};if(a>1)for(e=new Array(a),n=new Array(a),i=new Array(a);o<a;o++)r[o]&&C.isFunction(r[o].promise)?r[o].promise().done(u(o,i,r)).fail(c.reject).progress(u(o,n,e)):--s;return s||c.resolveWith(i,r),c.promise()}}),C.support=function(){var t,e,n,i,r,a,s,l,d,f,h=u.createElement("div");if(h.setAttribute("className","t"),h.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",e=h.getElementsByTagName("*"),n=h.getElementsByTagName("a")[0],!e||!n||!e.length)return{};s=(r=u.createElement("select")).appendChild(u.createElement("option")),i=h.getElementsByTagName("input")[0],n.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==h.className,leadingWhitespace:3===h.firstChild.nodeType,tbody:!h.getElementsByTagName("tbody").length,htmlSerialize:!!h.getElementsByTagName("link").length,style:/top/.test(n.getAttribute("style")),hrefNormalized:"/a"===n.getAttribute("href"),opacity:/^0.5/.test(n.style.opacity),cssFloat:!!n.style.cssFloat,checkOn:!!i.value,optSelected:s.selected,enctype:!!u.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==u.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===u.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},i.checked=!0,t.noCloneChecked=i.cloneNode(!0).checked,r.disabled=!0,t.optDisabled=!s.disabled;try{delete h.test}catch(e){t.deleteExpando=!1}for(f in(i=u.createElement("input")).setAttribute("value",""),t.input=""===i.getAttribute("value"),i.value="t",i.setAttribute("type","radio"),t.radioValue="t"===i.value,i.setAttribute("checked","t"),i.setAttribute("name","t"),(a=u.createDocumentFragment()).appendChild(i),t.appendChecked=i.checked,t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,h.attachEvent&&(h.attachEvent("onclick",function(){t.noCloneEvent=!1}),h.cloneNode(!0).click()),{submit:!0,change:!0,focusin:!0})h.setAttribute(l="on"+f,"t"),t[f+"Bubbles"]=l in o||!1===h.attributes[l].expando;return h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===h.style.backgroundClip,C(function(){var e,n,i,r="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",a=u.getElementsByTagName("body")[0];a&&((e=u.createElement("div")).style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(e).appendChild(h),h.innerHTML="<table><tr><td></td><td>t</td></tr></table>",(i=h.getElementsByTagName("td"))[0].style.cssText="padding:0;margin:0;border:0;display:none",d=0===i[0].offsetHeight,i[0].style.display="",i[1].style.display="none",t.reliableHiddenOffsets=d&&0===i[0].offsetHeight,h.innerHTML="",h.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===h.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==a.offsetTop,o.getComputedStyle&&(t.pixelPosition="1%"!==(o.getComputedStyle(h,null)||{}).top,t.boxSizingReliable="4px"===(o.getComputedStyle(h,null)||{width:"4px"}).width,(n=h.appendChild(u.createElement("div"))).style.cssText=h.style.cssText=r,n.style.marginRight=n.style.width="0",h.style.width="1px",t.reliableMarginRight=!parseFloat((o.getComputedStyle(n,null)||{}).marginRight)),typeof h.style.zoom!==c&&(h.innerHTML="",h.style.cssText=r+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===h.offsetWidth,h.style.display="block",h.innerHTML="<div></div>",h.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==h.offsetWidth,t.inlineBlockNeedsLayout&&(a.style.zoom=1)),a.removeChild(e),e=h=i=n=null)}),e=r=a=s=n=i=null,t}();var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,W=/([A-Z])/g;function V(t,e,n,i){if(C.acceptData(t)){var o,a,s=C.expando,c="string"==typeof e,u=t.nodeType,l=u?C.cache:t,d=u?t[s]:t[s]&&s;if(d&&l[d]&&(i||l[d].data)||!c||n!==r)return d||(u?t[s]=d=p.pop()||C.guid++:d=s),l[d]||(l[d]={},u||(l[d].toJSON=C.noop)),"object"!=typeof e&&"function"!=typeof e||(i?l[d]=C.extend(l[d],e):l[d].data=C.extend(l[d].data,e)),o=l[d],i||(o.data||(o.data={}),o=o.data),n!==r&&(o[C.camelCase(e)]=n),c?null==(a=o[e])&&(a=o[C.camelCase(e)]):a=o,a}}function U(t,e,n){if(C.acceptData(t)){var i,o,r,a=t.nodeType,s=a?C.cache:t,c=a?t[C.expando]:C.expando;if(s[c]){if(e&&(r=n?s[c]:s[c].data)){for((i=0,o=(e=C.isArray(e)?e.concat(C.map(e,C.camelCase)):e in r?[e]:(e=C.camelCase(e))in r?[e]:e.split(" ")).length);i<o;i++)delete r[e[i]];if(!(n?G:C.isEmptyObject)(r))return}(n||(delete s[c].data,G(s[c])))&&(a?C.cleanData([t],!0):C.support.deleteExpando||s!=s.window?delete s[c]:s[c]=null)}}}function z(t,e,n){if(n===r&&1===t.nodeType){var i="data-"+e.replace(W,"-$1").toLowerCase();if("string"==typeof(n=t.getAttribute(i))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:B.test(n)?C.parseJSON(n):n)}catch(t){}C.data(t,e,n)}else n=r}return n}function G(t){var e;for(e in t)if(("data"!==e||!C.isEmptyObject(t[e]))&&"toJSON"!==e)return!1;return!0}C.extend({cache:{},expando:"jQuery"+("1.9.1"+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(t){return!!(t=t.nodeType?C.cache[t[C.expando]]:t[C.expando])&&!G(t)},data:function(t,e,n){return V(t,e,n)},removeData:function(t,e){return U(t,e)},_data:function(t,e,n){return V(t,e,n,!0)},_removeData:function(t,e){return U(t,e,!0)},acceptData:function(t){if(t.nodeType&&1!==t.nodeType&&9!==t.nodeType)return!1;var e=t.nodeName&&C.noData[t.nodeName.toLowerCase()];return!e||!0!==e&&t.getAttribute("classid")===e}}),C.fn.extend({data:function(t,e){var n,i,o=this[0],a=0,s=null;if(t===r){if(this.length&&(s=C.data(o),1===o.nodeType&&!C._data(o,"parsedAttrs"))){for(n=o.attributes;a<n.length;a++)(i=n[a].name).indexOf("data-")||(i=C.camelCase(i.slice(5)),z(o,i,s[i]));C._data(o,"parsedAttrs",!0)}return s}return"object"==typeof t?this.each(function(){C.data(this,t)}):C.access(this,function(e){if(e===r)return o?z(o,t,C.data(o,t)):null;this.each(function(){C.data(this,t,e)})},null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each(function(){C.removeData(this,t)})}}),C.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=C._data(t,e),n&&(!i||C.isArray(n)?i=C._data(t,e,C.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=C.queue(t,e),i=n.length,o=n.shift(),r=C._queueHooks(t,e);"inprogress"===o&&(o=n.shift(),i--),r.cur=o,o&&("fx"===e&&n.unshift("inprogress"),delete r.stop,o.call(t,function(){C.dequeue(t,e)},r)),!i&&r&&r.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return C._data(t,n)||C._data(t,n,{empty:C.Callbacks("once memory").add(function(){C._removeData(t,e+"queue"),C._removeData(t,n)})})}}),C.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?C.queue(this[0],t):e===r?this:this.each(function(){var n=C.queue(this,t,e);C._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&C.dequeue(this,t)})},dequeue:function(t){return this.each(function(){C.dequeue(this,t)})},delay:function(t,e){return t=C.fx&&C.fx.speeds[t]||t,e=e||"fx",this.queue(e,function(e,n){var i=setTimeout(e,t);n.stop=function(){clearTimeout(i)}})},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,i=1,o=C.Deferred(),a=this,s=this.length,c=function(){--i||o.resolveWith(a,[a])};for("string"!=typeof t&&(e=t,t=r),t=t||"fx";s--;)(n=C._data(a[s],t+"queueHooks"))&&n.empty&&(i++,n.empty.add(c));return c(),o.promise(e)}});var j,q,K=/[\t\r\n]/g,X=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,$=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,Z=/^(?:checked|selected)$/i,Q=C.support.getSetAttribute,tt=C.support.input;C.fn.extend({attr:function(t,e){return C.access(this,C.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each(function(){C.removeAttr(this,t)})},prop:function(t,e){return C.access(this,C.prop,t,e,arguments.length>1)},removeProp:function(t){return t=C.propFix[t]||t,this.each(function(){try{this[t]=r,delete this[t]}catch(t){}})},addClass:function(t){var e,n,i,o,r,a=0,s=this.length,c="string"==typeof t&&t;if(C.isFunction(t))return this.each(function(e){C(this).addClass(t.call(this,e,this.className))});if(c)for(e=(t||"").match(E)||[];a<s;a++)if(i=1===(n=this[a]).nodeType&&(n.className?(" "+n.className+" ").replace(K," "):" ")){for(r=0;o=e[r++];)i.indexOf(" "+o+" ")<0&&(i+=o+" ");n.className=C.trim(i)}return this},removeClass:function(t){var e,n,i,o,r,a=0,s=this.length,c=0===arguments.length||"string"==typeof t&&t;if(C.isFunction(t))return this.each(function(e){C(this).removeClass(t.call(this,e,this.className))});if(c)for(e=(t||"").match(E)||[];a<s;a++)if(i=1===(n=this[a]).nodeType&&(n.className?(" "+n.className+" ").replace(K," "):"")){for(r=0;o=e[r++];)for(;i.indexOf(" "+o+" ")>=0;)i=i.replace(" "+o+" "," ");n.className=t?C.trim(i):""}return this},toggleClass:function(t,e){var n=typeof t,i="boolean"==typeof e;return C.isFunction(t)?this.each(function(n){C(this).toggleClass(t.call(this,n,this.className,e),e)}):this.each(function(){if("string"===n)for(var o,r=0,a=C(this),s=e,u=t.match(E)||[];o=u[r++];)s=i?s:!a.hasClass(o),a[s?"addClass":"removeClass"](o);else n!==c&&"boolean"!==n||(this.className&&C._data(this,"__className__",this.className),this.className=this.className||!1===t?"":C._data(this,"__className__")||"")})},hasClass:function(t){for(var e=" "+t+" ",n=0,i=this.length;n<i;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(K," ").indexOf(e)>=0)return!0;return!1},val:function(t){var e,n,i,o=this[0];return arguments.length?(i=C.isFunction(t),this.each(function(e){var o,a=C(this);1===this.nodeType&&(null==(o=i?t.call(this,e,a.val()):t)?o="":"number"==typeof o?o+="":C.isArray(o)&&(o=C.map(o,function(t){return null==t?"":t+""})),(n=C.valHooks[this.type]||C.valHooks[this.nodeName.toLowerCase()])&&"set"in n&&n.set(this,o,"value")!==r||(this.value=o))})):o?(n=C.valHooks[o.type]||C.valHooks[o.nodeName.toLowerCase()])&&"get"in n&&(e=n.get(o,"value"))!==r?e:"string"==typeof(e=o.value)?e.replace(X,""):null==e?"":e:void 0}}),C.extend({valHooks:{option:{get:function(t){var e=t.attributes.value;return!e||e.specified?t.value:t.text}},select:{get:function(t){for(var e,n,i=t.options,o=t.selectedIndex,r="select-one"===t.type||o<0,a=r?null:[],s=r?o+1:i.length,c=o<0?s:r?o:0;c<s;c++)if(((n=i[c]).selected||c===o)&&(C.support.optDisabled?!n.disabled:null===n.getAttribute("disabled"))&&(!n.parentNode.disabled||!C.nodeName(n.parentNode,"optgroup"))){if(e=C(n).val(),r)return e;a.push(e)}return a},set:function(t,e){var n=C.makeArray(e);return C(t).find("option").each(function(){this.selected=C.inArray(C(this).val(),n)>=0}),n.length||(t.selectedIndex=-1),n}}},attr:function(t,e,n){var i,o,a,s=t.nodeType;if(t&&3!==s&&8!==s&&2!==s)return typeof t.getAttribute===c?C.prop(t,e,n):((o=1!==s||!C.isXMLDoc(t))&&(e=e.toLowerCase(),i=C.attrHooks[e]||(J.test(e)?q:j)),n===r?i&&o&&"get"in i&&null!==(a=i.get(t,e))?a:(typeof t.getAttribute!==c&&(a=t.getAttribute(e)),null==a?r:a):null!==n?i&&o&&"set"in i&&(a=i.set(t,n,e))!==r?a:(t.setAttribute(e,n+""),n):void C.removeAttr(t,e))},removeAttr:function(t,e){var n,i,o=0,r=e&&e.match(E);if(r&&1===t.nodeType)for(;n=r[o++];)i=C.propFix[n]||n,J.test(n)?!Q&&Z.test(n)?t[C.camelCase("default-"+n)]=t[i]=!1:t[i]=!1:C.attr(t,n,""),t.removeAttribute(Q?n:i)},attrHooks:{type:{set:function(t,e){if(!C.support.radioValue&&"radio"===e&&C.nodeName(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(t,e,n){var i,o,a=t.nodeType;if(t&&3!==a&&8!==a&&2!==a)return(1!==a||!C.isXMLDoc(t))&&(e=C.propFix[e]||e,o=C.propHooks[e]),n!==r?o&&"set"in o&&(i=o.set(t,n,e))!==r?i:t[e]=n:o&&"get"in o&&null!==(i=o.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=t.getAttributeNode("tabindex");return e&&e.specified?parseInt(e.value,10):Y.test(t.nodeName)||$.test(t.nodeName)&&t.href?0:r}}}}),q={get:function(t,e){var n=C.prop(t,e),i="boolean"==typeof n&&t.getAttribute(e),o="boolean"==typeof n?tt&&Q?null!=i:Z.test(e)?t[C.camelCase("default-"+e)]:!!i:t.getAttributeNode(e);return o&&!1!==o.value?e.toLowerCase():r},set:function(t,e,n){return!1===e?C.removeAttr(t,n):tt&&Q||!Z.test(n)?t.setAttribute(!Q&&C.propFix[n]||n,n):t[C.camelCase("default-"+n)]=t[n]=!0,n}},tt&&Q||(C.attrHooks.value={get:function(t,e){var n=t.getAttributeNode(e);return C.nodeName(t,"input")?t.defaultValue:n&&n.specified?n.value:r},set:function(t,e,n){if(!C.nodeName(t,"input"))return j&&j.set(t,e,n);t.defaultValue=e}}),Q||(j=C.valHooks.button={get:function(t,e){var n=t.getAttributeNode(e);return n&&("id"===e||"name"===e||"coords"===e?""!==n.value:n.specified)?n.value:r},set:function(t,e,n){var i=t.getAttributeNode(n);return i||t.setAttributeNode(i=t.ownerDocument.createAttribute(n)),i.value=e+="","value"===n||e===t.getAttribute(n)?e:r}},C.attrHooks.contenteditable={get:j.get,set:function(t,e,n){j.set(t,""!==e&&e,n)}},C.each(["width","height"],function(t,e){C.attrHooks[e]=C.extend(C.attrHooks[e],{set:function(t,n){if(""===n)return t.setAttribute(e,"auto"),n}})})),C.support.hrefNormalized||(C.each(["href","src","width","height"],function(t,e){C.attrHooks[e]=C.extend(C.attrHooks[e],{get:function(t){var n=t.getAttribute(e,2);return null==n?r:n}})}),C.each(["href","src"],function(t,e){C.propHooks[e]={get:function(t){return t.getAttribute(e,4)}}})),C.support.style||(C.attrHooks.style={get:function(t){return t.style.cssText||r},set:function(t,e){return t.style.cssText=e+""}}),C.support.optSelected||(C.propHooks.selected=C.extend(C.propHooks.selected,{get:function(t){var e=t.parentNode;return e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex),null}})),C.support.enctype||(C.propFix.enctype="encoding"),C.support.checkOn||C.each(["radio","checkbox"],function(){C.valHooks[this]={get:function(t){return null===t.getAttribute("value")?"on":t.value}}}),C.each(["radio","checkbox"],function(){C.valHooks[this]=C.extend(C.valHooks[this],{set:function(t,e){if(C.isArray(e))return t.checked=C.inArray(C(t).val(),e)>=0}})});var et=/^(?:input|select|textarea)$/i,nt=/^key/,it=/^(?:mouse|contextmenu)|click/,ot=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function at(){return!0}function st(){return!1}C.event={global:{},add:function(t,e,n,i,o){var a,s,u,l,d,f,h,p,g,m,v,_=C._data(t);if(_){for(n.handler&&(n=(l=n).handler,o=l.selector),n.guid||(n.guid=C.guid++),(s=_.events)||(s=_.events={}),(f=_.handle)||((f=_.handle=function(t){return typeof C===c||t&&C.event.triggered===t.type?r:C.event.dispatch.apply(f.elem,arguments)}).elem=t),u=(e=(e||"").match(E)||[""]).length;u--;)g=v=(a=rt.exec(e[u])||[])[1],m=(a[2]||"").split(".").sort(),d=C.event.special[g]||{},g=(o?d.delegateType:d.bindType)||g,d=C.event.special[g]||{},h=C.extend({type:g,origType:v,data:i,handler:n,guid:n.guid,selector:o,needsContext:o&&C.expr.match.needsContext.test(o),namespace:m.join(".")},l),(p=s[g])||((p=s[g]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,i,m,f)||(t.addEventListener?t.addEventListener(g,f,!1):t.attachEvent&&t.attachEvent("on"+g,f))),d.add&&(d.add.call(t,h),h.handler.guid||(h.handler.guid=n.guid)),o?p.splice(p.delegateCount++,0,h):p.push(h),C.event.global[g]=!0;t=null}},remove:function(t,e,n,i,o){var r,a,s,c,u,l,d,f,h,p,g,m=C.hasData(t)&&C._data(t);if(m&&(l=m.events)){for(u=(e=(e||"").match(E)||[""]).length;u--;)if(h=g=(s=rt.exec(e[u])||[])[1],p=(s[2]||"").split(".").sort(),h){for(d=C.event.special[h]||{},f=l[h=(i?d.delegateType:d.bindType)||h]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),c=r=f.length;r--;)a=f[r],!o&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||i&&i!==a.selector&&("**"!==i||!a.selector)||(f.splice(r,1),a.selector&&f.delegateCount--,d.remove&&d.remove.call(t,a));c&&!f.length&&(d.teardown&&!1!==d.teardown.call(t,p,m.handle)||C.removeEvent(t,h,m.handle),delete l[h])}else for(h in l)C.event.remove(t,h+e[u],n,i,!0);C.isEmptyObject(l)&&(delete m.handle,C._removeData(t,"events"))}},trigger:function(t,e,n,i){var a,s,c,l,d,f,h,p=[n||u],g=b.call(t,"type")?t.type:t,m=b.call(t,"namespace")?t.namespace.split("."):[];if(c=f=n=n||u,3!==n.nodeType&&8!==n.nodeType&&!ot.test(g+C.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),s=g.indexOf(":")<0&&"on"+g,(t=t[C.expando]?t:new C.Event(g,"object"==typeof t&&t)).isTrigger=!0,t.namespace=m.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=r,t.target||(t.target=n),e=null==e?[t]:C.makeArray(e,[t]),d=C.event.special[g]||{},i||!d.trigger||!1!==d.trigger.apply(n,e))){if(!i&&!d.noBubble&&!C.isWindow(n)){for(l=d.delegateType||g,ot.test(l+g)||(c=c.parentNode);c;c=c.parentNode)p.push(c),f=c;f===(n.ownerDocument||u)&&p.push(f.defaultView||f.parentWindow||o)}for(h=0;(c=p[h++])&&!t.isPropagationStopped();)t.type=h>1?l:d.bindType||g,(a=(C._data(c,"events")||{})[t.type]&&C._data(c,"handle"))&&a.apply(c,e),(a=s&&c[s])&&C.acceptData(c)&&a.apply&&!1===a.apply(c,e)&&t.preventDefault();if(t.type=g,!i&&!t.isDefaultPrevented()&&(!d._default||!1===d._default.apply(n.ownerDocument,e))&&("click"!==g||!C.nodeName(n,"a"))&&C.acceptData(n)&&s&&n[g]&&!C.isWindow(n)){(f=n[s])&&(n[s]=null),C.event.triggered=g;try{n[g]()}catch(t){}C.event.triggered=r,f&&(n[s]=f)}return t.result}},dispatch:function(t){t=C.event.fix(t);var e,n,i,o,a,s,c=v.call(arguments),u=(C._data(this,"events")||{})[t.type]||[],l=C.event.special[t.type]||{};if(c[0]=t,t.delegateTarget=this,!l.preDispatch||!1!==l.preDispatch.call(this,t)){for(s=C.event.handlers.call(this,t,u),e=0;(o=s[e++])&&!t.isPropagationStopped();)for(t.currentTarget=o.elem,a=0;(i=o.handlers[a++])&&!t.isImmediatePropagationStopped();)t.namespace_re&&!t.namespace_re.test(i.namespace)||(t.handleObj=i,t.data=i.data,(n=((C.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,c))!==r&&!1===(t.result=n)&&(t.preventDefault(),t.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,t),t.result}},handlers:function(t,e){var n,i,o,a,s=[],c=e.delegateCount,u=t.target;if(c&&u.nodeType&&(!t.button||"click"!==t.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(!0!==u.disabled||"click"!==t.type)){for(o=[],a=0;a<c;a++)o[n=(i=e[a]).selector+" "]===r&&(o[n]=i.needsContext?C(n,this).index(u)>=0:C.find(n,this,null,[u]).length),o[n]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return c<e.length&&s.push({elem:this,handlers:e.slice(c)}),s},fix:function(t){if(t[C.expando])return t;var e,n,i,o=t.type,r=t,a=this.fixHooks[o];for(a||(this.fixHooks[o]=a=it.test(o)?this.mouseHooks:nt.test(o)?this.keyHooks:{}),i=a.props?this.props.concat(a.props):this.props,t=new C.Event(r),e=i.length;e--;)t[n=i[e]]=r[n];return t.target||(t.target=r.srcElement||u),3===t.target.nodeType&&(t.target=t.target.parentNode),t.metaKey=!!t.metaKey,a.filter?a.filter(t,r):t},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){return null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode),t}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,e){var n,i,o,a=e.button,s=e.fromElement;return null==t.pageX&&null!=e.clientX&&(o=(i=t.target.ownerDocument||u).documentElement,n=i.body,t.pageX=e.clientX+(o&&o.scrollLeft||n&&n.scrollLeft||0)-(o&&o.clientLeft||n&&n.clientLeft||0),t.pageY=e.clientY+(o&&o.scrollTop||n&&n.scrollTop||0)-(o&&o.clientTop||n&&n.clientTop||0)),!t.relatedTarget&&s&&(t.relatedTarget=s===t.target?e.toElement:s),t.which||a===r||(t.which=1&a?1:2&a?3:4&a?2:0),t}},special:{load:{noBubble:!0},click:{trigger:function(){if(C.nodeName(this,"input")&&"checkbox"===this.type&&this.click)return this.click(),!1}},focus:{trigger:function(){if(this!==u.activeElement&&this.focus)try{return this.focus(),!1}catch(t){}},delegateType:"focusin"},blur:{trigger:function(){if(this===u.activeElement&&this.blur)return this.blur(),!1},delegateType:"focusout"},beforeunload:{postDispatch:function(t){t.result!==r&&(t.originalEvent.returnValue=t.result)}}},simulate:function(t,e,n,i){var o=C.extend(new C.Event,n,{type:t,isSimulated:!0,originalEvent:{}});i?C.event.trigger(o,null,e):C.event.dispatch.call(e,o),o.isDefaultPrevented()&&n.preventDefault()}},C.removeEvent=u.removeEventListener?function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n,!1)}:function(t,e,n){var i="on"+e;t.detachEvent&&(typeof t[i]===c&&(t[i]=null),t.detachEvent(i,n))},C.Event=function(t,e){if(!(this instanceof C.Event))return new C.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||!1===t.returnValue||t.getPreventDefault&&t.getPreventDefault()?at:st):this.type=t,e&&C.extend(this,e),this.timeStamp=t&&t.timeStamp||C.now(),this[C.expando]=!0},C.Event.prototype={isDefaultPrevented:st,isPropagationStopped:st,isImmediatePropagationStopped:st,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=at,t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=at,t&&(t.stopPropagation&&t.stopPropagation(),t.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=at,this.stopPropagation()}},C.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(t,e){C.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,i=t.relatedTarget,o=t.handleObj;return i&&(i===this||C.contains(this,i))||(t.type=o.origType,n=o.handler.apply(this,arguments),t.type=e),n}}}),C.support.submitBubbles||(C.event.special.submit={setup:function(){if(C.nodeName(this,"form"))return!1;C.event.add(this,"click._submit keypress._submit",function(t){var e=t.target,n=C.nodeName(e,"input")||C.nodeName(e,"button")?e.form:r;n&&!C._data(n,"submitBubbles")&&(C.event.add(n,"submit._submit",function(t){t._submit_bubble=!0}),C._data(n,"submitBubbles",!0))})},postDispatch:function(t){t._submit_bubble&&(delete t._submit_bubble,this.parentNode&&!t.isTrigger&&C.event.simulate("submit",this.parentNode,t,!0))},teardown:function(){if(C.nodeName(this,"form"))return!1;C.event.remove(this,"._submit")}}),C.support.changeBubbles||(C.event.special.change={setup:function(){if(et.test(this.nodeName))return"checkbox"!==this.type&&"radio"!==this.type||(C.event.add(this,"propertychange._change",function(t){"checked"===t.originalEvent.propertyName&&(this._just_changed=!0)}),C.event.add(this,"click._change",function(t){this._just_changed&&!t.isTrigger&&(this._just_changed=!1),C.event.simulate("change",this,t,!0)})),!1;C.event.add(this,"beforeactivate._change",function(t){var e=t.target;et.test(e.nodeName)&&!C._data(e,"changeBubbles")&&(C.event.add(e,"change._change",function(t){!this.parentNode||t.isSimulated||t.isTrigger||C.event.simulate("change",this.parentNode,t,!0)}),C._data(e,"changeBubbles",!0))})},handle:function(t){var e=t.target;if(this!==e||t.isSimulated||t.isTrigger||"radio"!==e.type&&"checkbox"!==e.type)return t.handleObj.handler.apply(this,arguments)},teardown:function(){return C.event.remove(this,"._change"),!et.test(this.nodeName)}}),C.support.focusinBubbles||C.each({focus:"focusin",blur:"focusout"},function(t,e){var n=0,i=function(t){C.event.simulate(e,t.target,C.event.fix(t),!0)};C.event.special[e]={setup:function(){0==n++&&u.addEventListener(t,i,!0)},teardown:function(){0==--n&&u.removeEventListener(t,i,!0)}}}),C.fn.extend({on:function(t,e,n,i,o){var a,s;if("object"==typeof t){for(a in"string"!=typeof e&&(n=n||e,e=r),t)this.on(a,e,n,t[a],o);return this}if(null==n&&null==i?(i=e,n=e=r):null==i&&("string"==typeof e?(i=n,n=r):(i=n,n=e,e=r)),!1===i)i=st;else if(!i)return this;return 1===o&&(s=i,(i=function(t){return C().off(t),s.apply(this,arguments)}).guid=s.guid||(s.guid=C.guid++)),this.each(function(){C.event.add(this,t,i,n,e)})},one:function(t,e,n,i){return this.on(t,e,n,i,1)},off:function(t,e,n){var i,o;if(t&&t.preventDefault&&t.handleObj)return i=t.handleObj,C(t.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof t){for(o in t)this.off(o,e,t[o]);return this}return!1!==e&&"function"!=typeof e||(n=e,e=r),!1===n&&(n=st),this.each(function(){C.event.remove(this,t,n,e)})},bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,i){return this.on(e,t,n,i)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},trigger:function(t,e){return this.each(function(){C.event.trigger(t,e,this)})},triggerHandler:function(t,e){var n=this[0];if(n)return C.event.trigger(t,e,n,!0)}}), (...)
Exemplo de arquivo minimizado: