Advertisement
Guest User

hello

a guest
May 7th, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 120.29 KB | None | 0 0
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[2],{279:function(t,e,n){"use strict";(function(t,i){n.d(e,"c",function(){return b}),n.d(e,"d",function(){return w}),n.d(e,"b",function(){return k}),n.d(e,"a",function(){return x}),n.d(e,"g",function(){return O}),n.d(e,"v",function(){return S}),n.d(e,"i",function(){return j}),n.d(e,"k",function(){return C}),n.d(e,"p",function(){return T}),n.d(e,"q",function(){return R}),n.d(e,"t",function(){return A}),n.d(e,"u",function(){return P}),n.d(e,"x",function(){return N}),n.d(e,"n",function(){return M}),n.d(e,"s",function(){return U}),n.d(e,"l",function(){return I}),n.d(e,"h",function(){return L}),n.d(e,"z",function(){return z}),n.d(e,"y",function(){return q}),n.d(e,"r",function(){return K}),n.d(e,"o",function(){return D}),n.d(e,"e",function(){return B}),n.d(e,"j",function(){return F}),n.d(e,"w",function(){return G}),n.d(e,"f",function(){return J}),n.d(e,"m",function(){return W});var r=n(386),o=n.n(r),s=n(303),a=n.n(s),u=n(283),c=n(281),l=n.n(c),h=n(524),p=n.n(h),f=n(277),d=n.n(f),g=n(292),v=n(529),y={clickable_image:"clickable-image",free_text_poll:"free-text-poll",multiple_choice_poll:"multiple-choice-poll",discourse:"discourse",ranking_poll:"ranking-poll"},m=["strong","em","br"],_=/^\d+$/,b=/^https?:\/\/.+\/[^\/?]+\.(?:png|jpe?g|gif|image)[^,]*$/i,w=/^https?:\/\/s3\.amazonaws\.com\/polleverywhere-images\//i,k=/([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})/i,x=/^region:\s*(\d+\.?\d*)%,(\d+\.?\d*)%(\|(\d+\.?\d*)%x(\d+\.?\d*)%)?(?:\#(.+))?$/i,O=function t(e,n){if(void 0===n&&(n={}),(n=d.a.defaults(n,{delimit:""})).delimit.length){var i=e.split(n.delimit).map(function(e){return t(e)});e=i.join(n.delimit)}else e=e.charAt(0).toUpperCase()+e.slice(1);return e},S=function(t,e){null==t&&(t=""),null==e&&(e={}),t=t.toString();var n=u.a.get("imgix_url");return n?(d.a.defaults(e,{dpr:window.devicePixelRatio}),new p.a({domains:n.host(),secureURLToken:u.a.get("imgix_token")}).buildURL(t,e)):t},j=function(t,e){return void 0===e&&(e={}),t?g.clean(function(t,e){return e=d.a.intersection(e,m),String(t).replace(/<\/?([^>]+)>/g,function(t,n){return d.a.include(e,n)?t:" "})}(t,e.whitelist)):""},C=function t(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];if(i.length>1)i.forEach(function(n){return t(e,n)});else{var o=i[0];d.a.defaults(e,o),d.a.each(o,function(n,i){d.a.isObject(n)?t(e[i],o[i]):d.a.isNull(e[i])&&(e[i]=o[i])})}return e},T=function(t){var e={};try{e=l()(l.a.decode(t)).query(!0)}catch(e){console.error(t+" is invalid.")}for(var n in e){var i=e[n];_.test(i)&&(e[n]=parseInt(i))}return e},R=function(){return T(window.location.href)},A=function(t){return null!=t&&E(t)?d.a.values(t)[0]:t},E=function(t){return 1===d.a.values(t).length},P=function(t){return d.a.map([].concat(t),function(t){return A(t)})},N=function(t,e){var n={};return n[t]=e,n},M=function(t){return E(t)?d.a.first(d.a.keys(t)):t.type||t.poll_type},U=function(t){return y[t]||""},I=function(t){return a()(t).toString("MMM d, yyyy 'at' h:mmtt")},L=function(t){return{multiple_choice_poll:"MultipleChoicePoll",free_text_poll:"FreeTextPoll",discourse:"Discourse",clickable_image:"ClickableImage",ranking_poll:"RankingPoll",survey:"Survey",competition:"Competition"}[t]},z=function(e,n){null==n&&(n={});var i=l()(e).absoluteTo(u.a.get("api_url"));return(null!=t.os?t.os.android:void 0)&&i.setQuery("cache_buster",(new Date).getTime().toString()),i},q=function(t){return t.replace(/s$/,"")},K=function(t,e,n){null==n&&(n={});var i=1===t?e:{person:"people",Person:"People",this:"these",This:"These",Activity:"Activities",activity:"activities"}[e]||e+"s";return n.includeNumber?t+" "+i:i},D=function(t){var e=["th","st","nd","rd"],n=t%100;return t+(e[(n-20)%10]||e[n]||e[0])},B=function(t){return t.replace(H,function(t,e,n,i){return null==n&&(n=""),e+'<a href="'+(n||"http://")+i+'" target="_blank">'+n+i+"</a>"})},F=function(t,e){return null==t&&(t=0),null==e&&(e=0),t>e?-1:e>t?1:0},G=function(t){return t=String(t).replace(/[\\^$*+?.()|[\]{}]/g,"\\$&"),new RegExp(t,"i")},J=function(t,e){var n=[],i=setInterval(function(){n.length&&(e.call(this,n),n=[])},t),r=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return n.push(e)};return r.stop=function(){return clearInterval(i)},r},H=new RegExp("(^|[\\s\\n\\r])(?![a-z]+=['\"])(https?://)?((?:(?:(?:\\d{1,3}\\.){3}\\d{1,3})|\\[([0-9a-fA-F]{1,4}::?){1,7}[0-9a-fA-F]{1,4}\\]|(?:xn--[a-z0-9\\-]{1,59}|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?){0,62}[a-z\\u00a1-\\uffff0-9]{1,63}))(?:\\.(?:xn--[a-z0-9\\-]{1,59}|(?:[a-z\\u00a1-\\uffff0-9]+-?){0,62}[a-z\\u00a1-\\uffff0-9]{1,63}))*(?:\\.(?:xn--[a-z0-9\\-]{1,59}|(?:[a-z\\u00a1-\\uffff]{2,63}))))(?::\\d{2,5})?(?:/[^\\s]*)?)","ig"),W=function(t,e){void 0===e&&(e={}),e=d.a.defaults(e,{wordCount:1});var n=o()("sha256");n.update(t.toString());for(var i=n.digest("hex"),r=parseInt(i,16),s=v.a.length+v.b.length,a=r%Math.pow(s,e.wordCount),u=[],c=a,l=0;l<e.wordCount-1;l++)u.push(""+v.a[c%v.a.length]),c=Math.floor(c/v.a.length);return u.push(v.b[a%v.b.length]),u.join(" ")}}).call(this,n(83),n(345).setImmediate)},283:function(t,e,n){"use strict";var i,r=n(278),o=n.n(r),s=function(){function t(t,e){this.ajax=this.ajax.bind(this),this.nextAjax=e}return t.prototype.ajax=function(t,e){"object"==typeof t&&(t=(e=t).url);return e||(e={}),e.url=t,e.type=e.method||e.type||"GET",this.nextAjax(e)},t}(),a=n(276),u=n.n(a),c=n(317),l=n.n(c),h=n(275),p=n.n(h),f=n(281),d=n.n(f),g=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=t.call.apply(t,[this].concat(r))||this,i||(i=l()(e),e.ios=e.ios.bind(l()(e))),i||l()(e)}p()(e,t);var n=e.prototype;return n.get=function(e){var n=t.prototype.get.call(this,e);return n&&/_url$/i.test(e)&&(n=d()(n)),n},n.ios=function(){return"ios"===this.get("platform")},u()(e,[{key:"defaults",get:function(){return{root_url:d()().host()?"//"+d()().host():"https://pollev.com",api_url:d()().host()?"//"+d()().host():"https://www.polleverywhere.com",viz_url:d()().host()?"//"+d()().host():"https://viz.polleverywhere.com",ssl:"https:"===d()().protocol(),firehose_url:"//firehose.polleverywhere.com",secure_protocol:"https",image_url_regex:/^https?:\/\/.+\/[^\/?]+\.(?:png|jpe?g|gif|image)\??\S*/i,image_file_regex:/^https?:\/\/.+\/([^\/?]+\.(?:png|jpe?g|gif))\??\S*/i,uploaded_image_regex:/^https?:\/\/s3.amazonaws.com\/polleverywhere-images\/.*/i,image_bucket_url:"https://upload-images.polleverywhere.com",poll_renderer_url:"https://poll-renderer.polleverywhere.com",nginx_proxy_path:"",mobile_url:"https://pollev.com",token_auth_enabled:!1}}}]),e}(o.a.Model),v=n(277),y=n.n(v),m=n(83),_=n.n(m),b=new g,w=function(){function t(t,e){this.ajax=this.ajax.bind(this),this.nextAjax=e}return t.prototype.ajax=function(t){if(t.firehose||"script"===t.dataType||"jsonp"===t.dataType||!b.get("proxy_enabled"))return this.nextAjax(t);(t=y.a.defaults(t,{xhrFields:{}})).model&&(t.model._lastRequestMethod=t.type);var e=d()(t.url).absoluteTo(b.get("api_url"));return t.url=e.toString(),e.host()===b.get("api_url").host()&&(t.crossDomain=!0,"boolean"!=typeof t.xhrFields.withCredentials&&(t.xhrFields.withCredentials=!0),b.get("nginx_proxy_path")?function(t,e){t.crossDomain=!1;var n=d()(t.url);n.resource(e+n.resource()),n.origin(d()().origin()),t.url=n.toString(),t.url}(t,b.get("nginx_proxy_path")):_.a.support.cors||console.warn("Detected '$.support.cors = false', but no proxy is available. Cross-domain XHR requests may not work. You are likely running an unsupported browser. Try upgrading your browser. On iOS, try upgrading your Operating System.")),this.nextAjax(t)},t}();var k=new g,x={requiresCsrfToken:function(t,e){return!/^(get|head|options)$/i.test(e.type)&&x.domainExpectsCsrfToken(t,x.hostFromUrl(e.url))&&!e.firehose},hostFromUrl:function(t){var e="undefined"!=typeof location&&null!==location?location.href+"":"";return d()(t).absoluteTo(e).host()},domainExpectsCsrfToken:function(t,e){if(t[e])return!0;var n=[k.get("api_url"),k.get("root_url"),d()("undefined"!=typeof window&&null!==window?window.location.href:void 0)];return n=y.a.compact(n),n=y.a.invoke(n,"host"),y.a.include(n,e)}},O=x,S=function(){function t(t,e){this.ajax=this.ajax.bind(this),this.nextAjax=e,t.csrf||(t.csrf={}),this.tokens=t.csrf.tokens||(t.csrf.tokens={})}return t.prototype.ajax=function(t){var e=this,n=this.nextAjax(t),i=O.hostFromUrl(t.url);return O.domainExpectsCsrfToken(this.tokens,i)&&!t.firehose&&n.done(function(t,n,r){var o=r.getResponseHeader("X-CSRF-Token");o&&(e.tokens[i]=o)}),n},t}(),j=function(t){return 422===t.status&&"InvalidAuthenticityToken"===(e=null!=t.responseJSON?t.responseJSON.error:void 0,n=function(t){return t.type},null!=e?n(e):void 0);var e,n},C=function(){function t(t,e){this.ajax=this.ajax.bind(this),this.nextAjax=e,t.csrf||(t.csrf={}),this.tokens=t.csrf.tokens||(t.csrf.tokens={})}return t.prototype.ajax=function(t){if(!O.requiresCsrfToken(this.tokens,t)||t.csrfRetry)return this.nextAjax(t);var e=y.a.pick(t,"error","complete","success");t.error=t.complete=t.success=_.a.noop();var n=_.a.Deferred(),i=this.nextAjax(t);return i.done(function(){return"function"==typeof e.success&&e.success.apply(e,arguments),e.complete&&n.done(e.complete),n.resolve.apply(n,arguments)}),i.fail(function(){return j(i)?o.a.ajax({method:"GET",url:"/api/csrf_token",cache:!1}).done(function(i,r,s){return y.a.extend(t,e),t.csrfRetry=!0,o.a.ajax(t).done(n.resolve).fail(n.reject)}).fail(function(){var t,i,r;return t=console,i="warn",r=function(t){return t.warn("Failed to get new CSRF token")},null!=t&&"function"==typeof t[i]&&r(t,i),"function"==typeof e.error&&e.error.apply(e,arguments),e.complete&&n.fail(e.complete),n.reject.apply(n,arguments)}):("function"==typeof e.error&&e.error.apply(e,arguments),e.complete&&n.fail(e.complete),n.reject.apply(n,arguments))}),n.promise(i)},t}();var T,R=function(){function t(t,e){this.ajax=this.ajax.bind(this),this.nextAjax=e,t.csrf||(t.csrf={}),this.tokens=t.csrf.tokens||(t.csrf.tokens={})}return t.prototype.ajax=function(t){var e=O.hostFromUrl(t.url);return O.requiresCsrfToken(this.tokens,t)&&this.tokens[e]&&(t.headers||(t.headers={}),t.headers["X-CSRF-Token"]=this.tokens[e]),this.nextAjax(t)},t}(),A=((A=function(){function t(){this.cache={},this.ajax=T(this.cache,s,w,S,R,C,_.a.ajax),"undefined"!=typeof jasmine&&null!==jasmine&&(this.ajax.chain=this)}return t.initClass=function(){T=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];for(var r=Math.max(n.length,1),o=n.slice(0,r-1),s=n[r-1];o.length;)s=new(o.pop())(t,s).ajax;return s}},t}()).initClass(),A),E=A,P=new g;o.a.ajax=(new E).ajax;e.a=P},285:function(t,e,n){"use strict";var i=n(275),r=n.n(i),o=n(278),s=n.n(o),a=n(277),u=n.n(a),c=n(279),l=function(t){function e(){return t.apply(this,arguments)||this}r()(e,t);var n=e.prototype;return n.include=function(t){return u.a.extend(this,t(this))},n.templateAttrs=function(t){for(var e=("function"==typeof t.split?t.split(" "):void 0)||t,n={},i=Array.from(e),r=0;r<i.length;r++){var o=i[r],s=o.replace(/(-|_|\s)+(.)?/g,function(t,e,n){return n?n.toUpperCase():""});this.has(o)?n[s]=this.get(o):this[s]?n[s]=this[s]():n[s]=void 0}return n},n.patch=function(t){var e=this;if(u.a.any(u.a.keys(t),function(e){return this.get(e)!==t[e]},this))return this.set(t),s.a.ajax({url:u.a.result(this,"url"),type:"patch",data:t,success:function(n,i,r){return e.set(e.parse(n)),e.trigger("sync",e,n,{changes:t})},error:function(n,i,r){return e.trigger("error",e,n,{changes:t})}})},n.fetchAttrs=function(t,e){var n=this;if(null==e&&(e={}),u.a.isArray(t)||(t=[t]),0!==(t=u.a.compact(t)).length)return s.a.ajax({url:u.a.result(this,"url"),type:"get",success:function(i,r,o){return n.set(u.a.pick(n.parse(i),t)),"function"==typeof e.success?e.success(i,r,o):void 0},error:e.error})},n.cleanUp=function(){return this.off()},n.formattedTime=function(){var t;if(t=this.get("created_at"))return Object(c.l)(t)},n.sync=function(e,n,i){return null==i&&(i={}),i.model=n,t.prototype.sync.call(this,e,n,i)},e}(s.a.Model);e.a=l},290:function(t,e,n){"use strict";var i=n(277),r=n.n(i),o=n(279),s=n(83),a=n.n(s),u=/(\$\$|^latex:)(.+?)(\$\$|$)/gi,c=/{{(\d+)}}/gi,l=a.a.Deferred(),h=a.a.Deferred(),p=a.a.when(l,h),f=!1,d=function(t,e){try{return katex.renderToString(t,function(t){return{displayMode:!t.inline,throwOnError:!1,errorColor:t.errorColor}}(e))}catch(t){return"[<em>error rendering eqn.</em>]"}},g=function(t,e,n){var i=[],r=t.replace(u,function(t,e,n){var r=i.length;return i.push(n),"{{"+r+"}}"});return(r=Object(o.i)(r,{whitelist:n.cleanWhitelist})).replace(c,function(t,n){return e(i[n])})},v=function(){function t(){}return t.initClass=function(){this.DEFAULT_OPTS={inline:!0,errorColor:"#cc0000",cleanHTML:!0,cleanWhitelist:[],containerClass:""}},t.isLatex=function(t){return u.lastIndex=0,u.test(t)},t.renderInto=function(e,n,i){null==i&&(i={}),i=r.a.defaults(i,t.DEFAULT_OPTS);var o=a()(e);o.attr("m-latex","");var s=o.find(".latex--container");0===s.length&&(s=a()('<span class="latex--container"></span>')),i.containerClass&&s.addClass(i.containerClass),o.append(s);var c=t._getLib().then(function(){return s.attr("data-rendered",!0).html(function(t,e){return e.cleanHTML?g(t,function(t){return d(t,e)},e):t.replace(u,function(t,n,i){return d(i,e)})}(n,i))});return"pending"===c.state()&&s.attr("data-rendered",!1).html(function(t,e){return e.cleanHTML?g(t,function(){return"[<em>loading eqn.</em>]"},e):t.replace(u,"[<em>loading eqn.</em>]")}(n,i)),c},t.getText=function(t){return function(t){return t.replace(u,function(t,e,n){return n})}(t)},t._getLib=function(){return function(){if(!f){f=!0;var t=document.getElementsByTagName("head")[0],e=document.createElement("script");e.type="text/javascript",e.onload=l.resolve,e.src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.js";var n=document.createElement("link");n.rel="stylesheet",n.onload=h.resolve,n.href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.css",t.appendChild(n),t.appendChild(e)}return p}()},t}();v.initClass(),e.a=v},293:function(t,e,n){"use strict";var i=n(275),r=n.n(i),o=n(278),s=n.n(o),a=n(277),u=n.n(a),c=function(t){function e(){return t.apply(this,arguments)||this}r()(e,t);var n=e.prototype;return n.include=function(t){return u.a.extend(this,t(this))},n.parse=function(e,n){try{var i=JSON.parse(n.xhr.getResponseHeader("X-Pagination"));null!=this.params&&this.params(i)}catch(t){}return t.prototype.parse.apply(this,arguments)},n.sync=function(e,n,i){return null==i&&(i={}),i.model=n,t.prototype.sync.call(this,e,n,i)},e}(s.a.Collection);e.a=c},294:function(t,e,n){"use strict";n.d(e,"a",function(){return f});var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(327),u=n(400),c=n(352),l=n(316),h=n(281),p=n.n(h),f=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.initialize=function(){t.prototype.initialize.apply(this,arguments),this.include(u.a),this.include(c.a),this.initKeyword(),this.listenTo(this,"sync",this.initKeyword)},n.toggleAutocensor=function(t,e){return void 0===e&&(e={}),this.toggle("autocensor",e,t)},n.supportsModeration=function(){return!0},n.toggleModeration=function(t,e){return this.toggle("moderation_enabled")},n.isModerationEnabled=function(){return!0===this.get("moderation_enabled")},n.parse=function(e,n){void 0===n&&(n={}),e=t.prototype.parse.apply(this,arguments),n.resetKeyword&&this.resetKeyword(e.keyword);var i=0===e.results_count?[]:e.results;return this.results.set(i),delete e.results,e},n.processLiveResponse=function(e){return void 0===e&&(e={}),e.result&&(e.result.deleted_at?this.results.remove(e.result):this.results.add(e.result,{merge:!0}),delete e.result),e=t.prototype.processLiveResponse.call(this,e),this.flashOptions().processLiveResponse(e),e},n.hasCustomGlobalKeyword=function(){return!this.get("simple_keywords")&&!this.isAutoKeyword()},n.responseUrl=function(){var t=this.get("permalink");return p()("/").segment(this.type()+"s").segment(t).segment("results.json").toString()},r()(e,[{key:"defaultType",get:function(){return"free_text_poll"}},{key:"modelProperties",get:function(){return t.prototype.modelProperties.concat(["moderation_enabled","autocensor","keyword","emoji_filter"])}},{key:"results",get:function(){return this._results||(this._results=new l.a(this.attributes.results,{poll:this})),this._results}}]),e}(a.a)},295:function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return S});var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(277),u=n.n(a),c=n(281),l=n.n(c),h=n(303),p=n.n(h),f=n(278),d=n.n(f),g=n(283),v=n(304),y=n(349),m=n(351),_=n(332),b=n(285),w=n(355),k=n(279),x=function(t){var e={polls:t};return d.a.ajax({method:"POST",url:"/api/polls",data:JSON.stringify(e),contentType:"application/json; charset=UTF-8",dataType:"json"})};function O(e){var n=this.get("permalink");if(n){var i=l()(this.urlRoot).segment(n).segment("metrics");return d.a.ajax({method:"POST",url:i.segment(e).toString()})}return window.Rollbar&&window.Rollbar.error("Cannot send survey metrics without permalink",{model:this.attributes}),t.Deferred().reject()}var S=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.initialize=function(t,e){var n=this;void 0===t&&(t={}),void 0===e&&(e={}),this.include(_.a),this.include(y.a),this.include(m.a),this.initSubModel("presenter"),this.polls=new w.a,this.polls.comparator="position",this.polls.survey=this,this.parse(t,e),this.on("change:polls",function(){var t;return t=n.get("polls")instanceof d.a.Collection?n.get("polls").toArray():n.get("poll"),n.polls.set(t)})},n.url=function(){return this.instance.url()},n.type=function(){return"survey"},n.convertTo=function(t){var e=this.get("id")||this.get("permalink"),n=l()(this.urlRoot).segment(e.toString()).segment("convert_to_"+t).toString();return d.a.ajax({url:n,method:"post",dataType:"json"})},n.enableAndClearAllPolls=function(){var t=l()("/api").segment(this.showPath()).segment("enable_clear_polls");return d.a.ajax({contentType:"application/json; charset=UTF-8",dataType:"json",url:t.toString(),type:"POST"})},n.clearPolls=function(t){void 0===t&&(t=(new p.a).toString("MMMM d, yyyy 'at' h:mm:ss TT"));var e=l()("/api").segment(this.showPath()).segment("clear").toString();return d.a.ajax({url:e,type:"POST",data:{name:t}})},n.submitBatchResponse=function(t){return d.a.ajax({contentType:"application/json; charset=UTF-8",dataType:"json",url:l()("/api").segment(this.showPath()).segment("results").toString(),type:"POST",data:JSON.stringify(t)})},n.pollsAnswered=function(){var t=0,e=this.pollsAnsweredCache||{};for(var n in e){t+=e[n]}return t},n.trackResponse=function(t,e){if(t.isNew())return null==this.pollsAnsweredCache&&(this.pollsAnsweredCache=this.polls.reduce(function(t,e){return t[e.id]=0,t},{})),this.pollsAnsweredCache[t.get("poll_id")]=e,this.trigger("pollAnswered")},n.requiresRegistration=function(){return this.polls.any(function(t){return t.get("registered_participants_only")})},n.name=function(){return this.get("title")},n.showPath=function(){return this.showUrl()},n.screenshotUrl=function(t){return null==t&&(t={}),!0===t&&(t={attachment:!0}),l()(this.showUrl()).absoluteTo(g.a.get("poll_renderer_url")).query(t).toString()},n.showUrl=function(){return l()("/surveys").segment(this.get("permalink")).toString()},n.editUrl=function(){return this.showPath()+"/edit"},n.duplicateUrl=function(){return l()(this.urlRoot).segment(this.get("id").toString()).segment("duplicate").toString()},n.webVotingPath=function(){return this.webVotingUrl()},n.webVotingUrl=function(){return this.showPath()+"/web"},n.onScreenUrl=function(){return"/api/activation"},n.toJSON=function(t){null==t&&(t={});var e=this.pick(this.modelProperties);return e.polls=this.polls.invoke("toJSON",{root:!1}).filter(function(t){return!u.a.isEmpty(t)}),e},n.parse=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.instance&&(t=this.instance.normalizeActivityData(t)),this.polls&&t.polls&&(t=function(t){return void 0===t&&(t={}),t.polls=t.polls||[],t.polls=t.polls.map(function(e){return e.presenter=Object.assign({},t.presenter,e.presenter),e.group_id=null,e.survey_id=t.id,e.competition_id=null,e}),t}(t),this.polls.set(t.polls,e)),t},n.liveChannel=function(){return this.type()+"s/"+this.get("permalink")+"/firehose.json"},n.processLiveResponse=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),e.path&&e.path.includes("firehose.json")&&(t=function(t){var e=this;return void 0===t&&(t={}),t.polls&&(t.polls=t.polls.map(function(t){var n=e.polls.findWhere({permalink:t.permalink});if(n)t=Object.assign({},n.attributes,t);else{var i=Object(v.a)(t);i.fetch({data:{exclude:"results,flash_options,visual_settings"}}).then(function(){e.polls.add(i)}),t=void 0}return t}).filter(function(t){return!!t})),t}.call(this,t)),this.set(this.parse(t)),t},n.update=function(t){return this.save(t,{patch:!0})},n.updatePolls=function(t){var e=this;return t.forEach(function(t){var n=e.polls.findWhere({permalink:t.permalink});n&&n.set(t)}),x(t)},n.updateAllPolls=function(t){var e=this.polls.map(function(e){return e.set(t),u.a.extend({},{permalink:e.get("permalink")},t)});return x(e)},n.activate=function(){var t=this,e=d.a.ajax({method:"PUT",url:this.onScreenUrl(),data:{type:this.type(),uid:this.get("permalink")}});return e.done(function(){t.presenter.set({active:!0}),t.set({current:!0})}),e},n.deactivate=function(){var t=this,e=d.a.ajax({method:"DELETE",url:this.onScreenUrl()});return e.done(function(){t.presenter.set({active:!1}),t.set({current:!1})}),e},n.lockAllPolls=function(){return this.polls.invoke("stop")},n.unlockAllPolls=function(){return this.polls.invoke("start")},n.start=function(){return O.call(this,"survey_started")},n.complete=function(){return O.call(this,"survey_completed")},n.progress=function(t){return void 0===t&&(t=0),O.call(this,"poll_answered/"+t)},n.cleanTitle=function(t){return null==t&&(t={}),t=u.a.defaults(t,{emoji:"image"}),Object(k.i)(this.get("title"),t)},n.isActivated=function(){return this.get("current")},r()(e,[{key:"urlRoot",get:function(){return"/api/surveys"}},{key:"defaults",get:function(){return{full_page:!1}}},{key:"modelProperties",get:function(){return["id","permalink","owner_id","group_id","title","subtitle","full_page","display_state","custom_confirmation_message"]}}]),e}(b.a)}).call(this,n(83))},296:function(t,e,n){"use strict";var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(277),u=n.n(a),c=n(327),l=n(285),h=n(278),p=n.n(h),f=function(t,e){return t||(t=0),e||(e=0),0===e?0:t/e},d=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.percentOfSegmentingOption=function(t){null==t&&(t={});var e=this.get("results_count"),n=this.collection.responseCount(t);return f(e,n)},n.percentOfMaxResponseCount=function(t){null==t&&(t={});var e=this.get("results_count"),n=this.collection.maxResponseCount(t);return f(e,n)},e}(l.a),g=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.responseCount=function(t){return null==t&&(t={}),this.segmentingOption.responseCount(t)},n.maxResponseCount=function(t){return null==t&&(t={}),this.segmentingOption.maxResponseCount(t)},r()(e,[{key:"model",get:function(){return d}}]),e}(p.a.Collection),v=n(311),y=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.initialize=function(){t.prototype.initialize.apply(this,arguments),this.set({segments:new g(this.get("options")),mcpOption:new v.a(this.get("this_option"))}),this.get("segments").segmentingOption=this},n.parse=function(t,e){return null==t&&(t={}),this.get("segments")||this.set({segments:new g}),t.options&&this.get("segments").reset(t.options,e),this.get("mcpOption")||this.set({mcpOption:new v.a}),t.this_option&&this.get("mcpOption").set(t.this_option,e),t},n.responseCount=function(t){null==t&&(t={}),null==t.includeNonResponses&&(t.includeNonResponses=!1);var e=this.get("total_results");return t.includeNonResponses||(e-=this.get("no_responses")),e},n.maxResponseCount=function(t){return null==t&&(t={}),this.collection.maxResponseCount(t)},n.percentOfMaxResponseCount=function(t){return null==t&&(t={}),this.responseCount(t)/this.maxResponseCount(t)},e}(l.a),m=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.highestResult=function(){return u.a.max(u()(this.pluck("results_count")).map(function(t){return parseFloat(t)}))},n.lowestResult=function(){return u.a.min(u()(this.pluck("results_count")).map(function(t){return parseFloat(t)}))},n.hasImage=function(){return this.any(function(t){return t.isImage()})},n.hasAlphaNumericKeyword=function(){return this.any(function(t){return t.isKeywordAlphaNumeric()})},n.hasLatex=function(){return this.any(function(t){return t.isLatex()})},n.hasCorrect=function(){return this.any(function(t){return t.isCorrect()})},n.resetKeywords=function(t){var e=this;u.a.each(t,function(t){var n=e.get(t.id);return null!=n?n.resetKeyword(u.a.pick(t,"keyword","auto_keyword")):void 0})},n.ordinalRank=function(t){if("ranking_poll"===(null!=this.poll?this.poll.type():void 0)){var e=this.map(function(t){return t.get("results_count")}),n=u()(e).sortBy(function(t){return parseFloat(t)});return u()(n).indexOf(t.get("results_count"))+1}},r()(e,[{key:"model",get:function(){return v.a}}]),e}(n(353).a),_=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.mcpOptions=function(){var t=new m(this.pluck("mcpOption"));return t.poll=this.poll,t},n.maxResponseCount=function(t){var e;return null==t&&(t={}),null==t.includeNonResponses&&(t.includeNonResponses=!1),(e=this.invoke("responseCount",t)).length?u.a.max(e):void 0},r()(e,[{key:"model",get:function(){return y}}]),e}(n(293).a);n.d(e,"a",function(){return b});var b=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.initialize=function(e){t.prototype.initialize.apply(this,arguments);var n=this.get("comparison_report")||{};this.segmentingOptions=new _(n.groups),this.segmentingOptions.poll=this,this.mcpOptions=new m(this.attributes.options,{silent:!0}),this.mcpOptions.poll=this,this.listenTo(this.mcpOptions,"add",this.onAddOption),this.listenTo(this.mcpOptions,"remove",this.onRemoveOption),this.listenTo(this,"change:options",this.updateOptions)},n.summaryTableUrl=function(){return this._urlBase().segment("table").toString()},n.validateOptions=function(){if(!u.a.every(this.mcpOptions.invoke("isValid")))return u.a.unique(u.a.compact(this.mcpOptions.map(function(t){return t.validationError})))},n.hasImageOption=function(){return this.mcpOptions.hasImage()},n.hasLatexOption=function(){return this.mcpOptions.hasLatex()},n.hasAlphaNumericKeyword=function(){return this.mcpOptions.hasAlphaNumericKeyword()},n.highestResponse=function(){return this.mcpOptions&&this.mcpOptions.length?this.mcpOptions.highestResult():null},n.onAddOption=function(t){this.trigger("options:add",t)},n.onRemoveOption=function(t){this.trigger("options:remove",t)},n.isGraded=function(){return this.mcpOptions.hasCorrect()},n.updateOptions=function(){this.mcpOptions.set(this.get("options"))},n.toJSON=function(e){void 0===e&&(e={});var n=t.prototype.toJSON.call(this,e);if(this.has("grading_enabled")&&(n.grading_enabled=this.get("grading_enabled")),this.has("flash_options")&&(n.flash_options=this.get("flash_options")),n.options=this.mcpOptions.invoke("toJSON"),this.isSimpleKeywords()&&!this.isCustomSessionKeywordFormat()){var i=n.options,r=Array.isArray(i),o=0;for(i=r?i:i[Symbol.iterator]();;){var s;if(r){if(o>=i.length)break;s=i[o++]}else{if((o=i.next()).done)break;s=o.value}delete s.keyword}}return n},n.isCustomSessionKeywordFormat=function(){return"custom"===(this.get("session_keyword_format")||"").toLowerCase()},n.parse=function(e,n){return void 0===e&&(e={}),void 0===n&&(n={}),e=t.prototype.parse.apply(this,arguments),n=u.a.defaults({},n,{resetKeyword:!1,resetOptions:!0}),e.options&&this.mcpOptions&&(n.resetKeyword&&this.mcpOptions.resetKeywords(e.options),n.resetOptions?(n.validate=!1,this.mcpOptions.set(e.options,n)):delete e.options),e.comparison_report&&this.segmentingOptions&&this.segmentingOptions.set(e.comparison_report.groups,n),e},n.processLiveResponse=function(e){return void 0===e&&(e={}),e=t.prototype.processLiveResponse.call(this,e),this.visualSettings().processLiveResponse(e),this.flashOptions().processLiveResponse(e),e},n.toggle=function(e,n,i){return void 0===n&&(n={}),this.currentArchive&&(n=Object.assign({},n,{resetOptions:!1})),t.prototype.toggle.call(this,e,n,i)},n.toggleGradingEnabled=function(t){return t||this.mcpOptions.each(function(t){return t.set({correct_response:!1,correct:!1})}),this.save({grading_enabled:t})},n.hasCustomGlobalKeyword=function(){return!this.get("simple_keywords")&&!this.mcpOptions.all(function(t){return t.isAutoKeyword()})},r()(e,[{key:"defaultType",get:function(){return"multiple_choice_poll"}},{key:"modelProperties",get:function(){return t.prototype.modelProperties.concat(["session_keyword_format","instruction_image_url","instruction_image_alt"])}},{key:"comparisons",get:function(){return this.instance.comparisons}}]),e}(c.a)},299:function(t,e,n){"use strict";n.d(e,"a",function(){return f});var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(277),u=n.n(a),c=n(294),l=n(364),h=n(283),p=n(308),f=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.showPath=function(){return"/discourses/"+this.get("permalink")},n.firehoseFeaturedPath=function(){return"/discourses/"+this.get("permalink")+"/responses/featured.json"},n.fetch=function(e){return this.fetchOptions=e,t.prototype.fetch.apply(this,arguments)},n.sendToListUrl=function(){},n.listenForFeaturedResults=function(){var t=this;this._featuredChannel=Object(p.a)(this.firehoseFeaturedPath(),{host:h.a.get("firehose_url").toString(),ssl:h.a.get("firehose_ssl")}),this._featuredChannel.on("message",function(e){var n=e.result;if(n)return u.a.isEmpty(n)?t.results.trigger("unfeature"):t.results.trigger("feature",t.results.get(n.id))})},n.stopListeningForFeaturedResults=function(){this._featuredChannel&&this._featuredChannel.unsubscribe()},r()(e,[{key:"defaultType",get:function(){return"discourse"}},{key:"results",get:function(){return this._results||(this._results=new l.a(this.attributes.results,{poll:this})),this._results}}]),e}(c.a)},304:function(t,e,n){"use strict";var i=n(277),r=n.n(i),o=n(279),s=n(296),a=n(294),u=n(299),c=n(315),l=n(305),h=n(295),p=n(321),f={MultipleChoicePoll:s.a,FreeTextPoll:a.a,Discourse:u.a,ClickableImage:c.a,RankingPoll:l.a,Survey:h.a,Competition:p.a};e.a=function(t,e){if(!r()(t).isEmpty()){var n=Object(o.n)(t),i=Object(o.t)(t);i=function(t){if("object"!=typeof t)return t;if(Array.isArray(t))return t;if(t.group_id)return t;if(t.competition_id)return t;if(t.survey_id)return t;var e=JSON.parse(JSON.stringify(t));return e.group_id=-1,e}(i);var s=Object(o.h)(n)||n,a=f[s];return a?new a(i,e):void 0}}},305:function(t,e,n){"use strict";n.d(e,"a",function(){return h});var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(296),u=n(352),c=n(281),l=n.n(c),h=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.initialize=function(e){void 0===e&&(e={}),t.prototype.initialize.apply(this,arguments),this.include(u.a),this.model_type=this.type()},n.summaryTableUrl=function(){},n.responseUrl=function(){var t=this.get("permalink");return l()("/").segment(this.type()+"s").segment(t).segment("results.json").toString()},n.sendToListUrl=function(){},r()(e,[{key:"defaultType",get:function(){return"ranking_poll"}}]),e}(a.a)},309:function(t,e,n){"use strict";var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(344),u=n(285),c=n(303),l=n.n(c),h=n(277),p=n.n(h),f=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.urlRoot=function(){return"/api/payment_methods"},n.lastFour=function(){var t=this.get("number");if(t)return t.substr(t.length-4)},n.expirationMonth=function(){if(this.has("expiration_date")){var t=this.get("expiration_date").split("/")[0];return parseInt(t,10)}},n.expirationYear=function(){if(this.has("expiration_date")){var t=this.get("expiration_date").split("/")[1];return parseInt(t,10)}},n.expirationDate=function(){return new l.a(this.expirationYear()+2e3,this.expirationMonth()-1)},n.validate=function(t,e){var n={};return p.a.each(t,function(t,e){p.a.isString(t)&&!t.trim().length?n[e]="cannot be blank":p.a.isNull(t)?n[e]="cannot be null":p.a.isUndefined(t)?n[e]="cannot be undefined":p.a.isObject(t)&&p.a.isEmpty(t)&&(n[e]="cannot be empty")}),p.a.isEmpty(n)?null:n},e}(u.a),d=n(279),g=n(293),v=n(319),y=function(t,e){for(var n=e,i=0;i<=2;i++)if(n){var r=n.get("next_group_id");n=t.get(r)}return n},m=function(t){var e=[],n=[];if(t.each(function(t){if(t.isRealGroup())return n.push(t.get("next_group_id"))}),n.length>0)for(var i,r,o=i=r=-1===p.a.indexOf(n,null)?t.find(function(t){return t.id!==v.a.defaultId}):t.find(function(t){return t.id!==v.a.defaultId&&-1===p.a.indexOf(n,t.id)});o;){i=y(t,i);var s=o;e.push(s);var a=s.get("next_group_id");if(void 0===(o=t.get(a)))break;if(null===a)break;var u=a===r.id,c=(null!=i?i.id:void 0)===o.id;if(u||c)break}return e.splice.apply(e,[0,0].concat(function(t,e){return t.filter(function(t){return t.id!==v.a.defaultId&&void 0===p.a.find(e,function(e){return e.id===t.id})})}(t,e).reverse())),e.splice(0,0,t.ungrouped()),(e=p.a.compact(e)).forEach(function(t,e){return t.set({sequence:e},{silent:!0})}),e},_=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.sort=function(){return"sequence"===this.comparator&&m(this),t.prototype.sort.apply(this,arguments)},n.comparator=function(t){return t.id},n.checked=function(){return this.where({checked:!0})},n.checkedPolls=function(){return this.reduce(function(t,e){return e.polls().each(function(e){if(e.get("checked"))return t.push(e)}),t},[])},n.clearChecked=function(){return this.each(function(t){return t.set({checked:!1,indeterminate:!1}),t.polls().each(function(t){return t.set({checked:!1})})})},n.ungrouped=function(){return this.get(v.a.defaultId)},n.search=function(t){var e=Object(d.w)(t);return this.filter(function(t){return e.test(t.get("name"))})},n.fetch=function(e){return null==e&&(e={}),null==e.data&&(e.data={}),t.prototype.fetch.call(this,e)},n.fetchWithPolls=function(){var t=this;return this.fetch({data:{include_polls:!0}}).then(function(){return t.invoke("markAsLoaded")})},n.sortGroups=function(){return m(this)},r()(e,[{key:"model",get:function(){return v.a}},{key:"url",get:function(){return"/api/groups"}},{key:"states",get:function(){return{}}}]),e}(g.a),b=n(355),w=n(354),k=n(304),x=n(281),O=n.n(x),S=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.initialize=function(){return t.prototype.initialize.apply(this,arguments)},n.urlRoot=function(){return O()("/api/participants").segment(this.id.toString()).segment("responses").toString()},n.submissionDate=function(){return l()(this.get("created_at")).toString("MM/dd/yyyy")},n.submissionTime=function(){return l()(this.get("created_at")).toString("h:mm:sstt")},n.poll=function(){return this.get("poll")},n.pollTitle=function(){return this.poll().get("title")},n.pollLink=function(){return this.poll()._urlBase()},n.pollOwnerName=function(){return this.poll().get("owner_name").split(" ").map(function(t){return Object(d.g)(t)}).join(" ")},n.pollOwnerEmail=function(){return this.poll().get("owner_email")},n.response=function(){return this.get("humanized_value")},n.parse=function(e){return e.poll=Object(k.a)(e.poll),t.prototype.parse.apply(this,arguments)},e}(u.a),j=new w.a({order:"submitted_at",direction:"DESC"}),C=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.initialize=function(t){var e,n;null==t&&(t={}),null!=t.participant&&(this.url=(e=t.participant,n=e.id||e,function(){return O()("/api/participants").segment(n.toString()).segment("responses").toString()}))},n.url=function(){return"/api/participants/-1/responses"},n.params=function(t){return null!=t?j.set(t):j.attributes},n.query=function(){return this.fetch({data:this.params(),reset:!0})},r()(e,[{key:"model",get:function(){return S}}]),e}(g.a),T=n(332),R=n(402),A=n(278),E=n.n(A);n.d(e,"a",function(){return P});var P=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.url=function(){return this.isNew()?"/users":"/my/profile"},n.initialize=function(t){this.include(T.a),this.include(R.a),this.paymentMethod=new f,this.groups=new _,this.groups.user=this,this.polls=new b.a,this.polls.user=this,this.responses=new C},n.clear=function(){return t.prototype.clear.apply(this,arguments),this.paymentMethod.clear(),this.responses.reset(),this.groups.reset(),this.polls.reset()},n.liveChannel=function(){return O()("users").segment(this.get("login")).segment("activity/current.json").toString()},n.liveParams=function(){var t={};return this.firehose_token&&(t.firehose_token=this.firehose_token),t},n.livePreflight=function(){var t=this;return E.a.ajax({dataType:"json",url:"/api/firehose_tokens/current_activity",type:"GET",data:{presenter:this.get("login")}}).done(function(e){t.firehose_token=e.firehose_token})},n.dismissAnnouncement=function(){return this.sync("update",this,{url:"/profile/read_announcement",type:"PUT"})},n.firstNameLastInitial=function(){return this.get("first_name")+" "+(this.get("last_name")||"").slice(0,1)+"."},n.isRegisteredWith=function(t){var e;e=p.a.isNumber(t)?t:t.get("account_id");var n=this.get("member_of_account_ids");return p.a.include(n,e)},n.isOwner=function(){return"account owner"===this.get("role")},n.isAdmin=function(){return"account administrator"===this.get("role")},n.owns=function(t){return!p.a.isUndefined(this.get("id"))&&(p.a.isNumber(t)?t:t.get("owner_id")||t.get("user_id"))===this.get("id")},n.canManage=function(t){return this.owns(t)||(this.isAdmin()||this.isOwner())&&t.get("account_id")===this.get("account_id")},n.hasLogin=function(){return this.get("login").length>0},n.hasParticipantReporting=function(){return this.get("participant_reporting")},n.phoneNumber=function(){return this.get("phone_number")},n.isPhoneNumberVerified=function(){return this.phoneNumber()&&this.phoneNumber()===this.get("phone_number")},n.toJSON=function(){return this.isNew()?Object(d.x)("user",this.attributes):t.prototype.toJSON.apply(this,arguments)},n.parse=function(t){null==t&&(t={});var e=t;return null!=t.user&&(e=t.user),null!=e.payment_method_id&&this.paymentMethod.set({id:e.payment_method_id}),e},e.sendPasswordReset=function(t){return E.a.ajax({type:"POST",url:"/api/password_resets",data:{email:t}})},e.check=function(t){return E.a.ajax({url:"/api/users/check",data:{login_or_email:t},ssl:!0})},e.checkForExistence=function(t){return E.a.ajax({type:"HEAD",url:"/api/users/search?login_or_email="+encodeURIComponent(t),ssl:!0})},e.samlAjax=function(t){return E.a.ajax({url:"/saml_check.json",data:{email_login:t},ssl:!0})},r()(e,[{key:"defaults",get:function(){return{role:"presenter"}}},{key:"modelProperties",get:function(){return t.prototype.modelProperties.concat(["login"])}}]),e}(a.a)},311:function(t,e,n){"use strict";n.d(e,"a",function(){return g});var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(285),u=n(400),c=n(352),l=n(401),h=n(281),p=n.n(h),f=n(279),d=/^-?\d{0,3}(\.\d{1,2})?$/,g=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.initialize=function(e){return null==e&&(e={}),t.prototype.initialize.apply(this,arguments),this.include(c.a),this.include(u.a),this.initKeyword(),e.uploader&&(this.uploader=e.uploader,this.uploadId=e.uploadId),this.include(l.a)},n.validate=function(t,e){var n=this.validateKeyword({allowBlank:!0,sessionKeyword:null!=this.collection?this.collection.poll.get("simple_keywords"):void 0});return void 0!==n?n:t.points&&!d.test(t.points)?"Invalid points":void 0},n.hasValue=function(){return this.has("value")&&this.get("value").trim().length>0},n.cleanUp=function(){return v(null!=this.collection?this.collection.poll:void 0,function(t){return t.off()}),null!=this.mcpOptions&&this.mcpOptions.off(),t.prototype.cleanUp.apply(this,arguments)},n.displayValue=function(){return this.isLatex()?this.latexEquation():this.isImage()?this.imageUrl():Object(f.i)(this.get("value"))},n.percentageOfMax=function(){var t,e=this.get("results_count");return e&&null!=this.collection?"ranking_poll"===v(null!=this.collection?this.collection.poll:void 0,function(t){return t.type()})?((t=this.collection.length)-e)/(t-1)*100:e/(t=this.collection.highestResult())*100:0},n.percentageOfMinMaxDifference=function(){var t;if(this.collection){var e=this.collection.highestResult()-this.collection.lowestResult();if(e&&(t=this.get("results_count"))){var n=(t-this.collection.lowestResult())/e*100;return"ranking_poll"===v(null!=this.collection?this.collection.poll:void 0,function(t){return t.type()})?100-n:n}}},n.ordinalRank=function(){return null!=this.collection?this.collection.ordinalRank(this):void 0},n.percentageOfTotal=function(){return this.get("results_count")/(null!=this.collection?this.collection.poll.get("results_count"):void 0)*100},n.toJSON=function(){return this.pick(this.modelProperties)},n.isCorrect=function(){return this.has("correct_response")?this.get("correct_response"):this.get("correct")},n.responseUrl=function(){var t=this.collection.poll.get("permalink");return p()("/").segment(this.collection.poll.type()+"s").segment(t).segment("options").segment(this.id.toString()).segment("results.json").toString()},r()(e,[{key:"modelProperties",get:function(){return["id","value","keyword","correct_response","points","alt_text"]}}]),e}(a.a);function v(t,e){return null!=t?e(t):void 0}},315:function(t,e,n){"use strict";var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(277),u=n.n(a),c=n(327),l=n(316),h=n(333),p=n(293),f=/^Region (\d+)$/,d=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.isValueCorrect=function(t){return this.collidableRegions(this).some(function(e){return(e.get("correct")||e.get("correct_response"))&&e.contains(t)})},n.addValid=function(t){t.resolveOverlaps(this),t.outsideContainer()||this.collidableRegions(t).some(function(e){return t.overlaps(e)})||this.add(t)},n.collidableRegions=function(t){return new e(this.filter(function(e){return t!==e&&1!==t.get("_destroy")&&1!==e.get("_destroy")}))},n.highestResult=function(){return u.a.max(this.pluck("results_count"))},n.hasAlphaNumericKeyword=function(){return this.any(function(t){return t.isKeywordAlphaNumeric()})},n.hasCorrect=function(){return this.any(function(t){return t.get("correct")||t.get("correct_response")})},n.getNextName=function(){var t=0,e=0;return this.each(function(n){if(!n.isOtherRegion()){t+=1;var i=f.exec(n.getName());i&&(e=Math.max(e,parseInt(i[1])))}}),"Region "+(Math.max(t,e)+1)},r()(e,[{key:"model",get:function(){return h.a}}]),e}(p.a),g=n(279);n.d(e,"a",function(){return v});var v=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.initialize=function(e){void 0===e&&(e={}),t.prototype.initialize.apply(this,arguments),this.model_type=this.type(),this.regions=new d(this.attributes.options,{silent:!0}),this.regions.poll=this,this.on("change:options",this.updateRegions),this.hasOtherRegion()||this.regions.add(new h.a({value:h.a.CLICKABLE_REGION_OTHER}))},n.otherRegion=function(){return this.regions.find(function(t){return t.isOtherRegion()})},n.hasOtherRegion=function(){return!u.a.isUndefined(this.otherRegion())},n.findRegion=function(t,e,n,i){return this.regions.find(function(r){return r.containsRelativeXY(t,e,n,i)})||this.otherRegion()},n.highestResponse=function(){return this.regions&&this.regions.length?this.regions.highestResult():null},n.isGraded=function(){return this.regions.hasCorrect()},n.updateRegions=function(){this.regions.set(this.attributes.options)},n.toJSON=function(e){void 0===e&&(e={});var n=t.prototype.toJSON.apply(this,arguments);return n.options=this.regions.invoke("toJSON"),n},n.parse=function(e,n){void 0===e&&(e={}),void 0===n&&(n={}),e=t.prototype.parse.apply(this,arguments),u.a.defaults(n,{resetOptions:!0}),e.options&&this.regions&&(e.options.forEach(function(t){t.humanized_value&&g.a.test(t.humanized_value)&&t.value!==t.humanized_value&&(t.value=t.humanized_value)}),n.resetOptions?this.regions.set(e.options,n):delete e.options);var i=0===e.results_count?[]:e.results;return this.results.set(i),delete e.results,e},n.processLiveResponse=function(e){return void 0===e&&(e={}),e.result&&(e.result.deleted_at?this.results.remove(e.result):this.results.add(e.result,{merge:!0}),delete e.result),e=t.prototype.processLiveResponse.call(this,e),this.flashOptions().processLiveResponse(e),e},n.sendToListUrl=function(){},n.screenshotUrl=function(){return t.prototype.screenshotUrl.call(this,{hide:"clickable_image_regions"})},r()(e,[{key:"defaultType",get:function(){return"clickable_image"}},{key:"results",get:function(){return this._results||(this._results=new l.a(this.attributes.results,{poll:this})),this._results}}]),e}(c.a)},316:function(t,e,n){"use strict";var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(354),u=n(277),c=n.n(u),l=n(278);var h=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.preinitialize=function(){this.on("reset",this.resetParams,this)},n.resetParams=function(){this.params({}).resetSearchParams(),this.trigger("reset:params")},n.params=function(t){return this._filter||(this._filter=new a.a),null!=t?this._filter.set(t):this._filter.attributes},n.query=function(t){return null==t&&(t={}),t.data=this.params(),this.fetch(t)},n.hasMore=function(){return!!this.params().next_page},n.loadMore=function(){var t=this,e=this.model.prototype.idAttribute||"id";return this.params({page:this.params().next_page}),this.query({remove:!1}).then(function(n){var i=c.a.pluck(n,e);return t.filter(function(t){return c.a.contains(i,t.get(e))})})},n.fetch=function(e){var n=this;void 0===e&&(e={}),c.a.defaults(e,{all:!1});var i=t.prototype.fetch.call(this,e);return i.then(function(){(function(t){try{var e=JSON.parse(t.getResponseHeader("X-Pagination"));null!=this.params&&this.params(e)}catch(t){}}).call(n,i)}).then(function(){e.all&&n.hasMore()&&(n.params({page:n.params().next_page}),n.query(c.a.extend({},{remove:!1},e)))}),i},e}(n.n(l).a.Collection),p=n(320),f=n(279),d=n(281),g=n.n(d);n.d(e,"a",function(){return v});var v=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.initialize=function(t,e){void 0===e&&(e={}),this.poll=e.poll},n.comparator=function(t){return-t.id},n.url=function(){return g()("/polls").segment(this.poll.get("permalink")).segment("results").toString()},n.parse=function(t,e){return Object(f.u)(t)},r()(e,[{key:"model",get:function(){return p.a}}]),e}(h)},319:function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return d});var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(279),u=n(285),c=n(530),l=n(83),h=n.n(l),p=n(281),f=n.n(p),d=function(e){function n(){return e.apply(this,arguments)||this}s()(n,e);var i=n.prototype;return i.initialize=function(){e.prototype.initialize.apply(this,arguments),this.activities=new c.a(null,{group_id:this.id,user_id:this.get("owner_id")})},i.convertTo=function(e){var n=this.get("id")||this.get("permalink"),i=f()(this.urlRoot).segment(n.toString()).segment("convert_to_"+e).toString();return t.ajax({url:i,method:"post",dataType:"json"})},i.markAsLoaded=function(){return this.set({loaded:!0})},i.toggleCollapse=function(){var t=!this.get("collapsed");if(this.isRealGroup()){return this.save({collapsed:t},{patch:!0,wait:!0})}return this.set({collapsed:t}),h.a.Deferred().resolve()},i.url=function(t){return null==t&&(t={}),f()(e.prototype.url.apply(this,arguments)).setQuery(t).toString()},i.validate=function(t){if(null!=t.name&&0===t.name.length)return"Group name cannot be empty."},i.isRealGroup=function(){return this.id!==n.defaultId},i.parse=function(t){return t.group&&(t=a.t(t)),t.activities&&(this.activities?this.activities.set(t.activities):this.activities=new c.a(t.activities,{group_id:this.id,user_id:this.get("owner_id")})),e.prototype.parse.apply(this,arguments)},r()(n,[{key:"urlRoot",get:function(){return"/api/groups"}},{key:"defaults",get:function(){return{id:null,name:"New Group",collapsed:!1,loaded:!1,current:!1}}}],[{key:"defaultId",get:function(){return-1}}]),n}(u.a)}).call(this,n(278))},320:function(t,e,n){"use strict";n.d(e,"a",function(){return u});var i=n(275),r=n.n(i),o=n(285),s=n(279),a=n(401),u=function(t){function e(){return t.apply(this,arguments)||this}r()(e,t);var n=e.prototype;return n.initialize=function(){return t.prototype.initialize.apply(this,arguments),this.include(a.a)},n.parse=function(t){return Object(s.t)(t)},n.toJSON=function(){return{result:this.attributes}},n.poll=function(){return this.collection?this.collection.poll:null},n.isArchived=function(){return this.get("archive_id")||!1},n.approve=function(){return this.save({approved:!0})},n.reject=function(){return this.save({approved:!1})},n.isApproved=function(){return!0===this.get("approved")},n.isRejected=function(){return!1===this.get("approved")},n.isUnmoderated=function(){return null===this.get("approved")},n.isDeleted=function(){return!!this.get("deleted_at")},n.cleanValue=function(){return Object(s.i)(this.get("value"))},n.moderationState=function(){switch(this.get("approved")){case!0:return"approved";case!1:return"rejected";default:return"pending"}},n.shouldBeDisplayed=function(){return!this.isRejected()&&!this.isDeleted()&&(!(this.poll()&&this.poll().get("moderation_enabled"))||!this.isUnmoderated())},e}(o.a)},321:function(t,e,n){"use strict";(function(t,i){n.d(e,"a",function(){return m});var r=n(276),o=n.n(r),s=n(275),a=n.n(s),u=n(281),c=n.n(u),l=n(285),h=n(349),p=n(351),f=n(355),d=n(279),g=n(447),v=n(537),y=n(332);var m=function(e){function n(){return e.apply(this,arguments)||this}a()(n,e);var r=n.prototype;return r.initialize=function(t,n){void 0===t&&(t={}),void 0===n&&(n={}),e.prototype.initialize.apply(this,arguments),this.include(y.a),this.include(h.a),this.include(p.a),this.initSubModel("presenter"),this.flashOptionsStub=function(){var t=this,e=new g.a({showInstructions:!1,showTitle:!1});return e.url=function(){return c()("/api/competitions/"+t.get("permalink")+"/visual_setting").toString()},e}.call(this),this.leaderboard=new v.a(null,Object.assign({},n,{competition:this})),this.polls=new f.a,this.polls.comparator="position",this.polls.competition=this,this.parse(t,n)},r.url=function(){return this.instance.url()},r.deactivate=function(){var e=this;return t.ajax({url:"/api/activation",method:"DELETE",data:{user_id:this.get("owner_id")}}).then(function(){e.presenter.set("active",!1),e.set("current",!1)})},r.activate=function(){var e=this,n=t.ajax({url:"/api/activation",method:"PUT",data:{type:this.type(),uid:this.get("permalink")}});return n.done(function(){e.presenter.set("active",!0),e.set("current",!0)}),n},r.type=function(){return"competition"!==this.get("type")&&this.set({type:"competition"},{silent:!0}),this.get("type")},r.cleanTitle=function(t){return void 0===t&&(t={}),Object(d.i)(this.get("title"),t)},r.showUrl=function(){return this.has("permalink")?c()("/competitions").segment(this.get("permalink")).toString():""},r.copyUrl=function(){return this.has("id")?c()("/api/competitions").segment(this.get("id").toString()).segment("copy").toString():""},r.toJSON=function(t){void 0===t&&(t={});var e=this.pick(this.modelProperties);return e.polls=this.polls.invoke("toJSON",{root:!1}).filter(function(t){return!i.isEmpty(t)}),e},r.parse=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.instance&&(t=this.instance.normalizeActivityData(t)),this.polls&&t.polls&&(t=function(t){return void 0===t&&(t={}),t.polls=t.polls||[],t.polls=t.polls.map(function(e){return e.presenter=Object.assign({},t.presenter,e.presenter),e.group_id=null,e.survey_id=null,e.competition_id=t.id,e}),t}(t),this.polls.set(t.polls,e)),t},r.requiresRegistration=function(){return!!this.get("registered_participants_only")},r.flashOptions=function(){return this.flashOptionsStub},r.visualSettings=function(){return this.flashOptionsStub},r.introTextList=function(){var t=["Get ready to compete!"];return this.get("timed")?t.push("Win up to 1,000 points per answer!","Speed counts, so move fast!"):t.push("Win 1,000 points per correct answer!"),t},r.liveChannel=function(){if(!this.has("permalink"))throw new Error("This competition does not exist.");return"competitions/"+this.get("permalink")+"/firehose.json"},r.processLiveResponse=function(t){return void 0===t&&(t={}),this.set(this.parse(t)),t},r.isActivated=function(){return this.get("current")},o()(n,[{key:"modelProperties",get:function(){return["display_state","group_id","id","owner_id","owner_login","permalink","polls","title"]}}]),n}(l.a)}).call(this,n(278),n(277))},325:function(t,e,n){"use strict";(function(t,i,r){var o=n(275),s=n.n(o),a=function(t){function e(){return t.apply(this,arguments)||this}return s()(e,t),e.prototype.urlRoot=function(){return"/api/registrations"},e}(n(285).a);a.create=function(e,n){void 0===n&&(n={});var o=t.Deferred();return i.ajax({dataType:"json",contentType:"application/json",url:"/api/registrations",method:"POST",data:JSON.stringify(r.extend({email:e},n))}).done(o.resolve).fail(function(t){var e;e=401===t.status?"You must be logged in to register with a presenter":404===t.status?"Unable to find presenter to register with":t.responseJSON&&t.responseJSON.error&&t.responseJSON.error.message?t.responseJSON.error.message:"Unexpected error while registering, please contact support@polleverywhere.com",o.reject(e,t)}),o.promise()},e.a=a}).call(this,n(83),n(278),n(277))},327:function(t,e,n){"use strict";var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(277),u=n.n(a),c=n(281),l=n.n(c),h=n(278),p=n.n(h),f=n(285),d=n(349),g=n(332),v=n(351),y=n(283),m=n(279),_=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.toJSON=function(e){return void 0===e&&(e={}),(e=u.a.defaults(e,{root:!0})).root?{visual_settings:t.prototype.toJSON.call(this,e)}:t.prototype.toJSON.call(this,e)},n.isNew=function(){return!1},n.url=function(){if(!this.poll)throw new Error("A poll is required.");if(!this.poll.has("permalink"))throw new Error("Poll needs to be hydrated before fetching.");return l()("/polls").segment(this.poll.get("permalink")).segment("visual_settings.json").toString()},n.processLiveResponse=function(t){void 0===t&&(t={}),t.visual_settings&&this.set(t.visual_settings)},e}(f.a),b=n(447);n.d(e,"a",function(){return w});var w=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.initialize=function(e,n){void 0===e&&(e={}),void 0===n&&(n={}),t.prototype.initialize.apply(this,arguments),this.include(g.a),this.include(d.a),this.include(v.a),this.initSubModel("type_options"),this.initSubModel("presenter"),this.initSubModel("flash_options",{model:b.a,prefix:"_"}).poll=this,this.initSubModel("visual_settings",{model:_,prefix:"_"}).poll=this,this.parse(e,n)},n.fetch=function(e){void 0===e&&(e={}),(e=Object.assign({},e)).data=Object.assign({},e.data);var n=e.data.include?e.data.include.split(","):[];return n.includes("collection")||(n.push("collection"),e.data.include=n.join(",")),t.prototype.fetch.call(this,e)},n.liveChannel=function(){return Object(m.r)(2,this.type())+"/"+this.get("permalink")+"/firehose.json"},n.processLiveResponse=function(t){void 0===t&&(t={});var e="position"in t?t.position:null;return e&&e!==this.get("position")&&(t.position=e),this.set(this.parse(t)),t},n.isGraded=function(){return!1},n.hasAlphaNumericKeyword=function(){return!1},n.hasCustomGlobalKeyword=function(){return!1},n.supportsModeration=function(){return!1},n.visualSettings=function(){return this._visualSettings},n.flashOptions=function(){return this._flashOptions},n.type=function(t){return t||(this.has("type")?this.get("type"):this.defaultType)},n.remainingVotes=function(t){return Math.max((this.get("max_votes")||1/0)-t,0)},n.percentageVotesUsed=function(t){return t/this.get("max_votes")*100},n.permalink=function(){return this.get("permalink")},n.start=function(t){return this.toggle("state",t,"opened")},n.stop=function(t){return this.toggle("state",t,"closed")},n.toggleState=function(t){var e="opened"===this.get("state")?"closed":"opened";return this.toggle("state",t,e)},n.toggleSmsEnabled=function(t){return this.toggle("sms_enabled",t)},n.toggleWebEnabled=function(t){return this.toggle("web_enabled",t)},n.toggleRegisteredParticipantsOnly=function(t,e){return void 0===e&&(e={}),this.toggle("registered_participants_only",e,t)},n.toggleEditableAnswers=function(t,e){return void 0===e&&(e={}),this.toggle("editable_answers",e,t)},n.toggleMaxVotes=function(t,e,n){return void 0===n&&(n={}),"unlimited"===t?this.toggle("max_votes_select",n,"unlimited"):this.toggle("max_votes",n,e)},n.toggleAnonymous=function(t,e){return void 0===e&&(e={}),this.toggle("anonymous",e,t)},n.toggle=function(t,e,n){void 0===e&&(e={});var i={};return i[t]=void 0!==n?n:!this.get(t),Object(m.k)(e,{patch:!0,headers:{Prefer:"return=minimal"}}),this.save(i,e)},n.isActivated=function(){return this.get("current")},n.isStarted=function(){return"opened"===this.get("state")},n.isStopped=function(){return"closed"===this.get("state")},n.isMaxedOut=function(){return"maxed_out"===this.get("state")},n.isWebEnabled=function(){return this.get("web_enabled")},n.isWebRespondable=function(){return this.isStarted()&&this.isWebEnabled()},n.isWebRespondableFor=function(t){return!this.hasMaximumResponses(t)&&this.isWebRespondable()},n.isGlobalKeywordsEnabled=function(){return this.get("sms_enabled")&&!this.get("simple_keywords")},n.hasMaximumResponses=function(t){return!!this.get("max_votes")&&("function"==typeof t.resultsForPoll?t.resultsForPoll(this,!1).size():void 0)>=this.get("max_votes")},n.url=function(){return this.instance.url()},n._urlBase=function(){var t=Object(m.r)(2,this.type()),e=this.attributes.permalink;return l()("/").segment(t).segment(e)},n.webVotingPath=function(){return this.webVotingUrl()},n.webVotingUrl=function(){return this._urlBase().segment("web").toString()},n.showUrl=function(){return this._urlBase().toString()},n.editUrl=function(){return this._urlBase().segment("edit").toString()},n.duplicateUrl=function(){return this._urlBase().segment("duplicate").toString()},n.undo=function(){return p.a.ajax({url:this.undoUrl(),type:"delete"})},n.undoUrl=function(){return l()("/api/polls").segment(this.id.toString()).segment("results").toString()},n.clearUrl=function(){return this._urlBase().segment("results/archive").toString()},n.deleteResultsUrl=function(){return this._urlBase().segment("results").toString()},n.responseHistoryUrl=function(){return this._urlBase().segment("results").toString()},n.sendToListUrl=function(){return this._urlBase().segment("send_to_list").toString()},n.resultsUrl=function(){var t=this.get("permalink");return l()("/polls").segment(t).segment("results").toString()},n.screenshotUrl=function(t){return void 0===t&&(t={}),!0===t&&(t={attachment:!0}),this._urlBase().absoluteTo(y.a.get("poll_renderer_url")).query(t).toString()},n.toJSON=function(){var t={type:this.type()};return Object.assign(t,this.pick(this.modelProperties))},n.shouldHideKeywords=function(){var t=this.attributes.sms_enabled,e=this.attributes.web_enabled,n=this.attributes.current,i=this.attributes.simple_keywords,r=this.attributes.web_address,o="closed"===this.attributes.state,s=!t&&!e,a=!t&&e&&null!==r,u=!n&&i,c=!this.flashOptions().get("showKeywords"),l=this.flashOptions().has("teamPollArchiveId")&&0!==this.flashOptions().get("teamPollArchiveId");return o||s||a||u||c||l},n.cleanTitle=function(t){void 0===t&&(t={});var e=this.get("title");return Object(m.i)(e,t)},n.clearResults=function(t){var e=this;void 0===t&&(t={});var n=u.a.wrap(t.success,function(n,i,r,o){return i=Object(m.t)(i),!!e.set(e.parse(i,t),t)&&("function"==typeof n&&n(e,i,o),e.trigger("clear"))});return t.success=n,t.url=t.url||this.clearUrl(),this.sync("delete",this,t)},n.deleteResults=function(t){return void 0===t&&(t={}),t.url||(t.url=this.deleteResultsUrl()),this.clearResults(t)},n.refreshArchives=function(){var t=this;return this.archives.models.length&&u.a.each(this.archives.pluck("id"),function(e){t.archives.remove(t.archives.get(e))},this),this.archives.fetch()},n.parse=function(t){return void 0===t&&(t={}),this.instance&&(t=this.instance.normalizeActivityData(t)),t},n.requiresRegistration=function(){return!!this.get("registered_participants_only")},n.onScreenUrl=function(){return"/api/activation"},n.setAsCurrent=function(t){return void 0===t&&(t={}),(t=u.a.defaults(t,{url:this.onScreenUrl()})).type="PUT",t.data={type:"poll",uid:this.get("permalink")},t.processData=!0,this.sync("create",this,t)},n.toggleSimpleKeywords=function(t){return this.toggle("simple_keywords")},n.activate=function(){var t=this,e={type:"PUT",url:this.onScreenUrl(),data:{type:this.type(),uid:this.get("permalink")},processData:!0};return this.sync("create",this,e).done(function(){t.presenter.set({active:!0}),t.set({current:!0})})},n.deactivate=function(){var t=this,e={};return this.presenter?e.user_id=this.presenter.get("id"):e.user_id=this.get("owner_id"),this.sync("delete",this,{url:this.onScreenUrl(),processData:!0,data:e}).done(function(){t.presenter.set({active:!1}),t.set({current:!1})})},n.getTypeOption=function(t){return this.typeOptions.get(t)},n.setTypeOption=function(t,e){this.typeOptions.set(t,e)},n.unsetTypeOption=function(t){this.typeOptions.unset(t)},n.isSimpleKeywords=function(){return this.get("simple_keywords")},e.fetchByPermalink=function(t){return p.a.ajax({url:l()("/api/polls").segment(t).toString(),method:"GET"})},r()(e,[{key:"defaults",get:function(){return{web_enabled:!0,web_address:"PollEv.com"}}},{key:"modelProperties",get:function(){return["activated","anonymous","competition_id","confirmation_type","custom_confirmation_message","display_state","editable_answers","flash_options","group_id","max_votes","owner_id","participant_key","permalink","position","presenter_key","registered_participants_only","shared_key","simple_keywords","sms_enabled","start_at","state","stop_at","survey_id","title","type_options","web_enabled"]}},{key:"archives",get:function(){return this.instance.archives}},{key:"currentArchive",get:function(){return this.instance.currentArchive}}]),e}(f.a)},332:function(t,e,n){"use strict";var i=n(279),r=n(283),o=n(277),s=n.n(o),a=n(303),u=n.n(a),c=n(308);e.a=function(t){return t._subscriptionChannels=[],{firehoseConnect:function(e){return t.live(e)},firehoseConnectSingle:function(e){return t.live(e)},firehoseConnectMultiplexed:function(e){return void 0===e&&(e={}),t.live(e)},firehoseDisconnect:function(){t.die()},livePoll:function(e){if(void 0===e&&(e={}),t.type()){var n=Object(i.r)(2,t.type());return e.path="/"+n+"/"+t.get("permalink")+".json",t.live(e)}},live:function(e){void 0===e&&(e={});var n=(e=s.a.defaults({},e,{message:function(n){t._handleLiveMessage(n,e)},path:s.a.result(t,"liveChannel"),params:t.liveParams})).path;Array.isArray(n)||(n=[n]),n.forEach(function(n){return function(t,e){var n=Object(c.a)(t,{host:r.a.get("firehose_url").toString(),ssl:r.a.get("firehose_ssl"),params:e.params,preflight:this.livePreflight?this.livePreflight:void 0});e.message&&n.on("message",e.message),e.failed&&n.on("failed",e.failed),e.error&&n.on("error",e.error),e.connected&&n.on("up",e.connected),e.disconnected&&n.on("down",e.disconnected),this._subscriptionChannels.push(n)}.call(t,n,e)})},_handleLiveMessage:function(e,n){if(void 0===n&&(n={}),!t.silenced){var r="function"==typeof this.type&&this.type()in e?Object(i.t)(e):e;if(t.id===r.id)if(!(!(t.has("updated_at")&&r.updated_at)||u()(t.get("updated_at")).diffMilliseconds(r.updated_at)>=0))return;"function"==typeof t.processLiveResponse&&t.processLiveResponse(r,n),t.trigger("liveResponse",r)}},die:function(){t._subscriptionChannels.forEach(function(t){return t.unsubscribe()}),t._subscriptionChannels=[]},silence:function(e){void 0===e&&(e=!0),t.silenced=!0===e}}}},333:function(t,e,n){"use strict";n.d(e,"a",function(){return p});var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(279),u=n(311),c=n(277),l=n.n(c),h=/^-?\d{0,3}(\.\d{1,2})?$/,p=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.initialize=function(){var e=this;return t.prototype.initialize.apply(this,arguments),this.on("change:value",function(){return delete e.regionMatches})},n.validate=function(t){if(t.points&&!h.test(t.points))return"Invalid points"},n.contains=function(t){var n=new e({value:t+"|0.1%x0.1%"});return this.overlaps(n)},n.resolveOverlaps=function(t){var e=this;return t.each(function(t){if(e.overlaps(t))return e.separateFrom(t),e.trigger("reposition")})},n.revertIfInvalid=function(t){var e=this,n=!1;return this.collection.collidableRegions(this).each(function(i){(e.overlaps(i)||e.outsideContainer())&&(e.set({value:t}),e.trigger("reposition"),n=!0)}),n},n.outsideContainer=function(){var t=this.bounds();return t.left<0||t.right>100||t.top<0||t.bottom>100},n.isOtherRegion=function(){return this.get("value")===e.CLICKABLE_REGION_OTHER},n.containsRelativeXY=function(t,e,n,i){if(this.isOtherRegion())return!1;var r=t*n,o=e*i,s=this.relativeX()/100*n,a=this.relativeY()/100*i,u=this.relativeWidth()/100*n,c=this.relativeHeight()/100*i;return r>s&&r<s+u&&(o>a&&o<a+c)},n.relativeWidth=function(){if(null==this.regionMatches&&(this.regionMatches=f(this.get("value"),function(t){return t.match(a.a)})),(null!=this.regionMatches?this.regionMatches.length:void 0)>4)return parseFloat(this.regionMatches[4])},n.relativeHeight=function(){if(null==this.regionMatches&&(this.regionMatches=f(this.get("value"),function(t){return t.match(a.a)})),(null!=this.regionMatches?this.regionMatches.length:void 0)>5)return parseFloat(this.regionMatches[5])},n.respondWithCoord=function(t,e){return this.respond("region: "+100*t+"%,"+100*e+"%")},n.center=function(){return{x:this.relativeX()+this.relativeWidth()/2,y:this.relativeY()+this.relativeHeight()/2}},n.size=function(){return{width:this.relativeWidth(),height:this.relativeHeight()}},n.bounds=function(){return{left:this.relativeX(),right:this.relativeX()+this.relativeWidth(),top:this.relativeY(),bottom:this.relativeY()+this.relativeHeight()}},n.overlaps=function(t){if(t.isOtherRegion()||this.isOtherRegion())return!1;var e=this.bounds(),n=e.left,i=e.right,r=e.top,o=e.bottom,s=t.bounds(),a=s.left,u=s.right,c=s.top,l=s.bottom;return!(a>i||u<n||c>o||l<r)},n.separateFrom=function(t){var e=1.05,n=t.size(),i=n.width,r=n.height,o=t.center(),s=o.x,a=o.y,u=this.size(),c=u.width,l=u.height,h=this.center(),p=h.x,f=h.y,d=this.bounds(),g=d.left,v=d.top,y=(c+i)/2-Math.abs(p-s),m=(l+r)/2-Math.abs(f-a);return m>y?(p<=s&&(e=-e),g+=e*y,this.updateValue({x:g})):(f<=a&&(e=-e),v+=e*m,this.updateValue({y:v}))},n.updateValue=function(t){var e=t.x,n=t.y,i=t.width,r=t.height,o=t.name,s=this.bounds(),a=this.size();return null==e&&(e=s.left),null==n&&(n=s.top),null==i&&(i=a.width),null==r&&(r=a.height),null==o&&(o=this.getName()),this.set({value:"region: "+e+"%,"+n+"%|"+i+"%x"+r+"%#"+o})},n.setName=function(t){var e=this.get("value");return this.set({value:e.replace(/#.*$/,"")+"#"+t}),this.trigger("rename")},n.getName=function(){if(null==this.regionMatches&&(this.regionMatches=f(this.get("value"),function(t){return t.match(a.a)})),(null!=this.regionMatches?this.regionMatches.length:void 0)>5)return this.regionMatches[6]},n.toJSON=function(){return l.a.pick(this.attributes,"_destroy","id","value","correct_response","points")},r()(e,null,[{key:"CLICKABLE_REGION_OTHER",get:function(){return"region:other"}},{key:"CLICKABLE_REGION_DEFAULT_WIDTH",get:function(){return 65}},{key:"CLICKABLE_REGION_DEFAULT_HEIGHT",get:function(){return 65}},{key:"CLICKABLE_REGION_MIN_WIDTH",get:function(){return 20}},{key:"CLICKABLE_REGION_MIN_HEIGHT",get:function(){return 20}},{key:"CLICKABLE_REGION_REGEX",get:function(){return a.a}}]),e}(u.a);function f(t,e){return null!=t?e(t):void 0}},344:function(t,e,n){"use strict";n.d(e,"a",function(){return c});var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(285),u=n(279),c=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.initialize=function(t){if(null==t&&(t={}),t.user)return t.user.unset("id"),this.set(t.user.attributes)},n.url=function(){return"/users"},n.toJSON=function(){return Object(u.x)("user",this.pick(this.modelProperties))},n.isLoggedIn=function(){return this.id>0},n.isOnlyRegParticipant=function(){return!this.get("account_id")},r()(e,[{key:"defaults",get:function(){return{role:"participant"}}},{key:"modelProperties",get:function(){return["id","email","first_name","last_name","password","role","user_source"]}}]),e}(a.a)},349:function(t,e,n){"use strict";var i=n(278),r=n.n(i),o=n(277),s=n.n(o),a=n(292);e.a=function(t){return{initSubModel:function(e,n){void 0===n&&(n={}),n=s.a.defaults(n,{model:r.a.Model,prefix:""});var i=Object(a.camelize)(e),o=new n.model(t.get(e));return t[""+n.prefix+i]=o,t.set(e,o.toJSON({root:!1}),{silent:!0}),t.listenTo(o,"change",function(n){s.a.each(n.changedAttributes(),function(n,i){t.trigger("change:"+e+":"+i,n,o)}),t.set(e,o.toJSON({root:!1}),{silent:!0}),t.trigger("change",t)}),t.on("change:"+e,function(){return o.set(t.get(e))}),o}}}},351:function(t,e,n){"use strict";(function(t){var i=n(281),r=n.n(i),o=n(829),s=n(533);function a(t){return this._instance&&this._instance instanceof t?this._instance:new t({},{activity:this})}var u={duplicate:function(e){return void 0===e&&(e={}),e=Object.assign({},e,{url:r()(this.instance.url()).segment("duplicate").toString(),method:"post",dataType:"json"}),t.ajax(e)}};e.a=function(t){return Object.defineProperty(t,"instance",{get:function(){var t=this.get("presenter_key"),e=this.get("participant_key"),n=this.get("shared_key");return this._instance=t&&t!==n||!e?a.call(this,o.a):a.call(this,s.a),this._instance},set:function(t){this._instance=t}}),u}}).call(this,n(278))},352:function(t,e,n){"use strict";var i=n(320),r=n(281),o=n.n(r);function s(t,e){return null!=t?e(t):void 0}e.a=function(t){return{respond:function(e,n){var r=new i.a({value:e});(t.has("source")||s(null!=t.collection?t.collection.poll:void 0,function(t){return t.has("source")}))&&r.set({source:t.get("source")||s(null!=t.collection?t.collection.poll:void 0,function(t){return t.get("source")})});var a=o()(t.responseUrl());return(null!=n?n.include_confirmation_message:void 0)&&a.addQuery("include_confirmation_message","1"),r.save(null,{url:a.toString()})}}}},353:function(t,e,n){"use strict";n.d(e,"a",function(){return c});var i=n(275),r=n.n(i),o=n(293),s=n(277),a=n.n(s),u=n(279),c=function(t){function e(){return t.apply(this,arguments)||this}return r()(e,t),e.prototype.reset=function(t,e){var n=this;null==t&&(t=[]),null==e&&(e={});var i=this.filter(function(t){return t.isNew()});this.remove(i,e);var r=this.pluck("id"),o=a.a.map(t,function(t){return t.id||Object(u.t)(t).id}),s=a.a.without.apply(this,[r].concat(o));a()(s).each(function(t){return n.remove(n.get(t),e)}),this.add(t,a.a.extend({merge:!0},e,{validate:!1}));var c=!1;if(r.length>0&&JSON.stringify(o)!==JSON.stringify(r)){var l=a.a.map(t,function(t,e){return n.get(t.id||Object(u.t)(t).id)});a.a.each(l,function(t,e){n.models[e]=t}),c=!0}return!s.length&&r.length===o.length&&c&&(e.silent||this.trigger("reorder",this,e)),e.silent||this.trigger("reset",this,e),this},e}(o.a)},354:function(t,e,n){"use strict";n.d(e,"a",function(){return c});var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(278),u={page:1,search:"",order:"",direction:""},c=function(t){function e(){return t.apply(this,arguments)||this}return s()(e,t),e.prototype.resetSearchParams=function(){return this.clear().set(u)},r()(e,[{key:"defaults",get:function(){return u}}]),e}(n.n(a).a.Model)},355:function(t,e,n){"use strict";n.d(e,"a",function(){return f});var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(277),u=n.n(a),c=n(279),l=n(293),h=n(327),p=n(304),f=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.model=function(t,e){return Object(p.a)(t,e)||new h.a(t,e)},n.comparator=function(t,e){var n=t.get("position"),i=e.get("position");return u.a.isUndefined(n)||u.a.isUndefined(i)?0:n===i?t.id-e.id:n-i},n.multipleChoicePolls=function(){return new e(this.select(function(t){return"multiple_choice_poll"===t.type()}))},n.query=function(t){var e=this,n={term:t};return this.sync("create",this,{url:"/my/polls/search",data:n,processData:!0}).done(function(t){return e.set(t.polls,{parse:!0})})},n.getByPermalink=function(t){return this.find(function(e){return e.get("permalink")===t})},n.parse=function(e){return e=t.prototype.parse.apply(this,arguments),Object(c.u)(e)},n.search=function(t){var e=Object(c.w)(t);return this.filter(function(t){return e.test(t.get("title"))})},e.pollsToModels=function(t){t.map(function(t){return t instanceof h.a?t:Object(p.a)(t)})},r()(e,[{key:"url",get:function(){return"/api/polls"}}]),e}(l.a)},357:function(t,e,n){"use strict";n.d(e,"a",function(){return f});var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(353),u=n(320),c=n(354),l=n(279),h=n(277),p=n.n(h),f=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.url=function(){return"/my/results"},n.params=function(t){return this._filter||(this._filter=new c.a),null!=t?this._filter.set(t):this._filter.attributes},n.query=function(t){return null==t&&(t={}),t.data=this.params(),this.fetch(t)},n.parse=function(e,n){return t.prototype.parse.apply(this,arguments),Object(l.u)(e)},n.mostRecentForOptions=function(t){var e=this,n=null;return t.forEach(function(t){var i,r=e.where({accumulator_id:t});(i=p.a.sortBy(r,"created_at").reverse()[0])&&(null==n&&(n=i),new Date(i.get("created_at"))>new Date(n.get("created_at"))&&(n=i))}),n},r()(e,[{key:"model",get:function(){return u.a}}]),e}(a.a)},358:function(t,e,n){"use strict";(function(t,i){n.d(e,"a",function(){return u});var r=n(276),o=n.n(r),s=n(275),a=n.n(s),u=function(t){function e(){return t.apply(this,arguments)||this}a()(e,t);var n=e.prototype;return n.fetch=function(e){return null==e&&(e={}),e.url="/api/participants/"+this.get("participant_id")+"/presenters/"+this.get("presenter_id")+"/relationship",t.prototype.fetch.call(this,e)},n.hasNullScreenname=function(){return this.isNew()||null===this.get("screen_name")},n.save=function(e,n){var r=this;return i.Deferred(function(i){t.prototype.save.call(r,e,n).fail(function(t){if(409===t.status){var o=t.responseJSON.error;return o.detail.id?(r.set({id:o.detail.id}),r.save(e,n).fail(function(t){return i.reject(t,"Failed after retrying to save relationship")}).then(i.resolve)):i.reject(t,"Conflict while saving relationship")}return i.reject(t,"Failed to update/create relationship")}).then(i.resolve)})},o()(e,[{key:"urlRoot",get:function(){return"/api/participant_presenter_relationships"}}]),e}(t.Model)}).call(this,n(278),n(83))},363:function(t,e,n){"use strict";var i=n(275),r=n.n(i),o=n(353),s=n(285),a=n(279),u=function(t){function e(){return t.apply(this,arguments)||this}return r()(e,t),e.prototype.parse=function(t){return Object(a.t)(t)},e}(s.a),c=function(t){function e(){return t.apply(this,arguments)||this}return r()(e,t),e.initClass=function(){this.prototype.model=u},e.prototype.addVote=function(t){var e=this.find(function(e){return e.get("result_id")===t.result_id});return e?e.set({value:t.value}):(e=new u(t),this.add(e))},e}(o.a);c.initClass();e.a=c},364:function(t,e,n){"use strict";var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(279),u=n(316),c=n(320),l=n(281),h=n.n(l),p=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.urlRoot=function(){var t=this.collection&&this.collection.poll,e=t?t.get("permalink"):this.get("permalink");return e?"string"!=typeof e?"":h()("/polls").segment(e).segment("results").toString():""},n.put=function(t){if(void 0===t&&(t=""),!t||"string"!=typeof t)throw new Error("Missing action.");return this.save(null,{type:"PUT",url:h()(this.url()).segment(t).toString()})},n.upVote=function(){return this.put("upvote")},n.downVote=function(){return this.put("downvote")},n.unVote=function(){return this.put("unvote")},n.feature=function(){return this.put("feature")},n.unfeature=function(){return this.put("unfeature")},n.unapprove=function(){return this.save({approved:!1})},n.isUnapproved=function(){return!1===this.get("approved")},n.isPinned=function(){return!1},n.promote=function(){return this.put("promote")},n.unpromote=function(){return this.put("unpromote")},e}(c.a);n.d(e,"a",function(){return d});var f={recent:function(t){return-t.id},mine:function(t){return-t.get("score")},top:function(t,e){return t.get("score")===e.get("score")?t.id>e.id?1:-1:t.get("score")>e.get("score")?-1:1},netVotes:function(t,e){var n=Object(a.j)(t.get("net_votes"),e.get("net_votes"));return 0!==n?n:0!==(n=Object(a.j)(t.get("upvotes"),e.get("upvotes")))?n:Object(a.j)(e.id,t.id)},netVotesRecentFirst:function(t,e){var n=Object(a.j)(t.get("net_votes"),e.get("net_votes"));return 0!==n?n:0!==(n=Object(a.j)(t.get("upvotes"),e.get("upvotes")))?n:Object(a.j)(t.id,e.id)}},d=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.changeSort=function(t){this.comparator=this.strategies[t]},n.maxUpvotes=function(){return Math.max.apply(Math,this.pluck("upvotes").concat(0))},n.maxDownvotes=function(){return Math.max.apply(Math,this.pluck("downvotes").concat(0))},r()(e,[{key:"model",get:function(){return p}},{key:"sortStrategy",get:function(){return"recent"}},{key:"strategies",get:function(){return f}}]),e}(u.a)},399:function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return h});var i=n(277),r=n.n(i),o=n(281),s=n.n(o),a=n(308),u=n(283);function c(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=[]),!e.length)return t;var n=r.a.groupBy(e,"id");return t.map(function(t,e){var i=n[t.id],r={};return i&&(r=1===i.length?i.pop():i[e]),Object.assign({},t,r)})}function l(t,e){(void 0===t&&(t={}),void 0===e&&(e={}),Object.keys(t).length)&&(e.channel.includes("results")&&(t=function(t){return void 0===t&&(t={}),Object.keys(t).length?{result:t}:t}.call(this,t)),e.path=e.channel,this.activity.processLiveResponse(t,e),this.trigger("liveResponse",t))}var h={getInstanceChannelPath:function(t){void 0===t&&(t="");var e="presenter"===this.type?"presenter_key":"participant_key",n=s()("/instances").segment(this.activity.type()+"s").segment(this.activity.get(e));return t&&n.segment(t),n.suffix("json").toString()},getActivityChannelPath:function(){return s()("/").segment(this.activity.type()+"s").segment(this.activity.get("shared_key")).segment("shared").suffix("json").toString()},requireAttrs:function(t,e){void 0===t&&(t={}),void 0===e&&(e=[]),e.forEach(function(e){if(!t[e])throw new Error(e+" must be provided")})},parseActivity:function(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),Object.keys(t).length)return t.type=this.activity.type(),t=this.activity.parse(t,e),this.activity.set(t),t},getIdAttribute:function(){return this.type+"_key"},getUrlRoot:function(){var t=s()("/api/").segment(this.type).segment(this.activity.type()+"s"),e=this.activity.get(this.idAttribute);return e&&t.segment(e),t.toString()}},p={activate:function(){var e=this,n={method:"PUT",url:"/api/activation",data:{type:this.activity.type(),uid:this.activity.get(this.idAttribute)}};return t.ajax(n).done(function(){e.activity.set(e.normalizeActivityData({activated:!0}))})},deactivate:function(){var e=this,n={method:"DELETE",url:"/api/activation",data:{user_id:this.activity.presenter.get("id")}};return t.ajax(n).done(function(){e.activity.set(e.normalizeActivityData({activated:!1}))})},start:function(t){var e=this;void 0===t&&(t={}),this.subscriptions.length||(this.subscriptions=this.channels.map(function(t){var n=Object(a.a)(t,{host:u.a.get("firehose_url").toString(),ssl:u.a.get("firehose_ssl")});return n.on("message",l.bind(e)),n}))},stop:function(){this.subscriptions.forEach(function(t){return t.unsubscribe()}),this.subscriptions=[]},normalizeActivityData:function(t){var e=this;void 0===t&&(t={}),"shared_key"in t&&(t.permalink=t.shared_key),"activated"in t&&(t.current=t.activated,t.presenter=Object.assign({},t.presenter,{active:t.activated})),!t.owner_id&&t.presenter&&t.presenter.id&&(t.owner_id=t.presenter.id,t.owner_login=t.presenter.login,t.owner_name=t.presenter.name,t.owner={id:t.presenter.id});var n=t.type||this.activity.type();return/multiple|ranking|clickable/i.test(n)&&(t=function(t){void 0===t&&(t={});var e=[];if(this.activity.mcpOptions?e=this.activity.mcpOptions.map(function(t){return t.attributes}):this.activity.regions&&(e=this.activity.regions.map(function(t){return t.attributes})),t.options){t.options=t.options.map(function(t){return t.attributes||t});var n=c(t.options,e);t.options=c(n,t.options)}if(t.results){t.results.forEach(function(t){t.option_id&&(t.id=t.option_id,delete t.option_id)});var i=t.options||e;t.options=c(i,t.results),delete t.results}return t.clicks&&(t.results=t.clicks,delete t.clicks),t}.call(this,t)),t.poll_instances&&(t.polls=t.poll_instances,delete t.poll_instances,t.polls.forEach(function(t){return e.normalizeActivityData(t)})),t}};e.b=function(t){return Object.defineProperties(t,{subscriptions:{writable:!0,value:[]},activity:{get:function(){return this._activity},set:function(t){if(!t)throw new Error(this.type+" instance activity must be defined.");var e=t.get("shared_key")||t.get("permalink");e&&(t.set("shared_key",e),t.has(this.idAttribute)||t.set(this.idAttribute,e)),t.instance=this,this._activity=t}}}),p}}).call(this,n(278))},400:function(t,e,n){"use strict";(function(t){var i=n(277),r=n.n(i),o=n(83),s=n.n(o),a=["help","aide","info","ping","start","stop","arret","quit","cancel","unsubscribe","unsub","done","end","certify","certified","session","leave","results","22333","37607"],u=["true","false","yes","no","other","keyword","code","what","the","cast","vote"];function c(t,e){return null!=t?e(t):void 0}e.a=function(e){return{initKeyword:function(){e.initialKeyword=c(e.get("keyword"),function(t){return t.toLowerCase()})},resetKeyword:function(t){return e.set(t),e.initKeyword()},isAutoKeyword:function(){return e.isBlankKeyword()||"Auto Keyword"===e.get("keyword")||!!e.get("auto_keyword")},isBlankKeyword:function(){return void 0===e.get("keyword")||""===e.get("keyword")},isSystemKeyword:function(){var t;return!!(t=e.get("keyword"))&&r.a.contains(a,t.toLowerCase())},isCommonSessionKeyword:function(){var t;return!!(t=e.get("keyword"))&&r.a.contains(u,t.toLowerCase())},checkKeywordAvailability:function(){var n=s.a.Deferred(),i=c(e.get("keyword"),function(t){return t.toLowerCase()});return e.initialKeyword===i?n.resolve(!0):t.ajax({url:"/keywords/"+i+"/status"}).done(function(t){var e="available"===(null!=t.keyword?t.keyword.state:void 0);return n.resolve(e,null!=t.keyword?t.keyword.message:void 0,null!=t.keyword?t.keyword.poll_permalink:void 0)}).fail(function(t){return n.reject(t.message)}),n.promise()},validateKeyword:function(t){return null==t&&(t={}),r.a.defaults(t,{allowBlank:!0,sessionKeyword:!1}),!t.allowBlank&&e.isBlankKeyword()?"Keyword cannot be blank":!t.sessionKeyword&&e.isCommonSessionKeyword()?"This is a system keyword":e.isSystemKeyword()?"This is a system keyword":void 0},isKeywordAlphaNumeric:function(){return/[a-zA-Z]/.test(e.get("keyword"))}}}}).call(this,n(278))},401:function(t,e,n){"use strict";var i=n(290),r=n(279),o=n(277),s=n.n(o);function a(t,e){return null!=t?e(t):void 0}e.a=function(t){return{isImage:function(){var e=t.attributes.value;return e&&r.c.test(e)},isImageProxyImage:function(){return t.get("value").match(r.d)},imageUrl:function(e){return s.a.isString(e)&&(e={}),t.isImage()?(e||(e={}),e.width&&(e.w=e.width,delete e.width),e.height&&(e.h=e.height,delete e.height),s.a.defaults(e,{w:300,h:150}),Object(r.v)(t.get("value"),e).toString()):null},isLatex:function(){var e=t.attributes.value;return e&&i.a.isLatex(e)},latexEquation:function(){return t.isLatex()?i.a.getText(t.get("value")):""},isText:function(){return!(t.isImage()||t.isLatex())},isClickableRegion:function(){return a(a(t.get("value"),function(t){return t.match(r.a)}),function(t){return t.length})>3},relativeX:function(){if(null==t.regionMatches&&(t.regionMatches=a(t.get("value"),function(t){return t.match(r.a)})),(null!=t.regionMatches?t.regionMatches.length:void 0)>1)return parseFloat(t.regionMatches[1])},relativeY:function(){if(null==t.regionMatches&&(t.regionMatches=a(t.get("value"),function(t){return t.match(r.a)})),(null!=t.regionMatches?t.regionMatches.length:void 0)>2)return parseFloat(t.regionMatches[2])}}}},402:function(t,e,n){"use strict";var i=n(277),r=n.n(i);e.a=function(t){return{fullName:function(t){null==t&&(t={});var e,n=r.a.compact([this.get("first_name"),this.get("last_name")]);return n.length?(1===n.length?e="":(e=t.delimeter||" ",t.reverse&&n.reverse()),n.join(e)):this.get("email")||"Unregistered"}}}},403:function(t,e,n){"use strict";n.d(e,"a",function(){return h});var i=n(275),r=n.n(i),o=n(285),s=n(404),a=n(83),u=n.n(a),c=n(281),l=n.n(c),h=function(t){function e(){return t.apply(this,arguments)||this}r()(e,t);var n=e.prototype;return n.initialize=function(t){var e=this;return this.registrationInfo=new s.a(t),this.on("change:login",function(t,n){return e.updateLogin(n)})},n.url=function(){return l()("/api/users").segment(this.get("login")).toString()},n.updateLogin=function(t){return this.registrationInfo.clear(),this.registrationInfo.set({login:t})},n.fetch=function(e){return void 0===e&&(e={}),this.updateLogin(this.get("login")),u.a.when(t.prototype.fetch.call(this,e),this.registrationInfo.fetch(e))},e}(o.a)},404:function(t,e,n){"use strict";var i=n(275),r=n.n(i),o=n(285),s=n(281),a=n.n(s),u=function(t){function e(){return t.apply(this,arguments)||this}r()(e,t);var n=e.prototype;return n.url=function(){return a()("/api/users").segment(this.get("login")).segment("registration_info").toString()},n.participationCost=function(){return parseFloat(this.get("participation_cost"))},n.needsToPay=function(){return this.participationCost()>0},n.isExistingParticipant=function(){return!!this.get("existing_participant")},n.participantSelfRegistration=function(){return!!this.get("participant_self_registration")},n.register=function(t){return null==t&&(t={}),this.save(t,{url:this.registerUrl()})},n.registerUrl=function(){return a()("register").setQuery("email",this.get("login")).toString()},e}(o.a);e.a=u},447:function(t,e,n){"use strict";var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(329),u=n.n(a),c=n(285),l=n(534),h=n.n(l),p=(n(535),n(398),n(397)),f=n.n(p),d=n(277),g=n.n(d);function v(t,e){v=function(t,e){return new o(t,e)};var n=f()(RegExp),i=RegExp.prototype,r=new WeakMap;function o(t,e){var i=n.call(this,t);return r.set(i,e),i}function s(t,n){var i=r.get(n);return Object.keys(e).reduce(function(e,n){return e[n]=t[i[n]],e},Object.create(null))}return h()(o,n),o.prototype.exec=function(t){var e=i.exec.call(this,t);return e&&(e.groups=s(e,this)),e},o.prototype[Symbol.replace]=function(t,e){if("string"==typeof e){var n=r.get(this);return i[Symbol.replace].call(this,t,e.replace(/\$<([^>]+)>/g,function(t,e){return"$"+n[e]}))}if("function"==typeof e){var o=this;return i[Symbol.replace].call(this,t,function(){var t=[];return t.push.apply(t,arguments),"object"!=typeof t[t.length-1]&&t.push(s(t,o)),e.apply(this,t)})}return i[Symbol.replace].call(this,t,e)},v.apply(this,arguments)}var y=v(/^rgba\s?\((?:\s?,?(\d{1,3})\s?,?)(?:\s?,?(\d{1,3})\s?,?)(?:\s?,?(\d{1,3})\s?,?)(?:\s?,?([\d.]+)\s?,?)\)$/i,{red:1,green:2,blue:3,alpha:4}),m=v(/^rgb\s?\((?:\s?,?(\d{1,3})\s?,?(?:\s?,?(\d{1,3})\s?,?))(?:\s?,?(\d{1,3})\s?,??)\)$/i,{red:1,green:2,blue:3}),_=/^#?(?:[0-9a-fA-F]{3}){1,2}$/i;function b(t,e){if(void 0===e&&(e=1),null!=t){if(y.test(t)){var n=t.match(y).groups;if(!n)return;return"rgba("+n.red+","+n.green+","+n.blue+","+e+")"}if(m.test(t))return w(t,e);if(_.test(t)){var i=k(t);if(!i)return;var r=x(i);if(!r)return;return"rgba("+r.red+","+r.green+","+r.blue+","+e+")"}var o=k(t);if(o){var s=x(o);if(s)return"rgba("+s.red+","+s.green+","+s.blue+","+e+")"}}}function w(t,e){if(void 0===e&&(e=1),m.test(t)){null==e&&(e=1);var n=t.match(m).groups;return"rgba("+n.red+","+n.green+","+n.blue+","+e+")"}}function k(t){return null==t?null:_.test(t)?"#"!==(t=t.toString(16)).charAt(0)?"#"+(t=("000000"+t).slice(-6)):t:Number.isNaN(Number(t))?null:"#"+(t="000000"+t.toString(16)).slice(-6)}function x(t){return"string"!=typeof t?null:(3===(t=t.replace(/^#/,"")).length&&(t=t.replace(/(.)/g,"$1$1")),6===t.length?{red:parseInt(t.substr(0,2),16),green:parseInt(t.substr(2,2),16),blue:parseInt(t.substr(4,2),16)}:null)}var O={RGBA_REGEXP:y,RGB_REGEXP:m,HEX_REGEXP:_,colorToRGBA:b,rgbToRgba:w,intToHex:k,hexToRgb:x,bestContrast:function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];var r=g()(n).max(function(e){return O.contrast(t,e)});return r===-1/0?void 0:r},contrast:function(t,e){var n=O.luminosity(t),i=O.luminosity(e);if(null!=n&&null!=i)return n>i?(n+.05)/(i+.05):(i+.05)/(n+.05)},luminosity:function(t){var e={};if(null==t&&(t={}),null!=t.red&&null!=t.green&&null!=t.blue)e=t;else if(y.test(t)){var n=t.match(y).groups;n&&(e={red:n.red,green:n.green,blue:n.blue})}else if(m.test(t)){var i=t.match(m).groups;i&&(e={red:i.red,green:i.green,blue:i.blue})}else e=O.hexToRgb(t);if(e){var r=e,o=r.red,s=r.green,a=r.blue;return.2126*(o=O.linearise(o))+.7152*(s=O.linearise(s))+.0722*(a=O.linearise(a))}},linearise:function(t,e){return null==e&&(e=255),Math.pow(t/e,2.2)}},S=O,j=n(281),C=n.n(j);n.d(e,"a",function(){return N});var T={bgColor:"background_color",bgPrimaryTextColor:"background_primary_text_color",bgSecondaryTextColor:"background_secondary_text_color",butterflyChartLeft:"butterfly_chart_left_color",butterflyChartRight:"butterfly_chart_right_color",chartBarColor:"chart_bar_color",chartKeywordColor:"chart_keyword_color",chartPrimaryTextColor:"chart_primary_text_color",clicksReceivedBoxColor:"clicks_received_box_color",clicksReceivedTextColor:"clicks_received_text_color",colorSchemeBaseColor:"colorscheme_base_color",colorSchemeLightSecondaryBgColor:"colorscheme_light_secondary_background_color",colorSchemePrimaryBgColor:"colorscheme_primary_background_color",colorSchemePrimaryTextColor:"colorscheme_primary_text_color",colorSchemeSecondaryBgColor:"colorscheme_secondary_background_color",colorSchemeSecondaryTextColor:"colorscheme_secondary_text_color",headerBGColorBottom:"header_bottom_background_color",headerInstructionColor:"header_instruction_color",headerTitleColor:"header_title_color",headerBGColorTop:"header_top_background_color",heatMapLongBarColor:"heatmap_long_bar_color",heatMapShortBarColor:"heatmap_short_bar_color",messageBGColor:"message_background_color",pinnedMessageBG:"pinned_messaged_background_color"},R=[{oldKey:"teamBarColors",newKey:"team_bar_colors"}],A=[{newKey:"keyword_scale",oldKey:"chartKeywordScale",scale:[.3,2.5]},{newKey:"label_scale",oldKey:"chartLabelScale",scale:[.3,2.5]},{newKey:"voting_instructions_scale",oldKey:"headerInstructionScale",scale:[1,1.45]},{newKey:"title_scale",oldKey:"headerScale",scale:[.4,3]},{newKey:"message_scale",oldKey:"messageScale",scale:[.4,3]}];function E(t){return t=t||{},t=JSON.parse(JSON.stringify(t,function(t,e){return void 0===e?null:e})),g.a.intersection(Object.keys(T),Object.keys(t)).forEach(function(e){t[T[e]]=b(t[e])}),g.a.intersection(Object.values(T),Object.keys(t)).forEach(function(e){t[e]=b(t[e])}),t}function P(t){t=t||{},t=JSON.parse(JSON.stringify(t,function(t,e){return void 0===e?null:e}));var e=[].concat(u()(Object.keys(T)),u()(A.map(function(t){return t.oldKey})),u()(R.map(function(t){return t.oldKey})));return g.a.intersection(e,Object.keys(t)).forEach(function(e){delete t[e]}),t}var N=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.url=function(){return C()("/polls").segment(this.poll.permalink()).segment("flash_options.json").toString()},n.isNew=function(){return!1},n.isSegmented=function(){return this.has("chartType")&&0===this.get("chartType").indexOf("team")},n.showingCorrectness=function(){return this.get("showTeamCorrectness")},n.toggleCorrectness=function(t){void 0===t&&(t={}),g.a.extend(t,{patch:!0});var e={showTeamCorrectness:!this.get("showTeamCorrectness")};return this.save({flash_options:e},t)},n.toJSON=function(e){void 0===e&&(e={}),g.a.defaults(e,{root:!0});var n=P(E(t.prototype.toJSON.apply(this,arguments)));return e.root?{flash_options:n}:n},n.setChartType=function(t){var e=this.isSegmented();(t=t.toLowerCase()).match(/bar/i)?this.set({chartType:e?"teamBar":"bar"}):t.match(/col/i)?this.set({chartType:e?"teamCol":"col"}):t.match(/donut/i)?this.set({chartType:t}):console&&console.warn&&console.warn("'"+t+"' isn't a valid chart type")},n.enableSegmentation=function(){this.get("chartType").match(/bar/i)?this.set({chartType:"teamBar"}):this.get("chartType").match(/col/i)&&this.set({chartType:"teamCol"})},n.disableSegmentation=function(){this.set({chartType:this.get("chartType").replace("team","").toLowerCase()})},n.getColorRGBA=function(t,e){return void 0===e&&(e=1),b(this.get(t),e)},n.getColorHex=function(t){return S.intToHex(this.get(t))},n.getColorARGB=function(t,e){var n;return void 0===e&&(e=1),(n=S.intToHex(this.get(t)))?"#"+(e=Math.floor(255*e).toString(16))+n.slice(1):void 0},n.set=function(e,n,i){if(!e)return this;var r={};return"object"==typeof e?(r=e,i=i||n):(r={})[e]=n,i||(i={}),r=P(E(r)),t.prototype.set.call(this,r,i)},n.parse=function(t){return t&&(g.a.isUndefined(t.headerLogoPlacement)||t.headerLogoPlacement||(t.headerLogoPlacement="center"),t=P(E(t))),t},n.processLiveResponse=function(t){var e=this;void 0===t&&(t={}),this.throttledUpdate||(this.throttledUpdate=g.a.throttle(function(t){e.isSaving||e.set(t)},1e3)),t.flash_options&&this.poll&&!this.poll.displayPanel&&this.throttledUpdate(t.flash_options)},r()(e,[{key:"defaults",get:function(){return{segmentationSizedByPercentage:!0}}}]),e}(c.a)},529:function(t,e,n){"use strict";n.d(e,"a",function(){return i}),n.d(e,"b",function(){return r});var i=["able","action","active","actual","adept","adored","adroit","affectionate","agile","airy","alert","alive","alter","amiable","ample","and","anima","apt","ardent","are","astute","august","avid","awake","aware","balmy","benevolent","big","billowing","blessed","bold","boss","brainy","brave","brawny","breezy","brief","bright","brisk","busy","calm","can","canny","cared","caring","casual","celestial","charming","chic","chief","choice","chosen","chummy","civic","civil","classy","clean","clear","clever","close","cogent","composed","cool","cosmic","cozy","cuddly","cute","dainty","dandy","dapper","daring","dear","decent","deep","deft","deluxe","devout","direct","divine","doted","doting","dreamy","driven","dry","earthy","easy","elated","energized","enigmatic","equal","exact","exotic","expert","exuberant","fair","famed","famous","fancy","fast","fiery","fine","fit","flashy","fleek","fleet","flowing","fluent","fluffy","fluttering","flying","fond","frank","free","fresh","full","fun","funny","fuscia","genial","gentle","giddy","gifted","giving","glad","gnarly","gold","golden","good","goodly","graceful","grand","great","green","groovy","guided","gutsy","haloed","happy","hardy","harmonious","hearty","heroic","high","hip","hollow","holy","honest","huge","humane","humble","hunky","icy","ideal","immune","indigo","inquisitive","jazzed","jazzy","jolly","jovial","joyful","joyous","jubilant","juicy","just","keen","khaki","kind","kingly","large","lavish","lawful","left","legal","legit","light","like","liked","likely","limber","limitless","lively","loved","lovely","loyal","lucid","lucky","lush","main","major","master","mature","max","maxed","mellow","merciful","merry","mighty","mint","mirthful","modern","modest","money","moonlit","moral","moving","mucho","mutual","mysterious","native","natural","near","neat","needed","new","nice","nifty","nimble","noble","normal","noted","novel","okay","open","outrageous","overt","pacific","parched","peachy","peppy","pithy","placid","pleasant","plucky","plum","poetic","poised","polite","posh","potent","pretty","prime","primo","prized","pro","prompt","proper","proud","pumped","punchy","pure","purring","quaint","quick","quiet","rad","radioactive","rapid","rare","ready","real","regal","resilient","rich","right","robust","rooted","rosy","rugged","safe","sassy","saucy","savvy","scenic","secret","seemly","serene","sharp","showy","shrewd","simple","sleek","slick","smart","smiley","smooth","snappy","snazzy","snowy","snugly","social","sole","solitary","sound","spacial","spicy","spiffy","spry","stable","star","stark","steady","stoic","strong","stunning","sturdy","suave","subtle","sunny","sunset","super","superb","sure","swank","sweet","swell","swift","talented","teal","the","thriving","tidy","timely","top","tops","tough","touted","tranquil","trim","tropical","true","trusty","undisturbed","unique","united","unsightly","unwavering","upbeat","uplifting","urbane","usable","useful","utmost","valid","vast","vestal","viable","vital","vivid","vocal","vogue","voiceless","volant","wandering","wanted","warm","wealthy","whispering","whole","winged","wired","wise","witty","wooden","worthy","zealous"],r=["abyss","animal","apple","atoll","aurora","autumn","bacon","badlands","ball","banana","bath","beach","bear","bed","bee","bike","bird","boat","book","bowl","branch","bread","breeze","briars","brook","brush","bunny","candy","canopy","canyon","car","cat","cave","cavern","cereal","chair","chasm","chip","cliff","coal","coast","cookie","cove","cow","crater","creek","darkness","dawn","desert","dew","dog","door","dove","drylands","duck","dusk","earth","fall","farm","fern","field","firefly","fish","fjord","flood","flower","flowers","fog","foliage","forest","freeze","frog","fu","galaxy","garden","geyser","gift","glass","grove","guide","guru","hat","hug","hero","hill","horse","house","hurricane","ice","iceberg","island","juice","lagoon","lake","land","lawn","leaf","leaves","light","lion","marsh","meadow","milk","mist","moon","moss","mountain","mouse","nature","oasis","ocean","pants","peak","pebble","pine","pilot","plane","planet","plant","plateau","pond","prize","rabbit","rain","range","reef","reserve","resonance","river","rock","sage","salute","sanctuary","sand","sands","shark","shelter","shirt","shoe","silence","sky","smokescreen","snowflake","socks","soil","soul","soup","sparrow","spoon","spring","star","stone","storm","stream","summer","summit","sun","sunrise","sunset","sunshine","surf","swamp","table","teacher","temple","thorns","tiger","tigers","towel","train","tree","truck","tsunami","tundra","valley","volcano","water","waterfall","waves","wild","willow","window","winds","winter","zebra"]},530:function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return c});var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(293),u=n(304),c=function(e){function n(){return e.apply(this,arguments)||this}s()(n,e);var i=n.prototype;return i.preinitialize=function(){this.comparator="position"},i.initialize=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.group_id=e.group_id,this.user_id=e.user_id},i.fetch=function(n){return void 0===n&&(n={}),t.defaults(n,{data:{}}),t.defaults(n.data,{group_id:this.group_id,user_id:this.user_id}),e.prototype.fetch.call(this,n)},i.model=function(t,e){return Object(u.a)(t,e)},i.modelId=function(t){void 0===t&&(t={});var e=t,n=e.id,i=e.type;return n&&i?i+"_"+n:null},i.get=function(t,n){return null!=n?this.findWhere({type:n,id:t}):e.prototype.get.apply(this,arguments)},r()(n,[{key:"url",get:function(){return"/api/activities"}}]),n}(a.a)}).call(this,n(277))},533:function(t,e,n){"use strict";n.d(e,"a",function(){return p});var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(277),u=n.n(a),c=n(278),l=n.n(c),h=n(399),p=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.initialize=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),u.a.extend(this,Object(h.b)(this)),this.activity=e.activity,this.parse(this.activity.attributes)},n.parse=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),h.a.parseActivity.call(this,t,e),{}},r()(e,[{key:"idAttribute",get:function(){return h.a.getIdAttribute.call(this)}},{key:"urlRoot",get:function(){return h.a.getUrlRoot.call(this)}},{key:"type",get:function(){return"participant"}},{key:"channels",get:function(){return h.a.requireAttrs(this.activity.attributes,["shared_key","participant_key"]),[h.a.getInstanceChannelPath.call(this),h.a.getActivityChannelPath.call(this)]}}]),e}(l.a.Model)},537:function(t,e,n){"use strict";(function(t,i){n.d(e,"a",function(){return p});var r=n(276),o=n.n(r),s=n(275),a=n.n(s),u=n(281),c=n.n(u),l=n(279),h=n(538),p=function(t){function e(){return t.apply(this,arguments)||this}a()(e,t);var n=e.prototype;return n.initialize=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.options=i.defaults(e,{participantId:null,competition:null,contextSize:3,screenNamesEnabled:!0})},n.isScreenNamesEnabled=function(){return this.options.screenNamesEnabled},n.getCompetitionId=function(){return this.competition&&this.competition.get("shared_key")},n.getContextSize=function(){return this.options.contextSize},n.fetchParticipantScore=function(){return this.fetch()},n.fetchParticipantContext=function(){return this.fetch({data:{context:this.getContextSize()}})},n.getParticipantId=function(){return this.options.participantId},n.getParticipantScore=function(){return this.get(this.getParticipantId())},n.generateScreenName=function(t){void 0===t&&(t=this.getParticipantId());var e=String(this.getCompetitionId())+String(t),n=Object(l.m)(e,{wordCount:3});return Object(l.g)(n,{delimit:" "})},o()(e,[{key:"model",get:function(){return h.a},set:function(t){}},{key:"competition",get:function(){return this.options.competition}},{key:"url",get:function(){if(!this.competition)throw new Error("Competition is required to fetch leaderboard data.");return c()(this.competition.instance.url()).segment("leaderboard").toString()}},{key:"screenNamesEnabled",get:function(){return this.options.screenNamesEnabled},set:function(t){this.options.screenNamesEnabled=t}}]),e}(t.Collection)}).call(this,n(278),n(277))},538:function(t,e,n){"use strict";(function(t){n.d(e,"a",function(){return a});var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.answered=function(t){return!!t&&t in this.get("score_breakdown")},n.answeredCorrect=function(t){return!!t&&this.scoreFor(t)>0},n.scoreFor=function(t){return t&&this.get("score_breakdown")[t]||0},n.scoreWithout=function(t){return t?this.totalScore()-this.scoreFor(t):this.totalScore()},n.totalScore=function(){return this.get("score")||0},n.screenName=function(){return!this.collection||this.collection.screenNamesEnabled?this.get("screen_name"):this.collection.generateScreenName(this.id)},r()(e,[{key:"defaults",get:function(){return{abbreviation:"?",rank:0,score:0,score_breakdown:{},screen_name:"Unknown"}}}]),e}(t.Model)}).call(this,n(278))},556:function(t,e,n){"use strict";var i=n(275),r=n.n(i),o=function(t){function e(){return t.apply(this,arguments)||this}return r()(e,t),e.prototype.url=function(){return"/vote.json"},e}(n(285).a);e.a=o},719:function(t,e,n){"use strict";n.d(e,"a",function(){return g});var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(278),u=n.n(a),c=n(277),l=n.n(c),h=n(281),p=n.n(h),f={created:"create",queued:"queue",working:"inprogress",completed:"complete",failed:"fail"};function d(){return clearTimeout(this.timeoutId),delete this.timeoutId}var g=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.initialize=function(t){void 0===t&&(t={}),l.a.defaults(t,{pollingInterval:5});var e=parseInt(t.pollingInterval);if(isNaN(e))throw new Error("`options.pollingInterval` must be a number.");this.pollingInterval=e,this.stopChecking(),this.promise=new Promise(function(t,e){this.on("complete",t),this.on("fail error",e)}.bind(this)),this.on("change:status",function(){var t=this.get("status"),e=f[t];switch(t){case"completed":case"failed":this.stopChecking(),this.trigger(e,this.get("data"));break;default:this.trigger(e,this)}}.bind(this))},n.status=function(){return this.get("status")},n.startChecking=function(){return this.isPolling=!0,this.timeoutId||function t(e){var n=this;null==e&&(e=1e3*this.pollingInterval);var i=function(){return n.isPolling?n.fetch().done(function(){return t.call(n)}).fail(function(t){return d.call(n),n.trigger("error",n,t)}):d.call(n)};if(!(e>0))return i.call(this);this.timeoutId=setTimeout(i.bind(this),e)}.call(this,0),this},n.stopChecking=function(){return this.isPolling=!1,this},e.create=function(t,n){var i=new e;return i.save(n,{url:t}).then(function(t){i.set({uuid:p()(t.job_url).segment(-1)}),i.pollingInterval=1,i.startChecking()}).catch(function(t,e,n){i.trigger("fail",n)}),i},r()(e,[{key:"urlRoot",get:function(){return"/api/jobs"}},{key:"defaults",get:function(){return{status:"pending"}}},{key:"idAttribute",get:function(){return"uuid"}}]),e}(u.a.Model)},829:function(t,e,n){"use strict";var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(277),u=n.n(a),c=n(278),l=n.n(c),h=n(399),p=n(281),f=n.n(p),d=n(303),g=n.n(d),v=function(t){function e(){return t.apply(this,arguments)||this}return s()(e,t),e.prototype.localeName=function(t){if(!this.get("created_at"))return this.get("name");var e=new g.a(this.get("created_at"));try{return e.toLocaleDateString("en-US",{timeZone:t})+" "+e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",timeZone:t,timeZoneName:"short"})}catch(t){return e.toDateString()+" "+e.toTimeString({hour:"2-digit",minute:"2-digit"})}},e}(l.a.Model),y=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.initialize=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.options=Object.assign({},e)},n.url=function(){if(!this.activity)throw new Error("Activity must be provided");return f()(this.activity.instance.url()).segment("archives").toString()},r()(e,[{key:"model",get:function(){return v}},{key:"comparator",get:function(){return"id"}},{key:"activity",get:function(){return this.options.activity}}]),e}(l.a.Collection),m=function(t){function e(){return t.apply(this,arguments)||this}return s()(e,t),r()(e,[{key:"idAttribute",get:function(){return"presenter_key"}}]),e}(l.a.Model),_=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.initialize=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this.options=Object.assign({},e)},n.url=function(){if(!this.activity)throw new Error("Activity must be provided");return f()(this.activity.instance.url()).segment("comparisons").toString()},r()(e,[{key:"model",get:function(){return m}},{key:"activity",get:function(){return this.options.activity}}]),e}(l.a.Collection);function b(t,e,n){void 0===n&&(n={}),!1!==n.resetOptions&&x.call(this)}function w(t,e){if(void 0===e&&(e={}),!(t instanceof y)){var n={};t.has("options")&&(n.options=t.get("options")),t.has("results")&&(n.results=t.get("results")),this.parse(n),x.call(this,t)}}function k(t,e){void 0===e&&(e={}),t instanceof _||this.parse(e)}function x(t){void 0===t&&(t=null),this._currentArchive=t}n.d(e,"a",function(){return O});var O=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.initialize=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),u.a.extend(this,Object(h.b)(this)),this.activity=e.activity,this.parse(this.activity.attributes)},n.parse=function(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),h.a.parseActivity.call(this,t,e),{}},r()(e,[{key:"idAttribute",get:function(){return h.a.getIdAttribute.call(this)}},{key:"urlRoot",get:function(){return h.a.getUrlRoot.call(this)}},{key:"type",get:function(){return"presenter"}},{key:"channels",get:function(){h.a.requireAttrs(this.activity.attributes,["shared_key","presenter_key"]);var t=h.a.getInstanceChannelPath.call(this),e=h.a.getInstanceChannelPath.call(this,"results");return[t,h.a.getActivityChannelPath.call(this),e]}},{key:"archives",get:function(){return this._archives&&this._archives.activity===this.activity||(this._archives=new y([],{activity:this.activity}),this.listenTo(this._archives,"sync",w),this.listenTo(this,"sync",b),this.listenTo(this.activity,"sync",b)),this._archives}},{key:"comparisons",get:function(){return!/multiple/.test(this.activity.type())||this._comparisons&&this._comparisons.activity===this.activity||(this._comparisons=new _([],{activity:this.activity}),this.listenTo(this._comparisons,"sync",k)),this._comparisons}},{key:"currentArchive",get:function(){return this._currentArchive}}]),e}(l.a.Model)},830:function(t,e,n){"use strict";var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(285),u=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.urlRoot=function(){return"/api/participant_groups"},n.isUngrouped=function(){return 0===this.id},n.inviteUrl=function(){return this.get("invite_url")},n.assign=function(t){var e,n=this;if("all"===t?e="all":(e=[],t.each(function(t){t.groupIds().includes(n.id)||(e.push(t.id),t.get("groups").add(n))})),e.length){var i={participants:{add:e}};this.save(i,{patch:!0})}},n.unassign=function(t){var e,n=this;if("all"===t?e="all":(e=[],t.each(function(t){if(t.groupIds().includes(n.id)){e.push(t.id);var i=t.get("groups"),r=i.get(n);return i.remove(r)}})),e.length){var i={participants:{remove:e}};this.save(i,{patch:!0})}},e}(a.a),c=n(293),l=n(277),h=n.n(l),p=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.url=function(){return"/api/participant_groups"},n.anyMatchChecked=function(t){var e=t.pluck("id");return e.length||e.push(0),h.a.intersection(this.checkedIds(),e).length>0},n.onlyUngrouped=function(){return this.all(function(t){return t.isUngrouped()})},n.lastId=function(){var t=this.max(function(t){return t.id});return(null!=t?t.id:void 0)||1},n.checked=function(){return this.where({checked:!0})},n.allChecked=function(){return this.checked().length===this.length},n.checkedIds=function(){return h.a.pluck(this.checked(),"id")},n.anyChecked=function(){return this.checked().length>0},n.next=function(t){var e=this.indexOf(t);return this.at(e+1)},n.previous=function(t){var e=this.indexOf(t);if(0!==e)return this.at(e-1)},r()(e,[{key:"model",get:function(){return u}}]),e}(c.a),f=n(402),d=n(303),g=n.n(d);n.d(e,"a",function(){return v});var v=function(t){function e(){return t.apply(this,arguments)||this}s()(e,t);var n=e.prototype;return n.initialize=function(){return t.prototype.initialize.apply(this,arguments),this.include(f.a)},n.urlRoot=function(){return"/api/participants"},n.groupIds=function(){var t=this.get("groups").pluck("id");return t.length||t.push(0),t},n.assignedTo=function(t){return this.get("groups").get(t)},n.formattedRegisteredOn=function(){return g()(this.get("created_at")).toString("MM/dd/yyyy")},n.byLastName=function(){return this.fullName({reverse:!0,delimeter:", "})},n.parse=function(e){return e.groups=new p(e.groups),t.prototype.parse.apply(this,arguments)},n.assignToGroup=function(t){var e=new u({id:t});return this.get("groups").add(e),this.sync("create",this,{processData:!0,data:{participant_group_id:t,participant_id:this.id},url:"/api/participant_participant_groups"})},n.removeFromGroup=function(t){this.sync("delete",this,{processData:!0,data:{participant_group_id:t,participant_id:this.id},url:"/api/participant_participant_groups/-1"});var e=new u({id:t});return this.get("groups").remove(e)},r()(e,[{key:"defaults",get:function(){return{checked:!1,groups:new p([])}}}]),e}(a.a)},831:function(t,e,n){"use strict";var i=n(276),r=n.n(i),o=n(275),s=n.n(o),a=n(285),u=n(283),c=function(){var t={requestHeaders:["Accept","Content-Type"],requestMethods:["GET"],requestContentTypes:["application/x-www-form-urlencoded","multipart/form-data","text/plain"],requestPaths:[]},e={warn:function(t){window.console&&window.console.warn&&window.console.warn(t)},absolutifyURL:function(t,e){null!=e&&e.match(/^https/)&&!t.match(/^https/)&&(t=t.replace("http","https"));var n=document.createElement("a");return n.setAttribute("href",t),n.href},on:function(t,e,n){t.attachEvent?t.attachEvent("on"+e,n):t.addEventListener(e,n,!1)},off:function(t,e,n){t.detachEvent?t.detachEvent("on"+e,n):t.removeEventListener(e,n,!1)},encode:function(t){var e=[];for(var n in t)e.push(n+"="+encodeURIComponent(t[n]));return e.join("&")},decode:function(t){return e.parseUri("?"+t).queryKey},isSameOrigin:function(t,n){return t=e.parseUri(t),n=e.parseUri(n),t.protocol==n.protocol&&t.authority==n.authority},map:function(t,e){for(var n=[],i=0;i<t.length;i++)n.push(e(t[i]));return n},trim:function(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},parseUri:function(t){for(var n=e.parseUriOptions,i=n.parser[n.strictMode?"strict":"loose"].exec(t),r={},o=14;o--;)r[n.key[o]]=i[o]||"";return r[n.q.name]={},r[n.key[12]].replace(n.q.parser,function(t,e,i){e&&(r[n.q.name][e]=decodeURIComponent(i))}),r},parseUriOptions:{strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},inArray:function(t,e,n){var i,r=Array.prototype.indexOf;if(e){if(r)return r.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},getInternetExplorerVersion:function(){var t=-1;if("Microsoft Internet Explorer"==navigator.appName){var e=navigator.userAgent;null!=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})").exec(e)&&(t=parseFloat(RegExp.$1))}return t}};function n(t,n,i){function r(){return t.postMessage?t:t.contentWindow}var o={onMessage:n,onError:i||function(t){window.console&&window.console.error&&window.console.error(t)},destroy:function(){e.off(window,"message",s),t=null,n=null},send:function(t){r().postMessage(e.encode(t),"*")},error:function(t){r().postMessage(e.encode({__simpleChannelError:t}),"*")}};function s(t){if(t.source==r()){var n=e.decode(t.data);"__simpleChannelError"in n?o.onError(n.__simpleChannelError,t.origin):o.onMessage(n,t.origin)}}return e.on(window,"message",s),o}return{version:"0.1",utils:e,config:t,startServer:function(i,r){i=i||{},void 0!==(r=r||{}).requestHeaders&&(t.requestHeaders=t.requestHeaders.concat(r.requestHeaders)),void 0!==r.requestMethods&&(t.requestMethods=t.requestMethods.concat(r.requestMethods)),void 0!==r.requestContentTypes&&(t.requestContentTypes=t.requestContentTypes.concat(r.requestContentTypes)),void 0!==r.requestPaths&&(t.requestPaths=t.requestPaths.concat(r.requestPaths));var o=n(i.window||window.parent,function(n,r){if("send"==n.cmd){var s=new XMLHttpRequest;if(n.origin=r,n.headers=e.decode(n.headers),s.data=n,!e.isSameOrigin(window.location.href,n.url))return void o.error("url does not have same origin: "+n.url);if(-1==e.inArray(n.method,t.requestMethods))return void o.error("not a simple request method: "+n.method);var a=e.parseUri(n.url).path;if(-1==e.inArray(a,t.requestPaths))return void o.error("not a permitted path: "+a+". By default no paths are permitted.");s.open(n.method,n.url),s.onreadystatechange=function(){var t=e.getInternetExplorerVersion();if(2==s.readyState&&!t||4==s.readyState&&t<9){var n=function(t){return{allowOrigin:t.getResponseHeader("Access-Control-Allow-Origin")}}(s);if(i.modifyAccessControl&&i.modifyAccessControl(n,s.data),!function(t,e,n){return e.allowOrigin?"*"==e.allowOrigin||t.origin==e.allowOrigin||void n.error("message from invalid origin: "+t.origin):(n.error("CORS is unsupported at that path."),!1)}(s.data,n,o))return void s.abort()}var r={cmd:"readystatechange",readyState:s.readyState};4==s.readyState&&(r.responseText=s.responseText,r.status=s.status,r.statusText=s.statusText,r.responseHeaders=s.getAllResponseHeaders()),o.send(r)};var u=n.headers["Content-Type"];if(u&&(u=u.split(";")[0]),u&&-1==e.inArray(u,t.requestContentTypes))return void o.error("invalid content type for a simple request: "+u);for(var c in n.headers)if(-1==e.inArray(c,t.requestHeaders)){if("X-Requested-With"!=c)return void o.error("header '"+c+"' is not allowed.")}else s.setRequestHeader(c,n.headers[c]);s.setRequestHeader("X-Origin",n.origin),s.send(n.body||null)}});o.send({cmd:"ready"})},buildClientConstructor:function(t){return function(){var i,r,o,s,a={},u="";function c(){o&&(o.destroy(),o=null),s&&(document.body.removeChild(s),s=null)}var l={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4,readyState:0,status:0,statusText:"",responseText:"",onabort:null,open:function(t,e){i=t,r=e,l.readyState=l.OPENED,l.onreadystatechange&&l.onreadystatechange()},setRequestHeader:function(t,e){a[t]=e},getAllResponseHeaders:function(){return u},abort:function(){s&&(c(),l.readyState=l.DONE,l.onreadystatechange&&l.onreadystatechange(),l.readyState=l.UNSENT,l.onabort&&l.onabort())},send:function(h){if(l.readyState==l.UNSENT)throw new Error("request not initialized");s=document.createElement("iframe"),o=n(s,function(t){switch(t.cmd){case"ready":o.send({cmd:"send",method:i,url:e.absolutifyURL(r),headers:e.encode(a),body:h||""});break;case"readystatechange":l.readyState=parseInt(t.readyState),l.status=parseInt(t.status),l.statusText=t.statusText,l.responseText=t.responseText,u=t.responseHeaders,l.onreadystatechange&&l.onreadystatechange(),4==l.readyState&&(c(),l.onload&&l.onload())}},function(t){e.warn(t),l.responseText=t,l.readyState=l.DONE,c(),l.onreadystatechange&&l.onreadystatechange()}),s.setAttribute("src",e.absolutifyURL(t,r)),s.style.display="none",document.body.appendChild(s)}};return l}}}}(),l=n(281),h=n.n(l),p=n(278),f=n.n(p),d=n(83),g=n.n(d),v=function(){function t(t){this.token=t}r()(t,[{key:"url",get:function(){return"/api/participant_auth_token"}},{key:"logoutUrl",get:function(){return"/api/participant_auth_token/logout"}}]);var e=t.prototype;return e.authenticate=function(){var t=this,e=g.a.Deferred();return this.getCachedOrNewToken().then(function(n){t.post(n).then(e.resolve,e.reject)}).fail(e.reject),e.promise()},e.getCachedOrNewToken=function(){var t=g.a.Deferred();return null!=this.token?t.resolve({token:this.token}):this.get().then(t.resolve,t.reject),t.promise()},e.logout=function(){return this.get(this.logoutUrl)},e.ppxClient=function(){if(this._ppxClient)return this._ppxClient;var t=u.a.get("api_url").path("/ppx_proxy");return this._ppxClient=c.buildClientConstructor(t.toString()),this._ppxClient},e.post=function(t){return f.a.ajax({dataType:"json",method:"POST",url:this.url,data:t})},e.get=function(t){return t||(t=this.url),g.a.ajax({dataType:"json",url:h()(t).absoluteTo(u.a.get("api_url").toString()).toString(),xhr:this.ppxClient()})},t}(),y=n(277),m=n.n(y);n.d(e,"a",function(){return _});var _=function(t){function e(e,n){var i;return(i=t.apply(this,arguments)||this).user=e,i.participant=n,i}s()(e,t),r()(e,[{key:"url",get:function(){return"/api/sessions"}}]);var n=e.prototype;return n.authenticate=function(t,e){var n={login:t,password:e};return this.authEvents(this.sync("create",this,{url:this.url,attrs:n}))},n.destroy=function(){var t,e=this;t=u.a.get("token_auth_enabled")?this.authToken().logout():g.a.when();var n=this.stopped();return this.sync("delete",this,null).done(function(){return e.user.clear(),e.participant.clear(),e._started=null,e.trigger("session:stopped"),n.resolve()}),g.a.when(n,t)},n.configure=function(t,e){return this.user.set(t,{parse:!0}),this.participant.set(e,{parse:!0}),this._stopped=null,this.trigger("session:started")},n.startWithProfile=function(t,e){var n=this;void 0===e&&(e={});var i=this.started(),r=u.a.get("token_auth_enabled")||null!=this.authToken().token;return!e.skipAuthToken&&m.a.isEmpty(t.user)&&r?this.authenticateWithToken().fail(function(){return n.configure(t.user,t.participant)}).always(function(){return i.resolve()}):(this.configure(t.user,t.participant),i.resolve()),i},n.start=function(t){var e=this;void 0===t&&(t={});var n=this.started();return this.loadProfile().done(function(i){e.startWithProfile(i,t).then(n.resolve).fail(n.reject)}).fail(n.reject),n},n.started=function(){return this._started||(this._started=g.a.Deferred())},n.stopped=function(){return this._stopped||(this._stopped=g.a.Deferred())},n.loadProfile=function(){var t=this,e=0;return g.a.Deferred(function n(i){return t.sync("read",t,{url:"/api/profile"}).fail(function(t){return!t.status&&e<3?(e+=1,setTimeout(function(){return n(i)},2e3*e)):i.reject.apply(this,arguments)}).then(function(){return i.resolve.apply(this,arguments)})})},n.authenticateWithToken=function(){return this.authEvents(this.authToken().authenticate())},n.authToken=function(){return this._authToken||(this._authToken=new v)},n.authEvents=function(t){var e=this,n=g.a.Deferred();return t.fail(function(t){return e.trigger("authentication:fail",t),n.reject(t)}).done(function(){return e.trigger("authentication:success"),e.loadProfile().done(function(t){return e.configure(t.user,t.participant),n.resolve(t)})}),n.promise()},e}(a.a)},832:function(t,e,n){"use strict";var i=n(275),r=n.n(i),o=n(278),s=n.n(o),a=n(277),u=n.n(a),c=function(t){function e(){return t.apply(this,arguments)||this}r()(e,t);var n=e.prototype;return n.meta=function(t){return this.get("meta")[t]},n.links=function(t){return this.get("links")[t]},n.data=function(){return this.get("data")},e}(s.a.Model),l=n(281),h=n.n(l);n.d(e,"a",function(){return p});var p=function(t){function e(){return t.apply(this,arguments)||this}r()(e,t);var n=e.prototype;return n.initialize=function(){this.api=new c},n.nextPage=function(t){null==t&&(t={});var e=h()(this.api.links("next")),n=e.toString().replace(e.search(),"");return u.a.extend(t,{url:n,data:e.search(!0)}),this.fetch(t)},n.prevPage=function(t){null==t&&(t={});var e=h()(this.api.links("prev")),n=e.toString().replace(e.search(),"");return u.a.extend(t,{url:n,data:e.search(!0)}),this.fetch(t)},n.fetch=function(e){return null==e&&(e={}),e.page&&(e.data||(e.data={}),u.a.extend(e.data,{page:e.page})),t.prototype.fetch.call(this,e)},n.currentPage=function(){return this.api.meta("current_page")},n.totalPages=function(){return this.api.meta("total_pages")},n.totalCount=function(){return this.api.meta("total_count")},n.parse=function(t,e){return this.api.clear({silent:!0}),this.api.set(t),this.api.data()},e}(s.a.Collection)}}]);
  2. //# sourceMappingURL=core~app.850dba81bc111b802225.js.map
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement