diff --git a/Dockerfile b/Dockerfile
index 21de4e2..e4773b7 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,12 +1,14 @@
# Base Image used to create this Image
-FROM debian:buster-slim
+FROM debian:bullseye-slim
# Maintainer
-LABEL maintainer="oliver@traber-info.de"
+LABEL maintainer="hi@bluemedia.dev"
ENV DEBIAN_FRONTEND noninteractive
ENV RTMP_PORT 1935
ENV HTTP_PORT 8080
+ENV HLS_FRAGMENT_LENGTH 3
+ENV HLS_PLAYLIST_LENGTH 20
# Update and install packages
RUN apt update -y && \
diff --git a/README.md b/README.md
index c9619b4..cfe9c0f 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,23 @@
# nginx-live
+
+
+
+
+ :warning: Notice
+ |
+
+
+
+
+
+
+ The docker image is now hosted as git.bluemedia.dev/bluemedia/nginx-live . The old registry name will continue to point to the current image for now, but may stop working at some point in the future.
+ |
+
+
+
+
nginx-live is a simple, lightweight, self-hosted video streaming service in a Docker container.
It allows you to securely stream video and audio from encoders such as OBS via RTMP or RTMPS. The stream is then converted to the HLS format so that it can be viewed by a larger number of viewers in their favorite browser.
@@ -10,7 +28,7 @@ It allows you to securely stream video and audio from encoders such as OBS via R
If you want to try nginx-live, or test a configuration change, you can start the container without any environment variables. In this case the ingest is done unencrypted via RTMP. The necessary stream key is generated randomly and printed in the Docker log during the first start.
```shell
-docker run -d --name streaming -p 8080:8080 -p 1935:1935 repo.bluemedia.dev/bluemedia/nginx-live
+docker run -d --name streaming -p 8080:8080 -p 1935:1935 git.bluemedia.dev/bluemedia/nginx-live
```
After launch, the web player should be available at `http://:8080/`.
@@ -25,7 +43,7 @@ docker run -d --name streaming -p 8080:8080 -p 1935:1935 \
-v /path/to/certs:/cert:ro \
-e TLS_CERT=fullchain.cer \
-e TLS_KEY=private.key \
-repo.bluemedia.dev/bluemedia/nginx-live
+git.bluemedia.dev/bluemedia/nginx-live
```
You will now need to set the server url in your streaming software in the following format: `rtmps://:/live`. It is important that you specify the RTMP port.
@@ -38,18 +56,20 @@ If you want to make the web player and the HLS files available via HTTPS, you ca
- `TLS_CERT` - File name of the TLS certificate file in the /cert directory inside the container. If set, encrypted ingest will be enabled on the RTMP port.
- `TLS_KEY` - File name of the private key that belongs to the TLS certificate.
- `STREAM_KEY` - Stream key, which is needed to ingest stream data. If the variable is not set, the key is randomly generated at container startup.
+- `HLS_FRAGMENT_LENGTH` - Length of one HLS fragment in seconds. Defaults to `3`.
+- `HLS_PLAYLIST_LENGTH` - Length of the HLS playlist in seconds. Defaults to `20`.
## Built with
- [NGINX](https://www.nginx.com/) High Performance Load Balancer, Web Server, & Reverse Proxy
- [nginx-rtmp-module](https://github.com/arut/nginx-rtmp-module) NGINX-based Media Streaming Server
-- [voc-player](https://github.com/voc/voc-player) HTML5 Stream Player for MPEG-DASH and HLS
+- [Clappr](https://github.com/clappr/clappr) Extensible media player for the web
## Project structure / Directories
- `config/` NGINX config files with various placeholders which will be replaced by the entrypoint script.
- `frontend/` All frontend related files. These will be copied to the web root of nginx.
## Automated image builds
-The Docker image `repo.bluemedia.dev/bluemedia/nginx-live` is built an pushed every two days by a Jenkins instance. Builds are based on the current main branch of this repository.
+The Docker image `git.bluemedia.dev/bluemedia/nginx-live` is built an pushed every two days by a Jenkins instance. Builds are based on the current main branch of this repository.
## Contribution Guidelines
diff --git a/config/nginx-ssl.conf.skel b/config/nginx-ssl.conf.skel
index d78aba1..aad2997 100644
--- a/config/nginx-ssl.conf.skel
+++ b/config/nginx-ssl.conf.skel
@@ -72,9 +72,10 @@ rtmp {
# Turn on HLS
hls on;
- hls_path /var/www/html/hls/;
- hls_fragment 3;
- hls_playlist_length 20;
+ hls_path /tmp/hls;
+ hls_fragment_naming system;
+ hls_fragment {HLS_FRAGMENT_LENGTH};
+ hls_playlist_length {HLS_PLAYLIST_LENGTH};
}
}
}
@@ -108,12 +109,17 @@ http {
return 404;
}
- # Disable cache
- add_header 'Cache-Control' 'no-cache';
+ # Serve HLS files from tempfs
+ location /hls {
+ root /tmp;
+ # Don't let browsers cache HLS files
+ add_header Cache-Control no-cache;
+ }
- root /var/www/html/;
- index index.html index.htm;
+ # Serve frontend
location / {
+ root /var/www/html;
+ index index.html index.htm;
try_files $uri $uri/ =404;
}
}
diff --git a/config/nginx.conf.skel b/config/nginx.conf.skel
index de7cb88..7694a6a 100644
--- a/config/nginx.conf.skel
+++ b/config/nginx.conf.skel
@@ -59,9 +59,10 @@ rtmp {
# Turn on HLS
hls on;
- hls_path /var/www/html/hls/;
- hls_fragment 3;
- hls_playlist_length 20;
+ hls_path /tmp/hls;
+ hls_fragment_naming system;
+ hls_fragment {HLS_FRAGMENT_LENGTH};
+ hls_playlist_length {HLS_PLAYLIST_LENGTH};
}
}
}
@@ -95,12 +96,17 @@ http {
return 404;
}
- # Disable cache
- add_header 'Cache-Control' 'no-cache';
+ # Serve HLS files from tempfs
+ location /hls {
+ root /tmp;
+ # Don't let browsers cache HLS files
+ add_header Cache-Control no-cache;
+ }
- root /var/www/html/;
- index index.html index.htm;
+ # Serve frontend
location / {
+ root /var/www/html;
+ index index.html index.htm;
try_files $uri $uri/ =404;
}
}
diff --git a/entrypoint b/entrypoint
index 121765a..7500433 100644
--- a/entrypoint
+++ b/entrypoint
@@ -26,6 +26,8 @@ if [ ! -f /setup.lock ]; then
sed -i "s/{RTMP_PORT}/$RTMP_PORT/g" /etc/nginx/nginx.conf
sed -i "s/{STREAM_KEY}/$VALID_STREAM_KEY/g" /etc/nginx/nginx.conf
sed -i "s/{HTTP_PORT}/$HTTP_PORT/g" /etc/nginx/nginx.conf
+ sed -i "s/{HLS_FRAGMENT_LENGTH}/$HLS_FRAGMENT_LENGTH/g" /etc/nginx/nginx.conf
+ sed -i "s/{HLS_PLAYLIST_LENGTH}/$HLS_PLAYLIST_LENGTH/g" /etc/nginx/nginx.conf
# Touch setup lock
touch /setup.lock
diff --git a/frontend/assets/js/player.js b/frontend/assets/js/player.js
deleted file mode 100644
index 2d34bdb..0000000
--- a/frontend/assets/js/player.js
+++ /dev/null
@@ -1,1144 +0,0 @@
-!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VOCPlayer=t():e.VOCPlayer=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=9)}([function(e,t,n){var r;window,r=function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="dist/",n(n.s="./src/main.js")}({"./node_modules/babel-runtime/core-js/array/from.js":
-/*!**********************************************************!*\
- !*** ./node_modules/babel-runtime/core-js/array/from.js ***!
- \**********************************************************/
-/*! no static exports found */function(e,t,n){e.exports={default:n(/*! core-js/library/fn/array/from */"./node_modules/core-js/library/fn/array/from.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/get-iterator.js":
-/*!************************************************************!*\
- !*** ./node_modules/babel-runtime/core-js/get-iterator.js ***!
- \************************************************************/
-/*! no static exports found */function(e,t,n){e.exports={default:n(/*! core-js/library/fn/get-iterator */"./node_modules/core-js/library/fn/get-iterator.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/json/stringify.js":
-/*!**************************************************************!*\
- !*** ./node_modules/babel-runtime/core-js/json/stringify.js ***!
- \**************************************************************/
-/*! no static exports found */function(e,t,n){e.exports={default:n(/*! core-js/library/fn/json/stringify */"./node_modules/core-js/library/fn/json/stringify.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/object/assign.js":
-/*!*************************************************************!*\
- !*** ./node_modules/babel-runtime/core-js/object/assign.js ***!
- \*************************************************************/
-/*! no static exports found */function(e,t,n){e.exports={default:n(/*! core-js/library/fn/object/assign */"./node_modules/core-js/library/fn/object/assign.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/object/create.js":
-/*!*************************************************************!*\
- !*** ./node_modules/babel-runtime/core-js/object/create.js ***!
- \*************************************************************/
-/*! no static exports found */function(e,t,n){e.exports={default:n(/*! core-js/library/fn/object/create */"./node_modules/core-js/library/fn/object/create.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/object/define-property.js":
-/*!**********************************************************************!*\
- !*** ./node_modules/babel-runtime/core-js/object/define-property.js ***!
- \**********************************************************************/
-/*! no static exports found */function(e,t,n){e.exports={default:n(/*! core-js/library/fn/object/define-property */"./node_modules/core-js/library/fn/object/define-property.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/object/get-own-property-descriptor.js":
-/*!**********************************************************************************!*\
- !*** ./node_modules/babel-runtime/core-js/object/get-own-property-descriptor.js ***!
- \**********************************************************************************/
-/*! no static exports found */function(e,t,n){e.exports={default:n(/*! core-js/library/fn/object/get-own-property-descriptor */"./node_modules/core-js/library/fn/object/get-own-property-descriptor.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/object/keys.js":
-/*!***********************************************************!*\
- !*** ./node_modules/babel-runtime/core-js/object/keys.js ***!
- \***********************************************************/
-/*! no static exports found */function(e,t,n){e.exports={default:n(/*! core-js/library/fn/object/keys */"./node_modules/core-js/library/fn/object/keys.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/object/set-prototype-of.js":
-/*!***********************************************************************!*\
- !*** ./node_modules/babel-runtime/core-js/object/set-prototype-of.js ***!
- \***********************************************************************/
-/*! no static exports found */function(e,t,n){e.exports={default:n(/*! core-js/library/fn/object/set-prototype-of */"./node_modules/core-js/library/fn/object/set-prototype-of.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/symbol.js":
-/*!******************************************************!*\
- !*** ./node_modules/babel-runtime/core-js/symbol.js ***!
- \******************************************************/
-/*! no static exports found */function(e,t,n){e.exports={default:n(/*! core-js/library/fn/symbol */"./node_modules/core-js/library/fn/symbol/index.js"),__esModule:!0}},"./node_modules/babel-runtime/core-js/symbol/iterator.js":
-/*!***************************************************************!*\
- !*** ./node_modules/babel-runtime/core-js/symbol/iterator.js ***!
- \***************************************************************/
-/*! no static exports found */function(e,t,n){e.exports={default:n(/*! core-js/library/fn/symbol/iterator */"./node_modules/core-js/library/fn/symbol/iterator.js"),__esModule:!0}},"./node_modules/babel-runtime/helpers/classCallCheck.js":
-/*!**************************************************************!*\
- !*** ./node_modules/babel-runtime/helpers/classCallCheck.js ***!
- \**************************************************************/
-/*! no static exports found */function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},"./node_modules/babel-runtime/helpers/createClass.js":
-/*!***********************************************************!*\
- !*** ./node_modules/babel-runtime/helpers/createClass.js ***!
- \***********************************************************/
-/*! no static exports found */function(e,t,n){"use strict";t.__esModule=!0;var r,i=n(/*! ../core-js/object/define-property */"./node_modules/babel-runtime/core-js/object/define-property.js"),a=(r=i)&&r.__esModule?r:{default:r};t.default=function(){function e(e,t){for(var n=0;n]*>/,p=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,m=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,g=/^(?:body|html)$/i,y=/([A-Z])/g,v=["val","css","html","text","data","width","height","offset"],b=u.createElement("table"),_=u.createElement("tr"),A={tr:u.createElement("tbody"),tbody:b,thead:b,tfoot:b,td:_,th:_,"*":u.createElement("div")},E=/complete|loaded|interactive/,T=/^[\w-]*$/,w={},S=w.toString,k={},C=u.createElement("div"),x={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},R=Array.isArray||function(e){return e instanceof Array};function L(e){return null==e?String(e):w[S.call(e)]||"object"}function I(e){return"function"==L(e)}function P(e){return null!=e&&e==e.window}function j(e){return null!=e&&e.nodeType==e.DOCUMENT_NODE}function O(e){return"object"==L(e)}function D(e){return O(e)&&!P(e)&&Object.getPrototypeOf(e)==Object.prototype}function M(e){var n=!!e&&"length"in e&&e.length,r=t.type(e);return"function"!=r&&!P(e)&&("array"==r||0===n||"number"==typeof n&&n>0&&n-1 in e)}function N(e){return e.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function U(e){return e in d?d[e]:d[e]=new RegExp("(^|\\s)"+e+"(\\s|$)")}function F(e,t){return"number"!=typeof t||f[N(e)]?t:t+"px"}function B(e){return"children"in e?l.call(e.children):t.map(e.childNodes,(function(e){if(1==e.nodeType)return e}))}function K(e,t){var n,r=e?e.length:0;for(n=0;n$2>")),void 0===n&&(n=h.test(e)&&RegExp.$1),n in A||(n="*"),(o=A[n]).innerHTML=""+e,i=t.each(l.call(o.childNodes),(function(){o.removeChild(this)}))),D(r)&&(a=t(i),t.each(r,(function(e,t){v.indexOf(e)>-1?a[e](t):a.attr(e,t)}))),i},k.Z=function(e,t){return new K(e,t)},k.isZ=function(e){return e instanceof k.Z},k.init=function(e,n){var r,i;if(!e)return k.Z();if("string"==typeof e)if("<"==(e=e.trim())[0]&&h.test(e))r=k.fragment(e,RegExp.$1,n),e=null;else{if(void 0!==n)return t(n).find(e);r=k.qsa(u,e)}else{if(I(e))return t(u).ready(e);if(k.isZ(e))return e;if(R(e))i=e,r=s.call(i,(function(e){return null!=e}));else if(O(e))r=[e],e=null;else if(h.test(e))r=k.fragment(e.trim(),RegExp.$1,n),e=null;else{if(void 0!==n)return t(n).find(e);r=k.qsa(u,e)}}return k.Z(r,e)},(t=function(e,t){return k.init(e,t)}).extend=function(e){var t,n=l.call(arguments,1);return"boolean"==typeof e&&(t=e,e=n.shift()),n.forEach((function(n){V(e,n,t)})),e},k.qsa=function(e,t){var n,r="#"==t[0],i=!r&&"."==t[0],a=r||i?t.slice(1):t,o=T.test(a);return e.getElementById&&o&&r?(n=e.getElementById(a))?[n]:[]:1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType?[]:l.call(o&&!r&&e.getElementsByClassName?i?e.getElementsByClassName(a):e.getElementsByTagName(t):e.querySelectorAll(t))},t.contains=u.documentElement.contains?function(e,t){return e!==t&&e.contains(t)}:function(e,t){for(;t&&(t=t.parentNode);)if(t===e)return!0;return!1},t.type=L,t.isFunction=I,t.isWindow=P,t.isArray=R,t.isPlainObject=D,t.isEmptyObject=function(e){var t;for(t in e)return!1;return!0},t.isNumeric=function(e){var t=Number(e),n=typeof e;return null!=e&&"boolean"!=n&&("string"!=n||e.length)&&!isNaN(t)&&isFinite(t)||!1},t.inArray=function(e,t,n){return a.indexOf.call(t,e,n)},t.camelCase=r,t.trim=function(e){return null==e?"":String.prototype.trim.call(e)},t.uuid=0,t.support={},t.expr={},t.noop=function(){},t.map=function(e,n){var r,i,a,o,s=[];if(M(e))for(i=0;i0?t.fn.concat.apply([],o):o},t.each=function(e,t){var n,r;if(M(e)){for(n=0;n=0?e:e+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each((function(){null!=this.parentNode&&this.parentNode.removeChild(this)}))},each:function(e){return a.every.call(this,(function(t,n){return!1!==e.call(t,n,t)})),this},filter:function(e){return I(e)?this.not(this.not(e)):t(s.call(this,(function(t){return k.matches(t,e)})))},add:function(e,n){return t(i(this.concat(t(e,n))))},is:function(e){return this.length>0&&k.matches(this[0],e)},not:function(e){var n=[];if(I(e)&&void 0!==e.call)this.each((function(t){e.call(this,t)||n.push(this)}));else{var r="string"==typeof e?this.filter(e):M(e)&&I(e.item)?l.call(e):t(e);this.forEach((function(e){r.indexOf(e)<0&&n.push(e)}))}return t(n)},has:function(e){return this.filter((function(){return O(e)?t.contains(this,e):t(this).find(e).size()}))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){var e=this[0];return e&&!O(e)?e:t(e)},last:function(){var e=this[this.length-1];return e&&!O(e)?e:t(e)},find:function(e){var n=this;return e?"object"==typeof e?t(e).filter((function(){var e=this;return a.some.call(n,(function(n){return t.contains(n,e)}))})):1==this.length?t(k.qsa(this[0],e)):this.map((function(){return k.qsa(this,e)})):t()},closest:function(e,n){var r=[],i="object"==typeof e&&t(e);return this.each((function(t,a){for(;a&&!(i?i.indexOf(a)>=0:k.matches(a,e));)a=a!==n&&!j(a)&&a.parentNode;a&&r.indexOf(a)<0&&r.push(a)})),t(r)},parents:function(e){for(var n=[],r=this;r.length>0;)r=t.map(r,(function(e){if((e=e.parentNode)&&!j(e)&&n.indexOf(e)<0)return n.push(e),e}));return G(n,e)},parent:function(e){return G(i(this.pluck("parentNode")),e)},children:function(e){return G(this.map((function(){return B(this)})),e)},contents:function(){return this.map((function(){return this.contentDocument||l.call(this.childNodes)}))},siblings:function(e){return G(this.map((function(e,t){return s.call(B(t.parentNode),(function(e){return e!==t}))})),e)},empty:function(){return this.each((function(){this.innerHTML=""}))},pluck:function(e){return t.map(this,(function(t){return t[e]}))},show:function(){return this.each((function(){var e,t,n;"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=(e=this.nodeName,c[e]||(t=u.createElement(e),u.body.appendChild(t),n=getComputedStyle(t,"").getPropertyValue("display"),t.parentNode.removeChild(t),"none"==n&&(n="block"),c[e]=n),c[e]))}))},replaceWith:function(e){return this.before(e).remove()},wrap:function(e){var n=I(e);if(this[0]&&!n)var r=t(e).get(0),i=r.parentNode||this.length>1;return this.each((function(a){t(this).wrapAll(n?e.call(this,a):i?r.cloneNode(!0):r)}))},wrapAll:function(e){if(this[0]){var n;for(t(this[0]).before(e=t(e));(n=e.children()).length;)e=n.first();t(e).append(this)}return this},wrapInner:function(e){var n=I(e);return this.each((function(r){var i=t(this),a=i.contents(),o=n?e.call(this,r):e;a.length?a.wrapAll(o):i.append(o)}))},unwrap:function(){return this.parent().each((function(){t(this).replaceWith(t(this).children())})),this},clone:function(){return this.map((function(){return this.cloneNode(!0)}))},hide:function(){return this.css("display","none")},toggle:function(e){return this.each((function(){var n=t(this);(void 0===e?"none"==n.css("display"):e)?n.show():n.hide()}))},prev:function(e){return t(this.pluck("previousElementSibling")).filter(e||"*")},next:function(e){return t(this.pluck("nextElementSibling")).filter(e||"*")},html:function(e){return 0 in arguments?this.each((function(n){var r=this.innerHTML;t(this).empty().append(H(this,e,n,r))})):0 in this?this[0].innerHTML:null},text:function(e){return 0 in arguments?this.each((function(t){var n=H(this,e,t,this.textContent);this.textContent=null==n?"":""+n})):0 in this?this.pluck("textContent").join(""):null},attr:function(t,n){var r;return"string"!=typeof t||1 in arguments?this.each((function(r){if(1===this.nodeType)if(O(t))for(e in t)Y(this,e,t[e]);else Y(this,t,H(this,n,r,this.getAttribute(t)))})):0 in this&&1==this[0].nodeType&&null!=(r=this[0].getAttribute(t))?r:void 0},removeAttr:function(e){return this.each((function(){1===this.nodeType&&e.split(" ").forEach((function(e){Y(this,e)}),this)}))},prop:function(e,t){return e=x[e]||e,1 in arguments?this.each((function(n){this[e]=H(this,t,n,this[e])})):this[0]&&this[0][e]},removeProp:function(e){return e=x[e]||e,this.each((function(){delete this[e]}))},data:function(e,t){var n="data-"+e.replace(y,"-$1").toLowerCase(),r=1 in arguments?this.attr(n,t):this.attr(n);return null!==r?W(r):void 0},val:function(e){return 0 in arguments?(null==e&&(e=""),this.each((function(t){this.value=H(this,e,t,this.value)}))):this[0]&&(this[0].multiple?t(this[0]).find("option").filter((function(){return this.selected})).pluck("value"):this[0].value)},offset:function(e){if(e)return this.each((function(n){var r=t(this),i=H(this,e,n,r.offset()),a=r.offsetParent().offset(),o={top:i.top-a.top,left:i.left-a.left};"static"==r.css("position")&&(o.position="relative"),r.css(o)}));if(!this.length)return null;if(u.documentElement!==this[0]&&!t.contains(u.documentElement,this[0]))return{top:0,left:0};var n=this[0].getBoundingClientRect();return{left:n.left+window.pageXOffset,top:n.top+window.pageYOffset,width:Math.round(n.width),height:Math.round(n.height)}},css:function(n,i){if(arguments.length<2){var a=this[0];if("string"==typeof n){if(!a)return;return a.style[r(n)]||getComputedStyle(a,"").getPropertyValue(n)}if(R(n)){if(!a)return;var o={},s=getComputedStyle(a,"");return t.each(n,(function(e,t){o[t]=a.style[r(t)]||s.getPropertyValue(t)})),o}}var l="";if("string"==L(n))i||0===i?l=N(n)+":"+F(n,i):this.each((function(){this.style.removeProperty(N(n))}));else for(e in n)n[e]||0===n[e]?l+=N(e)+":"+F(e,n[e])+";":this.each((function(){this.style.removeProperty(N(e))}));return this.each((function(){this.style.cssText+=";"+l}))},index:function(e){return e?this.indexOf(t(e)[0]):this.parent().children().indexOf(this[0])},hasClass:function(e){return!!e&&a.some.call(this,(function(e){return this.test(z(e))}),U(e))},addClass:function(e){return e?this.each((function(r){if("className"in this){n=[];var i=z(this);H(this,e,r,i).split(/\s+/g).forEach((function(e){t(this).hasClass(e)||n.push(e)}),this),n.length&&z(this,i+(i?" ":"")+n.join(" "))}})):this},removeClass:function(e){return this.each((function(t){if("className"in this){if(void 0===e)return z(this,"");n=z(this),H(this,e,t,n).split(/\s+/g).forEach((function(e){n=n.replace(U(e)," ")})),z(this,n.trim())}}))},toggleClass:function(e,n){return e?this.each((function(r){var i=t(this);H(this,e,r,z(this)).split(/\s+/g).forEach((function(e){(void 0===n?!i.hasClass(e):n)?i.addClass(e):i.removeClass(e)}))})):this},scrollTop:function(e){if(this.length){var t="scrollTop"in this[0];return void 0===e?t?this[0].scrollTop:this[0].pageYOffset:this.each(t?function(){this.scrollTop=e}:function(){this.scrollTo(this.scrollX,e)})}},scrollLeft:function(e){if(this.length){var t="scrollLeft"in this[0];return void 0===e?t?this[0].scrollLeft:this[0].pageXOffset:this.each(t?function(){this.scrollLeft=e}:function(){this.scrollTo(e,this.scrollY)})}},position:function(){if(this.length){var e=this[0],n=this.offsetParent(),r=this.offset(),i=g.test(n[0].nodeName)?{top:0,left:0}:n.offset();return r.top-=parseFloat(t(e).css("margin-top"))||0,r.left-=parseFloat(t(e).css("margin-left"))||0,i.top+=parseFloat(t(n[0]).css("border-top-width"))||0,i.left+=parseFloat(t(n[0]).css("border-left-width"))||0,{top:r.top-i.top,left:r.left-i.left}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent||u.body;e&&!g.test(e.nodeName)&&"static"==t(e).css("position");)e=e.offsetParent;return e}))}},t.fn.detach=t.fn.remove,["width","height"].forEach((function(e){var n=e.replace(/./,(function(e){return e[0].toUpperCase()}));t.fn[e]=function(r){var i,a=this[0];return void 0===r?P(a)?a["inner"+n]:j(a)?a.documentElement["scroll"+n]:(i=this.offset())&&i[e]:this.each((function(n){(a=t(this)).css(e,H(this,r,n,a[e]()))}))}})),["after","prepend","before","append"].forEach((function(e,n){var r=n%2;t.fn[e]=function(){var e,i,a=t.map(arguments,(function(n){var r=[];return"array"==(e=L(n))?(n.forEach((function(e){return void 0!==e.nodeType?r.push(e):t.zepto.isZ(e)?r=r.concat(e.get()):void(r=r.concat(k.fragment(e)))})),r):"object"==e||null==n?n:k.fragment(n)})),o=this.length>1;return a.length<1?this:this.each((function(e,s){i=r?s:s.parentNode,s=0==n?s.nextSibling:1==n?s.firstChild:2==n?s:null;var l=t.contains(u.documentElement,i);a.forEach((function(e){if(o)e=e.cloneNode(!0);else if(!i)return t(e).remove();i.insertBefore(e,s),l&&$(e,(function(e){if(!(null==e.nodeName||"SCRIPT"!==e.nodeName.toUpperCase()||e.type&&"text/javascript"!==e.type||e.src)){var t=e.ownerDocument?e.ownerDocument.defaultView:window;t.eval.call(t,e.innerHTML)}}))}))}))},t.fn[r?e+"To":"insert"+(n?"Before":"After")]=function(n){return t(n)[e](this),this}})),k.Z.prototype=K.prototype=t.fn,k.uniq=i,k.deserializeValue=W,t.zepto=k,t}();window.Zepto=r,void 0===window.$&&(window.$=r),function(e){var t,n,r=+new Date,i=window.document,a=/
+
+
+
+
-
-