forked from vindi/api-docs
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathswagger-ui.min.js
1 lines (1 loc) · 57.4 KB
/
swagger-ui.min.js
1
"// swagger-ui.js";"// version 2.1.0-alpha.3";$(function(){$.fn.vAlign=function(){return this.each(function(c){var a=$(this).height();var d=$(this).parent().height();var b=(d-a)/2;$(this).css("margin-top",b)})};$.fn.stretchFormtasticInputWidthToParent=function(){return this.each(function(b){var d=$(this).closest("form").innerWidth();var c=parseInt($(this).closest("form").css("padding-left"),10)+parseInt($(this).closest("form").css("padding-right"),10);var a=parseInt($(this).css("padding-left"),10)+parseInt($(this).css("padding-right"),10);$(this).css("width",d-c-a)})};$("form.formtastic li.string input, form.formtastic textarea").stretchFormtasticInputWidthToParent();$("ul.downplayed li div.content p").vAlign();$("form.sandbox").submit(function(){var a=true;$(this).find("input.required").each(function(){$(this).removeClass("error");if($(this).val()==""){$(this).addClass("error");$(this).wiggle();a=false}});return a})});function clippyCopiedCallback(b){$("#api_key_copied").fadeIn().delay(1000).fadeOut()}log=function(){log.history=log.history||[];log.history.push(arguments);if(this.console){console.log(Array.prototype.slice.call(arguments)[0])}};if(Function.prototype.bind&&console&&typeof console.log=="object"){["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(a){console[a]=this.bind(console[a],console)},Function.prototype.call)}var Docs={shebang:function(){var b=$.param.fragment().split("/");b.shift();switch(b.length){case 1:var d="resource_"+b[0];Docs.expandEndpointListForResource(b[0]);$("#"+d).slideto({highlight:false});break;case 2:Docs.expandEndpointListForResource(b[0]);$("#"+d).slideto({highlight:false});var c=b.join("_");var a=c+"_content";Docs.expandOperation($("#"+a));$("#"+c).slideto({highlight:false});break}},toggleEndpointListForResource:function(b){var a=$("li#resource_"+Docs.escapeResourceName(b)+" ul.endpoints");if(a.is(":visible")){Docs.collapseEndpointListForResource(b)}else{Docs.expandEndpointListForResource(b)}},expandEndpointListForResource:function(b){var b=Docs.escapeResourceName(b);if(b==""){$(".resource ul.endpoints").slideDown();return}$("li#resource_"+b).addClass("active");var a=$("li#resource_"+b+" ul.endpoints");a.slideDown()},collapseEndpointListForResource:function(b){var b=Docs.escapeResourceName(b);$("li#resource_"+b).removeClass("active");var a=$("li#resource_"+b+" ul.endpoints");a.slideUp()},expandOperationsForResource:function(a){Docs.expandEndpointListForResource(a);if(a==""){$(".resource ul.endpoints li.operation div.content").slideDown();return}$("li#resource_"+Docs.escapeResourceName(a)+" li.operation div.content").each(function(){Docs.expandOperation($(this))})},collapseOperationsForResource:function(a){Docs.expandEndpointListForResource(a);$("li#resource_"+Docs.escapeResourceName(a)+" li.operation div.content").each(function(){Docs.collapseOperation($(this))})},escapeResourceName:function(a){return a.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},expandOperation:function(a){a.slideDown()},collapseOperation:function(a){a.slideUp()}};(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.apikey_button_view=b(function(e,k,d,j,i){this.compilerInfo=[4,">= 1.0.0"];d=this.merge(d,e.helpers);i=i||{};var g="",c,f="function",h=this.escapeExpression;g+="<div class='auth_button' id='apikey_button'><img class='auth_icon' alt='apply api key' src='images/apikey.jpeg'></div>\r\n<div class='auth_container' id='apikey_container'>\r\n <div class='key_input_container'>\r\n <div class='auth_label'>";if(c=d.keyName){c=c.call(k,{hash:{},data:i})}else{c=k.keyName;c=typeof c===f?c.apply(k):c}g+=h(c)+'</div>\r\n <input placeholder="api_key" class="auth_input" id="input_apiKey_entry" name="apiKey" type="text"/>\r\n <div class=\'auth_submit\'><a class=\'auth_submit_button\' id="apply_api_key" href="#">apply</a></div>\r\n </div>\r\n</div>\r\n\r\n';return g})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.basic_auth_button_view=b(function(f,g,d,c,e){this.compilerInfo=[4,">= 1.0.0"];d=this.merge(d,f.helpers);e=e||{};return'<div class=\'auth_button\' id=\'basic_auth_button\'><img class=\'auth_icon\' src=\'images/password.jpeg\'></div>\r\n<div class=\'auth_container\' id=\'basic_auth_container\'>\r\n <div class=\'key_input_container\'>\r\n <div class="auth_label">Username</div>\r\n <input placeholder="username" class="auth_input" id="input_username" name="username" type="text"/>\r\n <div class="auth_label">Password</div>\r\n <input placeholder="password" class="auth_input" id="input_password" name="password" type="password"/>\r\n <div class=\'auth_submit\'><a class=\'auth_submit_button\' id="apply_basic_auth" href="#">apply</a></div>\r\n </div>\r\n</div>\r\n\r\n'})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.content_type=b(function(g,l,f,k,j){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);j=j||{};var i="",c,h="function",m=this;function e(r,q){var o="",p;o+="\r\n ";p=f.each.call(r,r.produces,{hash:{},inverse:m.noop,fn:m.program(2,d,q),data:q});if(p||p===0){o+=p}o+="\r\n";return o}function d(r,q){var o="",p;o+='\r\n <option value="';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+='">';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+="</option>\r\n ";return o}function n(p,o){return'\r\n <option value="application/json">application/json</option>\r\n'}i+='<label for="contentType"></label>\r\n<select name="contentType">\r\n';c=f["if"].call(l,l.produces,{hash:{},inverse:m.program(4,n,j),fn:m.program(1,e,j),data:j});if(c||c===0){i+=c}i+="\r\n</select>\r\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.main=b(function(h,n,g,m,l){this.compilerInfo=[4,">= 1.0.0"];g=this.merge(g,h.helpers);l=l||{};var j="",c,s,i="function",k=this.escapeExpression,q=this;function f(x,w){var t="",v,u;t+='\r\n <div class="info_title">'+k(((v=((v=x.info),v==null||v===false?v:v.title)),typeof v===i?v.apply(x):v))+'</div>\r\n <div class="info_description">';u=((v=((v=x.info),v==null||v===false?v:v.description)),typeof v===i?v.apply(x):v);if(u||u===0){t+=u}t+="</div>\r\n ";u=g["if"].call(x,((v=x.info),v==null||v===false?v:v.termsOfServiceUrl),{hash:{},inverse:q.noop,fn:q.program(2,d,w),data:w});if(u||u===0){t+=u}t+="\r\n ";u=g["if"].call(x,((v=x.info),v==null||v===false?v:v.contact),{hash:{},inverse:q.noop,fn:q.program(4,r,w),data:w});if(u||u===0){t+=u}t+="\r\n ";u=g["if"].call(x,((v=x.info),v==null||v===false?v:v.license),{hash:{},inverse:q.noop,fn:q.program(6,p,w),data:w});if(u||u===0){t+=u}t+="\r\n ";return t}function d(w,v){var t="",u;t+='<div class="info_tos"><a href="'+k(((u=((u=w.info),u==null||u===false?u:u.termsOfServiceUrl)),typeof u===i?u.apply(w):u))+'">Terms of service</a></div>';return t}function r(w,v){var t="",u;t+="<div class='info_contact'><a href=\"mailto:"+k(((u=((u=((u=w.info),u==null||u===false?u:u.contact)),u==null||u===false?u:u.name)),typeof u===i?u.apply(w):u))+'">Contact the developer</a></div>';return t}function p(w,v){var t="",u;t+="<div class='info_license'><a href='"+k(((u=((u=((u=w.info),u==null||u===false?u:u.license)),u==null||u===false?u:u.url)),typeof u===i?u.apply(w):u))+"'>"+k(((u=((u=((u=w.info),u==null||u===false?u:u.license)),u==null||u===false?u:u.name)),typeof u===i?u.apply(w):u))+"</a></div>";return t}function o(w,v){var t="",u;t+='\r\n , <span style="font-variant: small-caps">api version</span>: '+k(((u=((u=w.info),u==null||u===false?u:u.version)),typeof u===i?u.apply(w):u))+"\r\n ";return t}function e(w,v){var t="",u;t+='\r\n <span style="float:right"><a href="';if(u=g.validatorUrl){u=u.call(w,{hash:{},data:v})}else{u=w.validatorUrl;u=typeof u===i?u.apply(w):u}t+=k(u)+"/debug?url=";if(u=g.url){u=u.call(w,{hash:{},data:v})}else{u=w.url;u=typeof u===i?u.apply(w):u}t+=k(u)+'"><img id="validator" src="';if(u=g.validatorUrl){u=u.call(w,{hash:{},data:v})}else{u=w.validatorUrl;u=typeof u===i?u.apply(w):u}t+=k(u)+"?url=";if(u=g.url){u=u.call(w,{hash:{},data:v})}else{u=w.url;u=typeof u===i?u.apply(w):u}t+=k(u)+'"></a>\r\n </span>\r\n ';return t}j+="<div class='info' id='api_info'>\r\n ";c=g["if"].call(n,n.info,{hash:{},inverse:q.noop,fn:q.program(1,f,l),data:l});if(c||c===0){j+=c}j+="\r\n</div>\r\n<div class='container' id='resources_container'>\r\n <ul id='resources'></ul>\r\n\r\n <div class=\"footer\">\r\n <br>\r\n <br>\r\n <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url</span>: ";if(c=g.basePath){c=c.call(n,{hash:{},data:l})}else{c=n.basePath;c=typeof c===i?c.apply(n):c}j+=k(c)+"\r\n ";s=g["if"].call(n,((c=n.info),c==null||c===false?c:c.version),{hash:{},inverse:q.noop,fn:q.program(8,o,l),data:l});if(s||s===0){j+=s}j+="]\r\n ";s=g["if"].call(n,n.validatorUrl,{hash:{},inverse:q.noop,fn:q.program(10,e,l),data:l});if(s||s===0){j+=s}j+="\r\n </h4>\r\n </div>\r\n</div>\r\n";return j})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.operation=b(function(j,u,s,o,A){this.compilerInfo=[4,">= 1.0.0"];s=this.merge(s,j.helpers);A=A||{};var t="",k,f,e="function",d=this.escapeExpression,r=this,c=s.blockHelperMissing;function q(C,B){return"deprecated"}function p(C,B){return"\r\n <h4>Warning: Deprecated</h4>\r\n "}function n(E,D){var B="",C;B+="\r\n <h4>Implementation Notes</h4>\r\n <p>";if(C=s.description){C=C.call(E,{hash:{},data:D})}else{C=E.description;C=typeof C===e?C.apply(E):C}if(C||C===0){B+=C}B+="</p>\r\n ";return B}function m(C,B){return'\r\n <div class="auth">\r\n <span class="api-ic ic-error"></span>'}function i(E,D){var B="",C;B+='\r\n <div id="api_information_panel" style="top: 526px; left: 776px; display: none;">\r\n ';C=s.each.call(E,E,{hash:{},inverse:r.noop,fn:r.program(10,z,D),data:D});if(C||C===0){B+=C}B+="\r\n </div>\r\n ";return B}function z(F,E){var B="",D,C;B+="\r\n <div title='";C=((D=F.description),typeof D===e?D.apply(F):D);if(C||C===0){B+=C}B+="'>"+d(((D=F.scope),typeof D===e?D.apply(F):D))+"</div>\r\n ";return B}function y(C,B){return"</div>"}function x(C,B){return'\r\n <div class=\'access\'>\r\n <span class="api-ic ic-off" title="click to authenticate"></span>\r\n </div>\r\n '}function w(C,B){return'\r\n <h4>Response Class</h4>\r\n <p><span class="model-signature" /></p>\r\n <br/>\r\n <div class="response-content-type" />\r\n '}function v(C,B){return'\r\n <h4>Parameters</h4>\r\n <table class=\'fullwidth\'>\r\n <thead>\r\n <tr>\r\n <th style="width: 100px; max-width: 100px">Parameter</th>\r\n <th style="width: 310px; max-width: 310px">Value</th>\r\n <th style="width: 200px; max-width: 200px">Description</th>\r\n <th style="width: 100px; max-width: 100px">Parameter Type</th>\r\n <th style="width: 220px; max-width: 230px">Data Type</th>\r\n </tr>\r\n </thead>\r\n <tbody class="operation-params">\r\n\r\n </tbody>\r\n </table>\r\n '}function l(C,B){return"\r\n <div style='margin:0;padding:0;display:inline'></div>\r\n <h4>Response Messages</h4>\r\n <table class='fullwidth'>\r\n <thead>\r\n <tr>\r\n <th>HTTP Status Code</th>\r\n <th>Reason</th>\r\n <th>Response Model</th>\r\n </tr>\r\n </thead>\r\n <tbody class=\"operation-status\">\r\n \r\n </tbody>\r\n </table>\r\n "}function h(C,B){return"\r\n "}function g(C,B){return"\r\n <div class='sandbox_header'>\r\n <input class='submit' name='commit' type='button' value='Try it out!' />\r\n <a href='#' class='response_hider' style='display:none'>Hide Response</a>\r\n <span class='response_throbber' style='display:none'></span>\r\n </div>\r\n "}t+="\r\n <ul class='operations' >\r\n <li class='";if(k=s.method){k=k.call(u,{hash:{},data:A})}else{k=u.method;k=typeof k===e?k.apply(u):k}t+=d(k)+" operation' id='";if(k=s.parentId){k=k.call(u,{hash:{},data:A})}else{k=u.parentId;k=typeof k===e?k.apply(u):k}t+=d(k)+"_";if(k=s.nickname){k=k.call(u,{hash:{},data:A})}else{k=u.nickname;k=typeof k===e?k.apply(u):k}t+=d(k)+"'>\r\n <div class='heading'>\r\n <h3>\r\n <span class='http_method'>\r\n <a href='#!/";if(k=s.parentId){k=k.call(u,{hash:{},data:A})}else{k=u.parentId;k=typeof k===e?k.apply(u):k}t+=d(k)+"/";if(k=s.nickname){k=k.call(u,{hash:{},data:A})}else{k=u.nickname;k=typeof k===e?k.apply(u):k}t+=d(k)+'\' class="toggleOperation">';if(k=s.method){k=k.call(u,{hash:{},data:A})}else{k=u.method;k=typeof k===e?k.apply(u):k}t+=d(k)+"</a>\r\n </span>\r\n <span class='path'>\r\n <a href='#!/";if(k=s.parentId){k=k.call(u,{hash:{},data:A})}else{k=u.parentId;k=typeof k===e?k.apply(u):k}t+=d(k)+"/";if(k=s.nickname){k=k.call(u,{hash:{},data:A})}else{k=u.nickname;k=typeof k===e?k.apply(u):k}t+=d(k)+"' class=\"toggleOperation ";k=s["if"].call(u,u.deprecated,{hash:{},inverse:r.noop,fn:r.program(1,q,A),data:A});if(k||k===0){t+=k}t+='">';if(k=s.path){k=k.call(u,{hash:{},data:A})}else{k=u.path;k=typeof k===e?k.apply(u):k}t+=d(k)+"</a>\r\n </span>\r\n </h3>\r\n <ul class='options'>\r\n <li>\r\n <a href='#!/";if(k=s.parentId){k=k.call(u,{hash:{},data:A})}else{k=u.parentId;k=typeof k===e?k.apply(u):k}t+=d(k)+"/";if(k=s.nickname){k=k.call(u,{hash:{},data:A})}else{k=u.nickname;k=typeof k===e?k.apply(u):k}t+=d(k)+'\' class="toggleOperation">';if(k=s.summary){k=k.call(u,{hash:{},data:A})}else{k=u.summary;k=typeof k===e?k.apply(u):k}if(k||k===0){t+=k}t+="</a>\r\n </li>\r\n </ul>\r\n </div>\r\n <div class='content' id='";if(k=s.parentId){k=k.call(u,{hash:{},data:A})}else{k=u.parentId;k=typeof k===e?k.apply(u):k}t+=d(k)+"_";if(k=s.nickname){k=k.call(u,{hash:{},data:A})}else{k=u.nickname;k=typeof k===e?k.apply(u):k}t+=d(k)+"_content' style='display:none'>\r\n ";k=s["if"].call(u,u.deprecated,{hash:{},inverse:r.noop,fn:r.program(3,p,A),data:A});if(k||k===0){t+=k}t+="\r\n ";k=s["if"].call(u,u.description,{hash:{},inverse:r.noop,fn:r.program(5,n,A),data:A});if(k||k===0){t+=k}t+="\r\n ";f={hash:{},inverse:r.noop,fn:r.program(7,m,A),data:A};if(k=s.oauth){k=k.call(u,f)}else{k=u.oauth;k=typeof k===e?k.apply(u):k}if(!s.oauth){k=c.call(u,k,f)}if(k||k===0){t+=k}t+="\r\n ";k=s.each.call(u,u.oauth,{hash:{},inverse:r.noop,fn:r.program(9,i,A),data:A});if(k||k===0){t+=k}t+="\r\n ";f={hash:{},inverse:r.noop,fn:r.program(12,y,A),data:A};if(k=s.oauth){k=k.call(u,f)}else{k=u.oauth;k=typeof k===e?k.apply(u):k}if(!s.oauth){k=c.call(u,k,f)}if(k||k===0){t+=k}t+="\r\n ";f={hash:{},inverse:r.noop,fn:r.program(14,x,A),data:A};if(k=s.oauth){k=k.call(u,f)}else{k=u.oauth;k=typeof k===e?k.apply(u):k}if(!s.oauth){k=c.call(u,k,f)}if(k||k===0){t+=k}t+="\r\n ";k=s["if"].call(u,u.type,{hash:{},inverse:r.noop,fn:r.program(16,w,A),data:A});if(k||k===0){t+=k}t+="\r\n <form accept-charset='UTF-8' class='sandbox'>\r\n <div style='margin:0;padding:0;display:inline'></div>\r\n ";k=s["if"].call(u,u.parameters,{hash:{},inverse:r.noop,fn:r.program(18,v,A),data:A});if(k||k===0){t+=k}t+="\r\n ";k=s["if"].call(u,u.responseMessages,{hash:{},inverse:r.noop,fn:r.program(20,l,A),data:A});if(k||k===0){t+=k}t+="\r\n ";k=s["if"].call(u,u.isReadOnly,{hash:{},inverse:r.program(24,g,A),fn:r.program(22,h,A),data:A});if(k||k===0){t+=k}t+="\r\n </form>\r\n <div class='response' style='display:none'>\r\n <h4>Request URL</h4>\r\n <div class='block request_url'></div>\r\n <h4>Response Body</h4>\r\n <div class='block response_body'></div>\r\n <h4>Response Code</h4>\r\n <div class='block response_code'></div>\r\n <h4>Response Headers</h4>\r\n <div class='block response_headers'></div>\r\n </div>\r\n </div>\r\n </li>\r\n </ul>\r\n";return t})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param=b(function(f,q,o,j,t){this.compilerInfo=[4,">= 1.0.0"];o=this.merge(o,f.helpers);t=t||{};var p="",g,d="function",c=this.escapeExpression,n=this;function m(y,x){var v="",w;v+="\r\n ";w=o["if"].call(y,y.isFile,{hash:{},inverse:n.program(4,k,x),fn:n.program(2,l,x),data:x});if(w||w===0){v+=w}v+="\r\n ";return v}function l(y,x){var v="",w;v+='\r\n <input type="file" name=\'';if(w=o.name){w=w.call(y,{hash:{},data:x})}else{w=y.name;w=typeof w===d?w.apply(y):w}v+=c(w)+'\'/>\r\n <div class="parameter-content-type" />\r\n ';return v}function k(y,x){var v="",w;v+="\r\n ";w=o["if"].call(y,y["default"],{hash:{},inverse:n.program(7,h,x),fn:n.program(5,i,x),data:x});if(w||w===0){v+=w}v+="\r\n ";return v}function i(y,x){var v="",w;v+="\r\n <textarea class='body-textarea' name='";if(w=o.name){w=w.call(y,{hash:{},data:x})}else{w=y.name;w=typeof w===d?w.apply(y):w}v+=c(w)+"'>";if(w=o["default"]){w=w.call(y,{hash:{},data:x})}else{w=y["default"];w=typeof w===d?w.apply(y):w}v+=c(w)+"</textarea>\r\n ";return v}function h(y,x){var v="",w;v+="\r\n <textarea class='body-textarea' name='";if(w=o.name){w=w.call(y,{hash:{},data:x})}else{w=y.name;w=typeof w===d?w.apply(y):w}v+=c(w)+'\'></textarea>\r\n <br />\r\n <div class="parameter-content-type" />\r\n ';return v}function e(y,x){var v="",w;v+="\r\n ";w=o["if"].call(y,y.isFile,{hash:{},inverse:n.program(10,u,x),fn:n.program(2,l,x),data:x});if(w||w===0){v+=w}v+="\r\n ";return v}function u(y,x){var v="",w;v+="\r\n ";w=o["if"].call(y,y["default"],{hash:{},inverse:n.program(13,r,x),fn:n.program(11,s,x),data:x});if(w||w===0){v+=w}v+="\r\n ";return v}function s(y,x){var v="",w;v+="\r\n <input class='parameter' minlength='0' name='";if(w=o.name){w=w.call(y,{hash:{},data:x})}else{w=y.name;w=typeof w===d?w.apply(y):w}v+=c(w)+"' placeholder='' type='text' value='";if(w=o["default"]){w=w.call(y,{hash:{},data:x})}else{w=y["default"];w=typeof w===d?w.apply(y):w}v+=c(w)+"'/>\r\n ";return v}function r(y,x){var v="",w;v+="\r\n <input class='parameter' minlength='0' name='";if(w=o.name){w=w.call(y,{hash:{},data:x})}else{w=y.name;w=typeof w===d?w.apply(y):w}v+=c(w)+"' placeholder='' type='text' value=''/>\r\n ";return v}p+="<td class='code'>";if(g=o.name){g=g.call(q,{hash:{},data:t})}else{g=q.name;g=typeof g===d?g.apply(q):g}p+=c(g)+"</td>\r\n<td>\r\n\r\n ";g=o["if"].call(q,q.isBody,{hash:{},inverse:n.program(9,e,t),fn:n.program(1,m,t),data:t});if(g||g===0){p+=g}p+="\r\n\r\n</td>\r\n<td>";if(g=o.description){g=g.call(q,{hash:{},data:t})}else{g=q.description;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+="</td>\r\n<td>";if(g=o.paramType){g=g.call(q,{hash:{},data:t})}else{g=q.paramType;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+='</td>\r\n<td>\r\n <span class="model-signature"></span>\r\n</td>\r\n';return p})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.parameter_content_type=b(function(g,l,f,k,j){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);j=j||{};var i="",c,h="function",m=this;function e(r,q){var o="",p;o+="\r\n ";p=f.each.call(r,r.consumes,{hash:{},inverse:m.noop,fn:m.program(2,d,q),data:q});if(p||p===0){o+=p}o+="\r\n";return o}function d(r,q){var o="",p;o+='\r\n <option value="';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+='">';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+="</option>\r\n ";return o}function n(p,o){return'\r\n <option value="application/json">application/json</option>\r\n'}i+='<label for="parameterContentType"></label>\r\n<select name="parameterContentType">\r\n';c=f["if"].call(l,l.consumes,{hash:{},inverse:m.program(4,n,j),fn:m.program(1,e,j),data:j});if(c||c===0){i+=c}i+="\r\n</select>\r\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_list=b(function(h,t,r,m,y){this.compilerInfo=[4,">= 1.0.0"];r=this.merge(r,h.helpers);y=y||{};var s="",j,g,e,p=this,q=r.helperMissing,d="function",c=this.escapeExpression;function o(A,z){return" multiple='multiple'"}function n(A,z){return"\r\n "}function l(C,B){var z="",A;z+="\r\n ";A=r["if"].call(C,C.defaultValue,{hash:{},inverse:p.program(8,i,B),fn:p.program(6,k,B),data:B});if(A||A===0){z+=A}z+="\r\n ";return z}function k(A,z){return"\r\n "}function i(E,D){var z="",C,B,A;z+="\r\n ";A={hash:{},inverse:p.program(11,x,D),fn:p.program(9,f,D),data:D};B=((C=r.isArray||E.isArray),C?C.call(E,E,A):q.call(E,"isArray",E,A));if(B||B===0){z+=B}z+="\r\n ";return z}function f(A,z){return"\r\n "}function x(A,z){return"\r\n <option selected=\"\" value=''></option>\r\n "}function w(C,B){var z="",A;z+="\r\n ";A=r["if"].call(C,C.isDefault,{hash:{},inverse:p.program(16,u,B),fn:p.program(14,v,B),data:B});if(A||A===0){z+=A}z+="\r\n ";return z}function v(C,B){var z="",A;z+='\r\n <option selected="" value=\'';if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+"'>";if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+" (default)</option>\r\n ";return z}function u(C,B){var z="",A;z+="\r\n <option value='";if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+"'>";if(A=r.value){A=A.call(C,{hash:{},data:B})}else{A=C.value;A=typeof A===d?A.apply(C):A}z+=c(A)+"</option>\r\n ";return z}s+="<td class='code'>";if(j=r.name){j=j.call(t,{hash:{},data:y})}else{j=t.name;j=typeof j===d?j.apply(t):j}s+=c(j)+"</td>\r\n<td>\r\n <select ";e={hash:{},inverse:p.noop,fn:p.program(1,o,y),data:y};g=((j=r.isArray||t.isArray),j?j.call(t,t,e):q.call(t,"isArray",t,e));if(g||g===0){s+=g}s+=" class='parameter' name='";if(g=r.name){g=g.call(t,{hash:{},data:y})}else{g=t.name;g=typeof g===d?g.apply(t):g}s+=c(g)+"'>\r\n ";g=r["if"].call(t,t.required,{hash:{},inverse:p.program(5,l,y),fn:p.program(3,n,y),data:y});if(g||g===0){s+=g}s+="\r\n ";g=r.each.call(t,((j=t.allowableValues),j==null||j===false?j:j.descriptiveValues),{hash:{},inverse:p.noop,fn:p.program(13,w,y),data:y});if(g||g===0){s+=g}s+="\r\n </select>\r\n</td>\r\n<td>";if(g=r.description){g=g.call(t,{hash:{},data:y})}else{g=t.description;g=typeof g===d?g.apply(t):g}if(g||g===0){s+=g}s+="</td>\r\n<td>";if(g=r.paramType){g=g.call(t,{hash:{},data:y})}else{g=t.paramType;g=typeof g===d?g.apply(t):g}if(g||g===0){s+=g}s+='</td>\r\n<td><span class="model-signature"></span></td>';return s})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_readonly=b(function(g,m,f,l,k){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);k=k||{};var i="",d,h="function",j=this.escapeExpression,o=this;function e(t,s){var q="",r;q+="\r\n <textarea class='body-textarea' readonly='readonly' name='";if(r=f.name){r=r.call(t,{hash:{},data:s})}else{r=t.name;r=typeof r===h?r.apply(t):r}q+=j(r)+"'>";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"</textarea>\r\n ";return q}function c(t,s){var q="",r;q+="\r\n ";r=f["if"].call(t,t.defaultValue,{hash:{},inverse:o.program(6,n,s),fn:o.program(4,p,s),data:s});if(r||r===0){q+=r}q+="\r\n ";return q}function p(t,s){var q="",r;q+="\r\n ";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"\r\n ";return q}function n(r,q){return"\r\n (empty)\r\n "}i+="<td class='code'>";if(d=f.name){d=d.call(m,{hash:{},data:k})}else{d=m.name;d=typeof d===h?d.apply(m):d}i+=j(d)+"</td>\r\n<td>\r\n ";d=f["if"].call(m,m.isBody,{hash:{},inverse:o.program(3,c,k),fn:o.program(1,e,k),data:k});if(d||d===0){i+=d}i+="\r\n</td>\r\n<td>";if(d=f.description){d=d.call(m,{hash:{},data:k})}else{d=m.description;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+="</td>\r\n<td>";if(d=f.paramType){d=d.call(m,{hash:{},data:k})}else{d=m.paramType;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+='</td>\r\n<td><span class="model-signature"></span></td>\r\n';return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_readonly_required=b(function(g,m,f,l,k){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);k=k||{};var i="",d,h="function",j=this.escapeExpression,o=this;function e(t,s){var q="",r;q+="\r\n <textarea class='body-textarea' readonly='readonly' placeholder='(required)' name='";if(r=f.name){r=r.call(t,{hash:{},data:s})}else{r=t.name;r=typeof r===h?r.apply(t):r}q+=j(r)+"'>";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"</textarea>\r\n ";return q}function c(t,s){var q="",r;q+="\r\n ";r=f["if"].call(t,t.defaultValue,{hash:{},inverse:o.program(6,n,s),fn:o.program(4,p,s),data:s});if(r||r===0){q+=r}q+="\r\n ";return q}function p(t,s){var q="",r;q+="\r\n ";if(r=f.defaultValue){r=r.call(t,{hash:{},data:s})}else{r=t.defaultValue;r=typeof r===h?r.apply(t):r}q+=j(r)+"\r\n ";return q}function n(r,q){return"\r\n (empty)\r\n "}i+="<td class='code required'>";if(d=f.name){d=d.call(m,{hash:{},data:k})}else{d=m.name;d=typeof d===h?d.apply(m):d}i+=j(d)+"</td>\r\n<td>\r\n ";d=f["if"].call(m,m.isBody,{hash:{},inverse:o.program(3,c,k),fn:o.program(1,e,k),data:k});if(d||d===0){i+=d}i+="\r\n</td>\r\n<td>";if(d=f.description){d=d.call(m,{hash:{},data:k})}else{d=m.description;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+="</td>\r\n<td>";if(d=f.paramType){d=d.call(m,{hash:{},data:k})}else{d=m.paramType;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+='</td>\r\n<td><span class="model-signature"></span></td>\r\n';return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.param_required=b(function(f,q,o,j,u){this.compilerInfo=[4,">= 1.0.0"];o=this.merge(o,f.helpers);u=u||{};var p="",g,d="function",c=this.escapeExpression,n=this;function m(z,y){var w="",x;w+="\r\n ";x=o["if"].call(z,z.isFile,{hash:{},inverse:n.program(4,k,y),fn:n.program(2,l,y),data:y});if(x||x===0){w+=x}w+="\r\n ";return w}function l(z,y){var w="",x;w+='\r\n <input type="file" name=\'';if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"'/>\r\n ";return w}function k(z,y){var w="",x;w+="\r\n ";x=o["if"].call(z,z.defaultValue,{hash:{},inverse:n.program(7,h,y),fn:n.program(5,i,y),data:y});if(x||x===0){w+=x}w+="\r\n ";return w}function i(z,y){var w="",x;w+="\r\n <textarea class='body-textarea' placeholder='(required)' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"'>";if(x=o.defaultValue){x=x.call(z,{hash:{},data:y})}else{x=z.defaultValue;x=typeof x===d?x.apply(z):x}w+=c(x)+"</textarea>\r\n ";return w}function h(z,y){var w="",x;w+="\r\n <textarea class='body-textarea' placeholder='(required)' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+'\'></textarea>\r\n <br />\r\n <div class="parameter-content-type" />\r\n ';return w}function e(z,y){var w="",x;w+="\r\n ";x=o["if"].call(z,z.isFile,{hash:{},inverse:n.program(12,t,y),fn:n.program(10,v,y),data:y});if(x||x===0){w+=x}w+="\r\n ";return w}function v(z,y){var w="",x;w+="\r\n <input class='parameter' class='required' type='file' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"'/>\r\n ";return w}function t(z,y){var w="",x;w+="\r\n ";x=o["if"].call(z,z.defaultValue,{hash:{},inverse:n.program(15,r,y),fn:n.program(13,s,y),data:y});if(x||x===0){w+=x}w+="\r\n ";return w}function s(z,y){var w="",x;w+="\r\n <input class='parameter required' minlength='1' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"' placeholder='(required)' type='text' value='";if(x=o.defaultValue){x=x.call(z,{hash:{},data:y})}else{x=z.defaultValue;x=typeof x===d?x.apply(z):x}w+=c(x)+"'/>\r\n ";return w}function r(z,y){var w="",x;w+="\r\n <input class='parameter required' minlength='1' name='";if(x=o.name){x=x.call(z,{hash:{},data:y})}else{x=z.name;x=typeof x===d?x.apply(z):x}w+=c(x)+"' placeholder='(required)' type='text' value=''/>\r\n ";return w}p+="<td class='code required'>";if(g=o.name){g=g.call(q,{hash:{},data:u})}else{g=q.name;g=typeof g===d?g.apply(q):g}p+=c(g)+"</td>\r\n<td>\r\n ";g=o["if"].call(q,q.isBody,{hash:{},inverse:n.program(9,e,u),fn:n.program(1,m,u),data:u});if(g||g===0){p+=g}p+="\r\n</td>\r\n<td>\r\n <strong>";if(g=o.description){g=g.call(q,{hash:{},data:u})}else{g=q.description;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+="</strong>\r\n</td>\r\n<td>";if(g=o.paramType){g=g.call(q,{hash:{},data:u})}else{g=q.paramType;g=typeof g===d?g.apply(q):g}if(g||g===0){p+=g}p+='</td>\r\n<td><span class="model-signature"></span></td>\r\n';return p})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.resource=b(function(g,m,f,l,k){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);k=k||{};var i="",d,p,h="function",j=this.escapeExpression,o=this,n=f.blockHelperMissing;function e(r,q){return" : "}function c(t,s){var q="",r;q+="<li>\r\n <a href='";if(r=f.url){r=r.call(t,{hash:{},data:s})}else{r=t.url;r=typeof r===h?r.apply(t):r}q+=j(r)+"'>Raw</a>\r\n </li>";return q}i+="<div class='heading'>\r\n <h2>\r\n <a href='#!/";if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+'\' class="toggleEndpointList" data-id="';if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+'">';if(d=f.name){d=d.call(m,{hash:{},data:k})}else{d=m.name;d=typeof d===h?d.apply(m):d}i+=j(d)+"</a> ";p={hash:{},inverse:o.noop,fn:o.program(1,e,k),data:k};if(d=f.summary){d=d.call(m,p)}else{d=m.summary;d=typeof d===h?d.apply(m):d}if(!f.summary){d=n.call(m,d,p)}if(d||d===0){i+=d}if(d=f.summary){d=d.call(m,{hash:{},data:k})}else{d=m.summary;d=typeof d===h?d.apply(m):d}if(d||d===0){i+=d}i+="\r\n </h2>\r\n <ul class='options'>\r\n <li>\r\n <a href='#!/";if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+"' id='endpointListTogger_";if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+'\' class="toggleEndpointList" data-id="';if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+'">Show/Hide</a>\r\n </li>\r\n <li>\r\n <a href=\'#\' class="collapseResource" data-id="';if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+'">\r\n List Operations\r\n </a>\r\n </li>\r\n <li>\r\n <a href=\'#\' class="expandResource" data-id=';if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+">\r\n Expand Operations\r\n </a>\r\n </li>\r\n ";p={hash:{},inverse:o.noop,fn:o.program(3,c,k),data:k};if(d=f.url){d=d.call(m,p)}else{d=m.url;d=typeof d===h?d.apply(m):d}if(!f.url){d=n.call(m,d,p)}if(d||d===0){i+=d}i+="\r\n </ul>\r\n</div>\r\n<ul class='endpoints' id='";if(d=f.id){d=d.call(m,{hash:{},data:k})}else{d=m.id;d=typeof d===h?d.apply(m):d}i+=j(d)+"_endpoint_list' style='display:none'>\r\n\r\n</ul>\r\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.response_content_type=b(function(g,l,f,k,j){this.compilerInfo=[4,">= 1.0.0"];f=this.merge(f,g.helpers);j=j||{};var i="",c,h="function",m=this;function e(r,q){var o="",p;o+="\r\n ";p=f.each.call(r,r.produces,{hash:{},inverse:m.noop,fn:m.program(2,d,q),data:q});if(p||p===0){o+=p}o+="\r\n";return o}function d(r,q){var o="",p;o+='\r\n <option value="';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+='">';p=(typeof r===h?r.apply(r):r);if(p||p===0){o+=p}o+="</option>\r\n ";return o}function n(p,o){return'\r\n <option value="application/json">application/json</option>\r\n'}i+='<label for="responseContentType"></label>\r\n<select name="responseContentType">\r\n';c=f["if"].call(l,l.produces,{hash:{},inverse:m.program(4,n,j),fn:m.program(1,e,j),data:j});if(c||c===0){i+=c}i+="\r\n</select>\r\n";return i})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.signature=b(function(e,k,d,j,i){this.compilerInfo=[4,">= 1.0.0"];d=this.merge(d,e.helpers);i=i||{};var g="",c,f="function",h=this.escapeExpression;g+='<div>\r\n<ul class="signature-nav">\r\n <li><a class="description-link" href="#">Model</a></li>\r\n <li><a class="snippet-link" href="#">Model Schema</a></li>\r\n</ul>\r\n<div>\r\n\r\n<div class="signature-container">\r\n <div class="description">\r\n ';if(c=d.signature){c=c.call(k,{hash:{},data:i})}else{c=k.signature;c=typeof c===f?c.apply(k):c}if(c||c===0){g+=c}g+='\r\n </div>\r\n\r\n <div class="snippet">\r\n <pre><code>';if(c=d.sampleJSON){c=c.call(k,{hash:{},data:i})}else{c=k.sampleJSON;c=typeof c===f?c.apply(k):c}g+=h(c)+'</code></pre>\r\n <small class="notice"></small>\r\n </div>\r\n</div>\r\n\r\n';return g})})();(function(){var b=Handlebars.template,a=Handlebars.templates=Handlebars.templates||{};a.status_code=b(function(e,k,d,j,i){this.compilerInfo=[4,">= 1.0.0"];d=this.merge(d,e.helpers);i=i||{};var g="",c,f="function",h=this.escapeExpression;g+="<td width='15%' class='code'>";if(c=d.code){c=c.call(k,{hash:{},data:i})}else{c=k.code;c=typeof c===f?c.apply(k):c}g+=h(c)+"</td>\r\n<td>";if(c=d.message){c=c.call(k,{hash:{},data:i})}else{c=k.message;c=typeof c===f?c.apply(k):c}if(c||c===0){g+=c}g+="</td>\r\n<td width='50%'><span class=\"model-signature\" /></td>";return g})})();(function(){var o,l,g,c,i,d,n,f,k,a,m,j,b,h={}.hasOwnProperty,e=function(s,q){for(var p in q){if(h.call(q,p)){s[p]=q[p]}}function r(){this.constructor=s}r.prototype=q.prototype;s.prototype=new r();s.__super__=q.prototype;return s};b=(function(q){e(p,q);function p(){return p.__super__.constructor.apply(this,arguments)}p.prototype.dom_id="swagger_ui";p.prototype.options=null;p.prototype.api=null;p.prototype.headerView=null;p.prototype.mainView=null;p.prototype.initialize=function(r){if(r==null){r={}}if(r.dom_id!=null){this.dom_id=r.dom_id;delete r.dom_id}if($("#"+this.dom_id)==null){$("body").append('<div id="'+this.dom_id+'"></div>')}this.options=r;this.options.success=(function(s){return function(){return s.render()}})(this);this.options.progress=(function(s){return function(t){return s.showMessage(t)}})(this);this.options.failure=(function(s){return function(t){if(s.api&&s.api.isValid===false){log("not a valid 2.0 spec, loading legacy client");s.api=new SwaggerApi(s.options);return s.api.build()}else{return s.onLoadFailure(t)}}})(this);this.headerView=new c({el:$("#header")});return this.headerView.on("update-swagger-ui",(function(s){return function(t){return s.updateSwaggerUi(t)}})(this))};p.prototype.setOption=function(r,s){return this.options[r]=s};p.prototype.getOption=function(r){return this.options[r]};p.prototype.updateSwaggerUi=function(r){this.options.url=r.url;return this.load()};p.prototype.load=function(){var r,s;if((s=this.mainView)!=null){s.clear()}r=this.options.url;if(r.indexOf("http")!==0){r=this.buildUrl(window.location.href.toString(),r)}this.options.url=r;this.headerView.update(r);this.api=new SwaggerClient(this.options);return this.api.build()};p.prototype.render=function(){this.showMessage("Finished Loading Resource Information. Rendering Swagger UI...");this.mainView=new i({model:this.api,el:$("#"+this.dom_id),swaggerOptions:this.options}).render();this.showMessage();switch(this.options.docExpansion){case"full":Docs.expandOperationsForResource("");break;case"list":Docs.collapseOperationsForResource("")}if(this.options.onComplete){this.options.onComplete(this.api,this)}return setTimeout((function(r){return function(){return Docs.shebang()}})(this),400)};p.prototype.buildUrl=function(t,r){var s,u;log("base is "+t);if(r.indexOf("/")===0){u=t.split("/");t=u[0]+"//"+u[2];return t+r}else{s=t.length;if(t.indexOf("?")>-1){s=Math.min(s,t.indexOf("?"))}if(t.indexOf("#")>-1){s=Math.min(s,t.indexOf("#"))}t=t.substring(0,s);if(t.indexOf("/",t.length-1)!==-1){return t+r}return t+"/"+r}};p.prototype.showMessage=function(r){if(r==null){r=""}$("#message-bar").removeClass("message-fail");$("#message-bar").addClass("message-success");return $("#message-bar").html(r)};p.prototype.onLoadFailure=function(r){var s;if(r==null){r=""}$("#message-bar").removeClass("message-success");$("#message-bar").addClass("message-fail");s=$("#message-bar").html(r);if(this.options.onFailure!=null){this.options.onFailure(r)}return s};return p})(Backbone.Router);window.SwaggerUi=b;c=(function(q){e(p,q);function p(){return p.__super__.constructor.apply(this,arguments)}p.prototype.events={"click #show-pet-store-icon":"showPetStore","click #show-wordnik-dev-icon":"showWordnikDev","click #explore":"showCustom","keyup #input_baseUrl":"showCustomOnKeyup","keyup #input_apiKey":"showCustomOnKeyup"};p.prototype.initialize=function(){};p.prototype.showPetStore=function(r){return this.trigger("update-swagger-ui",{url:"http://petstore.swagger.wordnik.com/api/api-docs"})};p.prototype.showWordnikDev=function(r){return this.trigger("update-swagger-ui",{url:"http://api.wordnik.com/v4/resources.json"})};p.prototype.showCustomOnKeyup=function(r){if(r.keyCode===13){return this.showCustom()}};p.prototype.showCustom=function(r){if(r!=null){r.preventDefault()}return this.trigger("update-swagger-ui",{url:$("#input_baseUrl").val(),apiKey:$("#input_apiKey").val()})};p.prototype.update=function(s,t,r){if(r==null){r=false}$("#input_baseUrl").val(s);if(r){return this.trigger("update-swagger-ui",{url:s})}};return p})(Backbone.View);i=(function(p){var q;e(r,p);function r(){return r.__super__.constructor.apply(this,arguments)}q={alpha:function(t,s){return t.path.localeCompare(s.path)},method:function(t,s){return t.method.localeCompare(s.method)}};r.prototype.initialize=function(w){var v,u,t,s,y,x;if(w==null){w={}}this.model.auths=[];x=this.model.securityDefinitions;for(u in x){y=x[u];v={name:u,type:y.type,value:y};this.model.auths.push(v)}if(this.model.info&&this.model.info.license&&typeof this.model.info.license==="string"){t=this.model.info.license;s=this.model.info.licenseUrl;this.model.info.license={};this.model.info.license.name=t;this.model.info.license.url=s}if(!this.model.info){this.model.info={}}if(!this.model.info.version){this.model.info.version=this.model.apiVersion}if(this.model.swaggerVersion==="2.0"){if("validatorUrl" in w.swaggerOptions){return this.model.validatorUrl=w.swaggerOptions.validatorUrl}else{if(this.model.url.match(/https?:\/\/localhost/)){return this.model.validatorUrl=this.model.url}else{return this.model.validatorUrl="http://online.swagger.io/validator"}}}};r.prototype.render=function(){var w,A,s,u,t,x,v,y,B,z;if(this.model.securityDefinitions){for(t in this.model.securityDefinitions){w=this.model.securityDefinitions[t];if(w.type==="apiKey"&&$("#apikey_button").length===0){A=new o({model:w}).render().el;$(".auth_main_container").append(A)}if(w.type==="basicAuth"&&$("#basic_auth_button").length===0){A=new l({model:w}).render().el;$(".auth_main_container").append(A)}}}$(this.el).html(Handlebars.templates.main(this.model));v={};s=0;z=this.model.apisArray;for(y=0,B=z.length;y<B;y++){x=z[y];u=x.name;while(typeof v[u]!=="undefined"){u=u+"_"+s;s+=1}x.id=u;v[u]=x;this.addResource(x,this.model.auths)}return this};r.prototype.addResource=function(u,t){var s;u.id=u.id.replace(/\s/g,"_");s=new k({model:u,tagName:"li",id:"resource_"+u.id,className:"resource",auths:t,swaggerOptions:this.options.swaggerOptions});return $("#resources").append(s.render().el)};r.prototype.clear=function(){return $(this.el).html("")};return r})(Backbone.View);k=(function(q){e(p,q);function p(){return p.__super__.constructor.apply(this,arguments)}p.prototype.initialize=function(r){if(r==null){r={}}this.auths=r.auths;if(""===this.model.description){return this.model.description=null}};p.prototype.render=function(){var s,x,u,t,w,r,v;$(this.el).html(Handlebars.templates.resource(this.model));u={};if(this.model.description){this.model.summary=this.model.description}v=this.model.operationsArray;for(w=0,r=v.length;w<r;w++){t=v[w];s=0;x=t.nickname;while(typeof u[x]!=="undefined"){x=x+"_"+s;s+=1}u[x]=t;t.nickname=x;t.parentId=this.model.id;this.addOperation(t)}$(".toggleEndpointList",this.el).click(this.callDocs.bind(this,"toggleEndpointListForResource"));$(".collapseResource",this.el).click(this.callDocs.bind(this,"collapseOperationsForResource"));$(".expandResource",this.el).click(this.callDocs.bind(this,"expandOperationsForResource"));return this};p.prototype.addOperation=function(r){var s;r.number=this.number;s=new d({model:r,tagName:"li",className:"endpoint",swaggerOptions:this.options.swaggerOptions,auths:this.auths});$(".endpoints",$(this.el)).append(s.render().el);return this.number++};p.prototype.callDocs=function(s,r){r.preventDefault();return Docs[s](r.currentTarget.getAttribute("data-id"))};return p})(Backbone.View);d=(function(q){e(p,q);function p(){return p.__super__.constructor.apply(this,arguments)}p.prototype.invocationUrl=null;p.prototype.events={"submit .sandbox":"submitOperation","click .submit":"submitOperation","click .response_hider":"hideResponse","click .toggleOperation":"toggleOperationContent","mouseenter .api-ic":"mouseEnter","mouseout .api-ic":"mouseExit"};p.prototype.initialize=function(r){if(r==null){r={}}this.auths=r.auths;return this};p.prototype.mouseEnter=function(w){var u,v,B,s,r,C,z,t,D,A;u=$(w.currentTarget.parentNode).find("#api_information_panel");D=w.pageX;A=w.pageY;C=$(window).scrollLeft();z=$(window).scrollTop();s=C+$(window).width();r=z+$(window).height();t=u.width();v=u.height();if(D+t>s){D=s-t}if(D<C){D=C}if(A+v>r){A=r-v}if(A<z){A=z}B={};B.top=A;B.left=D;u.css(B);return $(w.currentTarget.parentNode).find("#api_information_panel").show()};p.prototype.mouseExit=function(r){return $(r.currentTarget.parentNode).find("#api_information_panel").hide()};p.prototype.render=function(){var ab,G,Z,s,L,K,V,H,R,u,P,t,J,M,T,aa,r,ac,N,Q,Y,X,W,U,I,z,y,x,w,S,O,F,E,D,C,B,A;K=true;if(!K){this.model.isReadOnly=true}this.model.description=this.model.description||this.model.notes;if(this.model.description){this.model.description=this.model.description.replace(/(?:\r\n|\r|\n)/g,"<br />")}this.model.oauth=null;log(this.model.authorizations);if(this.model.authorizations){if(Array.isArray(this.model.authorizations)){O=this.model.authorizations;for(Y=0,I=O.length;Y<I;Y++){Z=O[Y];for(H in Z){G=Z[H];for(ab in this.auths){G=this.auths[ab];if(G.type==="oauth2"){this.model.oauth={};this.model.oauth.scopes=[];F=G.value.scopes;for(V in F){N=F[V];R={scope:V,description:N};this.model.oauth.scopes.push(R)}}}}}}else{E=this.model.authorizations;for(V in E){N=E[V];if(V==="oauth2"){if(this.model.oauth===null){this.model.oauth={}}if(this.model.oauth.scopes===void 0){this.model.oauth.scopes=[]}for(X=0,z=N.length;X<z;X++){R=N[X];this.model.oauth.scopes.push(R)}}}}}if(typeof this.model.responses!=="undefined"){this.model.responseMessages=[];D=this.model.responses;for(s in D){Q=D[s];M=null;T=this.model.responses[s].schema;if(T&&T["$ref"]){M=T["$ref"];if(M.indexOf("#/definitions/")===0){M=M.substring("#/definitions/".length)}}this.model.responseMessages.push({code:s,message:Q.description,responseModel:M})}}if(typeof this.model.responseMessages==="undefined"){this.model.responseMessages=[]}$(this.el).html(Handlebars.templates.operation(this.model));if(this.model.responseClassSignature&&this.model.responseClassSignature!=="string"){aa={sampleJSON:this.model.responseSampleJSON,isParam:false,signature:this.model.responseClassSignature};J=new m({model:aa,tagName:"div"});$(".model-signature",$(this.el)).append(J.render().el)}else{this.model.responseClassSignature="string";$(".model-signature",$(this.el)).html(this.model.type)}L={isParam:false};L.consumes=this.model.consumes;L.produces=this.model.produces;C=this.model.parameters;for(W=0,y=C.length;W<y;W++){u=C[W];ac=u.type||u.dataType;if(typeof ac==="undefined"){M=u.schema;if(M&&M["$ref"]){P=M["$ref"];if(P.indexOf("#/definitions/")===0){ac=P.substring("#/definitions/".length)}else{ac=P}}}if(ac&&ac.toLowerCase()==="file"){if(!L.consumes){L.consumes="multipart/form-data"}}u.type=ac}t=new a({model:L});$(".response-content-type",$(this.el)).append(t.render().el);B=this.model.parameters;for(U=0,x=B.length;U<x;U++){u=B[U];this.addParameter(u,L.consumes)}A=this.model.responseMessages;for(S=0,w=A.length;S<w;S++){r=A[S];this.addStatusCode(r)}return this};p.prototype.addParameter=function(t,r){var s;t.consumes=r;s=new f({model:t,tagName:"tr",readOnly:this.model.isReadOnly});return $(".operation-params",$(this.el)).append(s.render().el)};p.prototype.addStatusCode=function(s){var r;r=new j({model:s,tagName:"tr"});return $(".operation-status",$(this.el)).append(r.render().el)};p.prototype.submitOperation=function(F){var H,v,E,t,w,r,x,C,B,z,G,u,s,D,A,y;if(F!=null){F.preventDefault()}v=$(".sandbox",$(this.el));H=true;v.find("input.required").each(function(){$(this).removeClass("error");if(jQuery.trim($(this).val())===""){$(this).addClass("error");$(this).wiggle({callback:(function(I){return function(){return $(I).focus()}})(this)});return H=false}});if(H){t={};r={parent:this};E=false;D=v.find("input");for(C=0,G=D.length;C<G;C++){w=D[C];if((w.value!=null)&&jQuery.trim(w.value).length>0){t[w.name]=w.value}if(w.type==="file"){E=true}}A=v.find("textarea");for(B=0,u=A.length;B<u;B++){w=A[B];if((w.value!=null)&&jQuery.trim(w.value).length>0){t[w.name]=w.value}}y=v.find("select");for(z=0,s=y.length;z<s;z++){w=y[z];x=this.getSelectedValue(w);if((x!=null)&&jQuery.trim(x).length>0){t[w.name]=x}}r.responseContentType=$("div select[name=responseContentType]",$(this.el)).val();r.requestContentType=$("div select[name=parameterContentType]",$(this.el)).val();$(".response_throbber",$(this.el)).show();if(E){return this.handleFileUpload(t,v)}else{return this.model["do"](t,r,this.showCompleteStatus,this.showErrorStatus,this)}}};p.prototype.success=function(r,s){return s.showCompleteStatus(r)};p.prototype.handleFileUpload=function(I,w){var E,v,r,F,D,B,G,y,u,t,s,H,L,K,J,C,A,z,x;C=w.serializeArray();for(y=0,H=C.length;y<H;y++){F=C[y];if((F.value!=null)&&jQuery.trim(F.value).length>0){I[F.name]=F.value}}E=new FormData();G=0;A=this.model.parameters;for(u=0,L=A.length;u<L;u++){B=A[u];if(B.paramType==="form"){if(B.type.toLowerCase()!=="file"&&I[B.name]!==void 0){E.append(B.name,I[B.name])}}}r={};z=this.model.parameters;for(t=0,K=z.length;t<K;t++){B=z[t];if(B.paramType==="header"){r[B.name]=I[B.name]}}x=w.find('input[type~="file"]');for(s=0,J=x.length;s<J;s++){v=x[s];if(typeof v.files[0]!=="undefined"){E.append($(v).attr("name"),v.files[0]);G+=1}}this.invocationUrl=this.model.supportHeaderParams()?(r=this.model.getHeaderParams(I),this.model.urlify(I,false)):this.model.urlify(I,true);$(".request_url",$(this.el)).html("<pre></pre>");$(".request_url pre",$(this.el)).text(this.invocationUrl);D={type:this.model.method,url:this.invocationUrl,headers:r,data:E,dataType:"json",contentType:false,processData:false,error:(function(M){return function(O,P,N){return M.showErrorStatus(M.wrap(O),M)}})(this),success:(function(M){return function(N){return M.showResponse(N,M)}})(this),complete:(function(M){return function(N){return M.showCompleteStatus(M.wrap(N),M)}})(this)};if(window.authorizations){window.authorizations.apply(D)}if(G===0){D.data.append("fake","true")}jQuery.ajax(D);return false};p.prototype.wrap=function(v){var t,w,y,s,x,u,r;y={};w=v.getAllResponseHeaders().split("\r");for(u=0,r=w.length;u<r;u++){s=w[u];t=s.split(":");if(t[0]!==void 0&&t[1]!==void 0){y[t[0].trim()]=t[1].trim()}}x={};x.content={};x.content.data=v.responseText;x.headers=y;x.request={};x.request.url=this.invocationUrl;x.status=v.status;return x};p.prototype.getSelectedValue=function(r){var u,t,w,s,v;if(!r.multiple){return r.value}else{t=[];v=r.options;for(w=0,s=v.length;w<s;w++){u=v[w];if(u.selected){t.push(u.value)}}if(t.length>0){return t}else{return null}}};p.prototype.hideResponse=function(r){if(r!=null){r.preventDefault()}$(".response",$(this.el)).slideUp();return $(".response_hider",$(this.el)).fadeOut()};p.prototype.showResponse=function(r){var s;s=JSON.stringify(r,null,"\t").replace(/\n/g,"<br>");return $(".response_body",$(this.el)).html(escape(s))};p.prototype.showErrorStatus=function(s,r){return r.showStatus(s)};p.prototype.showCompleteStatus=function(s,r){return r.showStatus(s)};p.prototype.formatXml=function(y){var u,x,s,z,E,A,t,r,C,D,w,v,B;r=/(>)(<)(\/*)/g;D=/[ ]*(.*)[ ]+\n/g;u=/(<.+>)(.+\n)/g;y=y.replace(r,"$1\n$2$3").replace(D,"$1\n").replace(u,"$1\n$2");t=0;x="";E=y.split("\n");s=0;z="other";C={"single->single":0,"single->closing":-1,"single->opening":0,"single->other":0,"closing->single":0,"closing->closing":-1,"closing->opening":0,"closing->other":0,"opening->single":1,"opening->closing":0,"opening->opening":1,"opening->other":1,"other->single":0,"other->closing":-1,"other->opening":0,"other->other":0};w=function(K){var G,F,I,M,J,H,L;H={single:Boolean(K.match(/<.+\/>/)),closing:Boolean(K.match(/<\/.+>/)),opening:Boolean(K.match(/<[^!?].*>/))};J=((function(){var N;N=[];for(I in H){L=H[I];if(L){N.push(I)}}return N})())[0];J=J===void 0?"other":J;G=z+"->"+J;z=J;M="";s+=C[G];M=((function(){var O,P,N;N=[];for(F=O=0,P=s;0<=P?O<P:O>P;F=0<=P?++O:--O){N.push(" ")}return N})()).join("");if(G==="opening->closing"){return x=x.substr(0,x.length-1)+K+"\n"}else{return x+=M+K+"\n"}};for(v=0,B=E.length;v<B;v++){A=E[v];w(A)}return x};p.prototype.showStatus=function(w){var t,A,C,z,u,D,r,v,y,x,s;if(w.content===void 0){A=w.data;s=w.url}else{A=w.content.data;s=w.request.url}u=w.headers;C=null;if(u){C=u["Content-Type"]||u["content-type"];if(C){C=C.split(";")[0].trim()}}if(!A){t=$("<code />").text("no content");v=$('<pre class="json" />').append(t)}else{if(C==="application/json"||/\+json$/.test(C)){D=null;try{D=JSON.stringify(JSON.parse(A),null," ")}catch(B){z=B;D="can't parse JSON. Raw result:\n\n"+A}t=$("<code />").text(D);v=$('<pre class="json" />').append(t)}else{if(C==="application/xml"||/\+xml$/.test(C)){t=$("<code />").text(this.formatXml(A));v=$('<pre class="xml" />').append(t)}else{if(C==="text/html"){t=$("<code />").html(_.escape(A));v=$('<pre class="xml" />').append(t)}else{if(/^image\//.test(C)){v=$("<img>").attr("src",s)}else{t=$("<code />").text(A);v=$('<pre class="json" />').append(t)}}}}}y=v;$(".request_url",$(this.el)).html("<pre></pre>");$(".request_url pre",$(this.el)).text(s);$(".response_code",$(this.el)).html("<pre>"+w.status+"</pre>");$(".response_body",$(this.el)).html(y);$(".response_headers",$(this.el)).html("<pre>"+_.escape(JSON.stringify(w.headers,null," ")).replace(/\n/g,"<br>")+"</pre>");$(".response",$(this.el)).slideDown();$(".response_hider",$(this.el)).show();$(".response_throbber",$(this.el)).hide();x=$(".response_body",$(this.el))[0];r=this.options.swaggerOptions;if(r.highlightSizeThreshold&&w.data.length>r.highlightSizeThreshold){return x}else{return hljs.highlightBlock(x)}};p.prototype.toggleOperationContent=function(){var r;r=$("#"+Docs.escapeResourceName(this.model.parentId)+"_"+this.model.nickname+"_content");if(r.is(":visible")){return Docs.collapseOperation(r)}else{return Docs.expandOperation(r)}};return p})(Backbone.View);j=(function(q){e(p,q);function p(){return p.__super__.constructor.apply(this,arguments)}p.prototype.initialize=function(){};p.prototype.render=function(){var s,r,t;t=this.template();$(this.el).html(t(this.model));if(swaggerUi.api.models.hasOwnProperty(this.model.responseModel)){s={sampleJSON:JSON.stringify(swaggerUi.api.models[this.model.responseModel].createJSONSample(),null,2),isParam:false,signature:swaggerUi.api.models[this.model.responseModel].getMockSignature()};r=new m({model:s,tagName:"div"});$(".model-signature",this.$el).append(r.render().el)}else{$(".model-signature",this.$el).html("")}return this};p.prototype.template=function(){return Handlebars.templates.status_code};return p})(Backbone.View);f=(function(q){e(p,q);function p(){return p.__super__.constructor.apply(this,arguments)}p.prototype.initialize=function(){return Handlebars.registerHelper("isArray",function(s,r){if(s.type.toLowerCase()==="array"||s.allowMultiple){return r.fn(this)}else{return r.inverse(this)}})};p.prototype.render=function(){var r,s,v,t,w,u,z,A,y,x;x=this.model.type||this.model.dataType;if(typeof x==="undefined"){u=this.model.schema;if(u&&u["$ref"]){t=u["$ref"];if(t.indexOf("#/definitions/")===0){x=t.substring("#/definitions/".length)}else{x=t}}}this.model.type=x;this.model.paramType=this.model["in"]||this.model.paramType;if(this.model.paramType==="body"){this.model.isBody=true}if(x&&x.toLowerCase()==="file"){this.model.isFile=true}this.model["default"]=this.model["default"]||this.model.defaultValue;y=this.template();$(this.el).html(y(this.model));z={sampleJSON:this.model.sampleJSON,isParam:true,signature:this.model.signature};if(this.model.sampleJSON){A=new m({model:z,tagName:"div"});$(".model-signature",$(this.el)).append(A.render().el)}else{$(".model-signature",$(this.el)).html(this.model.signature)}s=false;if(this.model.isBody){s=true}r={isParam:s};r.consumes=this.model.consumes;if(s){v=new n({model:r});$(".parameter-content-type",$(this.el)).append(v.render().el)}else{w=new a({model:r});$(".response-content-type",$(this.el)).append(w.render().el)}return this};p.prototype.template=function(){if(this.model.isList){return Handlebars.templates.param_list}else{if(this.options.readOnly){if(this.model.required){return Handlebars.templates.param_readonly_required}else{return Handlebars.templates.param_readonly}}else{if(this.model.required){return Handlebars.templates.param_required}else{return Handlebars.templates.param}}}};return p})(Backbone.View);m=(function(q){e(p,q);function p(){return p.__super__.constructor.apply(this,arguments)}p.prototype.events={"click a.description-link":"switchToDescription","click a.snippet-link":"switchToSnippet","mousedown .snippet":"snippetToTextArea"};p.prototype.initialize=function(){};p.prototype.render=function(){var r;r=this.template();$(this.el).html(r(this.model));this.switchToSnippet();this.isParam=this.model.isParam;if(this.isParam){$(".notice",$(this.el)).text("Click to set as parameter value")}return this};p.prototype.template=function(){return Handlebars.templates.signature};p.prototype.switchToDescription=function(r){if(r!=null){r.preventDefault()}$(".snippet",$(this.el)).hide();$(".description",$(this.el)).show();$(".description-link",$(this.el)).addClass("selected");return $(".snippet-link",$(this.el)).removeClass("selected")};p.prototype.switchToSnippet=function(r){if(r!=null){r.preventDefault()}$(".description",$(this.el)).hide();$(".snippet",$(this.el)).show();$(".snippet-link",$(this.el)).addClass("selected");return $(".description-link",$(this.el)).removeClass("selected")};p.prototype.snippetToTextArea=function(r){var s;if(this.isParam){if(r!=null){r.preventDefault()}s=$("textarea",$(this.el.parentNode.parentNode.parentNode));if($.trim(s.val())===""){return s.val(this.model.sampleJSON)}}};return p})(Backbone.View);g=(function(p){e(q,p);function q(){return q.__super__.constructor.apply(this,arguments)}q.prototype.initialize=function(){};q.prototype.render=function(){var r;r=this.template();$(this.el).html(r(this.model));$("label[for=contentType]",$(this.el)).text("Response Content Type");return this};q.prototype.template=function(){return Handlebars.templates.content_type};return q})(Backbone.View);a=(function(p){e(q,p);function q(){return q.__super__.constructor.apply(this,arguments)}q.prototype.initialize=function(){};q.prototype.render=function(){var r;r=this.template();$(this.el).html(r(this.model));$("label[for=responseContentType]",$(this.el)).text("Response Content Type");return this};q.prototype.template=function(){return Handlebars.templates.response_content_type};return q})(Backbone.View);n=(function(q){e(p,q);function p(){return p.__super__.constructor.apply(this,arguments)}p.prototype.initialize=function(){};p.prototype.render=function(){var r;r=this.template();$(this.el).html(r(this.model));$("label[for=parameterContentType]",$(this.el)).text("Parameter content type:");return this};p.prototype.template=function(){return Handlebars.templates.parameter_content_type};return p})(Backbone.View);o=(function(q){e(p,q);function p(){return p.__super__.constructor.apply(this,arguments)}p.prototype.initialize=function(){};p.prototype.render=function(){var r;r=this.template();$(this.el).html(r(this.model));return this};p.prototype.events={"click #apikey_button":"toggleApiKeyContainer","click #apply_api_key":"applyApiKey"};p.prototype.applyApiKey=function(){var r;window.authorizations.add(this.model.name,new ApiKeyAuthorization(this.model.name,$("#input_apiKey_entry").val(),this.model["in"]));window.swaggerUi.load();return r=$("#apikey_container").show()};p.prototype.toggleApiKeyContainer=function(){var r;if($("#apikey_container").length>0){r=$("#apikey_container").first();if(r.is(":visible")){return r.hide()}else{$(".auth_container").hide();return r.show()}}};p.prototype.template=function(){return Handlebars.templates.apikey_button_view};return p})(Backbone.View);l=(function(q){e(p,q);function p(){return p.__super__.constructor.apply(this,arguments)}p.prototype.initialize=function(){};p.prototype.render=function(){var r;r=this.template();$(this.el).html(r(this.model));return this};p.prototype.events={"click #basic_auth_button":"togglePasswordContainer","click #apply_basic_auth":"applyPassword"};p.prototype.applyPassword=function(){var s,r,t;console.log("applying password");t=$(".input_username").val();r=$(".input_password").val();window.authorizations.add(this.model.type,new PasswordAuthorization("basic",t,r));window.swaggerUi.load();return s=$("#basic_auth_container").hide()};p.prototype.togglePasswordContainer=function(){var r;if($("#basic_auth_container").length>0){r=$("#basic_auth_container").show();if(r.is(":visible")){return r.slideUp()}else{$(".auth_container").hide();return r.show()}}};p.prototype.template=function(){return Handlebars.templates.basic_auth_button_view};return p})(Backbone.View)}).call(this);