diff --git a/Dockerfile b/Dockerfile index 2882cc8..74529cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,4 +6,4 @@ RUN npm ci --only=production COPY . . RUN npm run copy-h5p-standalone EXPOSE 80 -CMD [ "npm", "start" ] \ No newline at end of file +CMD [ "npm", "start" ] diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..8a222d0 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,97 @@ +void setBuildStatus(String message, String state, String repo ) { + step([ + $class: "GitHubCommitStatusSetter", + reposSource: [$class: "ManuallyEnteredRepositorySource", url: "https://github.com/$repo"], + contextSource: [$class: "ManuallyEnteredCommitContextSource", context: "ci/jenkins/build-status"], + errorHandlers: [[$class: "ChangingBuildStatusErrorHandler", result: "UNSTABLE"]], + statusResultSource: [ $class: "ConditionalStatusResultSource", results: [[$class: "AnyBuildResult", message: message, state: state]] ] + ]); +} + +pipeline { + + parameters { + gitParameter(name: "BRANCH_NAME", type: "PT_BRANCH", defaultValue: "master", branchFilter: "origin/(master|staging)") + booleanParam(name: 'DEPLOY', defaultValue: false, description: "Deploy To Kubernetes") + } + + agent { + kubernetes { + inheritFrom 'jenkins-agent' + yamlFile 'KubernetesPod.yaml' + } + } + + environment { + IMAGE_NAME = "scorm-h5p-wrapper" + REPO_NAME = "fioru-software/$IMAGE_NAME" + GITHUB_API_URL = "https://api.github.com/repos/$REPO_NAME" + GITHUB_TOKEN = credentials('jenkins-github-personal-access-token') + COMMIT_SHA = sh(script: "git log -1 --format=%H", returnStdout:true).trim() + GCLOUD_KEYFILE = credentials('jenkins-gcloud-keyfile'); + } + + stages { + + stage('Build') { + + when { + beforeAgent true; + allOf { + expression {return params.DEPLOY} + anyOf { + branch 'master'; + } + } + } + steps { + container('cloud-sdk') { + script { + sh 'gcloud auth activate-service-account jenkins-agent@veri-cluster.iam.gserviceaccount.com --key-file=${GCLOUD_KEYFILE}' + env.GCLOUD_TOKEN = sh(script: "gcloud auth print-access-token", returnStdout: true).trim() + } + } + container('docker') { + script { + sh 'docker login -u oauth2accesstoken -p $GCLOUD_TOKEN https://eu.gcr.io' + sh 'docker build --tag ${IMAGE_NAME}:${COMMIT_SHA} .' + sh 'docker tag ${IMAGE_NAME}:${COMMIT_SHA} eu.gcr.io/veri-cluster/${IMAGE_NAME}:${COMMIT_SHA}' + sh 'docker tag ${IMAGE_NAME}:${COMMIT_SHA} eu.gcr.io/veri-cluster/${IMAGE_NAME}:latest' + sh 'docker push eu.gcr.io/veri-cluster/${IMAGE_NAME}:${COMMIT_SHA}' + sh 'docker push eu.gcr.io/veri-cluster/${IMAGE_NAME}:latest' + } + } + } + } + + stage ('Deploy') { + when { + beforeAgent true; + allOf { + expression {return params.DEPLOY} + anyOf { + branch 'master'; + } + } + } + steps { + container('cloud-sdk') { + script { + sh "kubectl --token=$GCLOUD_TOKEN apply -k deployment/k8s/overlays/staging" + sh "kubectl --token=$GCLOUD_TOKEN rollout restart deployment ${IMAGE_NAME}" + sh "kubectl --token=$GCLOUD_TOKEN rollout status deployment ${IMAGE_NAME}" + } + } + } + } + + } + post { + success { + setBuildStatus("Success", "SUCCESS", REPO_NAME) + } + failure { + setBuildStatus("Failure", "FAILURE", REPO_NAME) + } + } +} diff --git a/KubernetesPod.yaml b/KubernetesPod.yaml new file mode 100644 index 0000000..b6f7613 --- /dev/null +++ b/KubernetesPod.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: Pod +metadata: +labels: + component: ci +spec: + # Use service account that can deploy to all namespaces + containers: + - name: cloud-sdk + image: gcr.io/google.com/cloudsdktool/cloud-sdk + imagePullPolicy: Always + env: + - name: CLOUDSDK_CONTAINER_CLUSTER + value: belgium-01 + - name: CLOUDSDK_COMPUTE_ZONE + value: europe-west1-d + command: + - sleep + args: + - infinity + - name: docker + image: docker:20.10.12-alpine3.15 + imagePullPolicy: IfNotPresent + command: + - sleep + args: + - infinity + volumeMounts: + - name: docker + mountPath: /var/run/docker.sock # We use the k8s host docker engine + volumes: + - name: docker + hostPath: + path: /var/run/docker.sock diff --git a/deployment/k8s/base/deployment.yaml b/deployment/k8s/base/deployment.yaml new file mode 100644 index 0000000..dc4e8a2 --- /dev/null +++ b/deployment/k8s/base/deployment.yaml @@ -0,0 +1,69 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: scorm-h5p-wrapper + labels: + app: scorm-h5p-wrapper +spec: + replicas: 1 + revisionHistoryLimit: 3 + strategy: + type: Recreate + selector: + matchLabels: + app: scorm-h5p-wrapper + template: + metadata: + labels: + app: scorm-h5p-wrapper + spec: + securityContext: + fsGroup: 1000 + #runAsGroup: 33 + #fsGroupChangePolicy: "OnRootMismatch" + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: cloud.google.com/gke-preemptible + operator: DoesNotExist + - key: cloud.google.com/gke-nodepool + operator: In + values: + - spot-pool + containers: + - name: scorm-h5p-wrapper + image: eu.gcr.io/veri-cluster/scorm-h5p-wrapper + imagePullPolicy: Always + securityContext: + allowPrivilegeEscalation: false + ports: + - containerPort: 8080 + readinessProbe: + httpGet: + path: / + port: 80 + periodSeconds: 60 + timeoutSeconds: 30 + livenessProbe: + httpGet: + path: / + port: 80 + periodSeconds: 60 + timeoutSeconds: 30 + startupProbe: + initialDelaySeconds: 60 + httpGet: + path: / + port: 80 + periodSeconds: 60 + timeoutSeconds: 30 + resources: + limits: + cpu: 500m + memory: 512M + requests: + cpu: 250m + memory: 256M + diff --git a/deployment/k8s/base/ingress.yaml b/deployment/k8s/base/ingress.yaml new file mode 100644 index 0000000..35581ba --- /dev/null +++ b/deployment/k8s/base/ingress.yaml @@ -0,0 +1,28 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: scorm-h5p-wrapper-ingress + annotations: + nginx.ingress.kubernetes.io/auth-url: https://basic-auth.veri.ie/ + nginx.ingress.kubernetes.io/proxy-body-size: "20m" + nginx.ingress.kubernetes.io/client-max-body-size: "20m" + nginx.ingress.kubernetes.io/proxy-buffer-size: "16k" + nginx.ingress.kubernetes.io/proxy-connect-timeout: "60" + nginx.ingress.kubernetes.io/proxy-read-timeout: "60" + nginx.ingress.kubernetes.io/proxy-send-timeout: "60" +spec: + ingressClassName: nginx + rules: + - host: scorm-h5p-wrapper.veri.ie + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: scorm-h5p-wrapper-service + port: + number: 8080 + tls: + - hosts: + - scorm-h5p-wrapper.veri.ie diff --git a/deployment/k8s/base/kustomization.yaml b/deployment/k8s/base/kustomization.yaml new file mode 100644 index 0000000..86643a1 --- /dev/null +++ b/deployment/k8s/base/kustomization.yaml @@ -0,0 +1,21 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - ingress.yaml + - deployment.yaml + - service.yaml + + + + + + + + + + + + + + diff --git a/deployment/k8s/base/service.yaml b/deployment/k8s/base/service.yaml new file mode 100644 index 0000000..7a2a601 --- /dev/null +++ b/deployment/k8s/base/service.yaml @@ -0,0 +1,15 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: scorm-h5p-wrapper-service + labels: + app: scorm-h5p-wrapper-service +spec: + selector: + app: scorm-h5p-wrapper + ports: + - name: http + protocol: TCP + port: 8080 + targetPort: 80 diff --git a/deployment/k8s/overlays/staging/kustomization.yaml b/deployment/k8s/overlays/staging/kustomization.yaml new file mode 100644 index 0000000..e4c7c50 --- /dev/null +++ b/deployment/k8s/overlays/staging/kustomization.yaml @@ -0,0 +1,8 @@ +namePrefix: staging- + +generatorOptions: + disableNameSuffixHash: true + +bases: + - ../../base + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100755 index 0000000..8c24628 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: "3.7" + +services: + + node: + build: + context: . + environment: + - PORT=80 + volumes: + - ./static:/usr/src/app/static + ports: + - "8080:80" + diff --git a/edited-h5p-standalone/frame.bundle.js b/edited-h5p-standalone/frame.bundle.js new file mode 100644 index 0000000..2fee8ff --- /dev/null +++ b/edited-h5p-standalone/frame.bundle.js @@ -0,0 +1,524 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["h5p-standalone"]=t():e.H5PStandalone=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=16)}([,,function(e,t,n){var r;/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license +*/ +!function(i,o){var a,s,c=typeof o,l=i.document,u=i.location,d=i.jQuery,f=i.$,p={},h=[],g="1.9.1",m=h.concat,v=h.push,y=h.slice,b=h.indexOf,x=p.toString,w=p.hasOwnProperty,C=g.trim,T=function(e,t){return new T.fn.init(e,t,s)},E=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,S=/\S+/g,k=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,P=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,A=/^[\],:{}\s]*$/,D=/(?:^|:|,)(?:\s*\[)+/g,H=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,L=/^-ms-/,I=/-([\da-z])/gi,F=function(e,t){return t.toUpperCase()},O=function(e){(l.addEventListener||"load"===e.type||"complete"===l.readyState)&&(M(),T.ready())},M=function(){l.addEventListener?(l.removeEventListener("DOMContentLoaded",O,!1),i.removeEventListener("load",O,!1)):(l.detachEvent("onreadystatechange",O),i.detachEvent("onload",O))};function q(e){var t=e.length,n=T.type(e);return!T.isWindow(e)&&(!(1!==e.nodeType||!t)||("array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)))} +T.fn=T.prototype={jquery:g,constructor:T,init:function(e,t,n){var r,i;if(!e) +return this;if("string"==typeof e){if(!(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e))||!r[1]&&t) +return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof T?t[0]:t,T.merge(this,T.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:l,!0)),P.test(r[1])&&T.isPlainObject(t)) +for(r in t) +T.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this} +if((i=l.getElementById(r[2]))&&i.parentNode){if(i.id!==r[2]) +return n.find(e);this.length=1,this[0]=i} +return this.context=l,this.selector=e,this} +return e.nodeType?(this.context=this[0]=e,this.length=1,this):T.isFunction(e)?n.ready(e):(e.selector!==o&&(this.selector=e.selector,this.context=e.context),T.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return y.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=T.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return T.each(this,e,t)},ready:function(e){return T.ready.promise().done(e),this},slice:function(){return this.pushStack(y.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(T.map(this,(function(t,n){return e.call(t,n,t)})))},end:function(){return this.prevObject||this.constructor(null)},push:v,sort:[].sort,splice:[].splice},T.fn.init.prototype=T.fn,T.extend=T.fn.extend=function(){var e,t,n,r,i,a,s=arguments[0]||{},c=1,l=arguments.length,u=!1;for("boolean"==typeof s&&(u=s,s=arguments[1]||{},c=2),"object"==typeof s||T.isFunction(s)||(s={}),l===c&&(s=this,--c);l>c;c++) +if(null!=(i=arguments[c])) +for(r in i) +e=s[r],s!==(n=i[r])&&(u&&n&&(T.isPlainObject(n)||(t=T.isArray(n)))?(t?(t=!1,a=e&&T.isArray(e)?e:[]):a=e&&T.isPlainObject(e)?e:{},s[r]=T.extend(u,a,n)):n!==o&&(s[r]=n));return s},T.extend({noConflict:function(e){return i.$===T&&(i.$=f),e&&i.jQuery===T&&(i.jQuery=d),T},isReady:!1,readyWait:1,holdReady:function(e){e?T.readyWait++:T.ready(!0)},ready:function(e){if(!0===e?!--T.readyWait:!T.isReady){if(!l.body) +return setTimeout(T.ready);T.isReady=!0,!0!==e&&--T.readyWait>0||(a.resolveWith(l,[T]),T.fn.trigger&&T(l).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===T.type(e)},isArray:Array.isArray||function(e){return"array"===T.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?p[x.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==T.type(e)||e.nodeType||T.isWindow(e)) +return!1;try{if(e.constructor&&!w.call(e,"constructor")&&!w.call(e.constructor.prototype,"isPrototypeOf")) +return!1}catch(e){return!1} +var t;for(t in e);return t===o||w.call(e,t)},isEmptyObject:function(e){var t;for(t in e) +return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e) +return null;"boolean"==typeof t&&(n=t,t=!1),t=t||l;var r=P.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=T.buildFragment([e],t,i),i&&T(i).remove(),T.merge([],r.childNodes))},parseJSON:function(e){return i.JSON&&i.JSON.parse?i.JSON.parse(e):null===e?e:"string"==typeof e&&((e=T.trim(e))&&A.test(e.replace(H,"@").replace(j,"]").replace(D,"")))?Function("return "+e)():(T.error("Invalid JSON: "+e),o)},parseXML:function(e){var t;if(!e||"string"!=typeof e) +return null;try{i.DOMParser?t=(new DOMParser).parseFromString(e,"text/xml"):((t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e))}catch(e){t=o} +return t&&t.documentElement&&!t.getElementsByTagName("parsererror").length||T.error("Invalid XML: "+e),t},noop:function(){},globalEval:function(e){e&&T.trim(e)&&(i.execScript||function(e){i.eval.call(i,e)})(e)},camelCase:function(e){return e.replace(L,"ms-").replace(I,F)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r=0,i=e.length,o=q(e);if(n){if(o) +for(;i>r&&!1!==t.apply(e[r],n);r++);else for(r in e) +if(!1===t.apply(e[r],n)) +break}else if(o) +for(;i>r&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e) +if(!1===t.call(e[r],r,e[r])) +break;return e},trim:C&&!C.call("\ufeff ")?function(e){return null==e?"":C.call(e)}:function(e){return null==e?"":(e+"").replace(k,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(q(Object(e))?T.merge(n,"string"==typeof e?[e]:e):v.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(b) +return b.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++) +if(n in t&&t[n]===e) +return n} +return-1},merge:function(e,t){var n=t.length,r=e.length,i=0;if("number"==typeof n) +for(;n>i;i++) +e[r++]=t[i];else for(;t[i]!==o;) +e[r++]=t[i++];return e.length=r,e},grep:function(e,t,n){var r=[],i=0,o=e.length;for(n=!!n;o>i;i++) +n!==!!t(e[i],i)&&r.push(e[i]);return r},map:function(e,t,n){var r,i=0,o=e.length,a=[];if(q(e)) +for(;o>i;i++) +null!=(r=t(e[i],i,n))&&(a[a.length]=r);else for(i in e) +null!=(r=t(e[i],i,n))&&(a[a.length]=r);return m.apply([],a)},guid:1,proxy:function(e,t){var n,r,i;return"string"==typeof t&&(i=e[t],t=e,e=i),T.isFunction(e)?(n=y.call(arguments,2),(r=function(){return e.apply(t||this,n.concat(y.call(arguments)))}).guid=e.guid=e.guid||T.guid++,r):o},access:function(e,t,n,r,i,a,s){var c=0,l=e.length,u=null==n;if("object"===T.type(n)) +for(c in i=!0,n) +T.access(e,t,c,n[c],!0,a,s);else if(r!==o&&(i=!0,T.isFunction(r)||(s=!0),u&&(s?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(T(e),n)})),t)) +for(;l>c;c++) +t(e[c],n,s?r:r.call(e[c],c,t(e[c],n)));return i?e:u?t.call(e):l?t(e[0],n):a},now:function(){return(new Date).getTime()}}),T.ready.promise=function(e){if(!a) +if(a=T.Deferred(),"complete"===l.readyState) +setTimeout(T.ready);else if(l.addEventListener) +l.addEventListener("DOMContentLoaded",O,!1),i.addEventListener("load",O,!1);else{l.attachEvent("onreadystatechange",O),i.attachEvent("onload",O);var t=!1;try{t=null==i.frameElement&&l.documentElement}catch(e){} +t&&t.doScroll&&function e(){if(!T.isReady){try{t.doScroll("left")}catch(t){return setTimeout(e,50)} +M(),T.ready()}}()} +return a.promise(e)},T.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),(function(e,t){p["[object "+t+"]"]=t.toLowerCase()})),s=T(l);var B={};T.Callbacks=function(e){e="string"==typeof e?B[e]||function(e){var t=B[e]={};return T.each(e.match(S)||[],(function(e,n){t[n]=!0})),t}(e):T.extend({},e);var t,n,r,i,a,s,c=[],l=!e.once&&[],u=function(o){for(n=e.memory&&o,r=!0,a=s||0,s=0,i=c.length,t=!0;c&&i>a;a++) +if(!1===c[a].apply(o[0],o[1])&&e.stopOnFalse){n=!1;break} +t=!1,c&&(l?l.length&&u(l.shift()):n?c=[]:d.disable())},d={add:function(){if(c){var r=c.length;(function t(n){T.each(n,(function(n,r){var i=T.type(r);"function"===i?e.unique&&d.has(r)||c.push(r):r&&r.length&&"string"!==i&&t(r)}))})(arguments),t?i=c.length:n&&(s=r,u(n))} +return this},remove:function(){return c&&T.each(arguments,(function(e,n){for(var r;(r=T.inArray(n,c,r))>-1;) +c.splice(r,1),t&&(i>=r&&i--,a>=r&&a--)})),this},has:function(e){return e?T.inArray(e,c)>-1:!(!c||!c.length)},empty:function(){return c=[],this},disable:function(){return c=l=n=o,this},disabled:function(){return!c},lock:function(){return l=o,n||d.disable(),this},locked:function(){return!l},fireWith:function(e,n){return n=[e,(n=n||[]).slice?n.slice():n],!c||r&&!l||(t?l.push(n):u(n)),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!r}};return d},T.extend({Deferred:function(e){var t=[["resolve","done",T.Callbacks("once memory"),"resolved"],["reject","fail",T.Callbacks("once memory"),"rejected"],["notify","progress",T.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return T.Deferred((function(n){T.each(t,(function(t,o){var a=o[0],s=T.isFunction(e[t])&&e[t];i[o[1]]((function(){var e=s&&s.apply(this,arguments);e&&T.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)}))})),e=null})).promise()},promise:function(e){return null!=e?T.extend(e,r):r}},i={};return r.pipe=r.then,T.each(t,(function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add((function(){n=s}),t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith})),r.promise(i),e&&e.call(i,i),i},when:function(e){var t,n,r,i=0,o=y.call(arguments),a=o.length,s=1!==a||e&&T.isFunction(e.promise)?a:0,c=1===s?e:T.Deferred(),l=function(e,n,r){return function(i){n[e]=this,r[e]=arguments.length>1?y.call(arguments):i,r===t?c.notifyWith(n,r):--s||c.resolveWith(n,r)}};if(a>1) +for(t=Array(a),n=Array(a),r=Array(a);a>i;i++) +o[i]&&T.isFunction(o[i].promise)?o[i].promise().done(l(i,r,o)).fail(c.reject).progress(l(i,n,t)):--s;return s||c.resolveWith(r,o),c.promise()}}),T.support=function(){var e,t,n,r,o,a,s,u,d,f,p=l.createElement("div");if(p.setAttribute("className","t"),p.innerHTML="
a",t=p.getElementsByTagName("*"),n=p.getElementsByTagName("a")[0],!t||!n||!t.length) +return{};s=(o=l.createElement("select")).appendChild(l.createElement("option")),r=p.getElementsByTagName("input")[0],n.style.cssText="top:1px;float:left;opacity:.5",e={getSetAttribute:"t"!==p.className,leadingWhitespace:3===p.firstChild.nodeType,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(n.getAttribute("style")),hrefNormalized:"/a"===n.getAttribute("href"),opacity:/^0.5/.test(n.style.opacity),cssFloat:!!n.style.cssFloat,checkOn:!!r.value,optSelected:s.selected,enctype:!!l.createElement("form").enctype,html5Clone:"<:nav>"!==l.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===l.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},r.checked=!0,e.noCloneChecked=r.cloneNode(!0).checked,o.disabled=!0,e.optDisabled=!s.disabled;try{delete p.test}catch(t){e.deleteExpando=!1} +for(f in(r=l.createElement("input")).setAttribute("value",""),e.input=""===r.getAttribute("value"),r.value="t",r.setAttribute("type","radio"),e.radioValue="t"===r.value,r.setAttribute("checked","t"),r.setAttribute("name","t"),(a=l.createDocumentFragment()).appendChild(r),e.appendChecked=r.checked,e.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,p.attachEvent&&(p.attachEvent("onclick",(function(){e.noCloneEvent=!1})),p.cloneNode(!0).click()),{submit:!0,change:!0,focusin:!0}) +p.setAttribute(u="on"+f,"t"),e[f+"Bubbles"]=u in i||!1===p.attributes[u].expando;return p.style.backgroundClip="content-box",p.cloneNode(!0).style.backgroundClip="",e.clearCloneStyle="content-box"===p.style.backgroundClip,T((function(){var t,n,r,o="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",a=l.getElementsByTagName("body")[0];a&&((t=l.createElement("div")).style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(t).appendChild(p),p.innerHTML="
t
",(r=p.getElementsByTagName("td"))[0].style.cssText="padding:0;margin:0;border:0;display:none",d=0===r[0].offsetHeight,r[0].style.display="",r[1].style.display="none",e.reliableHiddenOffsets=d&&0===r[0].offsetHeight,p.innerHTML="",p.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",e.boxSizing=4===p.offsetWidth,e.doesNotIncludeMarginInBodyOffset=1!==a.offsetTop,i.getComputedStyle&&(e.pixelPosition="1%"!==(i.getComputedStyle(p,null)||{}).top,e.boxSizingReliable="4px"===(i.getComputedStyle(p,null)||{width:"4px"}).width,(n=p.appendChild(l.createElement("div"))).style.cssText=p.style.cssText=o,n.style.marginRight=n.style.width="0",p.style.width="1px",e.reliableMarginRight=!parseFloat((i.getComputedStyle(n,null)||{}).marginRight)),typeof p.style.zoom!==c&&(p.innerHTML="",p.style.cssText=o+"width:1px;padding:1px;display:inline;zoom:1",e.inlineBlockNeedsLayout=3===p.offsetWidth,p.style.display="block",p.innerHTML="
",p.firstChild.style.width="5px",e.shrinkWrapBlocks=3!==p.offsetWidth,e.inlineBlockNeedsLayout&&(a.style.zoom=1)),a.removeChild(t),t=p=r=n=null)})),t=o=a=s=n=r=null,e}();var R=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,_=/([A-Z])/g;function z(e,t,n,r){if(T.acceptData(e)){var i,a,s=T.expando,c="string"==typeof t,l=e.nodeType,u=l?T.cache:e,d=l?e[s]:e[s]&&s;if(d&&u[d]&&(r||u[d].data)||!c||n!==o) +return d||(l?e[s]=d=h.pop()||T.guid++:d=s),u[d]||(u[d]={},l||(u[d].toJSON=T.noop)),("object"==typeof t||"function"==typeof t)&&(r?u[d]=T.extend(u[d],t):u[d].data=T.extend(u[d].data,t)),i=u[d],r||(i.data||(i.data={}),i=i.data),n!==o&&(i[T.camelCase(t)]=n),c?null==(a=i[t])&&(a=i[T.camelCase(t)]):a=i,a}} +function Q(e,t,n){if(T.acceptData(e)){var r,i,o,a=e.nodeType,s=a?T.cache:e,c=a?e[T.expando]:T.expando;if(s[c]){if(t&&(o=n?s[c]:s[c].data)){T.isArray(t)?t=t.concat(T.map(t,T.camelCase)):t in o?t=[t]:t=(t=T.camelCase(t))in o?[t]:t.split(" ");for(r=0,i=t.length;i>r;r++) +delete o[t[r]];if(!(n?X:T.isEmptyObject)(o)) +return}(n||(delete s[c].data,X(s[c])))&&(a?T.cleanData([e],!0):T.support.deleteExpando||s!=s.window?delete s[c]:s[c]=null)}}} +function $(e,t,n){if(n===o&&1===e.nodeType){var r="data-"+t.replace(_,"-$1").toLowerCase();if("string"==typeof(n=e.getAttribute(r))){try{n="true"===n||"false"!==n&&("null"===n?null:+n+""===n?+n:R.test(n)?T.parseJSON(n):n)}catch(e){} +T.data(e,t,n)}else n=o} +return n} +function X(e){var t;for(t in e) +if(("data"!==t||!T.isEmptyObject(e[t]))&&"toJSON"!==t) +return!1;return!0} +T.extend({cache:{},expando:"jQuery"+(g+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return!!(e=e.nodeType?T.cache[e[T.expando]]:e[T.expando])&&!X(e)},data:function(e,t,n){return z(e,t,n)},removeData:function(e,t){return Q(e,t)},_data:function(e,t,n){return z(e,t,n,!0)},_removeData:function(e,t){return Q(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType) +return!1;var t=e.nodeName&&T.noData[e.nodeName.toLowerCase()];return!t||!0!==t&&e.getAttribute("classid")===t}}),T.fn.extend({data:function(e,t){var n,r,i=this[0],a=0,s=null;if(e===o){if(this.length&&(s=T.data(i),1===i.nodeType&&!T._data(i,"parsedAttrs"))){for(n=i.attributes;n.length>a;a++)(r=n[a].name).indexOf("data-")||(r=T.camelCase(r.slice(5)),$(i,r,s[r]));T._data(i,"parsedAttrs",!0)} +return s} +return"object"==typeof e?this.each((function(){T.data(this,e)})):T.access(this,(function(t){return t===o?i?$(i,e,T.data(i,e)):null:(this.each((function(){T.data(this,e,t)})),o)}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){T.removeData(this,e)}))}}),T.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=T._data(e,t),n&&(!r||T.isArray(n)?r=T._data(e,t,T.makeArray(n)):r.push(n)),r||[]):o},dequeue:function(e,t){t=t||"fx";var n=T.queue(e,t),r=n.length,i=n.shift(),o=T._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){T.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return T._data(e,n)||T._data(e,n,{empty:T.Callbacks("once memory").add((function(){T._removeData(e,t+"queue"),T._removeData(e,n)}))})}}),T.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),n>arguments.length?T.queue(this[0],e):t===o?this:this.each((function(){var n=T.queue(this,e,t);T._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&T.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){T.dequeue(this,e)}))},delay:function(e,t){return e=T.fx&&T.fx.speeds[e]||e,t=t||"fx",this.queue(t,(function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=T.Deferred(),a=this,s=this.length,c=function(){--r||i.resolveWith(a,[a])};for("string"!=typeof e&&(t=e,e=o),e=e||"fx";s--;)(n=T._data(a[s],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(c));return c(),i.promise(t)}});var W,U,V=/[\t\r\n]/g,Y=/\r/g,J=/^(?:input|select|textarea|button|object)$/i,G=/^(?:a|area)$/i,K=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,Z=/^(?:checked|selected)$/i,ee=T.support.getSetAttribute,te=T.support.input;T.fn.extend({attr:function(e,t){return T.access(this,T.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){T.removeAttr(this,e)}))},prop:function(e,t){return T.access(this,T.prop,e,t,arguments.length>1)},removeProp:function(e){return e=T.propFix[e]||e,this.each((function(){try{this[e]=o,delete this[e]}catch(e){}}))},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,c="string"==typeof e&&e;if(T.isFunction(e)) +return this.each((function(t){T(this).addClass(e.call(this,t,this.className))}));if(c) +for(t=(e||"").match(S)||[];s>a;a++) +if(r=1===(n=this[a]).nodeType&&(n.className?(" "+n.className+" ").replace(V," "):" ")){for(o=0;i=t[o++];) +0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=T.trim(r)} +return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,c=0===arguments.length||"string"==typeof e&&e;if(T.isFunction(e)) +return this.each((function(t){T(this).removeClass(e.call(this,t,this.className))}));if(c) +for(t=(e||"").match(S)||[];s>a;a++) +if(r=1===(n=this[a]).nodeType&&(n.className?(" "+n.className+" ").replace(V," "):"")){for(o=0;i=t[o++];) +for(;r.indexOf(" "+i+" ")>=0;) +r=r.replace(" "+i+" "," ");n.className=e?T.trim(r):""} +return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return T.isFunction(e)?this.each((function(n){T(this).toggleClass(e.call(this,n,this.className,t),t)})):this.each((function(){if("string"===n) +for(var i,o=0,a=T(this),s=t,l=e.match(S)||[];i=l[o++];) +s=r?s:!a.hasClass(i),a[s?"addClass":"removeClass"](i);else(n===c||"boolean"===n)&&(this.className&&T._data(this,"__className__",this.className),this.className=this.className||!1===e?"":T._data(this,"__className__")||"")}))},hasClass:function(e){for(var t=" "+e+" ",n=0,r=this.length;r>n;n++) +if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(V," ").indexOf(t)>=0) +return!0;return!1},val:function(e){var t,n,r,i=this[0];return arguments.length?(r=T.isFunction(e),this.each((function(t){var i,a=T(this);1===this.nodeType&&(null==(i=r?e.call(this,t,a.val()):e)?i="":"number"==typeof i?i+="":T.isArray(i)&&(i=T.map(i,(function(e){return null==e?"":e+""}))),(n=T.valHooks[this.type]||T.valHooks[this.nodeName.toLowerCase()])&&"set"in n&&n.set(this,i,"value")!==o||(this.value=i))}))):i?(n=T.valHooks[i.type]||T.valHooks[i.nodeName.toLowerCase()])&&"get"in n&&(t=n.get(i,"value"))!==o?t:"string"==typeof(t=i.value)?t.replace(Y,""):null==t?"":t:void 0}}),T.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){for(var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,c=0>i?s:o?i:0;s>c;c++) +if(!(!(n=r[c]).selected&&c!==i||(T.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&T.nodeName(n.parentNode,"optgroup"))){if(t=T(n).val(),o) +return t;a.push(t)} +return a},set:function(e,t){var n=T.makeArray(t);return T(e).find("option").each((function(){this.selected=T.inArray(T(this).val(),n)>=0})),n.length||(e.selectedIndex=-1),n}}},attr:function(e,t,n){var r,i,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s) +return typeof e.getAttribute===c?T.prop(e,t,n):((i=1!==s||!T.isXMLDoc(e))&&(t=t.toLowerCase(),r=T.attrHooks[t]||(K.test(t)?U:W)),n===o?r&&i&&"get"in r&&null!==(a=r.get(e,t))?a:(typeof e.getAttribute!==c&&(a=e.getAttribute(t)),null==a?o:a):null!==n?r&&i&&"set"in r&&(a=r.set(e,n,t))!==o?a:(e.setAttribute(t,n+""),n):(T.removeAttr(e,t),o))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(S);if(o&&1===e.nodeType) +for(;n=o[i++];) +r=T.propFix[n]||n,K.test(n)?!ee&&Z.test(n)?e[T.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:T.attr(e,n,""),e.removeAttribute(ee?n:r)},attrHooks:{type:{set:function(e,t){if(!T.support.radioValue&&"radio"===t&&T.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,t,n){var r,i,a=e.nodeType;if(e&&3!==a&&8!==a&&2!==a) +return(1!==a||!T.isXMLDoc(e))&&(t=T.propFix[t]||t,i=T.propHooks[t]),n!==o?i&&"set"in i&&(r=i.set(e,n,t))!==o?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=e.getAttributeNode("tabindex");return t&&t.specified?parseInt(t.value,10):J.test(e.nodeName)||G.test(e.nodeName)&&e.href?0:o}}}}),U={get:function(e,t){var n=T.prop(e,t),r="boolean"==typeof n&&e.getAttribute(t),i="boolean"==typeof n?te&&ee?null!=r:Z.test(t)?e[T.camelCase("default-"+t)]:!!r:e.getAttributeNode(t);return i&&!1!==i.value?t.toLowerCase():o},set:function(e,t,n){return!1===t?T.removeAttr(e,n):te&&ee||!Z.test(n)?e.setAttribute(!ee&&T.propFix[n]||n,n):e[T.camelCase("default-"+n)]=e[n]=!0,n}},te&&ee||(T.attrHooks.value={get:function(e,t){var n=e.getAttributeNode(t);return T.nodeName(e,"input")?e.defaultValue:n&&n.specified?n.value:o},set:function(e,t,n){return T.nodeName(e,"input")?(e.defaultValue=t,o):W&&W.set(e,t,n)}}),ee||(W=T.valHooks.button={get:function(e,t){var n=e.getAttributeNode(t);return n&&("id"===t||"name"===t||"coords"===t?""!==n.value:n.specified)?n.value:o},set:function(e,t,n){var r=e.getAttributeNode(n);return r||e.setAttributeNode(r=e.ownerDocument.createAttribute(n)),r.value=t+="","value"===n||t===e.getAttribute(n)?t:o}},T.attrHooks.contenteditable={get:W.get,set:function(e,t,n){W.set(e,""!==t&&t,n)}},T.each(["width","height"],(function(e,t){T.attrHooks[t]=T.extend(T.attrHooks[t],{set:function(e,n){return""===n?(e.setAttribute(t,"auto"),n):o}})}))),T.support.hrefNormalized||(T.each(["href","src","width","height"],(function(e,t){T.attrHooks[t]=T.extend(T.attrHooks[t],{get:function(e){var n=e.getAttribute(t,2);return null==n?o:n}})})),T.each(["href","src"],(function(e,t){T.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}))),T.support.style||(T.attrHooks.style={get:function(e){return e.style.cssText||o},set:function(e,t){return e.style.cssText=t+""}}),T.support.optSelected||(T.propHooks.selected=T.extend(T.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),T.support.enctype||(T.propFix.enctype="encoding"),T.support.checkOn||T.each(["radio","checkbox"],(function(){T.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}})),T.each(["radio","checkbox"],(function(){T.valHooks[this]=T.extend(T.valHooks[this],{set:function(e,t){return T.isArray(t)?e.checked=T.inArray(T(e).val(),t)>=0:o}})}));var ne=/^(?:input|select|textarea)$/i,re=/^key/,ie=/^(?:mouse|contextmenu)|click/,oe=/^(?:focusinfocus|focusoutblur)$/,ae=/^([^.]*)(?:\.(.+)|)$/;function se(){return!0} +function ce(){return!1} +T.event={global:{},add:function(e,t,n,r,i){var a,s,l,u,d,f,p,h,g,m,v,y=T._data(e);if(y){for(n.handler&&(n=(u=n).handler,i=u.selector),n.guid||(n.guid=T.guid++),(s=y.events)||(s=y.events={}),(f=y.handle)||((f=y.handle=function(e){return typeof T===c||e&&T.event.triggered===e.type?o:T.event.dispatch.apply(f.elem,arguments)}).elem=e),l=(t=(t||"").match(S)||[""]).length;l--;) +g=v=(a=ae.exec(t[l])||[])[1],m=(a[2]||"").split(".").sort(),d=T.event.special[g]||{},g=(i?d.delegateType:d.bindType)||g,d=T.event.special[g]||{},p=T.extend({type:g,origType:v,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&T.expr.match.needsContext.test(i),namespace:m.join(".")},u),(h=s[g])||((h=s[g]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,r,m,f)||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),d.add&&(d.add.call(e,p),p.handler.guid||(p.handler.guid=n.guid)),i?h.splice(h.delegateCount++,0,p):h.push(p),T.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,c,l,u,d,f,p,h,g,m=T.hasData(e)&&T._data(e);if(m&&(u=m.events)){for(l=(t=(t||"").match(S)||[""]).length;l--;) +if(p=g=(s=ae.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),p){for(d=T.event.special[p]||{},f=u[p=(r?d.delegateType:d.bindType)||p]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),c=o=f.length;o--;) +a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,d.remove&&d.remove.call(e,a));c&&!f.length&&(d.teardown&&!1!==d.teardown.call(e,h,m.handle)||T.removeEvent(e,p,m.handle),delete u[p])}else for(p in u) +T.event.remove(e,p+t[l],n,r,!0);T.isEmptyObject(u)&&(delete m.handle,T._removeData(e,"events"))}},trigger:function(e,t,n,r){var a,s,c,u,d,f,p,h=[n||l],g=w.call(e,"type")?e.type:e,m=w.call(e,"namespace")?e.namespace.split("."):[];if(c=f=n=n||l,3!==n.nodeType&&8!==n.nodeType&&!oe.test(g+T.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),s=0>g.indexOf(":")&&"on"+g,(e=e[T.expando]?e:new T.Event(g,"object"==typeof e&&e)).isTrigger=!0,e.namespace=m.join("."),e.namespace_re=e.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=o,e.target||(e.target=n),t=null==t?[e]:T.makeArray(t,[e]),d=T.event.special[g]||{},r||!d.trigger||!1!==d.trigger.apply(n,t))){if(!r&&!d.noBubble&&!T.isWindow(n)){for(u=d.delegateType||g,oe.test(u+g)||(c=c.parentNode);c;c=c.parentNode) +h.push(c),f=c;f===(n.ownerDocument||l)&&h.push(f.defaultView||f.parentWindow||i)} +for(p=0;(c=h[p++])&&!e.isPropagationStopped();) +e.type=p>1?u:d.bindType||g,(a=(T._data(c,"events")||{})[e.type]&&T._data(c,"handle"))&&a.apply(c,t),(a=s&&c[s])&&T.acceptData(c)&&a.apply&&!1===a.apply(c,t)&&e.preventDefault();if(e.type=g,!(r||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(n.ownerDocument,t)||"click"===g&&T.nodeName(n,"a"))&&T.acceptData(n)&&s&&n[g]&&!T.isWindow(n)){(f=n[s])&&(n[s]=null),T.event.triggered=g;try{n[g]()}catch(e){} +T.event.triggered=o,f&&(n[s]=f)} +return e.result}},dispatch:function(e){e=T.event.fix(e);var t,n,r,i,a,s=[],c=y.call(arguments),l=(T._data(this,"events")||{})[e.type]||[],u=T.event.special[e.type]||{};if(c[0]=e,e.delegateTarget=this,!u.preDispatch||!1!==u.preDispatch.call(this,e)){for(s=T.event.handlers.call(this,e,l),t=0;(i=s[t++])&&!e.isPropagationStopped();) +for(e.currentTarget=i.elem,a=0;(r=i.handlers[a++])&&!e.isImmediatePropagationStopped();)(!e.namespace_re||e.namespace_re.test(r.namespace))&&(e.handleObj=r,e.data=r.data,(n=((T.event.special[r.origType]||{}).handle||r.handler).apply(i.elem,c))!==o&&!1===(e.result=n)&&(e.preventDefault(),e.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,a,s=[],c=t.delegateCount,l=e.target;if(c&&l.nodeType&&(!e.button||"click"!==e.type)) +for(;l!=this;l=l.parentNode||this) +if(1===l.nodeType&&(!0!==l.disabled||"click"!==e.type)){for(i=[],a=0;c>a;a++) +i[n=(r=t[a]).selector+" "]===o&&(i[n]=r.needsContext?T(n,this).index(l)>=0:T.find(n,this,null,[l]).length),i[n]&&i.push(r);i.length&&s.push({elem:l,handlers:i})} +return t.length>c&&s.push({elem:this,handlers:t.slice(c)}),s},fix:function(e){if(e[T.expando]) +return e;var t,n,r,i=e.type,o=e,a=this.fixHooks[i];for(a||(this.fixHooks[i]=a=ie.test(i)?this.mouseHooks:re.test(i)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,e=new T.Event(o),t=r.length;t--;) +e[n=r[t]]=o[n];return e.target||(e.target=o.srcElement||l),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,a.filter?a.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,a=t.button,s=t.fromElement;return null==e.pageX&&null!=t.clientX&&(i=(r=e.target.ownerDocument||l).documentElement,n=r.body,e.pageX=t.clientX+(i&&i.scrollLeft||n&&n.scrollLeft||0)-(i&&i.clientLeft||n&&n.clientLeft||0),e.pageY=t.clientY+(i&&i.scrollTop||n&&n.scrollTop||0)-(i&&i.clientTop||n&&n.clientTop||0)),!e.relatedTarget&&s&&(e.relatedTarget=s===e.target?t.toElement:s),e.which||a===o||(e.which=1&a?1:2&a?3:4&a?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return T.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):o}},focus:{trigger:function(){if(this!==l.activeElement&&this.focus) +try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===l.activeElement&&this.blur?(this.blur(),!1):o},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==o&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=T.extend(new T.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?T.event.trigger(i,null,t):T.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},T.removeEvent=l.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===c&&(e[r]=null),e.detachEvent(r,n))},T.Event=function(e,t){return this instanceof T.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||!1===e.returnValue||e.getPreventDefault&&e.getPreventDefault()?se:ce):this.type=e,t&&T.extend(this,t),this.timeStamp=e&&e.timeStamp||T.now(),this[T.expando]=!0,o):new T.Event(e,t)},T.Event.prototype={isDefaultPrevented:ce,isPropagationStopped:ce,isImmediatePropagationStopped:ce,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=se,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=se,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=se,this.stopPropagation()}},T.each({mouseenter:"mouseover",mouseleave:"mouseout"},(function(e,t){T.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!T.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}})),T.support.submitBubbles||(T.event.special.submit={setup:function(){return!T.nodeName(this,"form")&&(T.event.add(this,"click._submit keypress._submit",(function(e){var t=e.target,n=T.nodeName(t,"input")||T.nodeName(t,"button")?t.form:o;n&&!T._data(n,"submitBubbles")&&(T.event.add(n,"submit._submit",(function(e){e._submit_bubble=!0})),T._data(n,"submitBubbles",!0))})),o)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&T.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return!T.nodeName(this,"form")&&(T.event.remove(this,"._submit"),o)}}),T.support.changeBubbles||(T.event.special.change={setup:function(){return ne.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(T.event.add(this,"propertychange._change",(function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)})),T.event.add(this,"click._change",(function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),T.event.simulate("change",this,e,!0)}))),!1):(T.event.add(this,"beforeactivate._change",(function(e){var t=e.target;ne.test(t.nodeName)&&!T._data(t,"changeBubbles")&&(T.event.add(t,"change._change",(function(e){!this.parentNode||e.isSimulated||e.isTrigger||T.event.simulate("change",this.parentNode,e,!0)})),T._data(t,"changeBubbles",!0))})),o)},handle:function(e){var t=e.target;return this!==t||e.isSimulated||e.isTrigger||"radio"!==t.type&&"checkbox"!==t.type?e.handleObj.handler.apply(this,arguments):o},teardown:function(){return T.event.remove(this,"._change"),!ne.test(this.nodeName)}}),T.support.focusinBubbles||T.each({focus:"focusin",blur:"focusout"},(function(e,t){var n=0,r=function(e){T.event.simulate(t,e.target,T.event.fix(e),!0)};T.event.special[t]={setup:function(){0==n++&&l.addEventListener(e,r,!0)},teardown:function(){0==--n&&l.removeEventListener(e,r,!0)}}})),T.fn.extend({on:function(e,t,n,r,i){var a,s;if("object"==typeof e){for(a in "string"!=typeof t&&(n=n||t,t=o),e) +this.on(a,t,n,e[a],i);return this} +if(null==n&&null==r?(r=t,n=t=o):null==r&&("string"==typeof t?(r=n,n=o):(r=n,n=t,t=o)),!1===r) +r=ce;else if(!r) +return this;return 1===i&&(s=r,(r=function(e){return T().off(e),s.apply(this,arguments)}).guid=s.guid||(s.guid=T.guid++)),this.each((function(){T.event.add(this,e,r,n,t)}))},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj) +return r=e.handleObj,T(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e) +this.off(i,t,e[i]);return this} +return(!1===t||"function"==typeof t)&&(n=t,t=o),!1===n&&(n=ce),this.each((function(){T.event.remove(this,e,n,t)}))},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each((function(){T.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];return n?T.event.trigger(e,t,n,!0):o}}),function(e,t){var n,r,i,o,a,s,c,l,u,d,f,p,h,g,m,v,y,b="sizzle"+ -new Date,x=e.document,w={},C=0,E=0,S=ne(),k=ne(),N=ne(),P=typeof t,A=1<<31,D=[],H=D.pop,j=D.push,L=D.slice,I=D.indexOf||function(e){for(var t=0,n=this.length;n>t;t++) +if(this[t]===e) +return t;return-1},F="[\\x20\\t\\r\\n\\f]",O="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",M=O.replace("w","w#"),q="\\["+F+"*("+O+")"+F+"*(?:([*^$|!~]?=)"+F+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+M+")|)|)"+F+"*\\]",B=":("+O+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+q.replace(3,8)+")*)|.*)\\)|)",R=RegExp("^"+F+"+|((?:^|[^\\\\])(?:\\\\.)*)"+F+"+$","g"),_=RegExp("^"+F+"*,"+F+"*"),z=RegExp("^"+F+"*([\\x20\\t\\r\\n\\f>+~])"+F+"*"),Q=RegExp(B),$=RegExp("^"+M+"$"),X={ID:RegExp("^#("+O+")"),CLASS:RegExp("^\\.("+O+")"),NAME:RegExp("^\\[name=['\"]?("+O+")['\"]?\\]"),TAG:RegExp("^("+O.replace("w","w*")+")"),ATTR:RegExp("^"+q),PSEUDO:RegExp("^"+B),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),needsContext:RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},W=/[\x20\t\r\n\f]*[+~]/,U=/^[^{]+\{\s*\[native code/,V=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Y=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,G=/'|\\/g,K=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,Z=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,ee=function(e,t){var n="0x"+t-65536;return n!=n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{L.call(x.documentElement.childNodes,0)[0].nodeType}catch(e){L=function(e){for(var t,n=[];t=this[e++];) +n.push(t);return n}} +function te(e){return U.test(e+"")} +function ne(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}} +function re(e){return e[b]=!0,e} +function ie(e){var t=d.createElement("div");try{return e(t)}catch(e){return!1}finally{t=null}} +function oe(e,t,n,r){var i,o,a,s,c,l,f,g,m,y;if((t?t.ownerDocument||t:x)!==d&&u(t),n=n||[],!e||"string"!=typeof e) +return n;if(1!==(s=(t=t||d).nodeType)&&9!==s) +return[];if(!p&&!r){if(i=V.exec(e)) +if(a=i[1]){if(9===s){if(!(o=t.getElementById(a))||!o.parentNode) +return n;if(o.id===a) +return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&v(t,o)&&o.id===a) +return n.push(o),n}else{if(i[2]) +return j.apply(n,L.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&w.getByClassName&&t.getElementsByClassName) +return j.apply(n,L.call(t.getElementsByClassName(a),0)),n} +if(w.qsa&&!h.test(e)){if(f=!0,g=b,m=t,y=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(l=ue(e),(f=t.getAttribute("id"))?g=f.replace(G,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",c=l.length;c--;) +l[c]=g+de(l[c]);m=W.test(e)&&t.parentNode||t,y=l.join(",")} +if(y) +try{return j.apply(n,L.call(m.querySelectorAll(y),0)),n}catch(e){}finally{f||t.removeAttribute("id")}}} +return ye(e.replace(R,"$1"),t,n,r)} +function ae(e,t){var n=t&&e,r=n&&(~t.sourceIndex||A)-(~e.sourceIndex||A);if(r) +return r;if(n) +for(;n=n.nextSibling;) +if(n===t) +return-1;return e?1:-1} +function se(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}} +function ce(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}} +function le(e){return re((function(t){return t=+t,re((function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;) +n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))} +for(n in a=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},u=oe.setDocument=function(e){var n=e?e.ownerDocument||e:x;return n!==d&&9===n.nodeType&&n.documentElement?(d=n,f=n.documentElement,p=a(n),w.tagNameNoComments=ie((function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length})),w.attributes=ie((function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t})),w.getByClassName=ie((function(e){return e.innerHTML="",!(!e.getElementsByClassName||!e.getElementsByClassName("e").length)&&(e.lastChild.className="e",2===e.getElementsByClassName("e").length)})),w.getByName=ie((function(e){e.id=b+0,e.innerHTML="
",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(b).length===2+n.getElementsByName(b+0).length;return w.getIdNotName=!n.getElementById(b),f.removeChild(e),t})),i.attrHandle=ie((function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==P&&"#"===e.firstChild.getAttribute("href")}))?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},w.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==P&&!p){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==P&&!p){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==P&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n=typeof e.getAttributeNode!==P&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=w.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==P?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];) +1===n.nodeType&&r.push(n);return r} +return o},i.find.NAME=w.getByName&&function(e,n){return typeof n.getElementsByName!==P?n.getElementsByName(name):t},i.find.CLASS=w.getByClassName&&function(e,n){return typeof n.getElementsByClassName===P||p?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(w.qsa=te(n.querySelectorAll))&&(ie((function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||h.push("\\["+F+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")})),ie((function(e){e.innerHTML="",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+F+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")}))),(w.matchesSelector=te(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ie((function(e){w.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",B)})),h=RegExp(h.join("|")),g=RegExp(g.join("|")),v=te(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t) +for(;t=t.parentNode;) +if(t===e) +return!0;return!1},y=f.compareDocumentPosition?function(e,t){var r;return e===t?(c=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||v(x,e)?-1:t===n||v(x,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t) +return c=!0,0;if(!o||!a) +return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a) +return ae(e,t);for(r=e;r=r.parentNode;) +s.unshift(r);for(r=t;r=r.parentNode;) +l.unshift(r);for(;s[i]===l[i];) +i++;return i?ae(s[i],l[i]):s[i]===x?-1:l[i]===x?1:0},c=!1,[0,0].sort(y),w.detectDuplicates=c,d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&u(e),t=t.replace(K,"='$1']"),!(!w.matchesSelector||p||g&&g.test(t)||h.test(t))) +try{var n=m.call(e,t);if(n||w.disconnectedMatch||e.document&&11!==e.document.nodeType) +return n}catch(e){} +return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&u(e),v(e,t)},oe.attr=function(e,t){var n;return(e.ownerDocument||e)!==d&&u(e),p||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):p||w.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&!0===e[t]?t:n&&n.specified?n.value:null},oe.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,n=[],r=1,i=0;if(c=!w.detectDuplicates,e.sort(y),c){for(;t=e[r];r++) +t===e[r-1]&&(i=n.push(r));for(;i--;) +e.splice(n[i],1)} +return e},o=oe.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent) +return e.textContent;for(e=e.firstChild;e;e=e.nextSibling) +n+=o(e)}else if(3===i||4===i) +return e.nodeValue}else for(;t=e[r];r++) +n+=o(t);return n},i=oe.selectors={cacheLength:50,createPseudo:re,match:X,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return X.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&Q.test(n)&&(t=ue(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(Z,ee).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=S[e+" "];return t||(t=RegExp("(^|"+F+")"+e+"("+F+"|$)"))&&S(e,(function(e){return t.test(e.className||typeof e.getAttribute!==P&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,c){var l,u,d,f,p,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!c&&!s;if(m){if(o){for(;g;){for(d=t;d=d[g];) +if(s?d.nodeName.toLowerCase()===v:1===d.nodeType) +return!1;h=g="only"===e&&!h&&"nextSibling"} +return!0} +if(h=[a?m.firstChild:m.lastChild],a&&y){for(p=(l=(u=m[b]||(m[b]={}))[e]||[])[0]===C&&l[1],f=l[0]===C&&l[2],d=p&&m.childNodes[p];d=++p&&d&&d[g]||(f=p=0)||h.pop();) +if(1===d.nodeType&&++f&&d===t){u[e]=[C,p,f];break}}else if(y&&(l=(t[b]||(t[b]={}))[e])&&l[0]===C) +f=l[1];else for(;(d=++p&&d&&d[g]||(f=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[b]||(d[b]={}))[e]=[C,f]),d!==t)););return(f-=i)===r||0==f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?re((function(e,n){for(var i,o=r(e,t),a=o.length;a--;) +e[i=I.call(e,o[a])]=!(n[i]=o[a])})):function(e){return r(e,0,n)}):r}},pseudos:{not:re((function(e){var t=[],n=[],r=s(e.replace(R,"$1"));return r[b]?re((function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))})):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}})),has:re((function(e){return function(t){return oe(e,t).length>0}})),contains:re((function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}})),lang:re((function(e){return $.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=p?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang) +return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return!1===e.disabled},disabled:function(e){return!0===e.disabled},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling) +if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType) +return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Y.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:le((function(){return[0]})),last:le((function(e,t){return[t-1]})),eq:le((function(e,t,n){return[0>n?n+t:n]})),even:le((function(e,t){for(var n=0;t>n;n+=2) +e.push(n);return e})),odd:le((function(e,t){for(var n=1;t>n;n+=2) +e.push(n);return e})),lt:le((function(e,t,n){for(var r=0>n?n+t:n;--r>=0;) +e.push(r);return e})),gt:le((function(e,t,n){for(var r=0>n?n+t:n;t>++r;) +e.push(r);return e}))}},{radio:!0,checkbox:!0,file:!0,password:!0,image:!0}) +i.pseudos[n]=se(n);for(n in{submit:!0,reset:!0}) +i.pseudos[n]=ce(n);function ue(e,t){var n,r,o,a,s,c,l,u=k[e+" "];if(u) +return t?0:u.slice(0);for(s=e,c=[],l=i.preFilter;s;){for(a in(!n||(r=_.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),c.push(o=[])),n=!1,(r=z.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(R," ")}),s=s.slice(n.length)),i.filter) +!(r=X[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n) +break} +return t?s.length:s?oe.error(e):k(e,c).slice(0)} +function de(e){for(var t=0,n=e.length,r="";n>t;t++) +r+=e[t].value;return r} +function fe(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=E++;return t.first?function(t,n,r){for(;t=t[i];) +if(1===t.nodeType||o) +return e(t,n,r)}:function(t,n,s){var c,l,u,d=C+" "+a;if(s){for(;t=t[i];) +if((1===t.nodeType||o)&&e(t,n,s)) +return!0}else for(;t=t[i];) +if(1===t.nodeType||o) +if((l=(u=t[b]||(t[b]={}))[i])&&l[0]===d){if(!0===(c=l[1])||c===r) +return!0===c}else if((l=u[i]=[d])[1]=e(t,n,s)||r,!0===l[1]) +return!0}} +function pe(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;) +if(!e[i](t,n,r)) +return!1;return!0}:e[0]} +function he(e,t,n,r,i){for(var o,a=[],s=0,c=e.length,l=null!=t;c>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a} +function ge(e,t,n,r,i,o){return r&&!r[b]&&(r=ge(r)),i&&!i[b]&&(i=ge(i,o)),re((function(o,a,s,c){var l,u,d,f=[],p=[],h=a.length,g=o||function(e,t,n){for(var r=0,i=t.length;i>r;r++) +oe(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:he(g,f,e,s,c),v=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,v,s,c),r) +for(l=he(v,p),r(l,[],s,c),u=l.length;u--;)(d=l[u])&&(v[p[u]]=!(m[p[u]]=d));if(o){if(i||e){if(i){for(l=[],u=v.length;u--;)(d=v[u])&&l.push(m[u]=d);i(null,v=[],l,c)} +for(u=v.length;u--;)(d=v[u])&&(l=i?I.call(o,d):f[u])>-1&&(o[l]=!(a[l]=d))}}else v=he(v===a?v.splice(h,v.length):v),i?i(null,a,v,c):j.apply(a,v)}))} +function me(e){for(var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],c=a?1:0,u=fe((function(e){return e===t}),s,!0),d=fe((function(e){return I.call(t,e)>-1}),s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?u(e,n,r):d(e,n,r))}];o>c;c++) +if(n=i.relative[e[c].type]) +f=[fe(pe(f),n)];else{if((n=i.filter[e[c].type].apply(null,e[c].matches))[b]){for(r=++c;o>r&&!i.relative[e[r].type];r++);return ge(c>1&&pe(f),c>1&&de(e.slice(0,c-1)).replace(R,"$1"),n,r>c&&me(e.slice(c,r)),o>r&&me(e=e.slice(r)),o>r&&de(e))} +f.push(n)} +return pe(f)} +function ve(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,c,u,f,p){var h,g,m,v=[],y=0,b="0",x=s&&[],w=null!=p,T=l,E=s||a&&i.find.TAG("*",p&&c.parentNode||c),S=C+=null==T?1:Math.random()||.1;for(w&&(l=c!==d&&c,r=n);null!=(h=E[b]);b++){if(a&&h){for(g=0;m=e[g++];) +if(m(h,c,u)){f.push(h);break} +w&&(C=S,r=++n)} +o&&((h=!m&&h)&&y--,s&&x.push(h))} +if(y+=b,o&&b!==y){for(g=0;m=t[g++];) +m(x,v,c,u);if(s){if(y>0) +for(;b--;) +x[b]||v[b]||(v[b]=H.call(f));v=he(v)} +j.apply(f,v),w&&!s&&v.length>0&&y+t.length>1&&oe.uniqueSort(f)} +return w&&(C=S,l=T),x};return o?re(s):s} +function ye(e,t,n,r){var o,a,c,l,u,d=ue(e);if(!r&&1===d.length){if((a=d[0]=d[0].slice(0)).length>2&&"ID"===(c=a[0]).type&&9===t.nodeType&&!p&&i.relative[a[1].type]){if(!(t=i.find.ID(c.matches[0].replace(Z,ee),t)[0])) +return n;e=e.slice(a.shift().value.length)} +for(o=X.needsContext.test(e)?0:a.length;o--&&(c=a[o],!i.relative[l=c.type]);) +if((u=i.find[l])&&(r=u(c.matches[0].replace(Z,ee),W.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),!(e=r.length&&de(a))) +return j.apply(n,L.call(r,0)),n;break}} +return s(e,d)(r,t,p,n,W.test(e)),n} +function be(){} +s=oe.compile=function(e,t){var n,r=[],i=[],o=N[e+" "];if(!o){for(t||(t=ue(e)),n=t.length;n--;)(o=me(t[n]))[b]?r.push(o):i.push(o);o=N(e,ve(i,r))} +return o},i.pseudos.nth=i.pseudos.eq,i.filters=be.prototype=i.pseudos,i.setFilters=new be,u(),oe.attr=T.attr,T.find=oe,T.expr=oe.selectors,T.expr[":"]=T.expr.pseudos,T.unique=oe.uniqueSort,T.text=oe.getText,T.isXMLDoc=oe.isXML,T.contains=oe.contains}(i);var le=/Until$/,ue=/^(?:parents|prev(?:Until|All))/,de=/^.[^:#\[\.,]*$/,fe=T.expr.match.needsContext,pe={children:!0,contents:!0,next:!0,prev:!0};function he(e,t){do{e=e[t]}while(e&&1!==e.nodeType);return e} +function ge(e,t,n){if(t=t||0,T.isFunction(t)) +return T.grep(e,(function(e,r){return!!t.call(e,r,e)===n}));if(t.nodeType) +return T.grep(e,(function(e){return e===t===n}));if("string"==typeof t){var r=T.grep(e,(function(e){return 1===e.nodeType}));if(de.test(t)) +return T.filter(t,r,!n);t=T.filter(t,r)} +return T.grep(e,(function(e){return T.inArray(e,t)>=0===n}))} +function me(e){var t=ve.split("|"),n=e.createDocumentFragment();if(n.createElement) +for(;t.length;) +n.createElement(t.pop());return n} +T.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e) +return r=this,this.pushStack(T(e).filter((function(){for(t=0;i>t;t++) +if(T.contains(r[t],this)) +return!0})));for(n=[],t=0;i>t;t++) +T.find(e,this[t],n);return(n=this.pushStack(i>1?T.unique(n):n)).selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=T(e,this),r=n.length;return this.filter((function(){for(t=0;r>t;t++) +if(T.contains(this,n[t])) +return!0}))},not:function(e){return this.pushStack(ge(this,e,!1))},filter:function(e){return this.pushStack(ge(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?fe.test(e)?T(e,this.context).index(this[0])>=0:T.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){for(var n,r=0,i=this.length,o=[],a=fe.test(e)||"string"!=typeof e?T(e,t||this.context):0;i>r;r++) +for(n=this[r];n&&n.ownerDocument&&n!==t&&11!==n.nodeType;){if(a?a.index(n)>-1:T.find.matchesSelector(n,e)){o.push(n);break} +n=n.parentNode} +return this.pushStack(o.length>1?T.unique(o):o)},index:function(e){return e?"string"==typeof e?T.inArray(this[0],T(e)):T.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?T(e,t):T.makeArray(e&&e.nodeType?[e]:e),r=T.merge(this.get(),n);return this.pushStack(T.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),T.fn.andSelf=T.fn.addBack,T.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return T.dir(e,"parentNode")},parentsUntil:function(e,t,n){return T.dir(e,"parentNode",n)},next:function(e){return he(e,"nextSibling")},prev:function(e){return he(e,"previousSibling")},nextAll:function(e){return T.dir(e,"nextSibling")},prevAll:function(e){return T.dir(e,"previousSibling")},nextUntil:function(e,t,n){return T.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return T.dir(e,"previousSibling",n)},siblings:function(e){return T.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return T.sibling(e.firstChild)},contents:function(e){return T.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:T.merge([],e.childNodes)}},(function(e,t){T.fn[e]=function(n,r){var i=T.map(this,t,n);return le.test(e)||(r=n),r&&"string"==typeof r&&(i=T.filter(r,i)),i=this.length>1&&!pe[e]?T.unique(i):i,this.length>1&&ue.test(e)&&(i=i.reverse()),this.pushStack(i)}})),T.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?T.find.matchesSelector(t[0],e)?[t[0]]:[]:T.find.matches(e,t)},dir:function(e,t,n){for(var r=[],i=e[t];i&&9!==i.nodeType&&(n===o||1!==i.nodeType||!T(i).is(n));) +1===i.nodeType&&r.push(i),i=i[t];return r},sibling:function(e,t){for(var n=[];e;e=e.nextSibling) +1===e.nodeType&&e!==t&&n.push(e);return n}});var ve="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ye=/ jQuery\d+="(?:null|\d+)"/g,be=RegExp("<(?:"+ve+")[\\s/>]","i"),xe=/^\s+/,we=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,Ce=/<([\w:]+)/,Te=/\s*$/g,He={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],_default:T.support.htmlSerialize?[0,"",""]:[1,"X
","
"]},je=me(l).appendChild(l.createElement("div"));function Le(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))} +function Ie(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e} +function Fe(e){var t=Ae.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e} +function Oe(e,t){for(var n,r=0;null!=(n=e[r]);r++) +T._data(n,"globalEval",!t||T._data(t[r],"globalEval"))} +function Me(e,t){if(1===t.nodeType&&T.hasData(e)){var n,r,i,o=T._data(e),a=T._data(t,o),s=o.events;if(s) +for(n in delete a.handle,a.events={},s) +for(r=0,i=s[n].length;i>r;r++) +T.event.add(t,n,s[n][r]);a.data&&(a.data=T.extend({},a.data))}} +function qe(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!T.support.noCloneEvent&&t[T.expando]){for(r in(i=T._data(t)).events) +T.removeEvent(t,r,i.handle);t.removeAttribute(T.expando)} +"script"===n&&t.text!==e.text?(Ie(t).text=e.text,Fe(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),T.support.html5Clone&&e.innerHTML&&!T.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&ke.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}} +function Be(e,t){var n,r,i=0,a=typeof e.getElementsByTagName!==c?e.getElementsByTagName(t||"*"):typeof e.querySelectorAll!==c?e.querySelectorAll(t||"*"):o;if(!a) +for(a=[],n=e.childNodes||e;null!=(r=n[i]);i++) +!t||T.nodeName(r,t)?a.push(r):T.merge(a,Be(r,t));return t===o||t&&T.nodeName(e,t)?T.merge([e],a):a} +function Re(e){ke.test(e.type)&&(e.defaultChecked=e.checked)} +He.optgroup=He.option,He.tbody=He.tfoot=He.colgroup=He.caption=He.thead,He.th=He.td,T.fn.extend({text:function(e){return T.access(this,(function(e){return e===o?T.text(this):this.empty().append((this[0]&&this[0].ownerDocument||l).createTextNode(e))}),null,e,arguments.length)},wrapAll:function(e){if(T.isFunction(e)) +return this.each((function(t){T(this).wrapAll(e.call(this,t))}));if(this[0]){var t=T(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstChild&&1===e.firstChild.nodeType;) +e=e.firstChild;return e})).append(this)} +return this},wrapInner:function(e){return T.isFunction(e)?this.each((function(t){T(this).wrapInner(e.call(this,t))})):this.each((function(){var t=T(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=T.isFunction(e);return this.each((function(n){T(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(){return this.parent().each((function(){T.nodeName(this,"body")||T(this).replaceWith(this.childNodes)})).end()},append:function(){return this.domManip(arguments,!0,(function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)}))},prepend:function(){return this.domManip(arguments,!0,(function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)}))},before:function(){return this.domManip(arguments,!1,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return this.domManip(arguments,!1,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},remove:function(e,t){for(var n,r=0;null!=(n=this[r]);r++)(!e||T.filter(e,[n]).length>0)&&(t||1!==n.nodeType||T.cleanData(Be(n)),n.parentNode&&(t&&T.contains(n.ownerDocument,n)&&Oe(Be(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){for(var e,t=0;null!=(e=this[t]);t++){for(1===e.nodeType&&T.cleanData(Be(e,!1));e.firstChild;) +e.removeChild(e.firstChild);e.options&&T.nodeName(e,"select")&&(e.options.length=0)} +return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return T.clone(this,e,t)}))},html:function(e){return T.access(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(e===o) +return 1===t.nodeType?t.innerHTML.replace(ye,""):o;if(!("string"!=typeof e||Se.test(e)||!T.support.htmlSerialize&&be.test(e)||!T.support.leadingWhitespace&&xe.test(e)||He[(Ce.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(we,"<$1>");try{for(;r>n;n++) +1===(t=this[n]||{}).nodeType&&(T.cleanData(Be(t,!1)),t.innerHTML=e);t=0}catch(e){}} +t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(e){return T.isFunction(e)||"string"==typeof e||(e=T(e).not(this).detach()),this.domManip([e],!0,(function(e){var t=this.nextSibling,n=this.parentNode;n&&(T(this).remove(),n.insertBefore(e,t))}))},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=m.apply([],e);var r,i,a,s,c,l,u=0,d=this.length,f=this,p=d-1,h=e[0],g=T.isFunction(h);if(g||!(1>=d||"string"!=typeof h||T.support.checkClone)&&Ne.test(h)) +return this.each((function(r){var i=f.eq(r);g&&(e[0]=h.call(this,r,t?i.html():o)),i.domManip(e,t,n)}));if(d&&(r=(l=T.buildFragment(e,this[0].ownerDocument,!1,this)).firstChild,1===l.childNodes.length&&(l=r),r)){for(t=t&&T.nodeName(r,"tr"),a=(s=T.map(Be(l,"script"),Ie)).length;d>u;u++) +i=l,u!==p&&(i=T.clone(i,!0,!0),a&&T.merge(s,Be(i,"script"))),n.call(t&&T.nodeName(this[u],"table")?Le(this[u],"tbody"):this[u],i,u);if(a) +for(c=s[s.length-1].ownerDocument,T.map(s,Fe),u=0;a>u;u++) +i=s[u],Pe.test(i.type||"")&&!T._data(i,"globalEval")&&T.contains(c,i)&&(i.src?T.ajax({url:i.src,type:"GET",dataType:"script",async:!1,global:!1,throws:!0}):T.globalEval((i.text||i.textContent||i.innerHTML||"").replace(De,"")));l=r=null} +return this}}),T.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){T.fn[e]=function(e){for(var n,r=0,i=[],o=T(e),a=o.length-1;a>=r;r++) +n=r===a?this:this.clone(!0),T(o[r])[t](n),v.apply(i,n.get());return this.pushStack(i)}})),T.extend({clone:function(e,t,n){var r,i,o,a,s,c=T.contains(e.ownerDocument,e);if(T.support.html5Clone||T.isXMLDoc(e)||!be.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(je.innerHTML=e.outerHTML,je.removeChild(o=je.firstChild)),!(T.support.noCloneEvent&&T.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||T.isXMLDoc(e))) +for(r=Be(o),s=Be(e),a=0;null!=(i=s[a]);++a) +r[a]&&qe(i,r[a]);if(t) +if(n) +for(s=s||Be(e),r=r||Be(o),a=0;null!=(i=s[a]);a++) +Me(i,r[a]);else Me(e,o);return(r=Be(o,"script")).length>0&&Oe(r,!c&&Be(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){for(var i,o,a,s,c,l,u,d=e.length,f=me(t),p=[],h=0;d>h;h++) +if((o=e[h])||0===o) +if("object"===T.type(o)) +T.merge(p,o.nodeType?[o]:o);else if(Ee.test(o)){for(s=s||f.appendChild(t.createElement("div")),c=(Ce.exec(o)||["",""])[1].toLowerCase(),u=He[c]||He._default,s.innerHTML=u[1]+o.replace(we,"<$1>")+u[2],i=u[0];i--;) +s=s.lastChild;if(!T.support.leadingWhitespace&&xe.test(o)&&p.push(t.createTextNode(xe.exec(o)[0])),!T.support.tbody) +for(i=(o="table"!==c||Te.test(o)?""!==u[1]||Te.test(o)?0:s:s.firstChild)&&o.childNodes.length;i--;) +T.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l);for(T.merge(p,s.childNodes),s.textContent="";s.firstChild;) +s.removeChild(s.firstChild);s=f.lastChild}else p.push(t.createTextNode(o));for(s&&f.removeChild(s),T.support.appendChecked||T.grep(Be(p,"input"),Re),h=0;o=p[h++];) +if((!r||-1===T.inArray(o,r))&&(a=T.contains(o.ownerDocument,o),s=Be(f.appendChild(o),"script"),a&&Oe(s),n)) +for(i=0;o=s[i++];) +Pe.test(o.type||"")&&n.push(o);return s=null,f},cleanData:function(e,t){for(var n,r,i,o,a=0,s=T.expando,l=T.cache,u=T.support.deleteExpando,d=T.event.special;null!=(n=e[a]);a++) +if((t||T.acceptData(n))&&(o=(i=n[s])&&l[i])){if(o.events) +for(r in o.events) +d[r]?T.event.remove(n,r):T.removeEvent(n,r,o.handle);l[i]&&(delete l[i],u?delete n[s]:typeof n.removeAttribute!==c?n.removeAttribute(s):n[s]=null,h.push(i))}}});var _e,ze,Qe,$e=/alpha\([^)]*\)/i,Xe=/opacity\s*=\s*([^)]*)/,We=/^(top|right|bottom|left)$/,Ue=/^(none|table(?!-c[ea]).+)/,Ve=/^margin/,Ye=RegExp("^("+E+")(.*)$","i"),Je=RegExp("^("+E+")(?!px)[a-z%]+$","i"),Ge=RegExp("^([+-])=("+E+")","i"),Ke={BODY:"block"},Ze={position:"absolute",visibility:"hidden",display:"block"},et={letterSpacing:0,fontWeight:400},tt=["Top","Right","Bottom","Left"],nt=["Webkit","O","Moz","ms"];function rt(e,t){if(t in e) +return t;for(var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=nt.length;i--;) +if((t=nt[i]+n)in e) +return t;return r} +function it(e,t){return e=t||e,"none"===T.css(e,"display")||!T.contains(e.ownerDocument,e)} +function ot(e,t){for(var n,r,i,o=[],a=0,s=e.length;s>a;a++)(r=e[a]).style&&(o[a]=T._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&it(r)&&(o[a]=T._data(r,"olddisplay",lt(r.nodeName)))):o[a]||(i=it(r),(n&&"none"!==n||!i)&&T._data(r,"olddisplay",i?n:T.css(r,"display"))));for(a=0;s>a;a++)(r=e[a]).style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e} +function at(e,t,n){var r=Ye.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t} +function st(e,t,n,r,i){for(var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;4>o;o+=2) +"margin"===n&&(a+=T.css(e,n+tt[o],!0,i)),r?("content"===n&&(a-=T.css(e,"padding"+tt[o],!0,i)),"margin"!==n&&(a-=T.css(e,"border"+tt[o]+"Width",!0,i))):(a+=T.css(e,"padding"+tt[o],!0,i),"padding"!==n&&(a+=T.css(e,"border"+tt[o]+"Width",!0,i)));return a} +function ct(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=ze(e),a=T.support.boxSizing&&"border-box"===T.css(e,"boxSizing",!1,o);if(0>=i||null==i){if((0>(i=Qe(e,t,o))||null==i)&&(i=e.style[t]),Je.test(i)) +return i;r=a&&(T.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0} +return i+st(e,t,n||(a?"border":"content"),r,o)+"px"} +function lt(e){var t=l,n=Ke[e];return n||("none"!==(n=ut(e,t))&&n||((t=((_e=(_e||T("\n ')},},{key:"initH5P",value:((o=a()(i.a.mark(function e(){var t,n,r,o,a,s,c,l,u=arguments;return i.a.wrap(function(e){for(;;) +switch((e.prev=e.next)){case 0:return((t=u.length>0&&void 0!==u[0]?u[0]:"./styles/h5p.css"),(n=u.length>1&&void 0!==u[1]?u[1]:"./frame.bundle.js"),(r=u.length>2?u[2]:void 0),u.length>3&&u[3],(e.next=6),this.getJSON("".concat(this.path,"/h5p.json")));case 6:return((this.h5p=e.sent),(e.next=9),this.getJSON("".concat(this.path,"/content/content.json")));case 9:return((o=e.sent),(e.next=12),this.checkIfPathIncludesVersion());case 12:return((H5PIntegration.pathIncludesVersion=this.pathIncludesVersion=e.sent),(e.next=15),this.findMainLibrary());case 15:return((this.mainLibrary=e.sent),(e.next=18),this.findAllDependencies());case 18:(a=e.sent),(s=this.sortDependencies(a)),(c=s.styles),(l=s.scripts),(H5PIntegration.url=this.path),(H5PIntegration.contents=H5PIntegration.contents?H5PIntegration.contents:{}),(H5PIntegration.core={styles:[t],scripts:[n],}),(H5PIntegration.contents["cid-".concat(this.id)]={library:"".concat(this.mainLibrary.machineName," ").concat(this.mainLibrary.majorVersion,".").concat(this.mainLibrary.minorVersion),jsonContent:JSON.stringify(o),styles:c,scripts:l,displayOptions:r,}),h.a.init();case 25:case "end":return e.stop()}},e,this)}))),function(){return o.apply(this,arguments)}),},{key:"getJSON",value:function(e){return fetch(e).then(function(e){return e.json()})},},{key:"checkIfPathIncludesVersion",value:((r=a()(i.a.mark(function e(){var t,n,r;return i.a.wrap(function(e){for(;;) +switch((e.prev=e.next)){case 0:return((t=this.h5p.preloadedDependencies[0]),(n=t.machineName+"-"+t.majorVersion+"."+t.minorVersion),(e.prev=2),(e.next=5),this.getJSON("".concat(this.path,"/").concat(n,"/library.json")));case 5:(r=!0),(e.next=11);break;case 8:(e.prev=8),(e.t0=e.catch(2)),(r=!1);case 11:return e.abrupt("return",r);case 12:case "end":return e.stop()}},e,this,[[2,8]])}))),function(){return r.apply(this,arguments)}),},{key:"libraryPath",value:function(e){return(e.machineName+(this.pathIncludesVersion?"-"+e.majorVersion+"."+e.minorVersion:""))},},{key:"findMainLibrary",value:function(){var e=this,t=this.h5p.preloadedDependencies.find(function(t){return t.machineName===e.h5p.mainLibrary});return((this.mainLibraryPath=this.h5p.mainLibrary+(this.pathIncludesVersion?"-"+t.majorVersion+"."+t.minorVersion:"")),this.getJSON("".concat(this.path,"/").concat(this.mainLibraryPath,"/library.json")))},},{key:"findAllDependencies",value:function(){var e=this,t=this.h5p.preloadedDependencies.map(function(t){return e.libraryPath(t)});return this.loadDependencies(t,[])},},{key:"loadDependencies",value:((n=a()(i.a.mark(function e(t,n){var r,o,a,s=this;return i.a.wrap(function(e){for(;;) +switch((e.prev=e.next)){case 0:return((r=n),(o=[]),(e.next=4),Promise.all(t.map(function(e){return s.findLibraryDependencies(e)})));case 4:if(((a=e.sent).forEach(function(e){r.push(e),e.dependencies.forEach(function(e){r.find(function(t){return t.libraryPath===e})||a.find(function(t){return t.libraryPath===e})||o.push(e)})}),!(o.length>0))){e.next=8;break} +return e.abrupt("return",this.loadDependencies(o,r));case 8:return e.abrupt("return",r);case 9:case "end":return e.stop()}},e,this)}))),function(e,t){return n.apply(this,arguments)}),},{key:"findLibraryDependencies",value:((t=a()(i.a.mark(function e(t){var n,r,o,a=this;return i.a.wrap(function(e){for(;;) +switch((e.prev=e.next)){case 0:return((e.next=2),this.getJSON("".concat(this.path,"/").concat(t,"/library.json")));case 2:return((n=e.sent),(r=this.libraryPath(n)),(o=[]),n.preloadedDependencies&&(o=n.preloadedDependencies.map(function(e){return a.libraryPath(e)})),e.abrupt("return",{libraryPath:r,dependencies:o,preloadedCss:n.preloadedCss,preloadedJs:n.preloadedJs,}));case 7:case "end":return e.stop()}},e,this)}))),function(e){return t.apply(this,arguments)}),},{key:"sortDependencies",value:function(e){var t=this,n=new f.a(),r={},i={};e.forEach(function(e){n.add(e.libraryPath,e.dependencies),e.preloadedCss&&((r[e.libraryPath]=r[e.libraryPath]?r[e.libraryPath]:[]),e.preloadedCss.forEach(function(n){r[e.libraryPath].push("".concat(t.path,"/").concat(e.libraryPath,"/").concat(n.path))})),e.preloadedJs&&((i[e.libraryPath]=i[e.libraryPath]?i[e.libraryPath]:[]),e.preloadedJs.forEach(function(n){i[e.libraryPath].push("".concat(t.path,"/").concat(e.libraryPath,"/").concat(n.path))}))});var o=[],a=[];return(n.sort().reverse().forEach(function(e){Array.prototype.push.apply(o,r[e]),Array.prototype.push.apply(a,i[e])}),this.mainLibrary.preloadedCss&&Array.prototype.push.apply(o,this.mainLibrary.preloadedCss.map(function(e){return"".concat(t.path,"/").concat(t.mainLibraryPath,"/").concat(e.path)})),this.mainLibrary.preloadedJs&&Array.prototype.push.apply(a,this.mainLibrary.preloadedJs.map(function(e){return"".concat(t.path,"/").concat(t.mainLibraryPath,"/").concat(e.path)})),{styles:o,scripts:a})},},]),e)})();n(4),n(5),n(6),n(7);window.H5P.preventInit=!0;t.default={H5P:g}},]).default}) \ No newline at end of file diff --git a/package.json b/package.json index 6fa6a04..25dbdd9 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "src/index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", - "copy-h5p-standalone": "cp -R node_modules/h5p-standalone/dist/* src/template", + "copy-h5p-standalone": "cp -R edited-h5p-standalone/* src/template", "start": "node ./src/index.js" }, "repository": {