graphdb-workbench 2.1.0-RC2 → 2.1.0-RC3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{11.7d07164f552bc27c327e.bundle.js → 11.7e4dcae789c43fc6131e.bundle.js} +2 -2
- package/dist/11.7e4dcae789c43fc6131e.bundle.js.map +1 -0
- package/dist/134.674fc334ea03aadba240.bundle.js +1 -1
- package/dist/134.674fc334ea03aadba240.bundle.js.map +1 -1
- package/dist/18.b39247b09bf69883801d.bundle.js +1 -1
- package/dist/18.b39247b09bf69883801d.bundle.js.map +1 -1
- package/dist/{25.e39c618ca1d1636339cf.bundle.js → 25.4aee6f444ae15b393a95.bundle.js} +2 -2
- package/dist/25.4aee6f444ae15b393a95.bundle.js.map +1 -0
- package/dist/30.aa58eb05e16cb046b2bc.bundle.js +1 -1
- package/dist/30.aa58eb05e16cb046b2bc.bundle.js.map +1 -1
- package/dist/31.27bb6cb77874c106bdf3.bundle.js +1 -1
- package/dist/31.27bb6cb77874c106bdf3.bundle.js.map +1 -1
- package/dist/70.9a3a49005f2f0f088bf0.bundle.js +2 -0
- package/dist/70.9a3a49005f2f0f088bf0.bundle.js.map +1 -0
- package/dist/71.997880006015b3f246cc.bundle.js +2 -0
- package/dist/71.997880006015b3f246cc.bundle.js.map +1 -0
- package/dist/73.2f485c964b689f1e927a.bundle.js +2 -0
- package/dist/73.2f485c964b689f1e927a.bundle.js.map +1 -0
- package/dist/75.7e5798d90571469de255.bundle.js +2 -0
- package/dist/75.7e5798d90571469de255.bundle.js.map +1 -0
- package/dist/78.931509bfe1d61d91eb06.bundle.js +2 -0
- package/dist/78.931509bfe1d61d91eb06.bundle.js.map +1 -0
- package/dist/79.ac5cb425c55f53b96a37.bundle.js +2 -0
- package/dist/79.ac5cb425c55f53b96a37.bundle.js.map +1 -0
- package/dist/{80.6dd83199b3a62951ba72.bundle.js → 80.e250a6936fcc15642e07.bundle.js} +1 -1
- package/dist/80.e250a6936fcc15642e07.bundle.js.map +1 -0
- package/dist/82.5546d65e41f31a410b86.bundle.js +1 -1
- package/dist/82.5546d65e41f31a410b86.bundle.js.map +1 -1
- package/dist/{bundle.49773f8bd1b7acd52299.bundle.js → bundle.22ecad5921060aa35ed6.bundle.js} +18 -18
- package/dist/bundle.22ecad5921060aa35ed6.bundle.js.map +1 -0
- package/dist/i18n/locale-en.json +10 -4
- package/dist/index.html +3 -3
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/cluster-management/clusterInfo.html +3 -3
- package/dist/pages/create-index.html +4 -4
- package/dist/pages/dependencies.html +1 -1
- package/dist/pages/domainRangeInfo.html +2 -2
- package/dist/pages/edit.html +1 -1
- package/dist/pages/explore.html +1 -1
- package/dist/pages/export.html +1 -1
- package/dist/pages/find.html +1 -1
- package/dist/pages/graph-config/saveGraphConfig.html +11 -11
- package/dist/pages/graphs-visualizations.html +7 -7
- package/dist/pages/guides.html +1 -1
- package/dist/pages/import.html +1 -1
- package/dist/pages/jdbc-create.html +5 -5
- package/dist/pages/monitor/queries.html +1 -1
- package/dist/pages/monitor/resources.html +2 -2
- package/dist/pages/namespaces.html +2 -2
- package/dist/pages/plugins.html +1 -1
- package/dist/pages/rdfClassHierarchyInfo.html +8 -7
- package/dist/pages/rdfrank.html +2 -2
- package/dist/pages/repositories.html +2 -2
- package/dist/pages/repository.html +42 -11
- package/dist/pages/similarity-indexes.html +1 -1
- package/dist/pages/sparql-template-create.html +5 -5
- package/dist/pages/sparql.html +3 -3
- package/dist/pages/webapi.html +2 -2
- package/dist/plugins.js +135 -51
- package/dist/res/swagger/index.html +27 -27
- package/package.json +1 -1
- package/dist/11.7d07164f552bc27c327e.bundle.js.map +0 -1
- package/dist/25.e39c618ca1d1636339cf.bundle.js.map +0 -1
- package/dist/70.24c74a3f706feb476c62.bundle.js +0 -2
- package/dist/70.24c74a3f706feb476c62.bundle.js.map +0 -1
- package/dist/71.0ab35e02331bebfd8b68.bundle.js +0 -2
- package/dist/71.0ab35e02331bebfd8b68.bundle.js.map +0 -1
- package/dist/73.86adae641bf117fce3fe.bundle.js +0 -2
- package/dist/73.86adae641bf117fce3fe.bundle.js.map +0 -1
- package/dist/75.9923d34e550b5358194c.bundle.js +0 -2
- package/dist/75.9923d34e550b5358194c.bundle.js.map +0 -1
- package/dist/78.b8fa389df60b30d1df18.bundle.js +0 -2
- package/dist/78.b8fa389df60b30d1df18.bundle.js.map +0 -1
- package/dist/79.58a71128203d7abe5973.bundle.js +0 -2
- package/dist/79.58a71128203d7abe5973.bundle.js.map +0 -1
- package/dist/80.6dd83199b3a62951ba72.bundle.js.map +0 -1
- package/dist/bundle.49773f8bd1b7acd52299.bundle.js.map +0 -1
package/dist/{bundle.49773f8bd1b7acd52299.bundle.js → bundle.22ecad5921060aa35ed6.bundle.js}
RENAMED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
!function(t){function e(e){for(var n,i,s=e[0],o=e[1],a=0,c=[];a<s.length;a++)i=s[a],Object.prototype.hasOwnProperty.call(r,i)&&r[i]&&c.push(r[i][0]),r[i]=0;for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n]);for(u&&u(e);c.length;)c.shift()()}var n={},r={122:0};function i(e){if(n[e])return n[e].exports;var r=n[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.e=function(t){var e=[],n=r[t];if(0!==n)if(n)e.push(n[2]);else{var s=new Promise((function(e,i){n=r[t]=[e,i]}));e.push(n[2]=s);var o,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(t){return i.p+""+({}[t]||t)+"."+{0:"2af856eced823a680859",1:"45f8e4931136db54363e",2:"866eec7e8745f6234b7d",3:"6c968a5a5ca65b702792",4:"2569b8cbd29257692f79",5:"e6ebc1c858a5b922c8fb",6:"213adc8245edef304232",7:"3f1b6ccc3cbff48551ec",8:"7e80265eb676d049547d",9:"0b804b71b898cace0d51",10:"018ca946a702a519142b",11:"7d07164f552bc27c327e",12:"800cb839e2eeecd15ad5",13:"12141a160217948d97e1",14:"6c4f3692cbe6ee8ed73d",15:"c0629323df8bafb5a788",16:"35bd2e472c19bcc0c6d1",17:"6a26e7fdc593a8dc3f59",18:"b39247b09bf69883801d",19:"7f55a7f5d4ca1b646407",20:"ceb98cbe18c738de2393",21:"fb9b4017de78e79d01a7",22:"4ccd425801b21e101fec",23:"a664a57e7da24c9796bc",24:"8fd98e1866c43357a15d",25:"e39c618ca1d1636339cf",26:"3853609f39f51acaaae4",27:"87b8ec4105a9ff8d680f",28:"12f5b42f5f6378775ab1",29:"3d299c04c603c7001d70",30:"aa58eb05e16cb046b2bc",31:"27bb6cb77874c106bdf3",32:"06f392a8f3b855594afa",33:"ae6ba36a5be1ca5c8f13",34:"a0fdf0057b3ac0c137ba",35:"f4b777c7aa15dbb92410",36:"482d18bfba58cd2b4326",37:"db967dfe4641139472a6",38:"da41947ae2e0e467fe5a",39:"332b1cb6a11aabf77986",40:"a15572367b822c1e9fcc",41:"961a43ff15e4125d4a34",42:"006fa9f7a6e17bc34391",43:"43b158e8fb944dd2de26",44:"04a3ed30f28a8eda63d2",45:"3f239ee36357d6e9a572",46:"d61e16839016b98caad2",47:"cfdc578c27f65aa04370",48:"e41d3852d0240c228640",49:"1bb5a5fc03aab1cb710e",50:"f43de5b83f3fe0f1d4bd",51:"8e4867cdb91b3a714b7c",52:"87e251b63ec08a4fb27d",53:"a3e712481865cdb425cc",54:"541402571ebb2d19f8a3",55:"975653547fd9764a2a71",56:"9b5d58d55e94edcc8b0a",57:"961005d8ad7af257f311",58:"a5f05cace85118602107",59:"06d98cbc45a9bf3133d5",60:"205ad76bf8d69b9c00a7",61:"70e327e808edf21f62d5",62:"8aa18053a8dbe17495de",63:"dd214e3a46666f6858b0",64:"d2ba6497382e547547c1",65:"786a8a66f654bee5bfc1",66:"7bfb79b32b0a0d15d946",67:"1356aed7f6498bc74989",68:"c4702868f8bfa090a5dc",69:"24f7049678e4d1daf7d0",70:"24c74a3f706feb476c62",71:"0ab35e02331bebfd8b68",72:"3bc9349132a7d3a1be26",73:"86adae641bf117fce3fe",74:"6b60a4237e762af25aeb",75:"9923d34e550b5358194c",76:"7d22deb94b514347a5c7",77:"4e84abd9b025b1812617",78:"b8fa389df60b30d1df18",79:"58a71128203d7abe5973",80:"6dd83199b3a62951ba72",81:"20f163625c61d1bfb502",82:"5546d65e41f31a410b86",83:"7abbe4e169521bfe7922",84:"80d37d0ddcfac8febf85",85:"6db38d2acf129418e364",86:"ccc0254c84126acec035",87:"e91dad8ff1c745245437",88:"7ea49b3f6eb283f5b4de",89:"9a5f3911782f145608d5",90:"14e8b6313641332d91cc",91:"19d221851a9e4cc1c309",92:"29f3b8c01256497723ad",93:"9762e532d75f531ff1f6",94:"1bdaae66a9358a539e6e",95:"143ed25274aa2f5d97bd",96:"8f85bcdd38ccc9a8f9c5",97:"474ec4e9a57fc0eacded",98:"73675340eac75910ad10",99:"19fa0954fe8af118f2b4",100:"ed952dfb8809934b3109",101:"26282fd3bcdec7572080",102:"ad9395f95733d16e3b4d",103:"94d6409d994e443554f0",104:"c98cf44ecf7c73af9190",105:"287b65e0a4438c7c2efd",106:"16278942204d9e624f55",107:"c69e530607378cbea6fd",108:"0309517b3f296b11e6cc",109:"4ec73d6d22c9a7ae0808",110:"08c4f65addfe97d85136",111:"e14ff57a9300db896814",112:"10df3caf5b784be35d0b",113:"22c1aba8ed5cba1dd8e4",114:"db038038f8afbc4eeda8",115:"f6d25b6e4cf3f0496f30",116:"c7bb0a4a09baf53c797e",117:"34635282d1e2ac2a1a21",118:"6d803973461a629687b0",119:"e38ecfa30d44abca83c7",120:"f3c50d2ad030ba6ae573",121:"afca46791ee897a1ce7e",125:"2dd261425102fa57d477",126:"570bbf5b388b8cd3962b",127:"4501e4877389d292ccd2",128:"4c22bbb0bddb2bbe2e14",129:"7a81eb2255d43a1a230e",130:"19e53db9e589fcd25802",131:"9fae2c5226a12ee09bdd",132:"32aa1775e6e81d7579cb",133:"2317e00ddb77c6121919",134:"674fc334ea03aadba240",135:"4d1c7e7d116a20355b6d",136:"c602f584444cbe4d7106",137:"af89b4fc67f18fd43ada",138:"620cc47c1129cbfcf787",139:"c33515ab5bc4b7a5730f",140:"4dfd2b8a710229472e2b",141:"ebfc1ad053eb5f24ea49",142:"be46d073aa363d3c07ba",143:"3fd322a7611056c80f8c",144:"c9ecea7f84da1eab1f9b",145:"1d339037e997c081d23a",146:"80ed63011a467dd76775",147:"3a7bb3d478308d3728ab",148:"0e0e690c86efbc4a88af",149:"2b14e3352da819be42c8",150:"99c877f335ffebc83249",151:"88c42cbb644fe1530c08",152:"00008258ae13818122d7",153:"ae1e7b25fae0a82a8b62",154:"b32bb99440fd4d59358e",155:"7c241378be86877d60ac",156:"45af3d9d71cfe0dcb504",157:"c54e1424084a9328745d",158:"539e2f99c71c5b254127",159:"492d9a7310155fc3fb0e",160:"f9af6f3c4af153df7caa",161:"db6e8215440d96a8b00b",162:"f0db4b33b452e95d2429",163:"4d3e55ae9287b7920fba",164:"d81c76d872cdc5be8473",165:"1bec422ca7f2daecec34",166:"3b4d1583f349cee6dbfb",167:"0d1080b20a93f0b50a6c",168:"b82c4e8540b80285ad6a",169:"699d259044567273e867",170:"804802ce53ee073dddf7",171:"c84ec2d276281aa1f179",172:"ba67c4e1fe11826783a2",173:"7d7e87e616abfcd8dbfd"}[t]+".bundle.js"}(t);var u=new Error;o=function(e){a.onerror=a.onload=null,clearTimeout(c);var n=r[t];if(0!==n){if(n){var i=e&&("load"===e.type?"missing":e.type),s=e&&e.target&&e.target.src;u.message="Loading chunk "+t+" failed.\n("+i+": "+s+")",u.name="ChunkLoadError",u.type=i,u.request=s,n[1](u)}r[t]=void 0}};var c=setTimeout((function(){o({type:"timeout",target:a})}),12e4);a.onerror=a.onload=o,document.head.appendChild(a)}return Promise.all(e)},i.m=t,i.c=n,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i.oe=function(t){throw console.error(t),t};var s=window.webpackJsonp=window.webpackJsonp||[],o=s.push.bind(s);s.push=e,s=s.slice();for(var a=0;a<s.length;a++)e(s[a]);var u=o;i(i.s=0)}([function(t,e,n){"use strict";n.r(e),n.d(e,"decodeHTML",(function(){return r}));n(4),n(26),n(31),n(188),n(37),n(189),n(21),n(32),n(33);const r=function(t){let e=document.createElement("textarea");return e.innerHTML=t,e.value},i=["ngRoute","graphdb.workbench.se.controllers","graphdb.framework.core","angularCancelOnNavigateModule","oc.lazyLoad","pascalprecht.translate","graphdb.framework.core.interceptors.unauthorized","graphdb.framework.core.directives.rdfresourcesearch.rdfresourcesearch","graphdb.framework.core.directives.languageselector.languageselector","graphdb.framework.guides.services"],s=["$routeProvider","$locationProvider","$menuItemsProvider","toastrConfig","localStorageServiceProvider","$tooltipProvider","$httpProvider","$templateRequestProvider","$translateProvider"];$.get("rest/info/version?local=1",(function(t){const e=t.productVersion.match(/^(\d+\.\d+)/);e.length?t.productShortVersion=e[1]:t.productShortVersion=t.productVersion;const o=t.productVersion.match(/(-.*?)(-|$)/);o&&o.length&&(t.productShortVersion=t.productShortVersion+o[1]),function(t){const e=angular.module("graphdb.workbench",i);e.config([...s,function(e,r,i,s,o,a,u,c,l){l.useStaticFilesLoader({prefix:"i18n/locale-",suffix:".json?v=2.1.0-RC2"}),l.preferredLanguage("en"),l.useSanitizeValueStrategy("escape"),angular.extend(s,{timeOut:5e3,positionClass:"toast-bottom-right",tapToDismiss:!1,extendedTimeOut:5e3}),o.setStorageType("localStorage").setNotify(!0,!0);var h=e.$get[e.$get.length-1]({$on:function(){}});e.when("_openid_implicit_",{controller:function(){},template:"<div></div>"}),h.routes._openid_implicit_.regexp=/[&/](?:id_token=.*&access_token=|access_token=.*&id_token=)/;let f=PluginRegistry.get("route");angular.forEach(f,(function(t){e.when(t.url,{controller:t.controller,templateUrl:t.templateUrl,title:t.title,helpInfo:t.helpInfo,reloadOnSearch:void 0===t.reloadOnSearch||t.reloadOnSearch,resolve:{preload:["$ocLazyLoad","$q",function(e,r){return t.path?n(190)("./"+t.path).then(n=>{e.inject(t.module)}):r.defer().resolve()}]}})})),e.otherwise({templateUrl:"pages/not_found.html"}),r.html5Mode(!0),a.setTriggers({show:"hide"}),a.options({appendToBody:!0}),i.setProductInfo(t),PluginRegistry.get("main.menu").forEach((function(t){t.items.forEach((function(t){i.addItem(t)}))})),u.interceptors.push("$unauthorizedInterceptor");const p=c.$get[3];"function"==typeof p&&(c.$get[3]=function(t,e,n){const r=p(t,e,n);return function(e,n){return t.get(e)||(e+="?v=2.1.0-RC2"),r(e,n)}})}]),e.constant("productInfo",t),e.run(["$rootScope","$route","toastr","$sce","$translate","LocalStorageAdapter","LSKeys","GuidesService",function(t,e,n,i,s,o,a,u){function c(){e.current.title?document.title=r(s.instant(e.current.title))+" | GraphDB Workbench":document.title="GraphDB Workbench",t.helpInfo=i.trustAsHtml(r(s.instant(e.current.helpInfo))),t.title=r(s.instant(e.current.title))}t.$on("$routeChangeSuccess",(function(){c(),n.clear()})),t.$on("$translateChangeSuccess",(function(){c()}));const l=o.get(a.WORKBENCH_SETTINGS);if(l&&l.theme){const t=document.querySelector(":root");"dark"===l.theme&&t.classList.add("dark")}u.init()}]),e.filter("titlecase",(function(){return function(t){var e=""+t;return e.charAt(0).toUpperCase()+e.slice(1)}})),angular.bootstrap(document,["graphdb.workbench"])}(t)}))},function(t,e,n){"use strict";n.r(e),n.d(e,"GuideUtils",(function(){return r}));const r=function(){const t=function(t,e,n=!0){return new Promise((function(r,i){let s=1e3*e|1e3;const o=setInterval(()=>{try{let e=document.querySelector(t);null!=e?!n||angular.element(e).is(":visible")?(clearInterval(o),setTimeout(()=>{r(angular.element(e))},0)):(s-=100,s<0&&(clearInterval(o),console.log("Element is not visible: "+t),i())):(s-=100,s<0&&(clearInterval(o),console.log("Element is not found: "+t),i()))}catch(e){clearInterval(o),console.log("Error when processing selector: "+t),console.log(e),i()}},100)}))},e=function(t){const e=document.querySelector(t);return e&&angular.element(e).is(":visible")},n=function(t,e){return`[guide-selector="${t}"] ${e||""}`},i=(t,e,n,r)=>{const i=t.use();let o;return angular.isObject(n)?(o=n[i],o||(o=n.en),o=e(o)(r)):o=s(t.instant(n,r)),o},s=t=>{const e=document.createElement("div");return e.innerHTML=t,e.innerText},o=t=>n("yasrResults",t);return{GUIDES_LIST_URL:"/rest/guides",GUIDES_DOWNLOAD_URL:"/rest/guides/download/",waitFor:t,clickOnElement:function(e){return()=>t(e).then(t=>t.click())},clickOnGuideElement:function(t,e){return r.clickOnElement(r.getGuideElementSelector(t,e))},getGuideElementSelector:n,isVisible:e,isGuideElementVisible:function(t){return this.isVisible(n(t))},awaitAlphaDropD3:function(t,n,r=2,i=.02){return()=>new Promise((function(s){e(t)?s():setTimeout(()=>{let t=1e3*r;const e=setInterval(()=>{n.d3alpha<i?(clearInterval(e),s()):(t-=100,t<0&&(clearInterval(e),s()))},100)},150)}))},graphVizExpandNode:function(t){const e=d3.select(t),n=new CustomEvent("gdb-expand-node",{detail:e.datum()});e.node().dispatchEvent(n)},graphVizShowNodeInfo:function(t){const e=d3.select(t),n=new CustomEvent("gdb-show-node-info",{detail:e.datum()});e.node().dispatchEvent(n)},classHierarchyFocus:function(t){const e=d3.select(t),n=new CustomEvent("gdb-focus",{detail:e.datum()});e.node().dispatchEvent(n)},classHierarchyZoom:function(t){const e=d3.select(t),n=new CustomEvent("gdb-zoom",{detail:e.datum()});e.node().dispatchEvent(n)},validateTextInput:function(t,e,n=!0){const r=$(t).val();return""===r&&n?($(t).val(e),$(t).trigger("change"),!0):r===e},translateLocalMessage:i,unescapeHtml:s,noNextErrorToast:(t,e,n,r,o)=>{t.error(s(i(e,n,r,o)),s(i(e,n,"guide.validate.no-next",o)),{allowHtml:!0})},deferredShow:t=>()=>new Promise((function(e){setTimeout(()=>{e()},t)})),scrollToTop:()=>{window.scrollTo(0,0)},removeWhiteSpaces:t=>t.replace(/\s+/g,""),toResourceDownloadUrl:t=>"/rest/guides/download/"+t.resourcePath+"/"+t.resourceFile,getSparqlEditorSelector:t=>n("queryEditor"," .CodeMirror-code",t),getSparqlResultsSelector:o,getSparqlResultsSelectorForIri:t=>o("a[title='"+t+"']"),getSparqlResultsSelectorForRow:t=>o("tbody tr:nth-child("+t+")")}}()},function(t,e,n){"use strict";n.r(e),n.d(e,"UserType",(function(){return i})),n.d(e,"UserRole",(function(){return r})),n.d(e,"UserUtils",(function(){return s}));const r=Object.freeze({ROLE_ADMIN:"ROLE_ADMIN",ROLE_USER:"ROLE_USER",ROLE_REPO_MANAGER:"ROLE_REPO_MANAGER"}),i=Object.freeze({ADMIN:"admin",USER:"user",REPO_MANAGER:"repoManager"}),s={getUserRoleName:function(t){switch(t){case i.USER:return"User";case i.REPO_MANAGER:return"Repository manager";case i.ADMIN:return"Administrator";default:return"Unknown"}}}},function(t,e,n){(function(t){var n,r,i,s,o,a,u,c,l,h,f,p={userAgent:!1},d={},g=g||(n=Math,i=(r={}).lib={},s=i.Base=function(){function t(){}return{extend:function(e){t.prototype=this;var n=new t;return e&&n.mixIn(e),n.hasOwnProperty("init")||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),o=i.WordArray=s.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var s=0;s<i;s++){var o=n[s>>>2]>>>24-s%4*8&255;e[r+s>>>2]|=o<<24-(r+s)%4*8}else for(s=0;s<i;s+=4)e[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=n.ceil(e/4)},clone:function(){var t=s.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r<t;r+=4)e.push(4294967296*n.random()|0);return new o.init(e,t)}}),a=r.enc={},u=a.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i++){var s=e[i>>>2]>>>24-i%4*8&255;r.push((s>>>4).toString(16)),r.push((15&s).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new o.init(n,e/2)}},c=a.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i++){var s=e[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(s))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new o.init(n,e)}},l=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},h=i.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=l.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var e=this._data,r=e.words,i=e.sigBytes,s=this.blockSize,a=i/(4*s),u=(a=t?n.ceil(a):n.max((0|a)-this._minBufferSize,0))*s,c=n.min(4*u,i);if(u){for(var l=0;l<u;l+=s)this._doProcessBlock(r,l);var h=r.splice(0,u);e.sigBytes-=c}return new o.init(h,c)},clone:function(){var t=s.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),i.Hasher=h.extend({cfg:s.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new f.HMAC.init(t,n).finalize(e)}}}),f=r.algo={},r);!function(t){var e,n=(e=g).lib,r=n.Base,i=n.WordArray;(e=e.x64={}).Word=r.extend({init:function(t,e){this.high=t,this.low=e}}),e.WordArray=r.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,n=[],r=0;r<e;r++){var s=t[r];n.push(s.high),n.push(s.low)}return i.create(n,this.sigBytes)},clone:function(){for(var t=r.clone.call(this),e=t.words=this.words.slice(0),n=e.length,i=0;i<n;i++)e[i]=e[i].clone();return t}})}(),g.lib.Cipher||function(t){var e=(p=g).lib,n=e.Base,r=e.WordArray,i=e.BufferedBlockAlgorithm,s=p.enc.Base64,o=p.algo.EvpKDF,a=e.Cipher=i.extend({cfg:n.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,n){this.cfg=this.cfg.extend(n),this._xformMode=t,this._key=e,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(t){return{encrypt:function(e,n,r){return("string"==typeof n?d:f).encrypt(t,e,n,r)},decrypt:function(e,n,r){return("string"==typeof n?d:f).decrypt(t,e,n,r)}}}});e.StreamCipher=a.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=p.mode={},c=function(t,e,n){var r=this._iv;r?this._iv=void 0:r=this._prevBlock;for(var i=0;i<n;i++)t[e+i]^=r[i]},l=(e.BlockCipherMode=n.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}})).extend();l.Encryptor=l.extend({processBlock:function(t,e){var n=this._cipher,r=n.blockSize;c.call(this,t,e,r),n.encryptBlock(t,e),this._prevBlock=t.slice(e,e+r)}}),l.Decryptor=l.extend({processBlock:function(t,e){var n=this._cipher,r=n.blockSize,i=t.slice(e,e+r);n.decryptBlock(t,e),c.call(this,t,e,r),this._prevBlock=i}}),u=u.CBC=l,l=(p.pad={}).Pkcs7={pad:function(t,e){for(var n,i=(n=(n=4*e)-t.sigBytes%n)<<24|n<<16|n<<8|n,s=[],o=0;o<n;o+=4)s.push(i);n=r.create(s,n),t.concat(n)},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2]}},e.BlockCipher=a.extend({cfg:a.cfg.extend({mode:u,padding:l}),reset:function(){a.reset.call(this);var t=(e=this.cfg).iv,e=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=e.createEncryptor;else n=e.createDecryptor,this._minBufferSize=1;this._mode=n.call(e,this,t&&t.words)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else e=this._process(!0),t.unpad(e);return e},blockSize:4});var h=e.CipherParams=n.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),f=(u=(p.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext;return((t=t.salt)?r.create([1398893684,1701076831]).concat(t).concat(e):e).toString(s)},parse:function(t){var e=(t=s.parse(t)).words;if(1398893684==e[0]&&1701076831==e[1]){var n=r.create(e.slice(2,4));e.splice(0,4),t.sigBytes-=16}return h.create({ciphertext:t,salt:n})}},e.SerializableCipher=n.extend({cfg:n.extend({format:u}),encrypt:function(t,e,n,r){r=this.cfg.extend(r);var i=t.createEncryptor(n,r);return e=i.finalize(e),i=i.cfg,h.create({ciphertext:e,key:n,iv:i.iv,algorithm:t,mode:i.mode,padding:i.padding,blockSize:t.blockSize,formatter:r.format})},decrypt:function(t,e,n,r){return r=this.cfg.extend(r),e=this._parse(e,r.format),t.createDecryptor(n,r).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}})),p=(p.kdf={}).OpenSSL={execute:function(t,e,n,i){return i||(i=r.random(8)),t=o.create({keySize:e+n}).compute(t,i),n=r.create(t.words.slice(e),4*n),t.sigBytes=4*e,h.create({key:t,iv:n,salt:i})}},d=e.PasswordBasedCipher=f.extend({cfg:f.cfg.extend({kdf:p}),encrypt:function(t,e,n,r){return n=(r=this.cfg.extend(r)).kdf.execute(n,t.keySize,t.ivSize),r.iv=n.iv,(t=f.encrypt.call(this,t,e,n.key,r)).mixIn(n),t},decrypt:function(t,e,n,r){return r=this.cfg.extend(r),e=this._parse(e,r.format),n=r.kdf.execute(n,t.keySize,t.ivSize,e.salt),r.iv=n.iv,f.decrypt.call(this,t,e,n.key,r)}})}(),function(){for(var t=g,e=t.lib.BlockCipher,n=t.algo,r=[],i=[],s=[],o=[],a=[],u=[],c=[],l=[],h=[],f=[],p=[],d=0;256>d;d++)p[d]=128>d?d<<1:d<<1^283;var m=0,v=0;for(d=0;256>d;d++){var y=(y=v^v<<1^v<<2^v<<3^v<<4)>>>8^255&y^99;r[m]=y,i[y]=m;var b=p[m],w=p[b],x=p[w],S=257*p[y]^16843008*y;s[m]=S<<24|S>>>8,o[m]=S<<16|S>>>16,a[m]=S<<8|S>>>24,u[m]=S,S=16843009*x^65537*w^257*b^16843008*m,c[y]=S<<24|S>>>8,l[y]=S<<16|S>>>16,h[y]=S<<8|S>>>24,f[y]=S,m?(m=b^p[p[p[x^b]]],v^=p[p[v]]):m=v=1}var E=[0,1,2,4,8,16,32,64,128,27,54];n=n.AES=e.extend({_doReset:function(){for(var t=(n=this._key).words,e=n.sigBytes/4,n=4*((this._nRounds=e+6)+1),i=this._keySchedule=[],s=0;s<n;s++)if(s<e)i[s]=t[s];else{var o=i[s-1];s%e?6<e&&4==s%e&&(o=r[o>>>24]<<24|r[o>>>16&255]<<16|r[o>>>8&255]<<8|r[255&o]):(o=r[(o=o<<8|o>>>24)>>>24]<<24|r[o>>>16&255]<<16|r[o>>>8&255]<<8|r[255&o],o^=E[s/e|0]<<24),i[s]=i[s-e]^o}for(t=this._invKeySchedule=[],e=0;e<n;e++)s=n-e,o=e%4?i[s]:i[s-4],t[e]=4>e||4>=s?o:c[r[o>>>24]]^l[r[o>>>16&255]]^h[r[o>>>8&255]]^f[r[255&o]]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,s,o,a,u,r)},decryptBlock:function(t,e){var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n,this._doCryptBlock(t,e,this._invKeySchedule,c,l,h,f,i),n=t[e+1],t[e+1]=t[e+3],t[e+3]=n},_doCryptBlock:function(t,e,n,r,i,s,o,a){for(var u=this._nRounds,c=t[e]^n[0],l=t[e+1]^n[1],h=t[e+2]^n[2],f=t[e+3]^n[3],p=4,d=1;d<u;d++){var g=r[c>>>24]^i[l>>>16&255]^s[h>>>8&255]^o[255&f]^n[p++],m=r[l>>>24]^i[h>>>16&255]^s[f>>>8&255]^o[255&c]^n[p++],v=r[h>>>24]^i[f>>>16&255]^s[c>>>8&255]^o[255&l]^n[p++];f=r[f>>>24]^i[c>>>16&255]^s[l>>>8&255]^o[255&h]^n[p++],c=g,l=m,h=v}g=(a[c>>>24]<<24|a[l>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^n[p++],m=(a[l>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&c])^n[p++],v=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[c>>>8&255]<<8|a[255&l])^n[p++],f=(a[f>>>24]<<24|a[c>>>16&255]<<16|a[l>>>8&255]<<8|a[255&h])^n[p++],t[e]=g,t[e+1]=m,t[e+2]=v,t[e+3]=f},keySize:8});t.AES=e._createHelper(n)}(),function(){function t(t,e){var n=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=n,this._lBlock^=n<<t}function e(t,e){var n=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=n,this._rBlock^=n<<t}var n=g,r=(i=n.lib).WordArray,i=i.BlockCipher,s=n.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=s.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],n=0;56>n;n++){var r=o[n]-1;e[n]=t[r>>>5]>>>31-r%32&1}for(t=this._subKeys=[],r=0;16>r;r++){var i=t[r]=[],s=u[r];for(n=0;24>n;n++)i[n/6|0]|=e[(a[n]-1+s)%28]<<31-n%6,i[4+(n/6|0)]|=e[28+(a[n+24]-1+s)%28]<<31-n%6;for(i[0]=i[0]<<1|i[0]>>>31,n=1;7>n;n++)i[n]>>>=4*(n-1)+3;i[7]=i[7]<<5|i[7]>>>27}for(e=this._invSubKeys=[],n=0;16>n;n++)e[n]=t[15-n]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(n,r,i){this._lBlock=n[r],this._rBlock=n[r+1],t.call(this,4,252645135),t.call(this,16,65535),e.call(this,2,858993459),e.call(this,8,16711935),t.call(this,1,1431655765);for(var s=0;16>s;s++){for(var o=i[s],a=this._lBlock,u=this._rBlock,h=0,f=0;8>f;f++)h|=c[f][((u^o[f])&l[f])>>>0];this._lBlock=u,this._rBlock=a^h}i=this._lBlock,this._lBlock=this._rBlock,this._rBlock=i,t.call(this,1,1431655765),e.call(this,8,16711935),e.call(this,2,858993459),t.call(this,16,65535),t.call(this,4,252645135),n[r]=this._lBlock,n[r+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});n.DES=i._createHelper(h),s=s.TripleDES=i.extend({_doReset:function(){var t=this._key.words;this._des1=h.createEncryptor(r.create(t.slice(0,2))),this._des2=h.createEncryptor(r.create(t.slice(2,4))),this._des3=h.createEncryptor(r.create(t.slice(4,6)))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2}),n.TripleDES=i._createHelper(s)}(),function(){var t=g,e=t.lib.WordArray;t.enc.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,r=this._map;t.clamp(),t=[];for(var i=0;i<n;i+=3)for(var s=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,o=0;4>o&&i+.75*o<n;o++)t.push(r.charAt(s>>>6*(3-o)&63));if(e=r.charAt(64))for(;t.length%4;)t.push(e);return t.join("")},parse:function(t){var n=t.length,r=this._map;(i=r.charAt(64))&&(-1!=(i=t.indexOf(i))&&(n=i));for(var i=[],s=0,o=0;o<n;o++)if(o%4){var a=r.indexOf(t.charAt(o-1))<<o%4*2,u=r.indexOf(t.charAt(o))>>>6-o%4*2;i[s>>>2]|=(a|u)<<24-s%4*8,s++}return e.create(i,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(t){function e(t,e,n,r,i,s,o){return((t=t+(e&n|~e&r)+i+o)<<s|t>>>32-s)+e}function n(t,e,n,r,i,s,o){return((t=t+(e&r|n&~r)+i+o)<<s|t>>>32-s)+e}function r(t,e,n,r,i,s,o){return((t=t+(e^n^r)+i+o)<<s|t>>>32-s)+e}function i(t,e,n,r,i,s,o){return((t=t+(n^(e|~r))+i+o)<<s|t>>>32-s)+e}for(var s=g,o=(u=s.lib).WordArray,a=u.Hasher,u=s.algo,c=[],l=0;64>l;l++)c[l]=4294967296*t.abs(t.sin(l+1))|0;u=u.MD5=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,s){for(var o=0;16>o;o++){var a=t[u=s+o];t[u]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}o=this._hash.words;var u=t[s+0],l=(a=t[s+1],t[s+2]),h=t[s+3],f=t[s+4],p=t[s+5],d=t[s+6],g=t[s+7],m=t[s+8],v=t[s+9],y=t[s+10],b=t[s+11],w=t[s+12],x=t[s+13],S=t[s+14],E=t[s+15],F=e(F=o[0],D=o[1],C=o[2],A=o[3],u,7,c[0]),A=e(A,F,D,C,a,12,c[1]),C=e(C,A,F,D,l,17,c[2]),D=e(D,C,A,F,h,22,c[3]);F=e(F,D,C,A,f,7,c[4]),A=e(A,F,D,C,p,12,c[5]),C=e(C,A,F,D,d,17,c[6]),D=e(D,C,A,F,g,22,c[7]),F=e(F,D,C,A,m,7,c[8]),A=e(A,F,D,C,v,12,c[9]),C=e(C,A,F,D,y,17,c[10]),D=e(D,C,A,F,b,22,c[11]),F=e(F,D,C,A,w,7,c[12]),A=e(A,F,D,C,x,12,c[13]),C=e(C,A,F,D,S,17,c[14]),F=n(F,D=e(D,C,A,F,E,22,c[15]),C,A,a,5,c[16]),A=n(A,F,D,C,d,9,c[17]),C=n(C,A,F,D,b,14,c[18]),D=n(D,C,A,F,u,20,c[19]),F=n(F,D,C,A,p,5,c[20]),A=n(A,F,D,C,y,9,c[21]),C=n(C,A,F,D,E,14,c[22]),D=n(D,C,A,F,f,20,c[23]),F=n(F,D,C,A,v,5,c[24]),A=n(A,F,D,C,S,9,c[25]),C=n(C,A,F,D,h,14,c[26]),D=n(D,C,A,F,m,20,c[27]),F=n(F,D,C,A,x,5,c[28]),A=n(A,F,D,C,l,9,c[29]),C=n(C,A,F,D,g,14,c[30]),F=r(F,D=n(D,C,A,F,w,20,c[31]),C,A,p,4,c[32]),A=r(A,F,D,C,m,11,c[33]),C=r(C,A,F,D,b,16,c[34]),D=r(D,C,A,F,S,23,c[35]),F=r(F,D,C,A,a,4,c[36]),A=r(A,F,D,C,f,11,c[37]),C=r(C,A,F,D,g,16,c[38]),D=r(D,C,A,F,y,23,c[39]),F=r(F,D,C,A,x,4,c[40]),A=r(A,F,D,C,u,11,c[41]),C=r(C,A,F,D,h,16,c[42]),D=r(D,C,A,F,d,23,c[43]),F=r(F,D,C,A,v,4,c[44]),A=r(A,F,D,C,w,11,c[45]),C=r(C,A,F,D,E,16,c[46]),F=i(F,D=r(D,C,A,F,l,23,c[47]),C,A,u,6,c[48]),A=i(A,F,D,C,g,10,c[49]),C=i(C,A,F,D,S,15,c[50]),D=i(D,C,A,F,p,21,c[51]),F=i(F,D,C,A,w,6,c[52]),A=i(A,F,D,C,h,10,c[53]),C=i(C,A,F,D,y,15,c[54]),D=i(D,C,A,F,a,21,c[55]),F=i(F,D,C,A,m,6,c[56]),A=i(A,F,D,C,E,10,c[57]),C=i(C,A,F,D,d,15,c[58]),D=i(D,C,A,F,x,21,c[59]),F=i(F,D,C,A,f,6,c[60]),A=i(A,F,D,C,b,10,c[61]),C=i(C,A,F,D,l,15,c[62]),D=i(D,C,A,F,v,21,c[63]);o[0]=o[0]+F|0,o[1]=o[1]+D|0,o[2]=o[2]+C|0,o[3]=o[3]+A|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;n[i>>>5]|=128<<24-i%32;var s=t.floor(r/4294967296);for(n[15+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),n[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(n.length+1),this._process(),n=(e=this._hash).words,r=0;4>r;r++)i=n[r],n[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return e},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}}),s.MD5=a._createHelper(u),s.HmacMD5=a._createHmacHelper(u)}(Math),function(){var t=g,e=(i=t.lib).WordArray,n=i.Hasher,r=[],i=t.algo.SHA1=n.extend({_doReset:function(){this._hash=new e.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=this._hash.words,i=n[0],s=n[1],o=n[2],a=n[3],u=n[4],c=0;80>c;c++){if(16>c)r[c]=0|t[e+c];else{var l=r[c-3]^r[c-8]^r[c-14]^r[c-16];r[c]=l<<1|l>>>31}l=(i<<5|i>>>27)+u+r[c],l=20>c?l+(1518500249+(s&o|~s&a)):40>c?l+(1859775393+(s^o^a)):60>c?l+((s&o|s&a|o&a)-1894007588):l+((s^o^a)-899497514),u=a,a=o,o=s<<30|s>>>2,s=i,i=l}n[0]=n[0]+i|0,n[1]=n[1]+s|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+u|0},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),e[15+(r+64>>>9<<4)]=n,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});t.SHA1=n._createHelper(i),t.HmacSHA1=n._createHmacHelper(i)}(),function(t){for(var e=g,n=(i=e.lib).WordArray,r=i.Hasher,i=e.algo,s=[],o=[],a=function(t){return 4294967296*(t-(0|t))|0},u=2,c=0;64>c;){var l;t:{l=u;for(var h=t.sqrt(l),f=2;f<=h;f++)if(!(l%f)){l=!1;break t}l=!0}l&&(8>c&&(s[c]=a(t.pow(u,.5))),o[c]=a(t.pow(u,1/3)),c++),u++}var p=[];i=i.SHA256=r.extend({_doReset:function(){this._hash=new n.init(s.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],s=n[2],a=n[3],u=n[4],c=n[5],l=n[6],h=n[7],f=0;64>f;f++){if(16>f)p[f]=0|t[e+f];else{var d=p[f-15],g=p[f-2];p[f]=((d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+p[f-7]+((g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10)+p[f-16]}d=h+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&l)+o[f]+p[f],g=((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+(r&i^r&s^i&s),h=l,l=c,c=u,u=a+d|0,a=s,s=i,i=r,r=d+g|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+u|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+h|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=r._createHelper(i),e.HmacSHA256=r._createHmacHelper(i)}(Math),function(){var t=g,e=t.lib.WordArray,n=(r=t.algo).SHA256,r=r.SHA224=n.extend({_doReset:function(){this._hash=new e.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=n._doFinalize.call(this);return t.sigBytes-=4,t}});t.SHA224=n._createHelper(r),t.HmacSHA224=n._createHmacHelper(r)}(),function(){function t(){return r.create.apply(r,arguments)}for(var e=g,n=e.lib.Hasher,r=(s=e.x64).Word,i=s.WordArray,s=e.algo,o=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],a=[],u=0;80>u;u++)a[u]=t();s=s.SHA512=n.extend({_doReset:function(){this._hash=new i.init([new r.init(1779033703,4089235720),new r.init(3144134277,2227873595),new r.init(1013904242,4271175723),new r.init(2773480762,1595750129),new r.init(1359893119,2917565137),new r.init(2600822924,725511199),new r.init(528734635,4215389547),new r.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var n=(h=this._hash.words)[0],r=h[1],i=h[2],s=h[3],u=h[4],c=h[5],l=h[6],h=h[7],f=n.high,p=n.low,d=r.high,g=r.low,m=i.high,v=i.low,y=s.high,b=s.low,w=u.high,x=u.low,S=c.high,E=c.low,F=l.high,A=l.low,C=h.high,D=h.low,I=f,$=p,R=d,T=g,_=m,P=v,k=y,O=b,j=w,B=x,N=S,L=E,H=F,M=A,U=C,V=D,q=0;80>q;q++){var K=a[q];if(16>q)var z=K.high=0|t[e+2*q],G=K.low=0|t[e+2*q+1];else{z=((G=(z=a[q-15]).high)>>>1|(W=z.low)<<31)^(G>>>8|W<<24)^G>>>7;var W=(W>>>1|G<<31)^(W>>>8|G<<24)^(W>>>7|G<<25),Y=((G=(Y=a[q-2]).high)>>>19|(X=Y.low)<<13)^(G<<3|X>>>29)^G>>>6,X=(X>>>19|G<<13)^(X<<3|G>>>29)^(X>>>6|G<<26),J=(G=a[q-7]).high,Z=(Q=a[q-16]).high,Q=Q.low;z=(z=(z=z+J+((G=W+G.low)>>>0<W>>>0?1:0))+Y+((G=G+X)>>>0<X>>>0?1:0))+Z+((G=G+Q)>>>0<Q>>>0?1:0);K.high=z,K.low=G}J=j&N^~j&H,Q=B&L^~B&M,K=I&R^I&_^R&_;var tt=$&T^$&P^T&P,et=(W=(I>>>28|$<<4)^(I<<30|$>>>2)^(I<<25|$>>>7),Y=($>>>28|I<<4)^($<<30|I>>>2)^($<<25|I>>>7),(X=o[q]).high),nt=X.low;Z=U+((j>>>14|B<<18)^(j>>>18|B<<14)^(j<<23|B>>>9))+((X=V+((B>>>14|j<<18)^(B>>>18|j<<14)^(B<<23|j>>>9)))>>>0<V>>>0?1:0),U=H,V=M,H=N,M=L,N=j,L=B,j=k+(Z=(Z=(Z=Z+J+((X=X+Q)>>>0<Q>>>0?1:0))+et+((X=X+nt)>>>0<nt>>>0?1:0))+z+((X=X+G)>>>0<G>>>0?1:0))+((B=O+X|0)>>>0<O>>>0?1:0)|0,k=_,O=P,_=R,P=T,R=I,T=$,I=Z+(K=W+K+((G=Y+tt)>>>0<Y>>>0?1:0))+(($=X+G|0)>>>0<X>>>0?1:0)|0}p=n.low=p+$,n.high=f+I+(p>>>0<$>>>0?1:0),g=r.low=g+T,r.high=d+R+(g>>>0<T>>>0?1:0),v=i.low=v+P,i.high=m+_+(v>>>0<P>>>0?1:0),b=s.low=b+O,s.high=y+k+(b>>>0<O>>>0?1:0),x=u.low=x+B,u.high=w+j+(x>>>0<B>>>0?1:0),E=c.low=E+L,c.high=S+N+(E>>>0<L>>>0?1:0),A=l.low=A+M,l.high=F+H+(A>>>0<M>>>0?1:0),D=h.low=D+V,h.high=C+U+(D>>>0<V>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),e[31+(r+128>>>10<<5)]=n,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32}),e.SHA512=n._createHelper(s),e.HmacSHA512=n._createHmacHelper(s)}(),function(){var t=g,e=(i=t.x64).Word,n=i.WordArray,r=(i=t.algo).SHA512,i=i.SHA384=r.extend({_doReset:function(){this._hash=new n.init([new e.init(3418070365,3238371032),new e.init(1654270250,914150663),new e.init(2438529370,812702999),new e.init(355462360,4144912697),new e.init(1731405415,4290775857),new e.init(2394180231,1750603025),new e.init(3675008525,1694076839),new e.init(1203062813,3204075428)])},_doFinalize:function(){var t=r._doFinalize.call(this);return t.sigBytes-=16,t}});t.SHA384=r._createHelper(i),t.HmacSHA384=r._createHmacHelper(i)}(),function(){var t=g,e=(r=t.lib).WordArray,n=r.Hasher,r=t.algo,i=e.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),s=e.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),o=e.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),a=e.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=e.create([0,1518500249,1859775393,2400959708,2840853838]),c=e.create([1352829926,1548603684,1836072691,2053994217,0]);r=r.RIPEMD160=n.extend({_doReset:function(){this._hash=e.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=0;16>n;n++){var r=t[w=e+n];t[w]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var l,h,f,p,d,g,m,v,y,b,w=this._hash.words,x=(r=u.words,c.words),S=i.words,E=s.words,F=o.words,A=a.words;g=l=w[0],m=h=w[1],v=f=w[2],y=p=w[3],b=d=w[4];var C;for(n=0;80>n;n+=1)C=l+t[e+S[n]]|0,C=16>n?C+((h^f^p)+r[0]):32>n?C+((h&f|~h&p)+r[1]):48>n?C+(((h|~f)^p)+r[2]):64>n?C+((h&p|f&~p)+r[3]):C+((h^(f|~p))+r[4]),C=(C=(C|=0)<<F[n]|C>>>32-F[n])+d|0,l=d,d=p,p=f<<10|f>>>22,f=h,h=C,C=g+t[e+E[n]]|0,C=16>n?C+((m^(v|~y))+x[0]):32>n?C+((m&y|v&~y)+x[1]):48>n?C+(((m|~v)^y)+x[2]):64>n?C+((m&v|~m&y)+x[3]):C+((m^v^y)+x[4]),C=(C=(C|=0)<<A[n]|C>>>32-A[n])+b|0,g=b,b=y,y=v<<10|v>>>22,v=m,m=C;C=w[1]+f+y|0,w[1]=w[2]+p+b|0,w[2]=w[3]+d+g|0,w[3]=w[4]+l+m|0,w[4]=w[0]+h+v|0,w[0]=C},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;for(e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t.sigBytes=4*(e.length+1),this._process(),e=(t=this._hash).words,n=0;5>n;n++)r=e[n],e[n]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8);return t},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});t.RIPEMD160=n._createHelper(r),t.HmacRIPEMD160=n._createHmacHelper(r)}(Math),function(){var t=g,e=t.enc.Utf8;t.algo.HMAC=t.lib.Base.extend({init:function(t,n){t=this._hasher=new t.init,"string"==typeof n&&(n=e.parse(n));var r=t.blockSize,i=4*r;n.sigBytes>i&&(n=t.finalize(n)),n.clamp();for(var s=this._oKey=n.clone(),o=this._iKey=n.clone(),a=s.words,u=o.words,c=0;c<r;c++)a[c]^=1549556828,u[c]^=909522486;s.sigBytes=o.sigBytes=i,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher;return t=e.finalize(t),e.reset(),e.finalize(this._oKey.clone().concat(t))}})}(),function(){var t,e=g,n=(t=e.lib).Base,r=t.WordArray,i=(t=e.algo).HMAC,s=t.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:t.SHA1,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){var n=this.cfg,s=i.create(n.hasher,t),o=r.create(),a=r.create([1]),u=o.words,c=a.words,l=n.keySize;for(n=n.iterations;u.length<l;){var h=s.update(e).finalize(a);s.reset();for(var f=h.words,p=f.length,d=h,g=1;g<n;g++){d=s.finalize(d),s.reset();for(var m=d.words,v=0;v<p;v++)f[v]^=m[v]}o.concat(h),c[0]++}return o.sigBytes=4*l,o}});e.PBKDF2=function(t,e,n){return s.create(n).compute(t,e)}}();
|
|
1
|
+
!function(t){function e(e){for(var n,i,s=e[0],o=e[1],a=0,c=[];a<s.length;a++)i=s[a],Object.prototype.hasOwnProperty.call(r,i)&&r[i]&&c.push(r[i][0]),r[i]=0;for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n]);for(u&&u(e);c.length;)c.shift()()}var n={},r={122:0};function i(e){if(n[e])return n[e].exports;var r=n[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.e=function(t){var e=[],n=r[t];if(0!==n)if(n)e.push(n[2]);else{var s=new Promise((function(e,i){n=r[t]=[e,i]}));e.push(n[2]=s);var o,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(t){return i.p+""+({}[t]||t)+"."+{0:"2af856eced823a680859",1:"45f8e4931136db54363e",2:"866eec7e8745f6234b7d",3:"6c968a5a5ca65b702792",4:"2569b8cbd29257692f79",5:"e6ebc1c858a5b922c8fb",6:"213adc8245edef304232",7:"3f1b6ccc3cbff48551ec",8:"7e80265eb676d049547d",9:"0b804b71b898cace0d51",10:"018ca946a702a519142b",11:"7e4dcae789c43fc6131e",12:"800cb839e2eeecd15ad5",13:"12141a160217948d97e1",14:"6c4f3692cbe6ee8ed73d",15:"c0629323df8bafb5a788",16:"35bd2e472c19bcc0c6d1",17:"6a26e7fdc593a8dc3f59",18:"b39247b09bf69883801d",19:"7f55a7f5d4ca1b646407",20:"ceb98cbe18c738de2393",21:"fb9b4017de78e79d01a7",22:"4ccd425801b21e101fec",23:"a664a57e7da24c9796bc",24:"8fd98e1866c43357a15d",25:"4aee6f444ae15b393a95",26:"3853609f39f51acaaae4",27:"87b8ec4105a9ff8d680f",28:"12f5b42f5f6378775ab1",29:"3d299c04c603c7001d70",30:"aa58eb05e16cb046b2bc",31:"27bb6cb77874c106bdf3",32:"06f392a8f3b855594afa",33:"ae6ba36a5be1ca5c8f13",34:"a0fdf0057b3ac0c137ba",35:"f4b777c7aa15dbb92410",36:"482d18bfba58cd2b4326",37:"db967dfe4641139472a6",38:"da41947ae2e0e467fe5a",39:"332b1cb6a11aabf77986",40:"a15572367b822c1e9fcc",41:"961a43ff15e4125d4a34",42:"006fa9f7a6e17bc34391",43:"43b158e8fb944dd2de26",44:"04a3ed30f28a8eda63d2",45:"3f239ee36357d6e9a572",46:"d61e16839016b98caad2",47:"cfdc578c27f65aa04370",48:"e41d3852d0240c228640",49:"1bb5a5fc03aab1cb710e",50:"f43de5b83f3fe0f1d4bd",51:"8e4867cdb91b3a714b7c",52:"87e251b63ec08a4fb27d",53:"a3e712481865cdb425cc",54:"541402571ebb2d19f8a3",55:"975653547fd9764a2a71",56:"9b5d58d55e94edcc8b0a",57:"961005d8ad7af257f311",58:"a5f05cace85118602107",59:"06d98cbc45a9bf3133d5",60:"205ad76bf8d69b9c00a7",61:"70e327e808edf21f62d5",62:"8aa18053a8dbe17495de",63:"dd214e3a46666f6858b0",64:"d2ba6497382e547547c1",65:"786a8a66f654bee5bfc1",66:"7bfb79b32b0a0d15d946",67:"1356aed7f6498bc74989",68:"c4702868f8bfa090a5dc",69:"24f7049678e4d1daf7d0",70:"9a3a49005f2f0f088bf0",71:"997880006015b3f246cc",72:"3bc9349132a7d3a1be26",73:"2f485c964b689f1e927a",74:"6b60a4237e762af25aeb",75:"7e5798d90571469de255",76:"7d22deb94b514347a5c7",77:"4e84abd9b025b1812617",78:"931509bfe1d61d91eb06",79:"ac5cb425c55f53b96a37",80:"e250a6936fcc15642e07",81:"20f163625c61d1bfb502",82:"5546d65e41f31a410b86",83:"7abbe4e169521bfe7922",84:"80d37d0ddcfac8febf85",85:"6db38d2acf129418e364",86:"ccc0254c84126acec035",87:"e91dad8ff1c745245437",88:"7ea49b3f6eb283f5b4de",89:"9a5f3911782f145608d5",90:"14e8b6313641332d91cc",91:"19d221851a9e4cc1c309",92:"29f3b8c01256497723ad",93:"9762e532d75f531ff1f6",94:"1bdaae66a9358a539e6e",95:"143ed25274aa2f5d97bd",96:"8f85bcdd38ccc9a8f9c5",97:"474ec4e9a57fc0eacded",98:"73675340eac75910ad10",99:"19fa0954fe8af118f2b4",100:"ed952dfb8809934b3109",101:"26282fd3bcdec7572080",102:"ad9395f95733d16e3b4d",103:"94d6409d994e443554f0",104:"c98cf44ecf7c73af9190",105:"287b65e0a4438c7c2efd",106:"16278942204d9e624f55",107:"c69e530607378cbea6fd",108:"0309517b3f296b11e6cc",109:"4ec73d6d22c9a7ae0808",110:"08c4f65addfe97d85136",111:"e14ff57a9300db896814",112:"10df3caf5b784be35d0b",113:"22c1aba8ed5cba1dd8e4",114:"db038038f8afbc4eeda8",115:"f6d25b6e4cf3f0496f30",116:"c7bb0a4a09baf53c797e",117:"34635282d1e2ac2a1a21",118:"6d803973461a629687b0",119:"e38ecfa30d44abca83c7",120:"f3c50d2ad030ba6ae573",121:"afca46791ee897a1ce7e",125:"2dd261425102fa57d477",126:"570bbf5b388b8cd3962b",127:"4501e4877389d292ccd2",128:"4c22bbb0bddb2bbe2e14",129:"7a81eb2255d43a1a230e",130:"19e53db9e589fcd25802",131:"9fae2c5226a12ee09bdd",132:"32aa1775e6e81d7579cb",133:"2317e00ddb77c6121919",134:"674fc334ea03aadba240",135:"4d1c7e7d116a20355b6d",136:"c602f584444cbe4d7106",137:"af89b4fc67f18fd43ada",138:"620cc47c1129cbfcf787",139:"c33515ab5bc4b7a5730f",140:"4dfd2b8a710229472e2b",141:"ebfc1ad053eb5f24ea49",142:"be46d073aa363d3c07ba",143:"3fd322a7611056c80f8c",144:"c9ecea7f84da1eab1f9b",145:"1d339037e997c081d23a",146:"80ed63011a467dd76775",147:"3a7bb3d478308d3728ab",148:"0e0e690c86efbc4a88af",149:"2b14e3352da819be42c8",150:"99c877f335ffebc83249",151:"88c42cbb644fe1530c08",152:"00008258ae13818122d7",153:"ae1e7b25fae0a82a8b62",154:"b32bb99440fd4d59358e",155:"7c241378be86877d60ac",156:"45af3d9d71cfe0dcb504",157:"c54e1424084a9328745d",158:"539e2f99c71c5b254127",159:"492d9a7310155fc3fb0e",160:"f9af6f3c4af153df7caa",161:"db6e8215440d96a8b00b",162:"f0db4b33b452e95d2429",163:"4d3e55ae9287b7920fba",164:"d81c76d872cdc5be8473",165:"1bec422ca7f2daecec34",166:"3b4d1583f349cee6dbfb",167:"0d1080b20a93f0b50a6c",168:"b82c4e8540b80285ad6a",169:"699d259044567273e867",170:"804802ce53ee073dddf7",171:"c84ec2d276281aa1f179",172:"ba67c4e1fe11826783a2",173:"7d7e87e616abfcd8dbfd"}[t]+".bundle.js"}(t);var u=new Error;o=function(e){a.onerror=a.onload=null,clearTimeout(c);var n=r[t];if(0!==n){if(n){var i=e&&("load"===e.type?"missing":e.type),s=e&&e.target&&e.target.src;u.message="Loading chunk "+t+" failed.\n("+i+": "+s+")",u.name="ChunkLoadError",u.type=i,u.request=s,n[1](u)}r[t]=void 0}};var c=setTimeout((function(){o({type:"timeout",target:a})}),12e4);a.onerror=a.onload=o,document.head.appendChild(a)}return Promise.all(e)},i.m=t,i.c=n,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i.oe=function(t){throw console.error(t),t};var s=window.webpackJsonp=window.webpackJsonp||[],o=s.push.bind(s);s.push=e,s=s.slice();for(var a=0;a<s.length;a++)e(s[a]);var u=o;i(i.s=0)}([function(t,e,n){"use strict";n.r(e),n.d(e,"decodeHTML",(function(){return r}));n(4),n(26),n(31),n(188),n(37),n(189),n(21),n(32),n(33);const r=function(t){let e=document.createElement("textarea");return e.innerHTML=t,e.value},i=["ngRoute","graphdb.workbench.se.controllers","graphdb.framework.core","angularCancelOnNavigateModule","oc.lazyLoad","pascalprecht.translate","graphdb.framework.core.interceptors.unauthorized","graphdb.framework.core.directives.rdfresourcesearch.rdfresourcesearch","graphdb.framework.core.directives.languageselector.languageselector","graphdb.framework.guides.services"],s=["$routeProvider","$locationProvider","$menuItemsProvider","toastrConfig","localStorageServiceProvider","$tooltipProvider","$httpProvider","$templateRequestProvider","$translateProvider"];$.get("rest/info/version?local=1",(function(t){const e=t.productVersion.match(/^(\d+\.\d+)/);e.length?t.productShortVersion=e[1]:t.productShortVersion=t.productVersion;const o=t.productVersion.match(/(-.*?)(-|$)/);o&&o.length&&(t.productShortVersion=t.productShortVersion+o[1]),function(t){const e=angular.module("graphdb.workbench",i);e.config([...s,function(e,r,i,s,o,a,u,c,l){l.useStaticFilesLoader({prefix:"i18n/locale-",suffix:".json?v=2.1.0-RC3"}),l.preferredLanguage("en"),l.useSanitizeValueStrategy("escape"),angular.extend(s,{timeOut:5e3,positionClass:"toast-bottom-right",tapToDismiss:!1,extendedTimeOut:5e3}),o.setStorageType("localStorage").setNotify(!0,!0);var h=e.$get[e.$get.length-1]({$on:function(){}});e.when("_openid_implicit_",{controller:function(){},template:"<div></div>"}),h.routes._openid_implicit_.regexp=/[&/](?:id_token=.*&access_token=|access_token=.*&id_token=)/;let f=PluginRegistry.get("route");angular.forEach(f,(function(t){e.when(t.url,{controller:t.controller,templateUrl:t.templateUrl,title:t.title,helpInfo:t.helpInfo,reloadOnSearch:void 0===t.reloadOnSearch||t.reloadOnSearch,resolve:{preload:["$ocLazyLoad","$q",function(e,r){return t.path?n(190)("./"+t.path).then(n=>{e.inject(t.module)}):r.defer().resolve()}]}})})),e.otherwise({templateUrl:"pages/not_found.html"}),r.html5Mode(!0),a.setTriggers({show:"hide"}),a.options({appendToBody:!0}),i.setProductInfo(t),PluginRegistry.get("main.menu").forEach((function(t){t.items.forEach((function(t){i.addItem(t)}))})),u.interceptors.push("$unauthorizedInterceptor");const p=c.$get[3];"function"==typeof p&&(c.$get[3]=function(t,e,n){const r=p(t,e,n);return function(e,n){return t.get(e)||(e+="?v=2.1.0-RC3"),r(e,n)}})}]),e.constant("productInfo",t),e.run(["$rootScope","$route","toastr","$sce","$translate","LocalStorageAdapter","LSKeys","GuidesService",function(t,e,n,i,s,o,a,u){function c(){e.current.title?document.title=r(s.instant(e.current.title))+" | GraphDB Workbench":document.title="GraphDB Workbench",t.helpInfo=i.trustAsHtml(r(s.instant(e.current.helpInfo))),t.title=r(s.instant(e.current.title))}t.$on("$routeChangeSuccess",(function(){c(),n.clear()})),t.$on("$translateChangeSuccess",(function(){c()}));const l=o.get(a.WORKBENCH_SETTINGS);if(l&&l.theme){const t=document.querySelector(":root");"dark"===l.theme&&t.classList.add("dark")}u.init()}]),e.filter("titlecase",(function(){return function(t){var e=""+t;return e.charAt(0).toUpperCase()+e.slice(1)}})),angular.bootstrap(document,["graphdb.workbench"])}(t)}))},function(t,e,n){"use strict";n.r(e),n.d(e,"GuideUtils",(function(){return r}));const r=function(){const t=function(t,e=1,n=!0){return new Promise((function(r,i){let s=1e3*e|1e3;const o=setInterval(()=>{try{const e=document.querySelector(t);null!=e?!n||angular.element(e).is(":visible")?(clearInterval(o),setTimeout(()=>{r(angular.element(e))},0)):(s-=100,s<0&&(clearInterval(o),console.log("Element is not visible: "+t),i())):(s-=100,s<0&&(clearInterval(o),console.log("Element is not found: "+t),i()))}catch(e){clearInterval(o),console.log("Error when processing selector: "+t),console.log(e),i(e)}},100)}))},e=function(t){const e=document.querySelector(t);return e&&angular.element(e).is(":visible")},n=function(t,e){return`[guide-selector="${t}"] ${e||""}`},i=(t,e,n,r)=>{const i=t.use();let o;return angular.isObject(n)?(o=n[i],o||(o=n.en),o=e(o)(r)):o=s(t.instant(n,r)),o},s=t=>{const e=document.createElement("div");return e.innerHTML=t,e.innerText},o=t=>n("yasrResults",t),a=t=>angular.element(t).is(":checked");return{GUIDES_LIST_URL:"/rest/guides",GUIDES_DOWNLOAD_URL:"/rest/guides/download/",waitFor:t,clickOnElement:function(e){return()=>t(e).then(t=>t.click())},clickOnGuideElement:function(t,e){return r.clickOnElement(r.getGuideElementSelector(t,e))},getGuideElementSelector:n,isVisible:e,isGuideElementVisible:function(t){return e(n(t))},awaitAlphaDropD3:function(t,n,r=2,i=.02){return()=>new Promise((function(s){e(t)?s():setTimeout(()=>{let t=1e3*r;const e=setInterval(()=>{n.d3alpha<i?(clearInterval(e),s()):(t-=100,t<0&&(clearInterval(e),s()))},100)},150)}))},graphVizExpandNode:function(t){const e=d3.select(t),n=new CustomEvent("gdb-expand-node",{detail:e.datum()});e.node().dispatchEvent(n)},graphVizShowNodeInfo:function(t){const e=d3.select(t),n=new CustomEvent("gdb-show-node-info",{detail:e.datum()});e.node().dispatchEvent(n)},classHierarchyFocus:function(t){const e=d3.select(t),n=new CustomEvent("gdb-focus",{detail:e.datum()});e.node().dispatchEvent(n)},classHierarchyZoom:function(t){const e=d3.select(t),n=new CustomEvent("gdb-zoom",{detail:e.datum()});e.node().dispatchEvent(n)},validateTextInput:function(t,e,n=!0){const r=$(t).val();return""===r&&n?($(t).val(e),$(t).trigger("change"),!0):r===e},translateLocalMessage:i,unescapeHtml:s,noNextErrorToast:(t,e,n,r,o)=>{t.error(s(i(e,n,r,o)),s(i(e,n,"guide.validate.no-next",o)),{allowHtml:!0})},deferredShow:t=>()=>new Promise((function(e){setTimeout(()=>{e()},t)})),scrollToTop:()=>{window.scrollTo(0,0)},removeWhiteSpaces:t=>t.replace(/\s+/g,""),toResourceDownloadUrl:t=>"/rest/guides/download/"+t.resourcePath+"/"+t.resourceFile,getSparqlEditorSelector:t=>n("queryEditor",t?".CodeMirror-code "+t:".CodeMirror-code"),getSparqlResultsSelector:o,getSparqlResultsSelectorForIri:t=>o("a[title='"+t+"']"),getSparqlResultsSelectorForRow:t=>o("tbody tr:nth-child("+t+")"),isChecked:a,isGuideElementChecked:(t,e)=>a(r.getGuideElementSelector("autocompleteCheckbox",e))}}()},function(t,e,n){"use strict";n.r(e),n.d(e,"UserType",(function(){return i})),n.d(e,"UserRole",(function(){return r})),n.d(e,"UserUtils",(function(){return s}));const r=Object.freeze({ROLE_ADMIN:"ROLE_ADMIN",ROLE_USER:"ROLE_USER",ROLE_REPO_MANAGER:"ROLE_REPO_MANAGER"}),i=Object.freeze({ADMIN:"admin",USER:"user",REPO_MANAGER:"repoManager"}),s={getUserRoleName:function(t){switch(t){case i.USER:return"User";case i.REPO_MANAGER:return"Repository manager";case i.ADMIN:return"Administrator";default:return"Unknown"}}}},function(t,e,n){(function(t){var n,r,i,s,o,a,u,c,l,h,f,p={userAgent:!1},d={},g=g||(n=Math,i=(r={}).lib={},s=i.Base=function(){function t(){}return{extend:function(e){t.prototype=this;var n=new t;return e&&n.mixIn(e),n.hasOwnProperty("init")||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),o=i.WordArray=s.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var s=0;s<i;s++){var o=n[s>>>2]>>>24-s%4*8&255;e[r+s>>>2]|=o<<24-(r+s)%4*8}else for(s=0;s<i;s+=4)e[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,e=this.sigBytes;t[e>>>2]&=4294967295<<32-e%4*8,t.length=n.ceil(e/4)},clone:function(){var t=s.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r<t;r+=4)e.push(4294967296*n.random()|0);return new o.init(e,t)}}),a=r.enc={},u=a.Hex={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i++){var s=e[i>>>2]>>>24-i%4*8&255;r.push((s>>>4).toString(16)),r.push((15&s).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r+=2)n[r>>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new o.init(n,e/2)}},c=a.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i<n;i++){var s=e[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(s))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r<e;r++)n[r>>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new o.init(n,e)}},l=a.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(t){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},h=i.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=l.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(t){var e=this._data,r=e.words,i=e.sigBytes,s=this.blockSize,a=i/(4*s),u=(a=t?n.ceil(a):n.max((0|a)-this._minBufferSize,0))*s,c=n.min(4*u,i);if(u){for(var l=0;l<u;l+=s)this._doProcessBlock(r,l);var h=r.splice(0,u);e.sigBytes-=c}return new o.init(h,c)},clone:function(){var t=s.clone.call(this);return t._data=this._data.clone(),t},_minBufferSize:0}),i.Hasher=h.extend({cfg:s.extend(),init:function(t){this.cfg=this.cfg.extend(t),this.reset()},reset:function(){h.reset.call(this),this._doReset()},update:function(t){return this._append(t),this._process(),this},finalize:function(t){return t&&this._append(t),this._doFinalize()},blockSize:16,_createHelper:function(t){return function(e,n){return new t.init(n).finalize(e)}},_createHmacHelper:function(t){return function(e,n){return new f.HMAC.init(t,n).finalize(e)}}}),f=r.algo={},r);!function(t){var e,n=(e=g).lib,r=n.Base,i=n.WordArray;(e=e.x64={}).Word=r.extend({init:function(t,e){this.high=t,this.low=e}}),e.WordArray=r.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:8*t.length},toX32:function(){for(var t=this.words,e=t.length,n=[],r=0;r<e;r++){var s=t[r];n.push(s.high),n.push(s.low)}return i.create(n,this.sigBytes)},clone:function(){for(var t=r.clone.call(this),e=t.words=this.words.slice(0),n=e.length,i=0;i<n;i++)e[i]=e[i].clone();return t}})}(),g.lib.Cipher||function(t){var e=(p=g).lib,n=e.Base,r=e.WordArray,i=e.BufferedBlockAlgorithm,s=p.enc.Base64,o=p.algo.EvpKDF,a=e.Cipher=i.extend({cfg:n.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,n){this.cfg=this.cfg.extend(n),this._xformMode=t,this._key=e,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(t){return{encrypt:function(e,n,r){return("string"==typeof n?d:f).encrypt(t,e,n,r)},decrypt:function(e,n,r){return("string"==typeof n?d:f).decrypt(t,e,n,r)}}}});e.StreamCipher=a.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=p.mode={},c=function(t,e,n){var r=this._iv;r?this._iv=void 0:r=this._prevBlock;for(var i=0;i<n;i++)t[e+i]^=r[i]},l=(e.BlockCipherMode=n.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}})).extend();l.Encryptor=l.extend({processBlock:function(t,e){var n=this._cipher,r=n.blockSize;c.call(this,t,e,r),n.encryptBlock(t,e),this._prevBlock=t.slice(e,e+r)}}),l.Decryptor=l.extend({processBlock:function(t,e){var n=this._cipher,r=n.blockSize,i=t.slice(e,e+r);n.decryptBlock(t,e),c.call(this,t,e,r),this._prevBlock=i}}),u=u.CBC=l,l=(p.pad={}).Pkcs7={pad:function(t,e){for(var n,i=(n=(n=4*e)-t.sigBytes%n)<<24|n<<16|n<<8|n,s=[],o=0;o<n;o+=4)s.push(i);n=r.create(s,n),t.concat(n)},unpad:function(t){t.sigBytes-=255&t.words[t.sigBytes-1>>>2]}},e.BlockCipher=a.extend({cfg:a.cfg.extend({mode:u,padding:l}),reset:function(){a.reset.call(this);var t=(e=this.cfg).iv,e=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=e.createEncryptor;else n=e.createDecryptor,this._minBufferSize=1;this._mode=n.call(e,this,t&&t.words)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else e=this._process(!0),t.unpad(e);return e},blockSize:4});var h=e.CipherParams=n.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),f=(u=(p.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext;return((t=t.salt)?r.create([1398893684,1701076831]).concat(t).concat(e):e).toString(s)},parse:function(t){var e=(t=s.parse(t)).words;if(1398893684==e[0]&&1701076831==e[1]){var n=r.create(e.slice(2,4));e.splice(0,4),t.sigBytes-=16}return h.create({ciphertext:t,salt:n})}},e.SerializableCipher=n.extend({cfg:n.extend({format:u}),encrypt:function(t,e,n,r){r=this.cfg.extend(r);var i=t.createEncryptor(n,r);return e=i.finalize(e),i=i.cfg,h.create({ciphertext:e,key:n,iv:i.iv,algorithm:t,mode:i.mode,padding:i.padding,blockSize:t.blockSize,formatter:r.format})},decrypt:function(t,e,n,r){return r=this.cfg.extend(r),e=this._parse(e,r.format),t.createDecryptor(n,r).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}})),p=(p.kdf={}).OpenSSL={execute:function(t,e,n,i){return i||(i=r.random(8)),t=o.create({keySize:e+n}).compute(t,i),n=r.create(t.words.slice(e),4*n),t.sigBytes=4*e,h.create({key:t,iv:n,salt:i})}},d=e.PasswordBasedCipher=f.extend({cfg:f.cfg.extend({kdf:p}),encrypt:function(t,e,n,r){return n=(r=this.cfg.extend(r)).kdf.execute(n,t.keySize,t.ivSize),r.iv=n.iv,(t=f.encrypt.call(this,t,e,n.key,r)).mixIn(n),t},decrypt:function(t,e,n,r){return r=this.cfg.extend(r),e=this._parse(e,r.format),n=r.kdf.execute(n,t.keySize,t.ivSize,e.salt),r.iv=n.iv,f.decrypt.call(this,t,e,n.key,r)}})}(),function(){for(var t=g,e=t.lib.BlockCipher,n=t.algo,r=[],i=[],s=[],o=[],a=[],u=[],c=[],l=[],h=[],f=[],p=[],d=0;256>d;d++)p[d]=128>d?d<<1:d<<1^283;var m=0,v=0;for(d=0;256>d;d++){var y=(y=v^v<<1^v<<2^v<<3^v<<4)>>>8^255&y^99;r[m]=y,i[y]=m;var b=p[m],x=p[b],w=p[x],S=257*p[y]^16843008*y;s[m]=S<<24|S>>>8,o[m]=S<<16|S>>>16,a[m]=S<<8|S>>>24,u[m]=S,S=16843009*w^65537*x^257*b^16843008*m,c[y]=S<<24|S>>>8,l[y]=S<<16|S>>>16,h[y]=S<<8|S>>>24,f[y]=S,m?(m=b^p[p[p[w^b]]],v^=p[p[v]]):m=v=1}var E=[0,1,2,4,8,16,32,64,128,27,54];n=n.AES=e.extend({_doReset:function(){for(var t=(n=this._key).words,e=n.sigBytes/4,n=4*((this._nRounds=e+6)+1),i=this._keySchedule=[],s=0;s<n;s++)if(s<e)i[s]=t[s];else{var o=i[s-1];s%e?6<e&&4==s%e&&(o=r[o>>>24]<<24|r[o>>>16&255]<<16|r[o>>>8&255]<<8|r[255&o]):(o=r[(o=o<<8|o>>>24)>>>24]<<24|r[o>>>16&255]<<16|r[o>>>8&255]<<8|r[255&o],o^=E[s/e|0]<<24),i[s]=i[s-e]^o}for(t=this._invKeySchedule=[],e=0;e<n;e++)s=n-e,o=e%4?i[s]:i[s-4],t[e]=4>e||4>=s?o:c[r[o>>>24]]^l[r[o>>>16&255]]^h[r[o>>>8&255]]^f[r[255&o]]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,s,o,a,u,r)},decryptBlock:function(t,e){var n=t[e+1];t[e+1]=t[e+3],t[e+3]=n,this._doCryptBlock(t,e,this._invKeySchedule,c,l,h,f,i),n=t[e+1],t[e+1]=t[e+3],t[e+3]=n},_doCryptBlock:function(t,e,n,r,i,s,o,a){for(var u=this._nRounds,c=t[e]^n[0],l=t[e+1]^n[1],h=t[e+2]^n[2],f=t[e+3]^n[3],p=4,d=1;d<u;d++){var g=r[c>>>24]^i[l>>>16&255]^s[h>>>8&255]^o[255&f]^n[p++],m=r[l>>>24]^i[h>>>16&255]^s[f>>>8&255]^o[255&c]^n[p++],v=r[h>>>24]^i[f>>>16&255]^s[c>>>8&255]^o[255&l]^n[p++];f=r[f>>>24]^i[c>>>16&255]^s[l>>>8&255]^o[255&h]^n[p++],c=g,l=m,h=v}g=(a[c>>>24]<<24|a[l>>>16&255]<<16|a[h>>>8&255]<<8|a[255&f])^n[p++],m=(a[l>>>24]<<24|a[h>>>16&255]<<16|a[f>>>8&255]<<8|a[255&c])^n[p++],v=(a[h>>>24]<<24|a[f>>>16&255]<<16|a[c>>>8&255]<<8|a[255&l])^n[p++],f=(a[f>>>24]<<24|a[c>>>16&255]<<16|a[l>>>8&255]<<8|a[255&h])^n[p++],t[e]=g,t[e+1]=m,t[e+2]=v,t[e+3]=f},keySize:8});t.AES=e._createHelper(n)}(),function(){function t(t,e){var n=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=n,this._lBlock^=n<<t}function e(t,e){var n=(this._rBlock>>>t^this._lBlock)&e;this._lBlock^=n,this._rBlock^=n<<t}var n=g,r=(i=n.lib).WordArray,i=i.BlockCipher,s=n.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],a=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=s.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],n=0;56>n;n++){var r=o[n]-1;e[n]=t[r>>>5]>>>31-r%32&1}for(t=this._subKeys=[],r=0;16>r;r++){var i=t[r]=[],s=u[r];for(n=0;24>n;n++)i[n/6|0]|=e[(a[n]-1+s)%28]<<31-n%6,i[4+(n/6|0)]|=e[28+(a[n+24]-1+s)%28]<<31-n%6;for(i[0]=i[0]<<1|i[0]>>>31,n=1;7>n;n++)i[n]>>>=4*(n-1)+3;i[7]=i[7]<<5|i[7]>>>27}for(e=this._invSubKeys=[],n=0;16>n;n++)e[n]=t[15-n]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(n,r,i){this._lBlock=n[r],this._rBlock=n[r+1],t.call(this,4,252645135),t.call(this,16,65535),e.call(this,2,858993459),e.call(this,8,16711935),t.call(this,1,1431655765);for(var s=0;16>s;s++){for(var o=i[s],a=this._lBlock,u=this._rBlock,h=0,f=0;8>f;f++)h|=c[f][((u^o[f])&l[f])>>>0];this._lBlock=u,this._rBlock=a^h}i=this._lBlock,this._lBlock=this._rBlock,this._rBlock=i,t.call(this,1,1431655765),e.call(this,8,16711935),e.call(this,2,858993459),t.call(this,16,65535),t.call(this,4,252645135),n[r]=this._lBlock,n[r+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});n.DES=i._createHelper(h),s=s.TripleDES=i.extend({_doReset:function(){var t=this._key.words;this._des1=h.createEncryptor(r.create(t.slice(0,2))),this._des2=h.createEncryptor(r.create(t.slice(2,4))),this._des3=h.createEncryptor(r.create(t.slice(4,6)))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2}),n.TripleDES=i._createHelper(s)}(),function(){var t=g,e=t.lib.WordArray;t.enc.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,r=this._map;t.clamp(),t=[];for(var i=0;i<n;i+=3)for(var s=(e[i>>>2]>>>24-i%4*8&255)<<16|(e[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|e[i+2>>>2]>>>24-(i+2)%4*8&255,o=0;4>o&&i+.75*o<n;o++)t.push(r.charAt(s>>>6*(3-o)&63));if(e=r.charAt(64))for(;t.length%4;)t.push(e);return t.join("")},parse:function(t){var n=t.length,r=this._map;(i=r.charAt(64))&&(-1!=(i=t.indexOf(i))&&(n=i));for(var i=[],s=0,o=0;o<n;o++)if(o%4){var a=r.indexOf(t.charAt(o-1))<<o%4*2,u=r.indexOf(t.charAt(o))>>>6-o%4*2;i[s>>>2]|=(a|u)<<24-s%4*8,s++}return e.create(i,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(t){function e(t,e,n,r,i,s,o){return((t=t+(e&n|~e&r)+i+o)<<s|t>>>32-s)+e}function n(t,e,n,r,i,s,o){return((t=t+(e&r|n&~r)+i+o)<<s|t>>>32-s)+e}function r(t,e,n,r,i,s,o){return((t=t+(e^n^r)+i+o)<<s|t>>>32-s)+e}function i(t,e,n,r,i,s,o){return((t=t+(n^(e|~r))+i+o)<<s|t>>>32-s)+e}for(var s=g,o=(u=s.lib).WordArray,a=u.Hasher,u=s.algo,c=[],l=0;64>l;l++)c[l]=4294967296*t.abs(t.sin(l+1))|0;u=u.MD5=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,s){for(var o=0;16>o;o++){var a=t[u=s+o];t[u]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}o=this._hash.words;var u=t[s+0],l=(a=t[s+1],t[s+2]),h=t[s+3],f=t[s+4],p=t[s+5],d=t[s+6],g=t[s+7],m=t[s+8],v=t[s+9],y=t[s+10],b=t[s+11],x=t[s+12],w=t[s+13],S=t[s+14],E=t[s+15],F=e(F=o[0],D=o[1],C=o[2],A=o[3],u,7,c[0]),A=e(A,F,D,C,a,12,c[1]),C=e(C,A,F,D,l,17,c[2]),D=e(D,C,A,F,h,22,c[3]);F=e(F,D,C,A,f,7,c[4]),A=e(A,F,D,C,p,12,c[5]),C=e(C,A,F,D,d,17,c[6]),D=e(D,C,A,F,g,22,c[7]),F=e(F,D,C,A,m,7,c[8]),A=e(A,F,D,C,v,12,c[9]),C=e(C,A,F,D,y,17,c[10]),D=e(D,C,A,F,b,22,c[11]),F=e(F,D,C,A,x,7,c[12]),A=e(A,F,D,C,w,12,c[13]),C=e(C,A,F,D,S,17,c[14]),F=n(F,D=e(D,C,A,F,E,22,c[15]),C,A,a,5,c[16]),A=n(A,F,D,C,d,9,c[17]),C=n(C,A,F,D,b,14,c[18]),D=n(D,C,A,F,u,20,c[19]),F=n(F,D,C,A,p,5,c[20]),A=n(A,F,D,C,y,9,c[21]),C=n(C,A,F,D,E,14,c[22]),D=n(D,C,A,F,f,20,c[23]),F=n(F,D,C,A,v,5,c[24]),A=n(A,F,D,C,S,9,c[25]),C=n(C,A,F,D,h,14,c[26]),D=n(D,C,A,F,m,20,c[27]),F=n(F,D,C,A,w,5,c[28]),A=n(A,F,D,C,l,9,c[29]),C=n(C,A,F,D,g,14,c[30]),F=r(F,D=n(D,C,A,F,x,20,c[31]),C,A,p,4,c[32]),A=r(A,F,D,C,m,11,c[33]),C=r(C,A,F,D,b,16,c[34]),D=r(D,C,A,F,S,23,c[35]),F=r(F,D,C,A,a,4,c[36]),A=r(A,F,D,C,f,11,c[37]),C=r(C,A,F,D,g,16,c[38]),D=r(D,C,A,F,y,23,c[39]),F=r(F,D,C,A,w,4,c[40]),A=r(A,F,D,C,u,11,c[41]),C=r(C,A,F,D,h,16,c[42]),D=r(D,C,A,F,d,23,c[43]),F=r(F,D,C,A,v,4,c[44]),A=r(A,F,D,C,x,11,c[45]),C=r(C,A,F,D,E,16,c[46]),F=i(F,D=r(D,C,A,F,l,23,c[47]),C,A,u,6,c[48]),A=i(A,F,D,C,g,10,c[49]),C=i(C,A,F,D,S,15,c[50]),D=i(D,C,A,F,p,21,c[51]),F=i(F,D,C,A,x,6,c[52]),A=i(A,F,D,C,h,10,c[53]),C=i(C,A,F,D,y,15,c[54]),D=i(D,C,A,F,a,21,c[55]),F=i(F,D,C,A,m,6,c[56]),A=i(A,F,D,C,E,10,c[57]),C=i(C,A,F,D,d,15,c[58]),D=i(D,C,A,F,w,21,c[59]),F=i(F,D,C,A,f,6,c[60]),A=i(A,F,D,C,b,10,c[61]),C=i(C,A,F,D,l,15,c[62]),D=i(D,C,A,F,v,21,c[63]);o[0]=o[0]+F|0,o[1]=o[1]+D|0,o[2]=o[2]+C|0,o[3]=o[3]+A|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;n[i>>>5]|=128<<24-i%32;var s=t.floor(r/4294967296);for(n[15+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),n[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(n.length+1),this._process(),n=(e=this._hash).words,r=0;4>r;r++)i=n[r],n[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return e},clone:function(){var t=a.clone.call(this);return t._hash=this._hash.clone(),t}}),s.MD5=a._createHelper(u),s.HmacMD5=a._createHmacHelper(u)}(Math),function(){var t=g,e=(i=t.lib).WordArray,n=i.Hasher,r=[],i=t.algo.SHA1=n.extend({_doReset:function(){this._hash=new e.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=this._hash.words,i=n[0],s=n[1],o=n[2],a=n[3],u=n[4],c=0;80>c;c++){if(16>c)r[c]=0|t[e+c];else{var l=r[c-3]^r[c-8]^r[c-14]^r[c-16];r[c]=l<<1|l>>>31}l=(i<<5|i>>>27)+u+r[c],l=20>c?l+(1518500249+(s&o|~s&a)):40>c?l+(1859775393+(s^o^a)):60>c?l+((s&o|s&a|o&a)-1894007588):l+((s^o^a)-899497514),u=a,a=o,o=s<<30|s>>>2,s=i,i=l}n[0]=n[0]+i|0,n[1]=n[1]+s|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+u|0},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),e[15+(r+64>>>9<<4)]=n,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});t.SHA1=n._createHelper(i),t.HmacSHA1=n._createHmacHelper(i)}(),function(t){for(var e=g,n=(i=e.lib).WordArray,r=i.Hasher,i=e.algo,s=[],o=[],a=function(t){return 4294967296*(t-(0|t))|0},u=2,c=0;64>c;){var l;t:{l=u;for(var h=t.sqrt(l),f=2;f<=h;f++)if(!(l%f)){l=!1;break t}l=!0}l&&(8>c&&(s[c]=a(t.pow(u,.5))),o[c]=a(t.pow(u,1/3)),c++),u++}var p=[];i=i.SHA256=r.extend({_doReset:function(){this._hash=new n.init(s.slice(0))},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],s=n[2],a=n[3],u=n[4],c=n[5],l=n[6],h=n[7],f=0;64>f;f++){if(16>f)p[f]=0|t[e+f];else{var d=p[f-15],g=p[f-2];p[f]=((d<<25|d>>>7)^(d<<14|d>>>18)^d>>>3)+p[f-7]+((g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10)+p[f-16]}d=h+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&c^~u&l)+o[f]+p[f],g=((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+(r&i^r&s^i&s),h=l,l=c,c=u,u=a+d|0,a=s,s=i,i=r,r=d+g|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+u|0,n[5]=n[5]+c|0,n[6]=n[6]+l|0,n[7]=n[7]+h|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=r._createHelper(i),e.HmacSHA256=r._createHmacHelper(i)}(Math),function(){var t=g,e=t.lib.WordArray,n=(r=t.algo).SHA256,r=r.SHA224=n.extend({_doReset:function(){this._hash=new e.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=n._doFinalize.call(this);return t.sigBytes-=4,t}});t.SHA224=n._createHelper(r),t.HmacSHA224=n._createHmacHelper(r)}(),function(){function t(){return r.create.apply(r,arguments)}for(var e=g,n=e.lib.Hasher,r=(s=e.x64).Word,i=s.WordArray,s=e.algo,o=[t(1116352408,3609767458),t(1899447441,602891725),t(3049323471,3964484399),t(3921009573,2173295548),t(961987163,4081628472),t(1508970993,3053834265),t(2453635748,2937671579),t(2870763221,3664609560),t(3624381080,2734883394),t(310598401,1164996542),t(607225278,1323610764),t(1426881987,3590304994),t(1925078388,4068182383),t(2162078206,991336113),t(2614888103,633803317),t(3248222580,3479774868),t(3835390401,2666613458),t(4022224774,944711139),t(264347078,2341262773),t(604807628,2007800933),t(770255983,1495990901),t(1249150122,1856431235),t(1555081692,3175218132),t(1996064986,2198950837),t(2554220882,3999719339),t(2821834349,766784016),t(2952996808,2566594879),t(3210313671,3203337956),t(3336571891,1034457026),t(3584528711,2466948901),t(113926993,3758326383),t(338241895,168717936),t(666307205,1188179964),t(773529912,1546045734),t(1294757372,1522805485),t(1396182291,2643833823),t(1695183700,2343527390),t(1986661051,1014477480),t(2177026350,1206759142),t(2456956037,344077627),t(2730485921,1290863460),t(2820302411,3158454273),t(3259730800,3505952657),t(3345764771,106217008),t(3516065817,3606008344),t(3600352804,1432725776),t(4094571909,1467031594),t(275423344,851169720),t(430227734,3100823752),t(506948616,1363258195),t(659060556,3750685593),t(883997877,3785050280),t(958139571,3318307427),t(1322822218,3812723403),t(1537002063,2003034995),t(1747873779,3602036899),t(1955562222,1575990012),t(2024104815,1125592928),t(2227730452,2716904306),t(2361852424,442776044),t(2428436474,593698344),t(2756734187,3733110249),t(3204031479,2999351573),t(3329325298,3815920427),t(3391569614,3928383900),t(3515267271,566280711),t(3940187606,3454069534),t(4118630271,4000239992),t(116418474,1914138554),t(174292421,2731055270),t(289380356,3203993006),t(460393269,320620315),t(685471733,587496836),t(852142971,1086792851),t(1017036298,365543100),t(1126000580,2618297676),t(1288033470,3409855158),t(1501505948,4234509866),t(1607167915,987167468),t(1816402316,1246189591)],a=[],u=0;80>u;u++)a[u]=t();s=s.SHA512=n.extend({_doReset:function(){this._hash=new i.init([new r.init(1779033703,4089235720),new r.init(3144134277,2227873595),new r.init(1013904242,4271175723),new r.init(2773480762,1595750129),new r.init(1359893119,2917565137),new r.init(2600822924,725511199),new r.init(528734635,4215389547),new r.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var n=(h=this._hash.words)[0],r=h[1],i=h[2],s=h[3],u=h[4],c=h[5],l=h[6],h=h[7],f=n.high,p=n.low,d=r.high,g=r.low,m=i.high,v=i.low,y=s.high,b=s.low,x=u.high,w=u.low,S=c.high,E=c.low,F=l.high,A=l.low,C=h.high,D=h.low,$=f,I=p,R=d,T=g,_=m,P=v,k=y,O=b,j=x,B=w,N=S,L=E,H=F,M=A,U=C,V=D,q=0;80>q;q++){var K=a[q];if(16>q)var z=K.high=0|t[e+2*q],G=K.low=0|t[e+2*q+1];else{z=((G=(z=a[q-15]).high)>>>1|(W=z.low)<<31)^(G>>>8|W<<24)^G>>>7;var W=(W>>>1|G<<31)^(W>>>8|G<<24)^(W>>>7|G<<25),Y=((G=(Y=a[q-2]).high)>>>19|(X=Y.low)<<13)^(G<<3|X>>>29)^G>>>6,X=(X>>>19|G<<13)^(X<<3|G>>>29)^(X>>>6|G<<26),J=(G=a[q-7]).high,Z=(Q=a[q-16]).high,Q=Q.low;z=(z=(z=z+J+((G=W+G.low)>>>0<W>>>0?1:0))+Y+((G=G+X)>>>0<X>>>0?1:0))+Z+((G=G+Q)>>>0<Q>>>0?1:0);K.high=z,K.low=G}J=j&N^~j&H,Q=B&L^~B&M,K=$&R^$&_^R&_;var tt=I&T^I&P^T&P,et=(W=($>>>28|I<<4)^($<<30|I>>>2)^($<<25|I>>>7),Y=(I>>>28|$<<4)^(I<<30|$>>>2)^(I<<25|$>>>7),(X=o[q]).high),nt=X.low;Z=U+((j>>>14|B<<18)^(j>>>18|B<<14)^(j<<23|B>>>9))+((X=V+((B>>>14|j<<18)^(B>>>18|j<<14)^(B<<23|j>>>9)))>>>0<V>>>0?1:0),U=H,V=M,H=N,M=L,N=j,L=B,j=k+(Z=(Z=(Z=Z+J+((X=X+Q)>>>0<Q>>>0?1:0))+et+((X=X+nt)>>>0<nt>>>0?1:0))+z+((X=X+G)>>>0<G>>>0?1:0))+((B=O+X|0)>>>0<O>>>0?1:0)|0,k=_,O=P,_=R,P=T,R=$,T=I,$=Z+(K=W+K+((G=Y+tt)>>>0<Y>>>0?1:0))+((I=X+G|0)>>>0<X>>>0?1:0)|0}p=n.low=p+I,n.high=f+$+(p>>>0<I>>>0?1:0),g=r.low=g+T,r.high=d+R+(g>>>0<T>>>0?1:0),v=i.low=v+P,i.high=m+_+(v>>>0<P>>>0?1:0),b=s.low=b+O,s.high=y+k+(b>>>0<O>>>0?1:0),w=u.low=w+B,u.high=x+j+(w>>>0<B>>>0?1:0),E=c.low=E+L,c.high=S+N+(E>>>0<L>>>0?1:0),A=l.low=A+M,l.high=F+H+(A>>>0<M>>>0?1:0),D=h.low=D+V,h.high=C+U+(D>>>0<V>>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),e[31+(r+128>>>10<<5)]=n,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32}),e.SHA512=n._createHelper(s),e.HmacSHA512=n._createHmacHelper(s)}(),function(){var t=g,e=(i=t.x64).Word,n=i.WordArray,r=(i=t.algo).SHA512,i=i.SHA384=r.extend({_doReset:function(){this._hash=new n.init([new e.init(3418070365,3238371032),new e.init(1654270250,914150663),new e.init(2438529370,812702999),new e.init(355462360,4144912697),new e.init(1731405415,4290775857),new e.init(2394180231,1750603025),new e.init(3675008525,1694076839),new e.init(1203062813,3204075428)])},_doFinalize:function(){var t=r._doFinalize.call(this);return t.sigBytes-=16,t}});t.SHA384=r._createHelper(i),t.HmacSHA384=r._createHmacHelper(i)}(),function(){var t=g,e=(r=t.lib).WordArray,n=r.Hasher,r=t.algo,i=e.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),s=e.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),o=e.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),a=e.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=e.create([0,1518500249,1859775393,2400959708,2840853838]),c=e.create([1352829926,1548603684,1836072691,2053994217,0]);r=r.RIPEMD160=n.extend({_doReset:function(){this._hash=e.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=0;16>n;n++){var r=t[x=e+n];t[x]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var l,h,f,p,d,g,m,v,y,b,x=this._hash.words,w=(r=u.words,c.words),S=i.words,E=s.words,F=o.words,A=a.words;g=l=x[0],m=h=x[1],v=f=x[2],y=p=x[3],b=d=x[4];var C;for(n=0;80>n;n+=1)C=l+t[e+S[n]]|0,C=16>n?C+((h^f^p)+r[0]):32>n?C+((h&f|~h&p)+r[1]):48>n?C+(((h|~f)^p)+r[2]):64>n?C+((h&p|f&~p)+r[3]):C+((h^(f|~p))+r[4]),C=(C=(C|=0)<<F[n]|C>>>32-F[n])+d|0,l=d,d=p,p=f<<10|f>>>22,f=h,h=C,C=g+t[e+E[n]]|0,C=16>n?C+((m^(v|~y))+w[0]):32>n?C+((m&y|v&~y)+w[1]):48>n?C+(((m|~v)^y)+w[2]):64>n?C+((m&v|~m&y)+w[3]):C+((m^v^y)+w[4]),C=(C=(C|=0)<<A[n]|C>>>32-A[n])+b|0,g=b,b=y,y=v<<10|v>>>22,v=m,m=C;C=x[1]+f+y|0,x[1]=x[2]+p+b|0,x[2]=x[3]+d+g|0,x[3]=x[4]+l+m|0,x[4]=x[0]+h+v|0,x[0]=C},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;for(e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t.sigBytes=4*(e.length+1),this._process(),e=(t=this._hash).words,n=0;5>n;n++)r=e[n],e[n]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8);return t},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});t.RIPEMD160=n._createHelper(r),t.HmacRIPEMD160=n._createHmacHelper(r)}(Math),function(){var t=g,e=t.enc.Utf8;t.algo.HMAC=t.lib.Base.extend({init:function(t,n){t=this._hasher=new t.init,"string"==typeof n&&(n=e.parse(n));var r=t.blockSize,i=4*r;n.sigBytes>i&&(n=t.finalize(n)),n.clamp();for(var s=this._oKey=n.clone(),o=this._iKey=n.clone(),a=s.words,u=o.words,c=0;c<r;c++)a[c]^=1549556828,u[c]^=909522486;s.sigBytes=o.sigBytes=i,this.reset()},reset:function(){var t=this._hasher;t.reset(),t.update(this._iKey)},update:function(t){return this._hasher.update(t),this},finalize:function(t){var e=this._hasher;return t=e.finalize(t),e.reset(),e.finalize(this._oKey.clone().concat(t))}})}(),function(){var t,e=g,n=(t=e.lib).Base,r=t.WordArray,i=(t=e.algo).HMAC,s=t.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:t.SHA1,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){var n=this.cfg,s=i.create(n.hasher,t),o=r.create(),a=r.create([1]),u=o.words,c=a.words,l=n.keySize;for(n=n.iterations;u.length<l;){var h=s.update(e).finalize(a);s.reset();for(var f=h.words,p=f.length,d=h,g=1;g<n;g++){d=s.finalize(d),s.reset();for(var m=d.words,v=0;v<p;v++)f[v]^=m[v]}o.concat(h),c[0]++}return o.sigBytes=4*l,o}});e.PBKDF2=function(t,e,n){return s.create(n).compute(t,e)}}();
|
|
2
2
|
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
3
3
|
*/
|
|
4
|
-
var m,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function y(t){var e,n,r="";for(e=0;e+3<=t.length;e+=3)n=parseInt(t.substring(e,e+3),16),r+=v.charAt(n>>6)+v.charAt(63&n);for(e+1==t.length?(n=parseInt(t.substring(e,e+1),16),r+=v.charAt(n<<2)):e+2==t.length&&(n=parseInt(t.substring(e,e+2),16),r+=v.charAt(n>>2)+v.charAt((3&n)<<4)),"=";(3&r.length)>0;)r+="=";return r}function b(t){var e,n,r,i="",s=0;for(e=0;e<t.length&&"="!=t.charAt(e);++e)(r=v.indexOf(t.charAt(e)))<0||(0==s?(i+=C(r>>2),n=3&r,s=1):1==s?(i+=C(n<<2|r>>4),n=15&r,s=2):2==s?(i+=C(n),i+=C(r>>2),n=3&r,s=3):(i+=C(n<<2|r>>4),i+=C(15&r),s=0));return 1==s&&(i+=C(n<<2)),i}function w(t){var e,n=b(t),r=new Array;for(e=0;2*e<n.length;++e)r[e]=parseInt(n.substring(2*e,2*e+2),16);return r}function x(t,e,n){null!=t&&("number"==typeof t?this.fromNumber(t,e,n):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function S(){return new x(null)}"Microsoft Internet Explorer"==p.appName?(x.prototype.am=function(t,e,n,r,i,s){for(var o=32767&e,a=e>>15;--s>=0;){var u=32767&this[t],c=this[t++]>>15,l=a*u+c*o;i=((u=o*u+((32767&l)<<15)+n[r]+(1073741823&i))>>>30)+(l>>>15)+a*c+(i>>>30),n[r++]=1073741823&u}return i},m=30):"Netscape"!=p.appName?(x.prototype.am=function(t,e,n,r,i,s){for(;--s>=0;){var o=e*this[t++]+n[r]+i;i=Math.floor(o/67108864),n[r++]=67108863&o}return i},m=26):(x.prototype.am=function(t,e,n,r,i,s){for(var o=16383&e,a=e>>14;--s>=0;){var u=16383&this[t],c=this[t++]>>14,l=a*u+c*o;i=((u=o*u+((16383&l)<<14)+n[r]+i)>>28)+(l>>14)+a*c,n[r++]=268435455&u}return i},m=28),x.prototype.DB=m,x.prototype.DM=(1<<m)-1,x.prototype.DV=1<<m;x.prototype.FV=Math.pow(2,52),x.prototype.F1=52-m,x.prototype.F2=2*m-52;var E,F,A=new Array;for(E="0".charCodeAt(0),F=0;F<=9;++F)A[E++]=F;for(E="a".charCodeAt(0),F=10;F<36;++F)A[E++]=F;for(E="A".charCodeAt(0),F=10;F<36;++F)A[E++]=F;function C(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function D(t,e){var n=A[t.charCodeAt(e)];return null==n?-1:n}function I(t){var e=S();return e.fromInt(t),e}function $(t){var e,n=1;return 0!=(e=t>>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}function R(t){this.m=t}function T(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function _(t,e){return t&e}function P(t,e){return t|e}function k(t,e){return t^e}function O(t,e){return t&~e}function j(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function B(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function N(){}function L(t){return t}function H(t){this.r2=S(),this.q3=S(),x.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}R.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},R.prototype.revert=function(t){return t},R.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},R.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},R.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},T.prototype.convert=function(t){var e=S();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(x.ZERO)>0&&this.m.subTo(e,e),e},T.prototype.revert=function(t){var e=S();return t.copyTo(e),this.reduce(e),e},T.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var n=32767&t[e],r=n*this.mpl+((n*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[n=e+this.m.t]+=this.m.am(0,r,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},T.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},T.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},x.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},x.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},x.prototype.fromString=function(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var r=t.length,i=!1,s=0;--r>=0;){var o=8==n?255&t[r]:D(t,r);o<0?"-"==t.charAt(r)&&(i=!0):(i=!1,0==s?this[this.t++]=o:s+n>this.DB?(this[this.t-1]|=(o&(1<<this.DB-s)-1)<<s,this[this.t++]=o>>this.DB-s):this[this.t-1]|=o<<s,(s+=n)>=this.DB&&(s-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&x.ZERO.subTo(this,this)},x.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},x.prototype.dlShiftTo=function(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s},x.prototype.drShiftTo=function(t,e){for(var n=t;n<this.t;++n)e[n-t]=this[n];e.t=Math.max(this.t-t,0),e.s=this.s},x.prototype.lShiftTo=function(t,e){var n,r=t%this.DB,i=this.DB-r,s=(1<<i)-1,o=Math.floor(t/this.DB),a=this.s<<r&this.DM;for(n=this.t-1;n>=0;--n)e[n+o+1]=this[n]>>i|a,a=(this[n]&s)<<r;for(n=o-1;n>=0;--n)e[n]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()},x.prototype.rShiftTo=function(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)e.t=0;else{var r=t%this.DB,i=this.DB-r,s=(1<<r)-1;e[0]=this[n]>>r;for(var o=n+1;o<this.t;++o)e[o-n-1]|=(this[o]&s)<<i,e[o-n]=this[o]>>r;r>0&&(e[this.t-n-1]|=(this.s&s)<<i),e.t=this.t-n,e.clamp()}},x.prototype.subTo=function(t,e){for(var n=0,r=0,i=Math.min(t.t,this.t);n<i;)r+=this[n]-t[n],e[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;n<this.t;)r+=this[n],e[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r-=t[n],e[n++]=r&this.DM,r>>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e[n++]=this.DV+r:r>0&&(e[n++]=r),e.t=n,e.clamp()},x.prototype.multiplyTo=function(t,e){var n=this.abs(),r=t.abs(),i=n.t;for(e.t=i+r.t;--i>=0;)e[i]=0;for(i=0;i<r.t;++i)e[i+n.t]=n.am(0,r[i],e,i,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&x.ZERO.subTo(e,e)},x.prototype.squareTo=function(t){for(var e=this.abs(),n=t.t=2*e.t;--n>=0;)t[n]=0;for(n=0;n<e.t-1;++n){var r=e.am(n,e[n],t,2*n,0,1);(t[n+e.t]+=e.am(n+1,2*e[n],t,2*n+1,r,e.t-n-1))>=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()},x.prototype.divRemTo=function(t,e,n){var r=t.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t)return null!=e&&e.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=S());var s=S(),o=this.s,a=t.s,u=this.DB-$(r[r.t-1]);u>0?(r.lShiftTo(u,s),i.lShiftTo(u,n)):(r.copyTo(s),i.copyTo(n));var c=s.t,l=s[c-1];if(0!=l){var h=l*(1<<this.F1)+(c>1?s[c-2]>>this.F2:0),f=this.FV/h,p=(1<<this.F1)/h,d=1<<this.F2,g=n.t,m=g-c,v=null==e?S():e;for(s.dlShiftTo(m,v),n.compareTo(v)>=0&&(n[n.t++]=1,n.subTo(v,n)),x.ONE.dlShiftTo(c,v),v.subTo(s,s);s.t<c;)s[s.t++]=0;for(;--m>=0;){var y=n[--g]==l?this.DM:Math.floor(n[g]*f+(n[g-1]+d)*p);if((n[g]+=s.am(0,y,n,m,0,c))<y)for(s.dlShiftTo(m,v),n.subTo(v,n);n[g]<--y;)n.subTo(v,n)}null!=e&&(n.drShiftTo(c,e),o!=a&&x.ZERO.subTo(e,e)),n.t=c,n.clamp(),u>0&&n.rShiftTo(u,n),o<0&&x.ZERO.subTo(n,n)}}},x.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},x.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},x.prototype.exp=function(t,e){if(t>4294967295||t<1)return x.ONE;var n=S(),r=S(),i=e.convert(this),s=$(t)-1;for(i.copyTo(n);--s>=0;)if(e.sqrTo(n,r),(t&1<<s)>0)e.mulTo(r,i,n);else{var o=n;n=r,r=o}return e.revert(n)},x.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var n,r=(1<<e)-1,i=!1,s="",o=this.t,a=this.DB-o*this.DB%e;if(o-- >0)for(a<this.DB&&(n=this[o]>>a)>0&&(i=!0,s=C(n));o>=0;)a<e?(n=(this[o]&(1<<a)-1)<<e-a,n|=this[--o]>>(a+=this.DB-e)):(n=this[o]>>(a-=e)&r,a<=0&&(a+=this.DB,--o)),n>0&&(i=!0),i&&(s+=C(n));return i?s:"0"},x.prototype.negate=function(){var t=S();return x.ZERO.subTo(this,t),t},x.prototype.abs=function(){return this.s<0?this.negate():this},x.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(0!=(e=n-t.t))return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this[n]-t[n]))return e;return 0},x.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+$(this[this.t-1]^this.s&this.DM)},x.prototype.mod=function(t){var e=S();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(x.ZERO)>0&&t.subTo(e,e),e},x.prototype.modPowInt=function(t,e){var n;return n=t<256||e.isEven()?new R(e):new T(e),this.exp(t,n)},x.ZERO=I(0),x.ONE=I(1),N.prototype.convert=L,N.prototype.revert=L,N.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n)},N.prototype.sqrTo=function(t,e){t.squareTo(e)},H.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=S();return t.copyTo(e),this.reduce(e),e},H.prototype.revert=function(t){return t},H.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},H.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},H.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var M=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],U=(1<<26)/M[M.length-1];
|
|
4
|
+
var m,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function y(t){var e,n,r="";for(e=0;e+3<=t.length;e+=3)n=parseInt(t.substring(e,e+3),16),r+=v.charAt(n>>6)+v.charAt(63&n);for(e+1==t.length?(n=parseInt(t.substring(e,e+1),16),r+=v.charAt(n<<2)):e+2==t.length&&(n=parseInt(t.substring(e,e+2),16),r+=v.charAt(n>>2)+v.charAt((3&n)<<4)),"=";(3&r.length)>0;)r+="=";return r}function b(t){var e,n,r,i="",s=0;for(e=0;e<t.length&&"="!=t.charAt(e);++e)(r=v.indexOf(t.charAt(e)))<0||(0==s?(i+=C(r>>2),n=3&r,s=1):1==s?(i+=C(n<<2|r>>4),n=15&r,s=2):2==s?(i+=C(n),i+=C(r>>2),n=3&r,s=3):(i+=C(n<<2|r>>4),i+=C(15&r),s=0));return 1==s&&(i+=C(n<<2)),i}function x(t){var e,n=b(t),r=new Array;for(e=0;2*e<n.length;++e)r[e]=parseInt(n.substring(2*e,2*e+2),16);return r}function w(t,e,n){null!=t&&("number"==typeof t?this.fromNumber(t,e,n):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function S(){return new w(null)}"Microsoft Internet Explorer"==p.appName?(w.prototype.am=function(t,e,n,r,i,s){for(var o=32767&e,a=e>>15;--s>=0;){var u=32767&this[t],c=this[t++]>>15,l=a*u+c*o;i=((u=o*u+((32767&l)<<15)+n[r]+(1073741823&i))>>>30)+(l>>>15)+a*c+(i>>>30),n[r++]=1073741823&u}return i},m=30):"Netscape"!=p.appName?(w.prototype.am=function(t,e,n,r,i,s){for(;--s>=0;){var o=e*this[t++]+n[r]+i;i=Math.floor(o/67108864),n[r++]=67108863&o}return i},m=26):(w.prototype.am=function(t,e,n,r,i,s){for(var o=16383&e,a=e>>14;--s>=0;){var u=16383&this[t],c=this[t++]>>14,l=a*u+c*o;i=((u=o*u+((16383&l)<<14)+n[r]+i)>>28)+(l>>14)+a*c,n[r++]=268435455&u}return i},m=28),w.prototype.DB=m,w.prototype.DM=(1<<m)-1,w.prototype.DV=1<<m;w.prototype.FV=Math.pow(2,52),w.prototype.F1=52-m,w.prototype.F2=2*m-52;var E,F,A=new Array;for(E="0".charCodeAt(0),F=0;F<=9;++F)A[E++]=F;for(E="a".charCodeAt(0),F=10;F<36;++F)A[E++]=F;for(E="A".charCodeAt(0),F=10;F<36;++F)A[E++]=F;function C(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function D(t,e){var n=A[t.charCodeAt(e)];return null==n?-1:n}function $(t){var e=S();return e.fromInt(t),e}function I(t){var e,n=1;return 0!=(e=t>>>16)&&(t=e,n+=16),0!=(e=t>>8)&&(t=e,n+=8),0!=(e=t>>4)&&(t=e,n+=4),0!=(e=t>>2)&&(t=e,n+=2),0!=(e=t>>1)&&(t=e,n+=1),n}function R(t){this.m=t}function T(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function _(t,e){return t&e}function P(t,e){return t|e}function k(t,e){return t^e}function O(t,e){return t&~e}function j(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function B(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function N(){}function L(t){return t}function H(t){this.r2=S(),this.q3=S(),w.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}R.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},R.prototype.revert=function(t){return t},R.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},R.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},R.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},T.prototype.convert=function(t){var e=S();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(w.ZERO)>0&&this.m.subTo(e,e),e},T.prototype.revert=function(t){var e=S();return t.copyTo(e),this.reduce(e),e},T.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var n=32767&t[e],r=n*this.mpl+((n*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[n=e+this.m.t]+=this.m.am(0,r,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},T.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},T.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},w.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},w.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},w.prototype.fromString=function(t,e){var n;if(16==e)n=4;else if(8==e)n=3;else if(256==e)n=8;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return void this.fromRadix(t,e);n=2}this.t=0,this.s=0;for(var r=t.length,i=!1,s=0;--r>=0;){var o=8==n?255&t[r]:D(t,r);o<0?"-"==t.charAt(r)&&(i=!0):(i=!1,0==s?this[this.t++]=o:s+n>this.DB?(this[this.t-1]|=(o&(1<<this.DB-s)-1)<<s,this[this.t++]=o>>this.DB-s):this[this.t-1]|=o<<s,(s+=n)>=this.DB&&(s-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,s>0&&(this[this.t-1]|=(1<<this.DB-s)-1<<s)),this.clamp(),i&&w.ZERO.subTo(this,this)},w.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},w.prototype.dlShiftTo=function(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s},w.prototype.drShiftTo=function(t,e){for(var n=t;n<this.t;++n)e[n-t]=this[n];e.t=Math.max(this.t-t,0),e.s=this.s},w.prototype.lShiftTo=function(t,e){var n,r=t%this.DB,i=this.DB-r,s=(1<<i)-1,o=Math.floor(t/this.DB),a=this.s<<r&this.DM;for(n=this.t-1;n>=0;--n)e[n+o+1]=this[n]>>i|a,a=(this[n]&s)<<r;for(n=o-1;n>=0;--n)e[n]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()},w.prototype.rShiftTo=function(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t)e.t=0;else{var r=t%this.DB,i=this.DB-r,s=(1<<r)-1;e[0]=this[n]>>r;for(var o=n+1;o<this.t;++o)e[o-n-1]|=(this[o]&s)<<i,e[o-n]=this[o]>>r;r>0&&(e[this.t-n-1]|=(this.s&s)<<i),e.t=this.t-n,e.clamp()}},w.prototype.subTo=function(t,e){for(var n=0,r=0,i=Math.min(t.t,this.t);n<i;)r+=this[n]-t[n],e[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r-=t.s;n<this.t;)r+=this[n],e[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r-=t[n],e[n++]=r&this.DM,r>>=this.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e[n++]=this.DV+r:r>0&&(e[n++]=r),e.t=n,e.clamp()},w.prototype.multiplyTo=function(t,e){var n=this.abs(),r=t.abs(),i=n.t;for(e.t=i+r.t;--i>=0;)e[i]=0;for(i=0;i<r.t;++i)e[i+n.t]=n.am(0,r[i],e,i,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&w.ZERO.subTo(e,e)},w.prototype.squareTo=function(t){for(var e=this.abs(),n=t.t=2*e.t;--n>=0;)t[n]=0;for(n=0;n<e.t-1;++n){var r=e.am(n,e[n],t,2*n,0,1);(t[n+e.t]+=e.am(n+1,2*e[n],t,2*n+1,r,e.t-n-1))>=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()},w.prototype.divRemTo=function(t,e,n){var r=t.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t)return null!=e&&e.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=S());var s=S(),o=this.s,a=t.s,u=this.DB-I(r[r.t-1]);u>0?(r.lShiftTo(u,s),i.lShiftTo(u,n)):(r.copyTo(s),i.copyTo(n));var c=s.t,l=s[c-1];if(0!=l){var h=l*(1<<this.F1)+(c>1?s[c-2]>>this.F2:0),f=this.FV/h,p=(1<<this.F1)/h,d=1<<this.F2,g=n.t,m=g-c,v=null==e?S():e;for(s.dlShiftTo(m,v),n.compareTo(v)>=0&&(n[n.t++]=1,n.subTo(v,n)),w.ONE.dlShiftTo(c,v),v.subTo(s,s);s.t<c;)s[s.t++]=0;for(;--m>=0;){var y=n[--g]==l?this.DM:Math.floor(n[g]*f+(n[g-1]+d)*p);if((n[g]+=s.am(0,y,n,m,0,c))<y)for(s.dlShiftTo(m,v),n.subTo(v,n);n[g]<--y;)n.subTo(v,n)}null!=e&&(n.drShiftTo(c,e),o!=a&&w.ZERO.subTo(e,e)),n.t=c,n.clamp(),u>0&&n.rShiftTo(u,n),o<0&&w.ZERO.subTo(n,n)}}},w.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},w.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},w.prototype.exp=function(t,e){if(t>4294967295||t<1)return w.ONE;var n=S(),r=S(),i=e.convert(this),s=I(t)-1;for(i.copyTo(n);--s>=0;)if(e.sqrTo(n,r),(t&1<<s)>0)e.mulTo(r,i,n);else{var o=n;n=r,r=o}return e.revert(n)},w.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var n,r=(1<<e)-1,i=!1,s="",o=this.t,a=this.DB-o*this.DB%e;if(o-- >0)for(a<this.DB&&(n=this[o]>>a)>0&&(i=!0,s=C(n));o>=0;)a<e?(n=(this[o]&(1<<a)-1)<<e-a,n|=this[--o]>>(a+=this.DB-e)):(n=this[o]>>(a-=e)&r,a<=0&&(a+=this.DB,--o)),n>0&&(i=!0),i&&(s+=C(n));return i?s:"0"},w.prototype.negate=function(){var t=S();return w.ZERO.subTo(this,t),t},w.prototype.abs=function(){return this.s<0?this.negate():this},w.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var n=this.t;if(0!=(e=n-t.t))return this.s<0?-e:e;for(;--n>=0;)if(0!=(e=this[n]-t[n]))return e;return 0},w.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+I(this[this.t-1]^this.s&this.DM)},w.prototype.mod=function(t){var e=S();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(w.ZERO)>0&&t.subTo(e,e),e},w.prototype.modPowInt=function(t,e){var n;return n=t<256||e.isEven()?new R(e):new T(e),this.exp(t,n)},w.ZERO=$(0),w.ONE=$(1),N.prototype.convert=L,N.prototype.revert=L,N.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n)},N.prototype.sqrTo=function(t,e){t.squareTo(e)},H.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=S();return t.copyTo(e),this.reduce(e),e},H.prototype.revert=function(t){return t},H.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},H.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},H.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var M=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],U=(1<<26)/M[M.length-1];
|
|
5
5
|
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
6
6
|
*/
|
|
7
|
-
function V(){this.i=0,this.j=0,this.S=new Array}
|
|
7
|
+
function V(){this.i=0,this.j=0,this.S=new Array}w.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},w.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),n=Math.pow(t,e),r=$(n),i=S(),s=S(),o="";for(this.divRemTo(r,i,s);i.signum()>0;)o=(n+s.intValue()).toString(t).substr(1)+o,i.divRemTo(r,i,s);return s.intValue().toString(t)+o},w.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var n=this.chunkSize(e),r=Math.pow(e,n),i=!1,s=0,o=0,a=0;a<t.length;++a){var u=D(t,a);u<0?"-"==t.charAt(a)&&0==this.signum()&&(i=!0):(o=e*o+u,++s>=n&&(this.dMultiply(r),this.dAddOffset(o,0),s=0,o=0))}s>0&&(this.dMultiply(Math.pow(e,s)),this.dAddOffset(o,0)),i&&w.ZERO.subTo(this,this)},w.prototype.fromNumber=function(t,e,n){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(w.ONE.shiftLeft(t-1),P,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(w.ONE.shiftLeft(t-1),this);else{var r=new Array,i=7&t;r.length=1+(t>>3),e.nextBytes(r),i>0?r[0]&=(1<<i)-1:r[0]=0,this.fromString(r,256)}},w.prototype.bitwiseTo=function(t,e,n){var r,i,s=Math.min(t.t,this.t);for(r=0;r<s;++r)n[r]=e(this[r],t[r]);if(t.t<this.t){for(i=t.s&this.DM,r=s;r<this.t;++r)n[r]=e(this[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=s;r<t.t;++r)n[r]=e(i,t[r]);n.t=t.t}n.s=e(this.s,t.s),n.clamp()},w.prototype.changeBit=function(t,e){var n=w.ONE.shiftLeft(t);return this.bitwiseTo(n,e,n),n},w.prototype.addTo=function(t,e){for(var n=0,r=0,i=Math.min(t.t,this.t);n<i;)r+=this[n]+t[n],e[n++]=r&this.DM,r>>=this.DB;if(t.t<this.t){for(r+=t.s;n<this.t;)r+=this[n],e[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<t.t;)r+=t[n],e[n++]=r&this.DM,r>>=this.DB;r+=t.s}e.s=r<0?-1:0,r>0?e[n++]=r:r<-1&&(e[n++]=this.DV+r),e.t=n,e.clamp()},w.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},w.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},w.prototype.multiplyLowerTo=function(t,e,n){var r,i=Math.min(this.t+t.t,e);for(n.s=0,n.t=i;i>0;)n[--i]=0;for(r=n.t-this.t;i<r;++i)n[i+this.t]=this.am(0,t[i],n,i,0,this.t);for(r=Math.min(t.t,e);i<r;++i)this.am(0,t[i],n,i,0,e-i);n.clamp()},w.prototype.multiplyUpperTo=function(t,e,n){--e;var r=n.t=this.t+t.t-e;for(n.s=0;--r>=0;)n[r]=0;for(r=Math.max(e-this.t,0);r<t.t;++r)n[this.t+r-e]=this.am(e-r,t[r],n,0,0,this.t+r-e);n.clamp(),n.drShiftTo(1,n)},w.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,n=this.s<0?t-1:0;if(this.t>0)if(0==e)n=this[0]%t;else for(var r=this.t-1;r>=0;--r)n=(e*n+this[r])%t;return n},w.prototype.millerRabin=function(t){var e=this.subtract(w.ONE),n=e.getLowestSetBit();if(n<=0)return!1;var r=e.shiftRight(n);(t=t+1>>1)>M.length&&(t=M.length);for(var i=S(),s=0;s<t;++s){i.fromInt(M[Math.floor(Math.random()*M.length)]);var o=i.modPow(r,this);if(0!=o.compareTo(w.ONE)&&0!=o.compareTo(e)){for(var a=1;a++<n&&0!=o.compareTo(e);)if(0==(o=o.modPowInt(2,this)).compareTo(w.ONE))return!1;if(0!=o.compareTo(e))return!1}}return!0},w.prototype.clone=
|
|
8
8
|
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
9
9
|
*/
|
|
10
|
-
function(){var t=S();return this.copyTo(t),t},
|
|
10
|
+
function(){var t=S();return this.copyTo(t),t},w.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},w.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},w.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},w.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},w.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var n,r=this.DB-t*this.DB%8,i=0;if(t-- >0)for(r<this.DB&&(n=this[t]>>r)!=(this.s&this.DM)>>r&&(e[i++]=n|this.s<<this.DB-r);t>=0;)r<8?(n=(this[t]&(1<<r)-1)<<8-r,n|=this[--t]>>(r+=this.DB-8)):(n=this[t]>>(r-=8)&255,r<=0&&(r+=this.DB,--t)),0!=(128&n)&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(e[i++]=n);return e},w.prototype.equals=function(t){return 0==this.compareTo(t)},w.prototype.min=function(t){return this.compareTo(t)<0?this:t},w.prototype.max=function(t){return this.compareTo(t)>0?this:t},w.prototype.and=function(t){var e=S();return this.bitwiseTo(t,_,e),e},w.prototype.or=function(t){var e=S();return this.bitwiseTo(t,P,e),e},w.prototype.xor=function(t){var e=S();return this.bitwiseTo(t,k,e),e},w.prototype.andNot=function(t){var e=S();return this.bitwiseTo(t,O,e),e},w.prototype.not=function(){for(var t=S(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},w.prototype.shiftLeft=function(t){var e=S();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},w.prototype.shiftRight=function(t){var e=S();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},w.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+j(this[t]);return this.s<0?this.t*this.DB:-1},w.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,n=0;n<this.t;++n)t+=B(this[n]^e);return t},w.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},w.prototype.setBit=function(t){return this.changeBit(t,P)},w.prototype.clearBit=function(t){return this.changeBit(t,O)},w.prototype.flipBit=function(t){return this.changeBit(t,k)},w.prototype.add=function(t){var e=S();return this.addTo(t,e),e},w.prototype.subtract=function(t){var e=S();return this.subTo(t,e),e},w.prototype.multiply=function(t){var e=S();return this.multiplyTo(t,e),e},w.prototype.divide=function(t){var e=S();return this.divRemTo(t,e,null),e},w.prototype.remainder=function(t){var e=S();return this.divRemTo(t,null,e),e},w.prototype.divideAndRemainder=function(t){var e=S(),n=S();return this.divRemTo(t,e,n),new Array(e,n)},w.prototype.modPow=function(t,e){var n,r,i=t.bitLength(),s=$(1);if(i<=0)return s;n=i<18?1:i<48?3:i<144?4:i<768?5:6,r=i<8?new R(e):e.isEven()?new H(e):new T(e);var o=new Array,a=3,u=n-1,c=(1<<n)-1;if(o[1]=r.convert(this),n>1){var l=S();for(r.sqrTo(o[1],l);a<=c;)o[a]=S(),r.mulTo(l,o[a-2],o[a]),a+=2}var h,f,p=t.t-1,d=!0,g=S();for(i=I(t[p])-1;p>=0;){for(i>=u?h=t[p]>>i-u&c:(h=(t[p]&(1<<i+1)-1)<<u-i,p>0&&(h|=t[p-1]>>this.DB+i-u)),a=n;0==(1&h);)h>>=1,--a;if((i-=a)<0&&(i+=this.DB,--p),d)o[h].copyTo(s),d=!1;else{for(;a>1;)r.sqrTo(s,g),r.sqrTo(g,s),a-=2;a>0?r.sqrTo(s,g):(f=s,s=g,g=f),r.mulTo(g,o[h],s)}for(;p>=0&&0==(t[p]&1<<i);)r.sqrTo(s,g),f=s,s=g,g=f,--i<0&&(i=this.DB-1,--p)}return r.revert(s)},w.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||0==t.signum())return w.ZERO;for(var n=t.clone(),r=this.clone(),i=$(1),s=$(0),o=$(0),a=$(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),e?(i.isEven()&&s.isEven()||(i.addTo(this,i),s.subTo(t,s)),i.rShiftTo(1,i)):s.isEven()||s.subTo(t,s),s.rShiftTo(1,s);for(;r.isEven();)r.rShiftTo(1,r),e?(o.isEven()&&a.isEven()||(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);n.compareTo(r)>=0?(n.subTo(r,n),e&&i.subTo(o,i),s.subTo(a,s)):(r.subTo(n,r),e&&o.subTo(i,o),a.subTo(s,a))}return 0!=r.compareTo(w.ONE)?w.ZERO:a.compareTo(t)>=0?a.subtract(t):a.signum()<0?(a.addTo(t,a),a.signum()<0?a.add(t):a):a},w.prototype.pow=function(t){return this.exp(t,new N)},w.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(e.compareTo(n)<0){var r=e;e=n,n=r}var i=e.getLowestSetBit(),s=n.getLowestSetBit();if(s<0)return e;for(i<s&&(s=i),s>0&&(e.rShiftTo(s,e),n.rShiftTo(s,n));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),e.compareTo(n)>=0?(e.subTo(n,e),e.rShiftTo(1,e)):(n.subTo(e,n),n.rShiftTo(1,n));return s>0&&n.lShiftTo(s,n),n},w.prototype.isProbablePrime=function(t){var e,n=this.abs();if(1==n.t&&n[0]<=M[M.length-1]){for(e=0;e<M.length;++e)if(n[0]==M[e])return!0;return!1}if(n.isEven())return!1;for(e=1;e<M.length;){for(var r=M[e],i=e+1;i<M.length&&r<U;)r*=M[i++];for(r=n.modInt(r);e<i;)if(r%M[e++]==0)return!1}return n.millerRabin(t)},w.prototype.square=function(){var t=S();return this.squareTo(t),t},V.prototype.init=function(t){var e,n,r;for(e=0;e<256;++e)this.S[e]=e;for(n=0,e=0;e<256;++e)n=n+this.S[e]+t[e%t.length]&255,r=this.S[e],this.S[e]=this.S[n],this.S[n]=r;this.i=0,this.j=0},V.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]};var q,K,z;
|
|
11
11
|
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
12
12
|
*/function G(){!function(t){K[z++]^=255&t,K[z++]^=t>>8&255,K[z++]^=t>>16&255,K[z++]^=t>>24&255,z>=256&&(z-=256)}((new Date).getTime())}if(null==K){var W;if(K=new Array,z=0,void 0!==d&&(void 0!==d.crypto||void 0!==d.msCrypto)){var Y=d.crypto||d.msCrypto;if(Y.getRandomValues){var X=new Uint8Array(32);for(Y.getRandomValues(X),W=0;W<32;++W)K[z++]=X[W]}else if("Netscape"==p.appName&&p.appVersion<"5"){var J=d.crypto.random(32);for(W=0;W<J.length;++W)K[z++]=255&J.charCodeAt(W)}}for(;z<256;)W=Math.floor(65536*Math.random()),K[z++]=W>>>8,K[z++]=255&W;z=0,G()}function Z(){if(null==q){for(G(),(q=new V).init(K),z=0;z<K.length;++z)K[z]=0;z=0}return q.next()}function Q(){}
|
|
13
13
|
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
14
14
|
*/
|
|
15
|
-
function tt(t,e){return new
|
|
15
|
+
function tt(t,e){return new w(t,e)}function et(t,e,n){for(var r="",i=0;r.length<e;)r+=n(String.fromCharCode.apply(String,t.concat([(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i]))),i+=1;return r}function nt(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function rt(t,e,n){for(var r="",i=0;r.length<e;)r+=n(t+String.fromCharCode.apply(String,[(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i])),i+=1;return r}
|
|
16
16
|
/*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
17
17
|
*/
|
|
18
|
-
function it(t,e){this.x=e,this.q=t}function st(t,e,n,r){this.curve=t,this.x=e,this.y=n,this.z=null==r?
|
|
18
|
+
function it(t,e){this.x=e,this.q=t}function st(t,e,n,r){this.curve=t,this.x=e,this.y=n,this.z=null==r?w.ONE:r,this.zinv=null}function ot(t,e,n){this.q=t,this.a=this.fromBigInteger(e),this.b=this.fromBigInteger(n),this.infinity=new st(this,null,null)}Q.prototype.nextBytes=function(t){var e;for(e=0;e<t.length;++e)t[e]=Z()},nt.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},nt.prototype.setPublic=function(t,e){if(this.isPublic=!0,this.isPrivate=!1,"string"!=typeof t)this.n=t,this.e=e;else{if(!(null!=t&&null!=e&&t.length>0&&e.length>0))throw"Invalid RSA public key";this.n=tt(t,16),this.e=parseInt(e,16)}},nt.prototype.encrypt=function(t){var e=function(t,e){if(e<t.length+11)throw"Message too long for RSA";for(var n=new Array,r=t.length-1;r>=0&&e>0;){var i=t.charCodeAt(r--);i<128?n[--e]=i:i>127&&i<2048?(n[--e]=63&i|128,n[--e]=i>>6|192):(n[--e]=63&i|128,n[--e]=i>>6&63|128,n[--e]=i>>12|224)}n[--e]=0;for(var s=new Q,o=new Array;e>2;){for(o[0]=0;0==o[0];)s.nextBytes(o);n[--e]=o[0]}return n[--e]=2,n[--e]=0,new w(n)}(t,this.n.bitLength()+7>>3);if(null==e)return null;var n=this.doPublic(e);if(null==n)return null;var r=n.toString(16);return 0==(1&r.length)?r:"0"+r},nt.prototype.encryptOAEP=function(t,e,n){var r=function(t,e,n,r){var i=ut.crypto.MessageDigest,s=ut.crypto.Util,o=null;if(n||(n="sha1"),"string"==typeof n&&(o=i.getCanonicalAlgName(n),r=i.getHashLength(o),n=function(t){return Et(s.hashHex(Ft(t),o))}),t.length+2*r+2>e)throw"Message too long for RSA";var a,u="";for(a=0;a<e-t.length-2*r-2;a+=1)u+="\0";var c=n("")+u+""+t,l=new Array(r);(new Q).nextBytes(l);var h=et(l,c.length,n),f=[];for(a=0;a<c.length;a+=1)f[a]=c.charCodeAt(a)^h.charCodeAt(a);var p=et(f,l.length,n),d=[0];for(a=0;a<l.length;a+=1)d[a+1]=l[a]^p.charCodeAt(a);return new w(d.concat(f))}(t,this.n.bitLength()+7>>3,e,n);if(null==r)return null;var i=this.doPublic(r);if(null==i)return null;var s=i.toString(16);return 0==(1&s.length)?s:"0"+s},nt.prototype.type="RSA",nt.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),n=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(n)<0;)e=e.add(this.p);return e.subtract(n).multiply(this.coeff).mod(this.p).multiply(this.q).add(n)},nt.prototype.setPrivate=function(t,e,n){if(this.isPrivate=!0,"string"!=typeof t)this.n=t,this.e=e,this.d=n;else{if(!(null!=t&&null!=e&&t.length>0&&e.length>0))throw"Invalid RSA private key";this.n=tt(t,16),this.e=parseInt(e,16),this.d=tt(n,16)}},nt.prototype.setPrivateEx=function(t,e,n,r,i,s,o,a){if(this.isPrivate=!0,this.isPublic=!1,null==t)throw"RSASetPrivateEx N == null";if(null==e)throw"RSASetPrivateEx E == null";if(0==t.length)throw"RSASetPrivateEx N.length == 0";if(0==e.length)throw"RSASetPrivateEx E.length == 0";if(!(null!=t&&null!=e&&t.length>0&&e.length>0))throw"Invalid RSA private key in RSASetPrivateEx";this.n=tt(t,16),this.e=parseInt(e,16),this.d=tt(n,16),this.p=tt(r,16),this.q=tt(i,16),this.dmp1=tt(s,16),this.dmq1=tt(o,16),this.coeff=tt(a,16)},nt.prototype.generate=function(t,e){var n=new Q,r=t>>1;this.e=parseInt(e,16);for(var i=new w(e,16),s=t/2-100,o=w.ONE.shiftLeft(s);;){for(;this.p=new w(t-r,1,n),0!=this.p.subtract(w.ONE).gcd(i).compareTo(w.ONE)||!this.p.isProbablePrime(10););for(;this.q=new w(r,1,n),0!=this.q.subtract(w.ONE).gcd(i).compareTo(w.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var a=this.p;this.p=this.q,this.q=a}var u=this.q.subtract(this.p).abs();if(!(u.bitLength()<s||u.compareTo(o)<=0)){var c=this.p.subtract(w.ONE),l=this.q.subtract(w.ONE),h=c.multiply(l);if(0==h.gcd(i).compareTo(w.ONE)&&(this.n=this.p.multiply(this.q),this.n.bitLength()==t)){this.d=i.modInverse(h),this.dmp1=this.d.mod(c),this.dmq1=this.d.mod(l),this.coeff=this.q.modInverse(this.p);break}}}this.isPrivate=!0},nt.prototype.decrypt=function(t){if(t.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var e=tt(t,16),n=this.doPrivate(e);return null==n?null:
|
|
19
19
|
/*! (c) Tom Wu, Kenji Urushima | http://www-cs-students.stanford.edu/~tjw/jsbn/
|
|
20
20
|
*/
|
|
21
|
-
function(t,e){for(var n=t.toByteArray(),r=0;r<n.length&&0==n[r];)++r;if(n.length-r!=e-1||2!=n[r])return null;for(++r;0!=n[r];)if(++r>=n.length)return null;for(var i="";++r<n.length;){var s=255&n[r];s<128?i+=String.fromCharCode(s):s>191&&s<224?(i+=String.fromCharCode((31&s)<<6|63&n[r+1]),++r):(i+=String.fromCharCode((15&s)<<12|(63&n[r+1])<<6|63&n[r+2]),r+=2)}return i}(n,this.n.bitLength()+7>>3)},nt.prototype.decryptOAEP=function(t,e,n){if(t.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var r=tt(t,16),i=this.doPrivate(r);return null==i?null:function(t,e,n,r){var i=ut.crypto.MessageDigest,s=ut.crypto.Util,o=null;for(n||(n="sha1"),"string"==typeof n&&(o=i.getCanonicalAlgName(n),r=i.getHashLength(o),n=function(t){return Et(s.hashHex(Ft(t),o))}),t=t.toByteArray(),a=0;a<t.length;a+=1)t[a]&=255;for(;t.length<e;)t.unshift(0);if((t=String.fromCharCode.apply(String,t)).length<2*r+2)throw"Cipher too short";var a,u=t.substr(1,r),c=t.substr(r+1),l=rt(c,r,n),h=[];for(a=0;a<u.length;a+=1)h[a]=u.charCodeAt(a)^l.charCodeAt(a);var f=rt(String.fromCharCode.apply(String,h),t.length-r,n),p=[];for(a=0;a<c.length;a+=1)p[a]=c.charCodeAt(a)^f.charCodeAt(a);if((p=String.fromCharCode.apply(String,p)).substr(0,r)!==n(""))throw"Hash mismatch";var d=(p=p.substr(r)).indexOf("");if((-1!=d?p.substr(0,d).lastIndexOf("\0"):-1)+1!=d)throw"Malformed data";return p.substr(d+1)}(i,this.n.bitLength()+7>>3,e,n)},it.prototype.equals=function(t){return t==this||this.q.equals(t.q)&&this.x.equals(t.x)},it.prototype.toBigInteger=function(){return this.x},it.prototype.negate=function(){return new it(this.q,this.x.negate().mod(this.q))},it.prototype.add=function(t){return new it(this.q,this.x.add(t.toBigInteger()).mod(this.q))},it.prototype.subtract=function(t){return new it(this.q,this.x.subtract(t.toBigInteger()).mod(this.q))},it.prototype.multiply=function(t){return new it(this.q,this.x.multiply(t.toBigInteger()).mod(this.q))},it.prototype.square=function(){return new it(this.q,this.x.square().mod(this.q))},it.prototype.divide=function(t){return new it(this.q,this.x.multiply(t.toBigInteger().modInverse(this.q)).mod(this.q))},it.prototype.sqrt=function(){return new it(this.q,this.x.sqrt().mod(this.q))},st.prototype.getX=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))},st.prototype.getY=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))},st.prototype.equals=function(t){return t==this||(this.isInfinity()?t.isInfinity():t.isInfinity()?this.isInfinity():!!t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(
|
|
21
|
+
function(t,e){for(var n=t.toByteArray(),r=0;r<n.length&&0==n[r];)++r;if(n.length-r!=e-1||2!=n[r])return null;for(++r;0!=n[r];)if(++r>=n.length)return null;for(var i="";++r<n.length;){var s=255&n[r];s<128?i+=String.fromCharCode(s):s>191&&s<224?(i+=String.fromCharCode((31&s)<<6|63&n[r+1]),++r):(i+=String.fromCharCode((15&s)<<12|(63&n[r+1])<<6|63&n[r+2]),r+=2)}return i}(n,this.n.bitLength()+7>>3)},nt.prototype.decryptOAEP=function(t,e,n){if(t.length!=Math.ceil(this.n.bitLength()/4))throw new Error("wrong ctext length");var r=tt(t,16),i=this.doPrivate(r);return null==i?null:function(t,e,n,r){var i=ut.crypto.MessageDigest,s=ut.crypto.Util,o=null;for(n||(n="sha1"),"string"==typeof n&&(o=i.getCanonicalAlgName(n),r=i.getHashLength(o),n=function(t){return Et(s.hashHex(Ft(t),o))}),t=t.toByteArray(),a=0;a<t.length;a+=1)t[a]&=255;for(;t.length<e;)t.unshift(0);if((t=String.fromCharCode.apply(String,t)).length<2*r+2)throw"Cipher too short";var a,u=t.substr(1,r),c=t.substr(r+1),l=rt(c,r,n),h=[];for(a=0;a<u.length;a+=1)h[a]=u.charCodeAt(a)^l.charCodeAt(a);var f=rt(String.fromCharCode.apply(String,h),t.length-r,n),p=[];for(a=0;a<c.length;a+=1)p[a]=c.charCodeAt(a)^f.charCodeAt(a);if((p=String.fromCharCode.apply(String,p)).substr(0,r)!==n(""))throw"Hash mismatch";var d=(p=p.substr(r)).indexOf("");if((-1!=d?p.substr(0,d).lastIndexOf("\0"):-1)+1!=d)throw"Malformed data";return p.substr(d+1)}(i,this.n.bitLength()+7>>3,e,n)},it.prototype.equals=function(t){return t==this||this.q.equals(t.q)&&this.x.equals(t.x)},it.prototype.toBigInteger=function(){return this.x},it.prototype.negate=function(){return new it(this.q,this.x.negate().mod(this.q))},it.prototype.add=function(t){return new it(this.q,this.x.add(t.toBigInteger()).mod(this.q))},it.prototype.subtract=function(t){return new it(this.q,this.x.subtract(t.toBigInteger()).mod(this.q))},it.prototype.multiply=function(t){return new it(this.q,this.x.multiply(t.toBigInteger()).mod(this.q))},it.prototype.square=function(){return new it(this.q,this.x.square().mod(this.q))},it.prototype.divide=function(t){return new it(this.q,this.x.multiply(t.toBigInteger().modInverse(this.q)).mod(this.q))},it.prototype.sqrt=function(){return new it(this.q,this.x.sqrt().mod(this.q))},st.prototype.getX=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.x.toBigInteger().multiply(this.zinv).mod(this.curve.q))},st.prototype.getY=function(){return null==this.zinv&&(this.zinv=this.z.modInverse(this.curve.q)),this.curve.fromBigInteger(this.y.toBigInteger().multiply(this.zinv).mod(this.curve.q))},st.prototype.equals=function(t){return t==this||(this.isInfinity()?t.isInfinity():t.isInfinity()?this.isInfinity():!!t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(w.ZERO)&&t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q).equals(w.ZERO))},st.prototype.isInfinity=function(){return null==this.x&&null==this.y||this.z.equals(w.ZERO)&&!this.y.toBigInteger().equals(w.ZERO)},st.prototype.negate=function(){return new st(this.curve,this.x,this.y.negate(),this.z)},st.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(t.z)).mod(this.curve.q),n=t.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(t.z)).mod(this.curve.q);if(w.ZERO.equals(n))return w.ZERO.equals(e)?this.twice():this.curve.getInfinity();var r=new w("3"),i=this.x.toBigInteger(),s=this.y.toBigInteger(),o=(t.x.toBigInteger(),t.y.toBigInteger(),n.square()),a=o.multiply(n),u=i.multiply(o),c=e.square().multiply(this.z),l=c.subtract(u.shiftLeft(1)).multiply(t.z).subtract(a).multiply(n).mod(this.curve.q),h=u.multiply(r).multiply(e).subtract(s.multiply(a)).subtract(c.multiply(e)).multiply(t.z).add(e.multiply(a)).mod(this.curve.q),f=a.multiply(this.z).multiply(t.z).mod(this.curve.q);return new st(this.curve,this.curve.fromBigInteger(l),this.curve.fromBigInteger(h),f)},st.prototype.twice=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=new w("3"),e=this.x.toBigInteger(),n=this.y.toBigInteger(),r=n.multiply(this.z),i=r.multiply(n).mod(this.curve.q),s=this.curve.a.toBigInteger(),o=e.square().multiply(t);w.ZERO.equals(s)||(o=o.add(this.z.square().multiply(s)));var a=(o=o.mod(this.curve.q)).square().subtract(e.shiftLeft(3).multiply(i)).shiftLeft(1).multiply(r).mod(this.curve.q),u=o.multiply(t).multiply(e).subtract(i.shiftLeft(1)).shiftLeft(2).multiply(i).subtract(o.square().multiply(o)).mod(this.curve.q),c=r.square().multiply(r).shiftLeft(3).mod(this.curve.q);return new st(this.curve,this.curve.fromBigInteger(a),this.curve.fromBigInteger(u),c)},st.prototype.multiply=function(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,n=t,r=n.multiply(new w("3")),i=this.negate(),s=this,o=this.curve.q.subtract(t),a=o.multiply(new w("3")),u=new st(this.curve,this.x,this.y),c=u.negate();for(e=r.bitLength()-2;e>0;--e){s=s.twice();var l=r.testBit(e);l!=n.testBit(e)&&(s=s.add(l?this:i))}for(e=a.bitLength()-2;e>0;--e){u=u.twice();var h=a.testBit(e);h!=o.testBit(e)&&(u=u.add(h?u:c))}return s},st.prototype.multiplyTwo=function(t,e,n){var r;r=t.bitLength()>n.bitLength()?t.bitLength()-1:n.bitLength()-1;for(var i=this.curve.getInfinity(),s=this.add(e);r>=0;)i=i.twice(),t.testBit(r)?i=n.testBit(r)?i.add(s):i.add(this):n.testBit(r)&&(i=i.add(e)),--r;return i},ot.prototype.getQ=function(){return this.q},ot.prototype.getA=function(){return this.a},ot.prototype.getB=function(){return this.b},ot.prototype.equals=function(t){return t==this||this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)},ot.prototype.getInfinity=function(){return this.infinity},ot.prototype.fromBigInteger=function(t){return new it(this.q,t)},ot.prototype.decodePointHex=function(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:var e=t.substr(0,2),n=(t.substr(2),this.fromBigInteger(new w(a,16))),r=this.getA(),i=this.getB(),s=n.square().add(r).multiply(n).add(i).sqrt();return"03"==e&&(s=s.negate()),new st(this,n,s);case 4:case 6:case 7:var o=(t.length-2)/2,a=t.substr(2,o),u=t.substr(o+2,o);return new st(this,this.fromBigInteger(new w(a,16)),this.fromBigInteger(new w(u,16)));default:return null}},
|
|
22
22
|
/*! (c) Stefan Thomas | https://github.com/bitcoinjs/bitcoinjs-lib
|
|
23
23
|
*/
|
|
24
|
-
it.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},st.prototype.getEncoded=function(t){var e=function(t,e){var n=t.toByteArrayUnsigned();if(e<n.length)n=n.slice(n.length-e);else for(;e>n.length;)n.unshift(0);return n},n=this.getX().toBigInteger(),r=this.getY().toBigInteger(),i=e(n,32);return t?r.isEven()?i.unshift(2):i.unshift(3):(i.unshift(4),i=i.concat(e(r,32))),i},st.decodeFrom=function(t,e){e[0];var n=e.length-1,r=e.slice(1,1+n/2),i=e.slice(1+n/2,1+n);r.unshift(0),i.unshift(0);var s=new
|
|
24
|
+
it.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},st.prototype.getEncoded=function(t){var e=function(t,e){var n=t.toByteArrayUnsigned();if(e<n.length)n=n.slice(n.length-e);else for(;e>n.length;)n.unshift(0);return n},n=this.getX().toBigInteger(),r=this.getY().toBigInteger(),i=e(n,32);return t?r.isEven()?i.unshift(2):i.unshift(3):(i.unshift(4),i=i.concat(e(r,32))),i},st.decodeFrom=function(t,e){e[0];var n=e.length-1,r=e.slice(1,1+n/2),i=e.slice(1+n/2,1+n);r.unshift(0),i.unshift(0);var s=new w(r),o=new w(i);return new st(t,t.fromBigInteger(s),t.fromBigInteger(o))},st.decodeFromHex=function(t,e){e.substr(0,2);var n=e.length-2,r=e.substr(2,n/2),i=e.substr(2+n/2,n/2),s=new w(r,16),o=new w(i,16);return new st(t,t.fromBigInteger(s),t.fromBigInteger(o))},st.prototype.add2D=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;if(this.x.equals(t.x))return this.y.equals(t.y)?this.twice():this.curve.getInfinity();var e=t.x.subtract(this.x),n=t.y.subtract(this.y).divide(e),r=n.square().subtract(this.x).subtract(t.x),i=n.multiply(this.x.subtract(r)).subtract(this.y);return new st(this.curve,r,i)},st.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var t=this.curve.fromBigInteger(w.valueOf(2)),e=this.curve.fromBigInteger(w.valueOf(3)),n=this.x.square().multiply(e).add(this.curve.a).divide(this.y.multiply(t)),r=n.square().subtract(this.x.multiply(t)),i=n.multiply(this.x.subtract(r)).subtract(this.y);return new st(this.curve,r,i)},st.prototype.multiply2D=function(t){if(this.isInfinity())return this;if(0==t.signum())return this.curve.getInfinity();var e,n=t,r=n.multiply(new w("3")),i=this.negate(),s=this;for(e=r.bitLength()-2;e>0;--e){s=s.twice();var o=r.testBit(e);o!=n.testBit(e)&&(s=s.add2D(o?this:i))}return s},st.prototype.isOnCurve=function(){var t=this.getX().toBigInteger(),e=this.getY().toBigInteger(),n=this.curve.getA().toBigInteger(),r=this.curve.getB().toBigInteger(),i=this.curve.getQ(),s=e.multiply(e).mod(i),o=t.multiply(t).multiply(t).add(n.multiply(t)).add(r).mod(i);return s.equals(o)},st.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},st.prototype.validate=function(){var t=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var e=this.getX().toBigInteger(),n=this.getY().toBigInteger();if(e.compareTo(w.ONE)<0||e.compareTo(t.subtract(w.ONE))>0)throw new Error("x coordinate out of bounds");if(n.compareTo(w.ONE)<0||n.compareTo(t.subtract(w.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(t).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};
|
|
25
25
|
/*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval
|
|
26
26
|
*/
|
|
27
|
-
var at=function(){var t=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),e=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),n={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function r(t,e,r){return e?n[e]:String.fromCharCode(parseInt(r,16))}var i=new String(""),s=Object.hasOwnProperty;return function(n,o){var a,u,c=n.match(t),l=c[0],h=!1;"{"===l?a={}:"["===l?a=[]:(a=[],h=!0);for(var f=[a],p=1-h,d=c.length;p<d;++p){var g;switch((l=c[p]).charCodeAt(0)){default:(g=f[0])[u||g.length]=+l,u=void 0;break;case 34:if(-1!==(l=l.substring(1,l.length-1)).indexOf("\\")&&(l=l.replace(e,r)),g=f[0],!u){if(!(g instanceof Array)){u=l||i;break}u=g.length}g[u]=l,u=void 0;break;case 91:g=f[0],f.unshift(g[u||g.length]=[]),u=void 0;break;case 93:f.shift();break;case 102:(g=f[0])[u||g.length]=!1,u=void 0;break;case 110:(g=f[0])[u||g.length]=null,u=void 0;break;case 116:(g=f[0])[u||g.length]=!0,u=void 0;break;case 123:g=f[0],f.unshift(g[u||g.length]={}),u=void 0;break;case 125:f.shift()}}if(h){if(1!==f.length)throw new Error;a=a[0]}else if(f.length)throw new Error;if(o){var m=function(t,e){var n=t[e];if(n&&"object"==typeof n){var r=null;for(var i in n)if(s.call(n,i)&&n!==t){var a=m(n,i);void 0!==a?n[i]=a:(r||(r=[]),r.push(i))}if(r)for(var u=r.length;--u>=0;)delete n[r[u]]}return o.call(t,e,n)};a=m({"":a},"")}return a}}();void 0!==ut&&ut||(ut={}),void 0!==ut.asn1&&ut.asn1||(ut.asn1={}),ut.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1))e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var n=e.substr(1).length;n%2==1?n+=1:e.match(/^[0-7]/)||(n+=2);for(var r="",i=0;i<n;i++)r+="f";e=new x(r,16).xor(t).add(x.ONE).toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){return It(t,e)},this.newObject=function(t){var e=ut.asn1,n=e.ASN1Object,r=e.DERBoolean,i=e.DERInteger,s=e.DERBitString,o=e.DEROctetString,a=e.DERNull,u=e.DERObjectIdentifier,c=e.DEREnumerated,l=e.DERUTF8String,h=e.DERNumericString,f=e.DERPrintableString,p=e.DERTeletexString,d=e.DERIA5String,g=e.DERUTCTime,m=e.DERGeneralizedTime,v=e.DERVisibleString,y=e.DERBMPString,b=e.DERSequence,w=e.DERSet,x=e.DERTaggedObject,S=e.ASN1Util.newObject;if(t instanceof e.ASN1Object)return t;var E=Object.keys(t);if(1!=E.length)throw new Error("key of param shall be only one.");var F=E[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+F+":"))throw new Error("undefined key: "+F);if("bool"==F)return new r(t[F]);if("int"==F)return new i(t[F]);if("bitstr"==F)return new s(t[F]);if("octstr"==F)return new o(t[F]);if("null"==F)return new a(t[F]);if("oid"==F)return new u(t[F]);if("enum"==F)return new c(t[F]);if("utf8str"==F)return new l(t[F]);if("numstr"==F)return new h(t[F]);if("prnstr"==F)return new f(t[F]);if("telstr"==F)return new p(t[F]);if("ia5str"==F)return new d(t[F]);if("utctime"==F)return new g(t[F]);if("gentime"==F)return new m(t[F]);if("visstr"==F)return new v(t[F]);if("bmpstr"==F)return new y(t[F]);if("asn1"==F)return new n(t[F]);if("seq"==F){for(var A=t[F],C=[],D=0;D<A.length;D++){var I=S(A[D]);C.push(I)}return new b({array:C})}if("set"==F){for(A=t[F],C=[],D=0;D<A.length;D++){I=S(A[D]);C.push(I)}return new w({array:C})}if("tag"==F){var $=t[F];if("[object Array]"===Object.prototype.toString.call($)&&3==$.length){var R=S($[2]);return new x({tag:$[0],explicit:$[1],obj:R})}return new x($)}},this.jsonToASN1HEX=function(t){return this.newObject(t).tohex()}},ut.asn1.ASN1Util.oidHexToInt=function(t){for(var e="",n=parseInt(t.substr(0,2),16),r=(e=Math.floor(n/40)+"."+n%40,""),i=2;i<t.length;i+=2){var s=("00000000"+parseInt(t.substr(i,2),16).toString(2)).slice(-8);if(r+=s.substr(1,7),"0"==s.substr(0,1))e=e+"."+new x(r,2).toString(10),r=""}return e},ut.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},n=function(t){var n="",r=new x(t,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var s="",o=0;o<i;o++)s+="0";r=s+r;for(o=0;o<r.length-1;o+=7){var a=r.substr(o,7);o!=r.length-7&&(a="1"+a),n+=e(parseInt(a,2))}return n};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var r="",i=t.split("."),s=40*parseInt(i[0])+parseInt(i[1]);r+=e(s),i.splice(0,2);for(var o=0;o<i.length;o++)r+=n(i[o]);return r},ut.asn1.ASN1Object=function(t){this.params=null,this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw new Error("this.hV is null or undefined");if(this.hV.length%2==1)throw new Error("value hex must be even length: n="+"".length+",v="+this.hV);var t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var n=e.length/2;if(n>15)throw new Error("ASN.1 length too long to represent by 8x: n = "+t.toString(16));return(128+n).toString(16)+e},this.tohex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.getValueHex=function(){return this.tohex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(t){this.params=t},null!=t&&null!=t.tlv&&(this.hTLV=t.tlv,this.isModified=!1)},ut.asn1.DERAbstractString=function(t){ut.asn1.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=wt(this.s).toLowerCase()},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},Zt(ut.asn1.DERAbstractString,ut.asn1.ASN1Object),ut.asn1.DERAbstractTime=function(t){ut.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(t){var e=t.getTime()+6e4*t.getTimezoneOffset();return new Date(e)},this.formatDate=function(t,e,n){var r=this.zeroPadding,i=this.localDateToUTC(t),s=String(i.getFullYear());"utc"==e&&(s=s.substr(2,2));var o=s+r(String(i.getMonth()+1),2)+r(String(i.getDate()),2)+r(String(i.getHours()),2)+r(String(i.getMinutes()),2)+r(String(i.getSeconds()),2);if(!0===n){var a=i.getMilliseconds();if(0!=a){var u=r(String(a),3);o=o+"."+(u=u.replace(/[0]+$/,""))}}return o+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.setByParam=function(t){this.hV=null,this.hTLV=null,this.params=t},this.getString=function(){},this.setString=function(t){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.str=t},this.setByDate=function(t){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.date=t},this.setByDateValue=function(t,e,n,r,i,s){var o=new Date(Date.UTC(t,e-1,n,r,i,s,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},Zt(ut.asn1.DERAbstractTime,ut.asn1.ASN1Object),ut.asn1.DERAbstractStructured=function(t){ut.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},Zt(ut.asn1.DERAbstractStructured,ut.asn1.ASN1Object),ut.asn1.DERBoolean=function(t){ut.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==t?"010100":"0101ff"},Zt(ut.asn1.DERBoolean,ut.asn1.ASN1Object),ut.asn1.DERInteger=function(t){ut.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=ut.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new x(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},Zt(ut.asn1.DERInteger,ut.asn1.ASN1Object),ut.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=ut.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.tohex()}ut.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var n="0"+t;this.hTLV=null,this.isModified=!0,this.hV=n+e},this.setByBinaryString=function(t){var e=8-(t=t.replace(/0+$/,"")).length%8;8==e&&(e=0),t+="0000000".substr(0,e);for(var n="",r=0;r<t.length-1;r+=8){var i=t.substr(r,8),s=parseInt(i,2).toString(16);1==s.length&&(s="0"+s),n+=s}this.hTLV=null,this.isModified=!0,this.hV="0"+e+n},this.setByBooleanArray=function(t){for(var e="",n=0;n<t.length;n++)1==t[n]?e+="1":e+="0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=!1;return e},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):void 0!==t.hex?this.setHexValueIncludingUnusedBits(t.hex):void 0!==t.bin?this.setByBinaryString(t.bin):void 0!==t.array&&this.setByBooleanArray(t.array))},Zt(ut.asn1.DERBitString,ut.asn1.ASN1Object),ut.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=ut.asn1.ASN1Util.newObject(t.obj);t.hex=e.tohex()}ut.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},Zt(ut.asn1.DEROctetString,ut.asn1.DERAbstractString),ut.asn1.DERNull=function(){ut.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},Zt(ut.asn1.DERNull,ut.asn1.ASN1Object),ut.asn1.DERObjectIdentifier=function(t){ut.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){var e=Kt(t);if(null==e)throw new Error("malformed oid string: "+t);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueName=function(t){var e=ut.asn1.x509.OID.name2oid(t);if(""===e)throw new Error("DERObjectIdentifier oidName undefined: "+t);this.setValueOidString(e)},this.setValueNameOrOid=function(t){t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(t){"string"==typeof t?this.setValueNameOrOid(t):void 0!==t.oid?this.setValueNameOrOid(t.oid):void 0!==t.name?this.setValueNameOrOid(t.name):void 0!==t.hex&&this.setValueHex(t.hex)},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.DERObjectIdentifier,ut.asn1.ASN1Object),ut.asn1.DEREnumerated=function(t){ut.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=ut.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new x(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},Zt(ut.asn1.DEREnumerated,ut.asn1.ASN1Object),ut.asn1.DERUTF8String=function(t){ut.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},Zt(ut.asn1.DERUTF8String,ut.asn1.DERAbstractString),ut.asn1.DERNumericString=function(t){ut.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},Zt(ut.asn1.DERNumericString,ut.asn1.DERAbstractString),ut.asn1.DERPrintableString=function(t){ut.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},Zt(ut.asn1.DERPrintableString,ut.asn1.DERAbstractString),ut.asn1.DERTeletexString=function(t){ut.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},Zt(ut.asn1.DERTeletexString,ut.asn1.DERAbstractString),ut.asn1.DERIA5String=function(t){ut.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},Zt(ut.asn1.DERIA5String,ut.asn1.DERAbstractString),ut.asn1.DERVisibleString=function(t){ut.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="1a"},Zt(ut.asn1.DERVisibleString,ut.asn1.DERAbstractString),ut.asn1.DERBMPString=function(t){ut.asn1.DERBMPString.superclass.constructor.call(this,t),this.hT="1e"},Zt(ut.asn1.DERBMPString,ut.asn1.DERAbstractString),ut.asn1.DERUTCTime=function(t){ut.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.params=void 0,this.getFreshValueHex=function(){var t=this.params;if(null==this.params&&(t={date:new Date}),"string"==typeof t){if(!t.match(/^[0-9]{12}Z$/)&&!t.match(/^[0-9]{12}\.[0-9]+Z$/))throw new Error("malformed string for UTCTime: "+t);this.hV=gt(t)}else if(null!=t.str)this.hV=gt(t.str);else if(null==t.date&&1==t.millis){var e=new Date;this.hV=gt(this.formatDate(e,"utc",!0))}else if(null!=t.date&&t.date instanceof Date){var n=!0===t.millis;this.hV=gt(this.formatDate(t.date,"utc",n))}else t instanceof Date&&(this.hV=gt(this.formatDate(t,"utc")));if(null==this.hV)throw new Error("parameter not specified properly for UTCTime");return this.hV},null!=t&&this.setByParam(t)},Zt(ut.asn1.DERUTCTime,ut.asn1.DERAbstractTime),ut.asn1.DERGeneralizedTime=function(t){ut.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.params=t,this.getFreshValueHex=function(){var t=this.params;if(null==this.params&&(t={date:new Date}),"string"==typeof t){if(!t.match(/^[0-9]{14}Z$/)&&!t.match(/^[0-9]{14}\.[0-9]+Z$/))throw new Error("malformed string for GeneralizedTime: "+t);this.hV=gt(t)}else if(null!=t.str)this.hV=gt(t.str);else if(null==t.date&&1==t.millis){var e=new Date;this.hV=gt(this.formatDate(e,"gen",!0))}else if(null!=t.date&&t.date instanceof Date){var n=!0===t.millis;this.hV=gt(this.formatDate(t.date,"gen",n))}else t instanceof Date&&(this.hV=gt(this.formatDate(t,"gen")));if(null==this.hV)throw new Error("parameter not specified properly for GeneralizedTime");return this.hV},null!=t&&this.setByParam(t)},Zt(ut.asn1.DERGeneralizedTime,ut.asn1.DERAbstractTime),ut.asn1.DERSequence=function(t){ut.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++){t+=this.asn1Array[e].tohex()}return this.hV=t,this.hV}},Zt(ut.asn1.DERSequence,ut.asn1.DERAbstractStructured),ut.asn1.DERSet=function(t){ut.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var n=this.asn1Array[e];t.push(n.tohex())}return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},void 0!==t&&void 0!==t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},Zt(ut.asn1.DERSet,ut.asn1.DERAbstractStructured),ut.asn1.DERTaggedObject=function(t){ut.asn1.DERTaggedObject.superclass.constructor.call(this);var e=ut.asn1,n=ht,r=n.getV,i=(n.isASN1HEX,e.ASN1Util.newObject);this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.params={tag:"a0",explicit:!0},this.setASN1Object=function(t,e,n){this.params={tag:e,explicit:t,obj:n}},this.getFreshValueHex=function(){var t=this.params;if(null==t.explicit&&(t.explicit=!0),null!=t.tage&&(t.tag=t.tage,t.explicit=!0),null!=t.tagi&&(t.tag=t.tagi,t.explicit=!1),null!=t.str)this.hV=wt(t.str);else if(null!=t.hex)this.hV=t.hex;else{if(null==t.obj)throw new Error("str, hex nor obj not specified");var n;t.obj instanceof e.ASN1Object?n=t.obj.tohex():"object"==typeof t.obj&&(n=i(t.obj).tohex()),t.explicit?this.hV=n:this.hV=r(n,0)}return null==t.tag&&(t.tag="a0"),this.hT=t.tag,this.hTLV=null,this.isModified=!0,this.hV},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.DERTaggedObject,ut.asn1.ASN1Object);var ut,ct,lt,ht=new function(){};function ft(t){for(var e=new Array,n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function pt(t){for(var e="",n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e}function dt(t){for(var e="",n=0;n<t.length;n++){var r=t[n].toString(16);1==r.length&&(r="0"+r),e+=r}return e}function gt(t){return dt(ft(t))}function mt(t){return t=(t=(t=t.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function vt(t){return t.length%4==2?t+="==":t.length%4==3&&(t+="="),t=(t=t.replace(/-/g,"+")).replace(/_/g,"/")}function yt(t){return t.length%2==1&&(t="0"+t),mt(y(t))}function bt(t){return b(vt(t))}function wt(t){return _t(Mt(t)).toLowerCase()}function xt(t){try{return decodeURIComponent(Pt(t))}catch(t){return null}}function St(t){return xt(function(t){for(var e=t.match(/.{1,2}/g),n=[],r=0;r<e.length;r++){var i=parseInt(e[r],16);161<=i&&i<=191?(n.push("c2"),n.push(e[r])):192<=i&&i<=255?(n.push("c3"),n.push((i-64).toString(16))):n.push(e[r])}return n.join("")}(t))}function Et(t){for(var e="",n=0;n<t.length-1;n+=2)e+=String.fromCharCode(parseInt(t.substr(n,2),16));return e}function Ft(t){for(var e="",n=0;n<t.length;n++)e+=("0"+t.charCodeAt(n).toString(16)).slice(-2);return e}function At(t){return y(t)}function Ct(t){var e=At(t).replace(/(.{64})/g,"$1\r\n");return e=e.replace(/\r\n$/,"")}function Dt(t){return b(t.replace(/[^0-9A-Za-z\/+=]*/g,""))}function It(t,e){return"-----BEGIN "+e+"-----\r\n"+Ct(t)+"\r\n-----END "+e+"-----\r\n"}function $t(t,e){if(-1==t.indexOf("-----BEGIN "))throw"can't find PEM header: "+e;return Dt(t=void 0!==e?(t=t.replace(new RegExp("^[^]*-----BEGIN "+e+"-----"),"")).replace(new RegExp("-----END "+e+"-----[^]*$"),""):(t=t.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function Rt(t){var e,n,r,i,s,o,a,u,c,l,h;if(h=t.match(/^(\d{2}|\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return u=h[1],e=parseInt(u),2===u.length&&(50<=e&&e<100?e=1900+e:0<=e&&e<50&&(e=2e3+e)),n=parseInt(h[2])-1,r=parseInt(h[3]),i=parseInt(h[4]),s=parseInt(h[5]),o=parseInt(h[6]),a=0,""!==(c=h[7])&&(l=(c.substr(1)+"00").substr(0,3),a=parseInt(l)),Date.UTC(e,n,r,i,s,o,a);throw new Error("unsupported zulu format: "+t)}function Tt(t){return Math.round(Rt(t)/1e3)}function _t(t){return t.replace(/%/g,"")}function Pt(t){return t.replace(/(..)/g,"%$1")}function kt(t){var e="malformed IPv6 address";if(!t.match(/^[0-9A-Fa-f:]+$/))throw e;var n=(t=t.toLowerCase()).split(":").length-1;if(n<2)throw e;var r=":".repeat(7-n+2),i=(t=t.replace("::",r)).split(":");if(8!=i.length)throw e;for(var s=0;s<8;s++)i[s]=("0000"+i[s]).slice(-4);return i.join("")}function Ot(t){if(!t.match(/^[0-9A-Fa-f]{32}$/))throw new Error("malformed IPv6 address: "+t);var e=(t=t.toLowerCase()).match(/.{1,4}/g),n=(t=":"+(e=(e=e.map((function(t){return t.replace(/^0+/,"")}))).map((function(t){return""==t?"0":t}))).join(":")+":").match(/:(0:){2,}/g);if(null==n)return t.slice(1,-1);var r=n.sort().slice(-1)[0];return"::"!=(t=t.replace(r.substr(0,r.length-1),":")).substr(0,2)&&(t=t.substr(1)),"::"!=t.substr(-2,2)&&(t=t.substr(0,t.length-1)),t}function jt(t){var e=new Error("malformed hex value");if(!t.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw e;if(8==t.length){try{return parseInt(t.substr(0,2),16)+"."+parseInt(t.substr(2,2),16)+"."+parseInt(t.substr(4,2),16)+"."+parseInt(t.substr(6,2),16)}catch(t){throw e}}else{if(16!=t.length){if(32==t.length)return Ot(t);if(64==t.length){try{return Ot(t.substr(0,32))+"/"+Bt(t.substr(32))}catch(t){throw e}return}return t}try{return jt(t.substr(0,8))+"/"+Bt(t.substr(8))}catch(t){throw e}}}function Bt(t){var e,n=new Error("malformed mask");try{e=new x(t,16).toString(2)}catch(t){throw n}if(!e.match(/^1*0*$/))throw n;return e.replace(/0+$/,"").length}function Nt(t){var e=new Error("malformed IP address");if(!(t=t.toLowerCase(t)).match(/^[0-9a-f.:/]+$/))throw e;if(!t.match(/^[0-9.]+$/)){var n;if(t.match(/^[0-9.]+\/[0-9]+$/))return Nt((n=t.split("/"))[0])+Lt(parseInt(n[1]),32);if(t.match(/^[0-9a-f:]+$/)&&-1!==t.indexOf(":"))return kt(t);if(t.match(/^[0-9a-f:]+\/[0-9]+$/)&&-1!==t.indexOf(":"))return kt((n=t.split("/"))[0])+Lt(parseInt(n[1]),128);throw e}var r=t.split(".");if(4!==r.length)throw e;var i="";try{for(var s=0;s<4;s++){i+=("0"+parseInt(r[s]).toString(16)).slice(-2)}return i}catch(t){throw e}}function Lt(t,e){return 32==e&&0==t?"00000000":128==e&&0==t?"00000000000000000000000000000000":new x(Array(t+1).join("1")+Array(e-t+1).join("0"),2).toString(16)}function Ht(t){return t.match(/.{4}/g).map((function(t){var e=parseInt(t.substr(0,2),16),n=parseInt(t.substr(2),16);if(0==e&n<128)return String.fromCharCode(n);if(e<8){var r=128|63&n;return xt((192|(7&e)<<3|(192&n)>>6).toString(16)+r.toString(16))}r=128|(15&e)<<2|(192&n)>>6;var i=128|63&n;return xt((224|(240&e)>>4).toString(16)+r.toString(16)+i.toString(16))})).join("")}function Mt(t){for(var e=encodeURIComponent(t),n="",r=0;r<e.length;r++)"%"==e[r]?(n+=e.substr(r,3),r+=2):n=n+"%"+gt(e[r]);return n}function Ut(t){return!(t.length%2!=0||!t.match(/^[0-9a-f]+$/)&&!t.match(/^[0-9A-F]+$/))}function Vt(t){return!!t.match(/^[0-9A-Za-z-_.]+$/)}function qt(t){return t.length%2==1?"0"+t:t.substr(0,1)>"7"?"00"+t:t}ht.getLblen=function(t,e){if("8"!=t.substr(e+2,1))return 1;var n=parseInt(t.substr(e+3,1));return 0==n?-1:0<n&&n<10?n+1:-2},ht.getL=function(t,e){var n=ht.getLblen(t,e);return n<1?"":t.substr(e+2,2*n)},ht.getVblen=function(t,e){var n;return""==(n=ht.getL(t,e))?-1:("8"===n.substr(0,1)?new x(n.substr(2),16):new x(n,16)).intValue()},ht.getVidx=function(t,e){var n=ht.getLblen(t,e);return n<0?n:e+2*(n+1)},ht.getV=function(t,e){var n=ht.getVidx(t,e),r=ht.getVblen(t,e);return t.substr(n,2*r)},ht.getTLV=function(t,e){return t.substr(e,2)+ht.getL(t,e)+ht.getV(t,e)},ht.getTLVblen=function(t,e){return 2+2*ht.getLblen(t,e)+2*ht.getVblen(t,e)},ht.getNextSiblingIdx=function(t,e){return ht.getVidx(t,e)+2*ht.getVblen(t,e)},ht.getChildIdx=function(t,e){var n,r,i,s=ht,o=[];n=s.getVidx(t,e),r=2*s.getVblen(t,e),"03"==t.substr(e,2)&&(n+=2,r-=2),i=0;for(var a=n;i<=r;){var u=s.getTLVblen(t,a);if((i+=u)<=r&&o.push(a),a+=u,i>=r)break}return o},ht.getNthChildIdx=function(t,e,n){return ht.getChildIdx(t,e)[n]},ht.getIdxbyList=function(t,e,n,r){var i,s,o=ht;return 0==n.length?void 0!==r&&t.substr(e,2)!==r?-1:e:(i=n.shift())>=(s=o.getChildIdx(t,e)).length?-1:o.getIdxbyList(t,s[i],n,r)},ht.getIdxbyListEx=function(t,e,n,r){var i,s,o=ht;if(0==n.length)return void 0!==r&&t.substr(e,2)!==r?-1:e;i=n.shift(),s=o.getChildIdx(t,e);for(var a=0,u=0;u<s.length;u++){var c=t.substr(s[u],2);if("number"==typeof i&&!o.isContextTag(c)&&a==i||"string"==typeof i&&o.isContextTag(c,i))return o.getIdxbyListEx(t,s[u],n,r);o.isContextTag(c)||a++}return-1},ht.getTLVbyList=function(t,e,n,r){var i=ht,s=i.getIdxbyList(t,e,n,r);return-1==s||s>=t.length?null:i.getTLV(t,s)},ht.getTLVbyListEx=function(t,e,n,r){var i=ht,s=i.getIdxbyListEx(t,e,n,r);return-1==s?null:i.getTLV(t,s)},ht.getVbyList=function(t,e,n,r,i){var s,o,a=ht;return-1==(s=a.getIdxbyList(t,e,n,r))||s>=t.length?null:(o=a.getV(t,s),!0===i&&(o=o.substr(2)),o)},ht.getVbyListEx=function(t,e,n,r,i){var s,o,a=ht;return-1==(s=a.getIdxbyListEx(t,e,n,r))?null:(o=a.getV(t,s),"03"==t.substr(s,2)&&!1!==i&&(o=o.substr(2)),o)},ht.getInt=function(t,e,n){null==n&&(n=-1);try{var r=t.substr(e,2);if("02"!=r&&"03"!=r)return n;var i=ht.getV(t,e);return"02"==r?parseInt(i,16):Wt(i)}catch(t){return n}},ht.getOID=function(t,e,n){null==n&&(n=null);try{return"06"!=t.substr(e,2)?n:zt(ht.getV(t,e))}catch(t){return n}},ht.getOIDName=function(t,e,n){null==n&&(n=null);try{var r=ht.getOID(t,e,n);if(r==n)return n;var i=ut.asn1.x509.OID.oid2name(r);return""==i?r:i}catch(t){return n}},ht.getString=function(t,e,n){null==n&&(n=null);try{return Et(ht.getV(t,e))}catch(t){return n}},ht.hextooidstr=function(t){var e=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},n=[],r=t.substr(0,2),i=parseInt(r,16);n[0]=new String(Math.floor(i/40)),n[1]=new String(i%40);for(var s=t.substr(2),o=[],a=0;a<s.length/2;a++)o.push(parseInt(s.substr(2*a,2),16));var u=[],c="";for(a=0;a<o.length;a++)128&o[a]?c+=e((127&o[a]).toString(2),7):(c+=e((127&o[a]).toString(2),7),u.push(new String(parseInt(c,2))),c="");var l=n.join(".");return u.length>0&&(l=l+"."+u.join(".")),l},ht.dump=function(t,e,n,r){var i=ht,s=i.getV,o=i.dump,a=i.getChildIdx,u=t;t instanceof ut.asn1.ASN1Object&&(u=t.tohex());var c=function(t,e){return t.length<=2*e?t:t.substr(0,e)+"..(total "+t.length/2+"bytes).."+t.substr(t.length-e,e)};void 0===e&&(e={ommit_long_octet:32}),void 0===n&&(n=0),void 0===r&&(r="");var l,h=e.ommit_long_octet;if("01"==(l=u.substr(n,2)))return"00"==(f=s(u,n))?r+"BOOLEAN FALSE\n":r+"BOOLEAN TRUE\n";if("02"==l)return r+"INTEGER "+c(f=s(u,n),h)+"\n";if("03"==l){var f=s(u,n);if(i.isASN1HEX(f.substr(2))){var p=r+"BITSTRING, encapsulates\n";return p+=o(f.substr(2),e,0,r+" ")}return r+"BITSTRING "+c(f,h)+"\n"}if("04"==l){f=s(u,n);if(i.isASN1HEX(f)){p=r+"OCTETSTRING, encapsulates\n";return p+=o(f,e,0,r+" ")}return r+"OCTETSTRING "+c(f,h)+"\n"}if("05"==l)return r+"NULL\n";if("06"==l){var d=s(u,n),g=ut.asn1.ASN1Util.oidHexToInt(d),m=ut.asn1.x509.OID.oid2name(g),v=g.replace(/\./g," ");return""!=m?r+"ObjectIdentifier "+m+" ("+v+")\n":r+"ObjectIdentifier ("+v+")\n"}if("0a"==l)return r+"ENUMERATED "+parseInt(s(u,n))+"\n";if("0c"==l)return r+"UTF8String '"+xt(s(u,n))+"'\n";if("13"==l)return r+"PrintableString '"+xt(s(u,n))+"'\n";if("14"==l)return r+"TeletexString '"+xt(s(u,n))+"'\n";if("16"==l)return r+"IA5String '"+xt(s(u,n))+"'\n";if("17"==l)return r+"UTCTime "+xt(s(u,n))+"\n";if("18"==l)return r+"GeneralizedTime "+xt(s(u,n))+"\n";if("1a"==l)return r+"VisualString '"+xt(s(u,n))+"'\n";if("1e"==l)return r+"BMPString '"+Ht(s(u,n))+"'\n";if("30"==l){if("3000"==u.substr(n,4))return r+"SEQUENCE {}\n";p=r+"SEQUENCE\n";var y=e;if((2==(x=a(u,n)).length||3==x.length)&&"06"==u.substr(x[0],2)&&"04"==u.substr(x[x.length-1],2)){m=i.oidname(s(u,x[0]));var b=JSON.parse(JSON.stringify(e));b.x509ExtName=m,y=b}for(var w=0;w<x.length;w++)p+=o(u,y,x[w],r+" ");return p}if("31"==l){p=r+"SET\n";var x=a(u,n);for(w=0;w<x.length;w++)p+=o(u,e,x[w],r+" ");return p}if(0!=(128&(l=parseInt(l,16)))){var S=31&l;if(0!=(32&l)){for(p=r+"["+S+"]\n",x=a(u,n),w=0;w<x.length;w++)p+=o(u,e,x[w],r+" ");return p}f=s(u,n);if(ht.isASN1HEX(f)){var p=r+"["+S+"]\n";return p+=o(f,e,0,r+" ")}return("68747470"==f.substr(0,8)||"subjectAltName"===e.x509ExtName&&2==S)&&(f=xt(f)),p=r+"["+S+"] "+f+"\n"}return r+"UNKNOWN("+l+") "+s(u,n)+"\n"},ht.parse=function(t){var e=ht,n=e.parse,r=e.isASN1HEX,i=e.getV,s=e.getTLV,o=e.getChildIdx,a=ut.asn1,u=a.ASN1Util.oidHexToInt,c=a.x509.OID.oid2name,l=xt,h=Ht,f=St,p={"0c":"utf8str",12:"numstr",13:"prnstr",14:"telstr",16:"ia5str",17:"utctime",18:"gentime","1a":"visstr","1e":"bmpstr",30:"seq",31:"set"},d=t.substr(0,2),g={},m=i(t,0);if("01"==d)return"0101ff"==t?{bool:!0}:{bool:!1};if("02"==d)return{int:{hex:m}};if("03"==d)try{if("00"!=m.substr(0,2))throw"not encap";var v=m.substr(2);if(!r(v))throw"not encap";return{bitstr:{obj:n(v)}}}catch(t){var y=null;return m.length<=10&&(y=Xt(m)),null==y?{bitstr:{hex:m}}:{bitstr:{bin:y}}}else if("04"==d)try{if(!r(m))throw"not encap";return{octstr:{obj:n(m)}}}catch(t){return{octstr:{hex:m}}}else{if("05"==d)return{null:""};if("06"==d){var b=u(m),w=c(b);return""==w?{oid:b}:{oid:w}}if("0a"==d)return m.length>4?{enum:{hex:m}}:{enum:parseInt(m,16)};if("30"==d||"31"==d)return g[p[d]]=function(t){for(var e=[],r=o(t,0),i=0;i<r.length;i++){var a=r[i],u=s(t,a),c=n(u);e.push(c)}return e}(t),g;if("14"==d){var x=f(m);return g[p[d]]={str:x},g}if("1e"==d){x=h(m);return g[p[d]]={str:x},g}if(-1!=":0c:12:13:16:17:18:1a:".indexOf(d)){x=l(m);return g[p[d]]={str:x},g}if(d.match(/^8[0-9]$/))return null==(x=l(m))|""==x||null!=x.match(/[\x00-\x1F\x7F-\x9F]/)||null!=x.match(/[\u0000-\u001F\u0080–\u009F]/)?{tag:{tag:d,explicit:!1,hex:m}}:{tag:{tag:d,explicit:!1,str:x}};if(!d.match(/^a[0-9]$/)){var S=new ut.asn1.ASN1Object;return S.hV=m,{asn1:{tlv:d+S.getLengthHexFromValue()+m}}}try{if(!r(m))throw new Error("not encap");return{tag:{tag:d,explicit:!0,obj:n(m)}}}catch(t){return{tag:{tag:d,explicit:!0,hex:m}}}}},ht.isContextTag=function(t,e){var n,r;t=t.toLowerCase();try{n=parseInt(t,16)}catch(t){return-1}if(void 0===e)return 128==(192&n);try{return null!=e.match(/^\[[0-9]+\]$/)&&(!((r=parseInt(e.substr(1,e.length-1),10))>31)&&(128==(192&n)&&(31&n)==r))}catch(t){return!1}},ht.isASN1HEX=function(t){var e=ht;if(t.length%2==1)return!1;var n=e.getVblen(t,0),r=t.substr(0,2),i=e.getL(t,0);return t.length-r.length-i.length==2*n},ht.checkStrictDER=function(t,e,n,r,i){var s=ht;if(void 0===n){if("string"!=typeof t)throw new Error("not hex string");if(t=t.toLowerCase(),!ut.lang.String.isHex(t))throw new Error("not hex string");n=t.length,i=(r=t.length/2)<128?1:Math.ceil(r.toString(16))+1}if(s.getL(t,e).length>2*i)throw new Error("L of TLV too long: idx="+e);var o=s.getVblen(t,e);if(o>r)throw new Error("value of L too long than hex: idx="+e);var a=s.getTLV(t,e),u=a.length-2-s.getL(t,e).length;if(u!==2*o)throw new Error("V string length and L's value not the same:"+u+"/"+2*o);if(0===e&&t.length!=a.length)throw new Error("total length and TLV length unmatch:"+t.length+"!="+a.length);var c=t.substr(e,2);if("02"===c){var l=s.getVidx(t,e);if("00"==t.substr(l,2)&&t.charCodeAt(l+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(c,16)){for(var h=s.getVblen(t,e),f=0,p=s.getChildIdx(t,e),d=0;d<p.length;d++){f+=s.getTLV(t,p[d]).length,s.checkStrictDER(t,p[d],n,r,i)}if(2*h!=f)throw new Error("sum of children's TLV length and L unmatch: "+2*h+"!="+f)}},ht.oidname=function(t){var e=ut.asn1;ut.lang.String.isHex(t)&&(t=e.ASN1Util.oidHexToInt(t));var n=e.x509.OID.oid2name(t);return""===n&&(n=t),n},void 0!==ut&&ut||(ut={}),void 0!==ut.asn1&&ut.asn1||(ut.asn1={}),void 0!==ut.asn1.x509&&ut.asn1.x509||(ut.asn1.x509={}),ut.asn1.x509.Certificate=function(t){ut.asn1.x509.Certificate.superclass.constructor.call(this);var e=ut.asn1,n=e.DERBitString,r=e.DERSequence,i=e.x509,s=i.TBSCertificate,o=i.AlgorithmIdentifier;this.params=void 0,this.setByParam=function(t){this.params=t},this.sign=function(){var t=this.params,e=t.sigalg;null!=t.sigalg.name&&(e=t.sigalg.name);var n=t.tbsobj.tohex(),r=new ut.crypto.Signature({alg:e});r.init(t.cakey),r.updateHex(n),t.sighex=r.sign()},this.getPEM=function(){return It(this.tohex(),"CERTIFICATE")},this.tohex=function(){var t=this.params;if(null!=t.tbsobj&&null!=t.tbsobj||(t.tbsobj=new s(t)),null==t.sighex&&null!=t.cakey&&this.sign(),null==t.sighex)throw new Error("sighex or cakey parameter not defined");var e=[];return e.push(t.tbsobj),e.push(new o({name:t.sigalg})),e.push(new n({hex:"00"+t.sighex})),new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&(this.params=t)},Zt(ut.asn1.x509.Certificate,ut.asn1.ASN1Object),ut.asn1.x509.TBSCertificate=function(t){ut.asn1.x509.TBSCertificate.superclass.constructor.call(this);var e=ut.asn1,n=e.x509,r=e.DERTaggedObject,i=e.DERInteger,s=e.DERSequence,o=n.AlgorithmIdentifier,a=n.Time,u=n.X500Name,c=n.Extensions,l=n.SubjectPublicKeyInfo;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=[],e=this.params;if(null!=e.version||1!=e.version){var n=2;null!=e.version&&(n=e.version-1);var h=new r({obj:new i({int:n})});t.push(h)}return t.push(new i(e.serial)),t.push(new o({name:e.sigalg})),t.push(new u(e.issuer)),t.push(new s({array:[new a(e.notbefore),new a(e.notafter)]})),t.push(new u(e.subject)),t.push(new l(Qt.getKey(e.sbjpubkey))),void 0!==e.ext&&e.ext.length>0&&t.push(new r({tag:"a3",obj:new c(e.ext)})),new ut.asn1.DERSequence({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.TBSCertificate,ut.asn1.ASN1Object),ut.asn1.x509.Extensions=function(t){ut.asn1.x509.Extensions.superclass.constructor.call(this);var e=ut.asn1,n=e.DERSequence,r=e.x509;this.aParam=[],this.setByParam=function(t){this.aParam=t},this.tohex=function(){for(var t=[],e=0;e<this.aParam.length;e++){var i=this.aParam[e],s=i.extname,o=null;if(null!=i.extn)o=new r.PrivateExtension(i);else if("subjectKeyIdentifier"==s)o=new r.SubjectKeyIdentifier(i);else if("keyUsage"==s)o=new r.KeyUsage(i);else if("subjectAltName"==s)o=new r.SubjectAltName(i);else if("issuerAltName"==s)o=new r.IssuerAltName(i);else if("basicConstraints"==s)o=new r.BasicConstraints(i);else if("nameConstraints"==s)o=new r.NameConstraints(i);else if("cRLDistributionPoints"==s)o=new r.CRLDistributionPoints(i);else if("certificatePolicies"==s)o=new r.CertificatePolicies(i);else if("authorityKeyIdentifier"==s)o=new r.AuthorityKeyIdentifier(i);else if("extKeyUsage"==s)o=new r.ExtKeyUsage(i);else if("authorityInfoAccess"==s)o=new r.AuthorityInfoAccess(i);else if("cRLNumber"==s)o=new r.CRLNumber(i);else if("cRLReason"==s)o=new r.CRLReason(i);else if("ocspNonce"==s)o=new r.OCSPNonce(i);else if("ocspNoCheck"==s)o=new r.OCSPNoCheck(i);else if("adobeTimeStamp"==s)o=new r.AdobeTimeStamp(i);else{if("subjectDirectoryAttributes"!=s)throw new Error("extension not supported:"+JSON.stringify(i));o=new r.SubjectDirectoryAttributes(i)}null!=o&&t.push(o)}return new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.x509.Extensions,ut.asn1.ASN1Object),ut.asn1.x509.Extension=function(t){ut.asn1.x509.Extension.superclass.constructor.call(this);var e=ut.asn1,n=e.DERObjectIdentifier,r=e.DEROctetString,i=(e.DERBitString,e.DERBoolean),s=e.DERSequence;this.tohex=function(){var t=new n({oid:this.oid}),e=new r({hex:this.getExtnValueHex()}),o=new Array;return o.push(t),this.critical&&o.push(new i),o.push(e),new s({array:o}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.critical=!1,void 0!==t&&void 0!==t.critical&&(this.critical=t.critical)},Zt(ut.asn1.x509.Extension,ut.asn1.ASN1Object),ut.asn1.x509.KeyUsage=function(t){ut.asn1.x509.KeyUsage.superclass.constructor.call(this,t);var e=Error,n={digitalSignature:0,nonRepudiation:1,keyEncipherment:2,dataEncipherment:3,keyAgreement:4,keyCertSign:5,cRLSign:6,encipherOnly:7,decipherOnly:8};this.getExtnValueHex=function(){var t=this.getBinValue();return this.asn1ExtnValue=new ut.asn1.DERBitString({bin:t}),this.asn1ExtnValue.tohex()},this.getBinValue=function(){var t=this.params;if("object"!=typeof t||"object"!=typeof t.names&&"string"!=typeof t.bin)throw new e("parameter not yet set");if(null!=t.names)return Jt(t.names,n);if(null!=t.bin)return t.bin;throw new e("parameter not set properly")},this.oid="2.5.29.15",void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.KeyUsage,ut.asn1.x509.Extension),ut.asn1.x509.BasicConstraints=function(t){ut.asn1.x509.BasicConstraints.superclass.constructor.call(this,t);var e=ut.asn1,n=e.DERBoolean,r=e.DERInteger,i=e.DERSequence;this.getExtnValueHex=function(){var t=new Array;this.cA&&t.push(new n),this.pathLen>-1&&t.push(new r({int:this.pathLen}));var e=new i({array:t});return this.asn1ExtnValue=e,this.asn1ExtnValue.tohex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,void 0!==t&&(void 0!==t.cA&&(this.cA=t.cA),void 0!==t.pathLen&&(this.pathLen=t.pathLen))},Zt(ut.asn1.x509.BasicConstraints,ut.asn1.x509.Extension),ut.asn1.x509.CRLDistributionPoints=function(t){ut.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,t);var e=ut.asn1,n=e.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.setByDPArray=function(t){for(var r=[],i=0;i<t.length;i++)if(t[i]instanceof ut.asn1.ASN1Object)r.push(t[i]);else{var s=new n.DistributionPoint(t[i]);r.push(s)}this.asn1ExtnValue=new e.DERSequence({array:r})},this.setByOneURI=function(t){var e=new n.DistributionPoint({fulluri:t});this.setByDPArray([e])},this.oid="2.5.29.31",void 0!==t&&(void 0!==t.array?this.setByDPArray(t.array):void 0!==t.uri&&this.setByOneURI(t.uri))},Zt(ut.asn1.x509.CRLDistributionPoints,ut.asn1.x509.Extension),ut.asn1.x509.DistributionPoint=function(t){ut.asn1.x509.DistributionPoint.superclass.constructor.call(this);var e=ut.asn1,n=e.x509.DistributionPointName;this.tohex=function(){var t=new e.DERSequence;if(null!=this.asn1DP){var n=new e.DERTaggedObject({explicit:!0,tag:"a0",obj:this.asn1DP});t.appendASN1Object(n)}return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(void 0!==t.dpobj?this.asn1DP=t.dpobj:void 0!==t.dpname?this.asn1DP=new n(t.dpname):void 0!==t.fulluri&&(this.asn1DP=new n({full:[{uri:t.fulluri}]})))},Zt(ut.asn1.x509.DistributionPoint,ut.asn1.ASN1Object),ut.asn1.x509.DistributionPointName=function(t){ut.asn1.x509.DistributionPointName.superclass.constructor.call(this);var e=ut.asn1,n=e.DERTaggedObject;if(this.tohex=function(){if("full"!=this.type)throw new Error("currently type shall be 'full': "+this.type);return this.asn1Obj=new n({explicit:!1,tag:this.tag,obj:this.asn1V}),this.hTLV=this.asn1Obj.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t)if(e.x509.GeneralNames.prototype.isPrototypeOf(t))this.type="full",this.tag="a0",this.asn1V=t;else{if(void 0===t.full)throw new Error("This class supports GeneralNames only as argument");this.type="full",this.tag="a0",this.asn1V=new e.x509.GeneralNames(t.full)}},Zt(ut.asn1.x509.DistributionPointName,ut.asn1.ASN1Object),ut.asn1.x509.CertificatePolicies=function(t){ut.asn1.x509.CertificatePolicies.superclass.constructor.call(this,t);var e=ut.asn1,n=e.x509,r=e.DERSequence,i=n.PolicyInformation;this.params=null,this.getExtnValueHex=function(){for(var t=[],e=0;e<this.params.array.length;e++)t.push(new i(this.params.array[e]));var n=new r({array:t});return this.asn1ExtnValue=n,this.asn1ExtnValue.tohex()},this.oid="2.5.29.32",void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.CertificatePolicies,ut.asn1.x509.Extension),ut.asn1.x509.PolicyInformation=function(t){ut.asn1.x509.PolicyInformation.superclass.constructor.call(this,t);var e=ut.asn1,n=e.DERSequence,r=e.DERObjectIdentifier,i=e.x509.PolicyQualifierInfo;this.params=null,this.tohex=function(){if(void 0===this.params.policyoid&&void 0===this.params.array)throw new Error("parameter oid and array missing");var t=[new r(this.params.policyoid)];if(void 0!==this.params.array){for(var e=[],s=0;s<this.params.array.length;s++)e.push(new i(this.params.array[s]));e.length>0&&t.push(new n({array:e}))}return new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.PolicyInformation,ut.asn1.ASN1Object),ut.asn1.x509.PolicyQualifierInfo=function(t){ut.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,t);var e=ut.asn1,n=e.DERSequence,r=e.DERIA5String,i=e.DERObjectIdentifier,s=e.x509.UserNotice;this.params=null,this.tohex=function(){return void 0!==this.params.cps?new n({array:[new i({oid:"1.3.6.1.5.5.7.2.1"}),new r({str:this.params.cps})]}).tohex():null!=this.params.unotice?new n({array:[new i({oid:"1.3.6.1.5.5.7.2.2"}),new s(this.params.unotice)]}).tohex():void 0},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.PolicyQualifierInfo,ut.asn1.ASN1Object),ut.asn1.x509.UserNotice=function(t){ut.asn1.x509.UserNotice.superclass.constructor.call(this,t);var e=ut.asn1.DERSequence,n=(ut.asn1.DERInteger,ut.asn1.x509.DisplayText),r=ut.asn1.x509.NoticeReference;this.params=null,this.tohex=function(){var t=[];return void 0!==this.params.noticeref&&t.push(new r(this.params.noticeref)),void 0!==this.params.exptext&&t.push(new n(this.params.exptext)),new e({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.UserNotice,ut.asn1.ASN1Object),ut.asn1.x509.NoticeReference=function(t){ut.asn1.x509.NoticeReference.superclass.constructor.call(this,t);var e=ut.asn1.DERSequence,n=ut.asn1.DERInteger,r=ut.asn1.x509.DisplayText;this.params=null,this.tohex=function(){var t=[];if(void 0!==this.params.org&&t.push(new r(this.params.org)),void 0!==this.params.noticenum){for(var i=[],s=this.params.noticenum,o=0;o<s.length;o++)i.push(new n(s[o]));t.push(new e({array:i}))}if(0==t.length)throw new Error("parameter is empty");return new e({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.NoticeReference,ut.asn1.ASN1Object),ut.asn1.x509.DisplayText=function(t){ut.asn1.x509.DisplayText.superclass.constructor.call(this,t),this.hT="0c",void 0!==t&&("ia5"===t.type?this.hT="16":"vis"===t.type?this.hT="1a":"bmp"===t.type&&(this.hT="1e"))},Zt(ut.asn1.x509.DisplayText,ut.asn1.DERAbstractString),ut.asn1.x509.NameConstraints=function(t){ut.asn1.x509.NameConstraints.superclass.constructor.call(this,t);var e=ut.asn1,n=e.x509,r=e.ASN1Util.newObject,i=n.GeneralSubtree;this.params=null,this.getExtnValueHex=function(){var t=this.params,e=[];if(null!=t.permit&&null!=t.permit.length){for(var n=[],s=0;s<t.permit.length;s++)n.push(new i(t.permit[s]));e.push({tag:{tagi:"a0",obj:{seq:n}}})}if(null!=t.exclude&&null!=t.exclude.length){var o=[];for(s=0;s<t.exclude.length;s++)o.push(new i(t.exclude[s]));e.push({tag:{tagi:"a1",obj:{seq:o}}})}return this.asn1ExtnValue=r({seq:e}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.30",void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.NameConstraints,ut.asn1.x509.Extension),ut.asn1.x509.GeneralSubtree=function(t){ut.asn1.x509.GeneralSubtree.superclass.constructor.call(this);var e=ut.asn1,n=e.x509.GeneralName,r=e.ASN1Util.newObject;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params,e=[new n(t)];return null!=t.min&&e.push({tag:{tagi:"80",obj:{int:t.min}}}),null!=t.max&&e.push({tag:{tagi:"81",obj:{int:t.max}}}),r({seq:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.GeneralSubtree,ut.asn1.ASN1Object),ut.asn1.x509.ExtKeyUsage=function(t){ut.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,t);var e=ut.asn1;this.setPurposeArray=function(t){this.asn1ExtnValue=new e.DERSequence;for(var n=0;n<t.length;n++){var r=new e.DERObjectIdentifier(t[n]);this.asn1ExtnValue.appendASN1Object(r)}},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.37",void 0!==t&&void 0!==t.array&&this.setPurposeArray(t.array)},Zt(ut.asn1.x509.ExtKeyUsage,ut.asn1.x509.Extension),ut.asn1.x509.AuthorityKeyIdentifier=function(t){ut.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,t);var e=ut,n=e.asn1,r=n.DERTaggedObject,i=n.x509.GeneralNames;e.crypto.Util.isKey;this.asn1KID=null,this.asn1CertIssuer=null,this.asn1CertSN=null,this.getExtnValueHex=function(){var t=new Array;this.asn1KID&&t.push(new r({explicit:!1,tag:"80",obj:this.asn1KID})),this.asn1CertIssuer&&t.push(new r({explicit:!1,tag:"a1",obj:new i([{dn:this.asn1CertIssuer}])})),this.asn1CertSN&&t.push(new r({explicit:!1,tag:"82",obj:this.asn1CertSN}));var e=new n.DERSequence({array:t});return this.asn1ExtnValue=e,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(t){if(void 0!==t.str||void 0!==t.hex)this.asn1KID=new ut.asn1.DEROctetString(t);else if("object"==typeof t&&ut.crypto.Util.isKey(t)||"string"==typeof t&&-1!=t.indexOf("BEGIN ")){var e=t;"string"==typeof t&&(e=Qt.getKey(t));var n=Qt.getKeyID(e);this.asn1KID=new ut.asn1.DEROctetString({hex:n})}},this.setCertIssuerByParam=function(t){void 0!==t.str||void 0!==t.ldapstr||void 0!==t.hex||void 0!==t.certsubject||void 0!==t.certissuer?this.asn1CertIssuer=new ut.asn1.x509.X500Name(t):"string"==typeof t&&-1!=t.indexOf("BEGIN ")&&-1!=t.indexOf("CERTIFICATE")&&(this.asn1CertIssuer=new ut.asn1.x509.X500Name({certissuer:t}))},this.setCertSNByParam=function(t){if(void 0!==t.str||void 0!==t.bigint||void 0!==t.hex)this.asn1CertSN=new ut.asn1.DERInteger(t);else if("string"==typeof t&&-1!=t.indexOf("BEGIN ")&&t.indexOf("CERTIFICATE")){var e=new re;e.readCertPEM(t);var n=e.getSerialNumberHex();this.asn1CertSN=new ut.asn1.DERInteger({hex:n})}},this.oid="2.5.29.35",void 0!==t&&(void 0!==t.kid&&this.setKIDByParam(t.kid),void 0!==t.issuer&&this.setCertIssuerByParam(t.issuer),void 0!==t.sn&&this.setCertSNByParam(t.sn),void 0!==t.issuersn&&"string"==typeof t.issuersn&&-1!=t.issuersn.indexOf("BEGIN ")&&t.issuersn.indexOf("CERTIFICATE")&&(this.setCertSNByParam(t.issuersn),this.setCertIssuerByParam(t.issuersn)))},Zt(ut.asn1.x509.AuthorityKeyIdentifier,ut.asn1.x509.Extension),ut.asn1.x509.SubjectKeyIdentifier=function(t){ut.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this,t);var e=ut.asn1.DEROctetString;this.asn1KID=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=this.asn1KID,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(t){if(void 0!==t.str||void 0!==t.hex)this.asn1KID=new e(t);else if("object"==typeof t&&ut.crypto.Util.isKey(t)||"string"==typeof t&&-1!=t.indexOf("BEGIN")){var n=t;"string"==typeof t&&(n=Qt.getKey(t));var r=Qt.getKeyID(n);this.asn1KID=new ut.asn1.DEROctetString({hex:r})}},this.oid="2.5.29.14",void 0!==t&&void 0!==t.kid&&this.setKIDByParam(t.kid)},Zt(ut.asn1.x509.SubjectKeyIdentifier,ut.asn1.x509.Extension),ut.asn1.x509.AuthorityInfoAccess=function(t){ut.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,t),this.setAccessDescriptionArray=function(t){for(var e=new Array,n=ut.asn1,r=n.DERSequence,i=n.DERObjectIdentifier,s=n.x509.GeneralName,o=0;o<t.length;o++){var a,u=t[o];if(void 0!==u.ocsp)a=new r({array:[new i({oid:"1.3.6.1.5.5.7.48.1"}),new s({uri:u.ocsp})]});else{if(void 0===u.caissuer)throw new Error("unknown AccessMethod parameter: "+JSON.stringify(u));a=new r({array:[new i({oid:"1.3.6.1.5.5.7.48.2"}),new s({uri:u.caissuer})]})}e.push(a)}this.asn1ExtnValue=new r({array:e})},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.1.1",void 0!==t&&void 0!==t.array&&this.setAccessDescriptionArray(t.array)},Zt(ut.asn1.x509.AuthorityInfoAccess,ut.asn1.x509.Extension),ut.asn1.x509.SubjectAltName=function(t){ut.asn1.x509.SubjectAltName.superclass.constructor.call(this,t),this.setNameArray=function(t){this.asn1ExtnValue=new ut.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.17",void 0!==t&&void 0!==t.array&&this.setNameArray(t.array)},Zt(ut.asn1.x509.SubjectAltName,ut.asn1.x509.Extension),ut.asn1.x509.IssuerAltName=function(t){ut.asn1.x509.IssuerAltName.superclass.constructor.call(this,t),this.setNameArray=function(t){this.asn1ExtnValue=new ut.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.18",void 0!==t&&void 0!==t.array&&this.setNameArray(t.array)},Zt(ut.asn1.x509.IssuerAltName,ut.asn1.x509.Extension),ut.asn1.x509.SubjectDirectoryAttributes=function(t){ut.asn1.x509.SubjectDirectoryAttributes.superclass.constructor.call(this,t);var e=ut.asn1,n=e.DERSequence,r=e.ASN1Util.newObject,i=e.x509.OID.name2oid;this.params=null,this.getExtnValueHex=function(){for(var t=[],e=0;e<this.params.array.length;e++){var s=this.params.array[e],o={seq:[{oid:"1.2.3.4"},{set:[{utf8str:"DE"}]}]};if("dateOfBirth"==s.attr)o.seq[0].oid=i(s.attr),o.seq[1].set[0]={gentime:s.str};else if("placeOfBirth"==s.attr)o.seq[0].oid=i(s.attr),o.seq[1].set[0]={utf8str:s.str};else if("gender"==s.attr)o.seq[0].oid=i(s.attr),o.seq[1].set[0]={prnstr:s.str};else if("countryOfCitizenship"==s.attr)o.seq[0].oid=i(s.attr),o.seq[1].set[0]={prnstr:s.str};else{if("countryOfResidence"!=s.attr)throw new Error("unsupported attribute: "+s.attr);o.seq[0].oid=i(s.attr),o.seq[1].set[0]={prnstr:s.str}}t.push(new r(o))}var a=new n({array:t});return this.asn1ExtnValue=a,this.asn1ExtnValue.tohex()},this.oid="2.5.29.9",void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.SubjectDirectoryAttributes,ut.asn1.x509.Extension),ut.asn1.x509.PrivateExtension=function(t){ut.asn1.x509.PrivateExtension.superclass.constructor.call(this,t);var e=ut,n=e.lang.String.isHex,r=e.asn1,i=r.x509.OID.name2oid,s=r.ASN1Util.newObject;this.params=null,this.setByParam=function(t){this.oid=i(t.extname),this.params=t},this.getExtnValueHex=function(){if(null==this.params.extname||null==this.params.extn)throw new Error("extname or extnhex not specified");var t=this.params.extn;if("string"==typeof t&&n(t))return t;if("object"==typeof t)try{return s(t).tohex()}catch(t){}throw new Error("unsupported extn value")},null!=t&&this.setByParam(t)},Zt(ut.asn1.x509.PrivateExtension,ut.asn1.x509.Extension),ut.asn1.x509.CRL=function(t){ut.asn1.x509.CRL.superclass.constructor.call(this);var e=ut.asn1,n=e.DERSequence,r=e.DERBitString,i=e.x509,s=i.AlgorithmIdentifier,o=i.TBSCertList;this.params=void 0,this.setByParam=function(t){this.params=t},this.sign=function(){var t=new o(this.params).tohex(),e=new ut.crypto.Signature({alg:this.params.sigalg});e.init(this.params.cakey),e.updateHex(t);var n=e.sign();this.params.sighex=n},this.getPEM=function(){return It(this.tohex(),"X509 CRL")},this.tohex=function(){var t=this.params;if(null==t.tbsobj&&(t.tbsobj=new o(t)),null==t.sighex&&null!=t.cakey&&this.sign(),null==t.sighex)throw new Error("sighex or cakey parameter not defined");var e=[];return e.push(t.tbsobj),e.push(new s({name:t.sigalg})),e.push(new r({hex:"00"+t.sighex})),new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&(this.params=t)},Zt(ut.asn1.x509.CRL,ut.asn1.ASN1Object),ut.asn1.x509.TBSCertList=function(t){ut.asn1.x509.TBSCertList.superclass.constructor.call(this);var e=ut.asn1,n=e.DERInteger,r=e.DERSequence,i=e.DERTaggedObject,s=(e.DERObjectIdentifier,e.x509),o=s.AlgorithmIdentifier,a=s.Time,u=s.Extensions,c=s.X500Name;this.params=null,this.setByParam=function(t){this.params=t},this.getRevCertSequence=function(){for(var t=[],e=this.params.revcert,i=0;i<e.length;i++){var s=[new n(e[i].sn),new a(e[i].date)];null!=e[i].ext&&s.push(new u(e[i].ext)),t.push(new r({array:s}))}return new r({array:t})},this.tohex=function(){var t=[],e=this.params;if(null!=e.version){var s=e.version-1,l=new n({int:s});t.push(l)}if(t.push(new o({name:e.sigalg})),t.push(new c(e.issuer)),t.push(new a(e.thisupdate)),null!=e.nextupdate&&t.push(new a(e.nextupdate)),null!=e.revcert&&t.push(this.getRevCertSequence()),null!=e.ext){var h=new u(e.ext);t.push(new i({tag:"a0",explicit:!0,obj:h}))}return new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.TBSCertList,ut.asn1.ASN1Object),ut.asn1.x509.CRLEntry=function(t){ut.asn1.x509.CRLEntry.superclass.constructor.call(this);var e=ut.asn1;this.setCertSerial=function(t){this.sn=new e.DERInteger(t)},this.setRevocationDate=function(t){this.time=new e.x509.Time(t)},this.tohex=function(){var t=new e.DERSequence({array:[this.sn,this.time]});return this.TLV=t.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(void 0!==t.time&&this.setRevocationDate(t.time),void 0!==t.sn&&this.setCertSerial(t.sn))},Zt(ut.asn1.x509.CRLEntry,ut.asn1.ASN1Object),ut.asn1.x509.CRLNumber=function(t){ut.asn1.x509.CRLNumber.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ut.asn1.DERInteger(this.params.num),this.asn1ExtnValue.tohex()},this.oid="2.5.29.20",null!=t&&(this.params=t)},Zt(ut.asn1.x509.CRLNumber,ut.asn1.x509.Extension),ut.asn1.x509.CRLReason=function(t){ut.asn1.x509.CRLReason.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ut.asn1.DEREnumerated(this.params.code),this.asn1ExtnValue.tohex()},this.oid="2.5.29.21",null!=t&&(this.params=t)},Zt(ut.asn1.x509.CRLReason,ut.asn1.x509.Extension),ut.asn1.x509.OCSPNonce=function(t){ut.asn1.x509.OCSPNonce.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ut.asn1.DEROctetString(this.params),this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.2",null!=t&&(this.params=t)},Zt(ut.asn1.x509.OCSPNonce,ut.asn1.x509.Extension),ut.asn1.x509.OCSPNoCheck=function(t){ut.asn1.x509.OCSPNoCheck.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ut.asn1.DERNull,this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.5",null!=t&&(this.params=t)},Zt(ut.asn1.x509.OCSPNoCheck,ut.asn1.x509.Extension),ut.asn1.x509.AdobeTimeStamp=function(t){ut.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this,t);var e=ut.asn1,n=e.DERInteger,r=e.DERBoolean,i=e.DERSequence,s=e.x509.GeneralName;this.params=null,this.getExtnValueHex=function(){var t=this.params,e=[new n(1)];return e.push(new s({uri:t.uri})),null!=t.reqauth&&e.push(new r(t.reqauth)),this.asn1ExtnValue=new i({array:e}),this.asn1ExtnValue.tohex()},this.oid="1.2.840.113583.1.1.9.1",void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.AdobeTimeStamp,ut.asn1.x509.Extension),ut.asn1.x509.X500Name=function(t){ut.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var e=ut.asn1,n=e.x509,r=n.RDN;this.setByString=function(t,e){void 0!==e&&(this.sRule=e);var n=t.split("/");n.shift();for(var i=[],s=0;s<n.length;s++)if(n[s].match(/^[^=]+=.+$/))i.push(n[s]);else{var o=i.length-1;i[o]=i[o]+"/"+n[s]}for(s=0;s<i.length;s++)this.asn1Array.push(new r({str:i[s],rule:this.sRule}))},this.setByLdapString=function(t,e){void 0!==e&&(this.sRule=e);var r=n.X500Name.ldapToCompat(t);this.setByString(r,e)},this.setByObject=function(t,e){for(var n in void 0!==e&&(this.sRule=e),t)if(t.hasOwnProperty(n)){var i=new r({str:n+"="+t[n],rule:this.sRule});this.asn1Array?this.asn1Array.push(i):this.asn1Array=[i]}},this.setByParam=function(t){var e;(void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.array)?this.paramArray=t.array:void 0!==t.str?this.setByString(t.str):void 0!==t.ldapstr?this.setByLdapString(t.ldapstr):void 0!==t.hex?this.hTLV=t.hex:void 0!==t.certissuer?((e=new re).readCertPEM(t.certissuer),this.hTLV=e.getIssuerHex()):void 0!==t.certsubject?((e=new re).readCertPEM(t.certsubject),this.hTLV=e.getSubjectHex()):"object"==typeof t&&void 0===t.certsubject&&void 0===t.certissuer&&this.setByObject(t)},this.tohex=function(){if("string"==typeof this.hTLV)return this.hTLV;if(0==this.asn1Array.length&&this.paramArray.length>0)for(var t=0;t<this.paramArray.length;t++){var n={array:this.paramArray[t]};"utf8"!=this.sRule&&(n.rule=this.sRule);var i=new r(n);this.asn1Array.push(i)}var s=new e.DERSequence({array:this.asn1Array});return this.hTLV=s.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.X500Name,ut.asn1.ASN1Object),ut.asn1.x509.X500Name.compatToLDAP=function(t){if("/"!==t.substr(0,1))throw"malformed input";var e=(t=t.substr(1)).split("/");return e.reverse(),(e=e.map((function(t){return t.replace(/,/,"\\,")}))).join(",")},ut.asn1.x509.X500Name.onelineToLDAP=function(t){return ut.asn1.x509.X500Name.compatToLDAP(t)},ut.asn1.x509.X500Name.ldapToCompat=function(t){for(var e=t.split(","),n=!1,r=[],i=0;e.length>0;i++){var s=e.shift();if(!0===n){var o=(r.pop()+","+s).replace(/\\,/g,",");r.push(o),n=!1}else r.push(s);"\\"===s.substr(-1,1)&&(n=!0)}return(r=r.map((function(t){return t.replace("/","\\/")}))).reverse(),"/"+r.join("/")},ut.asn1.x509.X500Name.ldapToOneline=function(t){return ut.asn1.x509.X500Name.ldapToCompat(t)},ut.asn1.x509.RDN=function(t){ut.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var e=ut.asn1.x509.AttributeTypeAndValue;this.setByParam=function(t){void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.str&&this.addByMultiValuedString(t.str),void 0!==t.array&&(this.paramArray=t.array)},this.addByString=function(t){this.asn1Array.push(new ut.asn1.x509.AttributeTypeAndValue({str:t,rule:this.sRule}))},this.addByMultiValuedString=function(t){for(var e=ut.asn1.x509.RDN.parseString(t),n=0;n<e.length;n++)this.addByString(e[n])},this.tohex=function(){if(0==this.asn1Array.length&&this.paramArray.length>0)for(var t=0;t<this.paramArray.length;t++){var n=this.paramArray[t];void 0!==n.rule&&"utf8"!=this.sRule&&(n.rule=this.sRule);var r=new e(n);this.asn1Array.push(r)}var i=new ut.asn1.DERSet({array:this.asn1Array});return this.TLV=i.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.RDN,ut.asn1.ASN1Object),ut.asn1.x509.RDN.parseString=function(t){for(var e=t.split(/\+/),n=!1,r=[],i=0;e.length>0;i++){var s=e.shift();if(!0===n){var o=(r.pop()+"+"+s).replace(/\\\+/g,"+");r.push(o),n=!1}else r.push(s);"\\"===s.substr(-1,1)&&(n=!0)}var a=!1,u=[];for(i=0;r.length>0;i++){s=r.shift();if(!0===a){var c=u.pop();if(s.match(/"$/)){o=(c+"+"+s).replace(/^([^=]+)="(.*)"$/,"$1=$2");u.push(o),a=!1}else u.push(c+"+"+s)}else u.push(s);s.match(/^[^=]+="/)&&(a=!0)}return u},ut.asn1.x509.AttributeTypeAndValue=function(t){ut.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var e=ut,n=e.asn1,r=n.DERSequence,i=n.DERUTF8String,s=n.DERPrintableString,o=n.DERTeletexString,a=n.DERIA5String,u=n.DERVisibleString,c=n.DERBMPString,l=e.lang.String.isMail,h=e.lang.String.isPrintable;this.setByParam=function(t){if(void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.ds&&(this.dsType=t.ds),void 0===t.value&&void 0!==t.str){var e=t.str.match(/^([^=]+)=(.+)$/);if(!e)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.sType=e[1],this.sValue=e[2]}else this.sType=t.type,this.sValue=t.value},this.setByString=function(t,e){void 0!==e&&(this.sRule=e);var n=t.match(/^([^=]+)=(.+)$/);if(!n)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.setByAttrTypeAndValueStr(n[1],n[2])},this._getDsType=function(){var t=this.sType,e=this.sValue,n=this.sRule;return"prn"===n?"CN"==t&&l(e)?"ia5":h(e)?"prn":"utf8":"utf8"===n?"CN"==t&&l(e)?"ia5":"C"==t?"prn":"utf8":"utf8"},this.setByAttrTypeAndValueStr=function(t,e,n){void 0!==n&&(this.sRule=n),this.sType=t,this.sValue=e},this.getValueObj=function(t,e){if("utf8"==t)return new i({str:e});if("prn"==t)return new s({str:e});if("tel"==t)return new o({str:e});if("ia5"==t)return new a({str:e});if("vis"==t)return new u({str:e});if("bmp"==t)return new c({str:e});throw new Error("unsupported directory string type: type="+t+" value="+e)},this.tohex=function(){null==this.dsType&&(this.dsType=this._getDsType());var t=ut.asn1.x509.OID.atype2obj(this.sType),e=this.getValueObj(this.dsType,this.sValue),n=new r({array:[t,e]});return this.TLV=n.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.AttributeTypeAndValue,ut.asn1.ASN1Object),ut.asn1.x509.SubjectPublicKeyInfo=function(t){ut.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var e=ut,n=e.asn1,r=n.DERInteger,i=n.DERBitString,s=n.DERObjectIdentifier,o=n.DERSequence,a=n.ASN1Util.newObject,u=n.x509.AlgorithmIdentifier,c=e.crypto;c.ECDSA,c.DSA;this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";return new o({array:[this.asn1AlgId,this.asn1SubjPKey]})},this.tohex=function(){var t=this.getASN1Object();return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.setPubKey=function(t){try{if(t instanceof nt){var e=a({seq:[{int:{bigint:t.n}},{int:{int:t.e}}]}).tohex();this.asn1AlgId=new u({name:"rsaEncryption"}),this.asn1SubjPKey=new i({hex:"00"+e})}}catch(t){}try{if(t instanceof ut.crypto.ECDSA){var n=new s({name:t.curveName});this.asn1AlgId=new u({name:"ecPublicKey",asn1params:n}),this.asn1SubjPKey=new i({hex:"00"+t.pubKeyHex})}}catch(t){}try{if(t instanceof ut.crypto.DSA){n=new a({seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]});this.asn1AlgId=new u({name:"dsa",asn1params:n});var o=new r({bigint:t.y});this.asn1SubjPKey=new i({hex:"00"+o.tohex()})}}catch(t){}},void 0!==t&&this.setPubKey(t)},Zt(ut.asn1.x509.SubjectPublicKeyInfo,ut.asn1.ASN1Object),ut.asn1.x509.Time=function(t){ut.asn1.x509.Time.superclass.constructor.call(this);var e=ut.asn1,n=e.DERUTCTime,r=e.DERGeneralizedTime;this.params=null,this.type=null,this.setTimeParams=function(t){this.timeParams=t},this.setByParam=function(t){this.params=t},this.getType=function(t){return t.match(/^[0-9]{12}Z$/)?"utc":t.match(/^[0-9]{14}Z$/)?"gen":t.match(/^[0-9]{12}\.[0-9]+Z$/)?"utc":t.match(/^[0-9]{14}\.[0-9]+Z$/)?"gen":null},this.tohex=function(){var t=this.params,e=null;if("string"==typeof t&&(t={str:t}),null==t||!t.str||null!=t.type&&null!=t.type||(t.type=this.getType(t.str)),null!=t&&t.str?("utc"==t.type&&(e=new n(t.str)),"gen"==t.type&&(e=new r(t.str))):e="gen"==this.type?new r:new n,null==e)throw new Error("wrong setting for Time");return this.TLV=e.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ut.asn1.x509.Time_bak=function(t){ut.asn1.x509.Time_bak.superclass.constructor.call(this);var e=ut.asn1,n=e.DERUTCTime,r=e.DERGeneralizedTime;this.setTimeParams=function(t){this.timeParams=t},this.tohex=function(){var t=null;return t=null!=this.timeParams?"utc"==this.type?new n(this.timeParams):new r(this.timeParams):"utc"==this.type?new n:new r,this.TLV=t.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},this.type="utc",void 0!==t&&(void 0!==t.type?this.type=t.type:void 0!==t.str&&(t.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),t.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=t)},Zt(ut.asn1.x509.Time,ut.asn1.ASN1Object),ut.asn1.x509.AlgorithmIdentifier=function(t){ut.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var e=ut.asn1,n=e.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;if(this.tohex=function(){if(null===this.nameAlg&&null===this.asn1Alg)throw new Error("algorithm not specified");if(null!==this.nameAlg){var t=null;for(var r in n)r===this.nameAlg&&(t=n[r]);if(null!==t)return this.hTLV=t,this.hTLV}null!==this.nameAlg&&null===this.asn1Alg&&(this.asn1Alg=e.x509.OID.name2obj(this.nameAlg));var i=[this.asn1Alg];null!==this.asn1Params&&i.push(this.asn1Params);var s=new e.DERSequence({array:i});return this.hTLV=s.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(void 0!==t.name&&(this.nameAlg=t.name),void 0!==t.asn1params&&(this.asn1Params=t.asn1params),void 0!==t.paramempty&&(this.paramEmpty=t.paramempty)),null===this.asn1Params&&!1===this.paramEmpty&&null!==this.nameAlg){void 0!==this.nameAlg.name&&(this.nameAlg=this.nameAlg.name);var r=this.nameAlg.toLowerCase();"withdsa"!==r.substr(-7,7)&&"withecdsa"!==r.substr(-9,9)&&(this.asn1Params=new e.DERNull)}},Zt(ut.asn1.x509.AlgorithmIdentifier,ut.asn1.ASN1Object),ut.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},ut.asn1.x509.GeneralName=function(t){ut.asn1.x509.GeneralName.superclass.constructor.call(this);var e=ut.asn1,n=e.x509,r=n.X500Name,i=n.OtherName,s=e.DERIA5String,o=(e.DERPrintableString,e.DEROctetString),a=e.DERTaggedObject,u=e.ASN1Object,c=Error;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t,e,n=this.params,l=!1;if(void 0!==n.other)t="a0",e=new i(n.other);else if(void 0!==n.rfc822)t="81",e=new s({str:n.rfc822});else if(void 0!==n.dns)t="82",e=new s({str:n.dns});else if(void 0!==n.dn)t="a4",l=!0,e="string"==typeof n.dn?new r({str:n.dn}):n.dn instanceof ut.asn1.x509.X500Name?n.dn:new r(n.dn);else if(void 0!==n.ldapdn)t="a4",l=!0,e=new r({ldapstr:n.ldapdn});else if(void 0!==n.certissuer||void 0!==n.certsubj){var h,f;t="a4",l=!0;var p=null;if(void 0!==n.certsubj?(h=!1,f=n.certsubj):(h=!0,f=n.certissuer),f.match(/^[0-9A-Fa-f]+$/),-1!=f.indexOf("-----BEGIN ")&&(p=$t(f)),null==p)throw new Error("certsubj/certissuer not cert");var d,g=new re;g.hex=p,d=h?g.getIssuerHex():g.getSubjectHex(),(e=new u).hTLV=d}else if(void 0!==n.uri)t="86",e=new s({str:n.uri});else{if(void 0===n.ip)throw new c("improper params");var m;t="87";var v=n.ip;try{if(v.match(/^[0-9a-f]+$/)){var y=v.length;if(8!=y&&16!=y&&32!=y&&64!=y)throw"err";m=v}else m=Nt(v)}catch(t){throw new c("malformed IP address: "+n.ip+":"+t.message)}e=new o({hex:m})}return new a({tag:t,explicit:l,obj:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.GeneralName,ut.asn1.ASN1Object),ut.asn1.x509.GeneralNames=function(t){ut.asn1.x509.GeneralNames.superclass.constructor.call(this);var e=ut.asn1;this.setByParamArray=function(t){for(var n=0;n<t.length;n++){var r=new e.x509.GeneralName(t[n]);this.asn1Array.push(r)}},this.tohex=function(){return new e.DERSequence({array:this.asn1Array}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.asn1Array=new Array,void 0!==t&&this.setByParamArray(t)},Zt(ut.asn1.x509.GeneralNames,ut.asn1.ASN1Object),ut.asn1.x509.OtherName=function(t){ut.asn1.x509.OtherName.superclass.constructor.call(this);var e=ut.asn1,n=e.DERObjectIdentifier,r=e.DERSequence,i=e.ASN1Util.newObject;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params;if(null==t.oid||null==t.value)throw new Error("oid or value not specified");var e=new n({oid:t.oid}),s=i({tag:{tag:"a0",explicit:!0,obj:t.value}});return new r({array:[e,s]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.OtherName,ut.asn1.ASN1Object),ut.asn1.x509.OID=new function(){var t=ut.asn1.DERObjectIdentifier;this.name2oidList={sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",secp521r1:"1.3.132.0.35",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1"},this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.objCache={},this.name2obj=function(e){if(void 0!==this.objCache[e])return this.objCache[e];if(void 0===this.name2oidList[e])throw"Name of ObjectIdentifier not defined: "+e;var n=this.name2oidList[e],r=new t({oid:n});return this.objCache[e]=r,r},this.atype2obj=function(e){if(void 0!==this.objCache[e])return this.objCache[e];var n;if(e.match(/^\d+\.\d+\.[0-9.]+$/))n=e;else if(void 0!==this.atype2oidList[e])n=this.atype2oidList[e];else{if(void 0===this.name2oidList[e])throw new Error("AttributeType name undefined: "+e);n=this.name2oidList[e]}var r=new t({oid:n});return this.objCache[e]=r,r},this.registerOIDs=function(t){if(this.checkOIDs(t))for(var e in t)this.name2oidList[e]=t[e]},this.checkOIDs=function(t){try{var e=Object.keys(t);return 0!=e.length&&(e.map((function(t,e,n){if(!this[t].match(/^[0-2]\.[0-9.]+$/))throw new Error("value is not OID")}),t),!0)}catch(t){return!1}}},ut.asn1.x509.OID.oid2name=function(t){var e=ut.asn1.x509.OID.name2oidList;for(var n in e)if(e[n]==t)return n;return""},ut.asn1.x509.OID.oid2atype=function(t){var e=ut.asn1.x509.OID.atype2oidList;for(var n in e)if(e[n]==t)return n;return t},ut.asn1.x509.OID.name2oid=function(t){if(t.match(/^[0-9.]+$/))return t;var e=ut.asn1.x509.OID.name2oidList;return void 0===e[t]?"":e[t]},ut.asn1.x509.X509Util={},ut.asn1.x509.X509Util.newCertPEM=function(t){var e=ut.asn1.x509;e.TBSCertificate;return new(0,e.Certificate)(t).getPEM()},void 0!==ut&&ut||(ut={}),void 0!==ut.asn1&&ut.asn1||(ut.asn1={}),void 0!==ut.asn1.cms&&ut.asn1.cms||(ut.asn1.cms={}),ut.asn1.cms.Attribute=function(t){var e=Error,n=ut.asn1,r=n.DERSequence,i=n.DERSet,s=n.DERObjectIdentifier;this.params=null,this.typeOid=null,this.setByParam=function(t){this.params=t},this.getValueArray=function(){throw new e("not yet implemented abstract")},this.tohex=function(){var t=new s({oid:this.typeOid}),e=new i({array:this.getValueArray()});return new r({array:[t,e]}).tohex()},this.getEncodedHex=function(){return this.tohex()}},Zt(ut.asn1.cms.Attribute,ut.asn1.ASN1Object),ut.asn1.cms.ContentType=function(t){var e=ut.asn1;e.cms.ContentType.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.3",this.getValueArray=function(){return[new e.DERObjectIdentifier(this.params.type)]},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.ContentType,ut.asn1.cms.Attribute),ut.asn1.cms.MessageDigest=function(t){var e=ut.asn1,n=e.DEROctetString;e.cms.MessageDigest.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.4",this.getValueArray=function(){return[new n(this.params)]},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.MessageDigest,ut.asn1.cms.Attribute),ut.asn1.cms.SigningTime=function(t){var e=ut.asn1;e.cms.SigningTime.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.5",this.getValueArray=function(){return[new e.x509.Time(this.params)]},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SigningTime,ut.asn1.cms.Attribute),ut.asn1.cms.SigningCertificate=function(t){var e=Error,n=ut,r=n.asn1,i=r.DERSequence,s=r.cms,o=s.ESSCertID;n.crypto;s.SigningCertificate.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.12",this.getValueArray=function(){if(null==this.params||null==this.params||null==this.params.array)throw new e("parameter 'array' not specified");for(var n=this.params.array,r=[],s=0;s<n.length;s++){var a=n[s];0!=t.hasis||"string"!=typeof a||-1==a.indexOf("-----BEGIN")&&!ht.isASN1HEX(a)||(a={cert:a}),0!=a.hasis&&0==t.hasis&&(a.hasis=!1),r.push(new o(a))}var u=new i({array:r});return[new i({array:[u]})]},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SigningCertificate,ut.asn1.cms.Attribute),ut.asn1.cms.ESSCertID=function(t){ut.asn1.cms.ESSCertID.superclass.constructor.call(this);var e=Error,n=ut,r=n.asn1,i=r.DEROctetString,s=r.DERSequence,o=r.cms.IssuerSerial;this.params=null,this.getCertHash=function(t,r){if(null!=t.hash)return t.hash;if("string"==typeof t&&-1==t.indexOf("-----BEGIN")&&!ht.isASN1HEX(t))return t;var i,s,o;if("string"==typeof t)i=t;else{if(null==t.cert)throw new e("hash nor cert unspecified");i=t.cert}if(s=-1!=i.indexOf("-----BEGIN")?$t(i):i,"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?s=$t(t):ht.isASN1HEX(t)&&(s=t)),null!=t.alg)o=t.alg;else{if(null==r)throw new e("hash alg unspecified");o=r}return n.crypto.Util.hashHex(s,o)},this.tohex=function(){var t=this.params,e=this.getCertHash(t,"sha1"),n=[];return n.push(new i({hex:e})),("string"==typeof t&&-1!=t.indexOf("-----BEGIN")||null!=t.cert&&0!=t.hasis||null!=t.issuer&&null!=t.serial)&&n.push(new o(t)),new s({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.ESSCertID,ut.asn1.ASN1Object),ut.asn1.cms.SigningCertificateV2=function(t){var e=Error,n=ut,r=n.asn1,i=r.DERSequence,s=(r.x509,r.cms),o=s.ESSCertIDv2;n.crypto;s.SigningCertificateV2.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.47",this.getValueArray=function(){if(null==this.params||null==this.params||null==this.params.array)throw new e("parameter 'array' not specified");for(var n=this.params.array,r=[],s=0;s<n.length;s++){var a=n[s];null==t.alg&&0!=t.hasis||"string"!=typeof a||-1==a.indexOf("-----BEGIN")&&!ht.isASN1HEX(a)||(a={cert:a}),null==a.alg&&null!=t.alg&&(a.alg=t.alg),0!=a.hasis&&0==t.hasis&&(a.hasis=!1),r.push(new o(a))}var u=new i({array:r});return[new i({array:[u]})]},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SigningCertificateV2,ut.asn1.cms.Attribute),ut.asn1.cms.ESSCertIDv2=function(t){ut.asn1.cms.ESSCertIDv2.superclass.constructor.call(this);Error;var e=ut.asn1,n=e.DEROctetString,r=e.DERSequence,i=e.cms.IssuerSerial,s=e.x509.AlgorithmIdentifier;this.params=null,this.tohex=function(){var t=this.params,e=this.getCertHash(t,"sha256"),o=[];return null!=t.alg&&"sha256"!=t.alg&&o.push(new s({name:t.alg})),o.push(new n({hex:e})),("string"==typeof t&&-1!=t.indexOf("-----BEGIN")||null!=t.cert&&0!=t.hasis||null!=t.issuer&&null!=t.serial)&&o.push(new i(t)),new r({array:o}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.ESSCertIDv2,ut.asn1.cms.ESSCertID),ut.asn1.cms.IssuerSerial=function(t){var e=Error,n=ut.asn1,r=n.DERInteger,i=n.DERSequence,s=n.cms,o=n.x509.GeneralNames,a=re;s.IssuerSerial.superclass.constructor.call(this),this.setByParam=function(t){this.params=t},this.tohex=function(){var t,n,s=this.params;if("string"==typeof s&&-1!=s.indexOf("-----BEGIN")||null!=s.cert){var u;u=null!=s.cert?s.cert:s;var c=new a;c.readCertPEM(u),t=c.getIssuer(),n={hex:c.getSerialNumberHex()}}else{if(null==s.issuer||!s.serial)throw new e("cert or issuer and serial parameter not specified");t=s.issuer,n=s.serial}var l=new o([{dn:t}]),h=new r(n);return new i({array:[l,h]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.IssuerSerial,ut.asn1.ASN1Object),ut.asn1.cms.SignerIdentifier=function(t){var e=ut.asn1,n=(e.DERInteger,e.DERSequence,e.cms),r=n.IssuerAndSerialNumber,i=n.SubjectKeyIdentifier;e.x509.X500Name,Error;n.SignerIdentifier.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if("isssn"==t.type)return new r(t).tohex();if("skid"==t.type)return new i(t).tohex();throw new Error("wrong property for isssn or skid")},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SignerIdentifier,ut.asn1.ASN1Object),ut.asn1.cms.IssuerAndSerialNumber=function(t){var e=ut.asn1,n=e.DERInteger,r=e.DERSequence,i=e.cms,s=e.x509.X500Name,o=re,a=Error;i.IssuerAndSerialNumber.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t,e,i=this.params;if("string"==typeof i&&-1!=i.indexOf("-----BEGIN")||null!=i.cert){var u;u=null!=i.cert?i.cert:i;var c=new o;c.readCertPEM(u),t=c.getIssuer(),e={hex:c.getSerialNumberHex()}}else{if(null==i.issuer||!i.serial)throw new a("cert or issuer and serial parameter not specified");t=i.issuer,e=i.serial}var l=new s(t),h=new n(e);return new r({array:[l,h]}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.IssuerAndSerialNumber,ut.asn1.ASN1Object),ut.asn1.cms.SubjectKeyIdentifier=function(t){var e=ut.asn1,n=(e.DERInteger,e.DERSequence,e.ASN1Util.newObject),r=e.cms,i=(r.IssuerAndSerialName,r.SubjectKeyIdentifier,e.x509.X500Name,re),s=Error;r.SubjectKeyIdentifier.superclass.constructor.call(this),this.tohex=function(){var t,e=this.params;if(null==e.cert&&null==e.skid)throw new s("property cert nor skid undefined");null!=e.cert?t=new i(e.cert).getExtSubjectKeyIdentifier().kid.hex:null!=e.skid&&(t=e.skid);return n({tag:{tage:"a0",obj:{octstr:{hex:t}}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SubjectKeyIdentifier,ut.asn1.ASN1Object),ut.asn1.cms.AttributeList=function(t){var e=Error,n=ut.asn1,r=n.DERSet,i=n.cms;i.AttributeList.superclass.constructor.call(this),this.params=null,this.hTLV=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params;if(null!=this.hTLV)return this.hTLV;var n=!0;null!=t.sortflag&&(n=t.sortflag);for(var s=t.array,o=[],a=0;a<s.length;a++){var u=s[a],c=u.attr;if("contentType"==c)o.push(new i.ContentType(u));else if("messageDigest"==c)o.push(new i.MessageDigest(u));else if("signingTime"==c)o.push(new i.SigningTime(u));else if("signingCertificate"==c)o.push(new i.SigningCertificate(u));else if("signingCertificateV2"==c)o.push(new i.SigningCertificateV2(u));else if("signaturePolicyIdentifier"==c)o.push(new ut.asn1.cades.SignaturePolicyIdentifier(u));else{if("signatureTimeStamp"!=c&&"timeStampToken"!=c)throw new e("unknown attr: "+c);o.push(new ut.asn1.cades.SignatureTimeStamp(u))}}var l=new r({array:o,sortflag:n});return this.hTLV=l.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.AttributeList,ut.asn1.ASN1Object),ut.asn1.cms.SignerInfo=function(t){var e=Error,n=ut,r=n.asn1,i=r.DERInteger,s=r.DEROctetString,o=r.DERSequence,a=r.DERTaggedObject,u=r.cms,c=u.SignerIdentifier,l=u.AttributeList,h=(u.ContentType,u.EncapsulatedContentInfo,u.MessageDigest,u.SignedData,r.x509.AlgorithmIdentifier),f=n.crypto,p=Qt;u.SignerInfo.superclass.constructor.call(this),this.params=null,this.sign=function(){var t=this.params,e=t.sigalg,n=new l(t.sattrs).tohex(),r=p.getKey(t.signkey),i=new f.Signature({alg:e});i.init(r),i.updateHex(n);var s=i.sign();t.sighex=s},this.tohex=function(){var t=this.params,n=[];if(n.push(new i({int:t.version})),n.push(new c(t.id)),n.push(new h({name:t.hashalg})),null!=t.sattrs){var r=new l(t.sattrs);try{n.push(new a({tag:"a0",explicit:!1,obj:r}))}catch(t){throw new e("si sattr error: "+t)}}if(null!=t.sigalgfield?n.push(new h({name:t.sigalgfield})):n.push(new h({name:t.sigalg})),null==t.sighex&&null!=t.signkey&&this.sign(),n.push(new s({hex:t.sighex})),null!=t.uattrs){r=new l(t.uattrs);try{n.push(new a({tag:"a1",explicit:!1,obj:r}))}catch(t){throw new e("si uattr error: "+t)}}return new o({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SignerInfo,ut.asn1.ASN1Object),ut.asn1.cms.EncapsulatedContentInfo=function(t){var e=ut.asn1,n=e.DERTaggedObject,r=e.DERSequence,i=e.DERObjectIdentifier,s=e.DEROctetString;e.cms.EncapsulatedContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];if(e.push(new i(t.type)),null!=t.content&&(null!=t.content.hex||null!=t.content.str)&&1!=t.isDetached){var o=new s(t.content),a=new n({tag:"a0",explicit:!0,obj:o});e.push(a)}return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.EncapsulatedContentInfo,ut.asn1.ASN1Object),ut.asn1.cms.ContentInfo=function(t){var e=ut.asn1,n=e.DERTaggedObject,r=e.DERSequence,i=e.DERObjectIdentifier;e.x509.OID.name2obj;ut.asn1.cms.ContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];e.push(new i(t.type));var s=new n({tag:"a0",explicit:!0,obj:t.obj});return e.push(s),new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.ContentInfo,ut.asn1.ASN1Object),ut.asn1.cms.SignedData=function(t){Error;var e=ut.asn1,n=(e.ASN1Object,e.DERInteger),r=e.DERSet,i=e.DERSequence,s=(e.DERTaggedObject,e.cms),o=s.EncapsulatedContentInfo,a=s.SignerInfo,u=s.ContentInfo,c=s.CertificateSet,l=s.RevocationInfoChoices,h=e.x509.AlgorithmIdentifier;ut.asn1.cms.SignedData.superclass.constructor.call(this),this.params=null,this.checkAndFixParam=function(){var t=this.params;this._setDigestAlgs(t),this._setContentTypeByEContent(t),this._setMessageDigestByEContent(t),this._setSignerInfoVersion(t),this._setSignedDataVersion(t)},this._setDigestAlgs=function(t){for(var e={},n=t.sinfos,r=0;r<n.length;r++){e[n[r].hashalg]=1}t.hashalgs=Object.keys(e).sort()},this._setContentTypeByEContent=function(t){for(var e=t.econtent.type,n=t.sinfos,r=0;r<n.length;r++){var i=n[r];this._getAttrParamByName(i,"contentType").type=e}},this._setMessageDigestByEContent=function(t){var e=t.econtent,n=(t.econtent.type,e.content.hex);null==n&&"data"==e.type&&null!=e.content.str&&(n=Ft(e.content.str));for(var r=t.sinfos,i=0;i<r.length;i++){var s=r[i],o=s.hashalg,a=this._getAttrParamByName(s,"messageDigest"),u=ut.crypto.Util.hashHex(n,o);a.hex=u}},this._getAttrParamByName=function(t,e){for(var n=t.sattrs.array,r=0;r<n.length;r++)if(n[r].attr==e)return n[r]},this._setSignerInfoVersion=function(t){for(var e=t.sinfos,n=0;n<e.length;n++){var r=e[n],i=1;"skid"==r.id.type&&(i=3),r.version=i}},this._setSignedDataVersion=function(t){var e=this._getSignedDataVersion(t);t.version=e},this._getSignedDataVersion=function(t){if(null!=t.revinfos)for(var e=t.revinfos,n=0;n<e.length;n++){if(null!=e[n].ocsp)return 5}var r=t.sinfos;for(n=0;n<r.length;n++){if(3==t.sinfos[n].version)return 3}return"data"!=t.econtent.type?3:1},this.tohex=function(){var t=this.params;null!=this.getEncodedHexPrepare&&this.getEncodedHexPrepare(),1!=t.fixed&&this.checkAndFixParam();var e=[];e.push(new n({int:t.version}));for(var s=[],u=0;u<t.hashalgs.length;u++){var f=t.hashalgs[u];s.push(new h({name:f}))}e.push(new r({array:s})),e.push(new o(t.econtent)),null!=t.certs&&e.push(new c(t.certs)),null!=t.revinfos&&e.push(new l(t.revinfos));var p=[];for(u=0;u<t.sinfos.length;u++){var d=t.sinfos[u];p.push(new a(d))}return e.push(new r({array:p})),new i({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.getContentInfo=function(){return new u({type:"signed-data",obj:this})},this.getContentInfoEncodedHex=function(){return this.getContentInfo().tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SignedData,ut.asn1.ASN1Object),ut.asn1.cms.CertificateSet=function(t){ut.asn1.cms.CertificateSet.superclass.constructor.call(this);var e=Error,n=ut.asn1,r=n.DERTaggedObject,i=n.DERSet,s=n.ASN1Object;this.params=null,this.tohex=function(){var t,n=this.params,o=[];if(n instanceof Array)t=n;else{if(null==n.array)throw new e("cert array not specified");t=n.array}for(var a=0;a<t.length;a++){var u=$t(t[a]),c=new s;c.hTLV=u,o.push(c)}var l={array:o};0==n.sortflag&&(l.sortflag=!1);var h=new i(l);return new r({tag:"a0",explicit:!1,obj:h}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.CertificateSet,ut.asn1.ASN1Object),ut.asn1.cms.RevocationInfoChoices=function(t){ut.asn1.cms.RevocationInfoChoices.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(!t instanceof Array)throw new Error("params is not array");for(var e=[],n=0;n<t.length;n++)e.push(new ut.asn1.cms.RevocationInfoChoice(t[n]));return ut.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:{set:e}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.RevocationInfoChoices,ut.asn1.ASN1Object),ut.asn1.cms.RevocationInfoChoice=function(t){ut.asn1.cms.RevocationInfoChoice.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(null!=t.crl&&"string"==typeof t.crl){var e=t.crl;return-1!=t.crl.indexOf("-----BEGIN")&&(e=$t(t.crl)),e}if(null!=t.ocsp)return ut.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:new ut.asn1.cms.OtherRevocationFormat(t)}}).tohex();throw new Error("property crl or ocsp undefined")},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.RevocationInfoChoice,ut.asn1.ASN1Object),ut.asn1.cms.OtherRevocationFormat=function(t){ut.asn1.cms.OtherRevocationFormat.superclass.constructor.call(this);var e=Error,n=ut,r=n.asn1.ASN1Util.newObject,i=n.lang.String.isHex;this.params=null,this.tohex=function(){var t=this.params;if(null==t.ocsp)throw new e("property ocsp not specified");if(!i(t.ocsp)||!ht.isASN1HEX(t.ocsp))throw new e("ocsp value not ASN.1 hex string");return r({seq:[{oid:"1.3.6.1.5.5.7.16.2"},{asn1:{tlv:t.ocsp}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.OtherRevocationFormat,ut.asn1.ASN1Object),ut.asn1.cms.CMSUtil=new function(){},ut.asn1.cms.CMSUtil.newSignedData=function(t){return new ut.asn1.cms.SignedData(t)},ut.asn1.cms.CMSUtil.verifySignedData=function(t){var e=ut,n=e.asn1,r=n.cms,i=(r.SignerInfo,r.SignedData,r.SigningTime,r.SigningCertificate,r.SigningCertificateV2,n.cades.SignaturePolicyIdentifier,e.lang.String.isHex),s=ht,o=s.getVbyList,a=s.getTLVbyList,u=s.getIdxbyList,c=s.getChildIdx,l=s.getTLV,h=s.oidname,f=e.crypto.Util.hashHex;void 0===t.cms&&i(t.cms);var p=t.cms,d=function(t,e){var n=e.idx;e.signerid_issuer1=a(t,n,[1,0],"30"),e.signerid_serial1=o(t,n,[1,1],"02"),e.hashalg=h(o(t,n,[2,0],"06"));var r=u(t,n,[3],"a0");e.idxSignedAttrs=r,g(t,e,r);var i=c(t,n).length;if(i<6)throw"malformed SignerInfo";e.sigalg=h(o(t,n,[i-2,0],"06")),e.sigval=o(t,n,[i-1],"04")},g=function(t,e,n){var r=c(t,n);e.signedAttrIdxList=r;for(var i=0;i<r.length;i++){var s,a=r[i],u=o(t,a,[0],"06");"2a864886f70d010905"===u?(s=xt(o(t,a,[1,0])),e.saSigningTime=s):"2a864886f70d010904"===u&&(s=o(t,a,[1,0],"04"),e.saMessageDigest=s)}},m=function(t,e,n,r){n.verifyDetail={};var i=n.verifyDetail,s=e.parse.econtent,o=n.hashalg,a=n.saMessageDigest;i.validMessageDigest=!1,f(s,o)===a&&(i.validMessageDigest=!0),function(t,e,n,r){var i,s=e.parse.certsIdx;if(void 0===e.certs){i=[],e.certkeys=[];for(var o=c(t,s),a=0;a<o.length;a++){var u=l(t,o[a]),h=new re;h.readCertHex(u),i[a]=h,e.certkeys[a]=h.getPublicKey()}e.certs=i}else i=e.certs;e.cccc=i.length,e.cccci=o.length;for(a=0;a<i.length;a++){var f=h.getIssuerHex(),p=h.getSerialNumberHex();n.signerid_issuer1===f&&n.signerid_serial1===p&&(n.certkey_idx=a)}}(t,e,n),i.validSignatureValue=!1;var u=n.sigalg,h="31"+l(t,n.idxSignedAttrs).substr(2);n.signedattrshex=h;var p=e.certs[n.certkey_idx].getPublicKey(),d=new ut.crypto.Signature({alg:u});d.init(p),d.updateHex(h);var g=d.verify(n.sigval);i.validSignatureValue_isValid=g,!0===g&&(i.validSignatureValue=!0),n.isValid=!1,i.validMessageDigest&&i.validSignatureValue&&(n.isValid=!0)},v={isValid:!1,parse:{}};return function(t,e){if("2a864886f70d010702"!==o(t,0,[0],"06"))return e;e.cmsType="signedData",e.econtent=o(t,0,[1,0,2,1,0]),function(t,e){for(var n,r=3;r<6;r++)if(void 0!==(n=u(t,0,[1,0,r]))){var i=t.substr(n,2);"a0"===i&&(e.certsIdx=n),"a1"===i&&(e.revinfosIdx=n),"31"===i&&(e.signerinfosIdx=n)}}(t,e),e.signerInfos=[],function(t,e){var n=e.signerinfosIdx;if(void 0!==n){var r=c(t,n);e.signerInfoIdxList=r;for(var i=0;i<r.length;i++){var s={idx:r[i]};d(t,s),e.signerInfos.push(s)}}}(t,e)}(p,v.parse),function(t,e){for(var n=e.parse.signerInfos,r=n.length,i=!0,s=0;s<r;s++){var o=n[s];m(t,e,o,s),o.isValid||(i=!1)}e.isValid=i}(p,v),v},ut.asn1.cms.CMSParser=function(){var t=Error,e=re,n=new e,r=ht,i=r.getV,s=r.getTLV,o=(r.getIdxbyList,r.getTLVbyList),a=r.getTLVbyListEx,u=r.getVbyList,c=r.getVbyListEx,l=r.getChildIdx;this.getCMSSignedData=function(t){var e=o(t,0,[1,0]);return this.getSignedData(e)},this.getSignedData=function(t){var e=l(t,0),n={},r=i(t,e[0]),o=parseInt(r,16);n.version=o;var u=s(t,e[1]);n.hashalgs=this.getHashAlgArray(u);var c=s(t,e[2]);n.econtent=this.getEContent(c);var h=a(t,0,["[0]"]);null!=h&&(n.certs=this.getCertificateSet(h));a(t,0,["[1]"]);var f=a(t,0,[3]);return n.sinfos=this.getSignerInfos(f),n},this.getHashAlgArray=function(t){for(var n=l(t,0),r=new e,i=[],o=0;o<n.length;o++){var a=s(t,n[o]),u=r.getAlgorithmIdentifierName(a);i.push(u)}return i},this.getEContent=function(t){var e={},n=u(t,0,[0]),r=u(t,0,[1,0]);return e.type=ut.asn1.x509.OID.oid2name(ht.hextooidstr(n)),e.content={hex:r},e},this.getSignerInfos=function(t){for(var e=[],n=l(t,0),r=0;r<n.length;r++){var i=s(t,n[r]),o=this.getSignerInfo(i);e.push(o)}return e},this.getSignerInfo=function(t){var e={},i=l(t,0),o=r.getInt(t,i[0],-1);-1!=o&&(e.version=o);var u=s(t,i[1]),h=this.getIssuerAndSerialNumber(u);e.id=h;var f=s(t,i[2]),p=n.getAlgorithmIdentifierName(f);e.hashalg=p;var d=a(t,0,["[0]"]);if(null!=d){var g=this.getAttributeList(d);e.sattrs=g}var m=a(t,0,[3]),v=n.getAlgorithmIdentifierName(m);e.sigalg=v;var y=c(t,0,[4]);e.sighex=y;var b=a(t,0,["[1]"]);if(null!=b){var w=this.getAttributeList(b);e.uattrs=w}return e},this.getSignerIdentifier=function(t){if("30"==t.substr(0,2))return this.getIssuerAndSerialNumber(t);throw new Error("SKID of signerIdentifier not supported")},this.getIssuerAndSerialNumber=function(t){var e={type:"isssn"},r=l(t,0),o=s(t,r[0]);e.issuer=n.getX500Name(o);var a=i(t,r[1]);return e.serial={hex:a},e},this.getAttributeList=function(t){for(var e=[],n=l(t,0),r=0;r<n.length;r++){var i=s(t,n[r]),o=this.getAttribute(i);e.push(o)}return{array:e}},this.getAttribute=function(t){var e={},n=l(t,0),i=r.getOID(t,n[0]),o=ut.asn1.x509.OID.oid2name(i);e.attr=o;var a=s(t,n[1]),u=l(a,0);if(1==u.length)e.valhex=s(a,u[0]);else{for(var c=[],h=0;h<u.length;h++)c.push(s(a,u[h]));e.valhex=c}return"contentType"==o?this.setContentType(e):"messageDigest"==o?this.setMessageDigest(e):"signingTime"==o?this.setSigningTime(e):"signingCertificate"==o?this.setSigningCertificate(e):"signingCertificateV2"==o?this.setSigningCertificateV2(e):"signaturePolicyIdentifier"==o&&this.setSignaturePolicyIdentifier(e),e},this.setContentType=function(t){var e=r.getOIDName(t.valhex,0,null);null!=e&&(t.type=e,delete t.valhex)},this.setSigningTime=function(t){var e=xt(i(t.valhex,0));t.str=e,delete t.valhex},this.setMessageDigest=function(t){var e=i(t.valhex,0);t.hex=e,delete t.valhex},this.setSigningCertificate=function(t){var e=l(t.valhex,0);if(e.length>0){for(var n=s(t.valhex,e[0]),r=l(n,0),i=[],o=0;o<r.length;o++){var a=s(n,r[o]),u=this.getESSCertID(a);i.push(u)}t.array=i}if(e.length>1){var c=s(t.valhex,e[1]);t.polhex=c}delete t.valhex},this.setSignaturePolicyIdentifier=function(t){var n=l(t.valhex,0);if(n.length>0){var o=r.getOID(t.valhex,n[0]);t.oid=o}if(n.length>1){var a=new e,u=l(t.valhex,n[1]),c=s(t.valhex,u[0]),h=a.getAlgorithmIdentifierName(c);t.alg=h;var f=i(t.valhex,u[1]);t.hash=f}delete t.valhex},this.setSigningCertificateV2=function(t){var e=l(t.valhex,0);if(e.length>0){for(var n=s(t.valhex,e[0]),r=l(n,0),i=[],o=0;o<r.length;o++){var a=s(n,r[o]),u=this.getESSCertIDv2(a);i.push(u)}t.array=i}if(e.length>1){var c=s(t.valhex,e[1]);t.polhex=c}delete t.valhex},this.getESSCertID=function(t){var e={},n=l(t,0);if(n.length>0){var r=i(t,n[0]);e.hash=r}if(n.length>1){var o=s(t,n[1]),a=this.getIssuerSerial(o);null!=a.serial&&(e.serial=a.serial),null!=a.issuer&&(e.issuer=a.issuer)}return e},this.getESSCertIDv2=function(e){var r={},o=l(e,0);if(o.length<1||3<o.length)throw new t("wrong number of elements");var a=0;if("30"==e.substr(o[0],2)){var u=s(e,o[0]);r.alg=n.getAlgorithmIdentifierName(u),a++}else r.alg="sha256";var c=i(e,o[a]);if(r.hash=c,o.length>a+1){var h=s(e,o[a+1]),f=this.getIssuerSerial(h);r.issuer=f.issuer,r.serial=f.serial}return r},this.getIssuerSerial=function(t){var e={},r=l(t,0),o=s(t,r[0]),a=n.getGeneralNames(o)[0].dn;e.issuer=a;var u=i(t,r[1]);return e.serial={hex:u},e},this.getCertificateSet=function(t){for(var e=l(t,0),n=[],r=0;r<e.length;r++){var i=s(t,e[r]);if("30"==i.substr(0,2)){var o=It(i,"CERTIFICATE");n.push(o)}}return{array:n,sortflag:!1}}},void 0!==ut&&ut||(ut={}),void 0!==ut.asn1&&ut.asn1||(ut.asn1={}),void 0!==ut.asn1.tsp&&ut.asn1.tsp||(ut.asn1.tsp={}),ut.asn1.tsp.TimeStampToken=function(t){var e=ut.asn1.tsp;e.TimeStampToken.superclass.constructor.call(this),this.params=null,this.getEncodedHexPrepare=function(){var t=new e.TSTInfo(this.params.econtent.content);this.params.econtent.content.hex=t.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.TimeStampToken,ut.asn1.cms.SignedData),ut.asn1.tsp.TSTInfo=function(t){Error;var e=ut.asn1,n=e.DERSequence,r=e.DERInteger,i=e.DERBoolean,s=e.DERGeneralizedTime,o=e.DERObjectIdentifier,a=e.DERTaggedObject,u=e.tsp,c=u.MessageImprint,l=u.Accuracy,h=(e.x509.X500Name,e.x509.GeneralName);if(u.TSTInfo.superclass.constructor.call(this),this.dVersion=new r({int:1}),this.dPolicy=null,this.dMessageImprint=null,this.dSerial=null,this.dGenTime=null,this.dAccuracy=null,this.dOrdering=null,this.dNonce=null,this.dTsa=null,this.tohex=function(){var t=[this.dVersion];if(null==this.dPolicy)throw new Error("policy shall be specified.");if(t.push(this.dPolicy),null==this.dMessageImprint)throw new Error("messageImprint shall be specified.");if(t.push(this.dMessageImprint),null==this.dSerial)throw new Error("serialNumber shall be specified.");if(t.push(this.dSerial),null==this.dGenTime)throw new Error("genTime shall be specified.");t.push(this.dGenTime),null!=this.dAccuracy&&t.push(this.dAccuracy),null!=this.dOrdering&&t.push(this.dOrdering),null!=this.dNonce&&t.push(this.dNonce),null!=this.dTsa&&t.push(this.dTsa);var e=new n({array:t});return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t){if("string"==typeof t.policy){if(!t.policy.match(/^[0-9.]+$/))throw"policy shall be oid like 0.1.4.134";this.dPolicy=new o({oid:t.policy})}void 0!==t.messageImprint&&(this.dMessageImprint=new c(t.messageImprint)),void 0!==t.serial&&(this.dSerial=new r(t.serial)),void 0!==t.genTime&&(this.dGenTime=new s(t.genTime)),void 0!==t.accuracy&&(this.dAccuracy=new l(t.accuracy)),void 0!==t.ordering&&1==t.ordering&&(this.dOrdering=new i),void 0!==t.nonce&&(this.dNonce=new r(t.nonce)),void 0!==t.tsa&&(this.dTsa=new a({tag:"a0",explicit:!0,obj:new h({dn:t.tsa})}))}},Zt(ut.asn1.tsp.TSTInfo,ut.asn1.ASN1Object),ut.asn1.tsp.Accuracy=function(t){var e=ut.asn1,n=e.ASN1Util.newObject;e.tsp.Accuracy.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];return null!=t.seconds&&"number"==typeof t.seconds&&e.push({int:t.seconds}),null!=t.millis&&"number"==typeof t.millis&&e.push({tag:{tagi:"80",obj:{int:t.millis}}}),null!=t.micros&&"number"==typeof t.micros&&e.push({tag:{tagi:"81",obj:{int:t.micros}}}),n({seq:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.Accuracy,ut.asn1.ASN1Object),ut.asn1.tsp.MessageImprint=function(t){var e=ut.asn1,n=e.DERSequence,r=e.DEROctetString,i=e.x509.AlgorithmIdentifier;e.tsp.MessageImprint.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=new i({name:t.alg}),s=new r({hex:t.hash});return new n({array:[e,s]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.tsp.MessageImprint,ut.asn1.ASN1Object),ut.asn1.tsp.TimeStampReq=function(t){var e=ut.asn1,n=e.DERSequence,r=e.DERInteger,i=e.DERBoolean,s=(e.ASN1Object,e.DERObjectIdentifier),o=e.tsp,a=o.MessageImprint;o.TimeStampReq.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];return e.push(new r({int:1})),t.messageImprint instanceof ut.asn1.ASN1Object?e.push(t.messageImprint):e.push(new a(t.messageImprint)),null!=t.policy&&e.push(new s(t.policy)),null!=t.nonce&&e.push(new r(t.nonce)),1==t.certreq&&e.push(new i),new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.TimeStampReq,ut.asn1.ASN1Object),ut.asn1.tsp.TimeStampResp=function(t){var e=ut.asn1,n=e.DERSequence,r=(e.ASN1Object,e.tsp),i=r.PKIStatusInfo;r.TimeStampResp.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,s=[];if(null!=t.econtent||null!=t.tst)if(null!=t.statusinfo?s.push(new i(t.statusinfo)):s.push(new i("granted")),null!=t.econtent)s.push(new r.TimeStampToken(t).getContentInfo());else{if(!(t.tst instanceof e.ASN1Object))throw new Error("improper member tst value");s.push(t.tst)}else{if(null==t.statusinfo)throw new Error("parameter for token nor statusinfo not specified");s.push(new i(t.statusinfo))}return new n({array:s}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.TimeStampResp,ut.asn1.ASN1Object),ut.asn1.tsp.PKIStatusInfo=function(t){var e=Error,n=ut.asn1,r=n.DERSequence,i=n.tsp,s=i.PKIStatus,o=i.PKIFreeText,a=i.PKIFailureInfo;i.PKIStatusInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,n=[];if("string"==typeof t)n.push(new s(t));else{if(null==t.status)throw new e("property 'status' unspecified");n.push(new s(t.status)),null!=t.statusstr&&n.push(new o(t.statusstr)),null!=t.failinfo&&n.push(new a(t.failinfo))}return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.PKIStatusInfo,ut.asn1.ASN1Object),ut.asn1.tsp.PKIStatus=function(t){var e=Error,n=ut.asn1,r=n.DERInteger;n.tsp.PKIStatus.superclass.constructor.call(this);var i={granted:0,grantedWithMods:1,rejection:2,waiting:3,revocationWarning:4,revocationNotification:5};this.params=null,this.tohex=function(){var t,n=this.params;if("string"==typeof n)try{t=i[n]}catch(t){throw new e("undefined name: "+n)}else{if("number"!=typeof n)throw new e("unsupported params");t=n}return new r({int:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.PKIStatus,ut.asn1.ASN1Object),ut.asn1.tsp.PKIFreeText=function(t){var e=Error,n=ut.asn1,r=n.DERSequence,i=n.DERUTF8String;n.tsp.PKIFreeText.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(!t instanceof Array)throw new e("wrong params: not array");for(var n=[],s=0;s<t.length;s++)n.push(new i({str:t[s]}));return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.PKIFreeText,ut.asn1.ASN1Object),ut.asn1.tsp.PKIFailureInfo=function(t){var e=Error,n=ut.asn1,r=n.DERBitString,i=n.tsp.PKIFailureInfo,s={badAlg:0,badRequest:2,badDataFormat:5,timeNotAvailable:14,unacceptedPolicy:15,unacceptedExtension:16,addInfoNotAvailable:17,systemFailure:25};i.superclass.constructor.call(this),this.params=null,this.getBinValue=function(){var t=this.params,n=0;if("number"==typeof t&&0<=t&&t<=25){for(var r=(n|=1<<t).toString(2),i="",o=r.length-1;o>=0;o--)i+=r[o];return i}if("string"==typeof t&&null!=s[t])return Jt([t],s);if("object"==typeof t&&null!=t.length)return Jt(t,s);throw new e("wrong params")},this.tohex=function(){this.params;var t=this.getBinValue();return new r({bin:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.PKIFailureInfo,ut.asn1.ASN1Object),ut.asn1.tsp.AbstractTSAAdapter=function(t){this.getTSTHex=function(t,e){throw"not implemented yet"}},ut.asn1.tsp.SimpleTSAAdapter=function(t){var e=ut,n=e.asn1.tsp,r=e.crypto.Util.hashHex;n.SimpleTSAAdapter.superclass.constructor.call(this),this.params=null,this.serial=0,this.getTSTHex=function(t,e){var i=r(t,e);this.params.econtent.content.messageImprint={alg:e,hash:i},this.params.econtent.content.serial={int:this.serial++};var s=Math.floor(1e9*Math.random());return this.params.econtent.content.nonce={int:s},new n.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==t&&(this.params=t)},Zt(ut.asn1.tsp.SimpleTSAAdapter,ut.asn1.tsp.AbstractTSAAdapter),ut.asn1.tsp.FixedTSAAdapter=function(t){var e=ut,n=e.asn1.tsp,r=e.crypto.Util.hashHex;n.FixedTSAAdapter.superclass.constructor.call(this),this.params=null,this.getTSTHex=function(t,e){var i=r(t,e);return this.params.econtent.content.messageImprint={alg:e,hash:i},new n.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==t&&(this.params=t)},Zt(ut.asn1.tsp.FixedTSAAdapter,ut.asn1.tsp.AbstractTSAAdapter),ut.asn1.tsp.TSPUtil=new function(){},ut.asn1.tsp.TSPUtil.newTimeStampToken=function(t){return new ut.asn1.tsp.TimeStampToken(t)},ut.asn1.tsp.TSPUtil.parseTimeStampReq=function(t){return(new ut.asn1.tsp.TSPParser).getTimeStampReq(t)},ut.asn1.tsp.TSPUtil.parseMessageImprint=function(t){return(new ut.asn1.tsp.TSPParser).getMessageImprint(t)},ut.asn1.tsp.TSPParser=function(){Error;var t=new re,e=ht,n=e.getV,r=e.getTLV,i=e.getIdxbyList,s=(e.getTLVbyListEx,e.getChildIdx),o=["granted","grantedWithMods","rejection","waiting","revocationWarning","revocationNotification"],a={0:"badAlg",2:"badRequest",5:"badDataFormat",14:"timeNotAvailable",15:"unacceptedPolicy",16:"unacceptedExtension",17:"addInfoNotAvailable",25:"systemFailure"};this.getResponse=function(t){var e=s(t,0);if(1==e.length)return this.getPKIStatusInfo(r(t,e[0]));if(e.length>1){var n=this.getPKIStatusInfo(r(t,e[0])),i=r(t,e[1]),o=this.getToken(i);return o.statusinfo=n,o}},this.getToken=function(t){var e=(new ut.asn1.cms.CMSParser).getCMSSignedData(t);return this.setTSTInfo(e),e},this.setTSTInfo=function(t){var e=t.econtent;if("tstinfo"==e.type){var n=e.content.hex,r=this.getTSTInfo(n);e.content=r}},this.getTSTInfo=function(e){var i={},o=s(e,0),a=n(e,o[1]);i.policy=zt(a);var u=r(e,o[2]);i.messageImprint=this.getMessageImprint(u);var c=n(e,o[3]);i.serial={hex:c};var l=n(e,o[4]);i.genTime={str:xt(l)};var h=0;if(o.length>5&&"30"==e.substr(o[5],2)){var f=r(e,o[5]);i.accuracy=this.getAccuracy(f),h++}o.length>5+h&&"01"==e.substr(o[5+h],2)&&("ff"==n(e,o[5+h])&&(i.ordering=!0),h++);if(o.length>5+h&&"02"==e.substr(o[5+h],2)){var p=n(e,o[5+h]);i.nonce={hex:p},h++}if(o.length>5+h&&"a0"==e.substr(o[5+h],2)){var d=r(e,o[5+h]);d="30"+d.substr(2),pGeneralNames=t.getGeneralNames(d);var g=pGeneralNames[0].dn;i.tsa=g,h++}if(o.length>5+h&&"a1"==e.substr(o[5+h],2)){var m=r(e,o[5+h]);m="30"+m.substr(2);var v=t.getExtParamArray(m);i.ext=v,h++}return i},this.getAccuracy=function(t){for(var e={},r=s(t,0),i=0;i<r.length;i++){var o=t.substr(r[i],2),a=n(t,r[i]),u=parseInt(a,16);"02"==o?e.seconds=u:"80"==o?e.millis=u:"81"==o&&(e.micros=u)}return e},this.getMessageImprint=function(t){if("30"!=t.substr(0,2))throw new Error("head of messageImprint hex shall be x30");var r={},o=(s(t,0),i(t,0,[0,0])),a=n(t,o),u=e.hextooidstr(a),c=ut.asn1.x509.OID.oid2name(u);if(""==c)throw new Error("hashAlg name undefined: "+u);var l=c,h=i(t,0,[1]);return r.alg=l,r.hash=n(t,h),r},this.getPKIStatusInfo=function(t){var e={},i=s(t,0),a=0;try{var u=n(t,i[0]),c=parseInt(u,16);e.status=o[c]}catch(t){}if(i.length>1&&"30"==t.substr(i[1],2)){var l=r(t,i[1]);e.statusstr=this.getPKIFreeText(l),a++}if(i.length>a&&"03"==t.substr(i[1+a],2)){var h=r(t,i[1+a]);e.failinfo=this.getPKIFailureInfo(h)}return e},this.getPKIFreeText=function(t){for(var n=[],r=s(t,0),i=0;i<r.length;i++)n.push(e.getString(t,r[i]));return n},this.getPKIFailureInfo=function(t){var n=e.getInt(t,0);return null!=a[n]?a[n]:n},this.getTimeStampReq=function(t){var i={certreq:!1},o=s(t,0);if(o.length<2)throw new Error("TimeStampReq must have at least 2 items");var a=r(t,o[1]);i.messageImprint=ut.asn1.tsp.TSPUtil.parseMessageImprint(a);for(var u=2;u<o.length;u++){var c=o[u],l=t.substr(c,2);if("06"==l){var h=n(t,c);i.policy=e.hextooidstr(h)}"02"==l&&(i.nonce=n(t,c)),"01"==l&&(i.certreq=!0)}return i}},void 0!==ut&&ut||(ut={}),void 0!==ut.asn1&&ut.asn1||(ut.asn1={}),void 0!==ut.asn1.cades&&ut.asn1.cades||(ut.asn1.cades={}),ut.asn1.cades.SignaturePolicyIdentifier=function(t){var e=ut.asn1.cades,n=e.SignaturePolicyId;e.SignaturePolicyIdentifier.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.15",this.params=null,this.getValueArray=function(){return[new n(this.params)]},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.SignaturePolicyIdentifier,ut.asn1.cms.Attribute),ut.asn1.cades.SignaturePolicyId=function(t){var e=ut.asn1,n=e.DERSequence,r=e.DERObjectIdentifier,i=(e.x509.AlgorithmIdentifier,e.cades),s=i.SignaturePolicyId,o=i.OtherHashAlgAndValue;s.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];return e.push(new r(t.oid)),e.push(new o(t)),new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.SignaturePolicyId,ut.asn1.ASN1Object),ut.asn1.cades.OtherHashAlgAndValue=function(t){var e=Error,n=ut.asn1,r=n.DERSequence,i=n.DEROctetString,s=n.x509.AlgorithmIdentifier;n.cades.OtherHashAlgAndValue.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(null==t.alg)throw new e("property 'alg' not specified");if(null==t.hash&&null==t.cert)throw new e("property 'hash' nor 'cert' not specified");var n=null;if(null!=t.hash)n=t.hash;else if(null!=t.cert){if("string"!=typeof t.cert)throw new e("cert not string");var o=t.cert;-1!=t.cert.indexOf("-----BEGIN")&&(o=$t(t.cert)),n=ut.crypto.Util.hashHex(o,t.alg)}var a=[];return a.push(new s({name:t.alg})),a.push(new i({hex:n})),new r({array:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.OtherHashAlgAndValue,ut.asn1.ASN1Object),ut.asn1.cades.OtherHashValue=function(t){ut.asn1.cades.OtherHashValue.superclass.constructor.call(this);var e=Error,n=ut,r=(n.lang.String.isHex,n.asn1.DEROctetString);n.crypto.Util.hashHex;this.params=null,this.tohex=function(){var t=this.params;if(null==t.hash&&null==t.cert)throw new e("hash or cert not specified");var n=null;if(null!=t.hash)n=t.hash;else if(null!=t.cert){if("string"!=typeof t.cert)throw new e("cert not string");var i=t.cert;-1!=t.cert.indexOf("-----BEGIN")&&(i=$t(t.cert)),n=ut.crypto.Util.hashHex(i,"sha1")}return new r({hex:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.OtherHashValue,ut.asn1.ASN1Object),ut.asn1.cades.SignatureTimeStamp=function(t){var e=Error,n=ut,r=n.lang.String.isHex,i=n.asn1,s=i.ASN1Object;i.x509;i.cades.SignatureTimeStamp.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.14",this.params=null,this.getValueArray=function(){var t=this.params;if(null!=t.tst){if(r(t.tst))return(i=new s).hTLV=t.tst,[i];if(t.tst instanceof s)return[t.tst];throw new e("params.tst has wrong value")}if(null!=t.res){var n=t.res;if(n instanceof s&&(n=n.tohex()),"string"!=typeof n||!r(n))throw new e("params.res has wrong value");var i;ht.getTLVbyList(n,0,[1]);return(i=new s).hTLV=t.tst,[i]}},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.SignatureTimeStamp,ut.asn1.cms.Attribute),ut.asn1.cades.CompleteCertificateRefs=function(t){var e=Error,n=ut,r=n.asn1,i=r.DERSequence,s=r.cades,o=s.OtherCertID,a=n.lang.String.isHex;s.CompleteCertificateRefs.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.21",this.params=null,this.getValueArray=function(){for(var t=this.params,n=[],r=0;r<t.array.length;r++){var s=t.array[r];if("string"==typeof s)if(-1!=s.indexOf("-----BEGIN"))s={cert:s};else{if(!a(s))throw new e("unsupported value: "+s);s={hash:s}}null!=t.alg&&null==s.alg&&(s.alg=t.alg),null!=t.hasis&&null==s.hasis&&(s.hasis=t.hasis);var u=new o(s);n.push(u)}return[new i({array:n})]},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.CompleteCertificateRefs,ut.asn1.cms.Attribute),ut.asn1.cades.OtherCertID=function(t){var e=ut.asn1,n=e.DERSequence,r=e.cms.IssuerSerial,i=e.cades,s=i.OtherHashValue,o=i.OtherHashAlgAndValue;i.OtherCertID.superclass.constructor.call(this),this.params=t,this.tohex=function(){var t=this.params;"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?t={cert:t}:_isHex(t)&&(t={hash:t}));var e=[],i=null;if(i=null!=t.alg?new o(t):new s(t),e.push(i),null!=t.cert&&1==t.hasis||null!=t.issuer&&null!=t.serial){var a=new r(t);e.push(a)}return new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.OtherCertID,ut.asn1.ASN1Object),ut.asn1.cades.OtherHash=function(t){Error;var e=ut,n=e.asn1,r=(n.cms,n.cades),i=r.OtherHashAlgAndValue,s=r.OtherHashValue,o=(e.crypto.Util.hashHex,e.lang.String.isHex);r.OtherHash.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?t={cert:t}:o(t)&&(t={hash:t}));return(null!=t.alg?new i(t):new s(t)).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.OtherHash,ut.asn1.ASN1Object),ut.asn1.cades.CAdESUtil=new function(){},ut.asn1.cades.CAdESUtil.parseSignedDataForAddingUnsigned=function(t){return(new ut.asn1.cms.CMSParser).getCMSSignedData(t)},ut.asn1.cades.CAdESUtil.parseSignerInfoForAddingUnsigned=function(t,e,n){var r=ht,i=r.getChildIdx,s=r.getTLV,o=r.getV,a=ut.asn1,u=a.ASN1Object,c=a.cms,l=c.AttributeList,h=c.SignerInfo,f={},p=i(t,e);if(6!=p.length)throw"not supported items for SignerInfo (!=6)";var d=p.shift();f.version=s(t,d);var g=p.shift();f.si=s(t,g);var m=p.shift();f.digalg=s(t,m);var v=p.shift();f.sattrs=s(t,v);var y=p.shift();f.sigalg=s(t,y);var b=p.shift();f.sig=s(t,b),f.sigval=o(t,b);var w=null;return f.obj=new h,(w=new u).hTLV=f.version,f.obj.dCMSVersion=w,(w=new u).hTLV=f.si,f.obj.dSignerIdentifier=w,(w=new u).hTLV=f.digalg,f.obj.dDigestAlgorithm=w,(w=new u).hTLV=f.sattrs,f.obj.dSignedAttrs=w,(w=new u).hTLV=f.sigalg,f.obj.dSigAlg=w,(w=new u).hTLV=f.sig,f.obj.dSig=w,f.obj.dUnsignedAttrs=new l,f},void 0!==ut.asn1.csr&&ut.asn1.csr||(ut.asn1.csr={}),ut.asn1.csr.CertificationRequest=function(t){var e=ut.asn1,n=e.DERBitString,r=e.DERSequence,i=e.csr,s=(e.x509,i.CertificationRequestInfo);i.CertificationRequest.superclass.constructor.call(this),this.setByParam=function(t){this.params=t},this.sign=function(){var t=new s(this.params).tohex(),e=new ut.crypto.Signature({alg:this.params.sigalg});e.init(this.params.sbjprvkey),e.updateHex(t);var n=e.sign();this.params.sighex=n},this.getPEM=function(){return It(this.tohex(),"CERTIFICATE REQUEST")},this.tohex=function(){var t=this.params,e=new ut.asn1.csr.CertificationRequestInfo(this.params),i=new ut.asn1.x509.AlgorithmIdentifier({name:t.sigalg});if(null==t.sighex&&null!=t.sbjprvkey&&this.sign(),null==t.sighex)throw new Error("sighex or sbjprvkey parameter not defined");var s=new n({hex:"00"+t.sighex});return new r({array:[e,i,s]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.csr.CertificationRequest,ut.asn1.ASN1Object),ut.asn1.csr.CertificationRequestInfo=function(t){var e=ut.asn1,n=(e.DERBitString,e.DERSequence),r=e.DERInteger,i=e.DERUTF8String,s=e.DERTaggedObject,o=e.ASN1Util.newObject,a=e.csr,u=e.x509,c=u.X500Name,l=u.Extensions,h=u.SubjectPublicKeyInfo;a.AttributeList;a.CertificationRequestInfo.superclass.constructor.call(this),this.params=null,this.setByParam=function(t){null!=t&&(this.params=t)},this.tohex=function(){var t=this.params,e=[];if(e.push(new r({int:0})),e.push(new c(t.subject)),e.push(new h(Qt.getKey(t.sbjpubkey))),null!=t.attrs){var a=function(t){for(var e=Error,n=ut.asn1.x509.Extensions,r=[],i=0;i<t.length;i++){var s=t[i],o=s.attr;if("extensionRequest"==o){var a={seq:[{oid:"1.2.840.113549.1.9.14"},{set:[new n(s.ext)]}]};r.push(a)}else if("unstructuredName"==o){a={seq:[{oid:"1.2.840.113549.1.9.2"},{set:s.names}]};r.push(a)}else{if("challengePassword"!=o)throw new e("unknown CSR attribute");a={seq:[{oid:"1.2.840.113549.1.9.7"},{set:[{utf8str:s.password}]}]};r.push(a)}}return{set:r}}(t.attrs),u=o({tag:{tage:"a0",obj:a}});e.push(u)}else if(null!=t.extreq){var f=new l(t.extreq);u=o({tag:{tage:"a0",obj:{seq:[{oid:"1.2.840.113549.1.9.14"},{set:[f]}]}}});e.push(u)}else e.push(new s({tag:"a0",explicit:!1,obj:new i({str:""})}));return new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.csr.CertificationRequestInfo,ut.asn1.ASN1Object),ut.asn1.csr.AttributeList=function(t){},Zt(ut.asn1.csr.AttributeList,ut.asn1.ASN1Object),ut.asn1.csr.CSRUtil=new function(){},ut.asn1.csr.CSRUtil.newCSRPEM=function(t){return new ut.asn1.csr.CertificationRequest(t).getPEM()},ut.asn1.csr.CSRUtil.getParam=function(t,e){var n=ht,r=n.getV,i=n.getIdxbyList,s=n.getTLVbyList,o=n.getTLVbyListEx,a=n.getVbyListEx,u={};if(-1==t.indexOf("-----BEGIN CERTIFICATE REQUEST"))throw new Error("argument is not PEM file");var c=$t(t,"CERTIFICATE REQUEST");e&&(u.tbs=s(c,0,[0]));try{var l=o(c,0,[0,1]);if("3000"==l)u.subject={};else{var h=new re;u.subject=h.getX500Name(l)}}catch(t){}var f=o(c,0,[0,2]),p=Qt.getKey(f,null,"pkcs8pub");u.sbjpubkey=Qt.getPEM(p,"PKCS8PUB");var d=function(t){var e=i(t,0,[0,3,0,0],"06");return"2a864886f70d01090e"!=r(t,e)?null:s(t,0,[0,3,0,1,0],"30")}(c);h=new re;null!=d&&(u.extreq=h.getExtParamArray(d));try{var g=o(c,0,[1],"30");h=new re;u.sigalg=h.getAlgorithmIdentifierName(g)}catch(t){}try{var m=a(c,0,[2]);u.sighex=m}catch(t){}return u},ut.asn1.csr.CSRUtil.verifySignature=function(t){try{var e=null;if("string"==typeof t&&-1!=t.indexOf("-----BEGIN CERTIFICATE REQUEST")?e=ut.asn1.csr.CSRUtil.getParam(t,!0):"object"==typeof t&&null!=t.sbjpubkey&&null!=t.sigalg&&null!=t.sighex&&null!=t.tbs&&(e=t),null==e)return!1;var n=new ut.crypto.Signature({alg:e.sigalg});return n.init(e.sbjpubkey),n.updateHex(e.tbs),n.verify(e.sighex)}catch(t){return alert(t),!1}},void 0!==ut&&ut||(ut={}),void 0!==ut.asn1&&ut.asn1||(ut.asn1={}),void 0!==ut.asn1.ocsp&&ut.asn1.ocsp||(ut.asn1.ocsp={}),ut.asn1.ocsp.DEFAULT_HASH="sha1",ut.asn1.ocsp.OCSPResponse=function(t){ut.asn1.ocsp.OCSPResponse.superclass.constructor.call(this);ut.asn1.DEREnumerated;var e=ut.asn1.ASN1Util.newObject,n=ut.asn1.ocsp.ResponseBytes,r=["successful","malformedRequest","internalError","tryLater","_not_used_","sigRequired","unauthorized"];this.params=null,this._getStatusCode=function(){var t=this.params.resstatus;return"number"==typeof t?t:"string"!=typeof t?-1:r.indexOf(t)},this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params,r=this._getStatusCode();if(-1==r)throw new Error("responseStatus not supported: "+t.resstatus);if(0!=r)return e({seq:[{enum:{int:r}}]}).tohex();var i=new n(t);return e({seq:[{enum:{int:0}},{tag:{tag:"a0",explicit:!0,obj:i}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.OCSPResponse,ut.asn1.ASN1Object),ut.asn1.ocsp.ResponseBytes=function(t){ut.asn1.ocsp.ResponseBytes.superclass.constructor.call(this);var e=ut.asn1,n=e.DERSequence,r=e.DERObjectIdentifier,i=e.DEROctetString,s=e.ocsp.BasicOCSPResponse;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params;if("ocspBasic"!=t.restype)throw new Error("not supported responseType: "+t.restype);var e=new s(t),o=[];return o.push(new r({name:"ocspBasic"})),o.push(new i({hex:e.tohex()})),new n({array:o}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.ResponseBytes,ut.asn1.ASN1Object),ut.asn1.ocsp.BasicOCSPResponse=function(t){ut.asn1.ocsp.BasicOCSPResponse.superclass.constructor.call(this);var e=Error,n=ut.asn1,r=n.ASN1Object,i=n.DERSequence,s=(n.DERGeneralizedTime,n.DERTaggedObject),o=n.DERBitString,a=(n.x509.Extensions,n.x509.AlgorithmIdentifier),u=n.ocsp;u.ResponderID;_SingleResponseList=u.SingleResponseList,_ResponseData=u.ResponseData,this.params=null,this.setByParam=function(t){this.params=t},this.sign=function(){var t=this.params,e=t.tbsresp.tohex(),n=new ut.crypto.Signature({alg:t.sigalg});n.init(t.reskey),n.updateHex(e),t.sighex=n.sign()},this.tohex=function(){var t=this.params;null==t.tbsresp&&(t.tbsresp=new _ResponseData(t)),null==t.sighex&&null!=t.reskey&&this.sign();var n=[];if(n.push(t.tbsresp),n.push(new a({name:t.sigalg})),n.push(new o({hex:"00"+t.sighex})),null!=t.certs&&null!=t.certs.length){for(var u=[],c=0;c<t.certs.length;c++){var l=t.certs[c],h=null;if(ht.isASN1HEX(l))h=l;else{if(!l.match(/-----BEGIN/))throw new e("certs["+c+"] not hex or PEM");h=$t(l)}u.push(new r({tlv:h}))}var f=new i({array:u});n.push(new s({tag:"a0",explicit:!0,obj:f}))}return new i({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.BasicOCSPResponse,ut.asn1.ASN1Object),ut.asn1.ocsp.ResponseData=function(t){ut.asn1.ocsp.ResponseData.superclass.constructor.call(this);var e=Error,n=ut.asn1,r=n.DERSequence,i=n.DERGeneralizedTime,s=n.DERTaggedObject,o=n.x509.Extensions,a=n.ocsp,u=a.ResponderID;_SingleResponseList=a.SingleResponseList,this.params=null,this.tohex=function(){var t=this.params;null!=t.respid&&new e("respid not specified"),null!=t.prodat&&new e("prodat not specified"),null!=t.array&&new e("array not specified");var n=[];if(n.push(new u(t.respid)),n.push(new i(t.prodat)),n.push(new _SingleResponseList(t.array)),null!=t.ext){var a=new o(t.ext);n.push(new s({tag:"a1",explicit:!0,obj:a}))}return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.ResponseData,ut.asn1.ASN1Object),ut.asn1.ocsp.ResponderID=function(t){ut.asn1.ocsp.ResponderID.superclass.constructor.call(this);var e=ut,n=e.asn1,r=n.ASN1Util.newObject,i=n.x509.X500Name,s=e.lang.String.isHex,o=Error;this.params=null,this.tohex=function(){var t=this.params;if(null!=t.key){var e,n=null;if("string"==typeof t.key){if(s(t.key)&&(n=t.key),t.key.match(/-----BEGIN CERTIFICATE/))null!=(e=new re(t.key).getExtSubjectKeyIdentifier())&&(n=e.kid.hex)}else if(t.key instanceof re)null!=(e=t.key.getExtSubjectKeyIdentifier())&&(n=e.kid.hex);if(null==n)throw new o("wrong key member value");return r({tag:{tag:"a2",explicit:!0,obj:{octstr:{hex:n}}}}).tohex()}if(null!=t.name){var a=null;if("string"==typeof t.name&&t.name.match(/-----BEGIN CERTIFICATE/))a=new re(t.name).getSubject();else t.name instanceof re?a=t.name.getSubject():"object"!=typeof t.name||null==t.name.array&&null==t.name.str||(a=t.name);if(null==a)throw new o("wrong name member value");return r({tag:{tag:"a1",explicit:!0,obj:new i(a)}}).tohex()}throw new o("key or name not specified")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.ResponderID,ut.asn1.ASN1Object),ut.asn1.ocsp.SingleResponseList=function(t){ut.asn1.ocsp.SingleResponseList.superclass.constructor.call(this);var e=ut.asn1,n=e.DERSequence,r=e.ocsp.SingleResponse;this.params=null,this.tohex=function(){var t=this.params;if("object"!=typeof t||null==t.length)throw new Error("params not specified properly");for(var e=[],i=0;i<t.length;i++)e.push(new r(t[i]));return new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.SingleResponseList,ut.asn1.ASN1Object),ut.asn1.ocsp.SingleResponse=function(t){var e=Error,n=ut.asn1,r=n.DERSequence,i=n.DERGeneralizedTime,s=n.DERTaggedObject,o=n.ocsp,a=o.CertID,u=o.CertStatus,c=n.x509.Extensions;o.SingleResponse.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,n=[];if(null==t.certid)throw new e("certid unspecified");if(null==t.status)throw new e("status unspecified");if(null==t.thisupdate)throw new e("thisupdate unspecified");if(n.push(new a(t.certid)),n.push(new u(t.status)),n.push(new i(t.thisupdate)),null!=t.nextupdate){var o=new i(t.nextupdate);n.push(new s({tag:"a0",explicit:!0,obj:o}))}if(null!=t.ext){var l=new c(t.ext);n.push(new s({tag:"a1",explicit:!0,obj:l}))}return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.SingleResponse,ut.asn1.ASN1Object),ut.asn1.ocsp.CertID=function(t){var e=ut,n=e.asn1,r=n.DEROctetString,i=n.DERInteger,s=n.DERSequence,o=n.x509.AlgorithmIdentifier,a=n.ocsp,u=(a.DEFAULT_HASH,e.crypto.Util.hashHex),c=re,l=ht.getVbyList;a.CertID.superclass.constructor.call(this),this.DEFAULT_HASH="sha1",this.params=null,this.setByValue=function(t,e,n,r){null==r&&(r=this.DEFAULT_HASH),this.params={alg:r,issname:t,isskey:e,sbjsn:n}},this.setByCert=function(t,e,n){null==n&&(n=this.DEFAULT_HASH),this.params={alg:n,issuerCert:t,subjectCert:e}},this.getParamByCerts=function(t,e,n){null==n&&(n=this.DEFAULT_HASH);var r=new c(t),i=new c(e),s=u(r.getSubjectHex(),n),o=r.getPublicKeyHex();return{alg:n,issname:s,isskey:u(l(o,0,[1],"03",!0),n),sbjsn:i.getSerialNumberHex()}},this.tohex=function(){if("object"!=typeof this.params)throw new Error("params not set");var t,e,n,a,u=this.params;if(a=null==u.alg?this.DEFAULT_HASH:u.alg,null!=u.issuerCert&&null!=u.subjectCert){var c=this.getParamByCerts(u.issuerCert,u.subjectCert,a);t=c.issname,e=c.isskey,n=c.sbjsn}else{if(null==u.issname||null==u.isskey||null==u.sbjsn)throw new Error("required param members not defined");t=u.issname,e=u.isskey,n=u.sbjsn}var l=new o({name:a}),h=new r({hex:t}),f=new r({hex:e}),p=new i({hex:n}),d=new s({array:[l,h,f,p]});return this.hTLV=d.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.CertID,ut.asn1.ASN1Object),ut.asn1.ocsp.CertStatus=function(t){ut.asn1.ocsp.CertStatus.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if("good"==t.status)return"8000";if("unknown"==t.status)return"8200";if("revoked"==t.status){var e=[{gentime:{str:t.time}}];null!=t.reason&&e.push({tag:{tag:"a0",explicit:!0,obj:{enum:{int:t.reason}}}});var n={tag:"a1",explicit:!1,obj:{seq:e}};return ut.asn1.ASN1Util.newObject({tag:n}).tohex()}throw new Error("bad status")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.CertStatus,ut.asn1.ASN1Object),ut.asn1.ocsp.Request=function(t){var e=ut.asn1,n=e.DERSequence,r=e.ocsp;if(r.Request.superclass.constructor.call(this),this.dReqCert=null,this.dExt=null,this.tohex=function(){var t=[];if(null===this.dReqCert)throw"reqCert not set";t.push(this.dReqCert);var e=new n({array:t});return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t){var i=new r.CertID(t);this.dReqCert=i}},Zt(ut.asn1.ocsp.Request,ut.asn1.ASN1Object),ut.asn1.ocsp.TBSRequest=function(t){var e=ut.asn1,n=e.DERSequence,r=e.ocsp;r.TBSRequest.superclass.constructor.call(this),this.version=0,this.dRequestorName=null,this.dRequestList=[],this.dRequestExt=null,this.setRequestListByParam=function(t){for(var e=[],n=0;n<t.length;n++){var i=new r.Request(t[0]);e.push(i)}this.dRequestList=e},this.tohex=function(){var t=[];if(0!==this.version)throw"not supported version: "+this.version;if(null!==this.dRequestorName)throw"requestorName not supported";var e=new n({array:this.dRequestList});if(t.push(e),null!==this.dRequestExt)throw"requestExtensions not supported";var r=new n({array:t});return this.hTLV=r.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&void 0!==t.reqList&&this.setRequestListByParam(t.reqList)},Zt(ut.asn1.ocsp.TBSRequest,ut.asn1.ASN1Object),ut.asn1.ocsp.OCSPRequest=function(t){var e=ut.asn1,n=e.DERSequence,r=e.ocsp;if(r.OCSPRequest.superclass.constructor.call(this),this.dTbsRequest=null,this.dOptionalSignature=null,this.tohex=function(){var t=[];if(null===this.dTbsRequest)throw"tbsRequest not set";if(t.push(this.dTbsRequest),null!==this.dOptionalSignature)throw"optionalSignature not supported";var e=new n({array:t});return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&void 0!==t.reqList){var i=new r.TBSRequest(t);this.dTbsRequest=i}},Zt(ut.asn1.ocsp.OCSPRequest,ut.asn1.ASN1Object),ut.asn1.ocsp.OCSPUtil={},ut.asn1.ocsp.OCSPUtil.getRequestHex=function(t,e,n){var r=ut.asn1.ocsp;void 0===n&&(n=r.DEFAULT_HASH);var i={alg:n,issuerCert:t,subjectCert:e};return new r.OCSPRequest({reqList:[i]}).tohex()},ut.asn1.ocsp.OCSPUtil.getOCSPResponseInfo=function(t){var e=ht,n=e.getVbyList,r=e.getVbyListEx,i=e.getIdxbyList,s=(e.getIdxbyListEx,e.getV),o={};try{var a=r(t,0,[0],"0a");o.responseStatus=parseInt(a,16)}catch(t){}if(0!==o.responseStatus)return o;try{var u=i(t,0,[1,0,1,0,0,2,0,1]);"80"===t.substr(u,2)?o.certStatus="good":"a1"===t.substr(u,2)?(o.certStatus="revoked",o.revocationTime=xt(n(t,u,[0]))):"82"===t.substr(u,2)&&(o.certStatus="unknown")}catch(t){}try{var c=i(t,0,[1,0,1,0,0,2,0,2]);o.thisUpdate=xt(s(t,c))}catch(t){}try{var l=i(t,0,[1,0,1,0,0,2,0,3]);"a0"===t.substr(l,2)&&(o.nextUpdate=xt(n(t,l,[0])))}catch(t){}return o},ut.asn1.ocsp.OCSPParser=function(){var t=Error,e=re,n=new e,r=ht,i=r.getV,s=r.getTLV,o=r.getIdxbyList,a=r.getVbyList,u=r.getTLVbyList,c=r.getVbyListEx,l=r.getTLVbyListEx,h=r.getChildIdx;this.getOCSPRequest=function(e){var n=h(e,0);if(1!=n.length&&2!=n.length)throw new t("wrong number elements: "+n.length);return this.getTBSRequest(s(e,n[0]))},this.getTBSRequest=function(t){var e={},r=l(t,0,[0],"30");e.array=this.getRequestList(r);var i=l(t,0,["[2]",0],"30");return null!=i&&(e.ext=n.getExtParamArray(i)),e},this.getRequestList=function(t){for(var e=[],n=h(t,0),r=0;r<n.length;r++){t=s(t,n[r]);e.push(this.getRequest(t))}return e},this.getRequest=function(e){var r=h(e,0);if(1!=r.length&&2!=r.length)throw new t("wrong number elements: "+r.length);var i=this.getCertID(s(e,r[0]));if(2==r.length){var a=o(e,0,[1,0]);i.ext=n.getExtParamArray(s(e,a))}return i},this.getCertID=function(n){var r=h(n,0);if(4!=r.length)throw new t("wrong number elements: "+r.length);var o=new e,a={};return a.alg=o.getAlgorithmIdentifierName(s(n,r[0])),a.issname=i(n,r[1]),a.isskey=i(n,r[2]),a.sbjsn=i(n,r[3]),a},this.getOCSPResponse=function(t){var e,n=h(t,0),r=i(t,n[0]),s=parseInt(r);if(1==n.length)return{resstatus:s};var o=u(t,0,[1,0]);return(e=this.getResponseBytes(o)).resstatus=s,e},this.getResponseBytes=function(t){var e,n=h(t,0),r=u(t,0,[1,0]);e=this.getBasicOCSPResponse(r);var s=i(t,n[0]);return e.restype=ut.asn1.x509.OID.oid2name(zt(s)),e},this.getBasicOCSPResponse=function(t){var e,n=h(t,0);e=this.getResponseData(s(t,n[0]));var r=new re;e.alg=r.getAlgorithmIdentifierName(s(t,n[1]));var o=i(t,n[2]);e.sighex=o.substr(2);var a=c(t,0,["[0]"]);if(null!=a){for(var u=h(a,0),l=[],f=0;f<u.length;f++){var p=s(a,u[f]);l.push(p)}e.certs=l}return e},this.getResponseData=function(t){var e=h(t,0),n=e.length,r={},o=0;"a0"==t.substr(e[0],2)&&o++,r.respid=this.getResponderID(s(t,e[o++]));var a=i(t,e[o++]);if(r.prodat=xt(a),r.array=this.getSingleResponseList(s(t,e[o++])),"a1"==t.substr(e[n-1],2)){var c=u(t,e[n-1],[0]),l=new re;r.ext=l.getExtParamArray(c)}return r},this.getResponderID=function(t){var e={};if("a2"==t.substr(0,2)){var n=a(t,0,[0]);e.key=n}if("a1"==t.substr(0,2)){var r=u(t,0,[0]),i=new re;e.name=i.getX500Name(r)}return e},this.getSingleResponseList=function(t){for(var e=h(t,0),n=[],r=0;r<e.length;r++){var i=this.getSingleResponse(s(t,e[r]));n.push(i)}return n},this.getSingleResponse=function(t){var e=h(t,0),n={},r=this.getCertID(s(t,e[0]));n.certid=r;var o=this.getCertStatus(s(t,e[1]));if(n.status=o,"18"==t.substr(e[2],2)){var c=i(t,e[2]);n.thisupdate=xt(c)}for(var l=3;l<e.length;l++){if("a0"==t.substr(e[l],2)){var f=a(t,e[l],[0],"18");n.nextupdate=xt(f)}if("a1"==t.substr(e[l],2)){var p=new re,d=u(t,0,[l,0]);n.ext=p.getExtParamArray(d)}}return n},this.getCertStatus=function(t){var e={};if("8000"==t)return{status:"good"};if("8200"==t)return{status:"unknown"};if("a1"==t.substr(0,2)){e.status="revoked";var n=xt(a(t,0,[0]));e.time=n}return e}},void 0!==ut&&ut||(ut={}),void 0!==ut.lang&&ut.lang||(ut.lang={}),ut.lang.String=function(){},"function"==typeof t?(ct=function(e){return mt(t.from(e,"utf8").toString("base64"))},lt=function(e){return t.from(vt(e),"base64").toString("utf8")}):(ct=function(t){return yt(_t(Mt(t)))},lt=function(t){return decodeURIComponent(Pt(bt(t)))}),ut.lang.String.isInteger=function(t){return!!t.match(/^[0-9]+$/)||!!t.match(/^-[0-9]+$/)},ut.lang.String.isHex=function(t){return Ut(t)},ut.lang.String.isBase64=function(t){return!(!(t=t.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||t.length%4!=0)},ut.lang.String.isBase64URL=function(t){return!t.match(/[+/=]/)&&(t=vt(t),ut.lang.String.isBase64(t))},ut.lang.String.isIntegerArray=function(t){return!!(t=t.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},ut.lang.String.isPrintable=function(t){return null!==t.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},ut.lang.String.isIA5=function(t){return null!==t.match(/^[\x20-\x21\x23-\x7f]*$/)},ut.lang.String.isMail=function(t){return null!==t.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};function Kt(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},n=function(t){var n="",r=parseInt(t,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var s="",o=0;o<i;o++)s+="0";r=s+r;for(o=0;o<r.length-1;o+=7){var a=r.substr(o,7);o!=r.length-7&&(a="1"+a),n+=e(parseInt(a,2))}return n};try{if(!t.match(/^[0-9.]+$/))return null;var r="",i=t.split("."),s=40*parseInt(i[0],10)+parseInt(i[1],10);r+=e(s),i.splice(0,2);for(var o=0;o<i.length;o++)r+=n(i[o]);return r}catch(t){return null}}function zt(t){if(!Ut(t))return null;try{var e=[],n=t.substr(0,2),r=parseInt(n,16);e[0]=new String(Math.floor(r/40)),e[1]=new String(r%40);for(var i=t.substr(2),s=[],o=0;o<i.length/2;o++)s.push(parseInt(i.substr(2*o,2),16));var a=[],u="";for(o=0;o<s.length;o++)128&s[o]?u+=Gt((127&s[o]).toString(2),7):(u+=Gt((127&s[o]).toString(2),7),a.push(new String(parseInt(u,2))),u="");var c=e.join(".");return a.length>0&&(c=c+"."+a.join(".")),c}catch(t){return null}}var Gt=function(t,e,n){return null==n&&(n="0"),t.length>=e?t:new Array(e-t.length+1).join(n)+t};function Wt(t){if(t.length%2!=0)return-1;if(null==(t=t.toLowerCase()).match(/^[0-9a-f]+$/))return-1;try{var e=t.substr(0,2);if("00"==e)return parseInt(t.substr(2),16);var n=parseInt(e,16);if(n>7)return-1;var r=t.substr(2),i=parseInt(r,16).toString(2);"0"==i&&(i="00000000"),i=i.slice(0,0-n);var s=parseInt(i,2);return NaN==s?-1:s}catch(t){return-1}}function Yt(t){if("number"!=typeof t)return null;if(t<0)return null;var e=Number(t).toString(2),n=8-e.length%8;8==n&&(n=0),e+=Gt("",n,"0");var r=parseInt(e,2).toString(16);return r.length%2==1&&(r="0"+r),"0"+n+r}function Xt(t){if("string"!=typeof t)return null;if(t.length%2!=0)return null;if(!t.match(/^[0-9a-f]+$/))return null;try{var e=parseInt(t.substr(0,2),16);if(e<0||7<e)return null;for(var n=t.substr(2),r="",i=0;i<n.length;i+=2){var s=n.substr(i,2),o=parseInt(s,16).toString(2);r+=o=("0000000"+o).slice(-8)}return r.substr(0,r.length-e)}catch(t){return null}}function Jt(t,e){for(var n=0,r=0;r<t.length;r++)n|=1<<e[t[r]];var i=n.toString(2),s="";for(r=i.length-1;r>=0;r--)s+=i[r];return s}function Zt(t,e){var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e)}void 0!==ut&&ut||(ut={}),void 0!==ut.crypto&&ut.crypto||(ut.crypto={}),ut.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:g.algo.MD5,sha1:g.algo.SHA1,sha224:g.algo.SHA224,sha256:g.algo.SHA256,sha384:g.algo.SHA384,sha512:g.algo.SHA512,ripemd160:g.algo.RIPEMD160},this.getDigestInfoHex=function(t,e){if(void 0===this.DIGESTINFOHEAD[e])throw"alg not supported in Util.DIGESTINFOHEAD: "+e;return this.DIGESTINFOHEAD[e]+t},this.getPaddedDigestInfoHex=function(t,e,n){var r=this.getDigestInfoHex(t,e),i=n/4;if(r.length+22>i)throw"key is too short for SigAlg: keylen="+n+","+e;for(var s="0001",o="00"+r,a="",u=i-s.length-o.length,c=0;c<u;c+=2)a+="ff";return s+a+o},this.hashString=function(t,e){return new ut.crypto.MessageDigest({alg:e}).digestString(t)},this.hashHex=function(t,e){return new ut.crypto.MessageDigest({alg:e}).digestHex(t)},this.sha1=function(t){return this.hashString(t,"sha1")},this.sha256=function(t){return this.hashString(t,"sha256")},this.sha256Hex=function(t){return this.hashHex(t,"sha256")},this.sha512=function(t){return this.hashString(t,"sha512")},this.sha512Hex=function(t){return this.hashHex(t,"sha512")},this.isKey=function(t){return t instanceof nt||t instanceof ut.crypto.DSA||t instanceof ut.crypto.ECDSA}},ut.crypto.Util.md5=function(t){return new ut.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(t)},ut.crypto.Util.ripemd160=function(t){return new ut.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(t)},ut.crypto.Util.SECURERANDOMGEN=new Q,ut.crypto.Util.getRandomHexOfNbytes=function(t){var e=new Array(t);return ut.crypto.Util.SECURERANDOMGEN.nextBytes(e),dt(e)},ut.crypto.Util.getRandomBigIntegerOfNbytes=function(t){return new x(ut.crypto.Util.getRandomHexOfNbytes(t),16)},ut.crypto.Util.getRandomHexOfNbits=function(t){var e=t%8,n=new Array((t-e)/8+1);return ut.crypto.Util.SECURERANDOMGEN.nextBytes(n),n[0]=(255<<e&255^255)&n[0],dt(n)},ut.crypto.Util.getRandomBigIntegerOfNbits=function(t){return new x(ut.crypto.Util.getRandomHexOfNbits(t),16)},ut.crypto.Util.getRandomBigIntegerZeroToMax=function(t){for(var e=t.bitLength();;){var n=ut.crypto.Util.getRandomBigIntegerOfNbits(e);if(-1!=t.compareTo(n))return n}},ut.crypto.Util.getRandomBigIntegerMinToMax=function(t,e){var n=t.compareTo(e);if(1==n)throw"biMin is greater than biMax";if(0==n)return t;var r=e.subtract(t);return ut.crypto.Util.getRandomBigIntegerZeroToMax(r).add(t)},ut.crypto.MessageDigest=function(t){this.setAlgAndProvider=function(t,e){if(null!==(t=ut.crypto.MessageDigest.getCanonicalAlgName(t))&&void 0===e&&(e=ut.crypto.Util.DEFAULTPROVIDER[t]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)&&"cryptojs"==e){try{this.md=ut.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[t].create()}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=g.enc.Hex.parse(t);this.md.update(e)},this.digest=function(){return this.md.finalize().toString(g.enc.Hex)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}if(-1!=":sha256:".indexOf(t)&&"sjcl"==e){try{this.md=new sjcl.hash.sha256}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=sjcl.codec.hex.toBits(t);this.md.update(e)},this.digest=function(){var t=this.md.finalize();return sjcl.codec.hex.fromBits(t)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==t&&void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=ut.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},ut.crypto.MessageDigest.getCanonicalAlgName=function(t){return"string"==typeof t&&(t=(t=t.toLowerCase()).replace(/-/,"")),t},ut.crypto.MessageDigest.getHashLength=function(t){var e=ut.crypto.MessageDigest,n=e.getCanonicalAlgName(t);if(void 0===e.HASHLENGTH[n])throw"not supported algorithm: "+t;return e.HASHLENGTH[n]},ut.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},ut.crypto.Mac=function(t){this.setAlgAndProvider=function(t,e){if(null==(t=t.toLowerCase())&&(t="hmacsha1"),"hmac"!=(t=t.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+t;void 0===e&&(e=ut.crypto.Util.DEFAULTPROVIDER[t]),this.algProv=t+"/"+e;var n=t.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(n)&&"cryptojs"==e){try{var r=ut.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[n];this.mac=g.algo.HMAC.create(r,this.pass)}catch(t){throw"setAlgAndProvider hash alg set fail hashAlg="+n+"/"+t}this.updateString=function(t){this.mac.update(t)},this.updateHex=function(t){var e=g.enc.Hex.parse(t);this.mac.update(e)},this.doFinal=function(){return this.mac.finalize().toString(g.enc.Hex)},this.doFinalString=function(t){return this.updateString(t),this.doFinal()},this.doFinalHex=function(t){return this.updateHex(t),this.doFinal()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(t){if("string"==typeof t){var e=t;return t.length%2!=1&&t.match(/^[0-9A-Fa-f]+$/)||(e=Ft(t)),void(this.pass=g.enc.Hex.parse(e))}if("object"!=typeof t)throw"KJUR.crypto.Mac unsupported password type: "+t;e=null;if(void 0!==t.hex){if(t.hex.length%2!=0||!t.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+t.hex;e=t.hex}if(void 0!==t.utf8&&(e=wt(t.utf8)),void 0!==t.rstr&&(e=Ft(t.rstr)),void 0!==t.b64&&(e=b(t.b64)),void 0!==t.b64u&&(e=bt(t.b64u)),null==e)throw"KJUR.crypto.Mac unsupported password type: "+t;this.pass=g.enc.Hex.parse(e)},void 0!==t&&(void 0!==t.pass&&this.setPassword(t.pass),void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=ut.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},ut.crypto.Signature=function(t){var e=null;if(this._setAlgNames=function(){var t=this.algName.match(/^(.+)with(.+)$/);t&&(this.mdAlgName=t[1].toLowerCase(),this.pubkeyAlgName=t[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(t,e){for(var n="",r=e/4-t.length,i=0;i<r;i++)n+="0";return n+t},this.setAlgAndProvider=function(t,e){if(this._setAlgNames(),"cryptojs/jsrsa"!=e)throw new Error("provider not supported: "+e);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new ut.crypto.MessageDigest({alg:this.mdAlgName})}catch(t){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+t)}this.init=function(t,e){var n=null;try{n=void 0===e?Qt.getKey(t):Qt.getKey(t,e)}catch(t){throw"init failed:"+t}if(!0===n.isPrivate)this.prvKey=n,this.state="SIGN";else{if(!0!==n.isPublic)throw"init failed.:"+n;this.pubKey=n,this.state="VERIFY"}},this.updateString=function(t){this.md.updateString(t)},this.updateHex=function(t){this.md.updateHex(t)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0===this.prvKey&&void 0!==this.ecprvhex&&void 0!==this.eccurvename&&void 0!==ut.crypto.ECDSA&&(this.prvKey=new ut.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof nt&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof nt&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof ut.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof ut.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(t){return this.updateString(t),this.sign()},this.signHex=function(t){return this.updateHex(t),this.sign()},this.verify=function(t){if(this.sHashHex=this.md.digest(),void 0===this.pubKey&&void 0!==this.ecpubhex&&void 0!==this.eccurvename&&void 0!==ut.crypto.ECDSA&&(this.pubKey=new ut.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof nt&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,t,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof nt&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==ut.crypto.ECDSA&&this.pubKey instanceof ut.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==ut.crypto.DSA&&this.pubKey instanceof ut.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(t,e){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(t){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(t){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(t){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(t){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=t,void 0!==t&&(void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov?this.provName=ut.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=t.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==t.psssaltlen&&(this.pssSaltLen=t.psssaltlen),void 0!==t.prvkeypem)){if(void 0!==t.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{e=Qt.getKey(t.prvkeypem);this.init(e)}catch(t){throw"fatal error to load pem private key: "+t}}},ut.crypto.Cipher=function(t){},ut.crypto.Cipher.encrypt=function(t,e,n){if(e instanceof nt&&e.isPublic){var r=ut.crypto.Cipher.getAlgByKeyAndName(e,n);if("RSA"===r)return e.encrypt(t);if("RSAOAEP"===r)return e.encryptOAEP(t,"sha1");var i=r.match(/^RSAOAEP(\d+)$/);if(null!==i)return e.encryptOAEP(t,"sha"+i[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+n}throw"Cipher.encrypt: unsupported key or algorithm"},ut.crypto.Cipher.decrypt=function(t,e,n){if(e instanceof nt&&e.isPrivate){var r=ut.crypto.Cipher.getAlgByKeyAndName(e,n);if("RSA"===r)return e.decrypt(t);if("RSAOAEP"===r)return e.decryptOAEP(t,"sha1");var i=r.match(/^RSAOAEP(\d+)$/);if(null!==i)return e.decryptOAEP(t,"sha"+i[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+n}throw"Cipher.decrypt: unsupported key or algorithm"},ut.crypto.Cipher.getAlgByKeyAndName=function(t,e){if(t instanceof nt){if(-1!=":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(e))return e;if(null==e)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+e}throw"getAlgByKeyAndName: not supported algorithm name: "+e},ut.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040022":"secp384r1","2b81040023":"secp521r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}},void 0!==ut&&ut||(ut={}),void 0!==ut.crypto&&ut.crypto||(ut.crypto={}),ut.crypto.ECDSA=function(t){var e=Error,n=x,r=st,i=ut.crypto.ECDSA,s=ut.crypto.ECParameterDB,o=i.getName,a=ht,u=a.getVbyListEx,c=a.isASN1HEX,l=new Q;this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(t){return new n(t.bitLength(),l).mod(t.subtract(n.ONE)).add(n.ONE)},this.setNamedCurve=function(t){this.ecparams=s.getByName(t),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=t},this.setPrivateKeyHex=function(t){this.isPrivate=!0,this.prvKeyHex=t},this.setPublicKeyHex=function(t){this.isPublic=!0,this.pubKeyHex=t},this.getPublicKeyXYHex=function(){var t=this.pubKeyHex;if("04"!==t.substr(0,2))throw"this method supports uncompressed format(04) only";var e=this.ecparams.keycharlen;if(t.length!==2+2*e)throw"malformed public key hex length";var n={};return n.x=t.substr(2,e),n.y=t.substr(2+e),n},this.getShortNISTPCurveName=function(){var t=this.curveName;return"secp256r1"===t||"NIST P-256"===t||"P-256"===t||"prime256v1"===t?"P-256":"secp384r1"===t||"NIST P-384"===t||"P-384"===t?"P-384":"secp521r1"===t||"NIST P-521"===t||"P-521"===t?"P-521":null},this.generateKeyPairHex=function(){var t=this.ecparams.n,e=this.getBigRandom(t),n=this.ecparams.keycharlen,r=("0000000000"+e.toString(16)).slice(-n);return this.setPrivateKeyHex(r),{ecprvhex:r,ecpubhex:this.generatePublicKeyHex()}},this.generatePublicKeyHex=function(){var t=new n(this.prvKeyHex,16),e=this.ecparams.G.multiply(t),r=e.getX().toBigInteger(),i=e.getY().toBigInteger(),s=this.ecparams.keycharlen,o="04"+("0000000000"+r.toString(16)).slice(-s)+("0000000000"+i.toString(16)).slice(-s);return this.setPublicKeyHex(o),o},this.signWithMessageHash=function(t){return this.signHex(t,this.prvKeyHex)},this.signHex=function(t,e){var r=new n(e,16),s=this.ecparams.n,o=new n(t.substring(0,this.ecparams.keycharlen),16);do{var a=this.getBigRandom(s),u=this.ecparams.G.multiply(a).getX().toBigInteger().mod(s)}while(u.compareTo(n.ZERO)<=0);var c=a.modInverse(s).multiply(o.add(r.multiply(u))).mod(s);return i.biRSSigToASN1Sig(u,c)},this.sign=function(t,e){var r=e,i=this.ecparams.n,s=n.fromByteArrayUnsigned(t);do{var o=this.getBigRandom(i),a=this.ecparams.G.multiply(o).getX().toBigInteger().mod(i)}while(a.compareTo(x.ZERO)<=0);var u=o.modInverse(i).multiply(s.add(r.multiply(a))).mod(i);return this.serializeSig(a,u)},this.verifyWithMessageHash=function(t,e){return this.verifyHex(t,e,this.pubKeyHex)},this.verifyHex=function(t,e,s){try{var o,a,u=i.parseSigHex(e);o=u.r,a=u.s;var c=r.decodeFromHex(this.ecparams.curve,s),l=new n(t.substring(0,this.ecparams.keycharlen),16);return this.verifyRaw(l,o,a,c)}catch(t){return!1}},this.verify=function(t,e,i){var s,o,a;if(Bitcoin.Util.isArray(e)){var u=this.parseSig(e);s=u.r,o=u.s}else{if("object"!=typeof e||!e.r||!e.s)throw"Invalid value for signature";s=e.r,o=e.s}if(i instanceof st)a=i;else{if(!Bitcoin.Util.isArray(i))throw"Invalid format for pubkey value, must be byte array or ECPointFp";a=r.decodeFrom(this.ecparams.curve,i)}var c=n.fromByteArrayUnsigned(t);return this.verifyRaw(c,s,o,a)},this.verifyRaw=function(t,e,r,i){var s=this.ecparams.n,o=this.ecparams.G;if(e.compareTo(n.ONE)<0||e.compareTo(s)>=0)return!1;if(r.compareTo(n.ONE)<0||r.compareTo(s)>=0)return!1;var a=r.modInverse(s),u=t.multiply(a).mod(s),c=e.multiply(a).mod(s);return o.multiply(u).add(i.multiply(c)).getX().toBigInteger().mod(s).equals(e)},this.serializeSig=function(t,e){var n=t.toByteArraySigned(),r=e.toByteArraySigned(),i=[];return i.push(2),i.push(n.length),(i=i.concat(n)).push(2),i.push(r.length),(i=i.concat(r)).unshift(i.length),i.unshift(48),i},this.parseSig=function(t){var e;if(48!=t[0])throw new Error("Signature not a valid DERSequence");if(2!=t[e=2])throw new Error("First element in signature must be a DERInteger");var r=t.slice(e+2,e+2+t[e+1]);if(2!=t[e+=2+t[e+1]])throw new Error("Second element in signature must be a DERInteger");var i=t.slice(e+2,e+2+t[e+1]);return e+=2+t[e+1],{r:n.fromByteArrayUnsigned(r),s:n.fromByteArrayUnsigned(i)}},this.parseSigCompact=function(t){if(65!==t.length)throw"Signature has the wrong length";var e=t[0]-27;if(e<0||e>7)throw"Invalid signature type";var r=this.ecparams.n;return{r:n.fromByteArrayUnsigned(t.slice(1,33)).mod(r),s:n.fromByteArrayUnsigned(t.slice(33,65)).mod(r),i:e}},this.readPKCS5PrvKeyHex=function(t){if(!1===c(t))throw new Error("not ASN.1 hex string");var e,n,r;try{e=u(t,0,["[0]",0],"06"),n=u(t,0,[1],"04");try{r=u(t,0,["[1]",0],"03")}catch(t){}}catch(t){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=o(e),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(r),this.setPrivateKeyHex(n),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var n,r,i;try{u(t,0,[1,0],"06"),n=u(t,0,[1,1],"06"),r=u(t,0,[2,0,1],"04");try{i=u(t,0,[2,0,"[1]",0],"03")}catch(t){}}catch(t){throw new e("malformed PKCS#8 plain ECC private key")}if(this.curveName=o(n),void 0===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PubKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var n,r;try{u(t,0,[0,0],"06"),n=u(t,0,[0,1],"06"),r=u(t,0,[1],"03")}catch(t){throw new e("malformed PKCS#8 ECC public key")}if(this.curveName=o(n),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(r)},this.readCertPubKeyHex=function(t,n){if(!1===c(t))throw new e("not ASN.1 hex string");var r,i;try{r=u(t,0,[0,5,0,1],"06"),i=u(t,0,[0,5,1],"03")}catch(t){throw new e("malformed X.509 certificate ECC public key")}if(this.curveName=o(r),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i)},void 0!==t&&void 0!==t.curve&&(this.curveName=t.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==t&&(void 0!==t.prv&&this.setPrivateKeyHex(t.prv),void 0!==t.pub&&this.setPublicKeyHex(t.pub))},ut.crypto.ECDSA.parseSigHex=function(t){var e=ut.crypto.ECDSA.parseSigHexInHexRS(t);return{r:new x(e.r,16),s:new x(e.s,16)}},ut.crypto.ECDSA.parseSigHexInHexRS=function(t){var e=ht,n=e.getChildIdx,r=e.getV;if(e.checkStrictDER(t,0),"30"!=t.substr(0,2))throw new Error("signature is not a ASN.1 sequence");var i=n(t,0);if(2!=i.length)throw new Error("signature shall have two elements");var s=i[0],o=i[1];if("02"!=t.substr(s,2))throw new Error("1st item not ASN.1 integer");if("02"!=t.substr(o,2))throw new Error("2nd item not ASN.1 integer");return{r:r(t,s),s:r(t,o)}},ut.crypto.ECDSA.asn1SigToConcatSig=function(t){var e=ut.crypto.ECDSA.parseSigHexInHexRS(t),n=e.r,r=e.s;if(n.length>=130&&n.length<=134){if(n.length%2!=0)throw Error("unknown ECDSA sig r length error");if(r.length%2!=0)throw Error("unknown ECDSA sig s length error");"00"==n.substr(0,2)&&(n=n.substr(2)),"00"==r.substr(0,2)&&(r=r.substr(2));var i=Math.max(n.length,r.length);return(n=("000000"+n).slice(-i))+(r=("000000"+r).slice(-i))}if("00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),"00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),n.length%32==30&&(n="00"+n),r.length%32==30&&(r="00"+r),n.length%32!=0)throw Error("unknown ECDSA sig r length error");if(r.length%32!=0)throw Error("unknown ECDSA sig s length error");return n+r},ut.crypto.ECDSA.concatSigToASN1Sig=function(t){if(t.length%4!=0)throw Error("unknown ECDSA concatinated r-s sig length error");var e=t.substr(0,t.length/2),n=t.substr(t.length/2);return ut.crypto.ECDSA.hexRSSigToASN1Sig(e,n)},ut.crypto.ECDSA.hexRSSigToASN1Sig=function(t,e){var n=new x(t,16),r=new x(e,16);return ut.crypto.ECDSA.biRSSigToASN1Sig(n,r)},ut.crypto.ECDSA.biRSSigToASN1Sig=function(t,e){var n=ut.asn1,r=new n.DERInteger({bigint:t}),i=new n.DERInteger({bigint:e});return new n.DERSequence({array:[r,i]}).tohex()},ut.crypto.ECDSA.getName=function(t){return"2b8104001f"===t?"secp192k1":"2a8648ce3d030107"===t?"secp256r1":"2b8104000a"===t?"secp256k1":"2b81040021"===t?"secp224r1":"2b81040022"===t?"secp384r1":"2b81040023"===t?"secp521r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(t)?"secp256r1":-1!=="|secp256k1|".indexOf(t)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(t)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(t)?"secp384r1":-1!=="|secp521r1|NIST P-521|P-521|".indexOf(t)?"secp521r1":null},void 0!==ut&&ut||(ut={}),void 0!==ut.crypto&&ut.crypto||(ut.crypto={}),ut.crypto.ECParameterDB=new function(){var t={},e={};function n(t){return new x(t,16)}this.getByName=function(n){var r=n;if(void 0!==e[r]&&(r=e[n]),void 0!==t[r])return t[r];throw"unregistered EC curve name: "+r},this.regist=function(r,i,s,o,a,u,c,l,h,f,p,d){t[r]={};var g=n(s),m=n(o),v=n(a),y=n(u),b=n(c),w=new ot(g,m,v),x=w.decodePointHex("04"+l+h);t[r].name=r,t[r].keylen=i,t[r].keycharlen=2*Math.ceil(i/8),t[r].curve=w,t[r].G=x,t[r].n=y,t[r].h=b,t[r].oid=p,t[r].info=d;for(var S=0;S<f.length;S++)e[f[S]]=r}},ut.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),ut.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),ut.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),ut.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),ut.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),ut.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),ut.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),ut.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),ut.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),ut.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]),void 0!==ut&&ut||(ut={}),void 0!==ut.crypto&&ut.crypto||(ut.crypto={}),ut.crypto.DSA=function(){var t=ht,e=(t.getVbyList,t.getVbyListEx),n=t.isASN1HEX,r=x;this.p=null,this.q=null,this.g=null,this.y=null,this.x=null,this.type="DSA",this.isPrivate=!1,this.isPublic=!1,this.setPrivate=function(t,e,n,r,i){this.isPrivate=!0,this.p=t,this.q=e,this.g=n,this.y=r,this.x=i},this.setPrivateHex=function(t,e,n,r,i){var s,o,a,u,c;s=new x(t,16),o=new x(e,16),a=new x(n,16),u="string"==typeof r&&r.length>1?new x(r,16):null,c=new x(i,16),this.setPrivate(s,o,a,u,c)},this.setPublic=function(t,e,n,r){this.isPublic=!0,this.p=t,this.q=e,this.g=n,this.y=r,this.x=null},this.setPublicHex=function(t,e,n,r){var i,s,o,a;i=new x(t,16),s=new x(e,16),o=new x(n,16),a=new x(r,16),this.setPublic(i,s,o,a)},this.signWithMessageHash=function(t){var e=this.p,n=this.q,r=this.g,i=(this.y,this.x),s=ut.crypto.Util.getRandomBigIntegerMinToMax(x.ONE.add(x.ONE),n.subtract(x.ONE)),o=new x(t.substr(0,n.bitLength()/4),16),a=r.modPow(s,e).mod(n),u=s.modInverse(n).multiply(o.add(i.multiply(a))).mod(n);return ut.asn1.ASN1Util.jsonToASN1HEX({seq:[{int:{bigint:a}},{int:{bigint:u}}]})},this.verifyWithMessageHash=function(t,e){var n=this.p,r=this.q,i=this.g,s=this.y,o=this.parseASN1Signature(e),a=o[0],u=o[1],c=new x(t.substr(0,r.bitLength()/4),16);if(x.ZERO.compareTo(a)>0||a.compareTo(r)>0)throw"invalid DSA signature";if(x.ZERO.compareTo(u)>=0||u.compareTo(r)>0)throw"invalid DSA signature";var l=u.modInverse(r),h=c.multiply(l).mod(r),f=a.multiply(l).mod(r);return 0==i.modPow(h,n).multiply(s.modPow(f,n)).mod(n).mod(r).compareTo(a)},this.parseASN1Signature=function(t){try{return[new r(e(t,0,[0],"02"),16),new r(e(t,0,[1],"02"),16)]}catch(t){throw new Error("malformed ASN.1 DSA signature")}},this.readPKCS5PrvKeyHex=function(t){var r,i,s,o,a;if(!1===n(t))throw new Error("not ASN.1 hex string");try{r=e(t,0,[1],"02"),i=e(t,0,[2],"02"),s=e(t,0,[3],"02"),o=e(t,0,[4],"02"),a=e(t,0,[5],"02")}catch(t){throw new Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(r,i,s,o,a)},this.readPKCS8PrvKeyHex=function(t){var r,i,s,o;if(!1===n(t))throw new Error("not ASN.1 hex string");try{r=e(t,0,[1,1,0],"02"),i=e(t,0,[1,1,1],"02"),s=e(t,0,[1,1,2],"02"),o=e(t,0,[2,0],"02")}catch(t){throw new Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(r,i,s,null,o)},this.readPKCS8PubKeyHex=function(t){var r,i,s,o;if(!1===n(t))throw new Error("not ASN.1 hex string");try{r=e(t,0,[0,1,0],"02"),i=e(t,0,[0,1,1],"02"),s=e(t,0,[0,1,2],"02"),o=e(t,0,[1,0],"02")}catch(t){throw new Error("malformed PKCS#8 DSA public key")}this.setPublicHex(r,i,s,o)},this.readCertPubKeyHex=function(t,r){var i,s,o,a;if(!1===n(t))throw new Error("not ASN.1 hex string");try{i=e(t,0,[0,5,0,1,0],"02"),s=e(t,0,[0,5,0,1,1],"02"),o=e(t,0,[0,5,0,1,2],"02"),a=e(t,0,[0,5,1,0],"02")}catch(t){throw new Error("malformed X.509 certificate DSA public key")}this.setPublicHex(i,s,o,a)}};var Qt=function(){var t=function(t,n,r){return e(g.AES,t,n,r)},e=function(t,e,n,r){var i=g.enc.Hex.parse(e),s=g.enc.Hex.parse(n),o=g.enc.Hex.parse(r),a={};a.key=s,a.iv=o,a.ciphertext=i;var u=t.decrypt(a,s,{iv:o});return g.enc.Hex.stringify(u)},n=function(t,e,n){return r(g.AES,t,e,n)},r=function(t,e,n,r){var i=g.enc.Hex.parse(e),s=g.enc.Hex.parse(n),o=g.enc.Hex.parse(r),a=t.encrypt(i,s,{iv:o}),u=g.enc.Hex.parse(a.toString());return g.enc.Base64.stringify(u)},i={"AES-256-CBC":{proc:t,eproc:n,keylen:32,ivlen:16},"AES-192-CBC":{proc:t,eproc:n,keylen:24,ivlen:16},"AES-128-CBC":{proc:t,eproc:n,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(t,n,r){return e(g.TripleDES,t,n,r)},eproc:function(t,e,n){return r(g.TripleDES,t,e,n)},keylen:24,ivlen:8},"DES-CBC":{proc:function(t,n,r){return e(g.DES,t,n,r)},eproc:function(t,e,n){return r(g.DES,t,e,n)},keylen:8,ivlen:8}},s=function(t){var e={},n=t.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));n&&(e.cipher=n[1],e.ivsalt=n[2]);var r=t.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));r&&(e.type=r[1]);var i=-1,s=0;-1!=t.indexOf("\r\n\r\n")&&(i=t.indexOf("\r\n\r\n"),s=2),-1!=t.indexOf("\n\n")&&(i=t.indexOf("\n\n"),s=1);var o=t.indexOf("-----END");if(-1!=i&&-1!=o){var a=t.substring(i+2*s,o-s);a=a.replace(/\s+/g,""),e.data=a}return e},o=function(t,e,n){for(var r=n.substring(0,16),s=g.enc.Hex.parse(r),o=g.enc.Utf8.parse(e),a=i[t].keylen+i[t].ivlen,u="",c=null;;){var l=g.algo.MD5.create();if(null!=c&&l.update(c),l.update(o),l.update(s),c=l.finalize(),(u+=g.enc.Hex.stringify(c)).length>=2*a)break}var h={};return h.keyhex=u.substr(0,2*i[t].keylen),h.ivhex=u.substr(2*i[t].keylen,2*i[t].ivlen),h},a=function(t,e,n,r){var s=g.enc.Base64.parse(t),o=g.enc.Hex.stringify(s);return(0,i[e].proc)(o,n,r)};return{version:"1.0.0",parsePKCS5PEM:function(t){return s(t)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(t,e,n){return o(t,e,n)},decryptKeyB64:function(t,e,n,r){return a(t,e,n,r)},getDecryptedKeyHex:function(t,e){var n=s(t),r=(n.type,n.cipher),i=n.ivsalt,u=n.data,c=o(r,e,i).keyhex;return a(u,r,c,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(t,e,n,r,s){var a="";if(void 0!==r&&null!=r||(r="AES-256-CBC"),void 0===i[r])throw new Error("KEYUTIL unsupported algorithm: "+r);void 0!==s&&null!=s||(s=function(t){var e=g.lib.WordArray.random(t);return g.enc.Hex.stringify(e)}(i[r].ivlen).toUpperCase());var u=function(t,e,n,r){return(0,i[e].eproc)(t,n,r)}(e,r,o(r,n,s).keyhex,s);a="-----BEGIN "+t+" PRIVATE KEY-----\r\n";return a+="Proc-Type: 4,ENCRYPTED\r\n",a+="DEK-Info: "+r+","+s+"\r\n",a+="\r\n",a+=u.replace(/(.{64})/g,"$1\r\n"),a+="\r\n-----END "+t+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(t){var e=ht,n=e.getChildIdx,r=e.getV,i={},s=n(t,0);if(2!=s.length)throw new Error("malformed format: SEQUENCE(0).items != 2: "+s.length);i.ciphertext=r(t,s[1]);var o=n(t,s[0]);if(2!=o.length)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+o.length);if("2a864886f70d01050d"!=r(t,o[0]))throw new Error("this only supports pkcs5PBES2");var a=n(t,o[1]);if(2!=o.length)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+a.length);var u=n(t,a[1]);if(2!=u.length)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+u.length);if("2a864886f70d0307"!=r(t,u[0]))throw"this only supports TripleDES";i.encryptionSchemeAlg="TripleDES",i.encryptionSchemeIV=r(t,u[1]);var c=n(t,a[0]);if(2!=c.length)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+c.length);if("2a864886f70d01050c"!=r(t,c[0]))throw new Error("this only supports pkcs5PBKDF2");var l=n(t,c[1]);if(l.length<2)throw new Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+l.length);i.pbkdf2Salt=r(t,l[0]);var h=r(t,l[1]);try{i.pbkdf2Iter=parseInt(h,16)}catch(t){throw new Error("malformed format pbkdf2Iter: "+h)}return i},getPBKDF2KeyHexFromParam:function(t,e){var n=g.enc.Hex.parse(t.pbkdf2Salt),r=t.pbkdf2Iter,i=g.PBKDF2(e,n,{keySize:6,iterations:r});return g.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(t,e){var n=$t(t,"ENCRYPTED PRIVATE KEY"),r=this.parseHexOfEncryptedPKCS8(n),i=Qt.getPBKDF2KeyHexFromParam(r,e),s={};s.ciphertext=g.enc.Hex.parse(r.ciphertext);var o=g.enc.Hex.parse(i),a=g.enc.Hex.parse(r.encryptionSchemeIV),u=g.TripleDES.decrypt(s,o,{iv:a});return g.enc.Hex.stringify(u)},getKeyFromEncryptedPKCS8PEM:function(t,e){var n=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(t,e);return this.getKeyFromPlainPrivatePKCS8Hex(n)},parsePlainPrivatePKCS8Hex:function(t){var e=ht,n=e.getChildIdx,r=e.getV,i={algparam:null};if("30"!=t.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var s=n(t,0);if(s.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=t.substr(s[1],2))throw new Error("malformed PKCS8 private key(code:003)");var o=n(t,s[1]);if(2!=o.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=t.substr(o[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(i.algoid=r(t,o[0]),"06"==t.substr(o[1],2)&&(i.algparam=r(t,o[1])),"04"!=t.substr(s[2],2))throw new Error("malformed PKCS8 private key(code:006)");return i.keyidx=e.getVidx(t,s[2]),i},getKeyFromPlainPrivatePKCS8PEM:function(t){var e=$t(t,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(e)},getKeyFromPlainPrivatePKCS8Hex:function(t){var e,n=this.parsePlainPrivatePKCS8Hex(t);if("2a864886f70d010101"==n.algoid)e=new nt;else if("2a8648ce380401"==n.algoid)e=new ut.crypto.DSA;else{if("2a8648ce3d0201"!=n.algoid)throw new Error("unsupported private key algorithm");e=new ut.crypto.ECDSA}return e.readPKCS8PrvKeyHex(t),e},_getKeyFromPublicPKCS8Hex:function(t){var e,n=ht.getVbyList(t,0,[0,0],"06");if("2a864886f70d010101"===n)e=new nt;else if("2a8648ce380401"===n)e=new ut.crypto.DSA;else{if("2a8648ce3d0201"!==n)throw new Error("unsupported PKCS#8 public key hex");e=new ut.crypto.ECDSA}return e.readPKCS8PubKeyHex(t),e},parsePublicRawRSAKeyHex:function(t){var e=ht,n=e.getChildIdx,r=e.getV,i={};if("30"!=t.substr(0,2))throw new Error("malformed RSA key(code:001)");var s=n(t,0);if(2!=s.length)throw new Error("malformed RSA key(code:002)");if("02"!=t.substr(s[0],2))throw new Error("malformed RSA key(code:003)");if(i.n=r(t,s[0]),"02"!=t.substr(s[1],2))throw new Error("malformed RSA key(code:004)");return i.e=r(t,s[1]),i},parsePublicPKCS8Hex:function(t){var e=ht,n=e.getChildIdx,r=e.getV,i={algparam:null},s=n(t,0);if(2!=s.length)throw new Error("outer DERSequence shall have 2 elements: "+s.length);var o=s[0];if("30"!=t.substr(o,2))throw new Error("malformed PKCS8 public key(code:001)");var a=n(t,o);if(2!=a.length)throw new Error("malformed PKCS8 public key(code:002)");if("06"!=t.substr(a[0],2))throw new Error("malformed PKCS8 public key(code:003)");if(i.algoid=r(t,a[0]),"06"==t.substr(a[1],2)?i.algparam=r(t,a[1]):"30"==t.substr(a[1],2)&&(i.algparam={},i.algparam.p=e.getVbyList(t,a[1],[0],"02"),i.algparam.q=e.getVbyList(t,a[1],[1],"02"),i.algparam.g=e.getVbyList(t,a[1],[2],"02")),"03"!=t.substr(s[1],2))throw new Error("malformed PKCS8 public key(code:004)");return i.key=r(t,s[1]).substr(2),i}}}();Qt.getKey=function(t,e,n){var r=(m=ht).getChildIdx,i=(m.getV,m.getVbyList),s=ut.crypto,o=s.ECDSA,a=s.DSA,u=nt,c=$t,l=Qt;if(void 0!==u&&t instanceof u)return t;if(void 0!==o&&t instanceof o)return t;if(void 0!==a&&t instanceof a)return t;if(void 0!==t.curve&&void 0!==t.xy&&void 0===t.d)return new o({pub:t.xy,curve:t.curve});if(void 0!==t.curve&&void 0!==t.d)return new o({prv:t.d,curve:t.curve});if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return(I=new u).setPublic(t.n,t.e),I;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.co&&void 0===t.qi)return(I=new u).setPrivateEx(t.n,t.e,t.d,t.p,t.q,t.dp,t.dq,t.co),I;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0===t.p)return(I=new u).setPrivate(t.n,t.e,t.d),I;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0===t.x)return(I=new a).setPublic(t.p,t.q,t.g,t.y),I;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0!==t.x)return(I=new a).setPrivate(t.p,t.q,t.g,t.y,t.x),I;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return(I=new u).setPublic(bt(t.n),bt(t.e)),I;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.qi)return(I=new u).setPrivateEx(bt(t.n),bt(t.e),bt(t.d),bt(t.p),bt(t.q),bt(t.dp),bt(t.dq),bt(t.qi)),I;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d)return(I=new u).setPrivate(bt(t.n),bt(t.e),bt(t.d)),I;if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0===t.d){var h=(D=new o({curve:t.crv})).ecparams.keycharlen,f="04"+("0000000000"+bt(t.x)).slice(-h)+("0000000000"+bt(t.y)).slice(-h);return D.setPublicKeyHex(f),D}if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0!==t.d){h=(D=new o({curve:t.crv})).ecparams.keycharlen,f="04"+("0000000000"+bt(t.x)).slice(-h)+("0000000000"+bt(t.y)).slice(-h);var p=("0000000000"+bt(t.d)).slice(-h);return D.setPublicKeyHex(f),D.setPrivateKeyHex(p),D}if("pkcs5prv"===n){var d,g=t,m=ht;if(9===(d=r(g,0)).length)(I=new u).readPKCS5PrvKeyHex(g);else if(6===d.length)(I=new a).readPKCS5PrvKeyHex(g);else{if(!(d.length>2&&"04"===g.substr(d[1],2)))throw new Error("unsupported PKCS#1/5 hexadecimal key");(I=new o).readPKCS5PrvKeyHex(g)}return I}if("pkcs8prv"===n)return I=l.getKeyFromPlainPrivatePKCS8Hex(t);if("pkcs8pub"===n)return l._getKeyFromPublicPKCS8Hex(t);if("x509pub"===n)return re.getPublicKeyFromCertHex(t);if(-1!=t.indexOf("-END CERTIFICATE-",0)||-1!=t.indexOf("-END X509 CERTIFICATE-",0)||-1!=t.indexOf("-END TRUSTED CERTIFICATE-",0))return re.getPublicKeyFromCertPEM(t);if(-1!=t.indexOf("-END PUBLIC KEY-")){var v=$t(t,"PUBLIC KEY");return l._getKeyFromPublicPKCS8Hex(v)}if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var y=c(t,"RSA PRIVATE KEY");return l.getKey(y,null,"pkcs5prv")}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var b=i(T=c(t,"DSA PRIVATE KEY"),0,[1],"02"),w=i(T,0,[2],"02"),S=i(T,0,[3],"02"),E=i(T,0,[4],"02"),F=i(T,0,[5],"02");return(I=new a).setPrivate(new x(b,16),new x(w,16),new x(S,16),new x(E,16),new x(F,16)),I}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){y=c(t,"EC PRIVATE KEY");return l.getKey(y,null,"pkcs5prv")}if(-1!=t.indexOf("-END PRIVATE KEY-"))return l.getKeyFromPlainPrivatePKCS8PEM(t);if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var A=l.getDecryptedKeyHex(t,e),C=new nt;return C.readPKCS5PrvKeyHex(A),C}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var D,I=i(T=l.getDecryptedKeyHex(t,e),0,[1],"04"),$=i(T,0,[2,0],"06"),R=i(T,0,[3,0],"03").substr(2);if(void 0===ut.crypto.OID.oidhex2name[$])throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+$);return(D=new o({curve:ut.crypto.OID.oidhex2name[$]})).setPublicKeyHex(R),D.setPrivateKeyHex(I),D.isPublic=!1,D}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var T;b=i(T=l.getDecryptedKeyHex(t,e),0,[1],"02"),w=i(T,0,[2],"02"),S=i(T,0,[3],"02"),E=i(T,0,[4],"02"),F=i(T,0,[5],"02");return(I=new a).setPrivate(new x(b,16),new x(w,16),new x(S,16),new x(E,16),new x(F,16)),I}if(-1!=t.indexOf("-END ENCRYPTED PRIVATE KEY-"))return l.getKeyFromEncryptedPKCS8PEM(t,e);throw new Error("not supported argument")},Qt.generateKeypair=function(t,e){if("RSA"==t){var n=e;(o=new nt).generate(n,"10001"),o.isPrivate=!0,o.isPublic=!0;var r=new nt,i=o.n.toString(16),s=o.e.toString(16);return r.setPublic(i,s),r.isPrivate=!1,r.isPublic=!0,(a={}).prvKeyObj=o,a.pubKeyObj=r,a}if("EC"==t){var o,a,u=e,c=new ut.crypto.ECDSA({curve:u}).generateKeyPairHex();return(o=new ut.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),o.setPrivateKeyHex(c.ecprvhex),o.isPrivate=!0,o.isPublic=!1,(r=new ut.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),r.isPrivate=!1,r.isPublic=!0,(a={}).prvKeyObj=o,a.pubKeyObj=r,a}throw new Error("unknown algorithm: "+t)},Qt.getPEM=function(t,e,n,r,i,s){var o=ut,a=o.asn1,u=a.DERObjectIdentifier,c=a.DERInteger,l=a.ASN1Util.newObject,h=a.x509.SubjectPublicKeyInfo,f=o.crypto,p=f.DSA,d=f.ECDSA,m=nt;function v(t){return l({seq:[{int:0},{int:{bigint:t.n}},{int:t.e},{int:{bigint:t.d}},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.dmp1}},{int:{bigint:t.dmq1}},{int:{bigint:t.coeff}}]})}function y(t){return l({seq:[{int:1},{octstr:{hex:t.prvKeyHex}},{tag:["a0",!0,{oid:{name:t.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}]})}function b(t){return l({seq:[{int:0},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}},{int:{bigint:t.y}},{int:{bigint:t.x}}]})}if((void 0!==m&&t instanceof m||void 0!==p&&t instanceof p||void 0!==d&&t instanceof d)&&1==t.isPublic&&(void 0===e||"PKCS8PUB"==e))return It(E=new h(t).tohex(),"PUBLIC KEY");if("PKCS1PRV"==e&&void 0!==m&&t instanceof m&&(void 0===n||null==n)&&1==t.isPrivate)return It(E=v(t).tohex(),"RSA PRIVATE KEY");if("PKCS1PRV"==e&&void 0!==d&&t instanceof d&&(void 0===n||null==n)&&1==t.isPrivate){var w=new u({name:t.curveName}).tohex(),x=y(t).tohex(),S="";return S+=It(w,"EC PARAMETERS"),S+=It(x,"EC PRIVATE KEY")}if("PKCS1PRV"==e&&void 0!==p&&t instanceof p&&(void 0===n||null==n)&&1==t.isPrivate)return It(E=b(t).tohex(),"DSA PRIVATE KEY");if("PKCS5PRV"==e&&void 0!==m&&t instanceof m&&void 0!==n&&null!=n&&1==t.isPrivate){var E=v(t).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",E,n,r,s)}if("PKCS5PRV"==e&&void 0!==d&&t instanceof d&&void 0!==n&&null!=n&&1==t.isPrivate){E=y(t).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",E,n,r,s)}if("PKCS5PRV"==e&&void 0!==p&&t instanceof p&&void 0!==n&&null!=n&&1==t.isPrivate){E=b(t).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",E,n,r,s)}var F=function(t,e){var n=A(t,e);return new l({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:n.pbkdf2Salt}},{int:n.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:n.encryptionSchemeIV}}]}]}]},{octstr:{hex:n.ciphertext}}]}).tohex()},A=function(t,e){var n=g.lib.WordArray.random(8),r=g.lib.WordArray.random(8),i=g.PBKDF2(e,n,{keySize:6,iterations:100}),s=g.enc.Hex.parse(t),o=g.TripleDES.encrypt(s,i,{iv:r})+"",a={};return a.ciphertext=o,a.pbkdf2Salt=g.enc.Hex.stringify(n),a.pbkdf2Iter=100,a.encryptionSchemeAlg="DES-EDE3-CBC",a.encryptionSchemeIV=g.enc.Hex.stringify(r),a};if("PKCS8PRV"==e&&null!=m&&t instanceof m&&1==t.isPrivate){var C=v(t).tohex();E=l({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:C}}]}).tohex();return void 0===n||null==n?It(E,"PRIVATE KEY"):It(x=F(E,n),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==e&&void 0!==d&&t instanceof d&&1==t.isPrivate){var D={seq:[{int:1},{octstr:{hex:t.prvKeyHex}}]};"string"==typeof t.pubKeyHex&&D.seq.push({tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]});C=new l(D).tohex(),E=l({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:t.curveName}}]},{octstr:{hex:C}}]}).tohex();return void 0===n||null==n?It(E,"PRIVATE KEY"):It(x=F(E,n),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==e&&void 0!==p&&t instanceof p&&1==t.isPrivate){C=new c({bigint:t.x}).tohex(),E=l({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]}]},{octstr:{hex:C}}]}).tohex();return void 0===n||null==n?It(E,"PRIVATE KEY"):It(x=F(E,n),"ENCRYPTED PRIVATE KEY")}throw new Error("unsupported object nor format")},Qt.getKeyFromCSRPEM=function(t){var e=$t(t,"CERTIFICATE REQUEST");return Qt.getKeyFromCSRHex(e)},Qt.getKeyFromCSRHex=function(t){var e=Qt.parseCSRHex(t);return Qt.getKey(e.p8pubkeyhex,null,"pkcs8pub")},Qt.parseCSRHex=function(t){var e=ht,n=e.getChildIdx,r=e.getTLV,i={},s=t;if("30"!=s.substr(0,2))throw new Error("malformed CSR(code:001)");var o=n(s,0);if(o.length<1)throw new Error("malformed CSR(code:002)");if("30"!=s.substr(o[0],2))throw new Error("malformed CSR(code:003)");var a=n(s,o[0]);if(a.length<3)throw new Error("malformed CSR(code:004)");return i.p8pubkeyhex=r(s,a[2]),i},Qt.getKeyID=function(t){var e=Qt,n=ht;"string"==typeof t&&-1!=t.indexOf("BEGIN ")&&(t=e.getKey(t));var r=$t(e.getPEM(t)),i=n.getIdxbyList(r,0,[1]),s=n.getV(r,i).substring(2);return ut.crypto.Util.hashHex(s,"sha1")},Qt.getJWK=function(t,e,n,r,i){var s,o,a={},u=ut.crypto.Util.hashHex;if("string"==typeof t)s=Qt.getKey(t),-1!=t.indexOf("CERTIFICATE")&&(o=$t(t));else{if("object"!=typeof t)throw new Error("unsupported keyinfo type");t instanceof re?(s=t.getPublicKey(),o=t.hex):s=t}if(s instanceof nt&&s.isPrivate)a.kty="RSA",a.n=yt(s.n.toString(16)),a.e=yt(s.e.toString(16)),a.d=yt(s.d.toString(16)),a.p=yt(s.p.toString(16)),a.q=yt(s.q.toString(16)),a.dp=yt(s.dmp1.toString(16)),a.dq=yt(s.dmq1.toString(16)),a.qi=yt(s.coeff.toString(16));else if(s instanceof nt&&s.isPublic)a.kty="RSA",a.n=yt(s.n.toString(16)),a.e=yt(s.e.toString(16));else if(s instanceof ut.crypto.ECDSA&&s.isPrivate){if("P-256"!==(l=s.getShortNISTPCurveName())&&"P-384"!==l&&"P-521"!==l)throw new Error("unsupported curve name for JWT: "+l);var c=s.getPublicKeyXYHex();a.kty="EC",a.crv=l,a.x=yt(c.x),a.y=yt(c.y),a.d=yt(s.prvKeyHex)}else if(s instanceof ut.crypto.ECDSA&&s.isPublic){var l;if("P-256"!==(l=s.getShortNISTPCurveName())&&"P-384"!==l&&"P-521"!==l)throw new Error("unsupported curve name for JWT: "+l);c=s.getPublicKeyXYHex();a.kty="EC",a.crv=l,a.x=yt(c.x),a.y=yt(c.y)}if(null==a.kty)throw new Error("unsupported keyinfo");return s.isPrivate||1==e||(a.kid=ut.jws.JWS.getJWKthumbprint(a)),null!=o&&1!=n&&(a.x5c=[y(o)]),null!=o&&1!=r&&(a.x5t=mt(y(u(o,"sha1")))),null!=o&&1!=i&&(a["x5t#S256"]=mt(y(u(o,"sha256")))),a},Qt.getJWKFromKey=function(t){return Qt.getJWK(t,!0,!0,!0,!0)},nt.getPosArrayOfChildrenFromHex=function(t){return ht.getChildIdx(t,0)},nt.getHexValueArrayOfChildrenFromHex=function(t){var e,n=ht.getV,r=n(t,(e=nt.getPosArrayOfChildrenFromHex(t))[0]),i=n(t,e[1]),s=n(t,e[2]),o=n(t,e[3]),a=n(t,e[4]),u=n(t,e[5]),c=n(t,e[6]),l=n(t,e[7]),h=n(t,e[8]);return(e=new Array).push(r,i,s,o,a,u,c,l,h),e},nt.prototype.readPrivateKeyFromPEMString=function(t){var e=$t(t),n=nt.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])},nt.prototype.readPKCS5PrvKeyHex=function(t){var e=nt.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},nt.prototype.readPKCS8PrvKeyHex=function(t){var e,n,r,i,s,o,a,u,c=ht,l=c.getVbyListEx;if(!1===c.isASN1HEX(t))throw new Error("not ASN.1 hex string");try{e=l(t,0,[2,0,1],"02"),n=l(t,0,[2,0,2],"02"),r=l(t,0,[2,0,3],"02"),i=l(t,0,[2,0,4],"02"),s=l(t,0,[2,0,5],"02"),o=l(t,0,[2,0,6],"02"),a=l(t,0,[2,0,7],"02"),u=l(t,0,[2,0,8],"02")}catch(t){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(e,n,r,i,s,o,a,u)},nt.prototype.readPKCS5PubKeyHex=function(t){var e=ht,n=e.getV;if(!1===e.isASN1HEX(t))throw new Error("keyHex is not ASN.1 hex string");var r=e.getChildIdx(t,0);if(2!==r.length||"02"!==t.substr(r[0],2)||"02"!==t.substr(r[1],2))throw new Error("wrong hex for PKCS#5 public key");var i=n(t,r[0]),s=n(t,r[1]);this.setPublic(i,s)},nt.prototype.readPKCS8PubKeyHex=function(t){var e=ht;if(!1===e.isASN1HEX(t))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==e.getTLVbyListEx(t,0,[0,0]))throw new Error("not PKCS8 RSA public key");var n=e.getTLVbyListEx(t,0,[1,0]);this.readPKCS5PubKeyHex(n)},nt.prototype.readCertPubKeyHex=function(t,e){var n,r;(n=new re).readCertHex(t),r=n.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};new RegExp("[^0-9a-f]","gi");function te(t,e){for(var n="",r=e/4-t.length,i=0;i<r;i++)n+="0";return n+t}function ee(t,e,n){for(var r="",i=0;r.length<e;)r+=Et(n(Ft(t+String.fromCharCode.apply(String,[(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return r}function ne(t){for(var e in ut.crypto.Util.DIGESTINFOHEAD){var n=ut.crypto.Util.DIGESTINFOHEAD[e],r=n.length;if(t.substring(0,r)==n)return[e,t.substring(r)]}return[]}function re(t){var e,n=ht,r=n.getChildIdx,i=n.getV,s=(n.dump,n.parse),o=n.getTLV,a=n.getVbyList,u=n.getVbyListEx,c=n.getTLVbyList,l=n.getTLVbyListEx,h=n.getIdxbyList,f=n.getIdxbyListEx,p=n.getVidx,d=n.getInt,g=n.oidname,m=n.hextooidstr,v=$t;try{e=ut.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(t){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(null===this.hex||0!==this.version)return this.version;var t=c(this.hex,0,[0,0]);if("a0"==t.substr(0,2)){var e=c(t,0,[0]),n=d(e,0);if(n<0||2<n)throw new Error("malformed version field");return this.version=n+1,this.version}return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return u(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var t=l(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(t)},this.getAlgorithmIdentifierName=function(t){for(var n in e)if(t===e[n])return n;return g(u(t,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return c(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return this.getIssuer().str},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return c(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return this.getSubject().str},this.getNotBefore=function(){var t=a(this.hex,0,[0,4+this.foffset,0]);return t=t.replace(/(..)/g,"%$1"),t=decodeURIComponent(t)},this.getNotAfter=function(){var t=a(this.hex,0,[0,4+this.foffset,1]);return t=t.replace(/(..)/g,"%$1"),t=decodeURIComponent(t)},this.getPublicKeyHex=function(){return this.getSPKI()},this.getSPKI=function(){return c(this.hex,0,[0,6+this.foffset],"30")},this.getSPKIValue=function(){var t=this.getSPKI();return null==t?null:a(t,0,[1],"03",!0)},this.getPublicKeyIdx=function(){return h(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var t=this.getPublicKeyIdx();return h(this.hex,t,[1,0],"30")},this.getPublicKey=function(){return Qt.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var t=c(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(t)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(t){var e=this.getSignatureAlgorithmField(),n=this.getSignatureValueHex(),r=c(this.hex,0,[0],"30"),i=new ut.crypto.Signature({alg:e});return i.init(t),i.updateHex(r),i.verify(n)},this.parseExt=function(t){var e,s,o;if(void 0===t){if(o=this.hex,3!==this.version)return-1;e=h(o,0,[0,7,0],"30"),s=r(o,e)}else{o=$t(t);var u=h(o,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=i(o,u))return void(this.aExtInfo=new Array);e=h(o,0,[0,3,0,1,0],"30"),s=r(o,e),this.hex=o}this.aExtInfo=new Array;for(var c=0;c<s.length;c++){var l={critical:!1},f=0;3===r(o,s[c]).length&&(l.critical=!0,f=1),l.oid=n.hextooidstr(a(o,s[c],[0],"06"));var d=h(o,s[c],[1+f]);l.vidx=p(o,d),this.aExtInfo.push(l)}},this.getExtInfo=function(t){var e=this.aExtInfo,n=t;if(t.match(/^[0-9.]+$/)||(n=ut.asn1.x509.OID.name2oid(t)),""!==n)for(var r=0;r<e.length;r++)if(e[r].oid===n)return e[r]},this.getExtBasicConstraints=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("basicConstraints");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var r={extname:"basicConstraints"};if(e&&(r.critical=!0),"3000"===t)return r;if("30030101ff"===t)return r.cA=!0,r;if("30060101ff02"===t.substr(0,12)){var s=i(t,10),a=parseInt(s,16);return r.cA=!0,r.pathLen=a,r}throw new Error("hExtV parse error: "+t)},this.getExtNameConstraints=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("nameConstraints");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"nameConstraints"};e&&(i.critical=!0);for(var s=r(t,0),a=0;a<s.length;a++){for(var u=[],c=r(t,s[a]),l=0;l<c.length;l++){var h=o(t,c[l]),f=this.getGeneralSubtree(h);u.push(f)}var p=t.substr(s[a],2);"a0"==p?i.permit=u:"a1"==p&&(i.exclude=u)}return i},this.getGeneralSubtree=function(t){var e=r(t,0),n=e.length;if(n<1||2<n)throw new Error("wrong num elements");for(var s=this.getGeneralName(o(t,e[0])),a=1;a<n;a++){var u=t.substr(e[a],2),c=i(t,e[a]),l=parseInt(c,16);"80"==u&&(s.min=l),"81"==u&&(s.max=l)}return s},this.getExtKeyUsage=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("keyUsage");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var r={extname:"keyUsage"};return e&&(r.critical=!0),r.names=this.getExtKeyUsageString(t).split(","),r},this.getExtKeyUsageBin=function(t){if(void 0===t){var e=this.getExtInfo("keyUsage");if(void 0===e)return"";t=o(this.hex,e.vidx)}if(8!=t.length&&10!=t.length)throw new Error("malformed key usage value: "+t);var n="000000000000000"+parseInt(t.substr(6),16).toString(2);return 8==t.length&&(n=n.slice(-8)),10==t.length&&(n=n.slice(-16)),""==(n=n.replace(/0+$/,""))&&(n="0"),n},this.getExtKeyUsageString=function(t){for(var e=this.getExtKeyUsageBin(t),n=new Array,r=0;r<e.length;r++)"1"==e.substr(r,1)&&n.push(re.KEYUSAGE_NAME[r]);return n.join(",")},this.getExtSubjectKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("subjectKeyIdentifier");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var r={extname:"subjectKeyIdentifier"};e&&(r.critical=!0);var s=i(t,0);return r.kid={hex:s},r},this.getExtAuthorityKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("authorityKeyIdentifier");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var s={extname:"authorityKeyIdentifier"};e&&(s.critical=!0);for(var a=r(t,0),u=0;u<a.length;u++){var c=t.substr(a[u],2);if("80"===c&&(s.kid={hex:i(t,a[u])}),"a1"===c){var l=o(t,a[u]),h=this.getGeneralNames(l);s.issuer=h[0].dn}"82"===c&&(s.sn={hex:i(t,a[u])})}return s},this.getExtExtKeyUsage=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("extKeyUsage");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var s={extname:"extKeyUsage",array:[]};e&&(s.critical=!0);for(var a=r(t,0),u=0;u<a.length;u++)s.array.push(g(i(t,a[u])));return s},this.getExtExtKeyUsageName=function(){var t=this.getExtInfo("extKeyUsage");if(void 0===t)return t;var e=new Array,n=o(this.hex,t.vidx);if(""===n)return e;for(var s=r(n,0),a=0;a<s.length;a++)e.push(g(i(n,s[a])));return e},this.getExtSubjectAltName=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("subjectAltName");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var r={extname:"subjectAltName",array:[]};return e&&(r.critical=!0),r.array=this.getGeneralNames(t),r},this.getExtIssuerAltName=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("issuerAltName");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var r={extname:"issuerAltName",array:[]};return e&&(r.critical=!0),r.array=this.getGeneralNames(t),r},this.getGeneralNames=function(t){for(var e=r(t,0),n=[],i=0;i<e.length;i++){var s=this.getGeneralName(o(t,e[i]));void 0!==s&&n.push(s)}return n},this.getGeneralName=function(t){var e=t.substr(0,2),n=i(t,0),r=Et(n);return"81"==e?{rfc822:r}:"82"==e?{dns:r}:"86"==e?{uri:r}:"87"==e?{ip:jt(n)}:"a4"==e?{dn:this.getX500Name(n)}:"a0"==e?{other:this.getOtherName(t)}:void 0},this.getExtSubjectAltName2=function(){var t,e,n,s=this.getExtInfo("subjectAltName");if(void 0===s)return s;for(var a=new Array,u=o(this.hex,s.vidx),c=r(u,0),l=0;l<c.length;l++)n=u.substr(c[l],2),t=i(u,c[l]),"81"===n&&(e=xt(t),a.push(["MAIL",e])),"82"===n&&(e=xt(t),a.push(["DNS",e])),"84"===n&&(e=re.hex2dn(t,0),a.push(["DN",e])),"86"===n&&(e=xt(t),a.push(["URI",e])),"87"===n&&(e=jt(t),a.push(["IP",e]));return a},this.getExtCRLDistributionPoints=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("cRLDistributionPoints");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"cRLDistributionPoints",array:[]};e&&(i.critical=!0);for(var s=r(t,0),a=0;a<s.length;a++){var u=o(t,s[a]);i.array.push(this.getDistributionPoint(u))}return i},this.getDistributionPoint=function(t){for(var e={},n=r(t,0),i=0;i<n.length;i++){var s=t.substr(n[i],2),a=o(t,n[i]);"a0"==s&&(e.dpname=this.getDistributionPointName(a))}return e},this.getDistributionPointName=function(t){for(var e={},n=r(t,0),i=0;i<n.length;i++){var s=t.substr(n[i],2),a=o(t,n[i]);"a0"==s&&(e.full=this.getGeneralNames(a))}return e},this.getExtCRLDistributionPointsURI=function(){var t=this.getExtCRLDistributionPoints();if(null==t)return t;for(var e=t.array,n=[],r=0;r<e.length;r++)try{null!=e[r].dpname.full[0].uri&&n.push(e[r].dpname.full[0].uri)}catch(t){}return n},this.getExtAIAInfo=function(){var t=this.getExtInfo("authorityInfoAccess");if(void 0===t)return t;for(var e={ocsp:[],caissuer:[]},n=r(this.hex,t.vidx),i=0;i<n.length;i++){var s=a(this.hex,n[i],[0],"06"),o=a(this.hex,n[i],[1],"86");"2b06010505073001"===s&&e.ocsp.push(xt(o)),"2b06010505073002"===s&&e.caissuer.push(xt(o))}return e},this.getExtAuthorityInfoAccess=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("authorityInfoAccess");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"authorityInfoAccess",array:[]};e&&(i.critical=!0);for(var s=r(t,0),c=0;c<s.length;c++){var l=u(t,s[c],[0],"06"),h=xt(a(t,s[c],[1],"86"));if("2b06010505073001"==l)i.array.push({ocsp:h});else{if("2b06010505073002"!=l)throw new Error("unknown method: "+l);i.array.push({caissuer:h})}}return i},this.getExtCertificatePolicies=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("certificatePolicies");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"certificatePolicies",array:[]};e&&(i.critical=!0);for(var s=r(t,0),a=0;a<s.length;a++){var u=o(t,s[a]),c=this.getPolicyInformation(u);i.array.push(c)}return i},this.getPolicyInformation=function(t){var e={},n=a(t,0,[0],"06");e.policyoid=g(n);var i=f(t,0,[1],"30");if(-1!=i){e.array=[];for(var s=r(t,i),u=0;u<s.length;u++){var c=o(t,s[u]),l=this.getPolicyQualifierInfo(c);e.array.push(l)}}return e},this.getOtherName=function(t){var e={},n=r(t,0),i=a(t,n[0],[],"06"),o=a(t,n[1],[]);return e.oid=ut.asn1.ASN1Util.oidHexToInt(i),e.obj=s(o),e},this.getPolicyQualifierInfo=function(t){var e={},n=a(t,0,[0],"06");if("2b06010505070201"===n){var r=u(t,0,[1],"16");e.cps=Et(r)}else if("2b06010505070202"===n){var i=c(t,0,[1],"30");e.unotice=this.getUserNotice(i)}return e},this.getUserNotice=function(t){for(var e={},n=r(t,0),i=0;i<n.length;i++){var s=o(t,n[i]);"30"!=s.substr(0,2)&&(e.exptext=this.getDisplayText(s))}return e},this.getDisplayText=function(t){var e={};return e.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[t.substr(0,2)],e.str=Et(i(t,0)),e},this.getExtCRLNumber=function(t,e){var n={extname:"cRLNumber"};if(e&&(n.critical=!0),"02"==t.substr(0,2))return n.num={hex:i(t,0)},n;throw new Error("hExtV parse error: "+t)},this.getExtCRLReason=function(t,e){var n={extname:"cRLReason"};if(e&&(n.critical=!0),"0a"==t.substr(0,2))return n.code=parseInt(i(t,0),16),n;throw new Error("hExtV parse error: "+t)},this.getExtOcspNonce=function(t,e){var n={extname:"ocspNonce"};e&&(n.critical=!0);var r=i(t,0);return n.hex=r,n},this.getExtOcspNoCheck=function(t,e){var n={extname:"ocspNoCheck"};return e&&(n.critical=!0),n},this.getExtAdobeTimeStamp=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("adobeTimeStamp");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"adobeTimeStamp"};e&&(i.critical=!0);var s=r(t,0);if(s.length>1){var a=o(t,s[1]),u=this.getGeneralName(a);null!=u.uri&&(i.uri=u.uri)}if(s.length>2){var c=o(t,s[2]);"0101ff"==c&&(i.reqauth=!0),"010100"==c&&(i.reqauth=!1)}return i};var y=function(t){var e={};try{var n=t.seq[0].oid,r=ut.asn1.x509.OID.name2oid(n);e.type=ut.asn1.x509.OID.oid2atype(r);var i=t.seq[1];if(null!=i.utf8str)e.ds="utf8",e.value=i.utf8str.str;else if(null!=i.numstr)e.ds="num",e.value=i.numstr.str;else if(null!=i.telstr)e.ds="tel",e.value=i.telstr.str;else if(null!=i.prnstr)e.ds="prn",e.value=i.prnstr.str;else if(null!=i.ia5str)e.ds="ia5",e.value=i.ia5str.str;else if(null!=i.visstr)e.ds="vis",e.value=i.visstr.str;else{if(null==i.bmpstr)throw"error";e.ds="bmp",e.value=i.bmpstr.str}return e}catch(t){throw new Erorr("improper ASN.1 parsed AttrTypeAndValue")}},b=function(t){try{return t.set.map((function(t){return y(t)}))}catch(t){throw new Error("improper ASN.1 parsed RDN: "+t)}};this.getX500NameRule=function(t){for(var e=null,n=[],r=0;r<t.length;r++)for(var i=t[r],s=0;s<i.length;s++)n.push(i[s]);for(r=0;r<n.length;r++){var o=n[r],a=o.ds,u=o.value,c=o.type;if(":"+a,"prn"!=a&&"utf8"!=a&&"ia5"!=a)return"mixed";if("ia5"==a){if("CN"!=c)return"mixed";if(ut.lang.String.isMail(u))continue;return"mixed"}if("C"==c){if("prn"==a)continue;return"mixed"}if(":"+a,null==e)e=a;else if(e!==a)return"mixed"}return null==e?"prn":e},this.getAttrTypeAndValue=function(t){var e=s(t);return y(e)},this.getRDN=function(t){var e=s(t);return b(e)},this.getX500NameArray=function(t){return function(t){try{return t.seq.map((function(t){return b(t)}))}catch(t){throw new Error("improper ASN.1 parsed X500Name: "+t)}}(s(t))},this.getX500Name=function(t){var e=this.getX500NameArray(t);return{array:e,str:this.dnarraytostr(e)}},this.readCertPEM=function(t){this.readCertHex(v(t))},this.readCertHex=function(t){this.hex=t,this.getVersion();try{h(this.hex,0,[0,7],"a3"),this.parseExt()}catch(t){}},this.getParam=function(t){var e={};return e.version=this.getVersion(),e.serial={hex:this.getSerialNumberHex()},e.sigalg=this.getSignatureAlgorithmField(),e.issuer=this.getIssuer(),e.notbefore=this.getNotBefore(),e.notafter=this.getNotAfter(),e.subject=this.getSubject(),e.sbjpubkey=It(this.getPublicKeyHex(),"PUBLIC KEY"),null!=this.aExtInfo&&this.aExtInfo.length>0&&(e.ext=this.getExtParamArray()),e.sighex=this.getSignatureValueHex(),"object"==typeof t&&(1==t.tbshex&&(e.tbshex=c(this.hex,0,[0])),1==t.nodnarray&&(delete e.issuer.array,delete e.subject.array)),e},this.getExtParamArray=function(t){null==t&&(-1!=f(this.hex,0,[0,"[3]"])&&(t=l(this.hex,0,[0,"[3]",0],"30")));for(var e=[],n=r(t,0),i=0;i<n.length;i++){var s=o(t,n[i]),a=this.getExtParam(s);null!=a&&e.push(a)}return e},this.getExtParam=function(t){var e=r(t,0).length;if(2!=e&&3!=e)throw new Error("wrong number elements in Extension: "+e+" "+t);var n=m(a(t,0,[0],"06")),i=!1;3==e&&"0101ff"==c(t,0,[1])&&(i=!0);var s=c(t,0,[e-1,0]),o=void 0;if("2.5.29.14"==n?o=this.getExtSubjectKeyIdentifier(s,i):"2.5.29.15"==n?o=this.getExtKeyUsage(s,i):"2.5.29.17"==n?o=this.getExtSubjectAltName(s,i):"2.5.29.18"==n?o=this.getExtIssuerAltName(s,i):"2.5.29.19"==n?o=this.getExtBasicConstraints(s,i):"2.5.29.30"==n?o=this.getExtNameConstraints(s,i):"2.5.29.31"==n?o=this.getExtCRLDistributionPoints(s,i):"2.5.29.32"==n?o=this.getExtCertificatePolicies(s,i):"2.5.29.35"==n?o=this.getExtAuthorityKeyIdentifier(s,i):"2.5.29.37"==n?o=this.getExtExtKeyUsage(s,i):"1.3.6.1.5.5.7.1.1"==n?o=this.getExtAuthorityInfoAccess(s,i):"2.5.29.20"==n?o=this.getExtCRLNumber(s,i):"2.5.29.21"==n?o=this.getExtCRLReason(s,i):"1.3.6.1.5.5.7.48.1.2"==n?o=this.getExtOcspNonce(s,i):"1.3.6.1.5.5.7.48.1.5"==n?o=this.getExtOcspNoCheck(s,i):"1.2.840.113583.1.1.9.1"==n&&(o=this.getExtAdobeTimeStamp(s,i)),null!=o)return o;var u={extname:n,extn:s};return i&&(u.critical=!0),u},this.findExt=function(t,e){for(var n=0;n<t.length;n++)if(t[n].extname==e)return t[n];return null},this.updateExtCDPFullURI=function(t,e){var n=this.findExt(t,"cRLDistributionPoints");if(null!=n&&null!=n.array)for(var r=n.array,i=0;i<r.length;i++)if(null!=r[i].dpname&&null!=r[i].dpname.full)for(var s=r[i].dpname.full,o=0;o<s.length;o++){var a=s[i];null!=a.uri&&(a.uri=e)}},this.updateExtAIAOCSP=function(t,e){var n=this.findExt(t,"authorityInfoAccess");if(null!=n&&null!=n.array)for(var r=n.array,i=0;i<r.length;i++)null!=r[i].ocsp&&(r[i].ocsp=e)},this.updateExtAIACAIssuer=function(t,e){var n=this.findExt(t,"authorityInfoAccess");if(null!=n&&null!=n.array)for(var r=n.array,i=0;i<r.length;i++)null!=r[i].caissuer&&(r[i].caissuer=e)},this.dnarraytostr=function(t){return"/"+t.map((function(t){return function(t){return t.map((function(t){return function(t){return t.type+"="+t.value}(t).replace(/\+/,"\\+")})).join("+")}(t).replace(/\//,"\\/")})).join("/")},this.getInfo=function(){var t,e,n,r,i=function(t){for(var e="",n=t.array,r=0;r<n.length;r++){var i=n[r];if(e+=" policy oid: "+i.policyoid+"\n",void 0!==i.array)for(var s=0;s<i.array.length;s++){var o=i.array[s];void 0!==o.cps&&(e+=" cps: "+o.cps+"\n")}}return e},s=function(t){for(var e="",n=t.array,r=0;r<n.length;r++){var i=n[r];try{void 0!==i.dpname.full[0].uri&&(e+=" "+i.dpname.full[0].uri+"\n")}catch(t){}try{void 0!==i.dname.full[0].dn.hex&&(e+=" "+re.hex2dn(i.dpname.full[0].dn.hex)+"\n")}catch(t){}}return e},o=function(t){for(var e="",n=t.array,r=0;r<n.length;r++){var i=n[r];void 0!==i.caissuer&&(e+=" caissuer: "+i.caissuer+"\n"),void 0!==i.ocsp&&(e+=" ocsp: "+i.ocsp+"\n")}return e};if(t="Basic Fields\n",t+=" serial number: "+this.getSerialNumberHex()+"\n",t+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",t+=" issuer: "+this.getIssuerString()+"\n",t+=" notBefore: "+this.getNotBefore()+"\n",t+=" notAfter: "+this.getNotAfter()+"\n",t+=" subject: "+this.getSubjectString()+"\n",t+=" subject public key info: \n",t+=" key algorithm: "+(e=this.getPublicKey()).type+"\n","RSA"===e.type&&(t+=" n="+qt(e.n.toString(16)).substr(0,16)+"...\n",t+=" e="+qt(e.e.toString(16))+"\n"),null!=(n=this.aExtInfo)){t+="X509v3 Extensions:\n";for(var a=0;a<n.length;a++){var u=n[a],c=ut.asn1.x509.OID.oid2name(u.oid);""===c&&(c=u.oid);var l="";if(!0===u.critical&&(l="CRITICAL"),t+=" "+c+" "+l+":\n","basicConstraints"===c){var h=this.getExtBasicConstraints();void 0===h.cA?t+=" {}\n":(t+=" cA=true",void 0!==h.pathLen&&(t+=", pathLen="+h.pathLen),t+="\n")}else if("keyUsage"===c)t+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"===c)t+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"===c){var f=this.getExtAuthorityKeyIdentifier();void 0!==f.kid&&(t+=" kid="+f.kid.hex+"\n")}else{if("extKeyUsage"===c)t+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n";else if("subjectAltName"===c)t+=" "+(r=this.getExtSubjectAltName(),JSON.stringify(r.array).replace(/[\[\]\{\}\"]/g,""))+"\n";else if("cRLDistributionPoints"===c)t+=s(this.getExtCRLDistributionPoints());else if("authorityInfoAccess"===c)t+=o(this.getExtAuthorityInfoAccess());else"certificatePolicies"===c&&(t+=i(this.getExtCertificatePolicies()))}}}return t+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n",t+="signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"},"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?this.readCertPEM(t):ut.lang.String.isHex(t)&&this.readCertHex(t))}nt.prototype.sign=function(t,e){var n=function(t){return ut.crypto.Util.hashString(t,e)}(t);return this.signWithMessageHash(n,e)},nt.prototype.signWithMessageHash=function(t,e){var n=tt(ut.crypto.Util.getPaddedDigestInfoHex(t,e,this.n.bitLength()),16);return te(this.doPrivate(n).toString(16),this.n.bitLength())},nt.prototype.signPSS=function(t,e,n){var r,i=(r=Ft(t),ut.crypto.Util.hashHex(r,e));return void 0===n&&(n=-1),this.signWithMessageHashPSS(i,e,n)},nt.prototype.signWithMessageHashPSS=function(t,e,n){var r,i=Et(t),s=i.length,o=this.n.bitLength()-1,a=Math.ceil(o/8),u=function(t){return ut.crypto.Util.hashHex(t,e)};if(-1===n||void 0===n)n=s;else if(-2===n)n=a-s-2;else if(n<-2)throw new Error("invalid salt length");if(a<s+n+2)throw new Error("data too long");var c="";n>0&&(c=new Array(n),(new Q).nextBytes(c),c=String.fromCharCode.apply(String,c));var l=Et(u(Ft("\0\0\0\0\0\0\0\0"+i+c))),h=[];for(r=0;r<a-n-s-2;r+=1)h[r]=0;var f=String.fromCharCode.apply(String,h)+""+c,p=ee(l,f.length,u),d=[];for(r=0;r<f.length;r+=1)d[r]=f.charCodeAt(r)^p.charCodeAt(r);var g=65280>>8*a-o&255;for(d[0]&=~g,r=0;r<s;r++)d.push(l.charCodeAt(r));return d.push(188),te(this.doPrivate(new x(d)).toString(16),this.n.bitLength())},nt.prototype.verify=function(t,e){if(null==(e=e.toLowerCase()).match(/^[0-9a-f]+$/))return!1;var n=tt(e,16),r=this.n.bitLength();if(n.bitLength()>r)return!1;var i=this.doPublic(n).toString(16);if(i.length+3!=r/4)return!1;var s=ne(i.replace(/^1f+00/,""));if(0==s.length)return!1;var o=s[0];return s[1]==function(t){return ut.crypto.Util.hashString(t,o)}(t)},nt.prototype.verifyWithMessageHash=function(t,e){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var n=tt(e,16);if(n.bitLength()>this.n.bitLength())return 0;var r=ne(this.doPublic(n).toString(16).replace(/^1f+00/,""));if(0==r.length)return!1;r[0];return r[1]==t},nt.prototype.verifyPSS=function(t,e,n,r){var i,s=(i=Ft(t),ut.crypto.Util.hashHex(i,n));return void 0===r&&(r=-1),this.verifyWithMessageHashPSS(s,e,n,r)},nt.prototype.verifyWithMessageHashPSS=function(t,e,n,r){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,s=new x(e,16),o=function(t){return ut.crypto.Util.hashHex(t,n)},a=Et(t),u=a.length,c=this.n.bitLength()-1,l=Math.ceil(c/8);if(-1===r||void 0===r)r=u;else if(-2===r)r=l-u-2;else if(r<-2)throw new Error("invalid salt length");if(l<u+r+2)throw new Error("data too long");var h=this.doPublic(s).toByteArray();for(i=0;i<h.length;i+=1)h[i]&=255;for(;h.length<l;)h.unshift(0);if(188!==h[l-1])throw new Error("encoded message does not end in 0xbc");var f=(h=String.fromCharCode.apply(String,h)).substr(0,l-u-1),p=h.substr(f.length,u),d=65280>>8*l-c&255;if(0!=(f.charCodeAt(0)&d))throw new Error("bits beyond keysize not zero");var g=ee(p,f.length,o),m=[];for(i=0;i<f.length;i+=1)m[i]=f.charCodeAt(i)^g.charCodeAt(i);m[0]&=~d;var v=l-u-r-2;for(i=0;i<v;i+=1)if(0!==m[i])throw new Error("leftmost octets not zero");if(1!==m[v])throw new Error("0x01 marker not found");return p===Et(o(Ft("\0\0\0\0\0\0\0\0"+a+String.fromCharCode.apply(String,m.slice(-r)))))},nt.SALT_LEN_HLEN=-1,nt.SALT_LEN_MAX=-2,nt.SALT_LEN_RECOVER=-2,re.hex2dn=function(t,e){void 0===e&&(e=0);var n=new re;ht.getTLV(t,e);return n.getX500Name(t).str},re.hex2rdn=function(t,e){if(void 0===e&&(e=0),"31"!==t.substr(e,2))throw new Error("malformed RDN");for(var n=new Array,r=ht.getChildIdx(t,e),i=0;i<r.length;i++)n.push(re.hex2attrTypeValue(t,r[i]));return(n=n.map((function(t){return t.replace("+","\\+")}))).join("+")},re.hex2attrTypeValue=function(t,e){var n=ht,r=n.getV;if(void 0===e&&(e=0),"30"!==t.substr(e,2))throw new Error("malformed attribute type and value");var i=n.getChildIdx(t,e);2!==i.length||t.substr(i[0],2);var s=r(t,i[0]),o=ut.asn1.ASN1Util.oidHexToInt(s);return ut.asn1.x509.OID.oid2atype(o)+"="+Et(r(t,i[1]))},re.getPublicKeyFromCertHex=function(t){var e=new re;return e.readCertHex(t),e.getPublicKey()},re.getPublicKeyFromCertPEM=function(t){var e=new re;return e.readCertPEM(t),e.getPublicKey()},re.getPublicKeyInfoPropOfCertPEM=function(t){var e,n,r=ht.getVbyList,i={};return i.algparam=null,(e=new re).readCertPEM(t),n=e.getPublicKeyHex(),i.keyhex=r(n,0,[1],"03").substr(2),i.algoid=r(n,0,[0,0],"06"),"2a8648ce3d0201"===i.algoid&&(i.algparam=r(n,0,[0,1],"06")),i},re.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];void 0!==ut&&ut||(ut={}),void 0!==ut.jws&&ut.jws||(ut.jws={}),ut.jws.JWS=function(){var t=ut.jws.JWS.isSafeJSONString;this.parseJWS=function(e,n){if(void 0===this.parsedJWS||!n&&void 0===this.parsedJWS.sigvalH){var r=e.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(null==r)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var i=r[1],s=r[2],o=r[3],a=i+"."+s;if(this.parsedJWS={},this.parsedJWS.headB64U=i,this.parsedJWS.payloadB64U=s,this.parsedJWS.sigvalB64U=o,this.parsedJWS.si=a,!n){var u=bt(o),c=tt(u,16);this.parsedJWS.sigvalH=u,this.parsedJWS.sigvalBI=c}var l=lt(i),h=lt(s);if(this.parsedJWS.headS=l,this.parsedJWS.payloadS=h,!t(l,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+l}}},ut.jws.JWS.sign=function(t,e,n,r,i){var s,o,a,u=ut,c=u.jws.JWS,l=c.readSafeJSONString,h=c.isSafeJSONString,f=u.crypto,p=(f.ECDSA,f.Mac),d=f.Signature,g=JSON;if("string"!=typeof e&&"object"!=typeof e)throw"spHeader must be JSON string or object: "+e;if("object"==typeof e&&(o=e,s=g.stringify(o)),"string"==typeof e){if(!h(s=e))throw"JWS Head is not safe JSON string: "+s;o=l(s)}if(a=n,"object"==typeof n&&(a=g.stringify(n)),""!=t&&null!=t||void 0===o.alg||(t=o.alg),""!=t&&null!=t&&void 0===o.alg&&(o.alg=t,s=g.stringify(o)),t!==o.alg)throw"alg and sHeader.alg doesn't match: "+t+"!="+o.alg;var m=null;if(void 0===c.jwsalg2sigalg[t])throw"unsupported alg name: "+t;m=c.jwsalg2sigalg[t];var v=ct(s)+"."+ct(a),y="";if("Hmac"==m.substr(0,4)){if(void 0===r)throw"mac key shall be specified for HS* alg";var b=new p({alg:m,prov:"cryptojs",pass:r});b.updateString(v),y=b.doFinal()}else if(-1!=m.indexOf("withECDSA")){(x=new d({alg:m})).init(r,i),x.updateString(v);var w=x.sign();y=ut.crypto.ECDSA.asn1SigToConcatSig(w)}else{var x;if("none"!=m)(x=new d({alg:m})).init(r,i),x.updateString(v),y=x.sign()}return v+"."+yt(y)},ut.jws.JWS.verify=function(t,e,n){var r,i=ut,s=i.jws.JWS,o=s.readSafeJSONString,a=i.crypto,u=a.ECDSA,c=a.Mac,l=a.Signature;if(r=nt,!Vt(t))return!1;var h=t.split(".");if(3!==h.length)return!1;var f=h[0]+"."+h[1],p=bt(h[2]),d=o(lt(h[0])),g=null,m=null;if(void 0===d.alg)throw"algorithm not specified in header";if((m=(g=d.alg).substr(0,2),null!=n&&"[object Array]"===Object.prototype.toString.call(n)&&n.length>0)&&-1==(":"+n.join(":")+":").indexOf(":"+g+":"))throw"algorithm '"+g+"' not accepted in the list";if("none"!=g&&null===e)throw"key shall be specified to verify.";if("string"==typeof e&&-1!=e.indexOf("-----BEGIN ")&&(e=Qt.getKey(e)),!("RS"!=m&&"PS"!=m||e instanceof r))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==m&&!(e instanceof u))throw"key shall be a ECDSA obj for ES* algs";var v=null;if(void 0===s.jwsalg2sigalg[d.alg])throw"unsupported alg name: "+g;if("none"==(v=s.jwsalg2sigalg[g]))throw"not supported";if("Hmac"==v.substr(0,4)){if(void 0===e)throw"hexadecimal key shall be specified for HMAC";var y=new c({alg:v,pass:e});return y.updateString(f),p==y.doFinal()}if(-1!=v.indexOf("withECDSA")){var b,w=null;try{w=u.concatSigToASN1Sig(p)}catch(t){return!1}return(b=new l({alg:v})).init(e),b.updateString(f),b.verify(w)}return(b=new l({alg:v})).init(e),b.updateString(f),b.verify(p)},ut.jws.JWS.parse=function(t){var e,n,r,i=t.split("."),s={};if(2!=i.length&&3!=i.length)throw"malformed sJWS: wrong number of '.' splitted elements";return e=i[0],n=i[1],3==i.length&&(r=i[2]),s.headerObj=ut.jws.JWS.readSafeJSONString(lt(e)),s.payloadObj=ut.jws.JWS.readSafeJSONString(lt(n)),s.headerPP=JSON.stringify(s.headerObj,null," "),null==s.payloadObj?s.payloadPP=lt(n):s.payloadPP=JSON.stringify(s.payloadObj,null," "),void 0!==r&&(s.sigHex=bt(r)),s},ut.jws.JWS.verifyJWT=function(t,e,n){var r=ut.jws,i=r.JWS,s=i.readSafeJSONString,o=i.inArray,a=i.includedArray;if(!Vt(t))return!1;var u=t.split(".");if(3!=u.length)return!1;var c=u[0],l=u[1],h=(bt(u[2]),s(lt(c))),f=s(lt(l));if(void 0===h.alg)return!1;if(void 0===n.alg)throw"acceptField.alg shall be specified";if(!o(h.alg,n.alg))return!1;if(void 0!==f.iss&&"object"==typeof n.iss&&!o(f.iss,n.iss))return!1;if(void 0!==f.sub&&"object"==typeof n.sub&&!o(f.sub,n.sub))return!1;if(void 0!==f.aud&&"object"==typeof n.aud)if("string"==typeof f.aud){if(!o(f.aud,n.aud))return!1}else if("object"==typeof f.aud&&!a(f.aud,n.aud))return!1;var p=r.IntDate.getNow();return void 0!==n.verifyAt&&"number"==typeof n.verifyAt&&(p=n.verifyAt),void 0!==n.gracePeriod&&"number"==typeof n.gracePeriod||(n.gracePeriod=0),!(void 0!==f.exp&&"number"==typeof f.exp&&f.exp+n.gracePeriod<p)&&(!(void 0!==f.nbf&&"number"==typeof f.nbf&&p<f.nbf-n.gracePeriod)&&(!(void 0!==f.iat&&"number"==typeof f.iat&&p<f.iat-n.gracePeriod)&&((void 0===f.jti||void 0===n.jti||f.jti===n.jti)&&!!i.verify(t,e,n.alg))))},ut.jws.JWS.includedArray=function(t,e){var n=ut.jws.JWS.inArray;if(null===t)return!1;if("object"!=typeof t)return!1;if("number"!=typeof t.length)return!1;for(var r=0;r<t.length;r++)if(!n(t[r],e))return!1;return!0},ut.jws.JWS.inArray=function(t,e){if(null===e)return!1;if("object"!=typeof e)return!1;if("number"!=typeof e.length)return!1;for(var n=0;n<e.length;n++)if(e[n]==t)return!0;return!1},ut.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",ES512:"SHA512withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"},ut.jws.JWS.isSafeJSONString=function(t,e,n){var r=null;try{return"object"!=typeof(r=at(t))||r.constructor===Array?0:(e&&(e[n]=r),1)}catch(t){return 0}},ut.jws.JWS.readSafeJSONString=function(t){var e=null;try{return"object"!=typeof(e=at(t))||e.constructor===Array?null:e}catch(t){return null}},ut.jws.JWS.getEncodedSignatureValueFromJWS=function(t){var e=t.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(null==e)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return e[1]},ut.jws.JWS.getJWKthumbprint=function(t){if("RSA"!==t.kty&&"EC"!==t.kty&&"oct"!==t.kty)throw"unsupported algorithm for JWK Thumprint";var e="{";if("RSA"===t.kty){if("string"!=typeof t.n||"string"!=typeof t.e)throw"wrong n and e value for RSA key";e+='"e":"'+t.e+'",',e+='"kty":"'+t.kty+'",',e+='"n":"'+t.n+'"}'}else if("EC"===t.kty){if("string"!=typeof t.crv||"string"!=typeof t.x||"string"!=typeof t.y)throw"wrong crv, x and y value for EC key";e+='"crv":"'+t.crv+'",',e+='"kty":"'+t.kty+'",',e+='"x":"'+t.x+'",',e+='"y":"'+t.y+'"}'}else if("oct"===t.kty){if("string"!=typeof t.k)throw"wrong k value for oct(symmetric) key";e+='"kty":"'+t.kty+'",',e+='"k":"'+t.k+'"}'}var n=Ft(e);return yt(ut.crypto.Util.hashHex(n,"sha256"))},ut.jws.IntDate={},ut.jws.IntDate.get=function(t){var e=ut.jws.IntDate,n=e.getNow,r=e.getZulu;if("now"==t)return n();if("now + 1hour"==t)return n()+3600;if("now + 1day"==t)return n()+86400;if("now + 1month"==t)return n()+2592e3;if("now + 1year"==t)return n()+31536e3;if(t.match(/Z$/))return r(t);if(t.match(/^[0-9]+$/))return parseInt(t);throw"unsupported format: "+t},ut.jws.IntDate.getZulu=function(t){return Tt(t)},ut.jws.IntDate.getNow=function(){return~~(new Date/1e3)},ut.jws.IntDate.intDate2UTCString=function(t){return new Date(1e3*t).toUTCString()},ut.jws.IntDate.intDate2Zulu=function(t){var e=new Date(1e3*t);return("0000"+e.getUTCFullYear()).slice(-4)+("00"+(e.getUTCMonth()+1)).slice(-2)+("00"+e.getUTCDate()).slice(-2)+("00"+e.getUTCHours()).slice(-2)+("00"+e.getUTCMinutes()).slice(-2)+("00"+e.getUTCSeconds()).slice(-2)+"Z"},void 0!==ut&&ut||(ut={}),void 0!==ut.jws&&ut.jws||(ut.jws={}),ut.jws.JWSJS=function(){var t=ut.jws.JWS,e=t.readSafeJSONString;this.aHeader=[],this.sPayload="",this.aSignature=[],this.init=function(){this.aHeader=[],this.sPayload=void 0,this.aSignature=[]},this.initWithJWS=function(t){this.init();var e=t.split(".");if(3!=e.length)throw"malformed input JWS";this.aHeader.push(e[0]),this.sPayload=e[1],this.aSignature.push(e[2])},this.addSignature=function(t,e,n,r){if(void 0===this.sPayload||null===this.sPayload)throw"there's no JSON-JS signature to add.";var i=this.aHeader.length;if(this.aHeader.length!=this.aSignature.length)throw"aHeader.length != aSignature.length";try{var s=ut.jws.JWS.sign(t,e,this.sPayload,n,r).split(".");s[0],s[2];this.aHeader.push(s[0]),this.aSignature.push(s[2])}catch(t){throw this.aHeader.length>i&&this.aHeader.pop(),this.aSignature.length>i&&this.aSignature.pop(),"addSignature failed: "+t}},this.verifyAll=function(t){if(this.aHeader.length!==t.length||this.aSignature.length!==t.length)return!1;for(var e=0;e<t.length;e++){var n=t[e];if(2!==n.length)return!1;if(!1===this.verifyNth(e,n[0],n[1]))return!1}return!0},this.verifyNth=function(e,n,r){if(this.aHeader.length<=e||this.aSignature.length<=e)return!1;var i=this.aHeader[e],s=this.aSignature[e],o=i+"."+this.sPayload+"."+s,a=!1;try{a=t.verify(o,n,r)}catch(t){return!1}return a},this.readJWSJS=function(t){if("string"==typeof t){var n=e(t);if(null==n)throw"argument is not safe JSON object string";this.aHeader=n.headers,this.sPayload=n.payload,this.aSignature=n.signatures}else try{if(!(t.headers.length>0))throw"malformed header";if(this.aHeader=t.headers,"string"!=typeof t.payload)throw"malformed signatures";if(this.sPayload=t.payload,!(t.signatures.length>0))throw"malformed signatures";this.aSignature=t.signatures}catch(t){throw"malformed JWS-JS JSON object: "+t}},this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}},this.isEmpty=function(){return 0==this.aHeader.length?1:0}},e.SecureRandom=Q,e.rng_seed_time=G,e.BigInteger=x,e.RSAKey=nt,e.ECDSA=ut.crypto.ECDSA,e.DSA=ut.crypto.DSA,e.Signature=ut.crypto.Signature,e.MessageDigest=ut.crypto.MessageDigest,e.Mac=ut.crypto.Mac,e.Cipher=ut.crypto.Cipher,e.KEYUTIL=Qt,e.ASN1HEX=ht,e.X509=re,e.X509CRL=function(t){var e=ut.lang.String.isHex,n=ht,r=n.getV,i=n.getTLV,s=n.getVbyList,o=n.getTLVbyList,a=n.getTLVbyListEx,u=n.getIdxbyList,c=n.getIdxbyListEx,l=n.getChildIdx,h=new re;this.hex=null,this.posSigAlg=null,this.posRevCert=null,this.parsed=null,this._setPos=function(){var t=u(this.hex,0,[0,0]),e=this.hex.substr(t,2);if("02"==e)this.posSigAlg=1;else{if("30"!=e)throw new Error("malformed 1st item of TBSCertList: "+e);this.posSigAlg=0}var n,r=u(this.hex,0,[0,this.posSigAlg+3]),i=this.hex.substr(r,2);if("17"==i||"18"==i)n=u(this.hex,0,[0,this.posSigAlg+4]),this.posRevCert=null,-1!=n&&"30"==this.hex.substr(n,2)&&(this.posRevCert=this.posSigAlg+4);else if("30"==i)this.posRevCert=this.posSigAlg+3;else{if("a0"!=i)throw new Error("malformed nextUpdate or revCert tag: "+i);this.posRevCert=null}},this.getVersion=function(){return 0==this.posSigAlg?null:parseInt(s(this.hex,0,[0,0],"02"),16)+1},this.getSignatureAlgorithmField=function(){var t=o(this.hex,0,[0,this.posSigAlg],"30");return h.getAlgorithmIdentifierName(t)},this.getIssuer=function(){return h.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return o(this.hex,0,[0,this.posSigAlg+1],"30")},this.getThisUpdate=function(){var t=s(this.hex,0,[0,this.posSigAlg+2]);return result=Et(t)},this.getNextUpdate=function(){var t=u(this.hex,0,[0,this.posSigAlg+3]),e=this.hex.substr(t,2);return"17"!=e&&"18"!=e?null:Et(r(this.hex,t))},this.getRevCertArray=function(){if(null==this.posRevCert)return null;for(var t=[],e=u(this.hex,0,[0,this.posRevCert]),n=l(this.hex,e),r=0;r<n.length;r++){var s=i(this.hex,n[r]);t.push(this.getRevCert(s))}return t},this.getRevCert=function(t){var e={},n=l(t,0);return e.sn={hex:s(t,0,[0],"02")},e.date=Et(s(t,0,[1])),3==n.length&&(e.ext=h.getExtParamArray(o(t,0,[2]))),e},this.findRevCert=function(t){var e=new re(t).getSerialNumberHex();return this.findRevCertBySN(e)},this.findRevCertBySN=function(t){if(null==this.parsed&&this.getParam(),null==this.parsed.revcert)return null;for(var e=this.parsed.revcert,n=0;n<e.length;n++)if(t==e[n].sn.hex)return e[n];return null},this.getSignatureValueHex=function(){return s(this.hex,0,[2],"03",!0)},this.verifySignature=function(t){var e=this.getSignatureAlgorithmField(),n=this.getSignatureValueHex(),r=o(this.hex,0,[0],"30"),i=new ut.crypto.Signature({alg:e});return i.init(t),i.updateHex(r),i.verify(n)},this.getParam=function(t){var e={},n=this.getVersion();null!=n&&(e.version=n),e.sigalg=this.getSignatureAlgorithmField(),e.issuer=this.getIssuer(),e.thisupdate=this.getThisUpdate();var r=this.getNextUpdate();null!=r&&(e.nextupdate=r);var i=this.getRevCertArray();if(null!=i&&(e.revcert=i),-1!=c(this.hex,0,[0,"[0]"])){var s=a(this.hex,0,[0,"[0]",0]);e.ext=h.getExtParamArray(s)}return e.sighex=this.getSignatureValueHex(),this.parsed=e,"object"==typeof t&&(1==t.tbshex&&(e.tbshex=o(this.hex,0,[0])),1==t.nodnarray&&delete e.issuer.array),e},"string"==typeof t&&(e(t)?this.hex=t:t.match(/-----BEGIN X509 CRL/)&&(this.hex=$t(t)),this._setPos())},e.CryptoJS=g,e.b64tohex=b,e.b64toBA=w,e.ECFieldElementFp=it,e.ECPointFp=st,e.ECCurveFp=ot,e.stoBA=ft,e.BAtos=pt,e.BAtohex=dt,e.stohex=gt,e.stob64=function(t){return y(gt(t))},e.stob64u=function(t){return mt(y(gt(t)))},e.b64utos=function(t){return pt(w(vt(t)))},e.b64tob64u=mt,e.b64utob64=vt,e.hex2b64=y,e.hextob64u=yt,e.b64utohex=bt,e.utf8tob64u=ct,e.b64utoutf8=lt,e.utf8tob64=function(t){return y(_t(Mt(t)))},e.b64toutf8=function(t){return decodeURIComponent(Pt(b(t)))},e.utf8tohex=wt,e.hextoutf8=xt,e.hextorstr=Et,e.rstrtohex=Ft,e.hextob64=At,e.hextob64nl=Ct,e.b64nltohex=Dt,e.hextopem=It,e.pemtohex=$t,e.hextoArrayBuffer=function(t){if(t.length%2!=0)throw"input is not even length";if(null==t.match(/^[0-9A-Fa-f]+$/))throw"input is not hexadecimal";for(var e=new ArrayBuffer(t.length/2),n=new DataView(e),r=0;r<t.length/2;r++)n.setUint8(r,parseInt(t.substr(2*r,2),16));return e},e.ArrayBuffertohex=function(t){for(var e="",n=new DataView(t),r=0;r<t.byteLength;r++)e+=("00"+n.getUint8(r).toString(16)).slice(-2);return e},e.zulutomsec=Rt,e.zulutosec=Tt,e.zulutodate=function(t){return new Date(Rt(t))},e.datetozulu=function(t,e,n){var r,i=t.getUTCFullYear();if(e){if(i<1950||2049<i)throw"not proper year for UTCTime: "+i;r=(""+i).slice(-2)}else r=("000"+i).slice(-4);if(r+=("0"+(t.getUTCMonth()+1)).slice(-2),r+=("0"+t.getUTCDate()).slice(-2),r+=("0"+t.getUTCHours()).slice(-2),r+=("0"+t.getUTCMinutes()).slice(-2),r+=("0"+t.getUTCSeconds()).slice(-2),n){var s=t.getUTCMilliseconds();0!==s&&(r+="."+(s=(s=("00"+s).slice(-3)).replace(/0+$/g,"")))}return r+="Z"},e.uricmptohex=_t,e.hextouricmp=Pt,e.ipv6tohex=kt,e.hextoipv6=Ot,e.hextoip=jt,e.iptohex=Nt,e.ucs2hextoutf8=Ht,e.encodeURIComponentAll=Mt,e.newline_toUnix=function(t){return t=t.replace(/\r\n/gm,"\n")},e.newline_toDos=function(t){return t=(t=t.replace(/\r\n/gm,"\n")).replace(/\n/gm,"\r\n")},e.hextoposhex=qt,e.intarystrtohex=function(t){t=(t=(t=t.replace(/^\s*\[\s*/,"")).replace(/\s*\]\s*$/,"")).replace(/\s*/g,"");try{return t.split(/,/).map((function(t,e,n){var r=parseInt(t);if(r<0||255<r)throw"integer not in range 0-255";return("00"+r.toString(16)).slice(-2)})).join("")}catch(t){throw"malformed integer array string: "+t}},e.strdiffidx=function(t,e){var n=t.length;t.length>e.length&&(n=e.length);for(var r=0;r<n;r++)if(t.charCodeAt(r)!=e.charCodeAt(r))return r;return t.length!=e.length?n:-1},e.oidtohex=Kt,e.hextooid=zt,e.strpad=Gt,e.bitstrtoint=Wt,e.inttobitstr=Yt,e.bitstrtobinstr=Xt,e.binstrtobitstr=function(t){if("string"!=typeof t)return null;if(null==t.match(/^[01]+$/))return null;try{return Yt(parseInt(t,2))}catch(t){return null}},e.isBase64URLDot=Vt,e.namearraytobinstr=Jt,e.extendClass=Zt,e.KJUR=ut,e.crypto=ut.crypto,e.asn1=ut.asn1,e.jws=ut.jws,e.lang=ut.lang}).call(this,n(184).Buffer)},function(t,e,n){"use strict";n.r(e);n(172),n(173),n(174),n(175),n(176),n(177),n(179),n(181),n(182),n(25),n(183),n(11),n(16),n(37);function r(t,e,n){return{openSimpleModal:function(e){return t.open({templateUrl:e.warning?"js/angular/core/templates/modal/modal-warning.html":"js/angular/core/templates/modal/modal-simple.html",controller:"SimpleModalCtrl",size:e.size,resolve:{title:function(){return e.title},message:function(){return n.trustAsHtml(e.message)}}})},openCopyToClipboardModal:function(n){const r=t.open({templateUrl:"js/angular/core/templates/modal/copy-to-clipboard-modal.html",controller:"CopyToClipboardModalCtrl",resolve:{uri:function(){return n}}});return r.opened.then((function(){e((function(){$("#clipboardURI")[0].select()}),100)})),r}}}function i(t){return{getDetails:function(e){return t.get("rest/explore/details",{params:{uri:e},headers:{Accept:"application/json"}})},getGraph:function(e){const n=encodeURIComponent(e);return t.get("rest/explore/graph?uri="+n+"&role=subject",{headers:{Accept:"application/rdf+json"}})},getNamespaceUriForPrefix:function(t,e){let n="";for(let r=0;r<t.length;r++)if(t[r].prefix===e){n=t[r].uri;break}return n},getNamespacePrefixForUri:function(t,e){let n="";for(let r=0;r<t.length;r++)if(t[r].uri===e){n=t[r].prefix;break}return n},getLocalName:function(t){if(angular.isUndefined(t))return t;{let e;const n=t.length-1;let r=t.toString().lastIndexOf("/");r===n&&(e=t.substr(0,n),r=e.lastIndexOf("/"));let i=t.toString().lastIndexOf("#");return i===n&&(e=t.substr(0,n),i=e.lastIndexOf("/")),t.toString().substring(Math.max(i,r)+1)}}}}angular.module("graphdb.framework.core",["ui.bootstrap","jlareau.bowser","LocalStorageModule","graphdb.framework.core.controllers","pascalprecht.translate"]).provider("$menuItems",(function(){const t=function(e,n){for(let r=0;r<e.length;r++){const i=e[r];if(i.label===n)return i;const s=t(i.children,n);if(!angular.isUndefined(s))return s}},e=function(t,e){for(let n=0;n<t.length;n++){if(t[n].label===e)return!0}return!1},n=function(t,e){return t.order<e.order?-1:t.order>e.order?1:0},r=function(t,e){return{label:t.label,labelKey:t.labelKey,href:t.href,hrefFun:t.hrefFun,order:t.order,role:t.role,editions:t.editions,icon:t.icon,guideSelector:t.guideSelector,children:e}};let i;const s=[];let o=[];this.addItem=function(t){angular.isUndefined(t.parent)?e(s,t.label)||(s.push(r(t,[])),this.updateItemsWithMissedParent()):this.addItemToParent(t)||o.push(t)},this.addItemToParent=function(n){const i=t(s,n.parent);return!angular.isUndefined(i)&&!e(i.children,n.label)&&(i.children.push(r(n,n.children?n.children:[])),!0)},this.updateItemsWithMissedParent=function(){if(o.length>0){const t=[];let e=this;o.forEach((function(n){e.addItemToParent(n)||t.push(n)})),o=t}},this.$get=function(){s.sort(n);for(let t=0;t<s.length;t++){s[t].children.sort(n)}return s},this.setProductInfo=function(t){i=t},this.getProductInfo=function(){return i}})).factory("ModalService",r).factory("ClassInstanceDetailsService",i),r.$inject=["$modal","$timeout","$sce"],i.$inject=["$http"]},function(t,e){function n(t,e){return{get:function(e){return t.get(e)},set:function(e,n){t.set(e,n)},keys:n,remove:r,clearAll:function(){t.clearAll()},clearClassHieararchyState:function(){n().forEach((function(t){0!==t.indexOf("classHierarchy-")||t===e.CLASS_HIERARCHY_HIDE_PREFIXES||t.startsWith("classHierarchy-selectedGraph-")||r(t)}))}};function n(){return t.keys()}function r(e){t.remove(e)}}angular.module("graphdb.framework.utils.localstorageadapter",[]).factory("LocalStorageAdapter",n).value("LSKeys",{TABS_STATE:"tabs-state",TABS_STATE_CURRENT_ID:"tabs-state-currentid",TABS_STATE_MAXID:"tabs-state-maxid",VIEW_MODE:"viewMode",CLASS_HIERARCHY_HIDE_PREFIXES:"classHierarchy-hidePrefixes",CLASS_HIERARCHY_CURRENT_SLIDER_VALUE:"classHierarchy-currentSliderValue",CLASS_HIERARCHY_SWITCH_PREFIXES:"classHierarchy-switchPrefixes",CLASS_HIERARCHY_LAST_SELECTED_CLASS:"classHierarchy-lastSelectedClass",DOMAIN_RANGE_WENT_BACK:"domainRange-wentBack",DOMAIN_RANGE_COLLAPSE_EDGES:"domainRange-collapseEdges",HIDE_SIMILARITY_HELP:"hide-similarity-help",TUTORIAL_STATE:"tutorial-state",MENU_STATE:"menu-state",HIDE_GRAPH_CONFIG_HELP:"hide-graph-config-help",GRAPHS_VIZ:"graphs-viz",AUTOCOMPLETE_ENABLED:"autocomplete.enabled",RDF_SEARCH_TYPE:"rdf-search.search-type",RDF_SEARCH_INPUT:"rdf-search.search-input",RDF_SEARCH_EXPANDED_URI:"rdf-search.search-expanded-uri",RDF_RESOURCE_DESCRIPTION:"rdf-search.resource-description",PREFERRED_LANG:"preferred-language",WORKBENCH_SETTINGS:"workbench-settings"}),n.$inject=["localStorageService","LSKeys"]},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.r(e),n.d(e,"GUIDE_ID",(function(){return cn})),n.d(e,"GUIDE_CURRENT_STEP_ID",(function(){return ln})),n.d(e,"GUIDE_STEP_HISTORY",(function(){return hn})),n.d(e,"GUIDE_PAUSE",(function(){return fn}));var r=n(1),i=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===s}(t)}(t)};
|
|
28
|
-
/*! shepherd.js 10.0.1 */var s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function o(t,e){return!1!==e.clone&&e.isMergeableObject(t)?h((n=t,Array.isArray(n)?[]:{}),t,e):t;var n}function a(t,e,n){return t.concat(e).map((function(t){return o(t,n)}))}function u(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter((function(e){return t.propertyIsEnumerable(e)})):[]}(t))}function c(t,e){try{return e in t}catch(t){return!1}}function l(t,e,n){var r={};return n.isMergeableObject(t)&&u(t).forEach((function(e){r[e]=o(t[e],n)})),u(e).forEach((function(i){(function(t,e){return c(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,i)||(c(t,i)&&n.isMergeableObject(e[i])?r[i]=function(t,e){if(!e.customMerge)return h;var n=e.customMerge(t);return"function"==typeof n?n:h}(i,n)(t[i],e[i],n):r[i]=o(e[i],n))})),r}function h(t,e,n){(n=n||{}).arrayMerge=n.arrayMerge||a,n.isMergeableObject=n.isMergeableObject||i,n.cloneUnlessOtherwiseSpecified=o;var r=Array.isArray(e);return r===Array.isArray(t)?r?n.arrayMerge(t,e,n):l(t,e,n):o(e,n)}h.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce((function(t,n){return h(t,n,e)}),{})};var f=h;function p(t){return t instanceof HTMLElement}function d(t){return"function"==typeof t}function g(t){return"string"==typeof t}function m(t){return void 0===t}class v{on(t,e,n,r){return void 0===r&&(r=!1),m(this.bindings)&&(this.bindings={}),m(this.bindings[t])&&(this.bindings[t]=[]),this.bindings[t].push({handler:e,ctx:n,once:r}),this}once(t,e,n){return this.on(t,e,n,!0)}off(t,e){return m(this.bindings)||m(this.bindings[t])||(m(e)?delete this.bindings[t]:this.bindings[t].forEach((n,r)=>{n.handler===e&&this.bindings[t].splice(r,1)})),this}trigger(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return!m(this.bindings)&&this.bindings[t]&&this.bindings[t].forEach((e,r)=>{const{ctx:i,handler:s,once:o}=e,a=i||this;s.apply(a,n),o&&this.bindings[t].splice(r,1)}),this}}function y(t){const e=Object.getOwnPropertyNames(t.constructor.prototype);for(let n=0;n<e.length;n++){const r=e[n],i=t[r];"constructor"!==r&&"function"==typeof i&&(t[r]=i.bind(t))}return t}function b(t){const{event:e,selector:n}=t.options.advanceOn||{};if(!e)return console.error("advanceOn was defined, but no event name was passed.");{const r=function(t,e){return n=>{if(e.isOpen()){const r=e.el&&n.currentTarget===e.el;(!m(t)&&n.currentTarget.matches(t)||r)&&e.tour.next()}}}(n,t);let i;try{i=document.querySelector(n)}catch(t){}if(!m(n)&&!i)return console.error("No element was found for the selector supplied to advanceOn: "+n);i?(i.addEventListener(e,r),t.on("destroy",()=>i.removeEventListener(e,r))):(document.body.addEventListener(e,r,!0),t.on("destroy",()=>document.body.removeEventListener(e,r,!0)))}}var w="top",x="bottom",S="right",E="left",F=[w,x,S,E],A=F.reduce((function(t,e){return t.concat([e+"-start",e+"-end"])}),[]),C=[].concat(F,["auto"]).reduce((function(t,e){return t.concat([e,e+"-start",e+"-end"])}),[]),D=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function I(t){return t?(t.nodeName||"").toLowerCase():null}function $(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function R(t){return t instanceof $(t).Element||t instanceof Element}function T(t){return t instanceof $(t).HTMLElement||t instanceof HTMLElement}function _(t){return"undefined"!=typeof ShadowRoot&&(t instanceof $(t).ShadowRoot||t instanceof ShadowRoot)}var P={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},r=e.attributes[t]||{},i=e.elements[t];T(i)&&I(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(t){var e=r[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var r=e.elements[t],i=e.attributes[t]||{},s=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});T(r)&&I(r)&&(Object.assign(r.style,s),Object.keys(i).forEach((function(t){r.removeAttribute(t)})))}))}},requires:["computeStyles"]};function k(t){return t.split("-")[0]}var O=Math.max,j=Math.min,B=Math.round;function N(t,e){void 0===e&&(e=!1);var n=t.getBoundingClientRect(),r=1,i=1;if(T(t)&&e){var s=t.offsetHeight,o=t.offsetWidth;o>0&&(r=B(n.width)/o||1),s>0&&(i=B(n.height)/s||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function L(t){var e=N(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function H(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&_(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function M(t){return $(t).getComputedStyle(t)}function U(t){return["table","td","th"].indexOf(I(t))>=0}function V(t){return((R(t)?t.ownerDocument:t.document)||window.document).documentElement}function q(t){return"html"===I(t)?t:t.assignedSlot||t.parentNode||(_(t)?t.host:null)||V(t)}function K(t){return T(t)&&"fixed"!==M(t).position?t.offsetParent:null}function z(t){for(var e=$(t),n=K(t);n&&U(n)&&"static"===M(n).position;)n=K(n);return n&&("html"===I(n)||"body"===I(n)&&"static"===M(n).position)?e:n||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&T(t)&&"fixed"===M(t).position)return null;var n=q(t);for(_(n)&&(n=n.host);T(n)&&["html","body"].indexOf(I(n))<0;){var r=M(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||e&&"filter"===r.willChange||e&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(t)||e}function G(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function W(t,e,n){return O(t,j(e,n))}function Y(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function X(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}function J(t){return t.split("-")[1]}var Z={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Q(t){var e,n=t.popper,r=t.popperRect,i=t.placement,s=t.variation,o=t.offsets,a=t.position,u=t.gpuAcceleration,c=t.adaptive,l=t.roundOffsets,h=t.isFixed,f=o.x,p=void 0===f?0:f,d=o.y,g=void 0===d?0:d,m="function"==typeof l?l({x:p,y:g}):{x:p,y:g};p=m.x,g=m.y;var v=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),b=E,F=w,A=window;if(c){var C=z(n),D="clientHeight",I="clientWidth";if(C===$(n)&&"static"!==M(C=V(n)).position&&"absolute"===a&&(D="scrollHeight",I="scrollWidth"),C=C,i===w||(i===E||i===S)&&"end"===s)F=x,g-=(h&&C===A&&A.visualViewport?A.visualViewport.height:C[D])-r.height,g*=u?1:-1;if(i===E||(i===w||i===x)&&"end"===s)b=S,p-=(h&&C===A&&A.visualViewport?A.visualViewport.width:C[I])-r.width,p*=u?1:-1}var R,T=Object.assign({position:a},c&&Z),_=!0===l?function(t){var e=t.x,n=t.y,r=window.devicePixelRatio||1;return{x:B(e*r)/r||0,y:B(n*r)/r||0}}({x:p,y:g}):{x:p,y:g};return p=_.x,g=_.y,u?Object.assign({},T,((R={})[F]=y?"0":"",R[b]=v?"0":"",R.transform=(A.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",R)):Object.assign({},T,((e={})[F]=y?g+"px":"",e[b]=v?p+"px":"",e.transform="",e))}var tt={passive:!0};var et={left:"right",right:"left",bottom:"top",top:"bottom"};function nt(t){return t.replace(/left|right|bottom|top/g,(function(t){return et[t]}))}var rt={start:"end",end:"start"};function it(t){return t.replace(/start|end/g,(function(t){return rt[t]}))}function st(t){var e=$(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ot(t){return N(V(t)).left+st(t).scrollLeft}function at(t){var e=M(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function ut(t,e){var n;void 0===e&&(e=[]);var r=function t(e){return["html","body","#document"].indexOf(I(e))>=0?e.ownerDocument.body:T(e)&&at(e)?e:t(q(e))}(t),i=r===(null==(n=t.ownerDocument)?void 0:n.body),s=$(r),o=i?[s].concat(s.visualViewport||[],at(r)?r:[]):r,a=e.concat(o);return i?a:a.concat(ut(q(o)))}function ct(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function lt(t,e){return"viewport"===e?ct(function(t){var e=$(t),n=V(t),r=e.visualViewport,i=n.clientWidth,s=n.clientHeight,o=0,a=0;return r&&(i=r.width,s=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=r.offsetLeft,a=r.offsetTop)),{width:i,height:s,x:o+ot(t),y:a}}(t)):R(e)?function(t){var e=N(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):ct(function(t){var e,n=V(t),r=st(t),i=null==(e=t.ownerDocument)?void 0:e.body,s=O(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=O(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+ot(t),u=-r.scrollTop;return"rtl"===M(i||n).direction&&(a+=O(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:o,x:a,y:u}}(V(t)))}function ht(t,e,n){var r="clippingParents"===e?function(t){var e=ut(q(t)),n=["absolute","fixed"].indexOf(M(t).position)>=0&&T(t)?z(t):t;return R(n)?e.filter((function(t){return R(t)&&H(t,n)&&"body"!==I(t)})):[]}(t):[].concat(e),i=[].concat(r,[n]),s=i[0],o=i.reduce((function(e,n){var r=lt(t,n);return e.top=O(r.top,e.top),e.right=j(r.right,e.right),e.bottom=j(r.bottom,e.bottom),e.left=O(r.left,e.left),e}),lt(t,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function ft(t){var e,n=t.reference,r=t.element,i=t.placement,s=i?k(i):null,o=i?J(i):null,a=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2;switch(s){case w:e={x:a,y:n.y-r.height};break;case x:e={x:a,y:n.y+n.height};break;case S:e={x:n.x+n.width,y:u};break;case E:e={x:n.x-r.width,y:u};break;default:e={x:n.x,y:n.y}}var c=s?G(s):null;if(null!=c){var l="y"===c?"height":"width";switch(o){case"start":e[c]=e[c]-(n[l]/2-r[l]/2);break;case"end":e[c]=e[c]+(n[l]/2-r[l]/2)}}return e}function pt(t,e){void 0===e&&(e={});var n=e,r=n.placement,i=void 0===r?t.placement:r,s=n.boundary,o=void 0===s?"clippingParents":s,a=n.rootBoundary,u=void 0===a?"viewport":a,c=n.elementContext,l=void 0===c?"popper":c,h=n.altBoundary,f=void 0!==h&&h,p=n.padding,d=void 0===p?0:p,g=Y("number"!=typeof d?d:X(d,F)),m="popper"===l?"reference":"popper",v=t.rects.popper,y=t.elements[f?m:l],b=ht(R(y)?y:y.contextElement||V(t.elements.popper),o,u),E=N(t.elements.reference),A=ft({reference:E,element:v,strategy:"absolute",placement:i}),C=ct(Object.assign({},v,A)),D="popper"===l?C:E,I={top:b.top-D.top+g.top,bottom:D.bottom-b.bottom+g.bottom,left:b.left-D.left+g.left,right:D.right-b.right+g.right},$=t.modifiersData.offset;if("popper"===l&&$){var T=$[i];Object.keys(I).forEach((function(t){var e=[S,x].indexOf(t)>=0?1:-1,n=[w,x].indexOf(t)>=0?"y":"x";I[t]+=T[n]*e}))}return I}function dt(t,e){void 0===e&&(e={});var n=e,r=n.placement,i=n.boundary,s=n.rootBoundary,o=n.padding,a=n.flipVariations,u=n.allowedAutoPlacements,c=void 0===u?C:u,l=J(r),h=l?a?A:A.filter((function(t){return J(t)===l})):F,f=h.filter((function(t){return c.indexOf(t)>=0}));0===f.length&&(f=h);var p=f.reduce((function(e,n){return e[n]=pt(t,{placement:n,boundary:i,rootBoundary:s,padding:o})[k(n)],e}),{});return Object.keys(p).sort((function(t,e){return p[t]-p[e]}))}function gt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function mt(t){return[w,S,x,E].some((function(e){return t[e]>=0}))}function vt(t,e,n){void 0===n&&(n=!1);var r,i,s=T(e),o=T(e)&&function(t){var e=t.getBoundingClientRect(),n=B(e.width)/t.offsetWidth||1,r=B(e.height)/t.offsetHeight||1;return 1!==n||1!==r}(e),a=V(e),u=N(t,o),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(s||!s&&!n)&&(("body"!==I(e)||at(a))&&(c=(r=e)!==$(r)&&T(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:st(r)),T(e)?((l=N(e,!0)).x+=e.clientLeft,l.y+=e.clientTop):a&&(l.x=ot(a))),{x:u.left+c.scrollLeft-l.x,y:u.top+c.scrollTop-l.y,width:u.width,height:u.height}}function yt(t){var e=new Map,n=new Set,r=[];return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||function t(i){n.add(i.name),[].concat(i.requires||[],i.requiresIfExists||[]).forEach((function(r){if(!n.has(r)){var i=e.get(r);i&&t(i)}})),r.push(i)}(t)})),r}var bt={placement:"bottom",modifiers:[],strategy:"absolute"};function wt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function xt(t){void 0===t&&(t={});var e=t,n=e.defaultModifiers,r=void 0===n?[]:n,i=e.defaultOptions,s=void 0===i?bt:i;return function(t,e,n){void 0===n&&(n=s);var i,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},bt,s),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},u=[],c=!1,l={state:a,setOptions:function(n){var i="function"==typeof n?n(a.options):n;h(),a.options=Object.assign({},s,a.options,i),a.scrollParents={reference:R(t)?ut(t):t.contextElement?ut(t.contextElement):[],popper:ut(e)};var o,c,f=function(t){var e=yt(t);return D.reduce((function(t,n){return t.concat(e.filter((function(t){return t.phase===n})))}),[])}((o=[].concat(r,a.options.modifiers),c=o.reduce((function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t}),{}),Object.keys(c).map((function(t){return c[t]}))));return a.orderedModifiers=f.filter((function(t){return t.enabled})),a.orderedModifiers.forEach((function(t){var e=t.name,n=t.options,r=void 0===n?{}:n,i=t.effect;if("function"==typeof i){var s=i({state:a,name:e,instance:l,options:r});u.push(s||function(){})}})),l.update()},forceUpdate:function(){if(!c){var t=a.elements,e=t.reference,n=t.popper;if(wt(e,n)){a.rects={reference:vt(e,z(n),"fixed"===a.options.strategy),popper:L(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(t){return a.modifiersData[t.name]=Object.assign({},t.data)}));for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var i=a.orderedModifiers[r],s=i.fn,o=i.options,u=void 0===o?{}:o,h=i.name;"function"==typeof s&&(a=s({state:a,options:u,name:h,instance:l})||a)}else a.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(t){l.forceUpdate(),t(a)}))},function(){return o||(o=new Promise((function(t){Promise.resolve().then((function(){o=void 0,t(i())}))}))),o}),destroy:function(){h(),c=!0}};if(!wt(t,e))return l;function h(){u.forEach((function(t){return t()})),u=[]}return l.setOptions(n).then((function(t){!c&&n.onFirstUpdate&&n.onFirstUpdate(t)})),l}}var St=xt({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,s=void 0===i||i,o=r.resize,a=void 0===o||o,u=$(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach((function(t){t.addEventListener("scroll",n.update,tt)})),a&&u.addEventListener("resize",n.update,tt),function(){s&&c.forEach((function(t){t.removeEventListener("scroll",n.update,tt)})),a&&u.removeEventListener("resize",n.update,tt)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=ft({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=void 0===r||r,s=n.adaptive,o=void 0===s||s,a=n.roundOffsets,u=void 0===a||a,c={placement:k(e.placement),variation:J(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Q(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:u})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Q(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},P,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,r=t.name,i=n.offset,s=void 0===i?[0,0]:i,o=C.reduce((function(t,n){return t[n]=function(t,e,n){var r=k(t),i=[E,w].indexOf(r)>=0?-1:1,s="function"==typeof n?n(Object.assign({},e,{placement:t})):n,o=s[0],a=s[1];return o=o||0,a=(a||0)*i,[E,S].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}(n,e.rects,s),t}),{}),a=o[e.placement],u=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,s=void 0===i||i,o=n.altAxis,a=void 0===o||o,u=n.fallbackPlacements,c=n.padding,l=n.boundary,h=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,d=void 0===p||p,g=n.allowedAutoPlacements,m=e.options.placement,v=k(m),y=u||(v===m||!d?[nt(m)]:function(t){if("auto"===k(t))return[];var e=nt(t);return[it(t),e,it(e)]}(m)),b=[m].concat(y).reduce((function(t,n){return t.concat("auto"===k(n)?dt(e,{placement:n,boundary:l,rootBoundary:h,padding:c,flipVariations:d,allowedAutoPlacements:g}):n)}),[]),F=e.rects.reference,A=e.rects.popper,C=new Map,D=!0,I=b[0],$=0;$<b.length;$++){var R=b[$],T=k(R),_="start"===J(R),P=[w,x].indexOf(T)>=0,O=P?"width":"height",j=pt(e,{placement:R,boundary:l,rootBoundary:h,altBoundary:f,padding:c}),B=P?_?S:E:_?x:w;F[O]>A[O]&&(B=nt(B));var N=nt(B),L=[];if(s&&L.push(j[T]<=0),a&&L.push(j[B]<=0,j[N]<=0),L.every((function(t){return t}))){I=R,D=!1;break}C.set(R,L)}if(D)for(var H=function(t){var e=b.find((function(e){var n=C.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return I=e,"break"},M=d?3:1;M>0;M--){if("break"===H(M))break}e.placement!==I&&(e.modifiersData[r]._skip=!0,e.placement=I,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,s=void 0===i||i,o=n.altAxis,a=void 0!==o&&o,u=n.boundary,c=n.rootBoundary,l=n.altBoundary,h=n.padding,f=n.tether,p=void 0===f||f,d=n.tetherOffset,g=void 0===d?0:d,m=pt(e,{boundary:u,rootBoundary:c,padding:h,altBoundary:l}),v=k(e.placement),y=J(e.placement),b=!y,F=G(v),A="x"===F?"y":"x",C=e.modifiersData.popperOffsets,D=e.rects.reference,I=e.rects.popper,$="function"==typeof g?g(Object.assign({},e.rects,{placement:e.placement})):g,R="number"==typeof $?{mainAxis:$,altAxis:$}:Object.assign({mainAxis:0,altAxis:0},$),T=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,_={x:0,y:0};if(C){if(s){var P,B="y"===F?w:E,N="y"===F?x:S,H="y"===F?"height":"width",M=C[F],U=M+m[B],V=M-m[N],q=p?-I[H]/2:0,K="start"===y?D[H]:I[H],Y="start"===y?-I[H]:-D[H],X=e.elements.arrow,Z=p&&X?L(X):{width:0,height:0},Q=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},tt=Q[B],et=Q[N],nt=W(0,D[H],Z[H]),rt=b?D[H]/2-q-nt-tt-R.mainAxis:K-nt-tt-R.mainAxis,it=b?-D[H]/2+q+nt+et+R.mainAxis:Y+nt+et+R.mainAxis,st=e.elements.arrow&&z(e.elements.arrow),ot=st?"y"===F?st.clientTop||0:st.clientLeft||0:0,at=null!=(P=null==T?void 0:T[F])?P:0,ut=M+it-at,ct=W(p?j(U,M+rt-at-ot):U,M,p?O(V,ut):V);C[F]=ct,_[F]=ct-M}if(a){var lt,ht="x"===F?w:E,ft="x"===F?x:S,dt=C[A],gt="y"===A?"height":"width",mt=dt+m[ht],vt=dt-m[ft],yt=-1!==[w,E].indexOf(v),bt=null!=(lt=null==T?void 0:T[A])?lt:0,wt=yt?mt:dt-D[gt]-I[gt]-bt+R.altAxis,xt=yt?dt+D[gt]+I[gt]-bt-R.altAxis:vt,St=p&&yt?function(t,e,n){var r=W(t,e,n);return r>n?n:r}(wt,dt,xt):W(p?wt:mt,dt,p?xt:vt);C[A]=St,_[A]=St-dt}e.modifiersData[r]=_}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,r=t.name,i=t.options,s=n.elements.arrow,o=n.modifiersData.popperOffsets,a=k(n.placement),u=G(a),c=[E,S].indexOf(a)>=0?"height":"width";if(s&&o){var l=function(t,e){return Y("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:X(t,F))}(i.padding,n),h=L(s),f="y"===u?w:E,p="y"===u?x:S,d=n.rects.reference[c]+n.rects.reference[u]-o[u]-n.rects.popper[c],g=o[u]-n.rects.reference[u],m=z(s),v=m?"y"===u?m.clientHeight||0:m.clientWidth||0:0,y=d/2-g/2,b=l[f],A=v-h[c]-l[p],C=v/2-h[c]/2+y,D=W(b,C,A),I=u;n.modifiersData[r]=((e={})[I]=D,e.centerOffset=D-C,e)}},effect:function(t){var e=t.state,n=t.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=e.elements.popper.querySelector(r)))&&H(e.elements.popper,r)&&(e.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,o=pt(e,{elementContext:"reference"}),a=pt(e,{altBoundary:!0}),u=gt(o,r),c=gt(a,i,s),l=mt(u),h=mt(c);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":h})}}]});function Et(){return(Et=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function Ft(t){return{name:"focusAfterRender",enabled:!0,phase:"afterWrite",fn(){setTimeout(()=>{if(t.el){const e={preventScroll:!0};t.el.focus(e)}},300)}}}function At(t){const e=[{name:"applyStyles",fn(t){let{state:e}=t;Object.keys(e.elements).forEach(t=>{if("popper"!==t)return;const n=e.attributes[t]||{},r=e.elements[t];Object.assign(r.style,{position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}),Object.keys(n).forEach(t=>{const e=n[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)})})}},{name:"computeStyles",options:{adaptive:!1}}];let n={placement:"top",strategy:"fixed",modifiers:[Ft(t)]};return n=Et({},n,{modifiers:Array.from(new Set([...n.modifiers,...e]))}),n}function Ct(t){return g(t)&&""!==t?"-"!==t.charAt(t.length-1)?t+"-":t:""}function Dt(t){return null==t||(!t.element||!t.on)}function It(t){t.tooltip&&t.tooltip.destroy();const e=t._getResolvedAttachToOptions();let n=e.element;const r=function(t,e){let n={modifiers:[{name:"preventOverflow",options:{altAxis:!0,tether:!1}},Ft(e)],strategy:"absolute"};Dt(t)?n=At(e):n.placement=t.on;const r=e.tour&&e.tour.options&&e.tour.options.defaultStepOptions;r&&(n=Rt(r,n));return n=Rt(e.options,n),n}(e,t);if(Dt(e)){n=document.body;t.shepherdElementComponent.getElement().classList.add("shepherd-centered")}return t.tooltip=St(n,t.el,r),t.target=e.element,r}function $t(){let t=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)})}function Rt(t,e){if(t.popperOptions){let n=Object.assign({},e,t.popperOptions);if(t.popperOptions.modifiers&&t.popperOptions.modifiers.length>0){const r=t.popperOptions.modifiers.map(t=>t.name),i=e.modifiers.filter(t=>!r.includes(t.name));n.modifiers=Array.from(new Set([...i,...t.popperOptions.modifiers]))}return n}return e}function Tt(){}function _t(t,e){for(const n in e)t[n]=e[n];return t}function Pt(t){return t()}function kt(){return Object.create(null)}function Ot(t){t.forEach(Pt)}function jt(t){return"function"==typeof t}function Bt(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function Nt(t,e){t.appendChild(e)}function Lt(t,e,n){t.insertBefore(e,n||null)}function Ht(t){t.parentNode.removeChild(t)}function Mt(t){return document.createElement(t)}function Ut(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Vt(t){return document.createTextNode(t)}function qt(){return Vt(" ")}function Kt(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function zt(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Gt(t,e){const n=Object.getOwnPropertyDescriptors(t.__proto__);for(const r in e)null==e[r]?t.removeAttribute(r):"style"===r?t.style.cssText=e[r]:"__value"===r?t.value=t[r]=e[r]:n[r]&&n[r].set?t[r]=e[r]:zt(t,r,e[r])}function Wt(t,e,n){t.classList[n?"add":"remove"](e)}let Yt;function Xt(t){Yt=t}function Jt(){if(!Yt)throw new Error("Function called outside component initialization");return Yt}function Zt(t){Jt().$$.after_update.push(t)}const Qt=[],te=[],ee=[],ne=[],re=Promise.resolve();let ie=!1;function se(t){ee.push(t)}const oe=new Set;let ae=0;function ue(){const t=Yt;do{for(;ae<Qt.length;){const t=Qt[ae];ae++,Xt(t),ce(t.$$)}for(Xt(null),Qt.length=0,ae=0;te.length;)te.pop()();for(let t=0;t<ee.length;t+=1){const e=ee[t];oe.has(e)||(oe.add(e),e())}ee.length=0}while(Qt.length);for(;ne.length;)ne.pop()();ie=!1,oe.clear(),Xt(t)}function ce(t){if(null!==t.fragment){t.update(),Ot(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(se)}}const le=new Set;let he;function fe(){he={r:0,c:[],p:he}}function pe(){he.r||Ot(he.c),he=he.p}function de(t,e){t&&t.i&&(le.delete(t),t.i(e))}function ge(t,e,n,r){if(t&&t.o){if(le.has(t))return;le.add(t),he.c.push(()=>{le.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}else r&&r()}function me(t){t&&t.c()}function ve(t,e,n,r){const{fragment:i,on_mount:s,on_destroy:o,after_update:a}=t.$$;i&&i.m(e,n),r||se(()=>{const e=s.map(Pt).filter(jt);o?o.push(...e):Ot(e),t.$$.on_mount=[]}),a.forEach(se)}function ye(t,e){const n=t.$$;null!==n.fragment&&(Ot(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function be(t,e){-1===t.$$.dirty[0]&&(Qt.push(t),ie||(ie=!0,re.then(ue)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function we(t,e,n,r,i,s,o,a){void 0===a&&(a=[-1]);const u=Yt;Xt(t);const c=t.$$={fragment:null,ctx:null,props:s,update:Tt,not_equal:i,bound:kt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:kt(),dirty:a,skip_bound:!1,root:e.target||u.$$.root};o&&o(c.root);let l=!1;if(c.ctx=n?n(t,e.props||{},(function(e,n){const r=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:n;return c.ctx&&i(c.ctx[e],c.ctx[e]=r)&&(!c.skip_bound&&c.bound[e]&&c.bound[e](r),l&&be(t,e)),n})):[],c.update(),l=!0,Ot(c.before_update),c.fragment=!!r&&r(c.ctx),e.target){if(e.hydrate){const t=(h=e.target,Array.from(h.childNodes));c.fragment&&c.fragment.l(t),t.forEach(Ht)}else c.fragment&&c.fragment.c();e.intro&&de(t.$$.fragment),ve(t,e.target,e.anchor,e.customElement),ue()}var h;Xt(u)}class xe{$destroy(){ye(this,1),this.$destroy=Tt}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function Se(t){let e,n,r,i,s;return{c(){e=Mt("button"),zt(e,"aria-label",n=t[3]?t[3]:null),zt(e,"class",r=`${t[1]||""} shepherd-button ${t[4]?"shepherd-button-secondary":""}`),e.disabled=t[2],zt(e,"tabindex","0")},m(n,r){Lt(n,e,r),e.innerHTML=t[5],i||(s=Kt(e,"click",(function(){jt(t[0])&&t[0].apply(this,arguments)})),i=!0)},p(i,s){let[o]=s;t=i,32&o&&(e.innerHTML=t[5]),8&o&&n!==(n=t[3]?t[3]:null)&&zt(e,"aria-label",n),18&o&&r!==(r=`${t[1]||""} shepherd-button ${t[4]?"shepherd-button-secondary":""}`)&&zt(e,"class",r),4&o&&(e.disabled=t[2])},i:Tt,o:Tt,d(t){t&&Ht(e),i=!1,s()}}}function Ee(t,e,n){let r,i,s,o,a,u,{config:c,step:l}=e;function h(t){return d(t)?t.call(l):t}return t.$$set=t=>{"config"in t&&n(6,c=t.config),"step"in t&&n(7,l=t.step)},t.$$.update=()=>{192&t.$$.dirty&&(n(0,r=c.action?c.action.bind(l.tour):null),n(1,i=c.classes),n(2,s=!!c.disabled&&h(c.disabled)),n(3,o=c.label?h(c.label):null),n(4,a=c.secondary),n(5,u=c.text?h(c.text):null))},[r,i,s,o,a,u,c,l]}class Fe extends xe{constructor(t){super(),we(this,t,Ee,Se,Bt,{config:6,step:7})}}function Ae(t,e,n){const r=t.slice();return r[2]=e[n],r}function Ce(t){let e,n,r=t[1],i=[];for(let e=0;e<r.length;e+=1)i[e]=De(Ae(t,r,e));const s=t=>ge(i[t],1,1,()=>{i[t]=null});return{c(){for(let t=0;t<i.length;t+=1)i[t].c();e=Vt("")},m(t,r){for(let e=0;e<i.length;e+=1)i[e].m(t,r);Lt(t,e,r),n=!0},p(t,n){if(3&n){let o;for(r=t[1],o=0;o<r.length;o+=1){const s=Ae(t,r,o);i[o]?(i[o].p(s,n),de(i[o],1)):(i[o]=De(s),i[o].c(),de(i[o],1),i[o].m(e.parentNode,e))}for(fe(),o=r.length;o<i.length;o+=1)s(o);pe()}},i(t){if(!n){for(let t=0;t<r.length;t+=1)de(i[t]);n=!0}},o(t){i=i.filter(Boolean);for(let t=0;t<i.length;t+=1)ge(i[t]);n=!1},d(t){!function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(i,t),t&&Ht(e)}}}function De(t){let e,n;return e=new Fe({props:{config:t[2],step:t[0]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};2&n&&(r.config=t[2]),1&n&&(r.step=t[0]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function Ie(t){let e,n,r=t[1]&&Ce(t);return{c(){e=Mt("footer"),r&&r.c(),zt(e,"class","shepherd-footer")},m(t,i){Lt(t,e,i),r&&r.m(e,null),n=!0},p(t,n){let[i]=n;t[1]?r?(r.p(t,i),2&i&&de(r,1)):(r=Ce(t),r.c(),de(r,1),r.m(e,null)):r&&(fe(),ge(r,1,1,()=>{r=null}),pe())},i(t){n||(de(r),n=!0)},o(t){ge(r),n=!1},d(t){t&&Ht(e),r&&r.d()}}}function $e(t,e,n){let r,{step:i}=e;return t.$$set=t=>{"step"in t&&n(0,i=t.step)},t.$$.update=()=>{1&t.$$.dirty&&n(1,r=i.options.buttons)},[i,r]}class Re extends xe{constructor(t){super(),we(this,t,$e,Ie,Bt,{step:0})}}function Te(t){let e,n,r,i,s;return{c(){e=Mt("button"),n=Mt("span"),n.textContent="×",zt(n,"aria-hidden","true"),zt(e,"aria-label",r=t[0].label?t[0].label:"Close Tour"),zt(e,"class","shepherd-cancel-icon"),zt(e,"type","button")},m(r,o){Lt(r,e,o),Nt(e,n),i||(s=Kt(e,"click",t[1]),i=!0)},p(t,n){let[i]=n;1&i&&r!==(r=t[0].label?t[0].label:"Close Tour")&&zt(e,"aria-label",r)},i:Tt,o:Tt,d(t){t&&Ht(e),i=!1,s()}}}function _e(t,e,n){let{cancelIcon:r,step:i}=e;return t.$$set=t=>{"cancelIcon"in t&&n(0,r=t.cancelIcon),"step"in t&&n(2,i=t.step)},[r,t=>{t.preventDefault(),i.cancel()},i]}class Pe extends xe{constructor(t){super(),we(this,t,_e,Te,Bt,{cancelIcon:0,step:2})}}function ke(t){let e;return{c(){e=Mt("h3"),zt(e,"id",t[1]),zt(e,"class","shepherd-title")},m(n,r){Lt(n,e,r),t[3](e)},p(t,n){let[r]=n;2&r&&zt(e,"id",t[1])},i:Tt,o:Tt,d(n){n&&Ht(e),t[3](null)}}}function Oe(t,e,n){let{labelId:r,element:i,title:s}=e;return Zt(()=>{d(s)&&n(2,s=s()),n(0,i.innerHTML=s,i)}),t.$$set=t=>{"labelId"in t&&n(1,r=t.labelId),"element"in t&&n(0,i=t.element),"title"in t&&n(2,s=t.title)},[i,r,s,function(t){te[t?"unshift":"push"](()=>{i=t,n(0,i)})}]}class je extends xe{constructor(t){super(),we(this,t,Oe,ke,Bt,{labelId:1,element:0,title:2})}}function Be(t){let e,n;return e=new je({props:{labelId:t[0],title:t[2]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};1&n&&(r.labelId=t[0]),4&n&&(r.title=t[2]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function Ne(t){let e,n;return e=new Pe({props:{cancelIcon:t[3],step:t[1]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};8&n&&(r.cancelIcon=t[3]),2&n&&(r.step=t[1]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function Le(t){let e,n,r,i=t[2]&&Be(t),s=t[3]&&t[3].enabled&&Ne(t);return{c(){e=Mt("header"),i&&i.c(),n=qt(),s&&s.c(),zt(e,"class","shepherd-header")},m(t,o){Lt(t,e,o),i&&i.m(e,null),Nt(e,n),s&&s.m(e,null),r=!0},p(t,r){let[o]=r;t[2]?i?(i.p(t,o),4&o&&de(i,1)):(i=Be(t),i.c(),de(i,1),i.m(e,n)):i&&(fe(),ge(i,1,1,()=>{i=null}),pe()),t[3]&&t[3].enabled?s?(s.p(t,o),8&o&&de(s,1)):(s=Ne(t),s.c(),de(s,1),s.m(e,null)):s&&(fe(),ge(s,1,1,()=>{s=null}),pe())},i(t){r||(de(i),de(s),r=!0)},o(t){ge(i),ge(s),r=!1},d(t){t&&Ht(e),i&&i.d(),s&&s.d()}}}function He(t,e,n){let r,i,{labelId:s,step:o}=e;return t.$$set=t=>{"labelId"in t&&n(0,s=t.labelId),"step"in t&&n(1,o=t.step)},t.$$.update=()=>{2&t.$$.dirty&&(n(2,r=o.options.title),n(3,i=o.options.cancelIcon))},[s,o,r,i]}class Me extends xe{constructor(t){super(),we(this,t,He,Le,Bt,{labelId:0,step:1})}}function Ue(t){let e;return{c(){e=Mt("div"),zt(e,"class","shepherd-text"),zt(e,"id",t[1])},m(n,r){Lt(n,e,r),t[3](e)},p(t,n){let[r]=n;2&r&&zt(e,"id",t[1])},i:Tt,o:Tt,d(n){n&&Ht(e),t[3](null)}}}function Ve(t,e,n){let{descriptionId:r,element:i,step:s}=e;return Zt(()=>{let{text:t}=s.options;d(t)&&(t=t.call(s)),p(t)?i.appendChild(t):n(0,i.innerHTML=t,i)}),t.$$set=t=>{"descriptionId"in t&&n(1,r=t.descriptionId),"element"in t&&n(0,i=t.element),"step"in t&&n(2,s=t.step)},[i,r,s,function(t){te[t?"unshift":"push"](()=>{i=t,n(0,i)})}]}class qe extends xe{constructor(t){super(),we(this,t,Ve,Ue,Bt,{descriptionId:1,element:0,step:2})}}function Ke(t){let e,n;return e=new Me({props:{labelId:t[1],step:t[2]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};2&n&&(r.labelId=t[1]),4&n&&(r.step=t[2]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function ze(t){let e,n;return e=new qe({props:{descriptionId:t[0],step:t[2]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};1&n&&(r.descriptionId=t[0]),4&n&&(r.step=t[2]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function Ge(t){let e,n;return e=new Re({props:{step:t[2]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};4&n&&(r.step=t[2]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function We(t){let e,n,r,i,s=!m(t[2].options.title)||t[2].options.cancelIcon&&t[2].options.cancelIcon.enabled,o=!m(t[2].options.text),a=Array.isArray(t[2].options.buttons)&&t[2].options.buttons.length,u=s&&Ke(t),c=o&&ze(t),l=a&&Ge(t);return{c(){e=Mt("div"),u&&u.c(),n=qt(),c&&c.c(),r=qt(),l&&l.c(),zt(e,"class","shepherd-content")},m(t,s){Lt(t,e,s),u&&u.m(e,null),Nt(e,n),c&&c.m(e,null),Nt(e,r),l&&l.m(e,null),i=!0},p(t,i){let[h]=i;4&h&&(s=!m(t[2].options.title)||t[2].options.cancelIcon&&t[2].options.cancelIcon.enabled),s?u?(u.p(t,h),4&h&&de(u,1)):(u=Ke(t),u.c(),de(u,1),u.m(e,n)):u&&(fe(),ge(u,1,1,()=>{u=null}),pe()),4&h&&(o=!m(t[2].options.text)),o?c?(c.p(t,h),4&h&&de(c,1)):(c=ze(t),c.c(),de(c,1),c.m(e,r)):c&&(fe(),ge(c,1,1,()=>{c=null}),pe()),4&h&&(a=Array.isArray(t[2].options.buttons)&&t[2].options.buttons.length),a?l?(l.p(t,h),4&h&&de(l,1)):(l=Ge(t),l.c(),de(l,1),l.m(e,null)):l&&(fe(),ge(l,1,1,()=>{l=null}),pe())},i(t){i||(de(u),de(c),de(l),i=!0)},o(t){ge(u),ge(c),ge(l),i=!1},d(t){t&&Ht(e),u&&u.d(),c&&c.d(),l&&l.d()}}}function Ye(t,e,n){let{descriptionId:r,labelId:i,step:s}=e;return t.$$set=t=>{"descriptionId"in t&&n(0,r=t.descriptionId),"labelId"in t&&n(1,i=t.labelId),"step"in t&&n(2,s=t.step)},[r,i,s]}class Xe extends xe{constructor(t){super(),we(this,t,Ye,We,Bt,{descriptionId:0,labelId:1,step:2})}}function Je(t){let e;return{c(){e=Mt("div"),zt(e,"class","shepherd-arrow"),zt(e,"data-popper-arrow","")},m(t,n){Lt(t,e,n)},d(t){t&&Ht(e)}}}function Ze(t){let e,n,r,i,s,o,a,u,c=t[4].options.arrow&&t[4].options.attachTo&&t[4].options.attachTo.element&&t[4].options.attachTo.on&&Je();r=new Xe({props:{descriptionId:t[2],labelId:t[3],step:t[4]}});let l=[{"aria-describedby":i=m(t[4].options.text)?null:t[2]},{"aria-labelledby":s=t[4].options.title?t[3]:null},t[1],{role:"dialog"},{tabindex:"0"}],h={};for(let t=0;t<l.length;t+=1)h=_t(h,l[t]);return{c(){e=Mt("div"),c&&c.c(),n=qt(),me(r.$$.fragment),Gt(e,h),Wt(e,"shepherd-has-cancel-icon",t[5]),Wt(e,"shepherd-has-title",t[6]),Wt(e,"shepherd-element",!0)},m(i,s){Lt(i,e,s),c&&c.m(e,null),Nt(e,n),ve(r,e,null),t[13](e),o=!0,a||(u=Kt(e,"keydown",t[7]),a=!0)},p(t,a){let[u]=a;t[4].options.arrow&&t[4].options.attachTo&&t[4].options.attachTo.element&&t[4].options.attachTo.on?c||(c=Je(),c.c(),c.m(e,n)):c&&(c.d(1),c=null);const f={};4&u&&(f.descriptionId=t[2]),8&u&&(f.labelId=t[3]),16&u&&(f.step=t[4]),r.$set(f),Gt(e,h=function(t,e){const n={},r={},i={$$scope:1};let s=t.length;for(;s--;){const o=t[s],a=e[s];if(a){for(const t in o)t in a||(r[t]=1);for(const t in a)i[t]||(n[t]=a[t],i[t]=1);t[s]=a}else for(const t in o)i[t]=1}for(const t in r)t in n||(n[t]=void 0);return n}(l,[(!o||20&u&&i!==(i=m(t[4].options.text)?null:t[2]))&&{"aria-describedby":i},(!o||24&u&&s!==(s=t[4].options.title?t[3]:null))&&{"aria-labelledby":s},2&u&&t[1],{role:"dialog"},{tabindex:"0"}])),Wt(e,"shepherd-has-cancel-icon",t[5]),Wt(e,"shepherd-has-title",t[6]),Wt(e,"shepherd-element",!0)},i(t){o||(de(r.$$.fragment,t),o=!0)},o(t){ge(r.$$.fragment,t),o=!1},d(n){n&&Ht(e),c&&c.d(),ye(r),t[13](null),a=!1,u()}}}function Qe(t){return t.split(" ").filter(t=>!!t.length)}function tn(t,e,n){let r,i,s,{classPrefix:o,element:a,descriptionId:u,firstFocusableElement:c,focusableElements:l,labelId:h,lastFocusableElement:f,step:p,dataStepId:d}=e;var m;m=()=>{n(1,d={[`data-${o}shepherd-step-id`]:p.id}),n(9,l=a.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]')),n(8,c=l[0]),n(10,f=l[l.length-1])},Jt().$$.on_mount.push(m),Zt(()=>{s!==p.options.classes&&(function(t){if(g(t)){const e=Qe(t);e.length&&a.classList.remove(...e)}}(s),s=p.options.classes,function(t){if(g(t)){const e=Qe(t);e.length&&a.classList.add(...e)}}(s))});return t.$$set=t=>{"classPrefix"in t&&n(11,o=t.classPrefix),"element"in t&&n(0,a=t.element),"descriptionId"in t&&n(2,u=t.descriptionId),"firstFocusableElement"in t&&n(8,c=t.firstFocusableElement),"focusableElements"in t&&n(9,l=t.focusableElements),"labelId"in t&&n(3,h=t.labelId),"lastFocusableElement"in t&&n(10,f=t.lastFocusableElement),"step"in t&&n(4,p=t.step),"dataStepId"in t&&n(1,d=t.dataStepId)},t.$$.update=()=>{16&t.$$.dirty&&(n(5,r=p.options&&p.options.cancelIcon&&p.options.cancelIcon.enabled),n(6,i=p.options&&p.options.title))},[a,d,u,h,p,r,i,t=>{const{tour:e}=p;switch(t.keyCode){case 9:if(0===l.length){t.preventDefault();break}t.shiftKey?(document.activeElement===c||document.activeElement.classList.contains("shepherd-element"))&&(t.preventDefault(),f.focus()):document.activeElement===f&&(t.preventDefault(),c.focus());break;case 27:e.options.exitOnEsc&&p.cancel();break;case 37:e.options.keyboardNavigation&&e.back();break;case 39:e.options.keyboardNavigation&&e.next()}},c,l,f,o,()=>a,function(t){te[t?"unshift":"push"](()=>{a=t,n(0,a)})}]}class en extends xe{constructor(t){super(),we(this,t,tn,Ze,Bt,{classPrefix:11,element:0,descriptionId:2,firstFocusableElement:8,focusableElements:9,labelId:3,lastFocusableElement:10,step:4,dataStepId:1,getElement:12})}get getElement(){return this.$$.ctx[12]}}var nn=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){t.exports={polyfill:function(){var t=window,e=document;if(!("scrollBehavior"in e.documentElement.style)||!0===t.__forceSmoothScrollPolyfill__){var n,r=t.HTMLElement||t.Element,i={scroll:t.scroll||t.scrollTo,scrollBy:t.scrollBy,elementScroll:r.prototype.scroll||a,scrollIntoView:r.prototype.scrollIntoView},s=t.performance&&t.performance.now?t.performance.now.bind(t.performance):Date.now,o=(n=t.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);t.scroll=t.scrollTo=function(){void 0!==arguments[0]&&(!0!==u(arguments[0])?d.call(t,e.body,void 0!==arguments[0].left?~~arguments[0].left:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:t.scrollY||t.pageYOffset):i.scroll.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:t.scrollY||t.pageYOffset))},t.scrollBy=function(){void 0!==arguments[0]&&(u(arguments[0])?i.scrollBy.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):d.call(t,e.body,~~arguments[0].left+(t.scrollX||t.pageXOffset),~~arguments[0].top+(t.scrollY||t.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==u(arguments[0])){var t=arguments[0].left,e=arguments[0].top;d.call(this,this,void 0===t?this.scrollLeft:~~t,void 0===e?this.scrollTop:~~e)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==u(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==u(arguments[0])){var n=f(this),r=n.getBoundingClientRect(),s=this.getBoundingClientRect();n!==e.body?(d.call(this,n,n.scrollLeft+s.left-r.left,n.scrollTop+s.top-r.top),"fixed"!==t.getComputedStyle(n).position&&t.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):t.scrollBy({left:s.left,top:s.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function a(t,e){this.scrollLeft=t,this.scrollTop=e}function u(t){if(null===t||"object"!=typeof t||void 0===t.behavior||"auto"===t.behavior||"instant"===t.behavior)return!0;if("object"==typeof t&&"smooth"===t.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+t.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(t,e){return"Y"===e?t.clientHeight+o<t.scrollHeight:"X"===e?t.clientWidth+o<t.scrollWidth:void 0}function l(e,n){var r=t.getComputedStyle(e,null)["overflow"+n];return"auto"===r||"scroll"===r}function h(t){var e=c(t,"Y")&&l(t,"Y"),n=c(t,"X")&&l(t,"X");return e||n}function f(t){for(;t!==e.body&&!1===h(t);)t=t.parentNode||t.host;return t}function p(e){var n,r,i,o,a=(s()-e.startTime)/468;o=a=a>1?1:a,n=.5*(1-Math.cos(Math.PI*o)),r=e.startX+(e.x-e.startX)*n,i=e.startY+(e.y-e.startY)*n,e.method.call(e.scrollable,r,i),r===e.x&&i===e.y||t.requestAnimationFrame(p.bind(t,e))}function d(n,r,o){var u,c,l,h,f=s();n===e.body?(u=t,c=t.scrollX||t.pageXOffset,l=t.scrollY||t.pageYOffset,h=i.scroll):(u=n,c=n.scrollLeft,l=n.scrollTop,h=a),p({scrollable:u,method:h,startTime:f,startX:c,startY:l,x:r,y:o})}}}}));nn.polyfill,nn.polyfill();class rn extends v{constructor(t,e){return void 0===e&&(e={}),super(t,e),this.tour=t,this.classPrefix=this.tour.options?Ct(this.tour.options.classPrefix):"",this.styles=t.styles,this._resolvedAttachTo=null,y(this),this._setOptions(e),this}cancel(){this.tour.cancel(),this.trigger("cancel")}complete(){this.tour.complete(),this.trigger("complete")}destroy(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null),p(this.el)&&this.el.parentNode&&(this.el.parentNode.removeChild(this.el),this.el=null),this._updateStepTargetOnHide(),this.trigger("destroy")}getTour(){return this.tour}hide(){this.tour.modal.hide(),this.trigger("before-hide"),this.el&&(this.el.hidden=!0),this._updateStepTargetOnHide(),this.trigger("hide")}_resolveAttachToOptions(){return this._resolvedAttachTo=function(t){const e=t.options.attachTo||{},n=Object.assign({},e);if(d(n.element)&&(n.element=n.element.call(t)),g(n.element)){try{n.element=document.querySelector(n.element)}catch(t){}n.element||console.error("The element for this Shepherd step was not found "+e.element)}return n}(this),this._resolvedAttachTo}_getResolvedAttachToOptions(){return null===this._resolvedAttachTo?this._resolveAttachToOptions():this._resolvedAttachTo}isOpen(){return Boolean(this.el&&!this.el.hidden)}show(){if(d(this.options.beforeShowPromise)){const t=this.options.beforeShowPromise();if(!m(t))return t.then(()=>this._show())}this._show()}updateStepOptions(t){Object.assign(this.options,t),this.shepherdElementComponent&&this.shepherdElementComponent.$set({step:this})}getElement(){return this.el}getTarget(){return this.target}_createTooltipContent(){const t=this.id+"-description",e=this.id+"-label";return this.shepherdElementComponent=new en({target:this.tour.options.stepsContainer||document.body,props:{classPrefix:this.classPrefix,descriptionId:t,labelId:e,step:this,styles:this.styles}}),this.shepherdElementComponent.getElement()}_scrollTo(t){const{element:e}=this._getResolvedAttachToOptions();d(this.options.scrollToHandler)?this.options.scrollToHandler(e):e instanceof Element&&"function"==typeof e.scrollIntoView&&e.scrollIntoView(t)}_getClassOptions(t){const e=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions,n=t.classes?t.classes:"",r=e&&e.classes?e.classes:"",i=[...n.split(" "),...r.split(" ")],s=new Set(i);return Array.from(s).join(" ").trim()}_setOptions(t){void 0===t&&(t={});let e=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions;e=f({},e||{}),this.options=Object.assign({arrow:!0},e,t);const{when:n}=this.options;this.options.classes=this._getClassOptions(t),this.destroy(),this.id=this.options.id||"step-"+$t(),n&&Object.keys(n).forEach(t=>{this.on(t,n[t],this)})}_setupElements(){m(this.el)||this.destroy(),this.el=this._createTooltipContent(),this.options.advanceOn&&b(this),It(this)}_show(){this.trigger("before-show"),this._resolveAttachToOptions(),this._setupElements(),this.tour.modal||this.tour._setupModal(),this.tour.modal.setupForStep(this),this._styleTargetElementForStep(this),this.el.hidden=!1,this.options.scrollTo&&setTimeout(()=>{this._scrollTo(this.options.scrollTo)}),this.el.hidden=!1;const t=this.shepherdElementComponent.getElement(),e=this.target||document.body;e.classList.add(this.classPrefix+"shepherd-enabled"),e.classList.add(this.classPrefix+"shepherd-target"),t.classList.add("shepherd-enabled"),this.trigger("show")}_styleTargetElementForStep(t){const e=t.target;e&&(t.options.highlightClass&&e.classList.add(t.options.highlightClass),e.classList.remove("shepherd-target-click-disabled"),!1===t.options.canClickTarget&&e.classList.add("shepherd-target-click-disabled"))}_updateStepTargetOnHide(){const t=this.target||document.body;this.options.highlightClass&&t.classList.remove(this.options.highlightClass),t.classList.remove("shepherd-target-click-disabled",this.classPrefix+"shepherd-enabled",this.classPrefix+"shepherd-target")}}function sn(t){let e,n,r,i,s;return{c(){e=Ut("svg"),n=Ut("path"),zt(n,"d",t[2]),zt(e,"class",r=(t[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")},m(r,o){Lt(r,e,o),Nt(e,n),t[11](e),i||(s=Kt(e,"touchmove",t[3]),i=!0)},p(t,i){let[s]=i;4&s&&zt(n,"d",t[2]),2&s&&r!==(r=(t[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")&&zt(e,"class",r)},i:Tt,o:Tt,d(n){n&&Ht(e),t[11](null),i=!1,s()}}}function on(t,e,n){let{element:r,openingProperties:i}=e;$t();let s,o=!1,a=void 0;u();function u(){n(4,i={width:0,height:0,x:0,y:0,r:0})}function c(){n(1,o=!1),p()}function l(t,e,r,s){if(void 0===t&&(t=0),void 0===e&&(e=0),s){const{y:o,height:a}=function(t,e){const n=t.getBoundingClientRect();let r=n.y||n.top,i=n.bottom||r+n.height;if(e){const t=e.getBoundingClientRect(),n=t.y||t.top,s=t.bottom||n+t.height;r=Math.max(r,n),i=Math.min(i,s)}return{y:r,height:Math.max(i-r,0)}}(s,r),{x:u,width:c,left:l}=s.getBoundingClientRect();n(4,i={width:c+2*t,height:a+2*t,x:(u||l)-t,y:o-t,r:e})}else u()}function h(){n(1,o=!0)}const f=t=>{t.preventDefault()};function p(){a&&(cancelAnimationFrame(a),a=void 0),window.removeEventListener("touchmove",f,{passive:!1})}return t.$$set=t=>{"element"in t&&n(0,r=t.element),"openingProperties"in t&&n(4,i=t.openingProperties)},t.$$.update=()=>{16&t.$$.dirty&&n(2,s=function(t){let{width:e,height:n,x:r=0,y:i=0,r:s=0}=t;const{innerWidth:o,innerHeight:a}=window;return`M${o},${a}H0V0H${o}V${a}ZM${r+s},${i}a${s},${s},0,0,0-${s},${s}V${n+i-s}a${s},${s},0,0,0,${s},${s}H${e+r-s}a${s},${s},0,0,0,${s}-${s}V${i+s}a${s},${s},0,0,0-${s}-${s}Z`}(i))},[r,o,s,t=>{t.stopPropagation()},i,()=>r,u,c,l,function(t){p(),t.tour.options.useModalOverlay?(!function(t){const{modalOverlayOpeningPadding:e,modalOverlayOpeningRadius:n}=t.options,r=function t(e){if(!e)return null;const n=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY;return"hidden"!==n&&"visible"!==n&&e.scrollHeight>=e.clientHeight?e:t(e.parentElement)}(t.target),i=()=>{a=void 0,l(e,n,r,t.target),a=requestAnimationFrame(i)};i(),window.addEventListener("touchmove",f,{passive:!1})}(t),h()):c()},h,function(t){te[t?"unshift":"push"](()=>{r=t,n(0,r)})}]}class an extends xe{constructor(t){super(),we(this,t,on,sn,Bt,{element:0,openingProperties:4,getElement:5,closeModalOpening:6,hide:7,positionModal:8,setupForStep:9,show:10})}get getElement(){return this.$$.ctx[5]}get closeModalOpening(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[7]}get positionModal(){return this.$$.ctx[8]}get setupForStep(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}}const un=new v;Object.assign(un,{Tour:class extends v{constructor(t){void 0===t&&(t={}),super(t),y(this);this.options=Object.assign({},{exitOnEsc:!0,keyboardNavigation:!0},t),this.classPrefix=Ct(this.options.classPrefix),this.steps=[],this.addSteps(this.options.steps);return["active","cancel","complete","inactive","show","start"].map(t=>{(t=>{this.on(t,e=>{(e=e||{}).tour=this,un.trigger(t,e)})})(t)}),this._setTourID(),this}addStep(t,e){let n=t;return n instanceof rn?n.tour=this:n=new rn(this,n),m(e)?this.steps.push(n):this.steps.splice(e,0,n),n}addSteps(t){return Array.isArray(t)&&t.forEach(t=>{this.addStep(t)}),this}back(){const t=this.steps.indexOf(this.currentStep);this.show(t-1,!1)}cancel(){if(this.options.confirmCancel){const t=this.options.confirmCancelMessage||"Are you sure you want to stop the tour?";window.confirm(t)&&this._done("cancel")}else this._done("cancel")}complete(){this._done("complete")}getById(t){return this.steps.find(e=>e.id===t)}getCurrentStep(){return this.currentStep}hide(){const t=this.getCurrentStep();if(t)return t.hide()}isActive(){return un.activeTour===this}next(){const t=this.steps.indexOf(this.currentStep);t===this.steps.length-1?this.complete():this.show(t+1,!0)}removeStep(t){const e=this.getCurrentStep();this.steps.some((e,n)=>{if(e.id===t)return e.isOpen()&&e.hide(),e.destroy(),this.steps.splice(n,1),!0}),e&&e.id===t&&(this.currentStep=void 0,this.steps.length?this.show(0):this.cancel())}show(t,e){void 0===t&&(t=0),void 0===e&&(e=!0);const n=g(t)?this.getById(t):this.steps[t];if(n){this._updateStateBeforeShow();d(n.options.showOn)&&!n.options.showOn()?this._skipStep(n,e):(this.trigger("show",{step:n,previous:this.currentStep}),this.currentStep=n,n.show())}}start(){this.trigger("start"),this.focusedElBeforeOpen=document.activeElement,this.currentStep=null,this._setupModal(),this._setupActiveTour(),this.next()}_done(t){const e=this.steps.indexOf(this.currentStep);if(Array.isArray(this.steps)&&this.steps.forEach(t=>t.destroy()),function(t){if(t){const{steps:e}=t;e.forEach(t=>{t.options&&!1===t.options.canClickTarget&&t.options.attachTo&&t.target instanceof HTMLElement&&t.target.classList.remove("shepherd-target-click-disabled")})}}(this),this.trigger(t,{index:e}),un.activeTour=null,this.trigger("inactive",{tour:this}),this.modal&&this.modal.hide(),("cancel"===t||"complete"===t)&&this.modal){const t=document.querySelector(".shepherd-modal-overlay-container");t&&t.remove()}p(this.focusedElBeforeOpen)&&this.focusedElBeforeOpen.focus()}_setupActiveTour(){this.trigger("active",{tour:this}),un.activeTour=this}_setupModal(){this.modal=new an({target:this.options.modalContainer||document.body,props:{classPrefix:this.classPrefix,styles:this.styles}})}_skipStep(t,e){const n=this.steps.indexOf(t);if(n===this.steps.length-1)this.complete();else{const t=e?n+1:n-1;this.show(t,e)}}_updateStateBeforeShow(){this.currentStep&&this.currentStep.hide(),this.isActive()||this._setupActiveTour()}_setTourID(){const t=this.options.tourName||"tour";this.id=`${t}--${$t()}`}},Step:rn});const cn="shepherd.guide_id",ln="shepherd.guide.current.step.id",hn="shepherd.guide.step.history",fn="shepherd.guide.pause";function pn(t,e,n,i,s,o,a){this.guideCancelSubscription=void 0,this.onPause=()=>{},this.onCancel=()=>{},this.startGuide=(t,e,r,i=!0)=>{if(i&&n.remove(hn),!e)return;const s=this._createGuide(t);this._addGuideSteps(s,e),this._startGuide(s,r)},this.resumeGuide=(t,e,r)=>{n.set(fn,!1),this.startGuide(t,e,r,!1)},this.isActive=()=>un.activeTour&&un.activeTour.isActive()&&un.activeTour.getCurrentStep().isOpen()&&!this.isPaused(),this.isPaused=()=>"true"===n.get(fn),this.getGuideId=()=>n.get(cn),this.getCurrentStepId=()=>n.get(ln),this.subscribeToGuideCancel=t=>{angular.isFunction(t)&&(this.onCancel=t)},this.subscribeToGuidePause=t=>{angular.isFunction(t)&&(this.onPause=t)},this._createGuide=t=>(this._subscribeToGuideCanceled(),new un.Tour({name:t,useModalOverlay:!0,confirmCancel:!0,confirmCancelMessage:e.instant("guide.confirm.cancel.message"),defaultStepOptions:{classes:"shadow-md bg-purple-dark",scrollTo:!0}})),this._addGuideSteps=(t,e)=>{if(e.length>0&&t.addStep(this._getFirstStep(t,e)),e.length>2)for(let n=1;n<e.length-1;n++)t.addStep(this._getMiddleStep(t,e,n));e.length>1&&t.addStep(this._getLastStep(t,e))},this._startGuide=(s,a)=>{n.remove(fn);let u=s.steps.findIndex(t=>t.options.id===a);u<0&&(u=0);const c=s.steps[u],l=c.options.url;l&&(t.url(l),i.reload()),c.options.attachTo?r.GuideUtils.waitFor(c.options.attachTo.element,c.options.maxWaitTime).then(()=>s.show(u)).catch(()=>{o.error(e.instant("guide.start.unexpected.error.message"))}):s.show(u)},this._subscribeToGuideCanceled=()=>{this.guideCancelSubscription||(this.guideCancelSubscription=un.on("cancel",()=>{this._clearLocaleStorage(),this.onCancel&&this.onCancel()}))},this._getFirstStep=function(t,e){const n=e.length>1?e[1]:void 0;return this._toGuideStep(t,void 0,e[0],n)},this._getMiddleStep=(t,e,n)=>this._toGuideStep(t,e[n-1],e[n],e[n+1]),this._getLastStep=(t,e)=>{const n=this._toGuideStep(t,e[e.length-2],e[e.length-1]);return n.buttons.push(this._getBackToGuidesButton(t)),n.buttons.push(this._getCancelButton(t)),n},this._getBackToGuidesButton=t=>this._getButton(e.instant("back.to.guides.btn"),()=>this._backToGuidesButton(t),!0),this._getCancelButton=t=>this._getButton(e.instant("common.close"),()=>this._cancelGuide(t,!1),!0),this._backToGuidesButton=e=>{t.path("guides"),this._cancelGuide(e,!1)},this._cancelGuide=(t,e=!0)=>{t.options.confirmCancel=e,t.cancel(),this.onCancel()&&this.onCancel()},this._toGuideStep=(t,n,r,i)=>{const s=this._toBaseGuideStep(t,e,r,()=>this._updateLocalStorage()),o=[];return n&&o.push(this._getPreviousButton(t)),i&&(o.push(this._getNextButton(t,r,i)),o.push(this._getPauseButton(t))),r.skipPoint&&o.push(this._getSkipButton(t,n,r,i)),s.buttons=o,s},this._getPauseButton=t=>this._getButton(e.instant("pause.btn"),()=>this._pauseGuide(t),!0),this._getSkipButton=(t,n,r,i)=>this._getButton(e.instant("skip.btn"),()=>this._skipSteps(t),!0),this._skipSteps=t=>{const e=t.getCurrentStep(),n=t.steps.findIndex(t=>e.id===t.id);this._startGuide(t,this._getNextSkipPointId(t.steps,n))},this._getNextSkipPointId=(t,e)=>{for(let n=e+1;n<t.length;n++){const e=t.at(n);if(e.options.skipPoint)return e.id}return t.at(t.length-1).id},this._pauseGuide=t=>{t.hide();let e=this._getStepWhichCanBePaused(t.steps,t.getCurrentStep().id);this._saveStep(e),n.set(fn,!0);let r=!1;for(;!r;){const t=this._getHistory();t&&t.length>0&&t.at(t.length-1)!==e.options.id?this._removeLastStepFromHistory():r=!0}this.onPause()&&this.onPause()},this._getStepWhichCanBePaused=(t,e)=>{const n=t.findIndex(t=>t.id===e),r=t[n];return r.options.canBePaused?r:n>0?this._getStepWhichCanBePaused(t,t[n-1].id):void 0},this._getPreviousButton=(t,n,r)=>{const i=e.instant("previous.btn"),s=this._getPreviousButtonAction(t);return this._getButton(i,s)},this._getPreviousButtonAction=n=>()=>{const r=this._getPreviousStepIdFromHistory();let i;i=-1===r?n.steps.at(0):n.steps.find(t=>t.options.id===r);const s=n.getCurrentStep();angular.isFunction(s.options.onPreviousClick)?s.options.onPreviousClick(n).then(t=>{!angular.isUndefined(t)&&null!==t&&t||(s.hide(),n.show(i.id))}).catch(()=>{o.error(e.instant("guide.unexpected.error.message")),n.hide()}):((i.options.forceReload||i.options.url&&i.options.url!==s.options.url)&&t.path(i.options.url),s.hide(),n.show(i.id))},this._getNextButton=(t,n,r)=>{const i=e.instant("next.btn"),s=u(t,n,r);return this._getButton(i,s)};const u=(n,r,i)=>()=>{let s=!0;if(angular.isFunction(r.onNextValidate)&&(s=r.onNextValidate(r)),s)if(angular.isFunction(r.onNextClick)){const t=r.onNextClick(n,r);t instanceof Promise&&t.catch(t=>{o.error(e.instant("guide.unexpected.error.message")),n.cancel()})}else(i.forceReload||i.url&&i.url!==r.url)&&t.path(i.url),n.next()};this._updateLocalStorage=()=>{const t=un.activeTour;if(!t)return;const e=t.getCurrentStep(),n=t.steps.findIndex(t=>t.id===e.id),r=this.getCurrentStepId(),i=t.steps.findIndex(t=>t.id===r);n>i?this._addStepToHistory(e):i>n&&this._removeLastStepFromHistory(),this._saveStep(e)},this._saveStep=t=>{t&&(n.set(cn,t.tour.options.name),n.set(ln,t.options.id))},this._addStepToHistory=t=>{const e=this._getHistory();e.push(t.options.id),n.set(hn,e)},this._getHistory=()=>{const t=n.get(hn);return t||[]},this._removeLastStepFromHistory=()=>{const t=this._getHistory();t.splice(t.length-1,1),n.set(hn,t)},this._getPreviousStepIdFromHistory=()=>{const t=this._getHistory();return t.length>1?t.at(t.length-2):-1},this._clearLocaleStorage=()=>{n.remove(cn),n.remove(fn),n.remove(ln),n.remove(hn)},this._toBaseGuideStep=(t,e,n,i)=>{let o;n.elementSelector&&(o={element:n.elementSelector,on:n.placement});const a=r.GuideUtils.unescapeHtml(r.GuideUtils.translateLocalMessage(e,s,n.title,n));let u="";if(n.stepsTotalN>1){const t=document.createElement("span");t.setAttribute("tooltip",e.instant("guide.block.progress.tooltip",{action:a})),t.setAttribute("tooltip-placement","bottom"),t.setAttribute("tooltip-trigger","mouseenter"),t.setAttribute("tooltip-append-to-body","false"),t.innerText=e.instant("guide.block.progress",{n:n.stepN+1,nn:n.stepsTotalN}),u=" — "+t.outerHTML}const c=this._toParagraph(r.GuideUtils.translateLocalMessage(e,s,n.content,n));let l="";n.extraContent&&(l=r.GuideUtils.translateLocalMessage(e,s,n.extraContent,n),l=this._toParagraph(l,n.extraContentClass));const h="readonly"!==n.type,f=n.extraPadding?n.extraPadding:0,p={id:n.id,title:a+u,text:c+l,url:n.url,maxWaitTime:n.maxWaitTime,cancelIcon:{enabled:!0},attachTo:o,modalOverlayOpeningPadding:f,modalOverlayOpeningRadius:0,canBePaused:n.canBePaused,advanceOn:n.advanceOn,showOn:n.showOn,scrollToHandler:n.scrollToHandler,classes:"guide-dialog",beforeShowPromise:n.beforeShowPromise,canClickTarget:h,keyboardNavigation:!1,skipPoint:n.skipPoint,onPreviousClick:n.onPreviousClick,when:{show:this._getShowFunction(t,n,i)}};return angular.isFunction(n.hide)&&(p.when.hide=n.hide(t)),p},this._getShowFunction=(t,e,n)=>angular.isFunction(e.show)?()=>{e.show(t)(),n(),this._whenStepShow(e)}:()=>{n(),this._whenStepShow(e)},this._whenStepShow=t=>{const e=un.activeTour.getCurrentStep(),n=e.getElement();this._addTotalProgress(e,n),this._addTypeIcon(n,t);const r=angular.element(n).scope();angular.isFunction(t.onScope)&&t.onScope(r),setTimeout(()=>r.$apply(()=>a(n)(r)))},this._toParagraph=(t,e)=>{if(t){const n=document.createElement("p");return e&&(n.className=e),n.innerHTML=t,n.outerHTML}return""},this._addTotalProgress=(t,n)=>{const r=un.activeTour.steps,i=n.querySelector(".shepherd-content"),s=document.createElement("div");s.className="shepherd-progress";const o=document.createElement("span");o.className="text-muted",o.innerText=e.instant("guide.total.progress",{n:r.indexOf(t)+1,nn:r.length}),o.setAttribute("tooltip",e.instant("guide.total.progress.tooltip")),o.setAttribute("tooltip-placement","left"),o.setAttribute("tooltip-trigger","mouseenter"),o.setAttribute("tooltip-append-to-body","false"),s.appendChild(o),i.appendChild(s)},this._addTypeIcon=(t,n)=>{let r,i;switch(n.type){case"clickable":r="focus",i="mouse";break;case"input":r="edit",i="input";break;default:r="info",i="info"}const s=document.createElement("span");s.className="shepherd-step-type icon-"+r+" icon-1-25x",s.setAttribute("tooltip",e.instant("guide.step-type."+i)),s.setAttribute("tooltip-placement","bottom-right"),s.setAttribute("tooltip-trigger","mouseenter"),s.setAttribute("tooltip-append-to-body","false"),angular.element(t.querySelector(".shepherd-header")).prepend(s)},this._getButton=(t,e,n)=>{const r={text:t,classes:n?"btn btn-secondary":"btn btn-primary",action:t=>{t.stopPropagation(),e()}};return r}}angular.module("graphdb.framework.guides.shepherd.services",["graphdb.framework.utils.localstorageadapter"]).service("ShepherdService",pn),pn.$inject=["$location","$translate","LocalStorageAdapter","$route","$interpolate","toastr","$compile"]},function(t,e){angular.module("graphdb.framework.rest.license.service",["ngFileUpload"]).factory("LicenseRestService",r),r.$inject=["$http","Upload"];const n="rest/graphdb-settings/license";function r(t,e){return{getLicenseInfo:function(){return t.get(n)},getHardcodedLicense:function(){return t.get(n+"/hardcoded")},sendLicenseToValidate:function(e){return t.post("rest/info/license/validate",e,{headers:{Accept:"application/json","Content-Type":"text/plain"}})},extractFromLicenseFile:function(t){return e.upload({url:"rest/info/license/to-base-64",file:t,headers:{Accept:"text/plain"}})},checkLicenseHardcoded:function(){return t.get(n+"/hardcoded")},registerLicense:function(e){const r=new Uint8Array(e.length);for(let t=0;t<r.length;t++)r[t]=e.charCodeAt(t);return t({method:"POST",url:n,headers:{"Content-Type":"application/octet-stream"},data:r,transformRequest:[]})},unregisterLicense:function(){return t({method:"DELETE",url:"rest/graphdb-settings/license"})},getInfo:function(){return t.get("rest/info/properties")},getVersion:function(e){return t.get("rest/info/version",{headers:{"X-GraphDB-Repository-Location":e}})},getStatistics:function(){return t.get("rest/graphdb-settings/statistics")},toggleStatistics:function(e){return t({method:"POST",url:"rest/graphdb-settings/statistics",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:"enabled="+e})}}}},function(t,e){angular.module("graphdb.framework.rest.repositories.service",[]).factory("RepositoriesRestService",n),n.$inject=["$http"];function n(t){return{getRepositories:function(e){return t.get("rest/repositories/all",{params:{location:e}})},getRepository:function(e){return t.get("rest/repositories/"+e.id,{params:{location:e.location}})},deleteRepository:function(e){return t.delete("rest/repositories/"+e.id,{params:{location:e.location}})},createRepository:function(e){return t.post("rest/repositories",e)},editRepository:function(e,n){return t.put("rest/repositories/"+e,n)},getRepositoryConfiguration:function(e){return t.get("rest/repositories/default-config/"+e)},getSize:function(e){return t.get(`rest/repositories/${e.id}/size`,{params:{location:e.location}})},getPrefix:function(e,n){return t.post(`rest/repositories/${e}/prefix`,null,{params:n})},getCluster:function(){return t.get("rest/repositories/cluster")},getRepositoryFileContent:function(e){return t.get("rest/repositories/file",{params:{fileLocation:e}})},updateRepositoryFileContent:function(e,n,r){return t.post("rest/repositories/file/update",JSON.stringify(n),{params:{fileLocation:e,location:r}})},validateOntopPropertiesConnection:function(e){return t.post("rest/repositories/ontop/test-connection",e.params.propertiesFile,{params:{location:e.location}})},restartRepository:function(e){return t.post(`rest/repositories/${e.id}/restart`,null,{params:{location:e.location}})},getSupportedDriversData:function(e){return t.get("rest/repositories/ontop/drivers",{params:{location:e.location}})},updatePropertiesFile:function(e,n,r){return t.post("rest/repositories/ontop/jdbc-properties",JSON.stringify(n),{params:{fileLocation:e,location:r}})},loadPropertiesFile:function(e,n){return t.get("rest/repositories/ontop/jdbc-properties",{params:{fileLocation:e,location:n}})},getRepositoriesFromKnownLocation:function(e){return t.get("rest/repositories?location="+e)}}}},function(t,e,n){"use strict";n.r(e);n(4),n(9),n(27),n(8),n(34),n(35);angular.module("graphdb.framework.core.services.repositories",["ngCookies","graphdb.framework.rest.repositories.service","graphdb.framework.rest.locations.service","graphdb.framework.rest.license.service","toastr"]).service("$repositories",["$http","toastr","$rootScope","$timeout","$location","productInfo","$jwtAuth","RepositoriesRestService","LocationsRestService","LicenseRestService","$translate","$q",function(t,e,n,r,i,s,o,a,u,c,l,h){this.repositoryStorageName="com.ontotext.graphdb.repository",this.repositoryStorageLocationName="com.ontotext.graphdb.repository.location",this.location={uri:"",label:"Local",local:!0},this.locationError="",this.loading=!0,this.repository={id:localStorage.getItem(this.repositoryStorageName)||"",location:localStorage.getItem(this.repositoryStorageLocationName)||""},this.locations=[this.location],this.repositories=new Map,this.locationsShouldReload=!0;const f=this,p=function(t,n){f.loading=!1,t&&(f.location={},f.locationError=n,f.repositories=new Map,f.setRepository(""),t.statusText?e.error(t.statusText,l.instant("repositories.service.error.loading.location")):e.error(l.instant("repositories.service.error.loading.location")))};let d;this.resetActiveRepository=function(){let t=f.repositories.get(this.repository.location),e=!1;t&&(e=t.find(t=>this.repository&&t.id===this.repository.id)),e?o.canReadRepo(this.repository)?n.$broadcast("repositoryIsSet",{newRepo:!1}):this.setRepository(""):this.setRepository(this.location.defaultRepository?{id:this.location.defaultRepository,location:this.location.uri}:"")},this.checkLocationsDegraded=function(t){this.locations.forEach(e=>{e.local||(e.errorMsg&&f.repositories.delete(e.uri)&&f.resetActiveRepository(),c.getVersion(e.uri).success((function(t){"object"==typeof t?t.productVersion!==s.productVersion&&(e.degradedReason=l.instant("repositories.service.different.gdb.version",{location:e.name})):e.degradedReason=l.instant("repositories.service.different.gdb.version",{location:e.name})})).error((function(n){e.errorMsg=n,t||(f.locationsShouldReload=!0)})))})},this.getDegradedReason=function(){let t=this.locations.find(t=>t.uri===this.repository.location);return t?t.degradedReason:""},this.clearLocationErrorMsg=function(t){let e=this.locations.find(e=>e.uri===t);e&&e.errorMsg&&(e.errorMsg=null)},this.initQuick=function(){this.hasActiveLocation()&&this.init(null,null,!0)},this.init=function(t,e,r){return this.loading=!0,r||(this.locationsShouldReload=!0),u.getActiveLocation().then((function(i){if(i.data){const s=i.data;if(s.active)return a.getRepositories().then((function(e){f.location=s,Object.entries(e.data).forEach(([t,e])=>{f.clearLocationErrorMsg(t),f.repositories.set(t,e)}),f.resetActiveRepository(),p(),f.checkLocationsDegraded(r),n.globalLocation=f.location,n.globalRepositories=f.getRepositories(),t&&t()})).catch((function(t){p(t),e&&e()}))}else p(),r&&(f.locationsShouldReload=!0),f.location="",f.repositories=new Map,f.setRepository("");n.globalLocation=f.location,n.globalRepositories=f.getRepositories()})).catch((function(t){p(t),e&&e()}))},this.getLocations=function(t){if(this.locationsShouldReload||d)return d||(this.locationsShouldReload=!1,this.locations=[this.location],d=u.getLocations(t).then(t=>(f.locations=t.data,this.locations)).catch((function(){r((function(){f.locationsShouldReload=!0}),2e3)})).finally(()=>{d=null})),d;const e=h.defer();return e.resolve(this.locations),e.promise},this.getActiveLocation=function(){return this.location},this.hasActiveLocation=function(){return!_.isEmpty(this.location)},this.getLocationError=function(){return this.locationError?this.locationError:l.instant("repositories.service.no.active.location")},this.isLoadingLocation=function(){return this.loading},this.getRepositories=function(){let t=[];return this.repositories.forEach(e=>t.push.apply(t,e)),t},this.getReadableRepositories=function(){return _.filter(this.getRepositories(),(function(t){return o.canReadRepo(t)}))},this.getWritableRepositories=function(){const t=this;return _.filter(this.getRepositories(),(function(e){return o.canWriteRepo(e)&&!t.isActiveRepoOntopType(e)}))},this.getActiveRepository=function(){return this.repository.id},this.getActiveRepositoryObject=function(){const t=this;let e=t.repositories.get(t.repository.location);return e?e.find(e=>e.id===t.repository.id):null},this.isSystemRepository=function(){return"SYSTEM"===this.repository.id},this.isActiveRepoOntopType=function(t){const e=this;let n;return t||(t=e.getActiveRepositoryObject()),t&&(n=e.repositories.get(t.location).find(e=>e.id===t.id),n)?"graphdb:OntopRepository"===n.sesameType:void 0===n},this.isActiveRepoFedXType=function(){const t=this;let e,n=t.getActiveRepositoryObject();return n&&(e=t.repositories.get(n.location).find(t=>t.id===n.id),e)?"graphdb:FedXRepository"===e.sesameType:void 0===e},this.getLocationFromUri=function(t){return this.locations.find(e=>e.uri===t)},this.setRepositoryHeaders=function(){t.defaults.headers.common["X-GraphDB-Repository"]=this.repository?this.repository.id:void 0,$.ajaxSetup().headers=$.ajaxSetup().headers||{},$.ajaxSetup().headers["X-GraphDB-Repository"]=this.repository?this.repository.id:void 0,t.defaults.headers.common["X-GraphDB-Repository-Location"]=this.repository?this.repository.location:void 0,$.ajaxSetup().headers=$.ajaxSetup().headers||{},$.ajaxSetup().headers["X-GraphDB-Repository-Location"]=this.repository?this.repository.location:void 0},f.setRepositoryHeaders(),this.setRepository=function(t){this.repository=t,t?(localStorage.setItem(f.repositoryStorageName,this.repository.id),localStorage.setItem(f.repositoryStorageLocationName,this.repository.location)):(localStorage.removeItem(f.repositoryStorageName),localStorage.removeItem(f.repositoryStorageLocationName)),f.setRepositoryHeaders(),n.$broadcast("repositoryIsSet",{newRepo:!0}),t&&!o.canReadRepo(t)&&this.setRepository(""),n.deniedPermissions={}},this.getDefaultRepository=function(){return this.hasActiveLocation()?this.location.defaultRepository:""},this.setDefaultRepository=function(t){if(!this.hasActiveLocation())return void e.error(l.instant("repositories.service.no.active.location"),l.instant("common.error"));const n=this;u.setDefaultRepository(t).success((function(){n.location.defaultRepository=t})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))}))},this.deleteLocation=function(t){return u.deleteLocation(encodeURIComponent(t)).success((function(){let e=f.getActiveRepositoryObject();e&&e.location===t&&(f.location="",f.setRepository("")),f.init()})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))}))},this.deleteRepository=function(t){return a.deleteRepository(t).success((function(){f.init()})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))})).finally(()=>{const e=f.getActiveRepositoryObject();e&&e.id===t.id&&e.location===t.location&&f.setRepository("")})},this.restartRepository=function(t){return a.restartRepository(t).success((function(){e.success(l.instant("repositories.service.restarting.repo",{repositoryId:t.id})),f.initQuick()})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))}))},this.getRepositoryTurtleConfig=function(e){return t.get("rest/repositories/"+e.id,{headers:{Accept:"text/turtle"}})},this.isRepoActive=function(t){return!!this.repository&&(t.id===this.repository.id&&t.location===this.repository.location)},this.getRepositoriesFromLocation=function(t){return this.repositories.get(t)},n.$on("securityInit",(function(t,e,n,r){(!e||n||r)&&f.init()}))}])},function(t,e,n){"use strict";n.r(e);n(5);var r=n(0);function i(){return{template:function(t,e){return'<object width="'+e.size+'" height="'+e.size+'" data="js/angular/templates/loader/ot-loader.svg?v=2.1.0-RC2">{{\'common.loading\' | translate}}</object>'}}}function s(){return{template:function(t,e){return'<object width="'+e.size+'" height="'+e.size+'" data="js/angular/templates/loader/ot-loader.svg?v=2.1.0-RC2"></object><div>{{\'common.loading\' | translate}}<div>'}}}function o(t){const e=function(t,n){n.timer=void 0,n.currentMessage=n.getMessage();const r=n.timeout[n.index%n.timeout.length];r&&(n.timer=t((function(){(n.index+1<n.message.length||0===n.message.length)&&(n.index++,e(t,n))}),1e3*r))};return{restrict:"EA",scope:{size:"@",trigger:"@",messageAttr:"=*message",timeoutAttr:"=*timeout",ngShow:"=",ngHide:"="},link:function(n){n.message=n.messageAttr,n.getMessage=function(){return n.message[n.index]},void 0===n.message?n.message=[""]:"function"==typeof n.message?(n.getMessage=n.message,n.message=[]):"object"!=typeof n.message&&(n.message=[n.message]),n.timeout=n.timeoutAttr,void 0===n.timeout?n.timeout=[0]:"object"!=typeof n.timeout&&(n.timeout=[n.timeout]),n.index=0,e(t,n);const r=function(r){n.timer&&t.cancel(n.timer),r&&(n.index=0,e(t,n))};n.$watch("ngShow",(function(t){r(t)})),n.$watch("ngHide",(function(t){r(!t)})),n.$on("$destroy",(function(){n.timer&&t.cancel(n.timer)}))},template:'<div class="ot-loader-new-content"><img width="{{size}}" height="{{size}}" src="js/angular/templates/loader/ot-loader.svg?v=2.1.0-RC2"/><div style="font-size: {{size/4}}px">{{currentMessage}}<div></div>'}}function a(t){return{restrict:"EA",transclude:!0,templateUrl:"js/angular/core/templates/core-errors.html",link:function(e,n,r){let i;e.setAttrs(r),e.setRestricted(),e.showRemoteLocations=!1,e.toggleShowRemoteLocations=()=>{e.showRemoteLocations=!e.showRemoteLocations},e.getAccessibleRepositories=function(){let t=t=>!0;return e.showRemoteLocations||(t=t=>t.local),e.isRestricted?e.getWritableRepositories().filter(t):e.getReadableRepositories().filter(t)},e.showPopoverForRepo=function(n,r){e.hidePopoverForRepo(),e.setPopoverRepo(r),t((function(){const t=$(n.toElement).find(".popover-anchor")[0];i=t,t&&!e.getActiveRepository()&&t.dispatchEvent(new Event("show"))})),n.stopPropagation()},e.hidePopoverForRepo=function(e){if(e){let t=e.relatedTarget;for(;t;){if(0===t.className.indexOf("popover"))return;t=t.parentElement}}i&&t((function(){i&&(i.dispatchEvent(new Event("hide")),i=null)})),e&&e.stopPropagation()}}}}function u(){return function(t,e){$(e).click((function(t){t.preventDefault(),t.stopPropagation()}))}}function c(){return{restrict:"A",require:"ngModel",link:function(t,e,n,r){t.multiRequired||(t.multiRequired=[]);const i=n.multiRequireElement,s=function(e){i&&i%1==0&&(t.multiRequired[i-1]=e)},o=function(){let e=!1,n=!1;for(let r=0;r<t.multiRequired.length;r++)t.multiRequired[r]?e=!0:n=!0;r.$setValidity("multiRequire",!(e&&n))};r.$parsers.unshift((function(t){return s(t),o(),t})),r.$formatters.unshift((function(t){return s(t),o(),t})),$("[multi-required]").on("blur keyup change focusout",(function(){o()}))}}}angular.module("graphdb.framework.core.directives",["graphdb.framework.core.services.repositories","graphdb.framework.utils.localstorageadapter"]).directive("ontoLoader",i).directive("ontoLoaderFancy",s).directive("ontoLoaderNew",o).directive("coreErrors",a).directive("eatClick",u).directive("multiRequired",c).directive("searchResourceInput",h).directive("keyboardShortcuts",f).directive("inactivePluginDirective",p),i.$inject=[],s.$inject=[],o.$inject=["$timeout"],a.$inject=["$timeout"],u.$inject=[],c.$inject=[];const l={table:"table",visual:"visual"};function h(t,e,n,i,s,o,a,u,c,h,f,p){return{restrict:"EA",scope:{namespacespromise:"=",autocompletepromisestatus:"=",textButton:"@",visualButton:"@",textCallback:"&",visualCallback:"&",placeholder:"@",uriValidation:"@",preserveInput:"@",empty:"=",clear:"=?clear",openInNewTab:"@",preserveSearch:"@",radioButtons:"@",clearInputIcon:"@"},templateUrl:"js/angular/core/templates/search-resource-input.html",link:function(d,g,m){g.autoCompleteStatus=void 0,g.autoCompleteWarning=!1,d.empty=!1,d.clear=!1,d.searchDisplayType=l;const v="true"===d.preserveSearch,y=g.find(".view-res-input");let b,w;d.textButtonLabel=d.textButton||"query.editor.table.btn",d.visualButtonLabel=d.visualButton||"query.editor.visual.btn",d.showClearInputIcon=!1,d.searchType=u.get(c.RDF_SEARCH_TYPE)||l.table,d.searchInput="",d.changeSearchType=function(t){d.searchType=t,u.set(c.RDF_SEARCH_TYPE,d.searchType)},d.$on("addStartFixedNodeAutomatically",(function(t,e){d.searchInput||!e.startIRI?d.checkIfValidAndSearchText():d.visualCallback({uri:e.startIRI,label:""})})),d.clearInput=function(){d.searchInput="",d.selectedElementIndex=-1,d.autoCompleteUriResults=[],d.showClearInputIcon=!1,u.remove(c.RDF_SEARCH_INPUT),u.remove(c.RDF_SEARCH_EXPANDED_URI),u.remove(c.RDF_RESOURCE_DESCRIPTION)},d.$watch("namespacespromise",(function(){angular.isDefined(d.namespacespromise)&&d.namespacespromise.success((function(t){g.namespaces=t.results.bindings.map((function(t){return{prefix:t.prefix.value,uri:t.namespace.value}}))})).error((function(t){const n=getError(t);e.error(n,f.instant("error.getting.namespaces.for.repo"))}))})),d.$watch("autocompletepromisestatus",(function(){!h.isActiveRepoFedXType()&&angular.isDefined(d.autocompletepromisestatus)&&d.autocompletepromisestatus.success((function(t){g.autoCompleteStatus=!!t,""!==d.searchInput&&d.onChange()})).error((function(){e.error(f.instant("explore.error.autocomplete"))}))})),d.$watch("empty",(function(){v||(d.searchInput="",d.empty=!1)})),d.$watch("clear",(function(){d.clear&&(d.clearInput(),d.clear=!1)})),s.$on("$translateChangeSuccess",(function(){m.$attr.placeholder?d.placeholder=m.$attr.placeholder:d.placeholder=f.instant("search.resources.msg")+"..."}));const x=function(e){const n=e.type||"uri";"true"===d.openInNewTab?E(!1,e):t.path("resource").search(n,e.uri)},S=function(e){const n=e.type||"uri";"true"===d.openInNewTab?E(!0,e):t.path("graphs-visualizations").search(n,e.uri)},E=function(t,e){const n=t?"graphs-visualizations":"resource";window.open(`${n}?uri=${encodeURIComponent(e.uri)}`)};angular.isUndefined(m.$attr.textCallback)&&(d.textCallback=x),angular.isUndefined(m.$attr.visualCallback)&&(d.visualCallback=S),m.$attr.textButton&&!d.textButton?d.textCallback=d.visualCallback:m.$attr.visualButton&&!d.visualButton&&(d.visualCallback=d.textCallback),m.$attr.placeholder?d.placeholder=m.$attr.placeholder:d.placeholder=f.instant("search.resources.msg")+"...",angular.isDefined(m.$attr.uriValidation)?d.uriValidation=m.$attr.uriValidation:d.uriValidation="true",angular.isDefined(m.$attr.preserveInput)&&(d.preserveInput=m.$attr.preserveInput),d.getResultItemHtml=function(t){return a.trustAsHtml(t.description)},d.searchRdfResource=function(t,e){if("prefix"===t.type)d.searchInput=D(t.value+":"),y.focus(),d.onChange();else{let n;n=angular.isUndefined(t)?d.searchInput:"object"==typeof t?t.value:t;let r="";if(t.description){const e=t.description.indexOf("<"+n+">");e>0&&(r=t.description.substring(0,e).replace(/<\/?b>/g,""))}e({uri:n,description:t.description,label:r,type:t.type}),v?(d.selectedElementIndex=d.activeSearchElm,u.set(c.RDF_SEARCH_EXPANDED_URI,b),u.set(c.RDF_SEARCH_INPUT,d.searchInput),u.set(c.RDF_RESOURCE_DESCRIPTION,t.description)):"true"===d.preserveInput?(d.searchInput=n,d.autoCompleteUriResults=[]):(d.searchInput="",d.autoCompleteUriResults=[])}},d.searchRdfResourceByEvent=function(t,e){d.searchType===l.visual||e.ctrlKey||e.metaKey?d.searchRdfResource(t,d.visualCallback):d.searchRdfResource(t,d.textCallback)};const F=function(t){const n=d.searchInput;""!==n?"false"!==d.uriValidation?g.autoCompleteStatus&&d.autoCompleteUriResults&&d.autoCompleteUriResults.length>0?"prefix"===d.autoCompleteUriResults[d.activeSearchElm].type?(d.searchInput=D(d.autoCompleteUriResults[d.activeSearchElm].value+":"),d.autoCompleteUriResults=[]):d.searchRdfResource(d.autoCompleteUriResults[d.activeSearchElm],t):C(n)?d.searchRdfResource(n,t):e.error(f.instant("invalid.uri.msg")):d.searchRdfResource(n,t):e.error(f.instant("fill.input.field.msg"))};function A(){let t=-1;const n=u.get(c.RDF_RESOURCE_DESCRIPTION);n&&d.autoCompleteUriResults&&(t=d.autoCompleteUriResults.findIndex(t=>t.description===n),d.selectedElementIndex=t,new Promise(t=>{const e=document.getElementById("auto-complete-results-wrapper").getBoundingClientRect();setTimeout(()=>{t(e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth))})}).then((function(){!function(){const t=$("#auto-complete-results-wrapper"),e=$("#auto_"+d.selectedElementIndex);t.animate({scrollTop:e.offset().top-t.offset().top+t.scrollTop()})}()})).catch((function(t){e.error(getError(t),f.instant("no.prev.search.element"))}))),d.activeSearchElm=-1===t?0:t}function C(t){const e=t.indexOf("<")>=0&&t.indexOf(">")>=0,n=-1===t.indexOf("<")&&-1===t.lastIndexOf(">"),r=/^<?(http|urn).*>?/.test(t)&&(e||n);let i=!1;if(r)if(t.indexOf("http")>=0){const e=t.indexOf("//");i=e>4&&t.substring(e+2).length>0}else t.indexOf("urn")>=0&&(i=t.substring(4).length>0);return r&&i}function D(t){if(!/^<?(http|urn).*>?/.test(t)){const e=t.split(":"),r=e[0],i=e[1];if(!angular.isUndefined(i)){const t=n.getNamespaceUriForPrefix(g.namespaces,r);if(b=t!==b?t:b,b)return y.val(b),b+i}}return t}d.checkIfValidAndSearchText=function(){F(d.textCallback)},d.checkIfValidAndSearchVisual=function(){F(d.visualCallback)},d.checkIfValidAndSearchEvent=function(t){d.searchType===l.visual||t.ctrlKey||t.metaKey?F(d.visualCallback):F(d.textCallback)},d.onChange=function(){return d.showClearInputIcon=d.clearInputIcon,v&&u.set(c.RDF_SEARCH_INPUT,d.searchInput),"false"!==d.uriValidation&&(d.searchInput=D(d.searchInput),g.autoCompleteStatus)?function(t){let e=t.replace(b,b+";");if(g.autoCompleteStatus)return";"===e.charAt(0)&&(e=e.slice(1)),e=function(t){let e=t;if(-1===e.indexOf(";")&&C(e)){e=e.replace(/<|>/g,"");const t=/[^/^#]*$/.exec(e)[0];return e.split(t)[0]+";"+t}return e}(e),w&&w.resolve(),w=o.defer(),i.getAutocompleteSuggestions(e,w.promise).then((function(t){w=null,d.autoCompleteUriResults=t.data.suggestions,d.activeSearchElm=0}));return Promise.resolve()}(d.searchInput):Promise.resolve()},d.onKeyDown=function(t){if(13===t.keyCode){if(t.preventDefault(),p.isActive())return;"false"!==d.uriValidation?g.autoCompleteStatus?d.checkIfValidAndSearchEvent(t):C(t.target.value)?d.searchRdfResourceByEvent(t.target.value,t):e.error(f.instant("invalid.uri.msg")):d.searchRdfResourceByEvent(t.target.value,t)}else if(d.searchInput.length>0&&!g.autoCompleteWarning&&!g.autoCompleteStatus){g.autoCompleteWarning=!0;const t=Object(r.decodeHTML)(f.instant("explore.autocomplete.warning.msg"));e.warning("",`<div class="autocomplete-toast"><a href="autocomplete">${t}</a></div>`,{allowHtml:!0})}if(g.autoCompleteStatus&&!angular.isUndefined(d.autoCompleteUriResults)){if(40===t.keyCode&&d.activeSearchElm<d.autoCompleteUriResults.length-1&&(d.activeSearchElm++,d.searchInput=d.autoCompleteUriResults[d.activeSearchElm].value,function(){const t=$("#auto-complete-results-wrapper"),e=t.children("div"),n=t.children("div.active");void 0!==n[0]&&n[0].offsetTop-e.height()-6-t.scrollTop()>170&&t.scrollTop(n[0].offsetTop-e.height()-6-170)}()),38===t.keyCode&&d.activeSearchElm>0&&(t.preventDefault(),d.activeSearchElm--,d.searchInput=d.autoCompleteUriResults[d.activeSearchElm].value,function(){const t=$("#auto-complete-results-wrapper"),e=t.children("div"),n=t.children("div.active");void 0!==n[0]&&n[0].offsetTop-e.height()-40<=t.scrollTop()&&t.scrollTop(t.scrollTop()-34)}()),27===t.keyCode){if(v)return;d.searchInput="",d.autoCompleteUriResults=[]}d.searchInput||d.clearInput()}},d.$on("rdfResourceSearchExpanded",(function(){(v?(d.preserveInput="true",d.searchInput=u.get(c.RDF_SEARCH_INPUT)||"",b=u.get(c.RDF_SEARCH_EXPANDED_URI),d.onChange()):Promise.resolve()).then((function(){A()}))})),d.setActiveClassOnMouseMove=function(t){g.autoCompleteStatus&&(d.activeSearchElm=t)}}}}function f(t){return{restrict:"AE",link:function(e,n,r){function i(t){27===t.keyCode&&(e.toggleCheatSheet(),e.$apply())}e.getTemplateUrl=function(){return r.templateUrl},e.shortcutsVisible=!1,e.toggleCheatSheet=function(){e.shortcutsVisible=!e.shortcutsVisible,e.shortcutsVisible?t.on("keydown",i):t.off("keydown",i)}},template:'<ng-include src="getTemplateUrl()" />'}}function p(t,e,n,i,s,o){return{restrict:"E",transclude:!0,scope:{loadSaved:"&",setPluginActive:"&",pluginName:"@",humanReadablePluginName:"@"},templateUrl:"js/angular/core/templates/inactive-plugin-warning-page.html",link:function(a){function u(){if(s.isLicenseValid()&&i.getActiveRepository()&&!i.isActiveRepoOntopType()&&!i.isActiveRepoFedXType())return e.checkPluginIsActive(a.pluginName).done((function(t){a.pluginIsActive=t.indexOf("true")>0,a.setPluginActive({isPluginActive:a.pluginIsActive})})).fail((function(e){t.error(getError(e),o.instant("check.active.plugin.failure"))}))}a.pluginIsActive=!0,a.activatePlugin=function(){const i=Object(r.decodeHTML)(o.instant("activate.plugin.warning.msg",{humanReadablePluginName:a.humanReadablePluginName}));n.openSimpleModal({title:o.instant("activate.plugin.confirmation"),message:`<p>${i}</p>`,warning:!0}).result.then((function(){e.activatePlugin(a.pluginName).done((function(){a.pluginIsActive=!0,a.setPluginActive({isPluginActive:a.pluginIsActive}),a.loadSaved()})).fail((function(e){t.error(getError(e),o.instant("activate.plugin.failure"))}))}))};const c=a.$on("repositoryIsSet",(function(){u()}));window.addEventListener("beforeunload",(function t(){c(),window.removeEventListener("beforeunload",t)})),a.$on("checkIsActive",u),u()}}}h.$inject=["$location","toastr","ClassInstanceDetailsService","AutocompleteRestService","$rootScope","$q","$sce","LocalStorageAdapter","LSKeys","$repositories","$translate","GuidesService"],f.$inject=["$document"],p.$inject=["toastr","RDF4JRepositoriesRestService","ModalService","$repositories","$licenseService","$translate"]},function(t,e,n){"use strict";n.r(e);n(4),n(23),n(24);var r=n(2);angular.module("graphdb.framework.core.services.jwtauth",["toastr","graphdb.framework.rest.security.service","graphdb.framework.core.services.openIDService"]).service("$jwtAuth",["$http","toastr","$location","$rootScope","SecurityRestService","$openIDAuth","$translate","$q",function(t,e,n,i,s,o,a,u){const c=this;i.deniedPermissions={},i.setPermissionDenied=function(t){return!("/"===t||"/login"===t||!c.isAuthenticated())&&(i.deniedPermissions[t]=!0,!0)},i.hasPermission=function(){const t=n.path();return!i.deniedPermissions[t]},i.redirectToLogin=function(t,e){return c.authTokenIsType("Bearer")&&(t=!0),c.clearAuthenticationInternal(),0!==n.url().indexOf("/login")&&(i.returnToUrl=n.url()),n.path("/login"),e?n.search("noaccess"):t&&n.search("expired"),new Promise(t=>{setTimeout(()=>{t(!0)},100)})},i.hasExternalAuthUser=function(){return c.hasExternalAuthUser()},this.authStorageName="com.ontotext.graphdb.auth",this.securityEnabled=!0,this.freeAccess=!1,this.hasOverrideAuth=!1,this.externalAuthUser=!1,this.securityInitialized=!1;const l=this;this.clearStorage=function(){localStorage.removeItem(l.authStorageName)},this.getAuthenticatedUserFromBackend=function(t,e){s.getAuthenticatedUser().success((function(t,e,n){l.auth&&l.auth.startsWith("GDB")?(l.externalAuthUser=!1,l.principal=t,i.$broadcast("securityInit",l.securityEnabled,!0,l.freeAccess)):l.openIDEnabled&&l.auth&&l.auth.startsWith("Bearer")?l.authenticate(t,l.auth):(l.externalAuthUser=!0,l.authenticate(t,""))})).error((function(){t||!l.freeAccess?i.redirectToLogin(!1,e):(l.securityInitialized=!0,l.hasExplicitAuthentication()||l.clearAuthentication())}))},this.initSecurity=function(){this.securityInitialized=!1,this.auth=localStorage.getItem(this.authStorageName),s.getSecurityConfig().then((function(t){if(l.securityEnabled=t.data.enabled,l.externalAuth=t.data.hasExternalAuth,l.authImplementation=t.data.authImplementation,l.openIDEnabled=t.data.openIdEnabled,l.passwordLoginEnabled=t.data.passwordLoginEnabled,l.securityEnabled){const e=t.data.freeAccess;l.freeAccess=e.enabled,l.freeAccess&&(l.freeAccessPrincipal={authorities:e.authorities,appSettings:e.appSettings}),l.openIDEnabled?(l.openIDConfig=t.data.methodSettings.openid,l.gdbUrl=n.absUrl().replace(n.url().substr(1),""),o.initOpenId(l.openIDConfig,l.gdbUrl,(function(t){l.auth=o.authHeaderGraphDB(),c.setAuthHeaders(),console.log("oidc: set id/access token as GraphDB auth"),l.getAuthenticatedUserFromBackend(!0,t)}),(function(){console.log("oidc: not logged or login error"),l.authTokenIsType("Bearer")?setTimeout(()=>{i.redirectToLogin(!0)},0):l.getAuthenticatedUserFromBackend()}))):l.getAuthenticatedUserFromBackend()}else{l.clearStorage();const e=t.data.overrideAuth;if(l.hasOverrideAuth=e.enabled,!l.hasOverrideAuth)return s.getAdminUser().then((function(t){l.principal={username:"admin",appSettings:t.data.appSettings,authorities:t.data.grantedAuthorities},i.$broadcast("securityInit",l.securityEnabled,!0,l.hasOverrideAuth)}));l.principal={username:"overrideauth",authorities:e.authorities,appSettings:e.appSettings},i.$broadcast("securityInit",l.securityEnabled,!0,l.hasOverrideAuth)}}))},this.initSecurity(),this.reinitializeSecurity=function(){this.securityInitialized||this.initSecurity()},this.isSecurityEnabled=function(){return this.securityEnabled},this.hasExternalAuth=function(){return this.externalAuth},this.getAuthImplementation=function(){return this.authImplementation},this.isFreeAccessEnabled=function(){return this.freeAccess},this.isDefaultAuthEnabled=function(){return this.hasOverrideAuth&&this.principal&&"overrideauth"===this.principal.username},this.getAuthToken=function(){return this.auth},this.authTokenIsType=function(t){return this.auth&&this.auth.startsWith(t)},this.loginOpenID=function(){o.login(this.openIDConfig,this.gdbUrl)},this.toggleSecurity=function(t){t!==this.securityEnabled&&(this.securityEnabled=t,s.toggleSecurity(t).then((function(){e.success(a.instant("jwt.auth.security.status",{status:a.instant(t?"enabled.status":"disabled.status")})),l.clearStorage(),l.initSecurity()}),(function(t){e.error(t.data.error.message,a.instant("common.error"))})))},this.toggleFreeAccess=function(t,n,r,o){(t!==this.freeAccess||o)&&(this.freeAccess=t,this.freeAccessPrincipal=t?{authorities:n,appSettings:r}:void 0,s.setFreeAccess({enabled:t?"true":"false",authorities:n,appSettings:r}).then((function(){o?e.success(a.instant("jwt.auth.free.access.updated.msg")):e.success(a.instant("jwt.auth.free.access.status",{status:a.instant(t?"enabled.status":"disabled.status")}))}),(function(t){e.error(t.data.error.message,a.instant("common.error"))})),i.$broadcast("securityInit",this.securityEnabled,this.hasExplicitAuthentication(),this.freeAccess))},this.setAuthHeaders=function(){return new Promise(e=>{const n=this.auth?this.auth:void 0;t.defaults.headers.common.Authorization=n,t.defaults.headers.common["X-Requested-With"]="XMLHttpRequest",$.ajaxSetup().headers=$.ajaxSetup().headers||{},$.ajaxSetup().headers.Authorization=n,$.ajaxSetup().headers["X-Requested-With"]="XMLHttpRequest",setTimeout(()=>{e(!0)})})},this.setAuthHeaders(),this.authenticate=function(t,e){return new Promise(n=>{l.clearStorage(),e&&(this.auth=e,localStorage.setItem(l.authStorageName,this.auth),this.externalAuthUser=!1),this.principal=t,i.deniedPermissions={},this.securityInitialized=!0,l.setAuthHeaders().then(()=>{i.$broadcast("securityInit",this.securityEnabled,l.hasExplicitAuthentication(),this.freeAccess)}),setTimeout(()=>{n(!0)})})},this.authenticateOpenID=function(t){this.clearStorage(),t&&(this.auth=t,localStorage.setItem(this.authStorageName,this.auth),this.externalAuthUser=!1)},this.hasExternalAuthUser=function(){return this.externalAuthUser},this.hasExplicitAuthentication=function(){return null!=this.auth||this.externalAuthUser},this.getPrincipal=function(){if(this.principal)return Promise.resolve(this.principal);const t=u.defer();return i.$on("securityInit",()=>{t.resolve(this.principal)}),t.promise},this.clearAuthenticationInternal=function(){o.softLogout(),this.auth=null,this.principal=this.freeAccessPrincipal,this.clearStorage(),this.setAuthHeaders()},this.clearAuthentication=function(){this.clearAuthenticationInternal(),i.$broadcast("securityInit",this.securityEnabled,!1,this.freeAccess)},this.isAuthenticated=function(){return!this.securityEnabled||this.hasExplicitAuthentication()},this.hasPermission=function(){},this.hasRole=function(t){if(void 0!==t&&(this.securityEnabled||this.hasOverrideAuth)){"string"==typeof t&&(t=[t]);const e=!_.isEmpty(this.principal);return!!e&&("IS_AUTHENTICATED_FULLY"===t[0]?e:_.intersection(t,this.principal.authorities).length>0)}return!0},this.isAdmin=function(){return this.hasRole(r.UserRole.ROLE_ADMIN)},this.checkForWrite=function(t,e){return"WRITE_REPO"===t?this.canWriteRepo(e):this.hasRole(t)},this.hasAdminRole=function(){return this.isAdmin()||this.hasRole(r.UserRole.ROLE_REPO_MANAGER)},this.canWriteRepo=function(t){return!!t&&(!this.securityEnabled&&!this.hasOverrideAuth||!_.isEmpty(this.principal)&&(!!this.hasAdminRole()||this.checkRights(t,"WRITE")))},this.canReadRepo=function(t){return!!t&&(!this.securityEnabled||!_.isEmpty(this.principal)&&(!!this.hasAdminRole()||this.checkRights(t,"READ")))},this.checkRights=function(t,e){if(t)for(let n=0;n<this.principal.authorities.length;n++){const r=this.principal.authorities[n],i=r.split("_",2),s=r.slice(i[0].length+i[1].length+2),o=t.location?`${t.id}@${t.location}`:t.id;if(i[0]===e&&(o===s||"SYSTEM"!==t.id&&"*"===s))return!0}return!1}}])},function(t,e){let n;angular.module("graphdb.framework.utils.uriutils",[]).factory("UriUtils",(function(){return{isValidIri:function(t){return void 0!==t&&!!t.match(n)},validateRdfUri:function(t){const e=t.indexOf("<")>=0&&t.indexOf(">")>=0,n=-1===t.indexOf("<")&&-1===t.lastIndexOf(">"),r=/^<?(http|urn).*>?/.test(t)&&(e||n);let i=!1;if(r)if(t.indexOf("http")>=0){const e=t.indexOf("//");i=e>4&&t.substring(e+2).length>0}else t.indexOf("urn")>=0&&(i=t.substring(4).length>0);return r&&i},shortenIri:function(t){const e=document.createElement("a");e.href=t;let n=e.hostname;return function(t){const e=t.split(".");for(let t=0,n=0;t<e.length;t++)if(parseInt(e[t],10)>=0&&parseInt(e[t],10)<=255?n++:n=0,4===n)return!0;return!1}(e.hostname)||(n=e.hostname.split(".")[0]),n+":"+e.port}}}));try{n=new RegExp("^[a-z](?:[-a-z0-9\\+\\.])*:(?:\\/\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:])*@)?(?:\\[(?:(?:(?:[0-9a-f]{1,4}:){6}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|::(?:[0-9a-f]{1,4}:){5}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:[0-9a-f]{1,4}:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|v[0-9a-f]+[-a-z0-9\\._~!\\$&'\\(\\)\\*\\+,;=:]+)\\]|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}|(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=@])*)(?::[0-9]*)?(?:\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))*)*|\\/(?:(?:(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))+)(?:\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))*)*)?|(?:(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))+)(?:\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))*)*|(?!(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@])))(?:\\?(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@])|[\\u{E000}-\\u{F8FF}\\u{F0000}-\\u{FFFFD}\\u{100000}-\\u{10FFFD}\\/\\?])*)?(?:#(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@])|[\\/\\?])*)?$","ui")}catch(t){n=new RegExp("^[a-z](?:[-a-z0-9\\+\\.])*:","i")}},function(t,e){angular.module("graphdb.framework.rest.monitoring.service",[]).factory("MonitoringRestService",n),n.$inject=["$http"];function n(t){return{monitorResources:function(){return t.get("rest/monitor/resource")},monitorGC:function(){return t.post("rest/monitor/resource/gc")},monitorQuery:function(){return t.get("rest/monitor/query")},abortQueryByAlias:function(e){return t.delete("rest/monitor/query?queryAlias="+encodeURIComponent(e))},deleteQuery:function(e){return t.delete("rest/monitor/query?queryId="+encodeURIComponent(e))},getQueryCount:function(){return t({url:"rest/monitor/query/count",method:"GET",timeout:1e4})},checkAutocompleteStatus:function(){return t.get("rest/autocomplete/enabled")}}}},function(t,e){angular.module("graphdb.framework.rest.rdf4j.repositories.service",[]).factory("RDF4JRepositoriesRestService",r),r.$inject=["$http","$repositories","$translate"];const n="select ?o where {\n?s <http://www.ontotext.com/owlim/system#listplugins> ?o .\nfilter(str(?s) = '{{pluginName}}')\n} ";function r(t,e,r){return{getNamespaces:function(e){return t.get(`repositories/${e}/namespaces`)},getRepositoryNamespaces:function(){return t.get(`repositories/${e.getActiveRepository()}/namespaces`)},updateNamespacePrefix:function(e,n,r){return t({url:`repositories/${e}/namespaces/${r}`,method:"PUT",data:n})},deleteNamespacePrefix:function(e,n){return t({url:`repositories/${e}/namespaces/${n}`,method:"DELETE"})},addStatements:function(e,n){return t({url:`repositories/${e}/statements`,method:"POST",data:n,headers:{"Content-Type":"application/x-www-form-urlencoded"}})},activatePlugin:function(t){return $.ajax({method:"POST",url:`repositories/${e.getActiveRepository()}/statements`,data:{update:"INSERT DATA { <u:a> <http://www.ontotext.com/owlim/system#startplugin> '{{pluginName}}' .}".replace("{{pluginName}}",t)}})},checkPluginIsActive:function(t){return $.ajax({method:"GET",url:"repositories/"+e.getActiveRepository(),data:{query:n.replace("{{pluginName}}",t)}})},getRepositorySize:function(){return t.get(`repositories/${e.getActiveRepository()}/size`)},getGraphs:i,resolveGraphs:function(){const t=e.getActiveRepository();let n=[];if(t)return i(t).success((function(t){t.results.bindings.unshift({contextID:{type:"default",value:"import.default.graph"}}),Object.keys(t.results.bindings).forEach((function(e){const n=t.results.bindings[e];"bnode"===n.contextID.type?n.contextID.value="_:"+n.contextID.value:"default"===n.contextID.type?n.contextID.uri="http://www.openrdf.org/schema/sesame#nil":n.contextID.uri=n.contextID.value})),t.results.bindings.unshift(allGraphs),n=t.results.bindings}));return n}};function i(e){return t.get(`repositories/${e}/contexts`)}}},function(t,e){function n(t,e,n,r){t.title=n,t.message=r,t.ok=function(){e.close()},t.cancel=function(){e.dismiss("cancel")}}function r(t,e,n,r,i){t.clipboardURI=n,t.ok=function(){try{document.getElementById("clipboardURI").select(),document.execCommand("copy"),r.success(i.instant("modal.ctr.copy.url.success"))}catch(t){r.error(i.instant("modal.ctr.copy.not.supported.warning"))}e.close()},t.cancel=function(){e.dismiss("cancel")}}function i(t,e,n,r,i){t.query=n,t.cancel=function(){e.dismiss("cancel")},t.selectQuery=function(){t.selectElement($("#create-query"))},t.copyQueryToClipboard=function(){try{t.selectQuery(),document.execCommand("copy"),e.close(),r.success(i.instant("modal.ctr.copy.query.success"))}catch(t){r.error(i.instant("modal.ctr.copy.not.supported.warning"))}},t.selectElement=function(t){if(t.length>0)if(window.getSelection){const e=window.getSelection();e.removeAllRanges();const n=document.createRange();n.selectNodeContents(t[0].firstChild),e.addRange(n)}else if(document.selection){const e=document.body.createTextRange();e.moveToElementText(t[0]),e.select()}}}angular.module("graphdb.framework.core.controllers",[]).controller("CopyToClipboardModalCtrl",r).controller("SimpleModalCtrl",n).controller("ViewQueryCtrl",i),n.$inject=["$scope","$modalInstance","title","message"],r.$inject=["$scope","$modalInstance","uri","toastr","$translate"],i.$inject=["$scope","$modalInstance","query","toastr","$translate"]},function(t,e){angular.module("graphdb.framework.rest.sparql.service",[]).factory("SparqlRestService",n),n.$inject=["$http"];function n(t){return{getSavedQueries:function(){return t.get("rest/sparql/saved-queries")},getSavedQuery:function(e,n){let r="";null!=n&&(r="&owner="+encodeURIComponent(n));return t.get(`rest/sparql/saved-queries?name=${encodeURIComponent(e)}${r}`)},addKnownPrefixes:function(e){return t.post("rest/sparql/add-known-prefixes",e)},editSavedQuery:function(e){return t.put("rest/sparql/saved-queries",e)},deleteSavedQuery:function(e){return t.delete("rest/sparql/saved-queries?name="+encodeURIComponent(e))},addNewSavedQuery:function(e){return t.post("rest/sparql/saved-queries",e)}}}},function(t,e){angular.module("graphdb.framework.rest.autocomplete.service",[]).factory("AutocompleteRestService",n);function n(t){return{checkAutocompleteStatus:function(){return t.get("rest/autocomplete/enabled")},refreshIndexStatus:function(){return t.get("rest/autocomplete/status")},refreshLabelConfig:function(){return t.get("rest/autocomplete/labels")},addLabelConfig:function(e){return t.put("rest/autocomplete/labels",e)},removeLabelConfig:function(e){return t.delete("rest/autocomplete/labels",{data:e,headers:{"Content-Type":"application/json;charset=utf-8"}})},toggleAutocomplete:function(e){return t.post("rest/autocomplete/enabled?enabled="+e)},refreshIndexIRIs:function(){return t.get("rest/autocomplete/iris")},toggleIndexIRIs:function(e){return t.post("rest/autocomplete/iris?enabled="+e)},buildIndex:function(){return t.post("rest/autocomplete/reindex")},interruptIndexing:function(){return t.post("rest/autocomplete/interrupt")},checkForPlugin:function(){return t.get("rest/autocomplete/plugin-found")},getAutocompleteSuggestions:function(e,n){return t.get("rest/autocomplete/query",{params:{q:e},timeout:n})}}}n.$inject=["$http"]},function(t,e){angular.module("graphdb.framework.rest.plugins.service",[]).factory("PluginsRestService",n);function n(t){return{togglePlugin:function(e,n,r){return n?t.post(`repositories/${e}/statements`,void 0,{params:{update:`INSERT DATA { <u:a> <http://www.ontotext.com/owlim/system#stopplugin> "${r}".}`}}):t.post(`repositories/${e}/statements`,void 0,{params:{update:`INSERT DATA { <u:a> <http://www.ontotext.com/owlim/system#startplugin> "${r}".}`}})},getPlugins:function(e){return t.get("repositories/"+e,{params:{query:"select ?s ?o where { ?s <http://www.ontotext.com/owlim/system#listplugins> ?o .}"}})}}}n.$inject=["$http"]},function(t,e,n){"use strict";n.r(e);n(5),n(7);var r=n(1);function i(t,e,n,i,s,o,a,u,c){this.guideResumeSubscription=void 0,this.languageChangeSubscription=void 0,this.guideCancelSubscription=void 0,this.init=()=>{this._subscribeToGuideResumed(),this._subscribeToGuideCancel(),this._subscribeToGuidePause()},this.startGuide=(t,n)=>{if(t&&t.options&&t.options.repositoryIdBase){const e=o.getRepositories();t.options.repositoryId=t.options.repositoryIdBase;for(let n=2;e.find(e=>e.id===t.options.repositoryId);n++)t.options.repositoryId=t.options.repositoryIdBase+n}const r=this._toStepsDescriptions(t);for(let t=0;t<r.length;t++)r[t].id=t;angular.isDefined(n)?s.resumeGuide(t.guideId,r,n):s.startGuide(t.guideId,r,n),e.$broadcast("guideStarted")},this.getGuides=()=>new Promise(e=>{t.get(r.GuideUtils.GUIDES_LIST_URL).success((function(t){angular.forEach(t,(t,e)=>{void 0===t.guideId&&(t.guideId=e)}),e(t)}))}),this.isActive=()=>s.isActive(),this._toStepsDescriptions=t=>{if(!t)return[];let e=[];return t.steps.forEach(n=>{e=e.concat(this._getSteps(n,t.options))}),e},this._getSteps=(t,s)=>{let o=[];if(angular.isArray(t))t.forEach(e=>{o=o.concat(this._getSteps(e,angular.extend({},t.options,s)))});else{const l=PluginRegistry.get("guide.step").find(e=>e.guideBlockName===t.guideBlockName);if(l){const h=angular.extend({},l.options,t.options,s);l.getSteps?o=o.concat(this._getSteps(angular.copy(l.getSteps(h,{$translate:n,$interpolate:i,GuideUtils:r.GuideUtils,$rootScope:e,toastr:a,$location:u,$route:c})),s)):l.getStep?o.push(angular.copy(l.getStep(h,{GuideUtils:r.GuideUtils,$translate:n,toastr:a,$location:u,$route:c}))):o=o.concat(this._getSteps(angular.copy(l,l.options),s))}}return o.forEach((t,e)=>{t.stepN=e,t.stepsTotalN=o.length,!t.title&&t.mainAction&&(t.title="guide.step-action."+t.mainAction)}),o},this._subscribeToGuideResumed=()=>{this.guideResumeSubscription||(this.guideResumeSubscription=e.$on("guideResume",()=>{const t=s.getGuideId();this.getGuides().then(e=>{const n=e.find(e=>e.guideId===t),r=s.getCurrentStepId();this.startGuide(n,r)})}))},this._subscribeToGuideCancel=()=>{s.subscribeToGuideCancel(()=>e.$broadcast("guideReset"))},this._subscribeToGuidePause=()=>{s.subscribeToGuidePause(()=>e.$broadcast("guidePaused"))}}angular.module("graphdb.framework.guides.services",["graphdb.framework.guides.shepherd.services"]).service("GuidesService",i),i.$inject=["$http","$rootScope","$translate","$interpolate","ShepherdService","$repositories","toastr","$location","$route"]},function(t,e,n){"use strict";n.r(e);n(4);angular.module("graphdb.framework.core.interceptors.unauthorized",["ngCookies"]).factory("$unauthorizedInterceptor",["$q","$location","$rootScope","$translate",function(t,e,n,r){return{responseError:function(i){let s=!1;return 401===i.status?i.config.url.indexOf("rest/security/authenticated-user")<0&&!n.hasExternalAuthUser()&&(s=!0):403===i.status&&(n.setPermissionDenied(e.path())?console.log(r.instant("unauthorized.console.warning")):s=!0),s?Promise.resolve(n.redirectToLogin()).then(()=>t.reject(i)):t.reject(i)}}}])},,function(t,e,n){"use strict";n.r(e);var r=n(3);const i={headers:{"X-GraphDB-Repository-Location":void 0,"X-GraphDB-Repository":void 0,"X-Requested-With":void 0,Authorization:void 0}};angular.module("graphdb.framework.core.services.openIDService",["toastr"]).service("$openIDAuth",["$http","$location","$window","toastr","$translate",function(t,e,n,s,o){const a="com.ontotext.graphdb.openid.",u=this;function c(t){const e=[];for(let n in t)t.hasOwnProperty(n)&&e.push(`${n}=${encodeURIComponent(t[n])}`);return e.join("&")}this.login=function(t,e){const r=u.generateRandomString(),i=t.authFlow;if("code"===i){u.setStorageItem("pkce_state",r);const i=u.generateRandomString();u.setStorageItem("pkce_code_verifier",i);const s=u.pkceChallengeFromVerifier(i);n.location.href=u.getLoginUrl(r,s,e,t)}else"code_no_pkce"===i?(u.removeStorageItem("pkce_code_verifier"),n.location.href=u.getLoginUrl(r,"",e,t)):"implicit"===i?(u.setStorageItem("nonce",r),n.location.href=u.getLoginUrl(r,"",e,t)):(console.log("oidc: unknown auth flow: "+i),s.error(o.instant("openid.auth.unknown.flow",{authFlow:i})))},this.getLoginUrl=function(t,e,n,r){const i=[];let s="";switch(r.authFlow){case"code":s="code",i.push("state="+encodeURIComponent(t)),i.push("code_challenge="+encodeURIComponent(e)),i.push("code_challenge_method=S256");break;case"code_no_pkce":s="code";break;case"implicit":s="token id_token",i.push("nonce="+encodeURIComponent(t));break;default:throw new Error(o.instant("openid.auth.unknown.flow",{authFlow:r.authFlow}))}return i.unshift("response_type="+encodeURIComponent(s),"scope="+encodeURIComponent(u.getScope(r.extraScopes)),"client_id="+encodeURIComponent(r.clientId),"redirect_uri="+encodeURIComponent(n)),r.oracleDomain&&i.push("domain="+encodeURIComponent(r.oracleDomain)),r.authorizeParameters&&i.push(r.authorizeParameters),`${r.oidcAuthorizationEndpoint}?${i.join("&")}`},this.withOpenIdKeys=function(e,n){t.get(e,i).success((function(t){u.openIdKeys={},t.keys.forEach((function(t){u.openIdKeys[t.kid]=t})),n()}))},this.initOpenId=function(t,e,r,a){u.clientId=t.clientId,u.tokenType=t.tokenType,u.idTokenAudience=t.clientId,u.idTokenIssuer=t.issuer,u.accessTokenAudience=t.tokenAudience,u.accessTokenIssuer=t.tokenIssuer,u.openIdTokenUrl=t.oidcTokenEndpoint;let c=t.oidcJwksUri;t.proxyOidc&&(c="rest/openid/jwks",u.openIdTokenUrl="rest/openid/token"),u.openIdEndSessionUrl=t.oidcEndSessionEndpoint,u.supportsOfflineAccess=t.oidcScopesSupported.includes("offline_access"),t.oracleDomain&&(i.headers["X-OAuth-Identity-Domain-Name"]=t.oracleDomain),u.withOpenIdKeys(c,(function(){if(u.isLoggedIn=u.hasValidIdToken(),u.isLoggedIn)u.setupTokensRefresh(!1,r,a);else if(u.hasValidRefreshToken())u.refreshTokens(r,a);else{const i=r;r=function(){u.isLoggedIn=!0,i(!0)},u.softLogout();const c=u.parseQueryString(n.location.search.substring(1));if(c.code)"code"===t.authFlow?u.getStorageItem("pkce_state")!==c.state?(s.error(o.instant("openid.auth.invalid.pkce.state")),console.log("oidc: PKCE state mismatch "+u.getStorageItem("pkce_state")+" != "+c.state),a()):u.retrieveTokensByCode(c.code,e,r,a):"code_no_pkce"===t.authFlow&&u.retrieveTokensByCode(c.code,e,r,a);else{const t=u.parseQueryString(n.location.pathname.substring(1));t.id_token?u.saveTokens(t,!0,!1,r):a()}}}))},this.authHeaderGraphDB=function(){return"id"===u.getStorageItem("token_type")?"Bearer "+u.getToken("id"):"Bearer "+u.getToken("access")},this.softLogout=function(){u.isLoggedIn=!1,u.setToken("id",null),u.setToken("access",null),u.setToken("refresh",null)},this.hardLogout=function(t){u.softLogout(),u.openIdEndSessionUrl&&(n.location.href=`${u.openIdEndSessionUrl}?client_id=${encodeURIComponent(u.clientId)}&post_logout_redirect_uri=${encodeURIComponent(t)}`)},this.getToken=function(t){return u.getStorageItem(t+"_token")},this.setToken=function(t,e){e?u.setStorageItem(t+"_token",e):u.removeStorageItem(t+"_token")},this.tokenHeader=function(t){const e=u.getToken(t);if(e){try{const t=r.KJUR.jws.JWS.readSafeJSONString(Object(r.b64utoutf8)(e.split(".")[0]));if(t)return t}catch(t){}return{error:o.instant("openid.auth.not.jwt.token",{token:e})}}return{}},this.verifyToken=function(t){const e=u.getToken(t),n=u.tokenHeader(t);if(!n.kid)return"id"!==t?n.error?(console.log(`oidc: token ${t} is not a JWT token (token considered valid)`),!0):(console.log(`oidc: invalid token ${t} (token is empty)`),!1):(console.log("oidc: invalid token id (not a JWT token)"),!1);const i=u.openIdKeys[n.kid];if(!i)return console.log("oidc: no key to verify JWT token (token considered invalid)"),!1;const s=r.KEYUTIL.getKey(i),o={alg:[n.alg],iss:[u.idTokenIssuer]};return"id"===t?(o.aud=[u.idTokenAudience,u.idTokenIssuer],o.nonce=[u.getStorageItem("nonce")]):"access"===t&&(o.aud=[u.accessTokenAudience],o.iss=[u.accessTokenIssuer]),r.KJUR.jws.JWS.verifyJWT(e,s,o)},this.hasValidIdToken=function(){return u.getToken("id")?u.verifyToken("id")?(console.log("oidc: valid id token found"),!0):(console.log("oidc: stale id token"),!1):(console.log("oidc: no id token"),!1)},this.tokenPayload=function(t){const e=u.getToken(t);if(e){try{const t=r.KJUR.jws.JWS.readSafeJSONString(Object(r.b64utoutf8)(e.split(".")[1]));if(t)return t}catch(t){}return{error:o.instant("openid.auth.not.jwt.token",{token:e})}}return{}},this.saveTokens=function(t,n,r,i){(n||t.refresh_token)&&u.setToken("refresh",t.refresh_token),u.setToken("access",t.access_token),u.setToken("id",t.id_token),u.setStorageItem("token_type",u.tokenType),console.log("oidc: saved tokens"),u.setupTokensRefresh(n||r,i),u.removeStorageItem("pkce_state"),u.removeStorageItem("pkce_code_verifier"),n&&e.url("/")},this.retrieveTokensByCode=function(e,n,r,a){const l={grant_type:"authorization_code",client_id:u.clientId,redirect_uri:n,code:e},h=u.getStorageItem("pkce_code_verifier");h&&(l.code_verifier=h);const f={...i.headers,"Content-type":"application/x-www-form-urlencoded; charset=utf-8"};t({method:"POST",url:u.openIdTokenUrl,headers:f,transformRequest:c,data:l}).success((function(t){u.saveTokens(t,!0,!1,r)})).error((function(t){s.error(o.instant("openid.auth.cannot.retrieve.token.msg",{error:getError(t)})),a()}))},this.refreshTokens=function(e,n){if(u.hasValidRefreshToken()){const r={grant_type:"refresh_token",client_id:u.clientId,refresh_token:u.getToken("refresh")},a={...i.headers,"Content-type":"application/x-www-form-urlencoded; charset=utf-8"};t({method:"POST",url:u.openIdTokenUrl,headers:a,transformRequest:c,data:r}).success((function(t){console.log("oidc: refreshed tokens"),u.saveTokens(t,!1,!0,e),u.isLoggedIn=!0})).error((function(t){console.log("oidc: could not refresh tokens"),s.error(o.instant("openid.auth.cannot.refresh.token.msg",{error:getError(t)})),n&&n()}))}else console.log("oidc: refresh requested without a valid refresh token")},this.hasValidRefreshToken=function(){const t=u.tokenPayload("refresh");return!(t.nbf&&1e3*t.nbf-Date.now()>5e3)&&(!(t.exp&&Date.now()-1e3*t.exp>5e3)&&!(!t.iat&&!t.error))},this.setupTokensRefresh=function(t,e,n){if(u.hasValidRefreshToken()){clearTimeout(u.previousTimer);const r=u.tokenPayload("id");if(r.exp>0){const i=1e3*r.exp-Date.now()-6e4;if(!(t||i>1e3))return u.previousTimer=null,console.log("oidc: tokens will refresh now, "+i+"; "+t),void u.refreshTokens(e,n);u.previousTimer=setTimeout((function(){u.refreshTokens(e)}),i),console.log("oidc: tokens will refresh in "+i/1e3+" seconds at "+new Date(Date.now()+i))}}else console.log("oidc: no valid refresh token");e()},this.parseQueryString=function(t){const e={access_token:null,code:null,id_token:null,state:null};if(""===t)return e;return t.split("&").map((function(t){return t.split("=")})).forEach((function(t){e[t[0]]=decodeURIComponent(t[1])})),e},this.generateRandomString=function(){const t=new Uint32Array(28);return window.crypto.getRandomValues(t),Array.from(t,(function(t){return("0"+t.toString(16)).substr(-2)})).join("")},this.pkceChallengeFromVerifier=function(t){const e=new r.KJUR.crypto.MessageDigest({alg:"sha256",prov:"cryptojs"});return Object(r.hextob64u)(e.digestString(t))},this.getScope=function(t){let e="openid"+(u.supportsOfflineAccess?" offline_access":"");return t&&(e+=" "+t),console.log(`oidc: requesting scopes '${e}'`),e},this.setStorageItem=function(t,e){localStorage.setItem(a+t,e)},this.getStorageItem=function(t){return localStorage.getItem(a+t)},this.removeStorageItem=function(t){localStorage.removeItem(a+t)}}])},function(t,e){angular.module("graphdb.framework.rest.security.service",[]).factory("SecurityRestService",n),n.$inject=["$http"];function n(t){return{getUser:function(n){return t.get("rest/security/users/"+e(n))},getAdminUser:function(){return t.get("rest/security/users/admin")},getUsers:function(){return t.get("rest/security/users")},createUser:function(n){return t({method:"POST",url:"rest/security/users/"+e(n.username),data:{password:n.pass,appSettings:n.appSettings,grantedAuthorities:n.grantedAuthorities}})},updateUser:function(n){return t({method:"PUT",url:"rest/security/users/"+e(n.username),data:{password:n.pass,appSettings:n.appSettings,grantedAuthorities:n.grantedAuthorities}})},updateUserData:function(n){return t({method:"PATCH",url:"rest/security/users/"+e(n.username),data:{password:n.pass,appSettings:n.appSettings}})},deleteUser:function(n){return t.delete("rest/security/users/"+e(n))},getFreeAccess:function(){return t.get("rest/security/free-access")},setFreeAccess:function(e){return t.post("rest/security/free-access",e)},getSecurityConfig:function(){return t.get("rest/security/all")},toggleSecurity:function(e){return t.post("rest/security",e?"true":"false")},getRoles:function(){return t.get("rest/roles")},getRolesMapping:function(e){return t.get("rest/roles/mapping",{params:e})},getAuthenticatedUser:function(){return t.get("rest/security/authenticated-user")}};function e(t){return encodeURIComponent(t).replace(/[.!'()*]/g,(function(t){return"%"+t.charCodeAt(0).toString(16)}))}}},function(t,e){!function(t){t.getError=function(t,e,n){if(angular.isObject(t)&&t.status&&t.data)return getError(t.data,e,n);if(e&&403===e)return"Access is restricted";if(t){let r="Generic error";if(angular.isString(t))-1===t.indexOf("<html>")&&(r=t,r=r.replace(/^(([a-z0-9_]+\.)+[a-zA-Z0-9_]+: )+/,""));else if(angular.isObject(t)){if("message"in t&&(r=t.message),"error"in t&&(r=t.error.message),"responseJSON"in t&&"message"in t.responseJSON)return getError(t.responseJSON,e,n);"responseText"in t&&(r=t.responseText)}return n>0&&r.length>n&&(r=r.substr(0,n)+"..."),r}return"There is an error"}}(window)},function(t,e,n){"use strict";n.r(e);n(4),n(17),n(18),n(19),n(14),n(8),n(9),n(15),n(34),n(35),n(12),n(10),n(28);var r=n(2),i=(n(5),n(13),n(29),n(0)),s=(n(20),n(30),n(7));function o(t,e,n,r,i,s,o,a,u,c){function l(){t.getActiveRepository()&&(t.getNamespacesPromise=c.getNamespaces(t.getActiveRepository()).success((function(){h()})),t.getActiveRepositorySize())}function h(){s.isLicenseValid()&&(t.getAutocompletePromise=o.checkAutocompleteStatus())}t.doClear=!1,t.getActiveRepositorySize=function(){const e=r.getActiveRepositoryObject();e&&(t.activeRepositorySizeError=void 0,u.getSize(e).then((function(e){t.activeRepositorySize=e.data})).catch((function(e){t.activeRepositorySizeError=e.data.message})))},t.$on("autocompleteStatus",(function(){h()})),t.$on("repositoryIsSet",l),t.$on("$routeChangeSuccess",(function(t,n,r){r&&(i.isAuthenticated()||i.isFreeAccessEnabled()?l():e.redirectToLogin())})),t.onKeyDown=function(e){27===e.keyCode&&(t.doClear=!0)}}function a(t,e,n,o,a,u,c,l,h,f,p,d,g,m,v,y,b,w,x,S,E,F,A,C,D){t.descr=F.instant("main.gdb.description"),t.documentation="",t.menu=e,t.tutorialState=1!==S.get(E.TUTORIAL_STATE),t.userLoggedIn=!1,t.embedded=u.search().embedded,t.productInfo=f,t.guidePaused="true"===S.get(s.GUIDE_PAUSE);function I(){$(window).width()<=720?($(".container-fluid.main-container").addClass("expanded"),$(".main-menu").addClass("collapsed"),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right"),$(".toggle-menu").hide()):$(window).width()>720&&"collapsedMenu"===S.get(E.MENU_STATE)?($(".container-fluid.main-container").addClass("expanded"),$(".main-menu").addClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right")):($(".container-fluid.main-container").removeClass("expanded"),$(".main-menu").removeClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left"))}!function(){const e=new Date;t.currentYear=e.getFullYear(),t.previousYear=2002}(),$("#repositorySelectDropdown").on("hide.bs.dropdown",(function(t){D.isActive()&&t.preventDefault()})),t.$on("$routeChangeSuccess",(function(e,n,r){t.clicked=!1,$(".menu-element-root").removeClass("active"),p((function(){$(".menu-element.open a.menu-element-root").addClass("active"),$(".main-menu.collapsed .menu-element.open .menu-element-root").addClass("active")}),400),r&&l.checkLicenseStatus()})),t.resumeGuide=function(){h.$broadcast("guideResume")},h.$on("guideReset",(function(){t.guidePaused=!1,h.guidePaused=!1})),h.$on("guideStarted",(function(){t.guidePaused=!1,h.guidePaused=!1})),h.$on("guidePaused",(function(){t.guidePaused=!0,h.guidePaused=!0})),h.$on("$translateChangeSuccess",(function(){t.menu.forEach((function(t){t.label=F.instant(t.labelKey),t.children&&t.children.forEach((function(t){t.label=F.instant(t.labelKey)}))})),h.helpInfo=x.trustAsHtml(Object(i.decodeHTML)(F.instant(h.helpInfo))),h.title=Object(i.decodeHTML)(F.instant(h.title)),t.initTutorial()})),t.checkMenu=function(){return $(".main-menu").hasClass("collapsed")},t.copyToClipboard=function(t){d.openCopyToClipboardModal(t)},t.goToAddRepo=function(){u.path("/repository/create").search({previous:"home"})},t.goToEditRepo=function(t){u.path("repository/edit/"+t.id).search({previous:"home",location:t.location})},t.getLocationFromUri=function(t){return c.getLocationFromUri(t)},t.$on("$locationChangeSuccess",(function(){t.showFooter="/"===u.url()})),t.$on("repositoryIsSet",(function(){t.setRestricted(),S.clearClassHieararchyState()})),t.graphdbVersion=t.engineVersion=f.productVersion,t.workbenchVersion=f.Workbench,t.connectorsVersion=f.connectors,t.sesameVersion=f.sesame,t.select=function(e,n,r){$(".main-menu").hasClass("collapsed")?$(n.target).parents(".menu-element").children(".menu-element-root").hasClass("active")?(t.selected=e,t.clicked=!r):(!$(n.target).parents(".menu-element").hasClass("open")&&r?t.clicked=!0:t.clicked=!r,t.selected===e?t.selected=-1:t.selected=e):(!$(n.target).parents(".menu-element").hasClass("open")&&r?t.clicked=!0:t.clicked=!r,0!==$(n.target).parent(".menu-element").find(".sub-menu").length?($(n.target).parents(".menu-element").children(".menu-element-root").hasClass("active")?$(".sub-menu li.active").parents(".menu-element").children(".menu-element-root").removeClass("active"):$(".sub-menu li.active").parents(".menu-element").children(".menu-element-root").addClass("active"),t.selected===e?t.selected=-1:t.selected=e):(p((function(){$(n.target).parents(".menu-element").children(".menu-element-root").addClass("active")}),50),t.selected=e))},$("body").bind("click",(function(e){!$(e.target).parents(".main-menu").length&&$(".main-menu").hasClass("collapsed")&&(t.clicked=!1,t.selected=-1)})),t.isCurrentPath=function(t){return u.path()==="/"+t},t.isCurrentSubmenuChildPath=function(e){return 0!==e.children.length&&e.children.some((function(e){return t.isCurrentPath(e.href)}))},"/"===u.path()?t.selected=-1:(p((function(){const e=u.path().replace("/",""),n=$('a[href^="'+e+'"]');t.selected=n.closest(".menu-element").index()-1}),200),t.isCurrentPath(u.path())),t.popoverTemplate="js/angular/templates/repositorySize.html",t.securityEnabled=!0,t.isSecurityEnabled=function(){return n.isSecurityEnabled()},t.isFreeAccessEnabled=function(){return n.isFreeAccessEnabled()},t.hasExternalAuthUser=function(){return n.hasExternalAuthUser()},t.isDefaultAuthEnabled=function(){return n.isDefaultAuthEnabled()},t.isUserLoggedIn=function(){return t.userLoggedIn},t.hasActiveLocation=function(){return c.hasActiveLocation()},t.getActiveLocation=function(){return c.getActiveLocation()},t.isLoadingLocation=function(){return c.isLoadingLocation()},t.getRepositories=function(){return c.getRepositories()},t.getReadableRepositories=function(){return c.getReadableRepositories()},t.getWritableRepositories=function(){return c.getWritableRepositories()},t.getActiveRepository=function(){return c.getActiveRepository()},t.canWriteRepoInLocation=function(t){return n.canWriteRepo(t)},t.canWriteActiveRepo=function(t){const e=c.getActiveRepositoryObject();return!!e&&(n.canWriteRepo(e)&&("SYSTEM"!==e.id||!t))},t.getActiveRepositoryObject=function(){return c.getActiveRepositoryObject()},t.getActiveRepositoryShortLocation=function(){const t=c.getActiveRepositoryObject();if(t){const e=t.location;if(e)return"@"+A.shortenIri(e)}return""},t.isActiveRepoOntopType=function(){return c.isActiveRepoOntopType()},t.isActiveRepoFedXType=function(){return c.isActiveRepoFedXType()},t.isLicenseValid=function(){return l.isLicenseValid()},t.setAttrs=function(e){t.attrs=e},t.setRestricted=function(){t.attrs&&(t.isRestricted=t.attrs.hasOwnProperty("license")&&!l.isLicenseValid()||t.attrs.hasOwnProperty("write")&&t.isSecurityEnabled()&&!t.canWriteActiveRepo()||t.attrs.hasOwnProperty("ontop")&&t.isActiveRepoOntopType()||t.attrs.hasOwnProperty("fedx")&&t.isActiveRepoFedXType())},t.toHumanReadableType=function(t){switch(t){case"graphdb":return"Graphdb";case"system":return"System";case"ontop":return"Ontop";case"fedx":return"FedX";default:return"Unknown"}},t.setRepository=function(t){c.setRepository(t)},t.logout=function(){n.clearAuthentication(),a.success("Signed out"),n.freeAccess?c.resetActiveRepository():n.isSecurityEnabled()&&h.redirectToLogin()},t.isAdmin=function(){return t.hasRole(r.UserRole.ROLE_ADMIN)},t.isUser=function(){return t.hasRole(r.UserRole.ROLE_USER)},t.hasRole=function(t){return!!angular.isUndefined(t)||n.hasRole(t)},t.hasPermission=function(){return h.hasPermission()},t.canReadRepo=function(t){return n.canReadRepo(t)},t.checkForWrite=function(t,e){return n.checkForWrite(t,e)},t.setPopoverRepo=function(e){t.popoverRepo=e},t.isRepoActive=function(t){return c.isRepoActive(t)},t.getRepositorySize=function(){t.repositorySize={},t.popoverRepo&&(t.repositorySize.loading=!0,y.getSize(t.popoverRepo).then((function(e){t.repositorySize=e.data})))},t.getDegradedReason=function(){return c.getDegradedReason()},t.canManageRepositories=function(){return n.hasRole(r.UserRole.ROLE_REPO_MANAGER)&&!c.getDegradedReason()},t.getSavedQueries=function(){w.getSavedQueries().success((function(e){t.sampleQueries=e})).error((function(t){const e=getError(t);a.error(e,F.instant("query.editor.get.saved.queries.error"))}))},t.goToSparqlEditor=function(t){u.path("/sparql").search({savedQueryName:t.name,owner:t.owner,execute:!0})},t.declineTutorial=function(){S.set(E.TUTORIAL_STATE,1),t.tutorialState=!1},t.showTutorial=function(){t.tutorialState=!0,S.remove(E.TUTORIAL_STATE)},t.initTutorial=function(){if(!t.tutorialState&&"/"!==u.path())return;t.tutorialInfo=[{title:F.instant("main.info.title.welcome.page"),info:"<p>"+Object(i.decodeHTML)(F.instant("main.info.welcome.page"))+"</p><p>"+Object(i.decodeHTML)(F.instant("main.info.welcome.page.guides"))+"</p><p>"+Object(i.decodeHTML)(F.instant("main.info.welcome.page.footer"))+"</p>"},{title:F.instant("main.info.title.create.repo.page"),info:Object(i.decodeHTML)(F.instant("main.info.create.repo.page",{link:'<a href="https://graphdb.ontotext.com/documentation/'+f.productShortVersion+'/configuring-a-repository.html" target="_blank">'}))},{title:F.instant("main.info.title.load.sample.dataset"),info:F.instant("main.info.load.sample.dataset")},{title:F.instant("main.info.title.run.sparql.query"),info:Object(i.decodeHTML)(F.instant("main.info.run.sparql.query"))},{title:F.instant("menu.rest.api.label"),info:Object(i.decodeHTML)(F.instant("main.info.rest.api"))}],t.activePage=0,$(".pages-wrapper .page-slide").css("opacity",100);const e=$(".main-container")[0].offsetWidth+200;p((function(){const n=$(".pages-wrapper .page-slide");n.css("left",e+"px"),$(n[t.activePage]).css("left","0px"),$($(".btn-toolbar.pull-right .btn-group .btn")[0]).focus()}),50)},t.getTutorialPageHtml=function(t){return x.trustAsHtml(t.info)},t.checkSubMenuPosition=function(t){0===t?$(".main-menu.collapsed .sub-menu").removeClass("align-bottom"):$(window).height()<735?$(".main-menu.collapsed .sub-menu").addClass("align-bottom"):$(".main-menu.collapsed .sub-menu").removeClass("align-bottom")},I(),$(window).resize((function(){angular.isDefined(t.menuState)?$(window).width()<=720?($(".container-fluid.main-container").addClass("expanded"),$(".main-menu").addClass("collapsed"),$(".toggle-menu").hide(),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right")):$(window).width()>720&&t.menuState?$(".toggle-menu").show():($(".container-fluid.main-container").removeClass("expanded"),$(".main-menu").removeClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left")):I(),t.tutorialState&&"/"===u.path()&&t.initTutorial(),$(window).height()<735?($(".sub-menu").addClass("align-bottom"),$(".main-menu.collapsed li:nth-child(2) .sub-menu").removeClass("align-bottom")):$(".sub-menu").removeClass("align-bottom")})),t.slideToPage=function(e){const n=$(".main-container")[0].offsetWidth,r=$(".pages-wrapper .page-slide");r.css("opacity","0").delay(200).css("left",n+"px"),t.activePage=e,$(r[t.activePage]).css("opacity","100").css("left","0px")},t.slideNext=function(){let e=++t.activePage;e>=t.tutorialInfo.length&&(e=0),t.slideToPage(e),$($(".btn-toolbar.pull-right .btn-group .btn")[t.activePage]).focus()},t.toggleNavigation=function(){const e=$(".main-menu"),n=$(".sub-menu li.active");if(e.hasClass("collapsed"))n.parents(".menu-element").hasClass("open")?n.parents(".menu-element").children(".menu-element-root").removeClass("active"):n.parents(".menu-element").children(".menu-element-root").addClass("active"),$(".container-fluid.main-container").removeClass("expanded"),e.removeClass("collapsed"),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left"),h.$broadcast("onToggleNavWidth",!1);else{n.parents(".menu-element").children(".menu-element-root").addClass("active");const r=$(".menu-element");r.hasClass("open")&&(r.removeClass("open"),t.clicked=!1,t.selected=-1),$(".container-fluid.main-container").addClass("expanded"),e.addClass("collapsed"),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right"),$(".main-menu.collapsed .menu-element.clicked").removeClass("clicked"),h.$broadcast("onToggleNavWidth",!0)}},t.$on("onToggleNavWidth",(function(e,n){if(t.menuState=n,n?S.set(E.MENU_STATE,"collapsedMenu"):S.set(E.MENU_STATE,"expandedMenu"),t.tutorialState&&"/"===u.path()){const e=$(".pages-wrapper")[0].offsetWidth+200;p((function(){const n=$(".pages-wrapper .page-slide");n.css("left",e+"px"),$(n[t.activePage]).css("left","0px")}),50)}})),t.numberOfActiveImports=0,t.getNumberOfActiveImportsRunning=!1,t.getNumberOfActiveImports=function(){t.getNumberOfActiveImportsRunning||t.canWriteActiveRepo()&&"SYSTEM"!==t.getActiveRepository()&&(t.getNumberOfActiveImportsRunning=!0,o({method:"GET",url:"rest/repositories/"+t.getActiveRepository()+"/import/active",timeout:1e4}).success((function(e){t.numberOfActiveImports=e})).finally((function(){t.getNumberOfActiveImportsRunning=!1})))},t.getQueriesRunning=!1,t.skipGetQueriesTimes=0;const R=function(){let t=0,e=1;return{next:function(){const n=e;return e=t+e,t=n,n},reset:function(){t=0,e=1}}}();t.getQueries=function(){t.getQueriesRunning||(t.skipGetQueriesTimes>0?t.skipGetQueriesTimes--:c.getActiveRepository()&&"SYSTEM"!==c.getActiveRepository()&&!c.isActiveRepoOntopType()&&t.hasRole(r.UserRole.ROLE_USER)?(t.getQueriesRunning=!0,b.getQueryCount().success((function(e){t.queryCount=e,R.reset()})).error((function(){t.queryCount=0,t.skipGetQueriesTimes=R.next()})).finally((function(){t.getQueriesRunning=!1}))):t.queryCount=0)};const T=g((function(){t.getDegradedReason()||(t.getQueries(),t.getNumberOfActiveImports())}),2e3);t.$on("$destroy",(function(){g.cancel(T)})),n.securityInitialized&&t.getSavedQueries(),t.$on("securityInit",(function(e,r,i,s){t.securityEnabled=r,t.userLoggedIn=i,!r||i||s?(C.when(n.getPrincipal()).then(e=>{t.principal=e,t.isIgnoreSharedQueries=e&&e.appSettings.IGNORE_SHARED_QUERIES}),l.checkLicenseStatus(),t.getSavedQueries()):"/login"!==u.path()&&h.redirectToLogin()})),t.isEnterprise=function(){return"enterprise"===t.getProductType()},t.isFreeEdition=function(){return"free"===t.getProductType()},t.checkEdition=function(e){return null==e||_.indexOf(e,t.getProductType())>=0},t.showLicense=function(){return l.showLicense},t.getLicense=function(){return l.license},t.isLicenseHardcoded=function(){return l.isLicenseHardcoded},t.getProductType=function(){return l.productType},t.getProductTypeHuman=function(){return l.productTypeHuman},t.getHumanReadableSeconds=function(t,e){const n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60);let s;s=e&&t<10?t<1?_.ceil(t%60,1):_.round(t%60,1):_.round(t%60,0);let o="";return n&&(o+=n+"d "),(n||r)&&(o+=r+"h "),(n||r||i)&&(o+=i+"m "),o+=s+"s",o.replace(/( 0[a-z])+$/,"")},t.getHumanReadableTimestamp=function(t){const e=Date.now(),n=(e-t)/1e3;if(n<60)return F.instant("timestamp.moments.ago");if(n<600)return F.instant("timestamp.minutes.ago");{const r=new Date(e),i=new Date(t);if(r.getYear()===i.getYear()&&r.getMonth()===i.getMonth()&&r.getDate()===i.getDate())return m("date")(t,"'"+F.instant("timestamp.today.at")+"' HH:mm");if(n<86400)return m("date")(t,"'"+F.instant("timestamp.yesterday.at")+"' HH:mm")}return m("date")(t,"'"+F.instant("timestamp.on")+"' yyyy-MM-dd '"+F.instant("timestamp.at")+"' HH:mm")}}function u(t,e,n){t.getRepositorySize=function(e){n.getSize(e).then((function(e){t.size=e.data}))}}angular.module("graphdb.workbench.se.controllers",["graphdb.framework.core.services.jwtauth","graphdb.framework.core.services.repositories","graphdb.framework.core.services.licenseService","ngCookies","ngFileUpload","graphdb.framework.core","graphdb.framework.core.controllers","graphdb.framework.core.directives","graphdb.framework.rest.license.service","graphdb.framework.rest.autocomplete.service","graphdb.framework.rest.repositories.service","graphdb.framework.rest.sparql.service","graphdb.framework.rest.autocomplete.service","graphdb.framework.rest.plugins.service","graphdb.framework.rest.monitoring.service","graphdb.framework.rest.rdf4j.repositories.service","graphdb.framework.utils.localstorageadapter","graphdb.framework.core.services.autocompleteStatus","graphdb.framework.utils.uriutils","graphdb.framework.guides.directives","graphdb.framework.guides.services"]).controller("mainCtrl",a).controller("homeCtrl",o).controller("repositorySizeCtrl",u),o.$inject=["$scope","$rootScope","$http","$repositories","$jwtAuth","$licenseService","AutocompleteRestService","LicenseRestService","RepositoriesRestService","RDF4JRepositoriesRestService"],a.$inject=["$scope","$menuItems","$jwtAuth","$http","toastr","$location","$repositories","$licenseService","$rootScope","productInfo","$timeout","ModalService","$interval","$filter","LicenseRestService","RepositoriesRestService","MonitoringRestService","SparqlRestService","$sce","LocalStorageAdapter","LSKeys","$translate","UriUtils","$q","GuidesService"],u.$inject=["$scope","$http","RepositoriesRestService"]},function(t,e){angular.module("graphdb.framework.rest.locations.service",[]).factory("LocationsRestService",n),n.$inject=["$http"];function n(t){return{getLocations:function(e){return t.get("rest/locations",{timeout:e?e.promise:null})},addLocation:function(e){return t.post("rest/locations",e)},editLocation:function(e){return t.put("rest/locations",e)},deleteLocation:function(e){return t.delete("rest/locations?uri="+e)},getActiveLocation:function(){return t({method:"GET",url:"rest/locations/active",noCancelOnRouteChange:!0})},setDefaultRepository:function(e){return t({url:"rest/locations/active/default-repository",method:"POST",data:{defaultRepository:e}})},getLocationRpcAddress:function(e){return t.get("rest/info/rpc-address",{params:{location:e}})}}}},function(t,e){angular.module("graphdb.framework.core.services.licenseService",[]).service("$licenseService",["$rootScope","LicenseRestService","$translate",function(t,e,n){const r=this;this.checkLicenseStatus=function(){r.loadingLicense=!0,e.getHardcodedLicense().success((function(t){r.isLicenseHardcoded="true"===t})).error((function(){r.isLicenseHardcoded=!0})).then((function(){e.getLicenseInfo().then((function(t){r.license=t.data,r.showLicense=!0,r.loadingLicense=!1,i(r.license)}),(function(){r.license={message:n.instant("no.license.set.msg"),valid:!1},r.showLicense=!0,r.loadingLicense=!1,i(r.license)}))}))};const i=function(t){r.productType=t.productType,"standard"===r.productType?r.productTypeHuman="Standard":"enterprise"===r.productType?r.productTypeHuman="Enterprise":"free"===r.productType?r.productTypeHuman="Free":"graphdb"===r.productType&&(r.productTypeHuman="GraphDB")};this.checkLicenseStatus(),this.isLicenseValid=function(){return r.license&&r.license.valid}}])},function(t,e){angular.module("graphdb.framework.core.services.autocompleteStatus",[]).service("$autocompleteStatus",["$rootScope","AutocompleteRestService","LocalStorageAdapter","LSKeys","$repositories",function(t,e,n,r,i){const s=this;this.setAutocompleteStatus=function(e){n.set(r.AUTOCOMPLETE_ENABLED,e),t.$broadcast("autocompleteStatus",e)},t.$watch((function(){return n.get(r.AUTOCOMPLETE_ENABLED)}),(function(t){s.setAutocompleteStatus(t)}),!0),t.$on("repositoryIsSet",(function(){!i.getActiveRepository()||i.isActiveRepoOntopType()||i.isActiveRepoFedXType()||e.checkAutocompleteStatus().success((function(t){s.setAutocompleteStatus(t)}))}))}])},function(t,e){angular.module("graphdb.framework.guides.directives",[]).directive("guideSelector",(function(){return{}}))},function(t,e){
|
|
27
|
+
var at=function(){var t=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),e=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),n={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function r(t,e,r){return e?n[e]:String.fromCharCode(parseInt(r,16))}var i=new String(""),s=Object.hasOwnProperty;return function(n,o){var a,u,c=n.match(t),l=c[0],h=!1;"{"===l?a={}:"["===l?a=[]:(a=[],h=!0);for(var f=[a],p=1-h,d=c.length;p<d;++p){var g;switch((l=c[p]).charCodeAt(0)){default:(g=f[0])[u||g.length]=+l,u=void 0;break;case 34:if(-1!==(l=l.substring(1,l.length-1)).indexOf("\\")&&(l=l.replace(e,r)),g=f[0],!u){if(!(g instanceof Array)){u=l||i;break}u=g.length}g[u]=l,u=void 0;break;case 91:g=f[0],f.unshift(g[u||g.length]=[]),u=void 0;break;case 93:f.shift();break;case 102:(g=f[0])[u||g.length]=!1,u=void 0;break;case 110:(g=f[0])[u||g.length]=null,u=void 0;break;case 116:(g=f[0])[u||g.length]=!0,u=void 0;break;case 123:g=f[0],f.unshift(g[u||g.length]={}),u=void 0;break;case 125:f.shift()}}if(h){if(1!==f.length)throw new Error;a=a[0]}else if(f.length)throw new Error;if(o){var m=function(t,e){var n=t[e];if(n&&"object"==typeof n){var r=null;for(var i in n)if(s.call(n,i)&&n!==t){var a=m(n,i);void 0!==a?n[i]=a:(r||(r=[]),r.push(i))}if(r)for(var u=r.length;--u>=0;)delete n[r[u]]}return o.call(t,e,n)};a=m({"":a},"")}return a}}();void 0!==ut&&ut||(ut={}),void 0!==ut.asn1&&ut.asn1||(ut.asn1={}),ut.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1))e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var n=e.substr(1).length;n%2==1?n+=1:e.match(/^[0-7]/)||(n+=2);for(var r="",i=0;i<n;i++)r+="f";e=new w(r,16).xor(t).add(w.ONE).toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){return $t(t,e)},this.newObject=function(t){var e=ut.asn1,n=e.ASN1Object,r=e.DERBoolean,i=e.DERInteger,s=e.DERBitString,o=e.DEROctetString,a=e.DERNull,u=e.DERObjectIdentifier,c=e.DEREnumerated,l=e.DERUTF8String,h=e.DERNumericString,f=e.DERPrintableString,p=e.DERTeletexString,d=e.DERIA5String,g=e.DERUTCTime,m=e.DERGeneralizedTime,v=e.DERVisibleString,y=e.DERBMPString,b=e.DERSequence,x=e.DERSet,w=e.DERTaggedObject,S=e.ASN1Util.newObject;if(t instanceof e.ASN1Object)return t;var E=Object.keys(t);if(1!=E.length)throw new Error("key of param shall be only one.");var F=E[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+F+":"))throw new Error("undefined key: "+F);if("bool"==F)return new r(t[F]);if("int"==F)return new i(t[F]);if("bitstr"==F)return new s(t[F]);if("octstr"==F)return new o(t[F]);if("null"==F)return new a(t[F]);if("oid"==F)return new u(t[F]);if("enum"==F)return new c(t[F]);if("utf8str"==F)return new l(t[F]);if("numstr"==F)return new h(t[F]);if("prnstr"==F)return new f(t[F]);if("telstr"==F)return new p(t[F]);if("ia5str"==F)return new d(t[F]);if("utctime"==F)return new g(t[F]);if("gentime"==F)return new m(t[F]);if("visstr"==F)return new v(t[F]);if("bmpstr"==F)return new y(t[F]);if("asn1"==F)return new n(t[F]);if("seq"==F){for(var A=t[F],C=[],D=0;D<A.length;D++){var $=S(A[D]);C.push($)}return new b({array:C})}if("set"==F){for(A=t[F],C=[],D=0;D<A.length;D++){$=S(A[D]);C.push($)}return new x({array:C})}if("tag"==F){var I=t[F];if("[object Array]"===Object.prototype.toString.call(I)&&3==I.length){var R=S(I[2]);return new w({tag:I[0],explicit:I[1],obj:R})}return new w(I)}},this.jsonToASN1HEX=function(t){return this.newObject(t).tohex()}},ut.asn1.ASN1Util.oidHexToInt=function(t){for(var e="",n=parseInt(t.substr(0,2),16),r=(e=Math.floor(n/40)+"."+n%40,""),i=2;i<t.length;i+=2){var s=("00000000"+parseInt(t.substr(i,2),16).toString(2)).slice(-8);if(r+=s.substr(1,7),"0"==s.substr(0,1))e=e+"."+new w(r,2).toString(10),r=""}return e},ut.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},n=function(t){var n="",r=new w(t,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var s="",o=0;o<i;o++)s+="0";r=s+r;for(o=0;o<r.length-1;o+=7){var a=r.substr(o,7);o!=r.length-7&&(a="1"+a),n+=e(parseInt(a,2))}return n};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var r="",i=t.split("."),s=40*parseInt(i[0])+parseInt(i[1]);r+=e(s),i.splice(0,2);for(var o=0;o<i.length;o++)r+=n(i[o]);return r},ut.asn1.ASN1Object=function(t){this.params=null,this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw new Error("this.hV is null or undefined");if(this.hV.length%2==1)throw new Error("value hex must be even length: n="+"".length+",v="+this.hV);var t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var n=e.length/2;if(n>15)throw new Error("ASN.1 length too long to represent by 8x: n = "+t.toString(16));return(128+n).toString(16)+e},this.tohex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.getValueHex=function(){return this.tohex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(t){this.params=t},null!=t&&null!=t.tlv&&(this.hTLV=t.tlv,this.isModified=!1)},ut.asn1.DERAbstractString=function(t){ut.asn1.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=xt(this.s).toLowerCase()},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},Zt(ut.asn1.DERAbstractString,ut.asn1.ASN1Object),ut.asn1.DERAbstractTime=function(t){ut.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(t){var e=t.getTime()+6e4*t.getTimezoneOffset();return new Date(e)},this.formatDate=function(t,e,n){var r=this.zeroPadding,i=this.localDateToUTC(t),s=String(i.getFullYear());"utc"==e&&(s=s.substr(2,2));var o=s+r(String(i.getMonth()+1),2)+r(String(i.getDate()),2)+r(String(i.getHours()),2)+r(String(i.getMinutes()),2)+r(String(i.getSeconds()),2);if(!0===n){var a=i.getMilliseconds();if(0!=a){var u=r(String(a),3);o=o+"."+(u=u.replace(/[0]+$/,""))}}return o+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.setByParam=function(t){this.hV=null,this.hTLV=null,this.params=t},this.getString=function(){},this.setString=function(t){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.str=t},this.setByDate=function(t){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.date=t},this.setByDateValue=function(t,e,n,r,i,s){var o=new Date(Date.UTC(t,e-1,n,r,i,s,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},Zt(ut.asn1.DERAbstractTime,ut.asn1.ASN1Object),ut.asn1.DERAbstractStructured=function(t){ut.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},Zt(ut.asn1.DERAbstractStructured,ut.asn1.ASN1Object),ut.asn1.DERBoolean=function(t){ut.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==t?"010100":"0101ff"},Zt(ut.asn1.DERBoolean,ut.asn1.ASN1Object),ut.asn1.DERInteger=function(t){ut.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=ut.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new w(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},Zt(ut.asn1.DERInteger,ut.asn1.ASN1Object),ut.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=ut.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.tohex()}ut.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var n="0"+t;this.hTLV=null,this.isModified=!0,this.hV=n+e},this.setByBinaryString=function(t){var e=8-(t=t.replace(/0+$/,"")).length%8;8==e&&(e=0),t+="0000000".substr(0,e);for(var n="",r=0;r<t.length-1;r+=8){var i=t.substr(r,8),s=parseInt(i,2).toString(16);1==s.length&&(s="0"+s),n+=s}this.hTLV=null,this.isModified=!0,this.hV="0"+e+n},this.setByBooleanArray=function(t){for(var e="",n=0;n<t.length;n++)1==t[n]?e+="1":e+="0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=!1;return e},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):void 0!==t.hex?this.setHexValueIncludingUnusedBits(t.hex):void 0!==t.bin?this.setByBinaryString(t.bin):void 0!==t.array&&this.setByBooleanArray(t.array))},Zt(ut.asn1.DERBitString,ut.asn1.ASN1Object),ut.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=ut.asn1.ASN1Util.newObject(t.obj);t.hex=e.tohex()}ut.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},Zt(ut.asn1.DEROctetString,ut.asn1.DERAbstractString),ut.asn1.DERNull=function(){ut.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},Zt(ut.asn1.DERNull,ut.asn1.ASN1Object),ut.asn1.DERObjectIdentifier=function(t){ut.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){var e=Kt(t);if(null==e)throw new Error("malformed oid string: "+t);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueName=function(t){var e=ut.asn1.x509.OID.name2oid(t);if(""===e)throw new Error("DERObjectIdentifier oidName undefined: "+t);this.setValueOidString(e)},this.setValueNameOrOid=function(t){t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(t){"string"==typeof t?this.setValueNameOrOid(t):void 0!==t.oid?this.setValueNameOrOid(t.oid):void 0!==t.name?this.setValueNameOrOid(t.name):void 0!==t.hex&&this.setValueHex(t.hex)},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.DERObjectIdentifier,ut.asn1.ASN1Object),ut.asn1.DEREnumerated=function(t){ut.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=ut.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new w(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},Zt(ut.asn1.DEREnumerated,ut.asn1.ASN1Object),ut.asn1.DERUTF8String=function(t){ut.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},Zt(ut.asn1.DERUTF8String,ut.asn1.DERAbstractString),ut.asn1.DERNumericString=function(t){ut.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},Zt(ut.asn1.DERNumericString,ut.asn1.DERAbstractString),ut.asn1.DERPrintableString=function(t){ut.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},Zt(ut.asn1.DERPrintableString,ut.asn1.DERAbstractString),ut.asn1.DERTeletexString=function(t){ut.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},Zt(ut.asn1.DERTeletexString,ut.asn1.DERAbstractString),ut.asn1.DERIA5String=function(t){ut.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},Zt(ut.asn1.DERIA5String,ut.asn1.DERAbstractString),ut.asn1.DERVisibleString=function(t){ut.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="1a"},Zt(ut.asn1.DERVisibleString,ut.asn1.DERAbstractString),ut.asn1.DERBMPString=function(t){ut.asn1.DERBMPString.superclass.constructor.call(this,t),this.hT="1e"},Zt(ut.asn1.DERBMPString,ut.asn1.DERAbstractString),ut.asn1.DERUTCTime=function(t){ut.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.params=void 0,this.getFreshValueHex=function(){var t=this.params;if(null==this.params&&(t={date:new Date}),"string"==typeof t){if(!t.match(/^[0-9]{12}Z$/)&&!t.match(/^[0-9]{12}\.[0-9]+Z$/))throw new Error("malformed string for UTCTime: "+t);this.hV=gt(t)}else if(null!=t.str)this.hV=gt(t.str);else if(null==t.date&&1==t.millis){var e=new Date;this.hV=gt(this.formatDate(e,"utc",!0))}else if(null!=t.date&&t.date instanceof Date){var n=!0===t.millis;this.hV=gt(this.formatDate(t.date,"utc",n))}else t instanceof Date&&(this.hV=gt(this.formatDate(t,"utc")));if(null==this.hV)throw new Error("parameter not specified properly for UTCTime");return this.hV},null!=t&&this.setByParam(t)},Zt(ut.asn1.DERUTCTime,ut.asn1.DERAbstractTime),ut.asn1.DERGeneralizedTime=function(t){ut.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.params=t,this.getFreshValueHex=function(){var t=this.params;if(null==this.params&&(t={date:new Date}),"string"==typeof t){if(!t.match(/^[0-9]{14}Z$/)&&!t.match(/^[0-9]{14}\.[0-9]+Z$/))throw new Error("malformed string for GeneralizedTime: "+t);this.hV=gt(t)}else if(null!=t.str)this.hV=gt(t.str);else if(null==t.date&&1==t.millis){var e=new Date;this.hV=gt(this.formatDate(e,"gen",!0))}else if(null!=t.date&&t.date instanceof Date){var n=!0===t.millis;this.hV=gt(this.formatDate(t.date,"gen",n))}else t instanceof Date&&(this.hV=gt(this.formatDate(t,"gen")));if(null==this.hV)throw new Error("parameter not specified properly for GeneralizedTime");return this.hV},null!=t&&this.setByParam(t)},Zt(ut.asn1.DERGeneralizedTime,ut.asn1.DERAbstractTime),ut.asn1.DERSequence=function(t){ut.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++){t+=this.asn1Array[e].tohex()}return this.hV=t,this.hV}},Zt(ut.asn1.DERSequence,ut.asn1.DERAbstractStructured),ut.asn1.DERSet=function(t){ut.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var n=this.asn1Array[e];t.push(n.tohex())}return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},void 0!==t&&void 0!==t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},Zt(ut.asn1.DERSet,ut.asn1.DERAbstractStructured),ut.asn1.DERTaggedObject=function(t){ut.asn1.DERTaggedObject.superclass.constructor.call(this);var e=ut.asn1,n=ht,r=n.getV,i=(n.isASN1HEX,e.ASN1Util.newObject);this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.params={tag:"a0",explicit:!0},this.setASN1Object=function(t,e,n){this.params={tag:e,explicit:t,obj:n}},this.getFreshValueHex=function(){var t=this.params;if(null==t.explicit&&(t.explicit=!0),null!=t.tage&&(t.tag=t.tage,t.explicit=!0),null!=t.tagi&&(t.tag=t.tagi,t.explicit=!1),null!=t.str)this.hV=xt(t.str);else if(null!=t.hex)this.hV=t.hex;else{if(null==t.obj)throw new Error("str, hex nor obj not specified");var n;t.obj instanceof e.ASN1Object?n=t.obj.tohex():"object"==typeof t.obj&&(n=i(t.obj).tohex()),t.explicit?this.hV=n:this.hV=r(n,0)}return null==t.tag&&(t.tag="a0"),this.hT=t.tag,this.hTLV=null,this.isModified=!0,this.hV},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.DERTaggedObject,ut.asn1.ASN1Object);var ut,ct,lt,ht=new function(){};function ft(t){for(var e=new Array,n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function pt(t){for(var e="",n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e}function dt(t){for(var e="",n=0;n<t.length;n++){var r=t[n].toString(16);1==r.length&&(r="0"+r),e+=r}return e}function gt(t){return dt(ft(t))}function mt(t){return t=(t=(t=t.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function vt(t){return t.length%4==2?t+="==":t.length%4==3&&(t+="="),t=(t=t.replace(/-/g,"+")).replace(/_/g,"/")}function yt(t){return t.length%2==1&&(t="0"+t),mt(y(t))}function bt(t){return b(vt(t))}function xt(t){return _t(Mt(t)).toLowerCase()}function wt(t){try{return decodeURIComponent(Pt(t))}catch(t){return null}}function St(t){return wt(function(t){for(var e=t.match(/.{1,2}/g),n=[],r=0;r<e.length;r++){var i=parseInt(e[r],16);161<=i&&i<=191?(n.push("c2"),n.push(e[r])):192<=i&&i<=255?(n.push("c3"),n.push((i-64).toString(16))):n.push(e[r])}return n.join("")}(t))}function Et(t){for(var e="",n=0;n<t.length-1;n+=2)e+=String.fromCharCode(parseInt(t.substr(n,2),16));return e}function Ft(t){for(var e="",n=0;n<t.length;n++)e+=("0"+t.charCodeAt(n).toString(16)).slice(-2);return e}function At(t){return y(t)}function Ct(t){var e=At(t).replace(/(.{64})/g,"$1\r\n");return e=e.replace(/\r\n$/,"")}function Dt(t){return b(t.replace(/[^0-9A-Za-z\/+=]*/g,""))}function $t(t,e){return"-----BEGIN "+e+"-----\r\n"+Ct(t)+"\r\n-----END "+e+"-----\r\n"}function It(t,e){if(-1==t.indexOf("-----BEGIN "))throw"can't find PEM header: "+e;return Dt(t=void 0!==e?(t=t.replace(new RegExp("^[^]*-----BEGIN "+e+"-----"),"")).replace(new RegExp("-----END "+e+"-----[^]*$"),""):(t=t.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function Rt(t){var e,n,r,i,s,o,a,u,c,l,h;if(h=t.match(/^(\d{2}|\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return u=h[1],e=parseInt(u),2===u.length&&(50<=e&&e<100?e=1900+e:0<=e&&e<50&&(e=2e3+e)),n=parseInt(h[2])-1,r=parseInt(h[3]),i=parseInt(h[4]),s=parseInt(h[5]),o=parseInt(h[6]),a=0,""!==(c=h[7])&&(l=(c.substr(1)+"00").substr(0,3),a=parseInt(l)),Date.UTC(e,n,r,i,s,o,a);throw new Error("unsupported zulu format: "+t)}function Tt(t){return Math.round(Rt(t)/1e3)}function _t(t){return t.replace(/%/g,"")}function Pt(t){return t.replace(/(..)/g,"%$1")}function kt(t){var e="malformed IPv6 address";if(!t.match(/^[0-9A-Fa-f:]+$/))throw e;var n=(t=t.toLowerCase()).split(":").length-1;if(n<2)throw e;var r=":".repeat(7-n+2),i=(t=t.replace("::",r)).split(":");if(8!=i.length)throw e;for(var s=0;s<8;s++)i[s]=("0000"+i[s]).slice(-4);return i.join("")}function Ot(t){if(!t.match(/^[0-9A-Fa-f]{32}$/))throw new Error("malformed IPv6 address: "+t);var e=(t=t.toLowerCase()).match(/.{1,4}/g),n=(t=":"+(e=(e=e.map((function(t){return t.replace(/^0+/,"")}))).map((function(t){return""==t?"0":t}))).join(":")+":").match(/:(0:){2,}/g);if(null==n)return t.slice(1,-1);var r=n.sort().slice(-1)[0];return"::"!=(t=t.replace(r.substr(0,r.length-1),":")).substr(0,2)&&(t=t.substr(1)),"::"!=t.substr(-2,2)&&(t=t.substr(0,t.length-1)),t}function jt(t){var e=new Error("malformed hex value");if(!t.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw e;if(8==t.length){try{return parseInt(t.substr(0,2),16)+"."+parseInt(t.substr(2,2),16)+"."+parseInt(t.substr(4,2),16)+"."+parseInt(t.substr(6,2),16)}catch(t){throw e}}else{if(16!=t.length){if(32==t.length)return Ot(t);if(64==t.length){try{return Ot(t.substr(0,32))+"/"+Bt(t.substr(32))}catch(t){throw e}return}return t}try{return jt(t.substr(0,8))+"/"+Bt(t.substr(8))}catch(t){throw e}}}function Bt(t){var e,n=new Error("malformed mask");try{e=new w(t,16).toString(2)}catch(t){throw n}if(!e.match(/^1*0*$/))throw n;return e.replace(/0+$/,"").length}function Nt(t){var e=new Error("malformed IP address");if(!(t=t.toLowerCase(t)).match(/^[0-9a-f.:/]+$/))throw e;if(!t.match(/^[0-9.]+$/)){var n;if(t.match(/^[0-9.]+\/[0-9]+$/))return Nt((n=t.split("/"))[0])+Lt(parseInt(n[1]),32);if(t.match(/^[0-9a-f:]+$/)&&-1!==t.indexOf(":"))return kt(t);if(t.match(/^[0-9a-f:]+\/[0-9]+$/)&&-1!==t.indexOf(":"))return kt((n=t.split("/"))[0])+Lt(parseInt(n[1]),128);throw e}var r=t.split(".");if(4!==r.length)throw e;var i="";try{for(var s=0;s<4;s++){i+=("0"+parseInt(r[s]).toString(16)).slice(-2)}return i}catch(t){throw e}}function Lt(t,e){return 32==e&&0==t?"00000000":128==e&&0==t?"00000000000000000000000000000000":new w(Array(t+1).join("1")+Array(e-t+1).join("0"),2).toString(16)}function Ht(t){return t.match(/.{4}/g).map((function(t){var e=parseInt(t.substr(0,2),16),n=parseInt(t.substr(2),16);if(0==e&n<128)return String.fromCharCode(n);if(e<8){var r=128|63&n;return wt((192|(7&e)<<3|(192&n)>>6).toString(16)+r.toString(16))}r=128|(15&e)<<2|(192&n)>>6;var i=128|63&n;return wt((224|(240&e)>>4).toString(16)+r.toString(16)+i.toString(16))})).join("")}function Mt(t){for(var e=encodeURIComponent(t),n="",r=0;r<e.length;r++)"%"==e[r]?(n+=e.substr(r,3),r+=2):n=n+"%"+gt(e[r]);return n}function Ut(t){return!(t.length%2!=0||!t.match(/^[0-9a-f]+$/)&&!t.match(/^[0-9A-F]+$/))}function Vt(t){return!!t.match(/^[0-9A-Za-z-_.]+$/)}function qt(t){return t.length%2==1?"0"+t:t.substr(0,1)>"7"?"00"+t:t}ht.getLblen=function(t,e){if("8"!=t.substr(e+2,1))return 1;var n=parseInt(t.substr(e+3,1));return 0==n?-1:0<n&&n<10?n+1:-2},ht.getL=function(t,e){var n=ht.getLblen(t,e);return n<1?"":t.substr(e+2,2*n)},ht.getVblen=function(t,e){var n;return""==(n=ht.getL(t,e))?-1:("8"===n.substr(0,1)?new w(n.substr(2),16):new w(n,16)).intValue()},ht.getVidx=function(t,e){var n=ht.getLblen(t,e);return n<0?n:e+2*(n+1)},ht.getV=function(t,e){var n=ht.getVidx(t,e),r=ht.getVblen(t,e);return t.substr(n,2*r)},ht.getTLV=function(t,e){return t.substr(e,2)+ht.getL(t,e)+ht.getV(t,e)},ht.getTLVblen=function(t,e){return 2+2*ht.getLblen(t,e)+2*ht.getVblen(t,e)},ht.getNextSiblingIdx=function(t,e){return ht.getVidx(t,e)+2*ht.getVblen(t,e)},ht.getChildIdx=function(t,e){var n,r,i,s=ht,o=[];n=s.getVidx(t,e),r=2*s.getVblen(t,e),"03"==t.substr(e,2)&&(n+=2,r-=2),i=0;for(var a=n;i<=r;){var u=s.getTLVblen(t,a);if((i+=u)<=r&&o.push(a),a+=u,i>=r)break}return o},ht.getNthChildIdx=function(t,e,n){return ht.getChildIdx(t,e)[n]},ht.getIdxbyList=function(t,e,n,r){var i,s,o=ht;return 0==n.length?void 0!==r&&t.substr(e,2)!==r?-1:e:(i=n.shift())>=(s=o.getChildIdx(t,e)).length?-1:o.getIdxbyList(t,s[i],n,r)},ht.getIdxbyListEx=function(t,e,n,r){var i,s,o=ht;if(0==n.length)return void 0!==r&&t.substr(e,2)!==r?-1:e;i=n.shift(),s=o.getChildIdx(t,e);for(var a=0,u=0;u<s.length;u++){var c=t.substr(s[u],2);if("number"==typeof i&&!o.isContextTag(c)&&a==i||"string"==typeof i&&o.isContextTag(c,i))return o.getIdxbyListEx(t,s[u],n,r);o.isContextTag(c)||a++}return-1},ht.getTLVbyList=function(t,e,n,r){var i=ht,s=i.getIdxbyList(t,e,n,r);return-1==s||s>=t.length?null:i.getTLV(t,s)},ht.getTLVbyListEx=function(t,e,n,r){var i=ht,s=i.getIdxbyListEx(t,e,n,r);return-1==s?null:i.getTLV(t,s)},ht.getVbyList=function(t,e,n,r,i){var s,o,a=ht;return-1==(s=a.getIdxbyList(t,e,n,r))||s>=t.length?null:(o=a.getV(t,s),!0===i&&(o=o.substr(2)),o)},ht.getVbyListEx=function(t,e,n,r,i){var s,o,a=ht;return-1==(s=a.getIdxbyListEx(t,e,n,r))?null:(o=a.getV(t,s),"03"==t.substr(s,2)&&!1!==i&&(o=o.substr(2)),o)},ht.getInt=function(t,e,n){null==n&&(n=-1);try{var r=t.substr(e,2);if("02"!=r&&"03"!=r)return n;var i=ht.getV(t,e);return"02"==r?parseInt(i,16):Wt(i)}catch(t){return n}},ht.getOID=function(t,e,n){null==n&&(n=null);try{return"06"!=t.substr(e,2)?n:zt(ht.getV(t,e))}catch(t){return n}},ht.getOIDName=function(t,e,n){null==n&&(n=null);try{var r=ht.getOID(t,e,n);if(r==n)return n;var i=ut.asn1.x509.OID.oid2name(r);return""==i?r:i}catch(t){return n}},ht.getString=function(t,e,n){null==n&&(n=null);try{return Et(ht.getV(t,e))}catch(t){return n}},ht.hextooidstr=function(t){var e=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},n=[],r=t.substr(0,2),i=parseInt(r,16);n[0]=new String(Math.floor(i/40)),n[1]=new String(i%40);for(var s=t.substr(2),o=[],a=0;a<s.length/2;a++)o.push(parseInt(s.substr(2*a,2),16));var u=[],c="";for(a=0;a<o.length;a++)128&o[a]?c+=e((127&o[a]).toString(2),7):(c+=e((127&o[a]).toString(2),7),u.push(new String(parseInt(c,2))),c="");var l=n.join(".");return u.length>0&&(l=l+"."+u.join(".")),l},ht.dump=function(t,e,n,r){var i=ht,s=i.getV,o=i.dump,a=i.getChildIdx,u=t;t instanceof ut.asn1.ASN1Object&&(u=t.tohex());var c=function(t,e){return t.length<=2*e?t:t.substr(0,e)+"..(total "+t.length/2+"bytes).."+t.substr(t.length-e,e)};void 0===e&&(e={ommit_long_octet:32}),void 0===n&&(n=0),void 0===r&&(r="");var l,h=e.ommit_long_octet;if("01"==(l=u.substr(n,2)))return"00"==(f=s(u,n))?r+"BOOLEAN FALSE\n":r+"BOOLEAN TRUE\n";if("02"==l)return r+"INTEGER "+c(f=s(u,n),h)+"\n";if("03"==l){var f=s(u,n);if(i.isASN1HEX(f.substr(2))){var p=r+"BITSTRING, encapsulates\n";return p+=o(f.substr(2),e,0,r+" ")}return r+"BITSTRING "+c(f,h)+"\n"}if("04"==l){f=s(u,n);if(i.isASN1HEX(f)){p=r+"OCTETSTRING, encapsulates\n";return p+=o(f,e,0,r+" ")}return r+"OCTETSTRING "+c(f,h)+"\n"}if("05"==l)return r+"NULL\n";if("06"==l){var d=s(u,n),g=ut.asn1.ASN1Util.oidHexToInt(d),m=ut.asn1.x509.OID.oid2name(g),v=g.replace(/\./g," ");return""!=m?r+"ObjectIdentifier "+m+" ("+v+")\n":r+"ObjectIdentifier ("+v+")\n"}if("0a"==l)return r+"ENUMERATED "+parseInt(s(u,n))+"\n";if("0c"==l)return r+"UTF8String '"+wt(s(u,n))+"'\n";if("13"==l)return r+"PrintableString '"+wt(s(u,n))+"'\n";if("14"==l)return r+"TeletexString '"+wt(s(u,n))+"'\n";if("16"==l)return r+"IA5String '"+wt(s(u,n))+"'\n";if("17"==l)return r+"UTCTime "+wt(s(u,n))+"\n";if("18"==l)return r+"GeneralizedTime "+wt(s(u,n))+"\n";if("1a"==l)return r+"VisualString '"+wt(s(u,n))+"'\n";if("1e"==l)return r+"BMPString '"+Ht(s(u,n))+"'\n";if("30"==l){if("3000"==u.substr(n,4))return r+"SEQUENCE {}\n";p=r+"SEQUENCE\n";var y=e;if((2==(w=a(u,n)).length||3==w.length)&&"06"==u.substr(w[0],2)&&"04"==u.substr(w[w.length-1],2)){m=i.oidname(s(u,w[0]));var b=JSON.parse(JSON.stringify(e));b.x509ExtName=m,y=b}for(var x=0;x<w.length;x++)p+=o(u,y,w[x],r+" ");return p}if("31"==l){p=r+"SET\n";var w=a(u,n);for(x=0;x<w.length;x++)p+=o(u,e,w[x],r+" ");return p}if(0!=(128&(l=parseInt(l,16)))){var S=31&l;if(0!=(32&l)){for(p=r+"["+S+"]\n",w=a(u,n),x=0;x<w.length;x++)p+=o(u,e,w[x],r+" ");return p}f=s(u,n);if(ht.isASN1HEX(f)){var p=r+"["+S+"]\n";return p+=o(f,e,0,r+" ")}return("68747470"==f.substr(0,8)||"subjectAltName"===e.x509ExtName&&2==S)&&(f=wt(f)),p=r+"["+S+"] "+f+"\n"}return r+"UNKNOWN("+l+") "+s(u,n)+"\n"},ht.parse=function(t){var e=ht,n=e.parse,r=e.isASN1HEX,i=e.getV,s=e.getTLV,o=e.getChildIdx,a=ut.asn1,u=a.ASN1Util.oidHexToInt,c=a.x509.OID.oid2name,l=wt,h=Ht,f=St,p={"0c":"utf8str",12:"numstr",13:"prnstr",14:"telstr",16:"ia5str",17:"utctime",18:"gentime","1a":"visstr","1e":"bmpstr",30:"seq",31:"set"},d=t.substr(0,2),g={},m=i(t,0);if("01"==d)return"0101ff"==t?{bool:!0}:{bool:!1};if("02"==d)return{int:{hex:m}};if("03"==d)try{if("00"!=m.substr(0,2))throw"not encap";var v=m.substr(2);if(!r(v))throw"not encap";return{bitstr:{obj:n(v)}}}catch(t){var y=null;return m.length<=10&&(y=Xt(m)),null==y?{bitstr:{hex:m}}:{bitstr:{bin:y}}}else if("04"==d)try{if(!r(m))throw"not encap";return{octstr:{obj:n(m)}}}catch(t){return{octstr:{hex:m}}}else{if("05"==d)return{null:""};if("06"==d){var b=u(m),x=c(b);return""==x?{oid:b}:{oid:x}}if("0a"==d)return m.length>4?{enum:{hex:m}}:{enum:parseInt(m,16)};if("30"==d||"31"==d)return g[p[d]]=function(t){for(var e=[],r=o(t,0),i=0;i<r.length;i++){var a=r[i],u=s(t,a),c=n(u);e.push(c)}return e}(t),g;if("14"==d){var w=f(m);return g[p[d]]={str:w},g}if("1e"==d){w=h(m);return g[p[d]]={str:w},g}if(-1!=":0c:12:13:16:17:18:1a:".indexOf(d)){w=l(m);return g[p[d]]={str:w},g}if(d.match(/^8[0-9]$/))return null==(w=l(m))|""==w||null!=w.match(/[\x00-\x1F\x7F-\x9F]/)||null!=w.match(/[\u0000-\u001F\u0080–\u009F]/)?{tag:{tag:d,explicit:!1,hex:m}}:{tag:{tag:d,explicit:!1,str:w}};if(!d.match(/^a[0-9]$/)){var S=new ut.asn1.ASN1Object;return S.hV=m,{asn1:{tlv:d+S.getLengthHexFromValue()+m}}}try{if(!r(m))throw new Error("not encap");return{tag:{tag:d,explicit:!0,obj:n(m)}}}catch(t){return{tag:{tag:d,explicit:!0,hex:m}}}}},ht.isContextTag=function(t,e){var n,r;t=t.toLowerCase();try{n=parseInt(t,16)}catch(t){return-1}if(void 0===e)return 128==(192&n);try{return null!=e.match(/^\[[0-9]+\]$/)&&(!((r=parseInt(e.substr(1,e.length-1),10))>31)&&(128==(192&n)&&(31&n)==r))}catch(t){return!1}},ht.isASN1HEX=function(t){var e=ht;if(t.length%2==1)return!1;var n=e.getVblen(t,0),r=t.substr(0,2),i=e.getL(t,0);return t.length-r.length-i.length==2*n},ht.checkStrictDER=function(t,e,n,r,i){var s=ht;if(void 0===n){if("string"!=typeof t)throw new Error("not hex string");if(t=t.toLowerCase(),!ut.lang.String.isHex(t))throw new Error("not hex string");n=t.length,i=(r=t.length/2)<128?1:Math.ceil(r.toString(16))+1}if(s.getL(t,e).length>2*i)throw new Error("L of TLV too long: idx="+e);var o=s.getVblen(t,e);if(o>r)throw new Error("value of L too long than hex: idx="+e);var a=s.getTLV(t,e),u=a.length-2-s.getL(t,e).length;if(u!==2*o)throw new Error("V string length and L's value not the same:"+u+"/"+2*o);if(0===e&&t.length!=a.length)throw new Error("total length and TLV length unmatch:"+t.length+"!="+a.length);var c=t.substr(e,2);if("02"===c){var l=s.getVidx(t,e);if("00"==t.substr(l,2)&&t.charCodeAt(l+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(c,16)){for(var h=s.getVblen(t,e),f=0,p=s.getChildIdx(t,e),d=0;d<p.length;d++){f+=s.getTLV(t,p[d]).length,s.checkStrictDER(t,p[d],n,r,i)}if(2*h!=f)throw new Error("sum of children's TLV length and L unmatch: "+2*h+"!="+f)}},ht.oidname=function(t){var e=ut.asn1;ut.lang.String.isHex(t)&&(t=e.ASN1Util.oidHexToInt(t));var n=e.x509.OID.oid2name(t);return""===n&&(n=t),n},void 0!==ut&&ut||(ut={}),void 0!==ut.asn1&&ut.asn1||(ut.asn1={}),void 0!==ut.asn1.x509&&ut.asn1.x509||(ut.asn1.x509={}),ut.asn1.x509.Certificate=function(t){ut.asn1.x509.Certificate.superclass.constructor.call(this);var e=ut.asn1,n=e.DERBitString,r=e.DERSequence,i=e.x509,s=i.TBSCertificate,o=i.AlgorithmIdentifier;this.params=void 0,this.setByParam=function(t){this.params=t},this.sign=function(){var t=this.params,e=t.sigalg;null!=t.sigalg.name&&(e=t.sigalg.name);var n=t.tbsobj.tohex(),r=new ut.crypto.Signature({alg:e});r.init(t.cakey),r.updateHex(n),t.sighex=r.sign()},this.getPEM=function(){return $t(this.tohex(),"CERTIFICATE")},this.tohex=function(){var t=this.params;if(null!=t.tbsobj&&null!=t.tbsobj||(t.tbsobj=new s(t)),null==t.sighex&&null!=t.cakey&&this.sign(),null==t.sighex)throw new Error("sighex or cakey parameter not defined");var e=[];return e.push(t.tbsobj),e.push(new o({name:t.sigalg})),e.push(new n({hex:"00"+t.sighex})),new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&(this.params=t)},Zt(ut.asn1.x509.Certificate,ut.asn1.ASN1Object),ut.asn1.x509.TBSCertificate=function(t){ut.asn1.x509.TBSCertificate.superclass.constructor.call(this);var e=ut.asn1,n=e.x509,r=e.DERTaggedObject,i=e.DERInteger,s=e.DERSequence,o=n.AlgorithmIdentifier,a=n.Time,u=n.X500Name,c=n.Extensions,l=n.SubjectPublicKeyInfo;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=[],e=this.params;if(null!=e.version||1!=e.version){var n=2;null!=e.version&&(n=e.version-1);var h=new r({obj:new i({int:n})});t.push(h)}return t.push(new i(e.serial)),t.push(new o({name:e.sigalg})),t.push(new u(e.issuer)),t.push(new s({array:[new a(e.notbefore),new a(e.notafter)]})),t.push(new u(e.subject)),t.push(new l(Qt.getKey(e.sbjpubkey))),void 0!==e.ext&&e.ext.length>0&&t.push(new r({tag:"a3",obj:new c(e.ext)})),new ut.asn1.DERSequence({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.TBSCertificate,ut.asn1.ASN1Object),ut.asn1.x509.Extensions=function(t){ut.asn1.x509.Extensions.superclass.constructor.call(this);var e=ut.asn1,n=e.DERSequence,r=e.x509;this.aParam=[],this.setByParam=function(t){this.aParam=t},this.tohex=function(){for(var t=[],e=0;e<this.aParam.length;e++){var i=this.aParam[e],s=i.extname,o=null;if(null!=i.extn)o=new r.PrivateExtension(i);else if("subjectKeyIdentifier"==s)o=new r.SubjectKeyIdentifier(i);else if("keyUsage"==s)o=new r.KeyUsage(i);else if("subjectAltName"==s)o=new r.SubjectAltName(i);else if("issuerAltName"==s)o=new r.IssuerAltName(i);else if("basicConstraints"==s)o=new r.BasicConstraints(i);else if("nameConstraints"==s)o=new r.NameConstraints(i);else if("cRLDistributionPoints"==s)o=new r.CRLDistributionPoints(i);else if("certificatePolicies"==s)o=new r.CertificatePolicies(i);else if("authorityKeyIdentifier"==s)o=new r.AuthorityKeyIdentifier(i);else if("extKeyUsage"==s)o=new r.ExtKeyUsage(i);else if("authorityInfoAccess"==s)o=new r.AuthorityInfoAccess(i);else if("cRLNumber"==s)o=new r.CRLNumber(i);else if("cRLReason"==s)o=new r.CRLReason(i);else if("ocspNonce"==s)o=new r.OCSPNonce(i);else if("ocspNoCheck"==s)o=new r.OCSPNoCheck(i);else if("adobeTimeStamp"==s)o=new r.AdobeTimeStamp(i);else{if("subjectDirectoryAttributes"!=s)throw new Error("extension not supported:"+JSON.stringify(i));o=new r.SubjectDirectoryAttributes(i)}null!=o&&t.push(o)}return new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.x509.Extensions,ut.asn1.ASN1Object),ut.asn1.x509.Extension=function(t){ut.asn1.x509.Extension.superclass.constructor.call(this);var e=ut.asn1,n=e.DERObjectIdentifier,r=e.DEROctetString,i=(e.DERBitString,e.DERBoolean),s=e.DERSequence;this.tohex=function(){var t=new n({oid:this.oid}),e=new r({hex:this.getExtnValueHex()}),o=new Array;return o.push(t),this.critical&&o.push(new i),o.push(e),new s({array:o}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.critical=!1,void 0!==t&&void 0!==t.critical&&(this.critical=t.critical)},Zt(ut.asn1.x509.Extension,ut.asn1.ASN1Object),ut.asn1.x509.KeyUsage=function(t){ut.asn1.x509.KeyUsage.superclass.constructor.call(this,t);var e=Error,n={digitalSignature:0,nonRepudiation:1,keyEncipherment:2,dataEncipherment:3,keyAgreement:4,keyCertSign:5,cRLSign:6,encipherOnly:7,decipherOnly:8};this.getExtnValueHex=function(){var t=this.getBinValue();return this.asn1ExtnValue=new ut.asn1.DERBitString({bin:t}),this.asn1ExtnValue.tohex()},this.getBinValue=function(){var t=this.params;if("object"!=typeof t||"object"!=typeof t.names&&"string"!=typeof t.bin)throw new e("parameter not yet set");if(null!=t.names)return Jt(t.names,n);if(null!=t.bin)return t.bin;throw new e("parameter not set properly")},this.oid="2.5.29.15",void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.KeyUsage,ut.asn1.x509.Extension),ut.asn1.x509.BasicConstraints=function(t){ut.asn1.x509.BasicConstraints.superclass.constructor.call(this,t);var e=ut.asn1,n=e.DERBoolean,r=e.DERInteger,i=e.DERSequence;this.getExtnValueHex=function(){var t=new Array;this.cA&&t.push(new n),this.pathLen>-1&&t.push(new r({int:this.pathLen}));var e=new i({array:t});return this.asn1ExtnValue=e,this.asn1ExtnValue.tohex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,void 0!==t&&(void 0!==t.cA&&(this.cA=t.cA),void 0!==t.pathLen&&(this.pathLen=t.pathLen))},Zt(ut.asn1.x509.BasicConstraints,ut.asn1.x509.Extension),ut.asn1.x509.CRLDistributionPoints=function(t){ut.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,t);var e=ut.asn1,n=e.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.setByDPArray=function(t){for(var r=[],i=0;i<t.length;i++)if(t[i]instanceof ut.asn1.ASN1Object)r.push(t[i]);else{var s=new n.DistributionPoint(t[i]);r.push(s)}this.asn1ExtnValue=new e.DERSequence({array:r})},this.setByOneURI=function(t){var e=new n.DistributionPoint({fulluri:t});this.setByDPArray([e])},this.oid="2.5.29.31",void 0!==t&&(void 0!==t.array?this.setByDPArray(t.array):void 0!==t.uri&&this.setByOneURI(t.uri))},Zt(ut.asn1.x509.CRLDistributionPoints,ut.asn1.x509.Extension),ut.asn1.x509.DistributionPoint=function(t){ut.asn1.x509.DistributionPoint.superclass.constructor.call(this);var e=ut.asn1,n=e.x509.DistributionPointName;this.tohex=function(){var t=new e.DERSequence;if(null!=this.asn1DP){var n=new e.DERTaggedObject({explicit:!0,tag:"a0",obj:this.asn1DP});t.appendASN1Object(n)}return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(void 0!==t.dpobj?this.asn1DP=t.dpobj:void 0!==t.dpname?this.asn1DP=new n(t.dpname):void 0!==t.fulluri&&(this.asn1DP=new n({full:[{uri:t.fulluri}]})))},Zt(ut.asn1.x509.DistributionPoint,ut.asn1.ASN1Object),ut.asn1.x509.DistributionPointName=function(t){ut.asn1.x509.DistributionPointName.superclass.constructor.call(this);var e=ut.asn1,n=e.DERTaggedObject;if(this.tohex=function(){if("full"!=this.type)throw new Error("currently type shall be 'full': "+this.type);return this.asn1Obj=new n({explicit:!1,tag:this.tag,obj:this.asn1V}),this.hTLV=this.asn1Obj.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t)if(e.x509.GeneralNames.prototype.isPrototypeOf(t))this.type="full",this.tag="a0",this.asn1V=t;else{if(void 0===t.full)throw new Error("This class supports GeneralNames only as argument");this.type="full",this.tag="a0",this.asn1V=new e.x509.GeneralNames(t.full)}},Zt(ut.asn1.x509.DistributionPointName,ut.asn1.ASN1Object),ut.asn1.x509.CertificatePolicies=function(t){ut.asn1.x509.CertificatePolicies.superclass.constructor.call(this,t);var e=ut.asn1,n=e.x509,r=e.DERSequence,i=n.PolicyInformation;this.params=null,this.getExtnValueHex=function(){for(var t=[],e=0;e<this.params.array.length;e++)t.push(new i(this.params.array[e]));var n=new r({array:t});return this.asn1ExtnValue=n,this.asn1ExtnValue.tohex()},this.oid="2.5.29.32",void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.CertificatePolicies,ut.asn1.x509.Extension),ut.asn1.x509.PolicyInformation=function(t){ut.asn1.x509.PolicyInformation.superclass.constructor.call(this,t);var e=ut.asn1,n=e.DERSequence,r=e.DERObjectIdentifier,i=e.x509.PolicyQualifierInfo;this.params=null,this.tohex=function(){if(void 0===this.params.policyoid&&void 0===this.params.array)throw new Error("parameter oid and array missing");var t=[new r(this.params.policyoid)];if(void 0!==this.params.array){for(var e=[],s=0;s<this.params.array.length;s++)e.push(new i(this.params.array[s]));e.length>0&&t.push(new n({array:e}))}return new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.PolicyInformation,ut.asn1.ASN1Object),ut.asn1.x509.PolicyQualifierInfo=function(t){ut.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,t);var e=ut.asn1,n=e.DERSequence,r=e.DERIA5String,i=e.DERObjectIdentifier,s=e.x509.UserNotice;this.params=null,this.tohex=function(){return void 0!==this.params.cps?new n({array:[new i({oid:"1.3.6.1.5.5.7.2.1"}),new r({str:this.params.cps})]}).tohex():null!=this.params.unotice?new n({array:[new i({oid:"1.3.6.1.5.5.7.2.2"}),new s(this.params.unotice)]}).tohex():void 0},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.PolicyQualifierInfo,ut.asn1.ASN1Object),ut.asn1.x509.UserNotice=function(t){ut.asn1.x509.UserNotice.superclass.constructor.call(this,t);var e=ut.asn1.DERSequence,n=(ut.asn1.DERInteger,ut.asn1.x509.DisplayText),r=ut.asn1.x509.NoticeReference;this.params=null,this.tohex=function(){var t=[];return void 0!==this.params.noticeref&&t.push(new r(this.params.noticeref)),void 0!==this.params.exptext&&t.push(new n(this.params.exptext)),new e({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.UserNotice,ut.asn1.ASN1Object),ut.asn1.x509.NoticeReference=function(t){ut.asn1.x509.NoticeReference.superclass.constructor.call(this,t);var e=ut.asn1.DERSequence,n=ut.asn1.DERInteger,r=ut.asn1.x509.DisplayText;this.params=null,this.tohex=function(){var t=[];if(void 0!==this.params.org&&t.push(new r(this.params.org)),void 0!==this.params.noticenum){for(var i=[],s=this.params.noticenum,o=0;o<s.length;o++)i.push(new n(s[o]));t.push(new e({array:i}))}if(0==t.length)throw new Error("parameter is empty");return new e({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.NoticeReference,ut.asn1.ASN1Object),ut.asn1.x509.DisplayText=function(t){ut.asn1.x509.DisplayText.superclass.constructor.call(this,t),this.hT="0c",void 0!==t&&("ia5"===t.type?this.hT="16":"vis"===t.type?this.hT="1a":"bmp"===t.type&&(this.hT="1e"))},Zt(ut.asn1.x509.DisplayText,ut.asn1.DERAbstractString),ut.asn1.x509.NameConstraints=function(t){ut.asn1.x509.NameConstraints.superclass.constructor.call(this,t);var e=ut.asn1,n=e.x509,r=e.ASN1Util.newObject,i=n.GeneralSubtree;this.params=null,this.getExtnValueHex=function(){var t=this.params,e=[];if(null!=t.permit&&null!=t.permit.length){for(var n=[],s=0;s<t.permit.length;s++)n.push(new i(t.permit[s]));e.push({tag:{tagi:"a0",obj:{seq:n}}})}if(null!=t.exclude&&null!=t.exclude.length){var o=[];for(s=0;s<t.exclude.length;s++)o.push(new i(t.exclude[s]));e.push({tag:{tagi:"a1",obj:{seq:o}}})}return this.asn1ExtnValue=r({seq:e}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.30",void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.NameConstraints,ut.asn1.x509.Extension),ut.asn1.x509.GeneralSubtree=function(t){ut.asn1.x509.GeneralSubtree.superclass.constructor.call(this);var e=ut.asn1,n=e.x509.GeneralName,r=e.ASN1Util.newObject;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params,e=[new n(t)];return null!=t.min&&e.push({tag:{tagi:"80",obj:{int:t.min}}}),null!=t.max&&e.push({tag:{tagi:"81",obj:{int:t.max}}}),r({seq:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.GeneralSubtree,ut.asn1.ASN1Object),ut.asn1.x509.ExtKeyUsage=function(t){ut.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,t);var e=ut.asn1;this.setPurposeArray=function(t){this.asn1ExtnValue=new e.DERSequence;for(var n=0;n<t.length;n++){var r=new e.DERObjectIdentifier(t[n]);this.asn1ExtnValue.appendASN1Object(r)}},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.37",void 0!==t&&void 0!==t.array&&this.setPurposeArray(t.array)},Zt(ut.asn1.x509.ExtKeyUsage,ut.asn1.x509.Extension),ut.asn1.x509.AuthorityKeyIdentifier=function(t){ut.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,t);var e=ut,n=e.asn1,r=n.DERTaggedObject,i=n.x509.GeneralNames;e.crypto.Util.isKey;this.asn1KID=null,this.asn1CertIssuer=null,this.asn1CertSN=null,this.getExtnValueHex=function(){var t=new Array;this.asn1KID&&t.push(new r({explicit:!1,tag:"80",obj:this.asn1KID})),this.asn1CertIssuer&&t.push(new r({explicit:!1,tag:"a1",obj:new i([{dn:this.asn1CertIssuer}])})),this.asn1CertSN&&t.push(new r({explicit:!1,tag:"82",obj:this.asn1CertSN}));var e=new n.DERSequence({array:t});return this.asn1ExtnValue=e,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(t){if(void 0!==t.str||void 0!==t.hex)this.asn1KID=new ut.asn1.DEROctetString(t);else if("object"==typeof t&&ut.crypto.Util.isKey(t)||"string"==typeof t&&-1!=t.indexOf("BEGIN ")){var e=t;"string"==typeof t&&(e=Qt.getKey(t));var n=Qt.getKeyID(e);this.asn1KID=new ut.asn1.DEROctetString({hex:n})}},this.setCertIssuerByParam=function(t){void 0!==t.str||void 0!==t.ldapstr||void 0!==t.hex||void 0!==t.certsubject||void 0!==t.certissuer?this.asn1CertIssuer=new ut.asn1.x509.X500Name(t):"string"==typeof t&&-1!=t.indexOf("BEGIN ")&&-1!=t.indexOf("CERTIFICATE")&&(this.asn1CertIssuer=new ut.asn1.x509.X500Name({certissuer:t}))},this.setCertSNByParam=function(t){if(void 0!==t.str||void 0!==t.bigint||void 0!==t.hex)this.asn1CertSN=new ut.asn1.DERInteger(t);else if("string"==typeof t&&-1!=t.indexOf("BEGIN ")&&t.indexOf("CERTIFICATE")){var e=new re;e.readCertPEM(t);var n=e.getSerialNumberHex();this.asn1CertSN=new ut.asn1.DERInteger({hex:n})}},this.oid="2.5.29.35",void 0!==t&&(void 0!==t.kid&&this.setKIDByParam(t.kid),void 0!==t.issuer&&this.setCertIssuerByParam(t.issuer),void 0!==t.sn&&this.setCertSNByParam(t.sn),void 0!==t.issuersn&&"string"==typeof t.issuersn&&-1!=t.issuersn.indexOf("BEGIN ")&&t.issuersn.indexOf("CERTIFICATE")&&(this.setCertSNByParam(t.issuersn),this.setCertIssuerByParam(t.issuersn)))},Zt(ut.asn1.x509.AuthorityKeyIdentifier,ut.asn1.x509.Extension),ut.asn1.x509.SubjectKeyIdentifier=function(t){ut.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this,t);var e=ut.asn1.DEROctetString;this.asn1KID=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=this.asn1KID,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(t){if(void 0!==t.str||void 0!==t.hex)this.asn1KID=new e(t);else if("object"==typeof t&&ut.crypto.Util.isKey(t)||"string"==typeof t&&-1!=t.indexOf("BEGIN")){var n=t;"string"==typeof t&&(n=Qt.getKey(t));var r=Qt.getKeyID(n);this.asn1KID=new ut.asn1.DEROctetString({hex:r})}},this.oid="2.5.29.14",void 0!==t&&void 0!==t.kid&&this.setKIDByParam(t.kid)},Zt(ut.asn1.x509.SubjectKeyIdentifier,ut.asn1.x509.Extension),ut.asn1.x509.AuthorityInfoAccess=function(t){ut.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,t),this.setAccessDescriptionArray=function(t){for(var e=new Array,n=ut.asn1,r=n.DERSequence,i=n.DERObjectIdentifier,s=n.x509.GeneralName,o=0;o<t.length;o++){var a,u=t[o];if(void 0!==u.ocsp)a=new r({array:[new i({oid:"1.3.6.1.5.5.7.48.1"}),new s({uri:u.ocsp})]});else{if(void 0===u.caissuer)throw new Error("unknown AccessMethod parameter: "+JSON.stringify(u));a=new r({array:[new i({oid:"1.3.6.1.5.5.7.48.2"}),new s({uri:u.caissuer})]})}e.push(a)}this.asn1ExtnValue=new r({array:e})},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.1.1",void 0!==t&&void 0!==t.array&&this.setAccessDescriptionArray(t.array)},Zt(ut.asn1.x509.AuthorityInfoAccess,ut.asn1.x509.Extension),ut.asn1.x509.SubjectAltName=function(t){ut.asn1.x509.SubjectAltName.superclass.constructor.call(this,t),this.setNameArray=function(t){this.asn1ExtnValue=new ut.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.17",void 0!==t&&void 0!==t.array&&this.setNameArray(t.array)},Zt(ut.asn1.x509.SubjectAltName,ut.asn1.x509.Extension),ut.asn1.x509.IssuerAltName=function(t){ut.asn1.x509.IssuerAltName.superclass.constructor.call(this,t),this.setNameArray=function(t){this.asn1ExtnValue=new ut.asn1.x509.GeneralNames(t)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.18",void 0!==t&&void 0!==t.array&&this.setNameArray(t.array)},Zt(ut.asn1.x509.IssuerAltName,ut.asn1.x509.Extension),ut.asn1.x509.SubjectDirectoryAttributes=function(t){ut.asn1.x509.SubjectDirectoryAttributes.superclass.constructor.call(this,t);var e=ut.asn1,n=e.DERSequence,r=e.ASN1Util.newObject,i=e.x509.OID.name2oid;this.params=null,this.getExtnValueHex=function(){for(var t=[],e=0;e<this.params.array.length;e++){var s=this.params.array[e],o={seq:[{oid:"1.2.3.4"},{set:[{utf8str:"DE"}]}]};if("dateOfBirth"==s.attr)o.seq[0].oid=i(s.attr),o.seq[1].set[0]={gentime:s.str};else if("placeOfBirth"==s.attr)o.seq[0].oid=i(s.attr),o.seq[1].set[0]={utf8str:s.str};else if("gender"==s.attr)o.seq[0].oid=i(s.attr),o.seq[1].set[0]={prnstr:s.str};else if("countryOfCitizenship"==s.attr)o.seq[0].oid=i(s.attr),o.seq[1].set[0]={prnstr:s.str};else{if("countryOfResidence"!=s.attr)throw new Error("unsupported attribute: "+s.attr);o.seq[0].oid=i(s.attr),o.seq[1].set[0]={prnstr:s.str}}t.push(new r(o))}var a=new n({array:t});return this.asn1ExtnValue=a,this.asn1ExtnValue.tohex()},this.oid="2.5.29.9",void 0!==t&&(this.params=t)},Zt(ut.asn1.x509.SubjectDirectoryAttributes,ut.asn1.x509.Extension),ut.asn1.x509.PrivateExtension=function(t){ut.asn1.x509.PrivateExtension.superclass.constructor.call(this,t);var e=ut,n=e.lang.String.isHex,r=e.asn1,i=r.x509.OID.name2oid,s=r.ASN1Util.newObject;this.params=null,this.setByParam=function(t){this.oid=i(t.extname),this.params=t},this.getExtnValueHex=function(){if(null==this.params.extname||null==this.params.extn)throw new Error("extname or extnhex not specified");var t=this.params.extn;if("string"==typeof t&&n(t))return t;if("object"==typeof t)try{return s(t).tohex()}catch(t){}throw new Error("unsupported extn value")},null!=t&&this.setByParam(t)},Zt(ut.asn1.x509.PrivateExtension,ut.asn1.x509.Extension),ut.asn1.x509.CRL=function(t){ut.asn1.x509.CRL.superclass.constructor.call(this);var e=ut.asn1,n=e.DERSequence,r=e.DERBitString,i=e.x509,s=i.AlgorithmIdentifier,o=i.TBSCertList;this.params=void 0,this.setByParam=function(t){this.params=t},this.sign=function(){var t=new o(this.params).tohex(),e=new ut.crypto.Signature({alg:this.params.sigalg});e.init(this.params.cakey),e.updateHex(t);var n=e.sign();this.params.sighex=n},this.getPEM=function(){return $t(this.tohex(),"X509 CRL")},this.tohex=function(){var t=this.params;if(null==t.tbsobj&&(t.tbsobj=new o(t)),null==t.sighex&&null!=t.cakey&&this.sign(),null==t.sighex)throw new Error("sighex or cakey parameter not defined");var e=[];return e.push(t.tbsobj),e.push(new s({name:t.sigalg})),e.push(new r({hex:"00"+t.sighex})),new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&(this.params=t)},Zt(ut.asn1.x509.CRL,ut.asn1.ASN1Object),ut.asn1.x509.TBSCertList=function(t){ut.asn1.x509.TBSCertList.superclass.constructor.call(this);var e=ut.asn1,n=e.DERInteger,r=e.DERSequence,i=e.DERTaggedObject,s=(e.DERObjectIdentifier,e.x509),o=s.AlgorithmIdentifier,a=s.Time,u=s.Extensions,c=s.X500Name;this.params=null,this.setByParam=function(t){this.params=t},this.getRevCertSequence=function(){for(var t=[],e=this.params.revcert,i=0;i<e.length;i++){var s=[new n(e[i].sn),new a(e[i].date)];null!=e[i].ext&&s.push(new u(e[i].ext)),t.push(new r({array:s}))}return new r({array:t})},this.tohex=function(){var t=[],e=this.params;if(null!=e.version){var s=e.version-1,l=new n({int:s});t.push(l)}if(t.push(new o({name:e.sigalg})),t.push(new c(e.issuer)),t.push(new a(e.thisupdate)),null!=e.nextupdate&&t.push(new a(e.nextupdate)),null!=e.revcert&&t.push(this.getRevCertSequence()),null!=e.ext){var h=new u(e.ext);t.push(new i({tag:"a0",explicit:!0,obj:h}))}return new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.TBSCertList,ut.asn1.ASN1Object),ut.asn1.x509.CRLEntry=function(t){ut.asn1.x509.CRLEntry.superclass.constructor.call(this);var e=ut.asn1;this.setCertSerial=function(t){this.sn=new e.DERInteger(t)},this.setRevocationDate=function(t){this.time=new e.x509.Time(t)},this.tohex=function(){var t=new e.DERSequence({array:[this.sn,this.time]});return this.TLV=t.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(void 0!==t.time&&this.setRevocationDate(t.time),void 0!==t.sn&&this.setCertSerial(t.sn))},Zt(ut.asn1.x509.CRLEntry,ut.asn1.ASN1Object),ut.asn1.x509.CRLNumber=function(t){ut.asn1.x509.CRLNumber.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ut.asn1.DERInteger(this.params.num),this.asn1ExtnValue.tohex()},this.oid="2.5.29.20",null!=t&&(this.params=t)},Zt(ut.asn1.x509.CRLNumber,ut.asn1.x509.Extension),ut.asn1.x509.CRLReason=function(t){ut.asn1.x509.CRLReason.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ut.asn1.DEREnumerated(this.params.code),this.asn1ExtnValue.tohex()},this.oid="2.5.29.21",null!=t&&(this.params=t)},Zt(ut.asn1.x509.CRLReason,ut.asn1.x509.Extension),ut.asn1.x509.OCSPNonce=function(t){ut.asn1.x509.OCSPNonce.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ut.asn1.DEROctetString(this.params),this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.2",null!=t&&(this.params=t)},Zt(ut.asn1.x509.OCSPNonce,ut.asn1.x509.Extension),ut.asn1.x509.OCSPNoCheck=function(t){ut.asn1.x509.OCSPNoCheck.superclass.constructor.call(this,t),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ut.asn1.DERNull,this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.5",null!=t&&(this.params=t)},Zt(ut.asn1.x509.OCSPNoCheck,ut.asn1.x509.Extension),ut.asn1.x509.AdobeTimeStamp=function(t){ut.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this,t);var e=ut.asn1,n=e.DERInteger,r=e.DERBoolean,i=e.DERSequence,s=e.x509.GeneralName;this.params=null,this.getExtnValueHex=function(){var t=this.params,e=[new n(1)];return e.push(new s({uri:t.uri})),null!=t.reqauth&&e.push(new r(t.reqauth)),this.asn1ExtnValue=new i({array:e}),this.asn1ExtnValue.tohex()},this.oid="1.2.840.113583.1.1.9.1",void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.AdobeTimeStamp,ut.asn1.x509.Extension),ut.asn1.x509.X500Name=function(t){ut.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var e=ut.asn1,n=e.x509,r=n.RDN;this.setByString=function(t,e){void 0!==e&&(this.sRule=e);var n=t.split("/");n.shift();for(var i=[],s=0;s<n.length;s++)if(n[s].match(/^[^=]+=.+$/))i.push(n[s]);else{var o=i.length-1;i[o]=i[o]+"/"+n[s]}for(s=0;s<i.length;s++)this.asn1Array.push(new r({str:i[s],rule:this.sRule}))},this.setByLdapString=function(t,e){void 0!==e&&(this.sRule=e);var r=n.X500Name.ldapToCompat(t);this.setByString(r,e)},this.setByObject=function(t,e){for(var n in void 0!==e&&(this.sRule=e),t)if(t.hasOwnProperty(n)){var i=new r({str:n+"="+t[n],rule:this.sRule});this.asn1Array?this.asn1Array.push(i):this.asn1Array=[i]}},this.setByParam=function(t){var e;(void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.array)?this.paramArray=t.array:void 0!==t.str?this.setByString(t.str):void 0!==t.ldapstr?this.setByLdapString(t.ldapstr):void 0!==t.hex?this.hTLV=t.hex:void 0!==t.certissuer?((e=new re).readCertPEM(t.certissuer),this.hTLV=e.getIssuerHex()):void 0!==t.certsubject?((e=new re).readCertPEM(t.certsubject),this.hTLV=e.getSubjectHex()):"object"==typeof t&&void 0===t.certsubject&&void 0===t.certissuer&&this.setByObject(t)},this.tohex=function(){if("string"==typeof this.hTLV)return this.hTLV;if(0==this.asn1Array.length&&this.paramArray.length>0)for(var t=0;t<this.paramArray.length;t++){var n={array:this.paramArray[t]};"utf8"!=this.sRule&&(n.rule=this.sRule);var i=new r(n);this.asn1Array.push(i)}var s=new e.DERSequence({array:this.asn1Array});return this.hTLV=s.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.X500Name,ut.asn1.ASN1Object),ut.asn1.x509.X500Name.compatToLDAP=function(t){if("/"!==t.substr(0,1))throw"malformed input";var e=(t=t.substr(1)).split("/");return e.reverse(),(e=e.map((function(t){return t.replace(/,/,"\\,")}))).join(",")},ut.asn1.x509.X500Name.onelineToLDAP=function(t){return ut.asn1.x509.X500Name.compatToLDAP(t)},ut.asn1.x509.X500Name.ldapToCompat=function(t){for(var e=t.split(","),n=!1,r=[],i=0;e.length>0;i++){var s=e.shift();if(!0===n){var o=(r.pop()+","+s).replace(/\\,/g,",");r.push(o),n=!1}else r.push(s);"\\"===s.substr(-1,1)&&(n=!0)}return(r=r.map((function(t){return t.replace("/","\\/")}))).reverse(),"/"+r.join("/")},ut.asn1.x509.X500Name.ldapToOneline=function(t){return ut.asn1.x509.X500Name.ldapToCompat(t)},ut.asn1.x509.RDN=function(t){ut.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var e=ut.asn1.x509.AttributeTypeAndValue;this.setByParam=function(t){void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.str&&this.addByMultiValuedString(t.str),void 0!==t.array&&(this.paramArray=t.array)},this.addByString=function(t){this.asn1Array.push(new ut.asn1.x509.AttributeTypeAndValue({str:t,rule:this.sRule}))},this.addByMultiValuedString=function(t){for(var e=ut.asn1.x509.RDN.parseString(t),n=0;n<e.length;n++)this.addByString(e[n])},this.tohex=function(){if(0==this.asn1Array.length&&this.paramArray.length>0)for(var t=0;t<this.paramArray.length;t++){var n=this.paramArray[t];void 0!==n.rule&&"utf8"!=this.sRule&&(n.rule=this.sRule);var r=new e(n);this.asn1Array.push(r)}var i=new ut.asn1.DERSet({array:this.asn1Array});return this.TLV=i.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.RDN,ut.asn1.ASN1Object),ut.asn1.x509.RDN.parseString=function(t){for(var e=t.split(/\+/),n=!1,r=[],i=0;e.length>0;i++){var s=e.shift();if(!0===n){var o=(r.pop()+"+"+s).replace(/\\\+/g,"+");r.push(o),n=!1}else r.push(s);"\\"===s.substr(-1,1)&&(n=!0)}var a=!1,u=[];for(i=0;r.length>0;i++){s=r.shift();if(!0===a){var c=u.pop();if(s.match(/"$/)){o=(c+"+"+s).replace(/^([^=]+)="(.*)"$/,"$1=$2");u.push(o),a=!1}else u.push(c+"+"+s)}else u.push(s);s.match(/^[^=]+="/)&&(a=!0)}return u},ut.asn1.x509.AttributeTypeAndValue=function(t){ut.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var e=ut,n=e.asn1,r=n.DERSequence,i=n.DERUTF8String,s=n.DERPrintableString,o=n.DERTeletexString,a=n.DERIA5String,u=n.DERVisibleString,c=n.DERBMPString,l=e.lang.String.isMail,h=e.lang.String.isPrintable;this.setByParam=function(t){if(void 0!==t.rule&&(this.sRule=t.rule),void 0!==t.ds&&(this.dsType=t.ds),void 0===t.value&&void 0!==t.str){var e=t.str.match(/^([^=]+)=(.+)$/);if(!e)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.sType=e[1],this.sValue=e[2]}else this.sType=t.type,this.sValue=t.value},this.setByString=function(t,e){void 0!==e&&(this.sRule=e);var n=t.match(/^([^=]+)=(.+)$/);if(!n)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.setByAttrTypeAndValueStr(n[1],n[2])},this._getDsType=function(){var t=this.sType,e=this.sValue,n=this.sRule;return"prn"===n?"CN"==t&&l(e)?"ia5":h(e)?"prn":"utf8":"utf8"===n?"CN"==t&&l(e)?"ia5":"C"==t?"prn":"utf8":"utf8"},this.setByAttrTypeAndValueStr=function(t,e,n){void 0!==n&&(this.sRule=n),this.sType=t,this.sValue=e},this.getValueObj=function(t,e){if("utf8"==t)return new i({str:e});if("prn"==t)return new s({str:e});if("tel"==t)return new o({str:e});if("ia5"==t)return new a({str:e});if("vis"==t)return new u({str:e});if("bmp"==t)return new c({str:e});throw new Error("unsupported directory string type: type="+t+" value="+e)},this.tohex=function(){null==this.dsType&&(this.dsType=this._getDsType());var t=ut.asn1.x509.OID.atype2obj(this.sType),e=this.getValueObj(this.dsType,this.sValue),n=new r({array:[t,e]});return this.TLV=n.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.AttributeTypeAndValue,ut.asn1.ASN1Object),ut.asn1.x509.SubjectPublicKeyInfo=function(t){ut.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var e=ut,n=e.asn1,r=n.DERInteger,i=n.DERBitString,s=n.DERObjectIdentifier,o=n.DERSequence,a=n.ASN1Util.newObject,u=n.x509.AlgorithmIdentifier,c=e.crypto;c.ECDSA,c.DSA;this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";return new o({array:[this.asn1AlgId,this.asn1SubjPKey]})},this.tohex=function(){var t=this.getASN1Object();return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.setPubKey=function(t){try{if(t instanceof nt){var e=a({seq:[{int:{bigint:t.n}},{int:{int:t.e}}]}).tohex();this.asn1AlgId=new u({name:"rsaEncryption"}),this.asn1SubjPKey=new i({hex:"00"+e})}}catch(t){}try{if(t instanceof ut.crypto.ECDSA){var n=new s({name:t.curveName});this.asn1AlgId=new u({name:"ecPublicKey",asn1params:n}),this.asn1SubjPKey=new i({hex:"00"+t.pubKeyHex})}}catch(t){}try{if(t instanceof ut.crypto.DSA){n=new a({seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]});this.asn1AlgId=new u({name:"dsa",asn1params:n});var o=new r({bigint:t.y});this.asn1SubjPKey=new i({hex:"00"+o.tohex()})}}catch(t){}},void 0!==t&&this.setPubKey(t)},Zt(ut.asn1.x509.SubjectPublicKeyInfo,ut.asn1.ASN1Object),ut.asn1.x509.Time=function(t){ut.asn1.x509.Time.superclass.constructor.call(this);var e=ut.asn1,n=e.DERUTCTime,r=e.DERGeneralizedTime;this.params=null,this.type=null,this.setTimeParams=function(t){this.timeParams=t},this.setByParam=function(t){this.params=t},this.getType=function(t){return t.match(/^[0-9]{12}Z$/)?"utc":t.match(/^[0-9]{14}Z$/)?"gen":t.match(/^[0-9]{12}\.[0-9]+Z$/)?"utc":t.match(/^[0-9]{14}\.[0-9]+Z$/)?"gen":null},this.tohex=function(){var t=this.params,e=null;if("string"==typeof t&&(t={str:t}),null==t||!t.str||null!=t.type&&null!=t.type||(t.type=this.getType(t.str)),null!=t&&t.str?("utc"==t.type&&(e=new n(t.str)),"gen"==t.type&&(e=new r(t.str))):e="gen"==this.type?new r:new n,null==e)throw new Error("wrong setting for Time");return this.TLV=e.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},ut.asn1.x509.Time_bak=function(t){ut.asn1.x509.Time_bak.superclass.constructor.call(this);var e=ut.asn1,n=e.DERUTCTime,r=e.DERGeneralizedTime;this.setTimeParams=function(t){this.timeParams=t},this.tohex=function(){var t=null;return t=null!=this.timeParams?"utc"==this.type?new n(this.timeParams):new r(this.timeParams):"utc"==this.type?new n:new r,this.TLV=t.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},this.type="utc",void 0!==t&&(void 0!==t.type?this.type=t.type:void 0!==t.str&&(t.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),t.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=t)},Zt(ut.asn1.x509.Time,ut.asn1.ASN1Object),ut.asn1.x509.AlgorithmIdentifier=function(t){ut.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var e=ut.asn1,n=e.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;if(this.tohex=function(){if(null===this.nameAlg&&null===this.asn1Alg)throw new Error("algorithm not specified");if(null!==this.nameAlg){var t=null;for(var r in n)r===this.nameAlg&&(t=n[r]);if(null!==t)return this.hTLV=t,this.hTLV}null!==this.nameAlg&&null===this.asn1Alg&&(this.asn1Alg=e.x509.OID.name2obj(this.nameAlg));var i=[this.asn1Alg];null!==this.asn1Params&&i.push(this.asn1Params);var s=new e.DERSequence({array:i});return this.hTLV=s.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&(void 0!==t.name&&(this.nameAlg=t.name),void 0!==t.asn1params&&(this.asn1Params=t.asn1params),void 0!==t.paramempty&&(this.paramEmpty=t.paramempty)),null===this.asn1Params&&!1===this.paramEmpty&&null!==this.nameAlg){void 0!==this.nameAlg.name&&(this.nameAlg=this.nameAlg.name);var r=this.nameAlg.toLowerCase();"withdsa"!==r.substr(-7,7)&&"withecdsa"!==r.substr(-9,9)&&(this.asn1Params=new e.DERNull)}},Zt(ut.asn1.x509.AlgorithmIdentifier,ut.asn1.ASN1Object),ut.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},ut.asn1.x509.GeneralName=function(t){ut.asn1.x509.GeneralName.superclass.constructor.call(this);var e=ut.asn1,n=e.x509,r=n.X500Name,i=n.OtherName,s=e.DERIA5String,o=(e.DERPrintableString,e.DEROctetString),a=e.DERTaggedObject,u=e.ASN1Object,c=Error;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t,e,n=this.params,l=!1;if(void 0!==n.other)t="a0",e=new i(n.other);else if(void 0!==n.rfc822)t="81",e=new s({str:n.rfc822});else if(void 0!==n.dns)t="82",e=new s({str:n.dns});else if(void 0!==n.dn)t="a4",l=!0,e="string"==typeof n.dn?new r({str:n.dn}):n.dn instanceof ut.asn1.x509.X500Name?n.dn:new r(n.dn);else if(void 0!==n.ldapdn)t="a4",l=!0,e=new r({ldapstr:n.ldapdn});else if(void 0!==n.certissuer||void 0!==n.certsubj){var h,f;t="a4",l=!0;var p=null;if(void 0!==n.certsubj?(h=!1,f=n.certsubj):(h=!0,f=n.certissuer),f.match(/^[0-9A-Fa-f]+$/),-1!=f.indexOf("-----BEGIN ")&&(p=It(f)),null==p)throw new Error("certsubj/certissuer not cert");var d,g=new re;g.hex=p,d=h?g.getIssuerHex():g.getSubjectHex(),(e=new u).hTLV=d}else if(void 0!==n.uri)t="86",e=new s({str:n.uri});else{if(void 0===n.ip)throw new c("improper params");var m;t="87";var v=n.ip;try{if(v.match(/^[0-9a-f]+$/)){var y=v.length;if(8!=y&&16!=y&&32!=y&&64!=y)throw"err";m=v}else m=Nt(v)}catch(t){throw new c("malformed IP address: "+n.ip+":"+t.message)}e=new o({hex:m})}return new a({tag:t,explicit:l,obj:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.GeneralName,ut.asn1.ASN1Object),ut.asn1.x509.GeneralNames=function(t){ut.asn1.x509.GeneralNames.superclass.constructor.call(this);var e=ut.asn1;this.setByParamArray=function(t){for(var n=0;n<t.length;n++){var r=new e.x509.GeneralName(t[n]);this.asn1Array.push(r)}},this.tohex=function(){return new e.DERSequence({array:this.asn1Array}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.asn1Array=new Array,void 0!==t&&this.setByParamArray(t)},Zt(ut.asn1.x509.GeneralNames,ut.asn1.ASN1Object),ut.asn1.x509.OtherName=function(t){ut.asn1.x509.OtherName.superclass.constructor.call(this);var e=ut.asn1,n=e.DERObjectIdentifier,r=e.DERSequence,i=e.ASN1Util.newObject;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params;if(null==t.oid||null==t.value)throw new Error("oid or value not specified");var e=new n({oid:t.oid}),s=i({tag:{tag:"a0",explicit:!0,obj:t.value}});return new r({array:[e,s]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.x509.OtherName,ut.asn1.ASN1Object),ut.asn1.x509.OID=new function(){var t=ut.asn1.DERObjectIdentifier;this.name2oidList={sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",secp521r1:"1.3.132.0.35",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1"},this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.objCache={},this.name2obj=function(e){if(void 0!==this.objCache[e])return this.objCache[e];if(void 0===this.name2oidList[e])throw"Name of ObjectIdentifier not defined: "+e;var n=this.name2oidList[e],r=new t({oid:n});return this.objCache[e]=r,r},this.atype2obj=function(e){if(void 0!==this.objCache[e])return this.objCache[e];var n;if(e.match(/^\d+\.\d+\.[0-9.]+$/))n=e;else if(void 0!==this.atype2oidList[e])n=this.atype2oidList[e];else{if(void 0===this.name2oidList[e])throw new Error("AttributeType name undefined: "+e);n=this.name2oidList[e]}var r=new t({oid:n});return this.objCache[e]=r,r},this.registerOIDs=function(t){if(this.checkOIDs(t))for(var e in t)this.name2oidList[e]=t[e]},this.checkOIDs=function(t){try{var e=Object.keys(t);return 0!=e.length&&(e.map((function(t,e,n){if(!this[t].match(/^[0-2]\.[0-9.]+$/))throw new Error("value is not OID")}),t),!0)}catch(t){return!1}}},ut.asn1.x509.OID.oid2name=function(t){var e=ut.asn1.x509.OID.name2oidList;for(var n in e)if(e[n]==t)return n;return""},ut.asn1.x509.OID.oid2atype=function(t){var e=ut.asn1.x509.OID.atype2oidList;for(var n in e)if(e[n]==t)return n;return t},ut.asn1.x509.OID.name2oid=function(t){if(t.match(/^[0-9.]+$/))return t;var e=ut.asn1.x509.OID.name2oidList;return void 0===e[t]?"":e[t]},ut.asn1.x509.X509Util={},ut.asn1.x509.X509Util.newCertPEM=function(t){var e=ut.asn1.x509;e.TBSCertificate;return new(0,e.Certificate)(t).getPEM()},void 0!==ut&&ut||(ut={}),void 0!==ut.asn1&&ut.asn1||(ut.asn1={}),void 0!==ut.asn1.cms&&ut.asn1.cms||(ut.asn1.cms={}),ut.asn1.cms.Attribute=function(t){var e=Error,n=ut.asn1,r=n.DERSequence,i=n.DERSet,s=n.DERObjectIdentifier;this.params=null,this.typeOid=null,this.setByParam=function(t){this.params=t},this.getValueArray=function(){throw new e("not yet implemented abstract")},this.tohex=function(){var t=new s({oid:this.typeOid}),e=new i({array:this.getValueArray()});return new r({array:[t,e]}).tohex()},this.getEncodedHex=function(){return this.tohex()}},Zt(ut.asn1.cms.Attribute,ut.asn1.ASN1Object),ut.asn1.cms.ContentType=function(t){var e=ut.asn1;e.cms.ContentType.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.3",this.getValueArray=function(){return[new e.DERObjectIdentifier(this.params.type)]},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.ContentType,ut.asn1.cms.Attribute),ut.asn1.cms.MessageDigest=function(t){var e=ut.asn1,n=e.DEROctetString;e.cms.MessageDigest.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.4",this.getValueArray=function(){return[new n(this.params)]},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.MessageDigest,ut.asn1.cms.Attribute),ut.asn1.cms.SigningTime=function(t){var e=ut.asn1;e.cms.SigningTime.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.5",this.getValueArray=function(){return[new e.x509.Time(this.params)]},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SigningTime,ut.asn1.cms.Attribute),ut.asn1.cms.SigningCertificate=function(t){var e=Error,n=ut,r=n.asn1,i=r.DERSequence,s=r.cms,o=s.ESSCertID;n.crypto;s.SigningCertificate.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.12",this.getValueArray=function(){if(null==this.params||null==this.params||null==this.params.array)throw new e("parameter 'array' not specified");for(var n=this.params.array,r=[],s=0;s<n.length;s++){var a=n[s];0!=t.hasis||"string"!=typeof a||-1==a.indexOf("-----BEGIN")&&!ht.isASN1HEX(a)||(a={cert:a}),0!=a.hasis&&0==t.hasis&&(a.hasis=!1),r.push(new o(a))}var u=new i({array:r});return[new i({array:[u]})]},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SigningCertificate,ut.asn1.cms.Attribute),ut.asn1.cms.ESSCertID=function(t){ut.asn1.cms.ESSCertID.superclass.constructor.call(this);var e=Error,n=ut,r=n.asn1,i=r.DEROctetString,s=r.DERSequence,o=r.cms.IssuerSerial;this.params=null,this.getCertHash=function(t,r){if(null!=t.hash)return t.hash;if("string"==typeof t&&-1==t.indexOf("-----BEGIN")&&!ht.isASN1HEX(t))return t;var i,s,o;if("string"==typeof t)i=t;else{if(null==t.cert)throw new e("hash nor cert unspecified");i=t.cert}if(s=-1!=i.indexOf("-----BEGIN")?It(i):i,"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?s=It(t):ht.isASN1HEX(t)&&(s=t)),null!=t.alg)o=t.alg;else{if(null==r)throw new e("hash alg unspecified");o=r}return n.crypto.Util.hashHex(s,o)},this.tohex=function(){var t=this.params,e=this.getCertHash(t,"sha1"),n=[];return n.push(new i({hex:e})),("string"==typeof t&&-1!=t.indexOf("-----BEGIN")||null!=t.cert&&0!=t.hasis||null!=t.issuer&&null!=t.serial)&&n.push(new o(t)),new s({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.ESSCertID,ut.asn1.ASN1Object),ut.asn1.cms.SigningCertificateV2=function(t){var e=Error,n=ut,r=n.asn1,i=r.DERSequence,s=(r.x509,r.cms),o=s.ESSCertIDv2;n.crypto;s.SigningCertificateV2.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.47",this.getValueArray=function(){if(null==this.params||null==this.params||null==this.params.array)throw new e("parameter 'array' not specified");for(var n=this.params.array,r=[],s=0;s<n.length;s++){var a=n[s];null==t.alg&&0!=t.hasis||"string"!=typeof a||-1==a.indexOf("-----BEGIN")&&!ht.isASN1HEX(a)||(a={cert:a}),null==a.alg&&null!=t.alg&&(a.alg=t.alg),0!=a.hasis&&0==t.hasis&&(a.hasis=!1),r.push(new o(a))}var u=new i({array:r});return[new i({array:[u]})]},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SigningCertificateV2,ut.asn1.cms.Attribute),ut.asn1.cms.ESSCertIDv2=function(t){ut.asn1.cms.ESSCertIDv2.superclass.constructor.call(this);Error;var e=ut.asn1,n=e.DEROctetString,r=e.DERSequence,i=e.cms.IssuerSerial,s=e.x509.AlgorithmIdentifier;this.params=null,this.tohex=function(){var t=this.params,e=this.getCertHash(t,"sha256"),o=[];return null!=t.alg&&"sha256"!=t.alg&&o.push(new s({name:t.alg})),o.push(new n({hex:e})),("string"==typeof t&&-1!=t.indexOf("-----BEGIN")||null!=t.cert&&0!=t.hasis||null!=t.issuer&&null!=t.serial)&&o.push(new i(t)),new r({array:o}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.ESSCertIDv2,ut.asn1.cms.ESSCertID),ut.asn1.cms.IssuerSerial=function(t){var e=Error,n=ut.asn1,r=n.DERInteger,i=n.DERSequence,s=n.cms,o=n.x509.GeneralNames,a=re;s.IssuerSerial.superclass.constructor.call(this),this.setByParam=function(t){this.params=t},this.tohex=function(){var t,n,s=this.params;if("string"==typeof s&&-1!=s.indexOf("-----BEGIN")||null!=s.cert){var u;u=null!=s.cert?s.cert:s;var c=new a;c.readCertPEM(u),t=c.getIssuer(),n={hex:c.getSerialNumberHex()}}else{if(null==s.issuer||!s.serial)throw new e("cert or issuer and serial parameter not specified");t=s.issuer,n=s.serial}var l=new o([{dn:t}]),h=new r(n);return new i({array:[l,h]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.IssuerSerial,ut.asn1.ASN1Object),ut.asn1.cms.SignerIdentifier=function(t){var e=ut.asn1,n=(e.DERInteger,e.DERSequence,e.cms),r=n.IssuerAndSerialNumber,i=n.SubjectKeyIdentifier;e.x509.X500Name,Error;n.SignerIdentifier.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if("isssn"==t.type)return new r(t).tohex();if("skid"==t.type)return new i(t).tohex();throw new Error("wrong property for isssn or skid")},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SignerIdentifier,ut.asn1.ASN1Object),ut.asn1.cms.IssuerAndSerialNumber=function(t){var e=ut.asn1,n=e.DERInteger,r=e.DERSequence,i=e.cms,s=e.x509.X500Name,o=re,a=Error;i.IssuerAndSerialNumber.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t,e,i=this.params;if("string"==typeof i&&-1!=i.indexOf("-----BEGIN")||null!=i.cert){var u;u=null!=i.cert?i.cert:i;var c=new o;c.readCertPEM(u),t=c.getIssuer(),e={hex:c.getSerialNumberHex()}}else{if(null==i.issuer||!i.serial)throw new a("cert or issuer and serial parameter not specified");t=i.issuer,e=i.serial}var l=new s(t),h=new n(e);return new r({array:[l,h]}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.IssuerAndSerialNumber,ut.asn1.ASN1Object),ut.asn1.cms.SubjectKeyIdentifier=function(t){var e=ut.asn1,n=(e.DERInteger,e.DERSequence,e.ASN1Util.newObject),r=e.cms,i=(r.IssuerAndSerialName,r.SubjectKeyIdentifier,e.x509.X500Name,re),s=Error;r.SubjectKeyIdentifier.superclass.constructor.call(this),this.tohex=function(){var t,e=this.params;if(null==e.cert&&null==e.skid)throw new s("property cert nor skid undefined");null!=e.cert?t=new i(e.cert).getExtSubjectKeyIdentifier().kid.hex:null!=e.skid&&(t=e.skid);return n({tag:{tage:"a0",obj:{octstr:{hex:t}}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SubjectKeyIdentifier,ut.asn1.ASN1Object),ut.asn1.cms.AttributeList=function(t){var e=Error,n=ut.asn1,r=n.DERSet,i=n.cms;i.AttributeList.superclass.constructor.call(this),this.params=null,this.hTLV=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params;if(null!=this.hTLV)return this.hTLV;var n=!0;null!=t.sortflag&&(n=t.sortflag);for(var s=t.array,o=[],a=0;a<s.length;a++){var u=s[a],c=u.attr;if("contentType"==c)o.push(new i.ContentType(u));else if("messageDigest"==c)o.push(new i.MessageDigest(u));else if("signingTime"==c)o.push(new i.SigningTime(u));else if("signingCertificate"==c)o.push(new i.SigningCertificate(u));else if("signingCertificateV2"==c)o.push(new i.SigningCertificateV2(u));else if("signaturePolicyIdentifier"==c)o.push(new ut.asn1.cades.SignaturePolicyIdentifier(u));else{if("signatureTimeStamp"!=c&&"timeStampToken"!=c)throw new e("unknown attr: "+c);o.push(new ut.asn1.cades.SignatureTimeStamp(u))}}var l=new r({array:o,sortflag:n});return this.hTLV=l.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.AttributeList,ut.asn1.ASN1Object),ut.asn1.cms.SignerInfo=function(t){var e=Error,n=ut,r=n.asn1,i=r.DERInteger,s=r.DEROctetString,o=r.DERSequence,a=r.DERTaggedObject,u=r.cms,c=u.SignerIdentifier,l=u.AttributeList,h=(u.ContentType,u.EncapsulatedContentInfo,u.MessageDigest,u.SignedData,r.x509.AlgorithmIdentifier),f=n.crypto,p=Qt;u.SignerInfo.superclass.constructor.call(this),this.params=null,this.sign=function(){var t=this.params,e=t.sigalg,n=new l(t.sattrs).tohex(),r=p.getKey(t.signkey),i=new f.Signature({alg:e});i.init(r),i.updateHex(n);var s=i.sign();t.sighex=s},this.tohex=function(){var t=this.params,n=[];if(n.push(new i({int:t.version})),n.push(new c(t.id)),n.push(new h({name:t.hashalg})),null!=t.sattrs){var r=new l(t.sattrs);try{n.push(new a({tag:"a0",explicit:!1,obj:r}))}catch(t){throw new e("si sattr error: "+t)}}if(null!=t.sigalgfield?n.push(new h({name:t.sigalgfield})):n.push(new h({name:t.sigalg})),null==t.sighex&&null!=t.signkey&&this.sign(),n.push(new s({hex:t.sighex})),null!=t.uattrs){r=new l(t.uattrs);try{n.push(new a({tag:"a1",explicit:!1,obj:r}))}catch(t){throw new e("si uattr error: "+t)}}return new o({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SignerInfo,ut.asn1.ASN1Object),ut.asn1.cms.EncapsulatedContentInfo=function(t){var e=ut.asn1,n=e.DERTaggedObject,r=e.DERSequence,i=e.DERObjectIdentifier,s=e.DEROctetString;e.cms.EncapsulatedContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];if(e.push(new i(t.type)),null!=t.content&&(null!=t.content.hex||null!=t.content.str)&&1!=t.isDetached){var o=new s(t.content),a=new n({tag:"a0",explicit:!0,obj:o});e.push(a)}return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.EncapsulatedContentInfo,ut.asn1.ASN1Object),ut.asn1.cms.ContentInfo=function(t){var e=ut.asn1,n=e.DERTaggedObject,r=e.DERSequence,i=e.DERObjectIdentifier;e.x509.OID.name2obj;ut.asn1.cms.ContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];e.push(new i(t.type));var s=new n({tag:"a0",explicit:!0,obj:t.obj});return e.push(s),new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.ContentInfo,ut.asn1.ASN1Object),ut.asn1.cms.SignedData=function(t){Error;var e=ut.asn1,n=(e.ASN1Object,e.DERInteger),r=e.DERSet,i=e.DERSequence,s=(e.DERTaggedObject,e.cms),o=s.EncapsulatedContentInfo,a=s.SignerInfo,u=s.ContentInfo,c=s.CertificateSet,l=s.RevocationInfoChoices,h=e.x509.AlgorithmIdentifier;ut.asn1.cms.SignedData.superclass.constructor.call(this),this.params=null,this.checkAndFixParam=function(){var t=this.params;this._setDigestAlgs(t),this._setContentTypeByEContent(t),this._setMessageDigestByEContent(t),this._setSignerInfoVersion(t),this._setSignedDataVersion(t)},this._setDigestAlgs=function(t){for(var e={},n=t.sinfos,r=0;r<n.length;r++){e[n[r].hashalg]=1}t.hashalgs=Object.keys(e).sort()},this._setContentTypeByEContent=function(t){for(var e=t.econtent.type,n=t.sinfos,r=0;r<n.length;r++){var i=n[r];this._getAttrParamByName(i,"contentType").type=e}},this._setMessageDigestByEContent=function(t){var e=t.econtent,n=(t.econtent.type,e.content.hex);null==n&&"data"==e.type&&null!=e.content.str&&(n=Ft(e.content.str));for(var r=t.sinfos,i=0;i<r.length;i++){var s=r[i],o=s.hashalg,a=this._getAttrParamByName(s,"messageDigest"),u=ut.crypto.Util.hashHex(n,o);a.hex=u}},this._getAttrParamByName=function(t,e){for(var n=t.sattrs.array,r=0;r<n.length;r++)if(n[r].attr==e)return n[r]},this._setSignerInfoVersion=function(t){for(var e=t.sinfos,n=0;n<e.length;n++){var r=e[n],i=1;"skid"==r.id.type&&(i=3),r.version=i}},this._setSignedDataVersion=function(t){var e=this._getSignedDataVersion(t);t.version=e},this._getSignedDataVersion=function(t){if(null!=t.revinfos)for(var e=t.revinfos,n=0;n<e.length;n++){if(null!=e[n].ocsp)return 5}var r=t.sinfos;for(n=0;n<r.length;n++){if(3==t.sinfos[n].version)return 3}return"data"!=t.econtent.type?3:1},this.tohex=function(){var t=this.params;null!=this.getEncodedHexPrepare&&this.getEncodedHexPrepare(),1!=t.fixed&&this.checkAndFixParam();var e=[];e.push(new n({int:t.version}));for(var s=[],u=0;u<t.hashalgs.length;u++){var f=t.hashalgs[u];s.push(new h({name:f}))}e.push(new r({array:s})),e.push(new o(t.econtent)),null!=t.certs&&e.push(new c(t.certs)),null!=t.revinfos&&e.push(new l(t.revinfos));var p=[];for(u=0;u<t.sinfos.length;u++){var d=t.sinfos[u];p.push(new a(d))}return e.push(new r({array:p})),new i({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.getContentInfo=function(){return new u({type:"signed-data",obj:this})},this.getContentInfoEncodedHex=function(){return this.getContentInfo().tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.SignedData,ut.asn1.ASN1Object),ut.asn1.cms.CertificateSet=function(t){ut.asn1.cms.CertificateSet.superclass.constructor.call(this);var e=Error,n=ut.asn1,r=n.DERTaggedObject,i=n.DERSet,s=n.ASN1Object;this.params=null,this.tohex=function(){var t,n=this.params,o=[];if(n instanceof Array)t=n;else{if(null==n.array)throw new e("cert array not specified");t=n.array}for(var a=0;a<t.length;a++){var u=It(t[a]),c=new s;c.hTLV=u,o.push(c)}var l={array:o};0==n.sortflag&&(l.sortflag=!1);var h=new i(l);return new r({tag:"a0",explicit:!1,obj:h}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.CertificateSet,ut.asn1.ASN1Object),ut.asn1.cms.RevocationInfoChoices=function(t){ut.asn1.cms.RevocationInfoChoices.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(!t instanceof Array)throw new Error("params is not array");for(var e=[],n=0;n<t.length;n++)e.push(new ut.asn1.cms.RevocationInfoChoice(t[n]));return ut.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:{set:e}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.RevocationInfoChoices,ut.asn1.ASN1Object),ut.asn1.cms.RevocationInfoChoice=function(t){ut.asn1.cms.RevocationInfoChoice.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(null!=t.crl&&"string"==typeof t.crl){var e=t.crl;return-1!=t.crl.indexOf("-----BEGIN")&&(e=It(t.crl)),e}if(null!=t.ocsp)return ut.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:new ut.asn1.cms.OtherRevocationFormat(t)}}).tohex();throw new Error("property crl or ocsp undefined")},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.RevocationInfoChoice,ut.asn1.ASN1Object),ut.asn1.cms.OtherRevocationFormat=function(t){ut.asn1.cms.OtherRevocationFormat.superclass.constructor.call(this);var e=Error,n=ut,r=n.asn1.ASN1Util.newObject,i=n.lang.String.isHex;this.params=null,this.tohex=function(){var t=this.params;if(null==t.ocsp)throw new e("property ocsp not specified");if(!i(t.ocsp)||!ht.isASN1HEX(t.ocsp))throw new e("ocsp value not ASN.1 hex string");return r({seq:[{oid:"1.3.6.1.5.5.7.16.2"},{asn1:{tlv:t.ocsp}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cms.OtherRevocationFormat,ut.asn1.ASN1Object),ut.asn1.cms.CMSUtil=new function(){},ut.asn1.cms.CMSUtil.newSignedData=function(t){return new ut.asn1.cms.SignedData(t)},ut.asn1.cms.CMSUtil.verifySignedData=function(t){var e=ut,n=e.asn1,r=n.cms,i=(r.SignerInfo,r.SignedData,r.SigningTime,r.SigningCertificate,r.SigningCertificateV2,n.cades.SignaturePolicyIdentifier,e.lang.String.isHex),s=ht,o=s.getVbyList,a=s.getTLVbyList,u=s.getIdxbyList,c=s.getChildIdx,l=s.getTLV,h=s.oidname,f=e.crypto.Util.hashHex;void 0===t.cms&&i(t.cms);var p=t.cms,d=function(t,e){var n=e.idx;e.signerid_issuer1=a(t,n,[1,0],"30"),e.signerid_serial1=o(t,n,[1,1],"02"),e.hashalg=h(o(t,n,[2,0],"06"));var r=u(t,n,[3],"a0");e.idxSignedAttrs=r,g(t,e,r);var i=c(t,n).length;if(i<6)throw"malformed SignerInfo";e.sigalg=h(o(t,n,[i-2,0],"06")),e.sigval=o(t,n,[i-1],"04")},g=function(t,e,n){var r=c(t,n);e.signedAttrIdxList=r;for(var i=0;i<r.length;i++){var s,a=r[i],u=o(t,a,[0],"06");"2a864886f70d010905"===u?(s=wt(o(t,a,[1,0])),e.saSigningTime=s):"2a864886f70d010904"===u&&(s=o(t,a,[1,0],"04"),e.saMessageDigest=s)}},m=function(t,e,n,r){n.verifyDetail={};var i=n.verifyDetail,s=e.parse.econtent,o=n.hashalg,a=n.saMessageDigest;i.validMessageDigest=!1,f(s,o)===a&&(i.validMessageDigest=!0),function(t,e,n,r){var i,s=e.parse.certsIdx;if(void 0===e.certs){i=[],e.certkeys=[];for(var o=c(t,s),a=0;a<o.length;a++){var u=l(t,o[a]),h=new re;h.readCertHex(u),i[a]=h,e.certkeys[a]=h.getPublicKey()}e.certs=i}else i=e.certs;e.cccc=i.length,e.cccci=o.length;for(a=0;a<i.length;a++){var f=h.getIssuerHex(),p=h.getSerialNumberHex();n.signerid_issuer1===f&&n.signerid_serial1===p&&(n.certkey_idx=a)}}(t,e,n),i.validSignatureValue=!1;var u=n.sigalg,h="31"+l(t,n.idxSignedAttrs).substr(2);n.signedattrshex=h;var p=e.certs[n.certkey_idx].getPublicKey(),d=new ut.crypto.Signature({alg:u});d.init(p),d.updateHex(h);var g=d.verify(n.sigval);i.validSignatureValue_isValid=g,!0===g&&(i.validSignatureValue=!0),n.isValid=!1,i.validMessageDigest&&i.validSignatureValue&&(n.isValid=!0)},v={isValid:!1,parse:{}};return function(t,e){if("2a864886f70d010702"!==o(t,0,[0],"06"))return e;e.cmsType="signedData",e.econtent=o(t,0,[1,0,2,1,0]),function(t,e){for(var n,r=3;r<6;r++)if(void 0!==(n=u(t,0,[1,0,r]))){var i=t.substr(n,2);"a0"===i&&(e.certsIdx=n),"a1"===i&&(e.revinfosIdx=n),"31"===i&&(e.signerinfosIdx=n)}}(t,e),e.signerInfos=[],function(t,e){var n=e.signerinfosIdx;if(void 0!==n){var r=c(t,n);e.signerInfoIdxList=r;for(var i=0;i<r.length;i++){var s={idx:r[i]};d(t,s),e.signerInfos.push(s)}}}(t,e)}(p,v.parse),function(t,e){for(var n=e.parse.signerInfos,r=n.length,i=!0,s=0;s<r;s++){var o=n[s];m(t,e,o,s),o.isValid||(i=!1)}e.isValid=i}(p,v),v},ut.asn1.cms.CMSParser=function(){var t=Error,e=re,n=new e,r=ht,i=r.getV,s=r.getTLV,o=(r.getIdxbyList,r.getTLVbyList),a=r.getTLVbyListEx,u=r.getVbyList,c=r.getVbyListEx,l=r.getChildIdx;this.getCMSSignedData=function(t){var e=o(t,0,[1,0]);return this.getSignedData(e)},this.getSignedData=function(t){var e=l(t,0),n={},r=i(t,e[0]),o=parseInt(r,16);n.version=o;var u=s(t,e[1]);n.hashalgs=this.getHashAlgArray(u);var c=s(t,e[2]);n.econtent=this.getEContent(c);var h=a(t,0,["[0]"]);null!=h&&(n.certs=this.getCertificateSet(h));a(t,0,["[1]"]);var f=a(t,0,[3]);return n.sinfos=this.getSignerInfos(f),n},this.getHashAlgArray=function(t){for(var n=l(t,0),r=new e,i=[],o=0;o<n.length;o++){var a=s(t,n[o]),u=r.getAlgorithmIdentifierName(a);i.push(u)}return i},this.getEContent=function(t){var e={},n=u(t,0,[0]),r=u(t,0,[1,0]);return e.type=ut.asn1.x509.OID.oid2name(ht.hextooidstr(n)),e.content={hex:r},e},this.getSignerInfos=function(t){for(var e=[],n=l(t,0),r=0;r<n.length;r++){var i=s(t,n[r]),o=this.getSignerInfo(i);e.push(o)}return e},this.getSignerInfo=function(t){var e={},i=l(t,0),o=r.getInt(t,i[0],-1);-1!=o&&(e.version=o);var u=s(t,i[1]),h=this.getIssuerAndSerialNumber(u);e.id=h;var f=s(t,i[2]),p=n.getAlgorithmIdentifierName(f);e.hashalg=p;var d=a(t,0,["[0]"]);if(null!=d){var g=this.getAttributeList(d);e.sattrs=g}var m=a(t,0,[3]),v=n.getAlgorithmIdentifierName(m);e.sigalg=v;var y=c(t,0,[4]);e.sighex=y;var b=a(t,0,["[1]"]);if(null!=b){var x=this.getAttributeList(b);e.uattrs=x}return e},this.getSignerIdentifier=function(t){if("30"==t.substr(0,2))return this.getIssuerAndSerialNumber(t);throw new Error("SKID of signerIdentifier not supported")},this.getIssuerAndSerialNumber=function(t){var e={type:"isssn"},r=l(t,0),o=s(t,r[0]);e.issuer=n.getX500Name(o);var a=i(t,r[1]);return e.serial={hex:a},e},this.getAttributeList=function(t){for(var e=[],n=l(t,0),r=0;r<n.length;r++){var i=s(t,n[r]),o=this.getAttribute(i);e.push(o)}return{array:e}},this.getAttribute=function(t){var e={},n=l(t,0),i=r.getOID(t,n[0]),o=ut.asn1.x509.OID.oid2name(i);e.attr=o;var a=s(t,n[1]),u=l(a,0);if(1==u.length)e.valhex=s(a,u[0]);else{for(var c=[],h=0;h<u.length;h++)c.push(s(a,u[h]));e.valhex=c}return"contentType"==o?this.setContentType(e):"messageDigest"==o?this.setMessageDigest(e):"signingTime"==o?this.setSigningTime(e):"signingCertificate"==o?this.setSigningCertificate(e):"signingCertificateV2"==o?this.setSigningCertificateV2(e):"signaturePolicyIdentifier"==o&&this.setSignaturePolicyIdentifier(e),e},this.setContentType=function(t){var e=r.getOIDName(t.valhex,0,null);null!=e&&(t.type=e,delete t.valhex)},this.setSigningTime=function(t){var e=wt(i(t.valhex,0));t.str=e,delete t.valhex},this.setMessageDigest=function(t){var e=i(t.valhex,0);t.hex=e,delete t.valhex},this.setSigningCertificate=function(t){var e=l(t.valhex,0);if(e.length>0){for(var n=s(t.valhex,e[0]),r=l(n,0),i=[],o=0;o<r.length;o++){var a=s(n,r[o]),u=this.getESSCertID(a);i.push(u)}t.array=i}if(e.length>1){var c=s(t.valhex,e[1]);t.polhex=c}delete t.valhex},this.setSignaturePolicyIdentifier=function(t){var n=l(t.valhex,0);if(n.length>0){var o=r.getOID(t.valhex,n[0]);t.oid=o}if(n.length>1){var a=new e,u=l(t.valhex,n[1]),c=s(t.valhex,u[0]),h=a.getAlgorithmIdentifierName(c);t.alg=h;var f=i(t.valhex,u[1]);t.hash=f}delete t.valhex},this.setSigningCertificateV2=function(t){var e=l(t.valhex,0);if(e.length>0){for(var n=s(t.valhex,e[0]),r=l(n,0),i=[],o=0;o<r.length;o++){var a=s(n,r[o]),u=this.getESSCertIDv2(a);i.push(u)}t.array=i}if(e.length>1){var c=s(t.valhex,e[1]);t.polhex=c}delete t.valhex},this.getESSCertID=function(t){var e={},n=l(t,0);if(n.length>0){var r=i(t,n[0]);e.hash=r}if(n.length>1){var o=s(t,n[1]),a=this.getIssuerSerial(o);null!=a.serial&&(e.serial=a.serial),null!=a.issuer&&(e.issuer=a.issuer)}return e},this.getESSCertIDv2=function(e){var r={},o=l(e,0);if(o.length<1||3<o.length)throw new t("wrong number of elements");var a=0;if("30"==e.substr(o[0],2)){var u=s(e,o[0]);r.alg=n.getAlgorithmIdentifierName(u),a++}else r.alg="sha256";var c=i(e,o[a]);if(r.hash=c,o.length>a+1){var h=s(e,o[a+1]),f=this.getIssuerSerial(h);r.issuer=f.issuer,r.serial=f.serial}return r},this.getIssuerSerial=function(t){var e={},r=l(t,0),o=s(t,r[0]),a=n.getGeneralNames(o)[0].dn;e.issuer=a;var u=i(t,r[1]);return e.serial={hex:u},e},this.getCertificateSet=function(t){for(var e=l(t,0),n=[],r=0;r<e.length;r++){var i=s(t,e[r]);if("30"==i.substr(0,2)){var o=$t(i,"CERTIFICATE");n.push(o)}}return{array:n,sortflag:!1}}},void 0!==ut&&ut||(ut={}),void 0!==ut.asn1&&ut.asn1||(ut.asn1={}),void 0!==ut.asn1.tsp&&ut.asn1.tsp||(ut.asn1.tsp={}),ut.asn1.tsp.TimeStampToken=function(t){var e=ut.asn1.tsp;e.TimeStampToken.superclass.constructor.call(this),this.params=null,this.getEncodedHexPrepare=function(){var t=new e.TSTInfo(this.params.econtent.content);this.params.econtent.content.hex=t.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.TimeStampToken,ut.asn1.cms.SignedData),ut.asn1.tsp.TSTInfo=function(t){Error;var e=ut.asn1,n=e.DERSequence,r=e.DERInteger,i=e.DERBoolean,s=e.DERGeneralizedTime,o=e.DERObjectIdentifier,a=e.DERTaggedObject,u=e.tsp,c=u.MessageImprint,l=u.Accuracy,h=(e.x509.X500Name,e.x509.GeneralName);if(u.TSTInfo.superclass.constructor.call(this),this.dVersion=new r({int:1}),this.dPolicy=null,this.dMessageImprint=null,this.dSerial=null,this.dGenTime=null,this.dAccuracy=null,this.dOrdering=null,this.dNonce=null,this.dTsa=null,this.tohex=function(){var t=[this.dVersion];if(null==this.dPolicy)throw new Error("policy shall be specified.");if(t.push(this.dPolicy),null==this.dMessageImprint)throw new Error("messageImprint shall be specified.");if(t.push(this.dMessageImprint),null==this.dSerial)throw new Error("serialNumber shall be specified.");if(t.push(this.dSerial),null==this.dGenTime)throw new Error("genTime shall be specified.");t.push(this.dGenTime),null!=this.dAccuracy&&t.push(this.dAccuracy),null!=this.dOrdering&&t.push(this.dOrdering),null!=this.dNonce&&t.push(this.dNonce),null!=this.dTsa&&t.push(this.dTsa);var e=new n({array:t});return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t){if("string"==typeof t.policy){if(!t.policy.match(/^[0-9.]+$/))throw"policy shall be oid like 0.1.4.134";this.dPolicy=new o({oid:t.policy})}void 0!==t.messageImprint&&(this.dMessageImprint=new c(t.messageImprint)),void 0!==t.serial&&(this.dSerial=new r(t.serial)),void 0!==t.genTime&&(this.dGenTime=new s(t.genTime)),void 0!==t.accuracy&&(this.dAccuracy=new l(t.accuracy)),void 0!==t.ordering&&1==t.ordering&&(this.dOrdering=new i),void 0!==t.nonce&&(this.dNonce=new r(t.nonce)),void 0!==t.tsa&&(this.dTsa=new a({tag:"a0",explicit:!0,obj:new h({dn:t.tsa})}))}},Zt(ut.asn1.tsp.TSTInfo,ut.asn1.ASN1Object),ut.asn1.tsp.Accuracy=function(t){var e=ut.asn1,n=e.ASN1Util.newObject;e.tsp.Accuracy.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];return null!=t.seconds&&"number"==typeof t.seconds&&e.push({int:t.seconds}),null!=t.millis&&"number"==typeof t.millis&&e.push({tag:{tagi:"80",obj:{int:t.millis}}}),null!=t.micros&&"number"==typeof t.micros&&e.push({tag:{tagi:"81",obj:{int:t.micros}}}),n({seq:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.Accuracy,ut.asn1.ASN1Object),ut.asn1.tsp.MessageImprint=function(t){var e=ut.asn1,n=e.DERSequence,r=e.DEROctetString,i=e.x509.AlgorithmIdentifier;e.tsp.MessageImprint.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=new i({name:t.alg}),s=new r({hex:t.hash});return new n({array:[e,s]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.tsp.MessageImprint,ut.asn1.ASN1Object),ut.asn1.tsp.TimeStampReq=function(t){var e=ut.asn1,n=e.DERSequence,r=e.DERInteger,i=e.DERBoolean,s=(e.ASN1Object,e.DERObjectIdentifier),o=e.tsp,a=o.MessageImprint;o.TimeStampReq.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];return e.push(new r({int:1})),t.messageImprint instanceof ut.asn1.ASN1Object?e.push(t.messageImprint):e.push(new a(t.messageImprint)),null!=t.policy&&e.push(new s(t.policy)),null!=t.nonce&&e.push(new r(t.nonce)),1==t.certreq&&e.push(new i),new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.TimeStampReq,ut.asn1.ASN1Object),ut.asn1.tsp.TimeStampResp=function(t){var e=ut.asn1,n=e.DERSequence,r=(e.ASN1Object,e.tsp),i=r.PKIStatusInfo;r.TimeStampResp.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,s=[];if(null!=t.econtent||null!=t.tst)if(null!=t.statusinfo?s.push(new i(t.statusinfo)):s.push(new i("granted")),null!=t.econtent)s.push(new r.TimeStampToken(t).getContentInfo());else{if(!(t.tst instanceof e.ASN1Object))throw new Error("improper member tst value");s.push(t.tst)}else{if(null==t.statusinfo)throw new Error("parameter for token nor statusinfo not specified");s.push(new i(t.statusinfo))}return new n({array:s}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.TimeStampResp,ut.asn1.ASN1Object),ut.asn1.tsp.PKIStatusInfo=function(t){var e=Error,n=ut.asn1,r=n.DERSequence,i=n.tsp,s=i.PKIStatus,o=i.PKIFreeText,a=i.PKIFailureInfo;i.PKIStatusInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,n=[];if("string"==typeof t)n.push(new s(t));else{if(null==t.status)throw new e("property 'status' unspecified");n.push(new s(t.status)),null!=t.statusstr&&n.push(new o(t.statusstr)),null!=t.failinfo&&n.push(new a(t.failinfo))}return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.PKIStatusInfo,ut.asn1.ASN1Object),ut.asn1.tsp.PKIStatus=function(t){var e=Error,n=ut.asn1,r=n.DERInteger;n.tsp.PKIStatus.superclass.constructor.call(this);var i={granted:0,grantedWithMods:1,rejection:2,waiting:3,revocationWarning:4,revocationNotification:5};this.params=null,this.tohex=function(){var t,n=this.params;if("string"==typeof n)try{t=i[n]}catch(t){throw new e("undefined name: "+n)}else{if("number"!=typeof n)throw new e("unsupported params");t=n}return new r({int:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.PKIStatus,ut.asn1.ASN1Object),ut.asn1.tsp.PKIFreeText=function(t){var e=Error,n=ut.asn1,r=n.DERSequence,i=n.DERUTF8String;n.tsp.PKIFreeText.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(!t instanceof Array)throw new e("wrong params: not array");for(var n=[],s=0;s<t.length;s++)n.push(new i({str:t[s]}));return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.PKIFreeText,ut.asn1.ASN1Object),ut.asn1.tsp.PKIFailureInfo=function(t){var e=Error,n=ut.asn1,r=n.DERBitString,i=n.tsp.PKIFailureInfo,s={badAlg:0,badRequest:2,badDataFormat:5,timeNotAvailable:14,unacceptedPolicy:15,unacceptedExtension:16,addInfoNotAvailable:17,systemFailure:25};i.superclass.constructor.call(this),this.params=null,this.getBinValue=function(){var t=this.params,n=0;if("number"==typeof t&&0<=t&&t<=25){for(var r=(n|=1<<t).toString(2),i="",o=r.length-1;o>=0;o--)i+=r[o];return i}if("string"==typeof t&&null!=s[t])return Jt([t],s);if("object"==typeof t&&null!=t.length)return Jt(t,s);throw new e("wrong params")},this.tohex=function(){this.params;var t=this.getBinValue();return new r({bin:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.tsp.PKIFailureInfo,ut.asn1.ASN1Object),ut.asn1.tsp.AbstractTSAAdapter=function(t){this.getTSTHex=function(t,e){throw"not implemented yet"}},ut.asn1.tsp.SimpleTSAAdapter=function(t){var e=ut,n=e.asn1.tsp,r=e.crypto.Util.hashHex;n.SimpleTSAAdapter.superclass.constructor.call(this),this.params=null,this.serial=0,this.getTSTHex=function(t,e){var i=r(t,e);this.params.econtent.content.messageImprint={alg:e,hash:i},this.params.econtent.content.serial={int:this.serial++};var s=Math.floor(1e9*Math.random());return this.params.econtent.content.nonce={int:s},new n.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==t&&(this.params=t)},Zt(ut.asn1.tsp.SimpleTSAAdapter,ut.asn1.tsp.AbstractTSAAdapter),ut.asn1.tsp.FixedTSAAdapter=function(t){var e=ut,n=e.asn1.tsp,r=e.crypto.Util.hashHex;n.FixedTSAAdapter.superclass.constructor.call(this),this.params=null,this.getTSTHex=function(t,e){var i=r(t,e);return this.params.econtent.content.messageImprint={alg:e,hash:i},new n.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==t&&(this.params=t)},Zt(ut.asn1.tsp.FixedTSAAdapter,ut.asn1.tsp.AbstractTSAAdapter),ut.asn1.tsp.TSPUtil=new function(){},ut.asn1.tsp.TSPUtil.newTimeStampToken=function(t){return new ut.asn1.tsp.TimeStampToken(t)},ut.asn1.tsp.TSPUtil.parseTimeStampReq=function(t){return(new ut.asn1.tsp.TSPParser).getTimeStampReq(t)},ut.asn1.tsp.TSPUtil.parseMessageImprint=function(t){return(new ut.asn1.tsp.TSPParser).getMessageImprint(t)},ut.asn1.tsp.TSPParser=function(){Error;var t=new re,e=ht,n=e.getV,r=e.getTLV,i=e.getIdxbyList,s=(e.getTLVbyListEx,e.getChildIdx),o=["granted","grantedWithMods","rejection","waiting","revocationWarning","revocationNotification"],a={0:"badAlg",2:"badRequest",5:"badDataFormat",14:"timeNotAvailable",15:"unacceptedPolicy",16:"unacceptedExtension",17:"addInfoNotAvailable",25:"systemFailure"};this.getResponse=function(t){var e=s(t,0);if(1==e.length)return this.getPKIStatusInfo(r(t,e[0]));if(e.length>1){var n=this.getPKIStatusInfo(r(t,e[0])),i=r(t,e[1]),o=this.getToken(i);return o.statusinfo=n,o}},this.getToken=function(t){var e=(new ut.asn1.cms.CMSParser).getCMSSignedData(t);return this.setTSTInfo(e),e},this.setTSTInfo=function(t){var e=t.econtent;if("tstinfo"==e.type){var n=e.content.hex,r=this.getTSTInfo(n);e.content=r}},this.getTSTInfo=function(e){var i={},o=s(e,0),a=n(e,o[1]);i.policy=zt(a);var u=r(e,o[2]);i.messageImprint=this.getMessageImprint(u);var c=n(e,o[3]);i.serial={hex:c};var l=n(e,o[4]);i.genTime={str:wt(l)};var h=0;if(o.length>5&&"30"==e.substr(o[5],2)){var f=r(e,o[5]);i.accuracy=this.getAccuracy(f),h++}o.length>5+h&&"01"==e.substr(o[5+h],2)&&("ff"==n(e,o[5+h])&&(i.ordering=!0),h++);if(o.length>5+h&&"02"==e.substr(o[5+h],2)){var p=n(e,o[5+h]);i.nonce={hex:p},h++}if(o.length>5+h&&"a0"==e.substr(o[5+h],2)){var d=r(e,o[5+h]);d="30"+d.substr(2),pGeneralNames=t.getGeneralNames(d);var g=pGeneralNames[0].dn;i.tsa=g,h++}if(o.length>5+h&&"a1"==e.substr(o[5+h],2)){var m=r(e,o[5+h]);m="30"+m.substr(2);var v=t.getExtParamArray(m);i.ext=v,h++}return i},this.getAccuracy=function(t){for(var e={},r=s(t,0),i=0;i<r.length;i++){var o=t.substr(r[i],2),a=n(t,r[i]),u=parseInt(a,16);"02"==o?e.seconds=u:"80"==o?e.millis=u:"81"==o&&(e.micros=u)}return e},this.getMessageImprint=function(t){if("30"!=t.substr(0,2))throw new Error("head of messageImprint hex shall be x30");var r={},o=(s(t,0),i(t,0,[0,0])),a=n(t,o),u=e.hextooidstr(a),c=ut.asn1.x509.OID.oid2name(u);if(""==c)throw new Error("hashAlg name undefined: "+u);var l=c,h=i(t,0,[1]);return r.alg=l,r.hash=n(t,h),r},this.getPKIStatusInfo=function(t){var e={},i=s(t,0),a=0;try{var u=n(t,i[0]),c=parseInt(u,16);e.status=o[c]}catch(t){}if(i.length>1&&"30"==t.substr(i[1],2)){var l=r(t,i[1]);e.statusstr=this.getPKIFreeText(l),a++}if(i.length>a&&"03"==t.substr(i[1+a],2)){var h=r(t,i[1+a]);e.failinfo=this.getPKIFailureInfo(h)}return e},this.getPKIFreeText=function(t){for(var n=[],r=s(t,0),i=0;i<r.length;i++)n.push(e.getString(t,r[i]));return n},this.getPKIFailureInfo=function(t){var n=e.getInt(t,0);return null!=a[n]?a[n]:n},this.getTimeStampReq=function(t){var i={certreq:!1},o=s(t,0);if(o.length<2)throw new Error("TimeStampReq must have at least 2 items");var a=r(t,o[1]);i.messageImprint=ut.asn1.tsp.TSPUtil.parseMessageImprint(a);for(var u=2;u<o.length;u++){var c=o[u],l=t.substr(c,2);if("06"==l){var h=n(t,c);i.policy=e.hextooidstr(h)}"02"==l&&(i.nonce=n(t,c)),"01"==l&&(i.certreq=!0)}return i}},void 0!==ut&&ut||(ut={}),void 0!==ut.asn1&&ut.asn1||(ut.asn1={}),void 0!==ut.asn1.cades&&ut.asn1.cades||(ut.asn1.cades={}),ut.asn1.cades.SignaturePolicyIdentifier=function(t){var e=ut.asn1.cades,n=e.SignaturePolicyId;e.SignaturePolicyIdentifier.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.15",this.params=null,this.getValueArray=function(){return[new n(this.params)]},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.SignaturePolicyIdentifier,ut.asn1.cms.Attribute),ut.asn1.cades.SignaturePolicyId=function(t){var e=ut.asn1,n=e.DERSequence,r=e.DERObjectIdentifier,i=(e.x509.AlgorithmIdentifier,e.cades),s=i.SignaturePolicyId,o=i.OtherHashAlgAndValue;s.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,e=[];return e.push(new r(t.oid)),e.push(new o(t)),new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.SignaturePolicyId,ut.asn1.ASN1Object),ut.asn1.cades.OtherHashAlgAndValue=function(t){var e=Error,n=ut.asn1,r=n.DERSequence,i=n.DEROctetString,s=n.x509.AlgorithmIdentifier;n.cades.OtherHashAlgAndValue.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if(null==t.alg)throw new e("property 'alg' not specified");if(null==t.hash&&null==t.cert)throw new e("property 'hash' nor 'cert' not specified");var n=null;if(null!=t.hash)n=t.hash;else if(null!=t.cert){if("string"!=typeof t.cert)throw new e("cert not string");var o=t.cert;-1!=t.cert.indexOf("-----BEGIN")&&(o=It(t.cert)),n=ut.crypto.Util.hashHex(o,t.alg)}var a=[];return a.push(new s({name:t.alg})),a.push(new i({hex:n})),new r({array:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.OtherHashAlgAndValue,ut.asn1.ASN1Object),ut.asn1.cades.OtherHashValue=function(t){ut.asn1.cades.OtherHashValue.superclass.constructor.call(this);var e=Error,n=ut,r=(n.lang.String.isHex,n.asn1.DEROctetString);n.crypto.Util.hashHex;this.params=null,this.tohex=function(){var t=this.params;if(null==t.hash&&null==t.cert)throw new e("hash or cert not specified");var n=null;if(null!=t.hash)n=t.hash;else if(null!=t.cert){if("string"!=typeof t.cert)throw new e("cert not string");var i=t.cert;-1!=t.cert.indexOf("-----BEGIN")&&(i=It(t.cert)),n=ut.crypto.Util.hashHex(i,"sha1")}return new r({hex:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.OtherHashValue,ut.asn1.ASN1Object),ut.asn1.cades.SignatureTimeStamp=function(t){var e=Error,n=ut,r=n.lang.String.isHex,i=n.asn1,s=i.ASN1Object;i.x509;i.cades.SignatureTimeStamp.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.14",this.params=null,this.getValueArray=function(){var t=this.params;if(null!=t.tst){if(r(t.tst))return(i=new s).hTLV=t.tst,[i];if(t.tst instanceof s)return[t.tst];throw new e("params.tst has wrong value")}if(null!=t.res){var n=t.res;if(n instanceof s&&(n=n.tohex()),"string"!=typeof n||!r(n))throw new e("params.res has wrong value");var i;ht.getTLVbyList(n,0,[1]);return(i=new s).hTLV=t.tst,[i]}},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.SignatureTimeStamp,ut.asn1.cms.Attribute),ut.asn1.cades.CompleteCertificateRefs=function(t){var e=Error,n=ut,r=n.asn1,i=r.DERSequence,s=r.cades,o=s.OtherCertID,a=n.lang.String.isHex;s.CompleteCertificateRefs.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.21",this.params=null,this.getValueArray=function(){for(var t=this.params,n=[],r=0;r<t.array.length;r++){var s=t.array[r];if("string"==typeof s)if(-1!=s.indexOf("-----BEGIN"))s={cert:s};else{if(!a(s))throw new e("unsupported value: "+s);s={hash:s}}null!=t.alg&&null==s.alg&&(s.alg=t.alg),null!=t.hasis&&null==s.hasis&&(s.hasis=t.hasis);var u=new o(s);n.push(u)}return[new i({array:n})]},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.CompleteCertificateRefs,ut.asn1.cms.Attribute),ut.asn1.cades.OtherCertID=function(t){var e=ut.asn1,n=e.DERSequence,r=e.cms.IssuerSerial,i=e.cades,s=i.OtherHashValue,o=i.OtherHashAlgAndValue;i.OtherCertID.superclass.constructor.call(this),this.params=t,this.tohex=function(){var t=this.params;"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?t={cert:t}:_isHex(t)&&(t={hash:t}));var e=[],i=null;if(i=null!=t.alg?new o(t):new s(t),e.push(i),null!=t.cert&&1==t.hasis||null!=t.issuer&&null!=t.serial){var a=new r(t);e.push(a)}return new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.OtherCertID,ut.asn1.ASN1Object),ut.asn1.cades.OtherHash=function(t){Error;var e=ut,n=e.asn1,r=(n.cms,n.cades),i=r.OtherHashAlgAndValue,s=r.OtherHashValue,o=(e.crypto.Util.hashHex,e.lang.String.isHex);r.OtherHash.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?t={cert:t}:o(t)&&(t={hash:t}));return(null!=t.alg?new i(t):new s(t)).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.cades.OtherHash,ut.asn1.ASN1Object),ut.asn1.cades.CAdESUtil=new function(){},ut.asn1.cades.CAdESUtil.parseSignedDataForAddingUnsigned=function(t){return(new ut.asn1.cms.CMSParser).getCMSSignedData(t)},ut.asn1.cades.CAdESUtil.parseSignerInfoForAddingUnsigned=function(t,e,n){var r=ht,i=r.getChildIdx,s=r.getTLV,o=r.getV,a=ut.asn1,u=a.ASN1Object,c=a.cms,l=c.AttributeList,h=c.SignerInfo,f={},p=i(t,e);if(6!=p.length)throw"not supported items for SignerInfo (!=6)";var d=p.shift();f.version=s(t,d);var g=p.shift();f.si=s(t,g);var m=p.shift();f.digalg=s(t,m);var v=p.shift();f.sattrs=s(t,v);var y=p.shift();f.sigalg=s(t,y);var b=p.shift();f.sig=s(t,b),f.sigval=o(t,b);var x=null;return f.obj=new h,(x=new u).hTLV=f.version,f.obj.dCMSVersion=x,(x=new u).hTLV=f.si,f.obj.dSignerIdentifier=x,(x=new u).hTLV=f.digalg,f.obj.dDigestAlgorithm=x,(x=new u).hTLV=f.sattrs,f.obj.dSignedAttrs=x,(x=new u).hTLV=f.sigalg,f.obj.dSigAlg=x,(x=new u).hTLV=f.sig,f.obj.dSig=x,f.obj.dUnsignedAttrs=new l,f},void 0!==ut.asn1.csr&&ut.asn1.csr||(ut.asn1.csr={}),ut.asn1.csr.CertificationRequest=function(t){var e=ut.asn1,n=e.DERBitString,r=e.DERSequence,i=e.csr,s=(e.x509,i.CertificationRequestInfo);i.CertificationRequest.superclass.constructor.call(this),this.setByParam=function(t){this.params=t},this.sign=function(){var t=new s(this.params).tohex(),e=new ut.crypto.Signature({alg:this.params.sigalg});e.init(this.params.sbjprvkey),e.updateHex(t);var n=e.sign();this.params.sighex=n},this.getPEM=function(){return $t(this.tohex(),"CERTIFICATE REQUEST")},this.tohex=function(){var t=this.params,e=new ut.asn1.csr.CertificationRequestInfo(this.params),i=new ut.asn1.x509.AlgorithmIdentifier({name:t.sigalg});if(null==t.sighex&&null!=t.sbjprvkey&&this.sign(),null==t.sighex)throw new Error("sighex or sbjprvkey parameter not defined");var s=new n({hex:"00"+t.sighex});return new r({array:[e,i,s]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.csr.CertificationRequest,ut.asn1.ASN1Object),ut.asn1.csr.CertificationRequestInfo=function(t){var e=ut.asn1,n=(e.DERBitString,e.DERSequence),r=e.DERInteger,i=e.DERUTF8String,s=e.DERTaggedObject,o=e.ASN1Util.newObject,a=e.csr,u=e.x509,c=u.X500Name,l=u.Extensions,h=u.SubjectPublicKeyInfo;a.AttributeList;a.CertificationRequestInfo.superclass.constructor.call(this),this.params=null,this.setByParam=function(t){null!=t&&(this.params=t)},this.tohex=function(){var t=this.params,e=[];if(e.push(new r({int:0})),e.push(new c(t.subject)),e.push(new h(Qt.getKey(t.sbjpubkey))),null!=t.attrs){var a=function(t){for(var e=Error,n=ut.asn1.x509.Extensions,r=[],i=0;i<t.length;i++){var s=t[i],o=s.attr;if("extensionRequest"==o){var a={seq:[{oid:"1.2.840.113549.1.9.14"},{set:[new n(s.ext)]}]};r.push(a)}else if("unstructuredName"==o){a={seq:[{oid:"1.2.840.113549.1.9.2"},{set:s.names}]};r.push(a)}else{if("challengePassword"!=o)throw new e("unknown CSR attribute");a={seq:[{oid:"1.2.840.113549.1.9.7"},{set:[{utf8str:s.password}]}]};r.push(a)}}return{set:r}}(t.attrs),u=o({tag:{tage:"a0",obj:a}});e.push(u)}else if(null!=t.extreq){var f=new l(t.extreq);u=o({tag:{tage:"a0",obj:{seq:[{oid:"1.2.840.113549.1.9.14"},{set:[f]}]}}});e.push(u)}else e.push(new s({tag:"a0",explicit:!1,obj:new i({str:""})}));return new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=t&&this.setByParam(t)},Zt(ut.asn1.csr.CertificationRequestInfo,ut.asn1.ASN1Object),ut.asn1.csr.AttributeList=function(t){},Zt(ut.asn1.csr.AttributeList,ut.asn1.ASN1Object),ut.asn1.csr.CSRUtil=new function(){},ut.asn1.csr.CSRUtil.newCSRPEM=function(t){return new ut.asn1.csr.CertificationRequest(t).getPEM()},ut.asn1.csr.CSRUtil.getParam=function(t,e){var n=ht,r=n.getV,i=n.getIdxbyList,s=n.getTLVbyList,o=n.getTLVbyListEx,a=n.getVbyListEx,u={};if(-1==t.indexOf("-----BEGIN CERTIFICATE REQUEST"))throw new Error("argument is not PEM file");var c=It(t,"CERTIFICATE REQUEST");e&&(u.tbs=s(c,0,[0]));try{var l=o(c,0,[0,1]);if("3000"==l)u.subject={};else{var h=new re;u.subject=h.getX500Name(l)}}catch(t){}var f=o(c,0,[0,2]),p=Qt.getKey(f,null,"pkcs8pub");u.sbjpubkey=Qt.getPEM(p,"PKCS8PUB");var d=function(t){var e=i(t,0,[0,3,0,0],"06");return"2a864886f70d01090e"!=r(t,e)?null:s(t,0,[0,3,0,1,0],"30")}(c);h=new re;null!=d&&(u.extreq=h.getExtParamArray(d));try{var g=o(c,0,[1],"30");h=new re;u.sigalg=h.getAlgorithmIdentifierName(g)}catch(t){}try{var m=a(c,0,[2]);u.sighex=m}catch(t){}return u},ut.asn1.csr.CSRUtil.verifySignature=function(t){try{var e=null;if("string"==typeof t&&-1!=t.indexOf("-----BEGIN CERTIFICATE REQUEST")?e=ut.asn1.csr.CSRUtil.getParam(t,!0):"object"==typeof t&&null!=t.sbjpubkey&&null!=t.sigalg&&null!=t.sighex&&null!=t.tbs&&(e=t),null==e)return!1;var n=new ut.crypto.Signature({alg:e.sigalg});return n.init(e.sbjpubkey),n.updateHex(e.tbs),n.verify(e.sighex)}catch(t){return alert(t),!1}},void 0!==ut&&ut||(ut={}),void 0!==ut.asn1&&ut.asn1||(ut.asn1={}),void 0!==ut.asn1.ocsp&&ut.asn1.ocsp||(ut.asn1.ocsp={}),ut.asn1.ocsp.DEFAULT_HASH="sha1",ut.asn1.ocsp.OCSPResponse=function(t){ut.asn1.ocsp.OCSPResponse.superclass.constructor.call(this);ut.asn1.DEREnumerated;var e=ut.asn1.ASN1Util.newObject,n=ut.asn1.ocsp.ResponseBytes,r=["successful","malformedRequest","internalError","tryLater","_not_used_","sigRequired","unauthorized"];this.params=null,this._getStatusCode=function(){var t=this.params.resstatus;return"number"==typeof t?t:"string"!=typeof t?-1:r.indexOf(t)},this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params,r=this._getStatusCode();if(-1==r)throw new Error("responseStatus not supported: "+t.resstatus);if(0!=r)return e({seq:[{enum:{int:r}}]}).tohex();var i=new n(t);return e({seq:[{enum:{int:0}},{tag:{tag:"a0",explicit:!0,obj:i}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.OCSPResponse,ut.asn1.ASN1Object),ut.asn1.ocsp.ResponseBytes=function(t){ut.asn1.ocsp.ResponseBytes.superclass.constructor.call(this);var e=ut.asn1,n=e.DERSequence,r=e.DERObjectIdentifier,i=e.DEROctetString,s=e.ocsp.BasicOCSPResponse;this.params=null,this.setByParam=function(t){this.params=t},this.tohex=function(){var t=this.params;if("ocspBasic"!=t.restype)throw new Error("not supported responseType: "+t.restype);var e=new s(t),o=[];return o.push(new r({name:"ocspBasic"})),o.push(new i({hex:e.tohex()})),new n({array:o}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.ResponseBytes,ut.asn1.ASN1Object),ut.asn1.ocsp.BasicOCSPResponse=function(t){ut.asn1.ocsp.BasicOCSPResponse.superclass.constructor.call(this);var e=Error,n=ut.asn1,r=n.ASN1Object,i=n.DERSequence,s=(n.DERGeneralizedTime,n.DERTaggedObject),o=n.DERBitString,a=(n.x509.Extensions,n.x509.AlgorithmIdentifier),u=n.ocsp;u.ResponderID;_SingleResponseList=u.SingleResponseList,_ResponseData=u.ResponseData,this.params=null,this.setByParam=function(t){this.params=t},this.sign=function(){var t=this.params,e=t.tbsresp.tohex(),n=new ut.crypto.Signature({alg:t.sigalg});n.init(t.reskey),n.updateHex(e),t.sighex=n.sign()},this.tohex=function(){var t=this.params;null==t.tbsresp&&(t.tbsresp=new _ResponseData(t)),null==t.sighex&&null!=t.reskey&&this.sign();var n=[];if(n.push(t.tbsresp),n.push(new a({name:t.sigalg})),n.push(new o({hex:"00"+t.sighex})),null!=t.certs&&null!=t.certs.length){for(var u=[],c=0;c<t.certs.length;c++){var l=t.certs[c],h=null;if(ht.isASN1HEX(l))h=l;else{if(!l.match(/-----BEGIN/))throw new e("certs["+c+"] not hex or PEM");h=It(l)}u.push(new r({tlv:h}))}var f=new i({array:u});n.push(new s({tag:"a0",explicit:!0,obj:f}))}return new i({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.BasicOCSPResponse,ut.asn1.ASN1Object),ut.asn1.ocsp.ResponseData=function(t){ut.asn1.ocsp.ResponseData.superclass.constructor.call(this);var e=Error,n=ut.asn1,r=n.DERSequence,i=n.DERGeneralizedTime,s=n.DERTaggedObject,o=n.x509.Extensions,a=n.ocsp,u=a.ResponderID;_SingleResponseList=a.SingleResponseList,this.params=null,this.tohex=function(){var t=this.params;null!=t.respid&&new e("respid not specified"),null!=t.prodat&&new e("prodat not specified"),null!=t.array&&new e("array not specified");var n=[];if(n.push(new u(t.respid)),n.push(new i(t.prodat)),n.push(new _SingleResponseList(t.array)),null!=t.ext){var a=new o(t.ext);n.push(new s({tag:"a1",explicit:!0,obj:a}))}return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.ResponseData,ut.asn1.ASN1Object),ut.asn1.ocsp.ResponderID=function(t){ut.asn1.ocsp.ResponderID.superclass.constructor.call(this);var e=ut,n=e.asn1,r=n.ASN1Util.newObject,i=n.x509.X500Name,s=e.lang.String.isHex,o=Error;this.params=null,this.tohex=function(){var t=this.params;if(null!=t.key){var e,n=null;if("string"==typeof t.key){if(s(t.key)&&(n=t.key),t.key.match(/-----BEGIN CERTIFICATE/))null!=(e=new re(t.key).getExtSubjectKeyIdentifier())&&(n=e.kid.hex)}else if(t.key instanceof re)null!=(e=t.key.getExtSubjectKeyIdentifier())&&(n=e.kid.hex);if(null==n)throw new o("wrong key member value");return r({tag:{tag:"a2",explicit:!0,obj:{octstr:{hex:n}}}}).tohex()}if(null!=t.name){var a=null;if("string"==typeof t.name&&t.name.match(/-----BEGIN CERTIFICATE/))a=new re(t.name).getSubject();else t.name instanceof re?a=t.name.getSubject():"object"!=typeof t.name||null==t.name.array&&null==t.name.str||(a=t.name);if(null==a)throw new o("wrong name member value");return r({tag:{tag:"a1",explicit:!0,obj:new i(a)}}).tohex()}throw new o("key or name not specified")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.ResponderID,ut.asn1.ASN1Object),ut.asn1.ocsp.SingleResponseList=function(t){ut.asn1.ocsp.SingleResponseList.superclass.constructor.call(this);var e=ut.asn1,n=e.DERSequence,r=e.ocsp.SingleResponse;this.params=null,this.tohex=function(){var t=this.params;if("object"!=typeof t||null==t.length)throw new Error("params not specified properly");for(var e=[],i=0;i<t.length;i++)e.push(new r(t[i]));return new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.SingleResponseList,ut.asn1.ASN1Object),ut.asn1.ocsp.SingleResponse=function(t){var e=Error,n=ut.asn1,r=n.DERSequence,i=n.DERGeneralizedTime,s=n.DERTaggedObject,o=n.ocsp,a=o.CertID,u=o.CertStatus,c=n.x509.Extensions;o.SingleResponse.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params,n=[];if(null==t.certid)throw new e("certid unspecified");if(null==t.status)throw new e("status unspecified");if(null==t.thisupdate)throw new e("thisupdate unspecified");if(n.push(new a(t.certid)),n.push(new u(t.status)),n.push(new i(t.thisupdate)),null!=t.nextupdate){var o=new i(t.nextupdate);n.push(new s({tag:"a0",explicit:!0,obj:o}))}if(null!=t.ext){var l=new c(t.ext);n.push(new s({tag:"a1",explicit:!0,obj:l}))}return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.SingleResponse,ut.asn1.ASN1Object),ut.asn1.ocsp.CertID=function(t){var e=ut,n=e.asn1,r=n.DEROctetString,i=n.DERInteger,s=n.DERSequence,o=n.x509.AlgorithmIdentifier,a=n.ocsp,u=(a.DEFAULT_HASH,e.crypto.Util.hashHex),c=re,l=ht.getVbyList;a.CertID.superclass.constructor.call(this),this.DEFAULT_HASH="sha1",this.params=null,this.setByValue=function(t,e,n,r){null==r&&(r=this.DEFAULT_HASH),this.params={alg:r,issname:t,isskey:e,sbjsn:n}},this.setByCert=function(t,e,n){null==n&&(n=this.DEFAULT_HASH),this.params={alg:n,issuerCert:t,subjectCert:e}},this.getParamByCerts=function(t,e,n){null==n&&(n=this.DEFAULT_HASH);var r=new c(t),i=new c(e),s=u(r.getSubjectHex(),n),o=r.getPublicKeyHex();return{alg:n,issname:s,isskey:u(l(o,0,[1],"03",!0),n),sbjsn:i.getSerialNumberHex()}},this.tohex=function(){if("object"!=typeof this.params)throw new Error("params not set");var t,e,n,a,u=this.params;if(a=null==u.alg?this.DEFAULT_HASH:u.alg,null!=u.issuerCert&&null!=u.subjectCert){var c=this.getParamByCerts(u.issuerCert,u.subjectCert,a);t=c.issname,e=c.isskey,n=c.sbjsn}else{if(null==u.issname||null==u.isskey||null==u.sbjsn)throw new Error("required param members not defined");t=u.issname,e=u.isskey,n=u.sbjsn}var l=new o({name:a}),h=new r({hex:t}),f=new r({hex:e}),p=new i({hex:n}),d=new s({array:[l,h,f,p]});return this.hTLV=d.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.CertID,ut.asn1.ASN1Object),ut.asn1.ocsp.CertStatus=function(t){ut.asn1.ocsp.CertStatus.superclass.constructor.call(this),this.params=null,this.tohex=function(){var t=this.params;if("good"==t.status)return"8000";if("unknown"==t.status)return"8200";if("revoked"==t.status){var e=[{gentime:{str:t.time}}];null!=t.reason&&e.push({tag:{tag:"a0",explicit:!0,obj:{enum:{int:t.reason}}}});var n={tag:"a1",explicit:!1,obj:{seq:e}};return ut.asn1.ASN1Util.newObject({tag:n}).tohex()}throw new Error("bad status")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(t){this.params=t},void 0!==t&&this.setByParam(t)},Zt(ut.asn1.ocsp.CertStatus,ut.asn1.ASN1Object),ut.asn1.ocsp.Request=function(t){var e=ut.asn1,n=e.DERSequence,r=e.ocsp;if(r.Request.superclass.constructor.call(this),this.dReqCert=null,this.dExt=null,this.tohex=function(){var t=[];if(null===this.dReqCert)throw"reqCert not set";t.push(this.dReqCert);var e=new n({array:t});return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t){var i=new r.CertID(t);this.dReqCert=i}},Zt(ut.asn1.ocsp.Request,ut.asn1.ASN1Object),ut.asn1.ocsp.TBSRequest=function(t){var e=ut.asn1,n=e.DERSequence,r=e.ocsp;r.TBSRequest.superclass.constructor.call(this),this.version=0,this.dRequestorName=null,this.dRequestList=[],this.dRequestExt=null,this.setRequestListByParam=function(t){for(var e=[],n=0;n<t.length;n++){var i=new r.Request(t[0]);e.push(i)}this.dRequestList=e},this.tohex=function(){var t=[];if(0!==this.version)throw"not supported version: "+this.version;if(null!==this.dRequestorName)throw"requestorName not supported";var e=new n({array:this.dRequestList});if(t.push(e),null!==this.dRequestExt)throw"requestExtensions not supported";var r=new n({array:t});return this.hTLV=r.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&void 0!==t.reqList&&this.setRequestListByParam(t.reqList)},Zt(ut.asn1.ocsp.TBSRequest,ut.asn1.ASN1Object),ut.asn1.ocsp.OCSPRequest=function(t){var e=ut.asn1,n=e.DERSequence,r=e.ocsp;if(r.OCSPRequest.superclass.constructor.call(this),this.dTbsRequest=null,this.dOptionalSignature=null,this.tohex=function(){var t=[];if(null===this.dTbsRequest)throw"tbsRequest not set";if(t.push(this.dTbsRequest),null!==this.dOptionalSignature)throw"optionalSignature not supported";var e=new n({array:t});return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==t&&void 0!==t.reqList){var i=new r.TBSRequest(t);this.dTbsRequest=i}},Zt(ut.asn1.ocsp.OCSPRequest,ut.asn1.ASN1Object),ut.asn1.ocsp.OCSPUtil={},ut.asn1.ocsp.OCSPUtil.getRequestHex=function(t,e,n){var r=ut.asn1.ocsp;void 0===n&&(n=r.DEFAULT_HASH);var i={alg:n,issuerCert:t,subjectCert:e};return new r.OCSPRequest({reqList:[i]}).tohex()},ut.asn1.ocsp.OCSPUtil.getOCSPResponseInfo=function(t){var e=ht,n=e.getVbyList,r=e.getVbyListEx,i=e.getIdxbyList,s=(e.getIdxbyListEx,e.getV),o={};try{var a=r(t,0,[0],"0a");o.responseStatus=parseInt(a,16)}catch(t){}if(0!==o.responseStatus)return o;try{var u=i(t,0,[1,0,1,0,0,2,0,1]);"80"===t.substr(u,2)?o.certStatus="good":"a1"===t.substr(u,2)?(o.certStatus="revoked",o.revocationTime=wt(n(t,u,[0]))):"82"===t.substr(u,2)&&(o.certStatus="unknown")}catch(t){}try{var c=i(t,0,[1,0,1,0,0,2,0,2]);o.thisUpdate=wt(s(t,c))}catch(t){}try{var l=i(t,0,[1,0,1,0,0,2,0,3]);"a0"===t.substr(l,2)&&(o.nextUpdate=wt(n(t,l,[0])))}catch(t){}return o},ut.asn1.ocsp.OCSPParser=function(){var t=Error,e=re,n=new e,r=ht,i=r.getV,s=r.getTLV,o=r.getIdxbyList,a=r.getVbyList,u=r.getTLVbyList,c=r.getVbyListEx,l=r.getTLVbyListEx,h=r.getChildIdx;this.getOCSPRequest=function(e){var n=h(e,0);if(1!=n.length&&2!=n.length)throw new t("wrong number elements: "+n.length);return this.getTBSRequest(s(e,n[0]))},this.getTBSRequest=function(t){var e={},r=l(t,0,[0],"30");e.array=this.getRequestList(r);var i=l(t,0,["[2]",0],"30");return null!=i&&(e.ext=n.getExtParamArray(i)),e},this.getRequestList=function(t){for(var e=[],n=h(t,0),r=0;r<n.length;r++){t=s(t,n[r]);e.push(this.getRequest(t))}return e},this.getRequest=function(e){var r=h(e,0);if(1!=r.length&&2!=r.length)throw new t("wrong number elements: "+r.length);var i=this.getCertID(s(e,r[0]));if(2==r.length){var a=o(e,0,[1,0]);i.ext=n.getExtParamArray(s(e,a))}return i},this.getCertID=function(n){var r=h(n,0);if(4!=r.length)throw new t("wrong number elements: "+r.length);var o=new e,a={};return a.alg=o.getAlgorithmIdentifierName(s(n,r[0])),a.issname=i(n,r[1]),a.isskey=i(n,r[2]),a.sbjsn=i(n,r[3]),a},this.getOCSPResponse=function(t){var e,n=h(t,0),r=i(t,n[0]),s=parseInt(r);if(1==n.length)return{resstatus:s};var o=u(t,0,[1,0]);return(e=this.getResponseBytes(o)).resstatus=s,e},this.getResponseBytes=function(t){var e,n=h(t,0),r=u(t,0,[1,0]);e=this.getBasicOCSPResponse(r);var s=i(t,n[0]);return e.restype=ut.asn1.x509.OID.oid2name(zt(s)),e},this.getBasicOCSPResponse=function(t){var e,n=h(t,0);e=this.getResponseData(s(t,n[0]));var r=new re;e.alg=r.getAlgorithmIdentifierName(s(t,n[1]));var o=i(t,n[2]);e.sighex=o.substr(2);var a=c(t,0,["[0]"]);if(null!=a){for(var u=h(a,0),l=[],f=0;f<u.length;f++){var p=s(a,u[f]);l.push(p)}e.certs=l}return e},this.getResponseData=function(t){var e=h(t,0),n=e.length,r={},o=0;"a0"==t.substr(e[0],2)&&o++,r.respid=this.getResponderID(s(t,e[o++]));var a=i(t,e[o++]);if(r.prodat=wt(a),r.array=this.getSingleResponseList(s(t,e[o++])),"a1"==t.substr(e[n-1],2)){var c=u(t,e[n-1],[0]),l=new re;r.ext=l.getExtParamArray(c)}return r},this.getResponderID=function(t){var e={};if("a2"==t.substr(0,2)){var n=a(t,0,[0]);e.key=n}if("a1"==t.substr(0,2)){var r=u(t,0,[0]),i=new re;e.name=i.getX500Name(r)}return e},this.getSingleResponseList=function(t){for(var e=h(t,0),n=[],r=0;r<e.length;r++){var i=this.getSingleResponse(s(t,e[r]));n.push(i)}return n},this.getSingleResponse=function(t){var e=h(t,0),n={},r=this.getCertID(s(t,e[0]));n.certid=r;var o=this.getCertStatus(s(t,e[1]));if(n.status=o,"18"==t.substr(e[2],2)){var c=i(t,e[2]);n.thisupdate=wt(c)}for(var l=3;l<e.length;l++){if("a0"==t.substr(e[l],2)){var f=a(t,e[l],[0],"18");n.nextupdate=wt(f)}if("a1"==t.substr(e[l],2)){var p=new re,d=u(t,0,[l,0]);n.ext=p.getExtParamArray(d)}}return n},this.getCertStatus=function(t){var e={};if("8000"==t)return{status:"good"};if("8200"==t)return{status:"unknown"};if("a1"==t.substr(0,2)){e.status="revoked";var n=wt(a(t,0,[0]));e.time=n}return e}},void 0!==ut&&ut||(ut={}),void 0!==ut.lang&&ut.lang||(ut.lang={}),ut.lang.String=function(){},"function"==typeof t?(ct=function(e){return mt(t.from(e,"utf8").toString("base64"))},lt=function(e){return t.from(vt(e),"base64").toString("utf8")}):(ct=function(t){return yt(_t(Mt(t)))},lt=function(t){return decodeURIComponent(Pt(bt(t)))}),ut.lang.String.isInteger=function(t){return!!t.match(/^[0-9]+$/)||!!t.match(/^-[0-9]+$/)},ut.lang.String.isHex=function(t){return Ut(t)},ut.lang.String.isBase64=function(t){return!(!(t=t.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||t.length%4!=0)},ut.lang.String.isBase64URL=function(t){return!t.match(/[+/=]/)&&(t=vt(t),ut.lang.String.isBase64(t))},ut.lang.String.isIntegerArray=function(t){return!!(t=t.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},ut.lang.String.isPrintable=function(t){return null!==t.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},ut.lang.String.isIA5=function(t){return null!==t.match(/^[\x20-\x21\x23-\x7f]*$/)},ut.lang.String.isMail=function(t){return null!==t.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};function Kt(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},n=function(t){var n="",r=parseInt(t,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var s="",o=0;o<i;o++)s+="0";r=s+r;for(o=0;o<r.length-1;o+=7){var a=r.substr(o,7);o!=r.length-7&&(a="1"+a),n+=e(parseInt(a,2))}return n};try{if(!t.match(/^[0-9.]+$/))return null;var r="",i=t.split("."),s=40*parseInt(i[0],10)+parseInt(i[1],10);r+=e(s),i.splice(0,2);for(var o=0;o<i.length;o++)r+=n(i[o]);return r}catch(t){return null}}function zt(t){if(!Ut(t))return null;try{var e=[],n=t.substr(0,2),r=parseInt(n,16);e[0]=new String(Math.floor(r/40)),e[1]=new String(r%40);for(var i=t.substr(2),s=[],o=0;o<i.length/2;o++)s.push(parseInt(i.substr(2*o,2),16));var a=[],u="";for(o=0;o<s.length;o++)128&s[o]?u+=Gt((127&s[o]).toString(2),7):(u+=Gt((127&s[o]).toString(2),7),a.push(new String(parseInt(u,2))),u="");var c=e.join(".");return a.length>0&&(c=c+"."+a.join(".")),c}catch(t){return null}}var Gt=function(t,e,n){return null==n&&(n="0"),t.length>=e?t:new Array(e-t.length+1).join(n)+t};function Wt(t){if(t.length%2!=0)return-1;if(null==(t=t.toLowerCase()).match(/^[0-9a-f]+$/))return-1;try{var e=t.substr(0,2);if("00"==e)return parseInt(t.substr(2),16);var n=parseInt(e,16);if(n>7)return-1;var r=t.substr(2),i=parseInt(r,16).toString(2);"0"==i&&(i="00000000"),i=i.slice(0,0-n);var s=parseInt(i,2);return NaN==s?-1:s}catch(t){return-1}}function Yt(t){if("number"!=typeof t)return null;if(t<0)return null;var e=Number(t).toString(2),n=8-e.length%8;8==n&&(n=0),e+=Gt("",n,"0");var r=parseInt(e,2).toString(16);return r.length%2==1&&(r="0"+r),"0"+n+r}function Xt(t){if("string"!=typeof t)return null;if(t.length%2!=0)return null;if(!t.match(/^[0-9a-f]+$/))return null;try{var e=parseInt(t.substr(0,2),16);if(e<0||7<e)return null;for(var n=t.substr(2),r="",i=0;i<n.length;i+=2){var s=n.substr(i,2),o=parseInt(s,16).toString(2);r+=o=("0000000"+o).slice(-8)}return r.substr(0,r.length-e)}catch(t){return null}}function Jt(t,e){for(var n=0,r=0;r<t.length;r++)n|=1<<e[t[r]];var i=n.toString(2),s="";for(r=i.length-1;r>=0;r--)s+=i[r];return s}function Zt(t,e){var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e)}void 0!==ut&&ut||(ut={}),void 0!==ut.crypto&&ut.crypto||(ut.crypto={}),ut.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:g.algo.MD5,sha1:g.algo.SHA1,sha224:g.algo.SHA224,sha256:g.algo.SHA256,sha384:g.algo.SHA384,sha512:g.algo.SHA512,ripemd160:g.algo.RIPEMD160},this.getDigestInfoHex=function(t,e){if(void 0===this.DIGESTINFOHEAD[e])throw"alg not supported in Util.DIGESTINFOHEAD: "+e;return this.DIGESTINFOHEAD[e]+t},this.getPaddedDigestInfoHex=function(t,e,n){var r=this.getDigestInfoHex(t,e),i=n/4;if(r.length+22>i)throw"key is too short for SigAlg: keylen="+n+","+e;for(var s="0001",o="00"+r,a="",u=i-s.length-o.length,c=0;c<u;c+=2)a+="ff";return s+a+o},this.hashString=function(t,e){return new ut.crypto.MessageDigest({alg:e}).digestString(t)},this.hashHex=function(t,e){return new ut.crypto.MessageDigest({alg:e}).digestHex(t)},this.sha1=function(t){return this.hashString(t,"sha1")},this.sha256=function(t){return this.hashString(t,"sha256")},this.sha256Hex=function(t){return this.hashHex(t,"sha256")},this.sha512=function(t){return this.hashString(t,"sha512")},this.sha512Hex=function(t){return this.hashHex(t,"sha512")},this.isKey=function(t){return t instanceof nt||t instanceof ut.crypto.DSA||t instanceof ut.crypto.ECDSA}},ut.crypto.Util.md5=function(t){return new ut.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(t)},ut.crypto.Util.ripemd160=function(t){return new ut.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(t)},ut.crypto.Util.SECURERANDOMGEN=new Q,ut.crypto.Util.getRandomHexOfNbytes=function(t){var e=new Array(t);return ut.crypto.Util.SECURERANDOMGEN.nextBytes(e),dt(e)},ut.crypto.Util.getRandomBigIntegerOfNbytes=function(t){return new w(ut.crypto.Util.getRandomHexOfNbytes(t),16)},ut.crypto.Util.getRandomHexOfNbits=function(t){var e=t%8,n=new Array((t-e)/8+1);return ut.crypto.Util.SECURERANDOMGEN.nextBytes(n),n[0]=(255<<e&255^255)&n[0],dt(n)},ut.crypto.Util.getRandomBigIntegerOfNbits=function(t){return new w(ut.crypto.Util.getRandomHexOfNbits(t),16)},ut.crypto.Util.getRandomBigIntegerZeroToMax=function(t){for(var e=t.bitLength();;){var n=ut.crypto.Util.getRandomBigIntegerOfNbits(e);if(-1!=t.compareTo(n))return n}},ut.crypto.Util.getRandomBigIntegerMinToMax=function(t,e){var n=t.compareTo(e);if(1==n)throw"biMin is greater than biMax";if(0==n)return t;var r=e.subtract(t);return ut.crypto.Util.getRandomBigIntegerZeroToMax(r).add(t)},ut.crypto.MessageDigest=function(t){this.setAlgAndProvider=function(t,e){if(null!==(t=ut.crypto.MessageDigest.getCanonicalAlgName(t))&&void 0===e&&(e=ut.crypto.Util.DEFAULTPROVIDER[t]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(t)&&"cryptojs"==e){try{this.md=ut.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[t].create()}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=g.enc.Hex.parse(t);this.md.update(e)},this.digest=function(){return this.md.finalize().toString(g.enc.Hex)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}if(-1!=":sha256:".indexOf(t)&&"sjcl"==e){try{this.md=new sjcl.hash.sha256}catch(e){throw"setAlgAndProvider hash alg set fail alg="+t+"/"+e}this.updateString=function(t){this.md.update(t)},this.updateHex=function(t){var e=sjcl.codec.hex.toBits(t);this.md.update(e)},this.digest=function(){var t=this.md.finalize();return sjcl.codec.hex.fromBits(t)},this.digestString=function(t){return this.updateString(t),this.digest()},this.digestHex=function(t){return this.updateHex(t),this.digest()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==t&&void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=ut.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},ut.crypto.MessageDigest.getCanonicalAlgName=function(t){return"string"==typeof t&&(t=(t=t.toLowerCase()).replace(/-/,"")),t},ut.crypto.MessageDigest.getHashLength=function(t){var e=ut.crypto.MessageDigest,n=e.getCanonicalAlgName(t);if(void 0===e.HASHLENGTH[n])throw"not supported algorithm: "+t;return e.HASHLENGTH[n]},ut.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},ut.crypto.Mac=function(t){this.setAlgAndProvider=function(t,e){if(null==(t=t.toLowerCase())&&(t="hmacsha1"),"hmac"!=(t=t.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+t;void 0===e&&(e=ut.crypto.Util.DEFAULTPROVIDER[t]),this.algProv=t+"/"+e;var n=t.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(n)&&"cryptojs"==e){try{var r=ut.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[n];this.mac=g.algo.HMAC.create(r,this.pass)}catch(t){throw"setAlgAndProvider hash alg set fail hashAlg="+n+"/"+t}this.updateString=function(t){this.mac.update(t)},this.updateHex=function(t){var e=g.enc.Hex.parse(t);this.mac.update(e)},this.doFinal=function(){return this.mac.finalize().toString(g.enc.Hex)},this.doFinalString=function(t){return this.updateString(t),this.doFinal()},this.doFinalHex=function(t){return this.updateHex(t),this.doFinal()}}},this.updateString=function(t){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(t){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(t){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(t){if("string"==typeof t){var e=t;return t.length%2!=1&&t.match(/^[0-9A-Fa-f]+$/)||(e=Ft(t)),void(this.pass=g.enc.Hex.parse(e))}if("object"!=typeof t)throw"KJUR.crypto.Mac unsupported password type: "+t;e=null;if(void 0!==t.hex){if(t.hex.length%2!=0||!t.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+t.hex;e=t.hex}if(void 0!==t.utf8&&(e=xt(t.utf8)),void 0!==t.rstr&&(e=Ft(t.rstr)),void 0!==t.b64&&(e=b(t.b64)),void 0!==t.b64u&&(e=bt(t.b64u)),null==e)throw"KJUR.crypto.Mac unsupported password type: "+t;this.pass=g.enc.Hex.parse(e)},void 0!==t&&(void 0!==t.pass&&this.setPassword(t.pass),void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov&&(this.provName=ut.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},ut.crypto.Signature=function(t){var e=null;if(this._setAlgNames=function(){var t=this.algName.match(/^(.+)with(.+)$/);t&&(this.mdAlgName=t[1].toLowerCase(),this.pubkeyAlgName=t[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(t,e){for(var n="",r=e/4-t.length,i=0;i<r;i++)n+="0";return n+t},this.setAlgAndProvider=function(t,e){if(this._setAlgNames(),"cryptojs/jsrsa"!=e)throw new Error("provider not supported: "+e);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new ut.crypto.MessageDigest({alg:this.mdAlgName})}catch(t){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+t)}this.init=function(t,e){var n=null;try{n=void 0===e?Qt.getKey(t):Qt.getKey(t,e)}catch(t){throw"init failed:"+t}if(!0===n.isPrivate)this.prvKey=n,this.state="SIGN";else{if(!0!==n.isPublic)throw"init failed.:"+n;this.pubKey=n,this.state="VERIFY"}},this.updateString=function(t){this.md.updateString(t)},this.updateHex=function(t){this.md.updateHex(t)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0===this.prvKey&&void 0!==this.ecprvhex&&void 0!==this.eccurvename&&void 0!==ut.crypto.ECDSA&&(this.prvKey=new ut.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof nt&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof nt&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof ut.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof ut.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(t){return this.updateString(t),this.sign()},this.signHex=function(t){return this.updateHex(t),this.sign()},this.verify=function(t){if(this.sHashHex=this.md.digest(),void 0===this.pubKey&&void 0!==this.ecpubhex&&void 0!==this.eccurvename&&void 0!==ut.crypto.ECDSA&&(this.pubKey=new ut.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof nt&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,t,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof nt&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==ut.crypto.ECDSA&&this.pubKey instanceof ut.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);if(void 0!==ut.crypto.DSA&&this.pubKey instanceof ut.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,t);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(t,e){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(t){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(t){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(t){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(t){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(t){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=t,void 0!==t&&(void 0!==t.alg&&(this.algName=t.alg,void 0===t.prov?this.provName=ut.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=t.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==t.psssaltlen&&(this.pssSaltLen=t.psssaltlen),void 0!==t.prvkeypem)){if(void 0!==t.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{e=Qt.getKey(t.prvkeypem);this.init(e)}catch(t){throw"fatal error to load pem private key: "+t}}},ut.crypto.Cipher=function(t){},ut.crypto.Cipher.encrypt=function(t,e,n){if(e instanceof nt&&e.isPublic){var r=ut.crypto.Cipher.getAlgByKeyAndName(e,n);if("RSA"===r)return e.encrypt(t);if("RSAOAEP"===r)return e.encryptOAEP(t,"sha1");var i=r.match(/^RSAOAEP(\d+)$/);if(null!==i)return e.encryptOAEP(t,"sha"+i[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+n}throw"Cipher.encrypt: unsupported key or algorithm"},ut.crypto.Cipher.decrypt=function(t,e,n){if(e instanceof nt&&e.isPrivate){var r=ut.crypto.Cipher.getAlgByKeyAndName(e,n);if("RSA"===r)return e.decrypt(t);if("RSAOAEP"===r)return e.decryptOAEP(t,"sha1");var i=r.match(/^RSAOAEP(\d+)$/);if(null!==i)return e.decryptOAEP(t,"sha"+i[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+n}throw"Cipher.decrypt: unsupported key or algorithm"},ut.crypto.Cipher.getAlgByKeyAndName=function(t,e){if(t instanceof nt){if(-1!=":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(e))return e;if(null==e)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+e}throw"getAlgByKeyAndName: not supported algorithm name: "+e},ut.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040022":"secp384r1","2b81040023":"secp521r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}},void 0!==ut&&ut||(ut={}),void 0!==ut.crypto&&ut.crypto||(ut.crypto={}),ut.crypto.ECDSA=function(t){var e=Error,n=w,r=st,i=ut.crypto.ECDSA,s=ut.crypto.ECParameterDB,o=i.getName,a=ht,u=a.getVbyListEx,c=a.isASN1HEX,l=new Q;this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(t){return new n(t.bitLength(),l).mod(t.subtract(n.ONE)).add(n.ONE)},this.setNamedCurve=function(t){this.ecparams=s.getByName(t),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=t},this.setPrivateKeyHex=function(t){this.isPrivate=!0,this.prvKeyHex=t},this.setPublicKeyHex=function(t){this.isPublic=!0,this.pubKeyHex=t},this.getPublicKeyXYHex=function(){var t=this.pubKeyHex;if("04"!==t.substr(0,2))throw"this method supports uncompressed format(04) only";var e=this.ecparams.keycharlen;if(t.length!==2+2*e)throw"malformed public key hex length";var n={};return n.x=t.substr(2,e),n.y=t.substr(2+e),n},this.getShortNISTPCurveName=function(){var t=this.curveName;return"secp256r1"===t||"NIST P-256"===t||"P-256"===t||"prime256v1"===t?"P-256":"secp384r1"===t||"NIST P-384"===t||"P-384"===t?"P-384":"secp521r1"===t||"NIST P-521"===t||"P-521"===t?"P-521":null},this.generateKeyPairHex=function(){var t=this.ecparams.n,e=this.getBigRandom(t),n=this.ecparams.keycharlen,r=("0000000000"+e.toString(16)).slice(-n);return this.setPrivateKeyHex(r),{ecprvhex:r,ecpubhex:this.generatePublicKeyHex()}},this.generatePublicKeyHex=function(){var t=new n(this.prvKeyHex,16),e=this.ecparams.G.multiply(t),r=e.getX().toBigInteger(),i=e.getY().toBigInteger(),s=this.ecparams.keycharlen,o="04"+("0000000000"+r.toString(16)).slice(-s)+("0000000000"+i.toString(16)).slice(-s);return this.setPublicKeyHex(o),o},this.signWithMessageHash=function(t){return this.signHex(t,this.prvKeyHex)},this.signHex=function(t,e){var r=new n(e,16),s=this.ecparams.n,o=new n(t.substring(0,this.ecparams.keycharlen),16);do{var a=this.getBigRandom(s),u=this.ecparams.G.multiply(a).getX().toBigInteger().mod(s)}while(u.compareTo(n.ZERO)<=0);var c=a.modInverse(s).multiply(o.add(r.multiply(u))).mod(s);return i.biRSSigToASN1Sig(u,c)},this.sign=function(t,e){var r=e,i=this.ecparams.n,s=n.fromByteArrayUnsigned(t);do{var o=this.getBigRandom(i),a=this.ecparams.G.multiply(o).getX().toBigInteger().mod(i)}while(a.compareTo(w.ZERO)<=0);var u=o.modInverse(i).multiply(s.add(r.multiply(a))).mod(i);return this.serializeSig(a,u)},this.verifyWithMessageHash=function(t,e){return this.verifyHex(t,e,this.pubKeyHex)},this.verifyHex=function(t,e,s){try{var o,a,u=i.parseSigHex(e);o=u.r,a=u.s;var c=r.decodeFromHex(this.ecparams.curve,s),l=new n(t.substring(0,this.ecparams.keycharlen),16);return this.verifyRaw(l,o,a,c)}catch(t){return!1}},this.verify=function(t,e,i){var s,o,a;if(Bitcoin.Util.isArray(e)){var u=this.parseSig(e);s=u.r,o=u.s}else{if("object"!=typeof e||!e.r||!e.s)throw"Invalid value for signature";s=e.r,o=e.s}if(i instanceof st)a=i;else{if(!Bitcoin.Util.isArray(i))throw"Invalid format for pubkey value, must be byte array or ECPointFp";a=r.decodeFrom(this.ecparams.curve,i)}var c=n.fromByteArrayUnsigned(t);return this.verifyRaw(c,s,o,a)},this.verifyRaw=function(t,e,r,i){var s=this.ecparams.n,o=this.ecparams.G;if(e.compareTo(n.ONE)<0||e.compareTo(s)>=0)return!1;if(r.compareTo(n.ONE)<0||r.compareTo(s)>=0)return!1;var a=r.modInverse(s),u=t.multiply(a).mod(s),c=e.multiply(a).mod(s);return o.multiply(u).add(i.multiply(c)).getX().toBigInteger().mod(s).equals(e)},this.serializeSig=function(t,e){var n=t.toByteArraySigned(),r=e.toByteArraySigned(),i=[];return i.push(2),i.push(n.length),(i=i.concat(n)).push(2),i.push(r.length),(i=i.concat(r)).unshift(i.length),i.unshift(48),i},this.parseSig=function(t){var e;if(48!=t[0])throw new Error("Signature not a valid DERSequence");if(2!=t[e=2])throw new Error("First element in signature must be a DERInteger");var r=t.slice(e+2,e+2+t[e+1]);if(2!=t[e+=2+t[e+1]])throw new Error("Second element in signature must be a DERInteger");var i=t.slice(e+2,e+2+t[e+1]);return e+=2+t[e+1],{r:n.fromByteArrayUnsigned(r),s:n.fromByteArrayUnsigned(i)}},this.parseSigCompact=function(t){if(65!==t.length)throw"Signature has the wrong length";var e=t[0]-27;if(e<0||e>7)throw"Invalid signature type";var r=this.ecparams.n;return{r:n.fromByteArrayUnsigned(t.slice(1,33)).mod(r),s:n.fromByteArrayUnsigned(t.slice(33,65)).mod(r),i:e}},this.readPKCS5PrvKeyHex=function(t){if(!1===c(t))throw new Error("not ASN.1 hex string");var e,n,r;try{e=u(t,0,["[0]",0],"06"),n=u(t,0,[1],"04");try{r=u(t,0,["[1]",0],"03")}catch(t){}}catch(t){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=o(e),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(r),this.setPrivateKeyHex(n),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var n,r,i;try{u(t,0,[1,0],"06"),n=u(t,0,[1,1],"06"),r=u(t,0,[2,0,1],"04");try{i=u(t,0,[2,0,"[1]",0],"03")}catch(t){}}catch(t){throw new e("malformed PKCS#8 plain ECC private key")}if(this.curveName=o(n),void 0===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PubKeyHex=function(t){if(!1===c(t))throw new e("not ASN.1 hex string");var n,r;try{u(t,0,[0,0],"06"),n=u(t,0,[0,1],"06"),r=u(t,0,[1],"03")}catch(t){throw new e("malformed PKCS#8 ECC public key")}if(this.curveName=o(n),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(r)},this.readCertPubKeyHex=function(t,n){if(!1===c(t))throw new e("not ASN.1 hex string");var r,i;try{r=u(t,0,[0,5,0,1],"06"),i=u(t,0,[0,5,1],"03")}catch(t){throw new e("malformed X.509 certificate ECC public key")}if(this.curveName=o(r),null===this.curveName)throw new e("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i)},void 0!==t&&void 0!==t.curve&&(this.curveName=t.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==t&&(void 0!==t.prv&&this.setPrivateKeyHex(t.prv),void 0!==t.pub&&this.setPublicKeyHex(t.pub))},ut.crypto.ECDSA.parseSigHex=function(t){var e=ut.crypto.ECDSA.parseSigHexInHexRS(t);return{r:new w(e.r,16),s:new w(e.s,16)}},ut.crypto.ECDSA.parseSigHexInHexRS=function(t){var e=ht,n=e.getChildIdx,r=e.getV;if(e.checkStrictDER(t,0),"30"!=t.substr(0,2))throw new Error("signature is not a ASN.1 sequence");var i=n(t,0);if(2!=i.length)throw new Error("signature shall have two elements");var s=i[0],o=i[1];if("02"!=t.substr(s,2))throw new Error("1st item not ASN.1 integer");if("02"!=t.substr(o,2))throw new Error("2nd item not ASN.1 integer");return{r:r(t,s),s:r(t,o)}},ut.crypto.ECDSA.asn1SigToConcatSig=function(t){var e=ut.crypto.ECDSA.parseSigHexInHexRS(t),n=e.r,r=e.s;if(n.length>=130&&n.length<=134){if(n.length%2!=0)throw Error("unknown ECDSA sig r length error");if(r.length%2!=0)throw Error("unknown ECDSA sig s length error");"00"==n.substr(0,2)&&(n=n.substr(2)),"00"==r.substr(0,2)&&(r=r.substr(2));var i=Math.max(n.length,r.length);return(n=("000000"+n).slice(-i))+(r=("000000"+r).slice(-i))}if("00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),"00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),n.length%32==30&&(n="00"+n),r.length%32==30&&(r="00"+r),n.length%32!=0)throw Error("unknown ECDSA sig r length error");if(r.length%32!=0)throw Error("unknown ECDSA sig s length error");return n+r},ut.crypto.ECDSA.concatSigToASN1Sig=function(t){if(t.length%4!=0)throw Error("unknown ECDSA concatinated r-s sig length error");var e=t.substr(0,t.length/2),n=t.substr(t.length/2);return ut.crypto.ECDSA.hexRSSigToASN1Sig(e,n)},ut.crypto.ECDSA.hexRSSigToASN1Sig=function(t,e){var n=new w(t,16),r=new w(e,16);return ut.crypto.ECDSA.biRSSigToASN1Sig(n,r)},ut.crypto.ECDSA.biRSSigToASN1Sig=function(t,e){var n=ut.asn1,r=new n.DERInteger({bigint:t}),i=new n.DERInteger({bigint:e});return new n.DERSequence({array:[r,i]}).tohex()},ut.crypto.ECDSA.getName=function(t){return"2b8104001f"===t?"secp192k1":"2a8648ce3d030107"===t?"secp256r1":"2b8104000a"===t?"secp256k1":"2b81040021"===t?"secp224r1":"2b81040022"===t?"secp384r1":"2b81040023"===t?"secp521r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(t)?"secp256r1":-1!=="|secp256k1|".indexOf(t)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(t)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(t)?"secp384r1":-1!=="|secp521r1|NIST P-521|P-521|".indexOf(t)?"secp521r1":null},void 0!==ut&&ut||(ut={}),void 0!==ut.crypto&&ut.crypto||(ut.crypto={}),ut.crypto.ECParameterDB=new function(){var t={},e={};function n(t){return new w(t,16)}this.getByName=function(n){var r=n;if(void 0!==e[r]&&(r=e[n]),void 0!==t[r])return t[r];throw"unregistered EC curve name: "+r},this.regist=function(r,i,s,o,a,u,c,l,h,f,p,d){t[r]={};var g=n(s),m=n(o),v=n(a),y=n(u),b=n(c),x=new ot(g,m,v),w=x.decodePointHex("04"+l+h);t[r].name=r,t[r].keylen=i,t[r].keycharlen=2*Math.ceil(i/8),t[r].curve=x,t[r].G=w,t[r].n=y,t[r].h=b,t[r].oid=p,t[r].info=d;for(var S=0;S<f.length;S++)e[f[S]]=r}},ut.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),ut.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),ut.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),ut.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),ut.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),ut.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),ut.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),ut.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),ut.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),ut.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]),void 0!==ut&&ut||(ut={}),void 0!==ut.crypto&&ut.crypto||(ut.crypto={}),ut.crypto.DSA=function(){var t=ht,e=(t.getVbyList,t.getVbyListEx),n=t.isASN1HEX,r=w;this.p=null,this.q=null,this.g=null,this.y=null,this.x=null,this.type="DSA",this.isPrivate=!1,this.isPublic=!1,this.setPrivate=function(t,e,n,r,i){this.isPrivate=!0,this.p=t,this.q=e,this.g=n,this.y=r,this.x=i},this.setPrivateHex=function(t,e,n,r,i){var s,o,a,u,c;s=new w(t,16),o=new w(e,16),a=new w(n,16),u="string"==typeof r&&r.length>1?new w(r,16):null,c=new w(i,16),this.setPrivate(s,o,a,u,c)},this.setPublic=function(t,e,n,r){this.isPublic=!0,this.p=t,this.q=e,this.g=n,this.y=r,this.x=null},this.setPublicHex=function(t,e,n,r){var i,s,o,a;i=new w(t,16),s=new w(e,16),o=new w(n,16),a=new w(r,16),this.setPublic(i,s,o,a)},this.signWithMessageHash=function(t){var e=this.p,n=this.q,r=this.g,i=(this.y,this.x),s=ut.crypto.Util.getRandomBigIntegerMinToMax(w.ONE.add(w.ONE),n.subtract(w.ONE)),o=new w(t.substr(0,n.bitLength()/4),16),a=r.modPow(s,e).mod(n),u=s.modInverse(n).multiply(o.add(i.multiply(a))).mod(n);return ut.asn1.ASN1Util.jsonToASN1HEX({seq:[{int:{bigint:a}},{int:{bigint:u}}]})},this.verifyWithMessageHash=function(t,e){var n=this.p,r=this.q,i=this.g,s=this.y,o=this.parseASN1Signature(e),a=o[0],u=o[1],c=new w(t.substr(0,r.bitLength()/4),16);if(w.ZERO.compareTo(a)>0||a.compareTo(r)>0)throw"invalid DSA signature";if(w.ZERO.compareTo(u)>=0||u.compareTo(r)>0)throw"invalid DSA signature";var l=u.modInverse(r),h=c.multiply(l).mod(r),f=a.multiply(l).mod(r);return 0==i.modPow(h,n).multiply(s.modPow(f,n)).mod(n).mod(r).compareTo(a)},this.parseASN1Signature=function(t){try{return[new r(e(t,0,[0],"02"),16),new r(e(t,0,[1],"02"),16)]}catch(t){throw new Error("malformed ASN.1 DSA signature")}},this.readPKCS5PrvKeyHex=function(t){var r,i,s,o,a;if(!1===n(t))throw new Error("not ASN.1 hex string");try{r=e(t,0,[1],"02"),i=e(t,0,[2],"02"),s=e(t,0,[3],"02"),o=e(t,0,[4],"02"),a=e(t,0,[5],"02")}catch(t){throw new Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(r,i,s,o,a)},this.readPKCS8PrvKeyHex=function(t){var r,i,s,o;if(!1===n(t))throw new Error("not ASN.1 hex string");try{r=e(t,0,[1,1,0],"02"),i=e(t,0,[1,1,1],"02"),s=e(t,0,[1,1,2],"02"),o=e(t,0,[2,0],"02")}catch(t){throw new Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(r,i,s,null,o)},this.readPKCS8PubKeyHex=function(t){var r,i,s,o;if(!1===n(t))throw new Error("not ASN.1 hex string");try{r=e(t,0,[0,1,0],"02"),i=e(t,0,[0,1,1],"02"),s=e(t,0,[0,1,2],"02"),o=e(t,0,[1,0],"02")}catch(t){throw new Error("malformed PKCS#8 DSA public key")}this.setPublicHex(r,i,s,o)},this.readCertPubKeyHex=function(t,r){var i,s,o,a;if(!1===n(t))throw new Error("not ASN.1 hex string");try{i=e(t,0,[0,5,0,1,0],"02"),s=e(t,0,[0,5,0,1,1],"02"),o=e(t,0,[0,5,0,1,2],"02"),a=e(t,0,[0,5,1,0],"02")}catch(t){throw new Error("malformed X.509 certificate DSA public key")}this.setPublicHex(i,s,o,a)}};var Qt=function(){var t=function(t,n,r){return e(g.AES,t,n,r)},e=function(t,e,n,r){var i=g.enc.Hex.parse(e),s=g.enc.Hex.parse(n),o=g.enc.Hex.parse(r),a={};a.key=s,a.iv=o,a.ciphertext=i;var u=t.decrypt(a,s,{iv:o});return g.enc.Hex.stringify(u)},n=function(t,e,n){return r(g.AES,t,e,n)},r=function(t,e,n,r){var i=g.enc.Hex.parse(e),s=g.enc.Hex.parse(n),o=g.enc.Hex.parse(r),a=t.encrypt(i,s,{iv:o}),u=g.enc.Hex.parse(a.toString());return g.enc.Base64.stringify(u)},i={"AES-256-CBC":{proc:t,eproc:n,keylen:32,ivlen:16},"AES-192-CBC":{proc:t,eproc:n,keylen:24,ivlen:16},"AES-128-CBC":{proc:t,eproc:n,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(t,n,r){return e(g.TripleDES,t,n,r)},eproc:function(t,e,n){return r(g.TripleDES,t,e,n)},keylen:24,ivlen:8},"DES-CBC":{proc:function(t,n,r){return e(g.DES,t,n,r)},eproc:function(t,e,n){return r(g.DES,t,e,n)},keylen:8,ivlen:8}},s=function(t){var e={},n=t.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));n&&(e.cipher=n[1],e.ivsalt=n[2]);var r=t.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));r&&(e.type=r[1]);var i=-1,s=0;-1!=t.indexOf("\r\n\r\n")&&(i=t.indexOf("\r\n\r\n"),s=2),-1!=t.indexOf("\n\n")&&(i=t.indexOf("\n\n"),s=1);var o=t.indexOf("-----END");if(-1!=i&&-1!=o){var a=t.substring(i+2*s,o-s);a=a.replace(/\s+/g,""),e.data=a}return e},o=function(t,e,n){for(var r=n.substring(0,16),s=g.enc.Hex.parse(r),o=g.enc.Utf8.parse(e),a=i[t].keylen+i[t].ivlen,u="",c=null;;){var l=g.algo.MD5.create();if(null!=c&&l.update(c),l.update(o),l.update(s),c=l.finalize(),(u+=g.enc.Hex.stringify(c)).length>=2*a)break}var h={};return h.keyhex=u.substr(0,2*i[t].keylen),h.ivhex=u.substr(2*i[t].keylen,2*i[t].ivlen),h},a=function(t,e,n,r){var s=g.enc.Base64.parse(t),o=g.enc.Hex.stringify(s);return(0,i[e].proc)(o,n,r)};return{version:"1.0.0",parsePKCS5PEM:function(t){return s(t)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(t,e,n){return o(t,e,n)},decryptKeyB64:function(t,e,n,r){return a(t,e,n,r)},getDecryptedKeyHex:function(t,e){var n=s(t),r=(n.type,n.cipher),i=n.ivsalt,u=n.data,c=o(r,e,i).keyhex;return a(u,r,c,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(t,e,n,r,s){var a="";if(void 0!==r&&null!=r||(r="AES-256-CBC"),void 0===i[r])throw new Error("KEYUTIL unsupported algorithm: "+r);void 0!==s&&null!=s||(s=function(t){var e=g.lib.WordArray.random(t);return g.enc.Hex.stringify(e)}(i[r].ivlen).toUpperCase());var u=function(t,e,n,r){return(0,i[e].eproc)(t,n,r)}(e,r,o(r,n,s).keyhex,s);a="-----BEGIN "+t+" PRIVATE KEY-----\r\n";return a+="Proc-Type: 4,ENCRYPTED\r\n",a+="DEK-Info: "+r+","+s+"\r\n",a+="\r\n",a+=u.replace(/(.{64})/g,"$1\r\n"),a+="\r\n-----END "+t+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(t){var e=ht,n=e.getChildIdx,r=e.getV,i={},s=n(t,0);if(2!=s.length)throw new Error("malformed format: SEQUENCE(0).items != 2: "+s.length);i.ciphertext=r(t,s[1]);var o=n(t,s[0]);if(2!=o.length)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+o.length);if("2a864886f70d01050d"!=r(t,o[0]))throw new Error("this only supports pkcs5PBES2");var a=n(t,o[1]);if(2!=o.length)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+a.length);var u=n(t,a[1]);if(2!=u.length)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+u.length);if("2a864886f70d0307"!=r(t,u[0]))throw"this only supports TripleDES";i.encryptionSchemeAlg="TripleDES",i.encryptionSchemeIV=r(t,u[1]);var c=n(t,a[0]);if(2!=c.length)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+c.length);if("2a864886f70d01050c"!=r(t,c[0]))throw new Error("this only supports pkcs5PBKDF2");var l=n(t,c[1]);if(l.length<2)throw new Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+l.length);i.pbkdf2Salt=r(t,l[0]);var h=r(t,l[1]);try{i.pbkdf2Iter=parseInt(h,16)}catch(t){throw new Error("malformed format pbkdf2Iter: "+h)}return i},getPBKDF2KeyHexFromParam:function(t,e){var n=g.enc.Hex.parse(t.pbkdf2Salt),r=t.pbkdf2Iter,i=g.PBKDF2(e,n,{keySize:6,iterations:r});return g.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(t,e){var n=It(t,"ENCRYPTED PRIVATE KEY"),r=this.parseHexOfEncryptedPKCS8(n),i=Qt.getPBKDF2KeyHexFromParam(r,e),s={};s.ciphertext=g.enc.Hex.parse(r.ciphertext);var o=g.enc.Hex.parse(i),a=g.enc.Hex.parse(r.encryptionSchemeIV),u=g.TripleDES.decrypt(s,o,{iv:a});return g.enc.Hex.stringify(u)},getKeyFromEncryptedPKCS8PEM:function(t,e){var n=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(t,e);return this.getKeyFromPlainPrivatePKCS8Hex(n)},parsePlainPrivatePKCS8Hex:function(t){var e=ht,n=e.getChildIdx,r=e.getV,i={algparam:null};if("30"!=t.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var s=n(t,0);if(s.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=t.substr(s[1],2))throw new Error("malformed PKCS8 private key(code:003)");var o=n(t,s[1]);if(2!=o.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=t.substr(o[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(i.algoid=r(t,o[0]),"06"==t.substr(o[1],2)&&(i.algparam=r(t,o[1])),"04"!=t.substr(s[2],2))throw new Error("malformed PKCS8 private key(code:006)");return i.keyidx=e.getVidx(t,s[2]),i},getKeyFromPlainPrivatePKCS8PEM:function(t){var e=It(t,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(e)},getKeyFromPlainPrivatePKCS8Hex:function(t){var e,n=this.parsePlainPrivatePKCS8Hex(t);if("2a864886f70d010101"==n.algoid)e=new nt;else if("2a8648ce380401"==n.algoid)e=new ut.crypto.DSA;else{if("2a8648ce3d0201"!=n.algoid)throw new Error("unsupported private key algorithm");e=new ut.crypto.ECDSA}return e.readPKCS8PrvKeyHex(t),e},_getKeyFromPublicPKCS8Hex:function(t){var e,n=ht.getVbyList(t,0,[0,0],"06");if("2a864886f70d010101"===n)e=new nt;else if("2a8648ce380401"===n)e=new ut.crypto.DSA;else{if("2a8648ce3d0201"!==n)throw new Error("unsupported PKCS#8 public key hex");e=new ut.crypto.ECDSA}return e.readPKCS8PubKeyHex(t),e},parsePublicRawRSAKeyHex:function(t){var e=ht,n=e.getChildIdx,r=e.getV,i={};if("30"!=t.substr(0,2))throw new Error("malformed RSA key(code:001)");var s=n(t,0);if(2!=s.length)throw new Error("malformed RSA key(code:002)");if("02"!=t.substr(s[0],2))throw new Error("malformed RSA key(code:003)");if(i.n=r(t,s[0]),"02"!=t.substr(s[1],2))throw new Error("malformed RSA key(code:004)");return i.e=r(t,s[1]),i},parsePublicPKCS8Hex:function(t){var e=ht,n=e.getChildIdx,r=e.getV,i={algparam:null},s=n(t,0);if(2!=s.length)throw new Error("outer DERSequence shall have 2 elements: "+s.length);var o=s[0];if("30"!=t.substr(o,2))throw new Error("malformed PKCS8 public key(code:001)");var a=n(t,o);if(2!=a.length)throw new Error("malformed PKCS8 public key(code:002)");if("06"!=t.substr(a[0],2))throw new Error("malformed PKCS8 public key(code:003)");if(i.algoid=r(t,a[0]),"06"==t.substr(a[1],2)?i.algparam=r(t,a[1]):"30"==t.substr(a[1],2)&&(i.algparam={},i.algparam.p=e.getVbyList(t,a[1],[0],"02"),i.algparam.q=e.getVbyList(t,a[1],[1],"02"),i.algparam.g=e.getVbyList(t,a[1],[2],"02")),"03"!=t.substr(s[1],2))throw new Error("malformed PKCS8 public key(code:004)");return i.key=r(t,s[1]).substr(2),i}}}();Qt.getKey=function(t,e,n){var r=(m=ht).getChildIdx,i=(m.getV,m.getVbyList),s=ut.crypto,o=s.ECDSA,a=s.DSA,u=nt,c=It,l=Qt;if(void 0!==u&&t instanceof u)return t;if(void 0!==o&&t instanceof o)return t;if(void 0!==a&&t instanceof a)return t;if(void 0!==t.curve&&void 0!==t.xy&&void 0===t.d)return new o({pub:t.xy,curve:t.curve});if(void 0!==t.curve&&void 0!==t.d)return new o({prv:t.d,curve:t.curve});if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return($=new u).setPublic(t.n,t.e),$;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.co&&void 0===t.qi)return($=new u).setPrivateEx(t.n,t.e,t.d,t.p,t.q,t.dp,t.dq,t.co),$;if(void 0===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0===t.p)return($=new u).setPrivate(t.n,t.e,t.d),$;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0===t.x)return($=new a).setPublic(t.p,t.q,t.g,t.y),$;if(void 0!==t.p&&void 0!==t.q&&void 0!==t.g&&void 0!==t.y&&void 0!==t.x)return($=new a).setPrivate(t.p,t.q,t.g,t.y,t.x),$;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0===t.d)return($=new u).setPublic(bt(t.n),bt(t.e)),$;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d&&void 0!==t.p&&void 0!==t.q&&void 0!==t.dp&&void 0!==t.dq&&void 0!==t.qi)return($=new u).setPrivateEx(bt(t.n),bt(t.e),bt(t.d),bt(t.p),bt(t.q),bt(t.dp),bt(t.dq),bt(t.qi)),$;if("RSA"===t.kty&&void 0!==t.n&&void 0!==t.e&&void 0!==t.d)return($=new u).setPrivate(bt(t.n),bt(t.e),bt(t.d)),$;if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0===t.d){var h=(D=new o({curve:t.crv})).ecparams.keycharlen,f="04"+("0000000000"+bt(t.x)).slice(-h)+("0000000000"+bt(t.y)).slice(-h);return D.setPublicKeyHex(f),D}if("EC"===t.kty&&void 0!==t.crv&&void 0!==t.x&&void 0!==t.y&&void 0!==t.d){h=(D=new o({curve:t.crv})).ecparams.keycharlen,f="04"+("0000000000"+bt(t.x)).slice(-h)+("0000000000"+bt(t.y)).slice(-h);var p=("0000000000"+bt(t.d)).slice(-h);return D.setPublicKeyHex(f),D.setPrivateKeyHex(p),D}if("pkcs5prv"===n){var d,g=t,m=ht;if(9===(d=r(g,0)).length)($=new u).readPKCS5PrvKeyHex(g);else if(6===d.length)($=new a).readPKCS5PrvKeyHex(g);else{if(!(d.length>2&&"04"===g.substr(d[1],2)))throw new Error("unsupported PKCS#1/5 hexadecimal key");($=new o).readPKCS5PrvKeyHex(g)}return $}if("pkcs8prv"===n)return $=l.getKeyFromPlainPrivatePKCS8Hex(t);if("pkcs8pub"===n)return l._getKeyFromPublicPKCS8Hex(t);if("x509pub"===n)return re.getPublicKeyFromCertHex(t);if(-1!=t.indexOf("-END CERTIFICATE-",0)||-1!=t.indexOf("-END X509 CERTIFICATE-",0)||-1!=t.indexOf("-END TRUSTED CERTIFICATE-",0))return re.getPublicKeyFromCertPEM(t);if(-1!=t.indexOf("-END PUBLIC KEY-")){var v=It(t,"PUBLIC KEY");return l._getKeyFromPublicPKCS8Hex(v)}if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var y=c(t,"RSA PRIVATE KEY");return l.getKey(y,null,"pkcs5prv")}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){var b=i(T=c(t,"DSA PRIVATE KEY"),0,[1],"02"),x=i(T,0,[2],"02"),S=i(T,0,[3],"02"),E=i(T,0,[4],"02"),F=i(T,0,[5],"02");return($=new a).setPrivate(new w(b,16),new w(x,16),new w(S,16),new w(E,16),new w(F,16)),$}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1==t.indexOf("4,ENCRYPTED")){y=c(t,"EC PRIVATE KEY");return l.getKey(y,null,"pkcs5prv")}if(-1!=t.indexOf("-END PRIVATE KEY-"))return l.getKeyFromPlainPrivatePKCS8PEM(t);if(-1!=t.indexOf("-END RSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var A=l.getDecryptedKeyHex(t,e),C=new nt;return C.readPKCS5PrvKeyHex(A),C}if(-1!=t.indexOf("-END EC PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var D,$=i(T=l.getDecryptedKeyHex(t,e),0,[1],"04"),I=i(T,0,[2,0],"06"),R=i(T,0,[3,0],"03").substr(2);if(void 0===ut.crypto.OID.oidhex2name[I])throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+I);return(D=new o({curve:ut.crypto.OID.oidhex2name[I]})).setPublicKeyHex(R),D.setPrivateKeyHex($),D.isPublic=!1,D}if(-1!=t.indexOf("-END DSA PRIVATE KEY-")&&-1!=t.indexOf("4,ENCRYPTED")){var T;b=i(T=l.getDecryptedKeyHex(t,e),0,[1],"02"),x=i(T,0,[2],"02"),S=i(T,0,[3],"02"),E=i(T,0,[4],"02"),F=i(T,0,[5],"02");return($=new a).setPrivate(new w(b,16),new w(x,16),new w(S,16),new w(E,16),new w(F,16)),$}if(-1!=t.indexOf("-END ENCRYPTED PRIVATE KEY-"))return l.getKeyFromEncryptedPKCS8PEM(t,e);throw new Error("not supported argument")},Qt.generateKeypair=function(t,e){if("RSA"==t){var n=e;(o=new nt).generate(n,"10001"),o.isPrivate=!0,o.isPublic=!0;var r=new nt,i=o.n.toString(16),s=o.e.toString(16);return r.setPublic(i,s),r.isPrivate=!1,r.isPublic=!0,(a={}).prvKeyObj=o,a.pubKeyObj=r,a}if("EC"==t){var o,a,u=e,c=new ut.crypto.ECDSA({curve:u}).generateKeyPairHex();return(o=new ut.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),o.setPrivateKeyHex(c.ecprvhex),o.isPrivate=!0,o.isPublic=!1,(r=new ut.crypto.ECDSA({curve:u})).setPublicKeyHex(c.ecpubhex),r.isPrivate=!1,r.isPublic=!0,(a={}).prvKeyObj=o,a.pubKeyObj=r,a}throw new Error("unknown algorithm: "+t)},Qt.getPEM=function(t,e,n,r,i,s){var o=ut,a=o.asn1,u=a.DERObjectIdentifier,c=a.DERInteger,l=a.ASN1Util.newObject,h=a.x509.SubjectPublicKeyInfo,f=o.crypto,p=f.DSA,d=f.ECDSA,m=nt;function v(t){return l({seq:[{int:0},{int:{bigint:t.n}},{int:t.e},{int:{bigint:t.d}},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.dmp1}},{int:{bigint:t.dmq1}},{int:{bigint:t.coeff}}]})}function y(t){return l({seq:[{int:1},{octstr:{hex:t.prvKeyHex}},{tag:["a0",!0,{oid:{name:t.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]}]})}function b(t){return l({seq:[{int:0},{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}},{int:{bigint:t.y}},{int:{bigint:t.x}}]})}if((void 0!==m&&t instanceof m||void 0!==p&&t instanceof p||void 0!==d&&t instanceof d)&&1==t.isPublic&&(void 0===e||"PKCS8PUB"==e))return $t(E=new h(t).tohex(),"PUBLIC KEY");if("PKCS1PRV"==e&&void 0!==m&&t instanceof m&&(void 0===n||null==n)&&1==t.isPrivate)return $t(E=v(t).tohex(),"RSA PRIVATE KEY");if("PKCS1PRV"==e&&void 0!==d&&t instanceof d&&(void 0===n||null==n)&&1==t.isPrivate){var x=new u({name:t.curveName}).tohex(),w=y(t).tohex(),S="";return S+=$t(x,"EC PARAMETERS"),S+=$t(w,"EC PRIVATE KEY")}if("PKCS1PRV"==e&&void 0!==p&&t instanceof p&&(void 0===n||null==n)&&1==t.isPrivate)return $t(E=b(t).tohex(),"DSA PRIVATE KEY");if("PKCS5PRV"==e&&void 0!==m&&t instanceof m&&void 0!==n&&null!=n&&1==t.isPrivate){var E=v(t).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",E,n,r,s)}if("PKCS5PRV"==e&&void 0!==d&&t instanceof d&&void 0!==n&&null!=n&&1==t.isPrivate){E=y(t).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",E,n,r,s)}if("PKCS5PRV"==e&&void 0!==p&&t instanceof p&&void 0!==n&&null!=n&&1==t.isPrivate){E=b(t).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",E,n,r,s)}var F=function(t,e){var n=A(t,e);return new l({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:n.pbkdf2Salt}},{int:n.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:n.encryptionSchemeIV}}]}]}]},{octstr:{hex:n.ciphertext}}]}).tohex()},A=function(t,e){var n=g.lib.WordArray.random(8),r=g.lib.WordArray.random(8),i=g.PBKDF2(e,n,{keySize:6,iterations:100}),s=g.enc.Hex.parse(t),o=g.TripleDES.encrypt(s,i,{iv:r})+"",a={};return a.ciphertext=o,a.pbkdf2Salt=g.enc.Hex.stringify(n),a.pbkdf2Iter=100,a.encryptionSchemeAlg="DES-EDE3-CBC",a.encryptionSchemeIV=g.enc.Hex.stringify(r),a};if("PKCS8PRV"==e&&null!=m&&t instanceof m&&1==t.isPrivate){var C=v(t).tohex();E=l({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:C}}]}).tohex();return void 0===n||null==n?$t(E,"PRIVATE KEY"):$t(w=F(E,n),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==e&&void 0!==d&&t instanceof d&&1==t.isPrivate){var D={seq:[{int:1},{octstr:{hex:t.prvKeyHex}}]};"string"==typeof t.pubKeyHex&&D.seq.push({tag:["a1",!0,{bitstr:{hex:"00"+t.pubKeyHex}}]});C=new l(D).tohex(),E=l({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:t.curveName}}]},{octstr:{hex:C}}]}).tohex();return void 0===n||null==n?$t(E,"PRIVATE KEY"):$t(w=F(E,n),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==e&&void 0!==p&&t instanceof p&&1==t.isPrivate){C=new c({bigint:t.x}).tohex(),E=l({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:t.p}},{int:{bigint:t.q}},{int:{bigint:t.g}}]}]},{octstr:{hex:C}}]}).tohex();return void 0===n||null==n?$t(E,"PRIVATE KEY"):$t(w=F(E,n),"ENCRYPTED PRIVATE KEY")}throw new Error("unsupported object nor format")},Qt.getKeyFromCSRPEM=function(t){var e=It(t,"CERTIFICATE REQUEST");return Qt.getKeyFromCSRHex(e)},Qt.getKeyFromCSRHex=function(t){var e=Qt.parseCSRHex(t);return Qt.getKey(e.p8pubkeyhex,null,"pkcs8pub")},Qt.parseCSRHex=function(t){var e=ht,n=e.getChildIdx,r=e.getTLV,i={},s=t;if("30"!=s.substr(0,2))throw new Error("malformed CSR(code:001)");var o=n(s,0);if(o.length<1)throw new Error("malformed CSR(code:002)");if("30"!=s.substr(o[0],2))throw new Error("malformed CSR(code:003)");var a=n(s,o[0]);if(a.length<3)throw new Error("malformed CSR(code:004)");return i.p8pubkeyhex=r(s,a[2]),i},Qt.getKeyID=function(t){var e=Qt,n=ht;"string"==typeof t&&-1!=t.indexOf("BEGIN ")&&(t=e.getKey(t));var r=It(e.getPEM(t)),i=n.getIdxbyList(r,0,[1]),s=n.getV(r,i).substring(2);return ut.crypto.Util.hashHex(s,"sha1")},Qt.getJWK=function(t,e,n,r,i){var s,o,a={},u=ut.crypto.Util.hashHex;if("string"==typeof t)s=Qt.getKey(t),-1!=t.indexOf("CERTIFICATE")&&(o=It(t));else{if("object"!=typeof t)throw new Error("unsupported keyinfo type");t instanceof re?(s=t.getPublicKey(),o=t.hex):s=t}if(s instanceof nt&&s.isPrivate)a.kty="RSA",a.n=yt(s.n.toString(16)),a.e=yt(s.e.toString(16)),a.d=yt(s.d.toString(16)),a.p=yt(s.p.toString(16)),a.q=yt(s.q.toString(16)),a.dp=yt(s.dmp1.toString(16)),a.dq=yt(s.dmq1.toString(16)),a.qi=yt(s.coeff.toString(16));else if(s instanceof nt&&s.isPublic)a.kty="RSA",a.n=yt(s.n.toString(16)),a.e=yt(s.e.toString(16));else if(s instanceof ut.crypto.ECDSA&&s.isPrivate){if("P-256"!==(l=s.getShortNISTPCurveName())&&"P-384"!==l&&"P-521"!==l)throw new Error("unsupported curve name for JWT: "+l);var c=s.getPublicKeyXYHex();a.kty="EC",a.crv=l,a.x=yt(c.x),a.y=yt(c.y),a.d=yt(s.prvKeyHex)}else if(s instanceof ut.crypto.ECDSA&&s.isPublic){var l;if("P-256"!==(l=s.getShortNISTPCurveName())&&"P-384"!==l&&"P-521"!==l)throw new Error("unsupported curve name for JWT: "+l);c=s.getPublicKeyXYHex();a.kty="EC",a.crv=l,a.x=yt(c.x),a.y=yt(c.y)}if(null==a.kty)throw new Error("unsupported keyinfo");return s.isPrivate||1==e||(a.kid=ut.jws.JWS.getJWKthumbprint(a)),null!=o&&1!=n&&(a.x5c=[y(o)]),null!=o&&1!=r&&(a.x5t=mt(y(u(o,"sha1")))),null!=o&&1!=i&&(a["x5t#S256"]=mt(y(u(o,"sha256")))),a},Qt.getJWKFromKey=function(t){return Qt.getJWK(t,!0,!0,!0,!0)},nt.getPosArrayOfChildrenFromHex=function(t){return ht.getChildIdx(t,0)},nt.getHexValueArrayOfChildrenFromHex=function(t){var e,n=ht.getV,r=n(t,(e=nt.getPosArrayOfChildrenFromHex(t))[0]),i=n(t,e[1]),s=n(t,e[2]),o=n(t,e[3]),a=n(t,e[4]),u=n(t,e[5]),c=n(t,e[6]),l=n(t,e[7]),h=n(t,e[8]);return(e=new Array).push(r,i,s,o,a,u,c,l,h),e},nt.prototype.readPrivateKeyFromPEMString=function(t){var e=It(t),n=nt.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])},nt.prototype.readPKCS5PrvKeyHex=function(t){var e=nt.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},nt.prototype.readPKCS8PrvKeyHex=function(t){var e,n,r,i,s,o,a,u,c=ht,l=c.getVbyListEx;if(!1===c.isASN1HEX(t))throw new Error("not ASN.1 hex string");try{e=l(t,0,[2,0,1],"02"),n=l(t,0,[2,0,2],"02"),r=l(t,0,[2,0,3],"02"),i=l(t,0,[2,0,4],"02"),s=l(t,0,[2,0,5],"02"),o=l(t,0,[2,0,6],"02"),a=l(t,0,[2,0,7],"02"),u=l(t,0,[2,0,8],"02")}catch(t){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(e,n,r,i,s,o,a,u)},nt.prototype.readPKCS5PubKeyHex=function(t){var e=ht,n=e.getV;if(!1===e.isASN1HEX(t))throw new Error("keyHex is not ASN.1 hex string");var r=e.getChildIdx(t,0);if(2!==r.length||"02"!==t.substr(r[0],2)||"02"!==t.substr(r[1],2))throw new Error("wrong hex for PKCS#5 public key");var i=n(t,r[0]),s=n(t,r[1]);this.setPublic(i,s)},nt.prototype.readPKCS8PubKeyHex=function(t){var e=ht;if(!1===e.isASN1HEX(t))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==e.getTLVbyListEx(t,0,[0,0]))throw new Error("not PKCS8 RSA public key");var n=e.getTLVbyListEx(t,0,[1,0]);this.readPKCS5PubKeyHex(n)},nt.prototype.readCertPubKeyHex=function(t,e){var n,r;(n=new re).readCertHex(t),r=n.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};new RegExp("[^0-9a-f]","gi");function te(t,e){for(var n="",r=e/4-t.length,i=0;i<r;i++)n+="0";return n+t}function ee(t,e,n){for(var r="",i=0;r.length<e;)r+=Et(n(Ft(t+String.fromCharCode.apply(String,[(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return r}function ne(t){for(var e in ut.crypto.Util.DIGESTINFOHEAD){var n=ut.crypto.Util.DIGESTINFOHEAD[e],r=n.length;if(t.substring(0,r)==n)return[e,t.substring(r)]}return[]}function re(t){var e,n=ht,r=n.getChildIdx,i=n.getV,s=(n.dump,n.parse),o=n.getTLV,a=n.getVbyList,u=n.getVbyListEx,c=n.getTLVbyList,l=n.getTLVbyListEx,h=n.getIdxbyList,f=n.getIdxbyListEx,p=n.getVidx,d=n.getInt,g=n.oidname,m=n.hextooidstr,v=It;try{e=ut.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(t){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(null===this.hex||0!==this.version)return this.version;var t=c(this.hex,0,[0,0]);if("a0"==t.substr(0,2)){var e=c(t,0,[0]),n=d(e,0);if(n<0||2<n)throw new Error("malformed version field");return this.version=n+1,this.version}return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return u(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var t=l(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(t)},this.getAlgorithmIdentifierName=function(t){for(var n in e)if(t===e[n])return n;return g(u(t,0,[0],"06"))},this.getIssuer=function(){return this.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return c(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return this.getIssuer().str},this.getSubject=function(){return this.getX500Name(this.getSubjectHex())},this.getSubjectHex=function(){return c(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return this.getSubject().str},this.getNotBefore=function(){var t=a(this.hex,0,[0,4+this.foffset,0]);return t=t.replace(/(..)/g,"%$1"),t=decodeURIComponent(t)},this.getNotAfter=function(){var t=a(this.hex,0,[0,4+this.foffset,1]);return t=t.replace(/(..)/g,"%$1"),t=decodeURIComponent(t)},this.getPublicKeyHex=function(){return this.getSPKI()},this.getSPKI=function(){return c(this.hex,0,[0,6+this.foffset],"30")},this.getSPKIValue=function(){var t=this.getSPKI();return null==t?null:a(t,0,[1],"03",!0)},this.getPublicKeyIdx=function(){return h(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var t=this.getPublicKeyIdx();return h(this.hex,t,[1,0],"30")},this.getPublicKey=function(){return Qt.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var t=c(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(t)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(t){var e=this.getSignatureAlgorithmField(),n=this.getSignatureValueHex(),r=c(this.hex,0,[0],"30"),i=new ut.crypto.Signature({alg:e});return i.init(t),i.updateHex(r),i.verify(n)},this.parseExt=function(t){var e,s,o;if(void 0===t){if(o=this.hex,3!==this.version)return-1;e=h(o,0,[0,7,0],"30"),s=r(o,e)}else{o=It(t);var u=h(o,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=i(o,u))return void(this.aExtInfo=new Array);e=h(o,0,[0,3,0,1,0],"30"),s=r(o,e),this.hex=o}this.aExtInfo=new Array;for(var c=0;c<s.length;c++){var l={critical:!1},f=0;3===r(o,s[c]).length&&(l.critical=!0,f=1),l.oid=n.hextooidstr(a(o,s[c],[0],"06"));var d=h(o,s[c],[1+f]);l.vidx=p(o,d),this.aExtInfo.push(l)}},this.getExtInfo=function(t){var e=this.aExtInfo,n=t;if(t.match(/^[0-9.]+$/)||(n=ut.asn1.x509.OID.name2oid(t)),""!==n)for(var r=0;r<e.length;r++)if(e[r].oid===n)return e[r]},this.getExtBasicConstraints=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("basicConstraints");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var r={extname:"basicConstraints"};if(e&&(r.critical=!0),"3000"===t)return r;if("30030101ff"===t)return r.cA=!0,r;if("30060101ff02"===t.substr(0,12)){var s=i(t,10),a=parseInt(s,16);return r.cA=!0,r.pathLen=a,r}throw new Error("hExtV parse error: "+t)},this.getExtNameConstraints=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("nameConstraints");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"nameConstraints"};e&&(i.critical=!0);for(var s=r(t,0),a=0;a<s.length;a++){for(var u=[],c=r(t,s[a]),l=0;l<c.length;l++){var h=o(t,c[l]),f=this.getGeneralSubtree(h);u.push(f)}var p=t.substr(s[a],2);"a0"==p?i.permit=u:"a1"==p&&(i.exclude=u)}return i},this.getGeneralSubtree=function(t){var e=r(t,0),n=e.length;if(n<1||2<n)throw new Error("wrong num elements");for(var s=this.getGeneralName(o(t,e[0])),a=1;a<n;a++){var u=t.substr(e[a],2),c=i(t,e[a]),l=parseInt(c,16);"80"==u&&(s.min=l),"81"==u&&(s.max=l)}return s},this.getExtKeyUsage=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("keyUsage");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var r={extname:"keyUsage"};return e&&(r.critical=!0),r.names=this.getExtKeyUsageString(t).split(","),r},this.getExtKeyUsageBin=function(t){if(void 0===t){var e=this.getExtInfo("keyUsage");if(void 0===e)return"";t=o(this.hex,e.vidx)}if(8!=t.length&&10!=t.length)throw new Error("malformed key usage value: "+t);var n="000000000000000"+parseInt(t.substr(6),16).toString(2);return 8==t.length&&(n=n.slice(-8)),10==t.length&&(n=n.slice(-16)),""==(n=n.replace(/0+$/,""))&&(n="0"),n},this.getExtKeyUsageString=function(t){for(var e=this.getExtKeyUsageBin(t),n=new Array,r=0;r<e.length;r++)"1"==e.substr(r,1)&&n.push(re.KEYUSAGE_NAME[r]);return n.join(",")},this.getExtSubjectKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("subjectKeyIdentifier");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var r={extname:"subjectKeyIdentifier"};e&&(r.critical=!0);var s=i(t,0);return r.kid={hex:s},r},this.getExtAuthorityKeyIdentifier=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("authorityKeyIdentifier");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var s={extname:"authorityKeyIdentifier"};e&&(s.critical=!0);for(var a=r(t,0),u=0;u<a.length;u++){var c=t.substr(a[u],2);if("80"===c&&(s.kid={hex:i(t,a[u])}),"a1"===c){var l=o(t,a[u]),h=this.getGeneralNames(l);s.issuer=h[0].dn}"82"===c&&(s.sn={hex:i(t,a[u])})}return s},this.getExtExtKeyUsage=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("extKeyUsage");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var s={extname:"extKeyUsage",array:[]};e&&(s.critical=!0);for(var a=r(t,0),u=0;u<a.length;u++)s.array.push(g(i(t,a[u])));return s},this.getExtExtKeyUsageName=function(){var t=this.getExtInfo("extKeyUsage");if(void 0===t)return t;var e=new Array,n=o(this.hex,t.vidx);if(""===n)return e;for(var s=r(n,0),a=0;a<s.length;a++)e.push(g(i(n,s[a])));return e},this.getExtSubjectAltName=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("subjectAltName");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var r={extname:"subjectAltName",array:[]};return e&&(r.critical=!0),r.array=this.getGeneralNames(t),r},this.getExtIssuerAltName=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("issuerAltName");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var r={extname:"issuerAltName",array:[]};return e&&(r.critical=!0),r.array=this.getGeneralNames(t),r},this.getGeneralNames=function(t){for(var e=r(t,0),n=[],i=0;i<e.length;i++){var s=this.getGeneralName(o(t,e[i]));void 0!==s&&n.push(s)}return n},this.getGeneralName=function(t){var e=t.substr(0,2),n=i(t,0),r=Et(n);return"81"==e?{rfc822:r}:"82"==e?{dns:r}:"86"==e?{uri:r}:"87"==e?{ip:jt(n)}:"a4"==e?{dn:this.getX500Name(n)}:"a0"==e?{other:this.getOtherName(t)}:void 0},this.getExtSubjectAltName2=function(){var t,e,n,s=this.getExtInfo("subjectAltName");if(void 0===s)return s;for(var a=new Array,u=o(this.hex,s.vidx),c=r(u,0),l=0;l<c.length;l++)n=u.substr(c[l],2),t=i(u,c[l]),"81"===n&&(e=wt(t),a.push(["MAIL",e])),"82"===n&&(e=wt(t),a.push(["DNS",e])),"84"===n&&(e=re.hex2dn(t,0),a.push(["DN",e])),"86"===n&&(e=wt(t),a.push(["URI",e])),"87"===n&&(e=jt(t),a.push(["IP",e]));return a},this.getExtCRLDistributionPoints=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("cRLDistributionPoints");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"cRLDistributionPoints",array:[]};e&&(i.critical=!0);for(var s=r(t,0),a=0;a<s.length;a++){var u=o(t,s[a]);i.array.push(this.getDistributionPoint(u))}return i},this.getDistributionPoint=function(t){for(var e={},n=r(t,0),i=0;i<n.length;i++){var s=t.substr(n[i],2),a=o(t,n[i]);"a0"==s&&(e.dpname=this.getDistributionPointName(a))}return e},this.getDistributionPointName=function(t){for(var e={},n=r(t,0),i=0;i<n.length;i++){var s=t.substr(n[i],2),a=o(t,n[i]);"a0"==s&&(e.full=this.getGeneralNames(a))}return e},this.getExtCRLDistributionPointsURI=function(){var t=this.getExtCRLDistributionPoints();if(null==t)return t;for(var e=t.array,n=[],r=0;r<e.length;r++)try{null!=e[r].dpname.full[0].uri&&n.push(e[r].dpname.full[0].uri)}catch(t){}return n},this.getExtAIAInfo=function(){var t=this.getExtInfo("authorityInfoAccess");if(void 0===t)return t;for(var e={ocsp:[],caissuer:[]},n=r(this.hex,t.vidx),i=0;i<n.length;i++){var s=a(this.hex,n[i],[0],"06"),o=a(this.hex,n[i],[1],"86");"2b06010505073001"===s&&e.ocsp.push(wt(o)),"2b06010505073002"===s&&e.caissuer.push(wt(o))}return e},this.getExtAuthorityInfoAccess=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("authorityInfoAccess");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"authorityInfoAccess",array:[]};e&&(i.critical=!0);for(var s=r(t,0),c=0;c<s.length;c++){var l=u(t,s[c],[0],"06"),h=wt(a(t,s[c],[1],"86"));if("2b06010505073001"==l)i.array.push({ocsp:h});else{if("2b06010505073002"!=l)throw new Error("unknown method: "+l);i.array.push({caissuer:h})}}return i},this.getExtCertificatePolicies=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("certificatePolicies");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"certificatePolicies",array:[]};e&&(i.critical=!0);for(var s=r(t,0),a=0;a<s.length;a++){var u=o(t,s[a]),c=this.getPolicyInformation(u);i.array.push(c)}return i},this.getPolicyInformation=function(t){var e={},n=a(t,0,[0],"06");e.policyoid=g(n);var i=f(t,0,[1],"30");if(-1!=i){e.array=[];for(var s=r(t,i),u=0;u<s.length;u++){var c=o(t,s[u]),l=this.getPolicyQualifierInfo(c);e.array.push(l)}}return e},this.getOtherName=function(t){var e={},n=r(t,0),i=a(t,n[0],[],"06"),o=a(t,n[1],[]);return e.oid=ut.asn1.ASN1Util.oidHexToInt(i),e.obj=s(o),e},this.getPolicyQualifierInfo=function(t){var e={},n=a(t,0,[0],"06");if("2b06010505070201"===n){var r=u(t,0,[1],"16");e.cps=Et(r)}else if("2b06010505070202"===n){var i=c(t,0,[1],"30");e.unotice=this.getUserNotice(i)}return e},this.getUserNotice=function(t){for(var e={},n=r(t,0),i=0;i<n.length;i++){var s=o(t,n[i]);"30"!=s.substr(0,2)&&(e.exptext=this.getDisplayText(s))}return e},this.getDisplayText=function(t){var e={};return e.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[t.substr(0,2)],e.str=Et(i(t,0)),e},this.getExtCRLNumber=function(t,e){var n={extname:"cRLNumber"};if(e&&(n.critical=!0),"02"==t.substr(0,2))return n.num={hex:i(t,0)},n;throw new Error("hExtV parse error: "+t)},this.getExtCRLReason=function(t,e){var n={extname:"cRLReason"};if(e&&(n.critical=!0),"0a"==t.substr(0,2))return n.code=parseInt(i(t,0),16),n;throw new Error("hExtV parse error: "+t)},this.getExtOcspNonce=function(t,e){var n={extname:"ocspNonce"};e&&(n.critical=!0);var r=i(t,0);return n.hex=r,n},this.getExtOcspNoCheck=function(t,e){var n={extname:"ocspNoCheck"};return e&&(n.critical=!0),n},this.getExtAdobeTimeStamp=function(t,e){if(void 0===t&&void 0===e){var n=this.getExtInfo("adobeTimeStamp");if(void 0===n)return;t=o(this.hex,n.vidx),e=n.critical}var i={extname:"adobeTimeStamp"};e&&(i.critical=!0);var s=r(t,0);if(s.length>1){var a=o(t,s[1]),u=this.getGeneralName(a);null!=u.uri&&(i.uri=u.uri)}if(s.length>2){var c=o(t,s[2]);"0101ff"==c&&(i.reqauth=!0),"010100"==c&&(i.reqauth=!1)}return i};var y=function(t){var e={};try{var n=t.seq[0].oid,r=ut.asn1.x509.OID.name2oid(n);e.type=ut.asn1.x509.OID.oid2atype(r);var i=t.seq[1];if(null!=i.utf8str)e.ds="utf8",e.value=i.utf8str.str;else if(null!=i.numstr)e.ds="num",e.value=i.numstr.str;else if(null!=i.telstr)e.ds="tel",e.value=i.telstr.str;else if(null!=i.prnstr)e.ds="prn",e.value=i.prnstr.str;else if(null!=i.ia5str)e.ds="ia5",e.value=i.ia5str.str;else if(null!=i.visstr)e.ds="vis",e.value=i.visstr.str;else{if(null==i.bmpstr)throw"error";e.ds="bmp",e.value=i.bmpstr.str}return e}catch(t){throw new Erorr("improper ASN.1 parsed AttrTypeAndValue")}},b=function(t){try{return t.set.map((function(t){return y(t)}))}catch(t){throw new Error("improper ASN.1 parsed RDN: "+t)}};this.getX500NameRule=function(t){for(var e=null,n=[],r=0;r<t.length;r++)for(var i=t[r],s=0;s<i.length;s++)n.push(i[s]);for(r=0;r<n.length;r++){var o=n[r],a=o.ds,u=o.value,c=o.type;if(":"+a,"prn"!=a&&"utf8"!=a&&"ia5"!=a)return"mixed";if("ia5"==a){if("CN"!=c)return"mixed";if(ut.lang.String.isMail(u))continue;return"mixed"}if("C"==c){if("prn"==a)continue;return"mixed"}if(":"+a,null==e)e=a;else if(e!==a)return"mixed"}return null==e?"prn":e},this.getAttrTypeAndValue=function(t){var e=s(t);return y(e)},this.getRDN=function(t){var e=s(t);return b(e)},this.getX500NameArray=function(t){return function(t){try{return t.seq.map((function(t){return b(t)}))}catch(t){throw new Error("improper ASN.1 parsed X500Name: "+t)}}(s(t))},this.getX500Name=function(t){var e=this.getX500NameArray(t);return{array:e,str:this.dnarraytostr(e)}},this.readCertPEM=function(t){this.readCertHex(v(t))},this.readCertHex=function(t){this.hex=t,this.getVersion();try{h(this.hex,0,[0,7],"a3"),this.parseExt()}catch(t){}},this.getParam=function(t){var e={};return e.version=this.getVersion(),e.serial={hex:this.getSerialNumberHex()},e.sigalg=this.getSignatureAlgorithmField(),e.issuer=this.getIssuer(),e.notbefore=this.getNotBefore(),e.notafter=this.getNotAfter(),e.subject=this.getSubject(),e.sbjpubkey=$t(this.getPublicKeyHex(),"PUBLIC KEY"),null!=this.aExtInfo&&this.aExtInfo.length>0&&(e.ext=this.getExtParamArray()),e.sighex=this.getSignatureValueHex(),"object"==typeof t&&(1==t.tbshex&&(e.tbshex=c(this.hex,0,[0])),1==t.nodnarray&&(delete e.issuer.array,delete e.subject.array)),e},this.getExtParamArray=function(t){null==t&&(-1!=f(this.hex,0,[0,"[3]"])&&(t=l(this.hex,0,[0,"[3]",0],"30")));for(var e=[],n=r(t,0),i=0;i<n.length;i++){var s=o(t,n[i]),a=this.getExtParam(s);null!=a&&e.push(a)}return e},this.getExtParam=function(t){var e=r(t,0).length;if(2!=e&&3!=e)throw new Error("wrong number elements in Extension: "+e+" "+t);var n=m(a(t,0,[0],"06")),i=!1;3==e&&"0101ff"==c(t,0,[1])&&(i=!0);var s=c(t,0,[e-1,0]),o=void 0;if("2.5.29.14"==n?o=this.getExtSubjectKeyIdentifier(s,i):"2.5.29.15"==n?o=this.getExtKeyUsage(s,i):"2.5.29.17"==n?o=this.getExtSubjectAltName(s,i):"2.5.29.18"==n?o=this.getExtIssuerAltName(s,i):"2.5.29.19"==n?o=this.getExtBasicConstraints(s,i):"2.5.29.30"==n?o=this.getExtNameConstraints(s,i):"2.5.29.31"==n?o=this.getExtCRLDistributionPoints(s,i):"2.5.29.32"==n?o=this.getExtCertificatePolicies(s,i):"2.5.29.35"==n?o=this.getExtAuthorityKeyIdentifier(s,i):"2.5.29.37"==n?o=this.getExtExtKeyUsage(s,i):"1.3.6.1.5.5.7.1.1"==n?o=this.getExtAuthorityInfoAccess(s,i):"2.5.29.20"==n?o=this.getExtCRLNumber(s,i):"2.5.29.21"==n?o=this.getExtCRLReason(s,i):"1.3.6.1.5.5.7.48.1.2"==n?o=this.getExtOcspNonce(s,i):"1.3.6.1.5.5.7.48.1.5"==n?o=this.getExtOcspNoCheck(s,i):"1.2.840.113583.1.1.9.1"==n&&(o=this.getExtAdobeTimeStamp(s,i)),null!=o)return o;var u={extname:n,extn:s};return i&&(u.critical=!0),u},this.findExt=function(t,e){for(var n=0;n<t.length;n++)if(t[n].extname==e)return t[n];return null},this.updateExtCDPFullURI=function(t,e){var n=this.findExt(t,"cRLDistributionPoints");if(null!=n&&null!=n.array)for(var r=n.array,i=0;i<r.length;i++)if(null!=r[i].dpname&&null!=r[i].dpname.full)for(var s=r[i].dpname.full,o=0;o<s.length;o++){var a=s[i];null!=a.uri&&(a.uri=e)}},this.updateExtAIAOCSP=function(t,e){var n=this.findExt(t,"authorityInfoAccess");if(null!=n&&null!=n.array)for(var r=n.array,i=0;i<r.length;i++)null!=r[i].ocsp&&(r[i].ocsp=e)},this.updateExtAIACAIssuer=function(t,e){var n=this.findExt(t,"authorityInfoAccess");if(null!=n&&null!=n.array)for(var r=n.array,i=0;i<r.length;i++)null!=r[i].caissuer&&(r[i].caissuer=e)},this.dnarraytostr=function(t){return"/"+t.map((function(t){return function(t){return t.map((function(t){return function(t){return t.type+"="+t.value}(t).replace(/\+/,"\\+")})).join("+")}(t).replace(/\//,"\\/")})).join("/")},this.getInfo=function(){var t,e,n,r,i=function(t){for(var e="",n=t.array,r=0;r<n.length;r++){var i=n[r];if(e+=" policy oid: "+i.policyoid+"\n",void 0!==i.array)for(var s=0;s<i.array.length;s++){var o=i.array[s];void 0!==o.cps&&(e+=" cps: "+o.cps+"\n")}}return e},s=function(t){for(var e="",n=t.array,r=0;r<n.length;r++){var i=n[r];try{void 0!==i.dpname.full[0].uri&&(e+=" "+i.dpname.full[0].uri+"\n")}catch(t){}try{void 0!==i.dname.full[0].dn.hex&&(e+=" "+re.hex2dn(i.dpname.full[0].dn.hex)+"\n")}catch(t){}}return e},o=function(t){for(var e="",n=t.array,r=0;r<n.length;r++){var i=n[r];void 0!==i.caissuer&&(e+=" caissuer: "+i.caissuer+"\n"),void 0!==i.ocsp&&(e+=" ocsp: "+i.ocsp+"\n")}return e};if(t="Basic Fields\n",t+=" serial number: "+this.getSerialNumberHex()+"\n",t+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",t+=" issuer: "+this.getIssuerString()+"\n",t+=" notBefore: "+this.getNotBefore()+"\n",t+=" notAfter: "+this.getNotAfter()+"\n",t+=" subject: "+this.getSubjectString()+"\n",t+=" subject public key info: \n",t+=" key algorithm: "+(e=this.getPublicKey()).type+"\n","RSA"===e.type&&(t+=" n="+qt(e.n.toString(16)).substr(0,16)+"...\n",t+=" e="+qt(e.e.toString(16))+"\n"),null!=(n=this.aExtInfo)){t+="X509v3 Extensions:\n";for(var a=0;a<n.length;a++){var u=n[a],c=ut.asn1.x509.OID.oid2name(u.oid);""===c&&(c=u.oid);var l="";if(!0===u.critical&&(l="CRITICAL"),t+=" "+c+" "+l+":\n","basicConstraints"===c){var h=this.getExtBasicConstraints();void 0===h.cA?t+=" {}\n":(t+=" cA=true",void 0!==h.pathLen&&(t+=", pathLen="+h.pathLen),t+="\n")}else if("keyUsage"===c)t+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"===c)t+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"===c){var f=this.getExtAuthorityKeyIdentifier();void 0!==f.kid&&(t+=" kid="+f.kid.hex+"\n")}else{if("extKeyUsage"===c)t+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n";else if("subjectAltName"===c)t+=" "+(r=this.getExtSubjectAltName(),JSON.stringify(r.array).replace(/[\[\]\{\}\"]/g,""))+"\n";else if("cRLDistributionPoints"===c)t+=s(this.getExtCRLDistributionPoints());else if("authorityInfoAccess"===c)t+=o(this.getExtAuthorityInfoAccess());else"certificatePolicies"===c&&(t+=i(this.getExtCertificatePolicies()))}}}return t+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n",t+="signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"},"string"==typeof t&&(-1!=t.indexOf("-----BEGIN")?this.readCertPEM(t):ut.lang.String.isHex(t)&&this.readCertHex(t))}nt.prototype.sign=function(t,e){var n=function(t){return ut.crypto.Util.hashString(t,e)}(t);return this.signWithMessageHash(n,e)},nt.prototype.signWithMessageHash=function(t,e){var n=tt(ut.crypto.Util.getPaddedDigestInfoHex(t,e,this.n.bitLength()),16);return te(this.doPrivate(n).toString(16),this.n.bitLength())},nt.prototype.signPSS=function(t,e,n){var r,i=(r=Ft(t),ut.crypto.Util.hashHex(r,e));return void 0===n&&(n=-1),this.signWithMessageHashPSS(i,e,n)},nt.prototype.signWithMessageHashPSS=function(t,e,n){var r,i=Et(t),s=i.length,o=this.n.bitLength()-1,a=Math.ceil(o/8),u=function(t){return ut.crypto.Util.hashHex(t,e)};if(-1===n||void 0===n)n=s;else if(-2===n)n=a-s-2;else if(n<-2)throw new Error("invalid salt length");if(a<s+n+2)throw new Error("data too long");var c="";n>0&&(c=new Array(n),(new Q).nextBytes(c),c=String.fromCharCode.apply(String,c));var l=Et(u(Ft("\0\0\0\0\0\0\0\0"+i+c))),h=[];for(r=0;r<a-n-s-2;r+=1)h[r]=0;var f=String.fromCharCode.apply(String,h)+""+c,p=ee(l,f.length,u),d=[];for(r=0;r<f.length;r+=1)d[r]=f.charCodeAt(r)^p.charCodeAt(r);var g=65280>>8*a-o&255;for(d[0]&=~g,r=0;r<s;r++)d.push(l.charCodeAt(r));return d.push(188),te(this.doPrivate(new w(d)).toString(16),this.n.bitLength())},nt.prototype.verify=function(t,e){if(null==(e=e.toLowerCase()).match(/^[0-9a-f]+$/))return!1;var n=tt(e,16),r=this.n.bitLength();if(n.bitLength()>r)return!1;var i=this.doPublic(n).toString(16);if(i.length+3!=r/4)return!1;var s=ne(i.replace(/^1f+00/,""));if(0==s.length)return!1;var o=s[0];return s[1]==function(t){return ut.crypto.Util.hashString(t,o)}(t)},nt.prototype.verifyWithMessageHash=function(t,e){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var n=tt(e,16);if(n.bitLength()>this.n.bitLength())return 0;var r=ne(this.doPublic(n).toString(16).replace(/^1f+00/,""));if(0==r.length)return!1;r[0];return r[1]==t},nt.prototype.verifyPSS=function(t,e,n,r){var i,s=(i=Ft(t),ut.crypto.Util.hashHex(i,n));return void 0===r&&(r=-1),this.verifyWithMessageHashPSS(s,e,n,r)},nt.prototype.verifyWithMessageHashPSS=function(t,e,n,r){if(e.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,s=new w(e,16),o=function(t){return ut.crypto.Util.hashHex(t,n)},a=Et(t),u=a.length,c=this.n.bitLength()-1,l=Math.ceil(c/8);if(-1===r||void 0===r)r=u;else if(-2===r)r=l-u-2;else if(r<-2)throw new Error("invalid salt length");if(l<u+r+2)throw new Error("data too long");var h=this.doPublic(s).toByteArray();for(i=0;i<h.length;i+=1)h[i]&=255;for(;h.length<l;)h.unshift(0);if(188!==h[l-1])throw new Error("encoded message does not end in 0xbc");var f=(h=String.fromCharCode.apply(String,h)).substr(0,l-u-1),p=h.substr(f.length,u),d=65280>>8*l-c&255;if(0!=(f.charCodeAt(0)&d))throw new Error("bits beyond keysize not zero");var g=ee(p,f.length,o),m=[];for(i=0;i<f.length;i+=1)m[i]=f.charCodeAt(i)^g.charCodeAt(i);m[0]&=~d;var v=l-u-r-2;for(i=0;i<v;i+=1)if(0!==m[i])throw new Error("leftmost octets not zero");if(1!==m[v])throw new Error("0x01 marker not found");return p===Et(o(Ft("\0\0\0\0\0\0\0\0"+a+String.fromCharCode.apply(String,m.slice(-r)))))},nt.SALT_LEN_HLEN=-1,nt.SALT_LEN_MAX=-2,nt.SALT_LEN_RECOVER=-2,re.hex2dn=function(t,e){void 0===e&&(e=0);var n=new re;ht.getTLV(t,e);return n.getX500Name(t).str},re.hex2rdn=function(t,e){if(void 0===e&&(e=0),"31"!==t.substr(e,2))throw new Error("malformed RDN");for(var n=new Array,r=ht.getChildIdx(t,e),i=0;i<r.length;i++)n.push(re.hex2attrTypeValue(t,r[i]));return(n=n.map((function(t){return t.replace("+","\\+")}))).join("+")},re.hex2attrTypeValue=function(t,e){var n=ht,r=n.getV;if(void 0===e&&(e=0),"30"!==t.substr(e,2))throw new Error("malformed attribute type and value");var i=n.getChildIdx(t,e);2!==i.length||t.substr(i[0],2);var s=r(t,i[0]),o=ut.asn1.ASN1Util.oidHexToInt(s);return ut.asn1.x509.OID.oid2atype(o)+"="+Et(r(t,i[1]))},re.getPublicKeyFromCertHex=function(t){var e=new re;return e.readCertHex(t),e.getPublicKey()},re.getPublicKeyFromCertPEM=function(t){var e=new re;return e.readCertPEM(t),e.getPublicKey()},re.getPublicKeyInfoPropOfCertPEM=function(t){var e,n,r=ht.getVbyList,i={};return i.algparam=null,(e=new re).readCertPEM(t),n=e.getPublicKeyHex(),i.keyhex=r(n,0,[1],"03").substr(2),i.algoid=r(n,0,[0,0],"06"),"2a8648ce3d0201"===i.algoid&&(i.algparam=r(n,0,[0,1],"06")),i},re.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];void 0!==ut&&ut||(ut={}),void 0!==ut.jws&&ut.jws||(ut.jws={}),ut.jws.JWS=function(){var t=ut.jws.JWS.isSafeJSONString;this.parseJWS=function(e,n){if(void 0===this.parsedJWS||!n&&void 0===this.parsedJWS.sigvalH){var r=e.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(null==r)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var i=r[1],s=r[2],o=r[3],a=i+"."+s;if(this.parsedJWS={},this.parsedJWS.headB64U=i,this.parsedJWS.payloadB64U=s,this.parsedJWS.sigvalB64U=o,this.parsedJWS.si=a,!n){var u=bt(o),c=tt(u,16);this.parsedJWS.sigvalH=u,this.parsedJWS.sigvalBI=c}var l=lt(i),h=lt(s);if(this.parsedJWS.headS=l,this.parsedJWS.payloadS=h,!t(l,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+l}}},ut.jws.JWS.sign=function(t,e,n,r,i){var s,o,a,u=ut,c=u.jws.JWS,l=c.readSafeJSONString,h=c.isSafeJSONString,f=u.crypto,p=(f.ECDSA,f.Mac),d=f.Signature,g=JSON;if("string"!=typeof e&&"object"!=typeof e)throw"spHeader must be JSON string or object: "+e;if("object"==typeof e&&(o=e,s=g.stringify(o)),"string"==typeof e){if(!h(s=e))throw"JWS Head is not safe JSON string: "+s;o=l(s)}if(a=n,"object"==typeof n&&(a=g.stringify(n)),""!=t&&null!=t||void 0===o.alg||(t=o.alg),""!=t&&null!=t&&void 0===o.alg&&(o.alg=t,s=g.stringify(o)),t!==o.alg)throw"alg and sHeader.alg doesn't match: "+t+"!="+o.alg;var m=null;if(void 0===c.jwsalg2sigalg[t])throw"unsupported alg name: "+t;m=c.jwsalg2sigalg[t];var v=ct(s)+"."+ct(a),y="";if("Hmac"==m.substr(0,4)){if(void 0===r)throw"mac key shall be specified for HS* alg";var b=new p({alg:m,prov:"cryptojs",pass:r});b.updateString(v),y=b.doFinal()}else if(-1!=m.indexOf("withECDSA")){(w=new d({alg:m})).init(r,i),w.updateString(v);var x=w.sign();y=ut.crypto.ECDSA.asn1SigToConcatSig(x)}else{var w;if("none"!=m)(w=new d({alg:m})).init(r,i),w.updateString(v),y=w.sign()}return v+"."+yt(y)},ut.jws.JWS.verify=function(t,e,n){var r,i=ut,s=i.jws.JWS,o=s.readSafeJSONString,a=i.crypto,u=a.ECDSA,c=a.Mac,l=a.Signature;if(r=nt,!Vt(t))return!1;var h=t.split(".");if(3!==h.length)return!1;var f=h[0]+"."+h[1],p=bt(h[2]),d=o(lt(h[0])),g=null,m=null;if(void 0===d.alg)throw"algorithm not specified in header";if((m=(g=d.alg).substr(0,2),null!=n&&"[object Array]"===Object.prototype.toString.call(n)&&n.length>0)&&-1==(":"+n.join(":")+":").indexOf(":"+g+":"))throw"algorithm '"+g+"' not accepted in the list";if("none"!=g&&null===e)throw"key shall be specified to verify.";if("string"==typeof e&&-1!=e.indexOf("-----BEGIN ")&&(e=Qt.getKey(e)),!("RS"!=m&&"PS"!=m||e instanceof r))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==m&&!(e instanceof u))throw"key shall be a ECDSA obj for ES* algs";var v=null;if(void 0===s.jwsalg2sigalg[d.alg])throw"unsupported alg name: "+g;if("none"==(v=s.jwsalg2sigalg[g]))throw"not supported";if("Hmac"==v.substr(0,4)){if(void 0===e)throw"hexadecimal key shall be specified for HMAC";var y=new c({alg:v,pass:e});return y.updateString(f),p==y.doFinal()}if(-1!=v.indexOf("withECDSA")){var b,x=null;try{x=u.concatSigToASN1Sig(p)}catch(t){return!1}return(b=new l({alg:v})).init(e),b.updateString(f),b.verify(x)}return(b=new l({alg:v})).init(e),b.updateString(f),b.verify(p)},ut.jws.JWS.parse=function(t){var e,n,r,i=t.split("."),s={};if(2!=i.length&&3!=i.length)throw"malformed sJWS: wrong number of '.' splitted elements";return e=i[0],n=i[1],3==i.length&&(r=i[2]),s.headerObj=ut.jws.JWS.readSafeJSONString(lt(e)),s.payloadObj=ut.jws.JWS.readSafeJSONString(lt(n)),s.headerPP=JSON.stringify(s.headerObj,null," "),null==s.payloadObj?s.payloadPP=lt(n):s.payloadPP=JSON.stringify(s.payloadObj,null," "),void 0!==r&&(s.sigHex=bt(r)),s},ut.jws.JWS.verifyJWT=function(t,e,n){var r=ut.jws,i=r.JWS,s=i.readSafeJSONString,o=i.inArray,a=i.includedArray;if(!Vt(t))return!1;var u=t.split(".");if(3!=u.length)return!1;var c=u[0],l=u[1],h=(bt(u[2]),s(lt(c))),f=s(lt(l));if(void 0===h.alg)return!1;if(void 0===n.alg)throw"acceptField.alg shall be specified";if(!o(h.alg,n.alg))return!1;if(void 0!==f.iss&&"object"==typeof n.iss&&!o(f.iss,n.iss))return!1;if(void 0!==f.sub&&"object"==typeof n.sub&&!o(f.sub,n.sub))return!1;if(void 0!==f.aud&&"object"==typeof n.aud)if("string"==typeof f.aud){if(!o(f.aud,n.aud))return!1}else if("object"==typeof f.aud&&!a(f.aud,n.aud))return!1;var p=r.IntDate.getNow();return void 0!==n.verifyAt&&"number"==typeof n.verifyAt&&(p=n.verifyAt),void 0!==n.gracePeriod&&"number"==typeof n.gracePeriod||(n.gracePeriod=0),!(void 0!==f.exp&&"number"==typeof f.exp&&f.exp+n.gracePeriod<p)&&(!(void 0!==f.nbf&&"number"==typeof f.nbf&&p<f.nbf-n.gracePeriod)&&(!(void 0!==f.iat&&"number"==typeof f.iat&&p<f.iat-n.gracePeriod)&&((void 0===f.jti||void 0===n.jti||f.jti===n.jti)&&!!i.verify(t,e,n.alg))))},ut.jws.JWS.includedArray=function(t,e){var n=ut.jws.JWS.inArray;if(null===t)return!1;if("object"!=typeof t)return!1;if("number"!=typeof t.length)return!1;for(var r=0;r<t.length;r++)if(!n(t[r],e))return!1;return!0},ut.jws.JWS.inArray=function(t,e){if(null===e)return!1;if("object"!=typeof e)return!1;if("number"!=typeof e.length)return!1;for(var n=0;n<e.length;n++)if(e[n]==t)return!0;return!1},ut.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",ES512:"SHA512withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"},ut.jws.JWS.isSafeJSONString=function(t,e,n){var r=null;try{return"object"!=typeof(r=at(t))||r.constructor===Array?0:(e&&(e[n]=r),1)}catch(t){return 0}},ut.jws.JWS.readSafeJSONString=function(t){var e=null;try{return"object"!=typeof(e=at(t))||e.constructor===Array?null:e}catch(t){return null}},ut.jws.JWS.getEncodedSignatureValueFromJWS=function(t){var e=t.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(null==e)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return e[1]},ut.jws.JWS.getJWKthumbprint=function(t){if("RSA"!==t.kty&&"EC"!==t.kty&&"oct"!==t.kty)throw"unsupported algorithm for JWK Thumprint";var e="{";if("RSA"===t.kty){if("string"!=typeof t.n||"string"!=typeof t.e)throw"wrong n and e value for RSA key";e+='"e":"'+t.e+'",',e+='"kty":"'+t.kty+'",',e+='"n":"'+t.n+'"}'}else if("EC"===t.kty){if("string"!=typeof t.crv||"string"!=typeof t.x||"string"!=typeof t.y)throw"wrong crv, x and y value for EC key";e+='"crv":"'+t.crv+'",',e+='"kty":"'+t.kty+'",',e+='"x":"'+t.x+'",',e+='"y":"'+t.y+'"}'}else if("oct"===t.kty){if("string"!=typeof t.k)throw"wrong k value for oct(symmetric) key";e+='"kty":"'+t.kty+'",',e+='"k":"'+t.k+'"}'}var n=Ft(e);return yt(ut.crypto.Util.hashHex(n,"sha256"))},ut.jws.IntDate={},ut.jws.IntDate.get=function(t){var e=ut.jws.IntDate,n=e.getNow,r=e.getZulu;if("now"==t)return n();if("now + 1hour"==t)return n()+3600;if("now + 1day"==t)return n()+86400;if("now + 1month"==t)return n()+2592e3;if("now + 1year"==t)return n()+31536e3;if(t.match(/Z$/))return r(t);if(t.match(/^[0-9]+$/))return parseInt(t);throw"unsupported format: "+t},ut.jws.IntDate.getZulu=function(t){return Tt(t)},ut.jws.IntDate.getNow=function(){return~~(new Date/1e3)},ut.jws.IntDate.intDate2UTCString=function(t){return new Date(1e3*t).toUTCString()},ut.jws.IntDate.intDate2Zulu=function(t){var e=new Date(1e3*t);return("0000"+e.getUTCFullYear()).slice(-4)+("00"+(e.getUTCMonth()+1)).slice(-2)+("00"+e.getUTCDate()).slice(-2)+("00"+e.getUTCHours()).slice(-2)+("00"+e.getUTCMinutes()).slice(-2)+("00"+e.getUTCSeconds()).slice(-2)+"Z"},void 0!==ut&&ut||(ut={}),void 0!==ut.jws&&ut.jws||(ut.jws={}),ut.jws.JWSJS=function(){var t=ut.jws.JWS,e=t.readSafeJSONString;this.aHeader=[],this.sPayload="",this.aSignature=[],this.init=function(){this.aHeader=[],this.sPayload=void 0,this.aSignature=[]},this.initWithJWS=function(t){this.init();var e=t.split(".");if(3!=e.length)throw"malformed input JWS";this.aHeader.push(e[0]),this.sPayload=e[1],this.aSignature.push(e[2])},this.addSignature=function(t,e,n,r){if(void 0===this.sPayload||null===this.sPayload)throw"there's no JSON-JS signature to add.";var i=this.aHeader.length;if(this.aHeader.length!=this.aSignature.length)throw"aHeader.length != aSignature.length";try{var s=ut.jws.JWS.sign(t,e,this.sPayload,n,r).split(".");s[0],s[2];this.aHeader.push(s[0]),this.aSignature.push(s[2])}catch(t){throw this.aHeader.length>i&&this.aHeader.pop(),this.aSignature.length>i&&this.aSignature.pop(),"addSignature failed: "+t}},this.verifyAll=function(t){if(this.aHeader.length!==t.length||this.aSignature.length!==t.length)return!1;for(var e=0;e<t.length;e++){var n=t[e];if(2!==n.length)return!1;if(!1===this.verifyNth(e,n[0],n[1]))return!1}return!0},this.verifyNth=function(e,n,r){if(this.aHeader.length<=e||this.aSignature.length<=e)return!1;var i=this.aHeader[e],s=this.aSignature[e],o=i+"."+this.sPayload+"."+s,a=!1;try{a=t.verify(o,n,r)}catch(t){return!1}return a},this.readJWSJS=function(t){if("string"==typeof t){var n=e(t);if(null==n)throw"argument is not safe JSON object string";this.aHeader=n.headers,this.sPayload=n.payload,this.aSignature=n.signatures}else try{if(!(t.headers.length>0))throw"malformed header";if(this.aHeader=t.headers,"string"!=typeof t.payload)throw"malformed signatures";if(this.sPayload=t.payload,!(t.signatures.length>0))throw"malformed signatures";this.aSignature=t.signatures}catch(t){throw"malformed JWS-JS JSON object: "+t}},this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}},this.isEmpty=function(){return 0==this.aHeader.length?1:0}},e.SecureRandom=Q,e.rng_seed_time=G,e.BigInteger=w,e.RSAKey=nt,e.ECDSA=ut.crypto.ECDSA,e.DSA=ut.crypto.DSA,e.Signature=ut.crypto.Signature,e.MessageDigest=ut.crypto.MessageDigest,e.Mac=ut.crypto.Mac,e.Cipher=ut.crypto.Cipher,e.KEYUTIL=Qt,e.ASN1HEX=ht,e.X509=re,e.X509CRL=function(t){var e=ut.lang.String.isHex,n=ht,r=n.getV,i=n.getTLV,s=n.getVbyList,o=n.getTLVbyList,a=n.getTLVbyListEx,u=n.getIdxbyList,c=n.getIdxbyListEx,l=n.getChildIdx,h=new re;this.hex=null,this.posSigAlg=null,this.posRevCert=null,this.parsed=null,this._setPos=function(){var t=u(this.hex,0,[0,0]),e=this.hex.substr(t,2);if("02"==e)this.posSigAlg=1;else{if("30"!=e)throw new Error("malformed 1st item of TBSCertList: "+e);this.posSigAlg=0}var n,r=u(this.hex,0,[0,this.posSigAlg+3]),i=this.hex.substr(r,2);if("17"==i||"18"==i)n=u(this.hex,0,[0,this.posSigAlg+4]),this.posRevCert=null,-1!=n&&"30"==this.hex.substr(n,2)&&(this.posRevCert=this.posSigAlg+4);else if("30"==i)this.posRevCert=this.posSigAlg+3;else{if("a0"!=i)throw new Error("malformed nextUpdate or revCert tag: "+i);this.posRevCert=null}},this.getVersion=function(){return 0==this.posSigAlg?null:parseInt(s(this.hex,0,[0,0],"02"),16)+1},this.getSignatureAlgorithmField=function(){var t=o(this.hex,0,[0,this.posSigAlg],"30");return h.getAlgorithmIdentifierName(t)},this.getIssuer=function(){return h.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return o(this.hex,0,[0,this.posSigAlg+1],"30")},this.getThisUpdate=function(){var t=s(this.hex,0,[0,this.posSigAlg+2]);return result=Et(t)},this.getNextUpdate=function(){var t=u(this.hex,0,[0,this.posSigAlg+3]),e=this.hex.substr(t,2);return"17"!=e&&"18"!=e?null:Et(r(this.hex,t))},this.getRevCertArray=function(){if(null==this.posRevCert)return null;for(var t=[],e=u(this.hex,0,[0,this.posRevCert]),n=l(this.hex,e),r=0;r<n.length;r++){var s=i(this.hex,n[r]);t.push(this.getRevCert(s))}return t},this.getRevCert=function(t){var e={},n=l(t,0);return e.sn={hex:s(t,0,[0],"02")},e.date=Et(s(t,0,[1])),3==n.length&&(e.ext=h.getExtParamArray(o(t,0,[2]))),e},this.findRevCert=function(t){var e=new re(t).getSerialNumberHex();return this.findRevCertBySN(e)},this.findRevCertBySN=function(t){if(null==this.parsed&&this.getParam(),null==this.parsed.revcert)return null;for(var e=this.parsed.revcert,n=0;n<e.length;n++)if(t==e[n].sn.hex)return e[n];return null},this.getSignatureValueHex=function(){return s(this.hex,0,[2],"03",!0)},this.verifySignature=function(t){var e=this.getSignatureAlgorithmField(),n=this.getSignatureValueHex(),r=o(this.hex,0,[0],"30"),i=new ut.crypto.Signature({alg:e});return i.init(t),i.updateHex(r),i.verify(n)},this.getParam=function(t){var e={},n=this.getVersion();null!=n&&(e.version=n),e.sigalg=this.getSignatureAlgorithmField(),e.issuer=this.getIssuer(),e.thisupdate=this.getThisUpdate();var r=this.getNextUpdate();null!=r&&(e.nextupdate=r);var i=this.getRevCertArray();if(null!=i&&(e.revcert=i),-1!=c(this.hex,0,[0,"[0]"])){var s=a(this.hex,0,[0,"[0]",0]);e.ext=h.getExtParamArray(s)}return e.sighex=this.getSignatureValueHex(),this.parsed=e,"object"==typeof t&&(1==t.tbshex&&(e.tbshex=o(this.hex,0,[0])),1==t.nodnarray&&delete e.issuer.array),e},"string"==typeof t&&(e(t)?this.hex=t:t.match(/-----BEGIN X509 CRL/)&&(this.hex=It(t)),this._setPos())},e.CryptoJS=g,e.b64tohex=b,e.b64toBA=x,e.ECFieldElementFp=it,e.ECPointFp=st,e.ECCurveFp=ot,e.stoBA=ft,e.BAtos=pt,e.BAtohex=dt,e.stohex=gt,e.stob64=function(t){return y(gt(t))},e.stob64u=function(t){return mt(y(gt(t)))},e.b64utos=function(t){return pt(x(vt(t)))},e.b64tob64u=mt,e.b64utob64=vt,e.hex2b64=y,e.hextob64u=yt,e.b64utohex=bt,e.utf8tob64u=ct,e.b64utoutf8=lt,e.utf8tob64=function(t){return y(_t(Mt(t)))},e.b64toutf8=function(t){return decodeURIComponent(Pt(b(t)))},e.utf8tohex=xt,e.hextoutf8=wt,e.hextorstr=Et,e.rstrtohex=Ft,e.hextob64=At,e.hextob64nl=Ct,e.b64nltohex=Dt,e.hextopem=$t,e.pemtohex=It,e.hextoArrayBuffer=function(t){if(t.length%2!=0)throw"input is not even length";if(null==t.match(/^[0-9A-Fa-f]+$/))throw"input is not hexadecimal";for(var e=new ArrayBuffer(t.length/2),n=new DataView(e),r=0;r<t.length/2;r++)n.setUint8(r,parseInt(t.substr(2*r,2),16));return e},e.ArrayBuffertohex=function(t){for(var e="",n=new DataView(t),r=0;r<t.byteLength;r++)e+=("00"+n.getUint8(r).toString(16)).slice(-2);return e},e.zulutomsec=Rt,e.zulutosec=Tt,e.zulutodate=function(t){return new Date(Rt(t))},e.datetozulu=function(t,e,n){var r,i=t.getUTCFullYear();if(e){if(i<1950||2049<i)throw"not proper year for UTCTime: "+i;r=(""+i).slice(-2)}else r=("000"+i).slice(-4);if(r+=("0"+(t.getUTCMonth()+1)).slice(-2),r+=("0"+t.getUTCDate()).slice(-2),r+=("0"+t.getUTCHours()).slice(-2),r+=("0"+t.getUTCMinutes()).slice(-2),r+=("0"+t.getUTCSeconds()).slice(-2),n){var s=t.getUTCMilliseconds();0!==s&&(r+="."+(s=(s=("00"+s).slice(-3)).replace(/0+$/g,"")))}return r+="Z"},e.uricmptohex=_t,e.hextouricmp=Pt,e.ipv6tohex=kt,e.hextoipv6=Ot,e.hextoip=jt,e.iptohex=Nt,e.ucs2hextoutf8=Ht,e.encodeURIComponentAll=Mt,e.newline_toUnix=function(t){return t=t.replace(/\r\n/gm,"\n")},e.newline_toDos=function(t){return t=(t=t.replace(/\r\n/gm,"\n")).replace(/\n/gm,"\r\n")},e.hextoposhex=qt,e.intarystrtohex=function(t){t=(t=(t=t.replace(/^\s*\[\s*/,"")).replace(/\s*\]\s*$/,"")).replace(/\s*/g,"");try{return t.split(/,/).map((function(t,e,n){var r=parseInt(t);if(r<0||255<r)throw"integer not in range 0-255";return("00"+r.toString(16)).slice(-2)})).join("")}catch(t){throw"malformed integer array string: "+t}},e.strdiffidx=function(t,e){var n=t.length;t.length>e.length&&(n=e.length);for(var r=0;r<n;r++)if(t.charCodeAt(r)!=e.charCodeAt(r))return r;return t.length!=e.length?n:-1},e.oidtohex=Kt,e.hextooid=zt,e.strpad=Gt,e.bitstrtoint=Wt,e.inttobitstr=Yt,e.bitstrtobinstr=Xt,e.binstrtobitstr=function(t){if("string"!=typeof t)return null;if(null==t.match(/^[01]+$/))return null;try{return Yt(parseInt(t,2))}catch(t){return null}},e.isBase64URLDot=Vt,e.namearraytobinstr=Jt,e.extendClass=Zt,e.KJUR=ut,e.crypto=ut.crypto,e.asn1=ut.asn1,e.jws=ut.jws,e.lang=ut.lang}).call(this,n(184).Buffer)},function(t,e,n){"use strict";n.r(e);n(172),n(173),n(174),n(175),n(176),n(177),n(179),n(181),n(182),n(25),n(183),n(11),n(16),n(37);function r(t,e,n){return{openSimpleModal:function(e){return t.open({templateUrl:e.warning?"js/angular/core/templates/modal/modal-warning.html":"js/angular/core/templates/modal/modal-simple.html",controller:"SimpleModalCtrl",size:e.size,resolve:{title:function(){return e.title},message:function(){return n.trustAsHtml(e.message)}}})},openCopyToClipboardModal:function(n){const r=t.open({templateUrl:"js/angular/core/templates/modal/copy-to-clipboard-modal.html",controller:"CopyToClipboardModalCtrl",resolve:{uri:function(){return n}}});return r.opened.then((function(){e((function(){$("#clipboardURI")[0].select()}),100)})),r}}}function i(t){return{getDetails:function(e){return t.get("rest/explore/details",{params:{uri:e},headers:{Accept:"application/json"}})},getGraph:function(e){const n=encodeURIComponent(e);return t.get("rest/explore/graph?uri="+n+"&role=subject",{headers:{Accept:"application/rdf+json"}})},getNamespaceUriForPrefix:function(t,e){let n="";for(let r=0;r<t.length;r++)if(t[r].prefix===e){n=t[r].uri;break}return n},getNamespacePrefixForUri:function(t,e){let n="";for(let r=0;r<t.length;r++)if(t[r].uri===e){n=t[r].prefix;break}return n},getLocalName:function(t){if(angular.isUndefined(t))return t;{let e;const n=t.length-1;let r=t.toString().lastIndexOf("/");r===n&&(e=t.substr(0,n),r=e.lastIndexOf("/"));let i=t.toString().lastIndexOf("#");return i===n&&(e=t.substr(0,n),i=e.lastIndexOf("/")),t.toString().substring(Math.max(i,r)+1)}}}}angular.module("graphdb.framework.core",["ui.bootstrap","jlareau.bowser","LocalStorageModule","graphdb.framework.core.controllers","pascalprecht.translate"]).provider("$menuItems",(function(){const t=function(e,n){for(let r=0;r<e.length;r++){const i=e[r];if(i.label===n)return i;const s=t(i.children,n);if(!angular.isUndefined(s))return s}},e=function(t,e){for(let n=0;n<t.length;n++){if(t[n].label===e)return!0}return!1},n=function(t,e){return t.order<e.order?-1:t.order>e.order?1:0},r=function(t,e){return{label:t.label,labelKey:t.labelKey,href:t.href,hrefFun:t.hrefFun,order:t.order,role:t.role,editions:t.editions,icon:t.icon,guideSelector:t.guideSelector,children:e}};let i;const s=[];let o=[];this.addItem=function(t){angular.isUndefined(t.parent)?e(s,t.label)||(s.push(r(t,[])),this.updateItemsWithMissedParent()):this.addItemToParent(t)||o.push(t)},this.addItemToParent=function(n){const i=t(s,n.parent);return!angular.isUndefined(i)&&!e(i.children,n.label)&&(i.children.push(r(n,n.children?n.children:[])),!0)},this.updateItemsWithMissedParent=function(){if(o.length>0){const t=[];let e=this;o.forEach((function(n){e.addItemToParent(n)||t.push(n)})),o=t}},this.$get=function(){s.sort(n);for(let t=0;t<s.length;t++){s[t].children.sort(n)}return s},this.setProductInfo=function(t){i=t},this.getProductInfo=function(){return i}})).factory("ModalService",r).factory("ClassInstanceDetailsService",i),r.$inject=["$modal","$timeout","$sce"],i.$inject=["$http"]},function(t,e){function n(t,e){return{get:function(e){return t.get(e)},set:function(e,n){t.set(e,n)},keys:n,remove:r,clearAll:function(){t.clearAll()},clearClassHieararchyState:function(){n().forEach((function(t){0!==t.indexOf("classHierarchy-")||t===e.CLASS_HIERARCHY_HIDE_PREFIXES||t.startsWith("classHierarchy-selectedGraph-")||r(t)}))}};function n(){return t.keys()}function r(e){t.remove(e)}}angular.module("graphdb.framework.utils.localstorageadapter",[]).factory("LocalStorageAdapter",n).value("LSKeys",{TABS_STATE:"tabs-state",TABS_STATE_CURRENT_ID:"tabs-state-currentid",TABS_STATE_MAXID:"tabs-state-maxid",VIEW_MODE:"viewMode",CLASS_HIERARCHY_HIDE_PREFIXES:"classHierarchy-hidePrefixes",CLASS_HIERARCHY_CURRENT_SLIDER_VALUE:"classHierarchy-currentSliderValue",CLASS_HIERARCHY_SWITCH_PREFIXES:"classHierarchy-switchPrefixes",CLASS_HIERARCHY_LAST_SELECTED_CLASS:"classHierarchy-lastSelectedClass",DOMAIN_RANGE_WENT_BACK:"domainRange-wentBack",DOMAIN_RANGE_COLLAPSE_EDGES:"domainRange-collapseEdges",HIDE_SIMILARITY_HELP:"hide-similarity-help",TUTORIAL_STATE:"tutorial-state",MENU_STATE:"menu-state",HIDE_GRAPH_CONFIG_HELP:"hide-graph-config-help",GRAPHS_VIZ:"graphs-viz",AUTOCOMPLETE_ENABLED:"autocomplete.enabled",RDF_SEARCH_TYPE:"rdf-search.search-type",RDF_SEARCH_INPUT:"rdf-search.search-input",RDF_SEARCH_EXPANDED_URI:"rdf-search.search-expanded-uri",RDF_RESOURCE_DESCRIPTION:"rdf-search.resource-description",PREFERRED_LANG:"preferred-language",WORKBENCH_SETTINGS:"workbench-settings"}),n.$inject=["localStorageService","LSKeys"]},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";n.r(e),n.d(e,"GUIDE_ID",(function(){return cn})),n.d(e,"GUIDE_CURRENT_STEP_ID",(function(){return ln})),n.d(e,"GUIDE_STEP_HISTORY",(function(){return hn})),n.d(e,"GUIDE_PAUSE",(function(){return fn}));var r=n(1),i=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===s}(t)}(t)};
|
|
28
|
+
/*! shepherd.js 10.0.1 */var s="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function o(t,e){return!1!==e.clone&&e.isMergeableObject(t)?h((n=t,Array.isArray(n)?[]:{}),t,e):t;var n}function a(t,e,n){return t.concat(e).map((function(t){return o(t,n)}))}function u(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter((function(e){return t.propertyIsEnumerable(e)})):[]}(t))}function c(t,e){try{return e in t}catch(t){return!1}}function l(t,e,n){var r={};return n.isMergeableObject(t)&&u(t).forEach((function(e){r[e]=o(t[e],n)})),u(e).forEach((function(i){(function(t,e){return c(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,i)||(c(t,i)&&n.isMergeableObject(e[i])?r[i]=function(t,e){if(!e.customMerge)return h;var n=e.customMerge(t);return"function"==typeof n?n:h}(i,n)(t[i],e[i],n):r[i]=o(e[i],n))})),r}function h(t,e,n){(n=n||{}).arrayMerge=n.arrayMerge||a,n.isMergeableObject=n.isMergeableObject||i,n.cloneUnlessOtherwiseSpecified=o;var r=Array.isArray(e);return r===Array.isArray(t)?r?n.arrayMerge(t,e,n):l(t,e,n):o(e,n)}h.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce((function(t,n){return h(t,n,e)}),{})};var f=h;function p(t){return t instanceof HTMLElement}function d(t){return"function"==typeof t}function g(t){return"string"==typeof t}function m(t){return void 0===t}class v{on(t,e,n,r){return void 0===r&&(r=!1),m(this.bindings)&&(this.bindings={}),m(this.bindings[t])&&(this.bindings[t]=[]),this.bindings[t].push({handler:e,ctx:n,once:r}),this}once(t,e,n){return this.on(t,e,n,!0)}off(t,e){return m(this.bindings)||m(this.bindings[t])||(m(e)?delete this.bindings[t]:this.bindings[t].forEach((n,r)=>{n.handler===e&&this.bindings[t].splice(r,1)})),this}trigger(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return!m(this.bindings)&&this.bindings[t]&&this.bindings[t].forEach((e,r)=>{const{ctx:i,handler:s,once:o}=e,a=i||this;s.apply(a,n),o&&this.bindings[t].splice(r,1)}),this}}function y(t){const e=Object.getOwnPropertyNames(t.constructor.prototype);for(let n=0;n<e.length;n++){const r=e[n],i=t[r];"constructor"!==r&&"function"==typeof i&&(t[r]=i.bind(t))}return t}function b(t){const{event:e,selector:n}=t.options.advanceOn||{};if(!e)return console.error("advanceOn was defined, but no event name was passed.");{const r=function(t,e){return n=>{if(e.isOpen()){const r=e.el&&n.currentTarget===e.el;(!m(t)&&n.currentTarget.matches(t)||r)&&e.tour.next()}}}(n,t);let i;try{i=document.querySelector(n)}catch(t){}if(!m(n)&&!i)return console.error("No element was found for the selector supplied to advanceOn: "+n);i?(i.addEventListener(e,r),t.on("destroy",()=>i.removeEventListener(e,r))):(document.body.addEventListener(e,r,!0),t.on("destroy",()=>document.body.removeEventListener(e,r,!0)))}}var x="top",w="bottom",S="right",E="left",F=[x,w,S,E],A=F.reduce((function(t,e){return t.concat([e+"-start",e+"-end"])}),[]),C=[].concat(F,["auto"]).reduce((function(t,e){return t.concat([e,e+"-start",e+"-end"])}),[]),D=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function $(t){return t?(t.nodeName||"").toLowerCase():null}function I(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function R(t){return t instanceof I(t).Element||t instanceof Element}function T(t){return t instanceof I(t).HTMLElement||t instanceof HTMLElement}function _(t){return"undefined"!=typeof ShadowRoot&&(t instanceof I(t).ShadowRoot||t instanceof ShadowRoot)}var P={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var n=e.styles[t]||{},r=e.attributes[t]||{},i=e.elements[t];T(i)&&$(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(t){var e=r[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach((function(t){var r=e.elements[t],i=e.attributes[t]||{},s=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce((function(t,e){return t[e]="",t}),{});T(r)&&$(r)&&(Object.assign(r.style,s),Object.keys(i).forEach((function(t){r.removeAttribute(t)})))}))}},requires:["computeStyles"]};function k(t){return t.split("-")[0]}var O=Math.max,j=Math.min,B=Math.round;function N(t,e){void 0===e&&(e=!1);var n=t.getBoundingClientRect(),r=1,i=1;if(T(t)&&e){var s=t.offsetHeight,o=t.offsetWidth;o>0&&(r=B(n.width)/o||1),s>0&&(i=B(n.height)/s||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function L(t){var e=N(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function H(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&_(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function M(t){return I(t).getComputedStyle(t)}function U(t){return["table","td","th"].indexOf($(t))>=0}function V(t){return((R(t)?t.ownerDocument:t.document)||window.document).documentElement}function q(t){return"html"===$(t)?t:t.assignedSlot||t.parentNode||(_(t)?t.host:null)||V(t)}function K(t){return T(t)&&"fixed"!==M(t).position?t.offsetParent:null}function z(t){for(var e=I(t),n=K(t);n&&U(n)&&"static"===M(n).position;)n=K(n);return n&&("html"===$(n)||"body"===$(n)&&"static"===M(n).position)?e:n||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&T(t)&&"fixed"===M(t).position)return null;var n=q(t);for(_(n)&&(n=n.host);T(n)&&["html","body"].indexOf($(n))<0;){var r=M(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||e&&"filter"===r.willChange||e&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(t)||e}function G(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function W(t,e,n){return O(t,j(e,n))}function Y(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function X(t,e){return e.reduce((function(e,n){return e[n]=t,e}),{})}function J(t){return t.split("-")[1]}var Z={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Q(t){var e,n=t.popper,r=t.popperRect,i=t.placement,s=t.variation,o=t.offsets,a=t.position,u=t.gpuAcceleration,c=t.adaptive,l=t.roundOffsets,h=t.isFixed,f=o.x,p=void 0===f?0:f,d=o.y,g=void 0===d?0:d,m="function"==typeof l?l({x:p,y:g}):{x:p,y:g};p=m.x,g=m.y;var v=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),b=E,F=x,A=window;if(c){var C=z(n),D="clientHeight",$="clientWidth";if(C===I(n)&&"static"!==M(C=V(n)).position&&"absolute"===a&&(D="scrollHeight",$="scrollWidth"),C=C,i===x||(i===E||i===S)&&"end"===s)F=w,g-=(h&&C===A&&A.visualViewport?A.visualViewport.height:C[D])-r.height,g*=u?1:-1;if(i===E||(i===x||i===w)&&"end"===s)b=S,p-=(h&&C===A&&A.visualViewport?A.visualViewport.width:C[$])-r.width,p*=u?1:-1}var R,T=Object.assign({position:a},c&&Z),_=!0===l?function(t){var e=t.x,n=t.y,r=window.devicePixelRatio||1;return{x:B(e*r)/r||0,y:B(n*r)/r||0}}({x:p,y:g}):{x:p,y:g};return p=_.x,g=_.y,u?Object.assign({},T,((R={})[F]=y?"0":"",R[b]=v?"0":"",R.transform=(A.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",R)):Object.assign({},T,((e={})[F]=y?g+"px":"",e[b]=v?p+"px":"",e.transform="",e))}var tt={passive:!0};var et={left:"right",right:"left",bottom:"top",top:"bottom"};function nt(t){return t.replace(/left|right|bottom|top/g,(function(t){return et[t]}))}var rt={start:"end",end:"start"};function it(t){return t.replace(/start|end/g,(function(t){return rt[t]}))}function st(t){var e=I(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ot(t){return N(V(t)).left+st(t).scrollLeft}function at(t){var e=M(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function ut(t,e){var n;void 0===e&&(e=[]);var r=function t(e){return["html","body","#document"].indexOf($(e))>=0?e.ownerDocument.body:T(e)&&at(e)?e:t(q(e))}(t),i=r===(null==(n=t.ownerDocument)?void 0:n.body),s=I(r),o=i?[s].concat(s.visualViewport||[],at(r)?r:[]):r,a=e.concat(o);return i?a:a.concat(ut(q(o)))}function ct(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function lt(t,e){return"viewport"===e?ct(function(t){var e=I(t),n=V(t),r=e.visualViewport,i=n.clientWidth,s=n.clientHeight,o=0,a=0;return r&&(i=r.width,s=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=r.offsetLeft,a=r.offsetTop)),{width:i,height:s,x:o+ot(t),y:a}}(t)):R(e)?function(t){var e=N(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):ct(function(t){var e,n=V(t),r=st(t),i=null==(e=t.ownerDocument)?void 0:e.body,s=O(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=O(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+ot(t),u=-r.scrollTop;return"rtl"===M(i||n).direction&&(a+=O(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:o,x:a,y:u}}(V(t)))}function ht(t,e,n){var r="clippingParents"===e?function(t){var e=ut(q(t)),n=["absolute","fixed"].indexOf(M(t).position)>=0&&T(t)?z(t):t;return R(n)?e.filter((function(t){return R(t)&&H(t,n)&&"body"!==$(t)})):[]}(t):[].concat(e),i=[].concat(r,[n]),s=i[0],o=i.reduce((function(e,n){var r=lt(t,n);return e.top=O(r.top,e.top),e.right=j(r.right,e.right),e.bottom=j(r.bottom,e.bottom),e.left=O(r.left,e.left),e}),lt(t,s));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function ft(t){var e,n=t.reference,r=t.element,i=t.placement,s=i?k(i):null,o=i?J(i):null,a=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2;switch(s){case x:e={x:a,y:n.y-r.height};break;case w:e={x:a,y:n.y+n.height};break;case S:e={x:n.x+n.width,y:u};break;case E:e={x:n.x-r.width,y:u};break;default:e={x:n.x,y:n.y}}var c=s?G(s):null;if(null!=c){var l="y"===c?"height":"width";switch(o){case"start":e[c]=e[c]-(n[l]/2-r[l]/2);break;case"end":e[c]=e[c]+(n[l]/2-r[l]/2)}}return e}function pt(t,e){void 0===e&&(e={});var n=e,r=n.placement,i=void 0===r?t.placement:r,s=n.boundary,o=void 0===s?"clippingParents":s,a=n.rootBoundary,u=void 0===a?"viewport":a,c=n.elementContext,l=void 0===c?"popper":c,h=n.altBoundary,f=void 0!==h&&h,p=n.padding,d=void 0===p?0:p,g=Y("number"!=typeof d?d:X(d,F)),m="popper"===l?"reference":"popper",v=t.rects.popper,y=t.elements[f?m:l],b=ht(R(y)?y:y.contextElement||V(t.elements.popper),o,u),E=N(t.elements.reference),A=ft({reference:E,element:v,strategy:"absolute",placement:i}),C=ct(Object.assign({},v,A)),D="popper"===l?C:E,$={top:b.top-D.top+g.top,bottom:D.bottom-b.bottom+g.bottom,left:b.left-D.left+g.left,right:D.right-b.right+g.right},I=t.modifiersData.offset;if("popper"===l&&I){var T=I[i];Object.keys($).forEach((function(t){var e=[S,w].indexOf(t)>=0?1:-1,n=[x,w].indexOf(t)>=0?"y":"x";$[t]+=T[n]*e}))}return $}function dt(t,e){void 0===e&&(e={});var n=e,r=n.placement,i=n.boundary,s=n.rootBoundary,o=n.padding,a=n.flipVariations,u=n.allowedAutoPlacements,c=void 0===u?C:u,l=J(r),h=l?a?A:A.filter((function(t){return J(t)===l})):F,f=h.filter((function(t){return c.indexOf(t)>=0}));0===f.length&&(f=h);var p=f.reduce((function(e,n){return e[n]=pt(t,{placement:n,boundary:i,rootBoundary:s,padding:o})[k(n)],e}),{});return Object.keys(p).sort((function(t,e){return p[t]-p[e]}))}function gt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function mt(t){return[x,S,w,E].some((function(e){return t[e]>=0}))}function vt(t,e,n){void 0===n&&(n=!1);var r,i,s=T(e),o=T(e)&&function(t){var e=t.getBoundingClientRect(),n=B(e.width)/t.offsetWidth||1,r=B(e.height)/t.offsetHeight||1;return 1!==n||1!==r}(e),a=V(e),u=N(t,o),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(s||!s&&!n)&&(("body"!==$(e)||at(a))&&(c=(r=e)!==I(r)&&T(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:st(r)),T(e)?((l=N(e,!0)).x+=e.clientLeft,l.y+=e.clientTop):a&&(l.x=ot(a))),{x:u.left+c.scrollLeft-l.x,y:u.top+c.scrollTop-l.y,width:u.width,height:u.height}}function yt(t){var e=new Map,n=new Set,r=[];return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){n.has(t.name)||function t(i){n.add(i.name),[].concat(i.requires||[],i.requiresIfExists||[]).forEach((function(r){if(!n.has(r)){var i=e.get(r);i&&t(i)}})),r.push(i)}(t)})),r}var bt={placement:"bottom",modifiers:[],strategy:"absolute"};function xt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some((function(t){return!(t&&"function"==typeof t.getBoundingClientRect)}))}function wt(t){void 0===t&&(t={});var e=t,n=e.defaultModifiers,r=void 0===n?[]:n,i=e.defaultOptions,s=void 0===i?bt:i;return function(t,e,n){void 0===n&&(n=s);var i,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},bt,s),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},u=[],c=!1,l={state:a,setOptions:function(n){var i="function"==typeof n?n(a.options):n;h(),a.options=Object.assign({},s,a.options,i),a.scrollParents={reference:R(t)?ut(t):t.contextElement?ut(t.contextElement):[],popper:ut(e)};var o,c,f=function(t){var e=yt(t);return D.reduce((function(t,n){return t.concat(e.filter((function(t){return t.phase===n})))}),[])}((o=[].concat(r,a.options.modifiers),c=o.reduce((function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t}),{}),Object.keys(c).map((function(t){return c[t]}))));return a.orderedModifiers=f.filter((function(t){return t.enabled})),a.orderedModifiers.forEach((function(t){var e=t.name,n=t.options,r=void 0===n?{}:n,i=t.effect;if("function"==typeof i){var s=i({state:a,name:e,instance:l,options:r});u.push(s||function(){})}})),l.update()},forceUpdate:function(){if(!c){var t=a.elements,e=t.reference,n=t.popper;if(xt(e,n)){a.rects={reference:vt(e,z(n),"fixed"===a.options.strategy),popper:L(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach((function(t){return a.modifiersData[t.name]=Object.assign({},t.data)}));for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var i=a.orderedModifiers[r],s=i.fn,o=i.options,u=void 0===o?{}:o,h=i.name;"function"==typeof s&&(a=s({state:a,options:u,name:h,instance:l})||a)}else a.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(t){l.forceUpdate(),t(a)}))},function(){return o||(o=new Promise((function(t){Promise.resolve().then((function(){o=void 0,t(i())}))}))),o}),destroy:function(){h(),c=!0}};if(!xt(t,e))return l;function h(){u.forEach((function(t){return t()})),u=[]}return l.setOptions(n).then((function(t){!c&&n.onFirstUpdate&&n.onFirstUpdate(t)})),l}}var St=wt({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,s=void 0===i||i,o=r.resize,a=void 0===o||o,u=I(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach((function(t){t.addEventListener("scroll",n.update,tt)})),a&&u.addEventListener("resize",n.update,tt),function(){s&&c.forEach((function(t){t.removeEventListener("scroll",n.update,tt)})),a&&u.removeEventListener("resize",n.update,tt)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,n=t.name;e.modifiersData[n]=ft({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=void 0===r||r,s=n.adaptive,o=void 0===s||s,a=n.roundOffsets,u=void 0===a||a,c={placement:k(e.placement),variation:J(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,Q(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:u})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,Q(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},P,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.options,r=t.name,i=n.offset,s=void 0===i?[0,0]:i,o=C.reduce((function(t,n){return t[n]=function(t,e,n){var r=k(t),i=[E,x].indexOf(r)>=0?-1:1,s="function"==typeof n?n(Object.assign({},e,{placement:t})):n,o=s[0],a=s[1];return o=o||0,a=(a||0)*i,[E,S].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}(n,e.rects,s),t}),{}),a=o[e.placement],u=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,s=void 0===i||i,o=n.altAxis,a=void 0===o||o,u=n.fallbackPlacements,c=n.padding,l=n.boundary,h=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,d=void 0===p||p,g=n.allowedAutoPlacements,m=e.options.placement,v=k(m),y=u||(v===m||!d?[nt(m)]:function(t){if("auto"===k(t))return[];var e=nt(t);return[it(t),e,it(e)]}(m)),b=[m].concat(y).reduce((function(t,n){return t.concat("auto"===k(n)?dt(e,{placement:n,boundary:l,rootBoundary:h,padding:c,flipVariations:d,allowedAutoPlacements:g}):n)}),[]),F=e.rects.reference,A=e.rects.popper,C=new Map,D=!0,$=b[0],I=0;I<b.length;I++){var R=b[I],T=k(R),_="start"===J(R),P=[x,w].indexOf(T)>=0,O=P?"width":"height",j=pt(e,{placement:R,boundary:l,rootBoundary:h,altBoundary:f,padding:c}),B=P?_?S:E:_?w:x;F[O]>A[O]&&(B=nt(B));var N=nt(B),L=[];if(s&&L.push(j[T]<=0),a&&L.push(j[B]<=0,j[N]<=0),L.every((function(t){return t}))){$=R,D=!1;break}C.set(R,L)}if(D)for(var H=function(t){var e=b.find((function(e){var n=C.get(e);if(n)return n.slice(0,t).every((function(t){return t}))}));if(e)return $=e,"break"},M=d?3:1;M>0;M--){if("break"===H(M))break}e.placement!==$&&(e.modifiersData[r]._skip=!0,e.placement=$,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,s=void 0===i||i,o=n.altAxis,a=void 0!==o&&o,u=n.boundary,c=n.rootBoundary,l=n.altBoundary,h=n.padding,f=n.tether,p=void 0===f||f,d=n.tetherOffset,g=void 0===d?0:d,m=pt(e,{boundary:u,rootBoundary:c,padding:h,altBoundary:l}),v=k(e.placement),y=J(e.placement),b=!y,F=G(v),A="x"===F?"y":"x",C=e.modifiersData.popperOffsets,D=e.rects.reference,$=e.rects.popper,I="function"==typeof g?g(Object.assign({},e.rects,{placement:e.placement})):g,R="number"==typeof I?{mainAxis:I,altAxis:I}:Object.assign({mainAxis:0,altAxis:0},I),T=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,_={x:0,y:0};if(C){if(s){var P,B="y"===F?x:E,N="y"===F?w:S,H="y"===F?"height":"width",M=C[F],U=M+m[B],V=M-m[N],q=p?-$[H]/2:0,K="start"===y?D[H]:$[H],Y="start"===y?-$[H]:-D[H],X=e.elements.arrow,Z=p&&X?L(X):{width:0,height:0},Q=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},tt=Q[B],et=Q[N],nt=W(0,D[H],Z[H]),rt=b?D[H]/2-q-nt-tt-R.mainAxis:K-nt-tt-R.mainAxis,it=b?-D[H]/2+q+nt+et+R.mainAxis:Y+nt+et+R.mainAxis,st=e.elements.arrow&&z(e.elements.arrow),ot=st?"y"===F?st.clientTop||0:st.clientLeft||0:0,at=null!=(P=null==T?void 0:T[F])?P:0,ut=M+it-at,ct=W(p?j(U,M+rt-at-ot):U,M,p?O(V,ut):V);C[F]=ct,_[F]=ct-M}if(a){var lt,ht="x"===F?x:E,ft="x"===F?w:S,dt=C[A],gt="y"===A?"height":"width",mt=dt+m[ht],vt=dt-m[ft],yt=-1!==[x,E].indexOf(v),bt=null!=(lt=null==T?void 0:T[A])?lt:0,xt=yt?mt:dt-D[gt]-$[gt]-bt+R.altAxis,wt=yt?dt+D[gt]+$[gt]-bt-R.altAxis:vt,St=p&&yt?function(t,e,n){var r=W(t,e,n);return r>n?n:r}(xt,dt,wt):W(p?xt:mt,dt,p?wt:vt);C[A]=St,_[A]=St-dt}e.modifiersData[r]=_}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,r=t.name,i=t.options,s=n.elements.arrow,o=n.modifiersData.popperOffsets,a=k(n.placement),u=G(a),c=[E,S].indexOf(a)>=0?"height":"width";if(s&&o){var l=function(t,e){return Y("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:X(t,F))}(i.padding,n),h=L(s),f="y"===u?x:E,p="y"===u?w:S,d=n.rects.reference[c]+n.rects.reference[u]-o[u]-n.rects.popper[c],g=o[u]-n.rects.reference[u],m=z(s),v=m?"y"===u?m.clientHeight||0:m.clientWidth||0:0,y=d/2-g/2,b=l[f],A=v-h[c]-l[p],C=v/2-h[c]/2+y,D=W(b,C,A),$=u;n.modifiersData[r]=((e={})[$]=D,e.centerOffset=D-C,e)}},effect:function(t){var e=t.state,n=t.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=e.elements.popper.querySelector(r)))&&H(e.elements.popper,r)&&(e.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,o=pt(e,{elementContext:"reference"}),a=pt(e,{altBoundary:!0}),u=gt(o,r),c=gt(a,i,s),l=mt(u),h=mt(c);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:h},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":h})}}]});function Et(){return(Et=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function Ft(t){return{name:"focusAfterRender",enabled:!0,phase:"afterWrite",fn(){setTimeout(()=>{if(t.el){const e={preventScroll:!0};t.el.focus(e)}},300)}}}function At(t){const e=[{name:"applyStyles",fn(t){let{state:e}=t;Object.keys(e.elements).forEach(t=>{if("popper"!==t)return;const n=e.attributes[t]||{},r=e.elements[t];Object.assign(r.style,{position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}),Object.keys(n).forEach(t=>{const e=n[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)})})}},{name:"computeStyles",options:{adaptive:!1}}];let n={placement:"top",strategy:"fixed",modifiers:[Ft(t)]};return n=Et({},n,{modifiers:Array.from(new Set([...n.modifiers,...e]))}),n}function Ct(t){return g(t)&&""!==t?"-"!==t.charAt(t.length-1)?t+"-":t:""}function Dt(t){return null==t||(!t.element||!t.on)}function $t(t){t.tooltip&&t.tooltip.destroy();const e=t._getResolvedAttachToOptions();let n=e.element;const r=function(t,e){let n={modifiers:[{name:"preventOverflow",options:{altAxis:!0,tether:!1}},Ft(e)],strategy:"absolute"};Dt(t)?n=At(e):n.placement=t.on;const r=e.tour&&e.tour.options&&e.tour.options.defaultStepOptions;r&&(n=Rt(r,n));return n=Rt(e.options,n),n}(e,t);if(Dt(e)){n=document.body;t.shepherdElementComponent.getElement().classList.add("shepherd-centered")}return t.tooltip=St(n,t.el,r),t.target=e.element,r}function It(){let t=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)})}function Rt(t,e){if(t.popperOptions){let n=Object.assign({},e,t.popperOptions);if(t.popperOptions.modifiers&&t.popperOptions.modifiers.length>0){const r=t.popperOptions.modifiers.map(t=>t.name),i=e.modifiers.filter(t=>!r.includes(t.name));n.modifiers=Array.from(new Set([...i,...t.popperOptions.modifiers]))}return n}return e}function Tt(){}function _t(t,e){for(const n in e)t[n]=e[n];return t}function Pt(t){return t()}function kt(){return Object.create(null)}function Ot(t){t.forEach(Pt)}function jt(t){return"function"==typeof t}function Bt(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function Nt(t,e){t.appendChild(e)}function Lt(t,e,n){t.insertBefore(e,n||null)}function Ht(t){t.parentNode.removeChild(t)}function Mt(t){return document.createElement(t)}function Ut(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function Vt(t){return document.createTextNode(t)}function qt(){return Vt(" ")}function Kt(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function zt(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function Gt(t,e){const n=Object.getOwnPropertyDescriptors(t.__proto__);for(const r in e)null==e[r]?t.removeAttribute(r):"style"===r?t.style.cssText=e[r]:"__value"===r?t.value=t[r]=e[r]:n[r]&&n[r].set?t[r]=e[r]:zt(t,r,e[r])}function Wt(t,e,n){t.classList[n?"add":"remove"](e)}let Yt;function Xt(t){Yt=t}function Jt(){if(!Yt)throw new Error("Function called outside component initialization");return Yt}function Zt(t){Jt().$$.after_update.push(t)}const Qt=[],te=[],ee=[],ne=[],re=Promise.resolve();let ie=!1;function se(t){ee.push(t)}const oe=new Set;let ae=0;function ue(){const t=Yt;do{for(;ae<Qt.length;){const t=Qt[ae];ae++,Xt(t),ce(t.$$)}for(Xt(null),Qt.length=0,ae=0;te.length;)te.pop()();for(let t=0;t<ee.length;t+=1){const e=ee[t];oe.has(e)||(oe.add(e),e())}ee.length=0}while(Qt.length);for(;ne.length;)ne.pop()();ie=!1,oe.clear(),Xt(t)}function ce(t){if(null!==t.fragment){t.update(),Ot(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(se)}}const le=new Set;let he;function fe(){he={r:0,c:[],p:he}}function pe(){he.r||Ot(he.c),he=he.p}function de(t,e){t&&t.i&&(le.delete(t),t.i(e))}function ge(t,e,n,r){if(t&&t.o){if(le.has(t))return;le.add(t),he.c.push(()=>{le.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}else r&&r()}function me(t){t&&t.c()}function ve(t,e,n,r){const{fragment:i,on_mount:s,on_destroy:o,after_update:a}=t.$$;i&&i.m(e,n),r||se(()=>{const e=s.map(Pt).filter(jt);o?o.push(...e):Ot(e),t.$$.on_mount=[]}),a.forEach(se)}function ye(t,e){const n=t.$$;null!==n.fragment&&(Ot(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function be(t,e){-1===t.$$.dirty[0]&&(Qt.push(t),ie||(ie=!0,re.then(ue)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function xe(t,e,n,r,i,s,o,a){void 0===a&&(a=[-1]);const u=Yt;Xt(t);const c=t.$$={fragment:null,ctx:null,props:s,update:Tt,not_equal:i,bound:kt(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(u?u.$$.context:[])),callbacks:kt(),dirty:a,skip_bound:!1,root:e.target||u.$$.root};o&&o(c.root);let l=!1;if(c.ctx=n?n(t,e.props||{},(function(e,n){const r=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:n;return c.ctx&&i(c.ctx[e],c.ctx[e]=r)&&(!c.skip_bound&&c.bound[e]&&c.bound[e](r),l&&be(t,e)),n})):[],c.update(),l=!0,Ot(c.before_update),c.fragment=!!r&&r(c.ctx),e.target){if(e.hydrate){const t=(h=e.target,Array.from(h.childNodes));c.fragment&&c.fragment.l(t),t.forEach(Ht)}else c.fragment&&c.fragment.c();e.intro&&de(t.$$.fragment),ve(t,e.target,e.anchor,e.customElement),ue()}var h;Xt(u)}class we{$destroy(){ye(this,1),this.$destroy=Tt}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function Se(t){let e,n,r,i,s;return{c(){e=Mt("button"),zt(e,"aria-label",n=t[3]?t[3]:null),zt(e,"class",r=`${t[1]||""} shepherd-button ${t[4]?"shepherd-button-secondary":""}`),e.disabled=t[2],zt(e,"tabindex","0")},m(n,r){Lt(n,e,r),e.innerHTML=t[5],i||(s=Kt(e,"click",(function(){jt(t[0])&&t[0].apply(this,arguments)})),i=!0)},p(i,s){let[o]=s;t=i,32&o&&(e.innerHTML=t[5]),8&o&&n!==(n=t[3]?t[3]:null)&&zt(e,"aria-label",n),18&o&&r!==(r=`${t[1]||""} shepherd-button ${t[4]?"shepherd-button-secondary":""}`)&&zt(e,"class",r),4&o&&(e.disabled=t[2])},i:Tt,o:Tt,d(t){t&&Ht(e),i=!1,s()}}}function Ee(t,e,n){let r,i,s,o,a,u,{config:c,step:l}=e;function h(t){return d(t)?t.call(l):t}return t.$$set=t=>{"config"in t&&n(6,c=t.config),"step"in t&&n(7,l=t.step)},t.$$.update=()=>{192&t.$$.dirty&&(n(0,r=c.action?c.action.bind(l.tour):null),n(1,i=c.classes),n(2,s=!!c.disabled&&h(c.disabled)),n(3,o=c.label?h(c.label):null),n(4,a=c.secondary),n(5,u=c.text?h(c.text):null))},[r,i,s,o,a,u,c,l]}class Fe extends we{constructor(t){super(),xe(this,t,Ee,Se,Bt,{config:6,step:7})}}function Ae(t,e,n){const r=t.slice();return r[2]=e[n],r}function Ce(t){let e,n,r=t[1],i=[];for(let e=0;e<r.length;e+=1)i[e]=De(Ae(t,r,e));const s=t=>ge(i[t],1,1,()=>{i[t]=null});return{c(){for(let t=0;t<i.length;t+=1)i[t].c();e=Vt("")},m(t,r){for(let e=0;e<i.length;e+=1)i[e].m(t,r);Lt(t,e,r),n=!0},p(t,n){if(3&n){let o;for(r=t[1],o=0;o<r.length;o+=1){const s=Ae(t,r,o);i[o]?(i[o].p(s,n),de(i[o],1)):(i[o]=De(s),i[o].c(),de(i[o],1),i[o].m(e.parentNode,e))}for(fe(),o=r.length;o<i.length;o+=1)s(o);pe()}},i(t){if(!n){for(let t=0;t<r.length;t+=1)de(i[t]);n=!0}},o(t){i=i.filter(Boolean);for(let t=0;t<i.length;t+=1)ge(i[t]);n=!1},d(t){!function(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}(i,t),t&&Ht(e)}}}function De(t){let e,n;return e=new Fe({props:{config:t[2],step:t[0]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};2&n&&(r.config=t[2]),1&n&&(r.step=t[0]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function $e(t){let e,n,r=t[1]&&Ce(t);return{c(){e=Mt("footer"),r&&r.c(),zt(e,"class","shepherd-footer")},m(t,i){Lt(t,e,i),r&&r.m(e,null),n=!0},p(t,n){let[i]=n;t[1]?r?(r.p(t,i),2&i&&de(r,1)):(r=Ce(t),r.c(),de(r,1),r.m(e,null)):r&&(fe(),ge(r,1,1,()=>{r=null}),pe())},i(t){n||(de(r),n=!0)},o(t){ge(r),n=!1},d(t){t&&Ht(e),r&&r.d()}}}function Ie(t,e,n){let r,{step:i}=e;return t.$$set=t=>{"step"in t&&n(0,i=t.step)},t.$$.update=()=>{1&t.$$.dirty&&n(1,r=i.options.buttons)},[i,r]}class Re extends we{constructor(t){super(),xe(this,t,Ie,$e,Bt,{step:0})}}function Te(t){let e,n,r,i,s;return{c(){e=Mt("button"),n=Mt("span"),n.textContent="×",zt(n,"aria-hidden","true"),zt(e,"aria-label",r=t[0].label?t[0].label:"Close Tour"),zt(e,"class","shepherd-cancel-icon"),zt(e,"type","button")},m(r,o){Lt(r,e,o),Nt(e,n),i||(s=Kt(e,"click",t[1]),i=!0)},p(t,n){let[i]=n;1&i&&r!==(r=t[0].label?t[0].label:"Close Tour")&&zt(e,"aria-label",r)},i:Tt,o:Tt,d(t){t&&Ht(e),i=!1,s()}}}function _e(t,e,n){let{cancelIcon:r,step:i}=e;return t.$$set=t=>{"cancelIcon"in t&&n(0,r=t.cancelIcon),"step"in t&&n(2,i=t.step)},[r,t=>{t.preventDefault(),i.cancel()},i]}class Pe extends we{constructor(t){super(),xe(this,t,_e,Te,Bt,{cancelIcon:0,step:2})}}function ke(t){let e;return{c(){e=Mt("h3"),zt(e,"id",t[1]),zt(e,"class","shepherd-title")},m(n,r){Lt(n,e,r),t[3](e)},p(t,n){let[r]=n;2&r&&zt(e,"id",t[1])},i:Tt,o:Tt,d(n){n&&Ht(e),t[3](null)}}}function Oe(t,e,n){let{labelId:r,element:i,title:s}=e;return Zt(()=>{d(s)&&n(2,s=s()),n(0,i.innerHTML=s,i)}),t.$$set=t=>{"labelId"in t&&n(1,r=t.labelId),"element"in t&&n(0,i=t.element),"title"in t&&n(2,s=t.title)},[i,r,s,function(t){te[t?"unshift":"push"](()=>{i=t,n(0,i)})}]}class je extends we{constructor(t){super(),xe(this,t,Oe,ke,Bt,{labelId:1,element:0,title:2})}}function Be(t){let e,n;return e=new je({props:{labelId:t[0],title:t[2]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};1&n&&(r.labelId=t[0]),4&n&&(r.title=t[2]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function Ne(t){let e,n;return e=new Pe({props:{cancelIcon:t[3],step:t[1]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};8&n&&(r.cancelIcon=t[3]),2&n&&(r.step=t[1]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function Le(t){let e,n,r,i=t[2]&&Be(t),s=t[3]&&t[3].enabled&&Ne(t);return{c(){e=Mt("header"),i&&i.c(),n=qt(),s&&s.c(),zt(e,"class","shepherd-header")},m(t,o){Lt(t,e,o),i&&i.m(e,null),Nt(e,n),s&&s.m(e,null),r=!0},p(t,r){let[o]=r;t[2]?i?(i.p(t,o),4&o&&de(i,1)):(i=Be(t),i.c(),de(i,1),i.m(e,n)):i&&(fe(),ge(i,1,1,()=>{i=null}),pe()),t[3]&&t[3].enabled?s?(s.p(t,o),8&o&&de(s,1)):(s=Ne(t),s.c(),de(s,1),s.m(e,null)):s&&(fe(),ge(s,1,1,()=>{s=null}),pe())},i(t){r||(de(i),de(s),r=!0)},o(t){ge(i),ge(s),r=!1},d(t){t&&Ht(e),i&&i.d(),s&&s.d()}}}function He(t,e,n){let r,i,{labelId:s,step:o}=e;return t.$$set=t=>{"labelId"in t&&n(0,s=t.labelId),"step"in t&&n(1,o=t.step)},t.$$.update=()=>{2&t.$$.dirty&&(n(2,r=o.options.title),n(3,i=o.options.cancelIcon))},[s,o,r,i]}class Me extends we{constructor(t){super(),xe(this,t,He,Le,Bt,{labelId:0,step:1})}}function Ue(t){let e;return{c(){e=Mt("div"),zt(e,"class","shepherd-text"),zt(e,"id",t[1])},m(n,r){Lt(n,e,r),t[3](e)},p(t,n){let[r]=n;2&r&&zt(e,"id",t[1])},i:Tt,o:Tt,d(n){n&&Ht(e),t[3](null)}}}function Ve(t,e,n){let{descriptionId:r,element:i,step:s}=e;return Zt(()=>{let{text:t}=s.options;d(t)&&(t=t.call(s)),p(t)?i.appendChild(t):n(0,i.innerHTML=t,i)}),t.$$set=t=>{"descriptionId"in t&&n(1,r=t.descriptionId),"element"in t&&n(0,i=t.element),"step"in t&&n(2,s=t.step)},[i,r,s,function(t){te[t?"unshift":"push"](()=>{i=t,n(0,i)})}]}class qe extends we{constructor(t){super(),xe(this,t,Ve,Ue,Bt,{descriptionId:1,element:0,step:2})}}function Ke(t){let e,n;return e=new Me({props:{labelId:t[1],step:t[2]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};2&n&&(r.labelId=t[1]),4&n&&(r.step=t[2]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function ze(t){let e,n;return e=new qe({props:{descriptionId:t[0],step:t[2]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};1&n&&(r.descriptionId=t[0]),4&n&&(r.step=t[2]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function Ge(t){let e,n;return e=new Re({props:{step:t[2]}}),{c(){me(e.$$.fragment)},m(t,r){ve(e,t,r),n=!0},p(t,n){const r={};4&n&&(r.step=t[2]),e.$set(r)},i(t){n||(de(e.$$.fragment,t),n=!0)},o(t){ge(e.$$.fragment,t),n=!1},d(t){ye(e,t)}}}function We(t){let e,n,r,i,s=!m(t[2].options.title)||t[2].options.cancelIcon&&t[2].options.cancelIcon.enabled,o=!m(t[2].options.text),a=Array.isArray(t[2].options.buttons)&&t[2].options.buttons.length,u=s&&Ke(t),c=o&&ze(t),l=a&&Ge(t);return{c(){e=Mt("div"),u&&u.c(),n=qt(),c&&c.c(),r=qt(),l&&l.c(),zt(e,"class","shepherd-content")},m(t,s){Lt(t,e,s),u&&u.m(e,null),Nt(e,n),c&&c.m(e,null),Nt(e,r),l&&l.m(e,null),i=!0},p(t,i){let[h]=i;4&h&&(s=!m(t[2].options.title)||t[2].options.cancelIcon&&t[2].options.cancelIcon.enabled),s?u?(u.p(t,h),4&h&&de(u,1)):(u=Ke(t),u.c(),de(u,1),u.m(e,n)):u&&(fe(),ge(u,1,1,()=>{u=null}),pe()),4&h&&(o=!m(t[2].options.text)),o?c?(c.p(t,h),4&h&&de(c,1)):(c=ze(t),c.c(),de(c,1),c.m(e,r)):c&&(fe(),ge(c,1,1,()=>{c=null}),pe()),4&h&&(a=Array.isArray(t[2].options.buttons)&&t[2].options.buttons.length),a?l?(l.p(t,h),4&h&&de(l,1)):(l=Ge(t),l.c(),de(l,1),l.m(e,null)):l&&(fe(),ge(l,1,1,()=>{l=null}),pe())},i(t){i||(de(u),de(c),de(l),i=!0)},o(t){ge(u),ge(c),ge(l),i=!1},d(t){t&&Ht(e),u&&u.d(),c&&c.d(),l&&l.d()}}}function Ye(t,e,n){let{descriptionId:r,labelId:i,step:s}=e;return t.$$set=t=>{"descriptionId"in t&&n(0,r=t.descriptionId),"labelId"in t&&n(1,i=t.labelId),"step"in t&&n(2,s=t.step)},[r,i,s]}class Xe extends we{constructor(t){super(),xe(this,t,Ye,We,Bt,{descriptionId:0,labelId:1,step:2})}}function Je(t){let e;return{c(){e=Mt("div"),zt(e,"class","shepherd-arrow"),zt(e,"data-popper-arrow","")},m(t,n){Lt(t,e,n)},d(t){t&&Ht(e)}}}function Ze(t){let e,n,r,i,s,o,a,u,c=t[4].options.arrow&&t[4].options.attachTo&&t[4].options.attachTo.element&&t[4].options.attachTo.on&&Je();r=new Xe({props:{descriptionId:t[2],labelId:t[3],step:t[4]}});let l=[{"aria-describedby":i=m(t[4].options.text)?null:t[2]},{"aria-labelledby":s=t[4].options.title?t[3]:null},t[1],{role:"dialog"},{tabindex:"0"}],h={};for(let t=0;t<l.length;t+=1)h=_t(h,l[t]);return{c(){e=Mt("div"),c&&c.c(),n=qt(),me(r.$$.fragment),Gt(e,h),Wt(e,"shepherd-has-cancel-icon",t[5]),Wt(e,"shepherd-has-title",t[6]),Wt(e,"shepherd-element",!0)},m(i,s){Lt(i,e,s),c&&c.m(e,null),Nt(e,n),ve(r,e,null),t[13](e),o=!0,a||(u=Kt(e,"keydown",t[7]),a=!0)},p(t,a){let[u]=a;t[4].options.arrow&&t[4].options.attachTo&&t[4].options.attachTo.element&&t[4].options.attachTo.on?c||(c=Je(),c.c(),c.m(e,n)):c&&(c.d(1),c=null);const f={};4&u&&(f.descriptionId=t[2]),8&u&&(f.labelId=t[3]),16&u&&(f.step=t[4]),r.$set(f),Gt(e,h=function(t,e){const n={},r={},i={$$scope:1};let s=t.length;for(;s--;){const o=t[s],a=e[s];if(a){for(const t in o)t in a||(r[t]=1);for(const t in a)i[t]||(n[t]=a[t],i[t]=1);t[s]=a}else for(const t in o)i[t]=1}for(const t in r)t in n||(n[t]=void 0);return n}(l,[(!o||20&u&&i!==(i=m(t[4].options.text)?null:t[2]))&&{"aria-describedby":i},(!o||24&u&&s!==(s=t[4].options.title?t[3]:null))&&{"aria-labelledby":s},2&u&&t[1],{role:"dialog"},{tabindex:"0"}])),Wt(e,"shepherd-has-cancel-icon",t[5]),Wt(e,"shepherd-has-title",t[6]),Wt(e,"shepherd-element",!0)},i(t){o||(de(r.$$.fragment,t),o=!0)},o(t){ge(r.$$.fragment,t),o=!1},d(n){n&&Ht(e),c&&c.d(),ye(r),t[13](null),a=!1,u()}}}function Qe(t){return t.split(" ").filter(t=>!!t.length)}function tn(t,e,n){let r,i,s,{classPrefix:o,element:a,descriptionId:u,firstFocusableElement:c,focusableElements:l,labelId:h,lastFocusableElement:f,step:p,dataStepId:d}=e;var m;m=()=>{n(1,d={[`data-${o}shepherd-step-id`]:p.id}),n(9,l=a.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]')),n(8,c=l[0]),n(10,f=l[l.length-1])},Jt().$$.on_mount.push(m),Zt(()=>{s!==p.options.classes&&(function(t){if(g(t)){const e=Qe(t);e.length&&a.classList.remove(...e)}}(s),s=p.options.classes,function(t){if(g(t)){const e=Qe(t);e.length&&a.classList.add(...e)}}(s))});return t.$$set=t=>{"classPrefix"in t&&n(11,o=t.classPrefix),"element"in t&&n(0,a=t.element),"descriptionId"in t&&n(2,u=t.descriptionId),"firstFocusableElement"in t&&n(8,c=t.firstFocusableElement),"focusableElements"in t&&n(9,l=t.focusableElements),"labelId"in t&&n(3,h=t.labelId),"lastFocusableElement"in t&&n(10,f=t.lastFocusableElement),"step"in t&&n(4,p=t.step),"dataStepId"in t&&n(1,d=t.dataStepId)},t.$$.update=()=>{16&t.$$.dirty&&(n(5,r=p.options&&p.options.cancelIcon&&p.options.cancelIcon.enabled),n(6,i=p.options&&p.options.title))},[a,d,u,h,p,r,i,t=>{const{tour:e}=p;switch(t.keyCode){case 9:if(0===l.length){t.preventDefault();break}t.shiftKey?(document.activeElement===c||document.activeElement.classList.contains("shepherd-element"))&&(t.preventDefault(),f.focus()):document.activeElement===f&&(t.preventDefault(),c.focus());break;case 27:e.options.exitOnEsc&&p.cancel();break;case 37:e.options.keyboardNavigation&&e.back();break;case 39:e.options.keyboardNavigation&&e.next()}},c,l,f,o,()=>a,function(t){te[t?"unshift":"push"](()=>{a=t,n(0,a)})}]}class en extends we{constructor(t){super(),xe(this,t,tn,Ze,Bt,{classPrefix:11,element:0,descriptionId:2,firstFocusableElement:8,focusableElements:9,labelId:3,lastFocusableElement:10,step:4,dataStepId:1,getElement:12})}get getElement(){return this.$$.ctx[12]}}var nn=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){t.exports={polyfill:function(){var t=window,e=document;if(!("scrollBehavior"in e.documentElement.style)||!0===t.__forceSmoothScrollPolyfill__){var n,r=t.HTMLElement||t.Element,i={scroll:t.scroll||t.scrollTo,scrollBy:t.scrollBy,elementScroll:r.prototype.scroll||a,scrollIntoView:r.prototype.scrollIntoView},s=t.performance&&t.performance.now?t.performance.now.bind(t.performance):Date.now,o=(n=t.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);t.scroll=t.scrollTo=function(){void 0!==arguments[0]&&(!0!==u(arguments[0])?d.call(t,e.body,void 0!==arguments[0].left?~~arguments[0].left:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:t.scrollY||t.pageYOffset):i.scroll.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:t.scrollX||t.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:t.scrollY||t.pageYOffset))},t.scrollBy=function(){void 0!==arguments[0]&&(u(arguments[0])?i.scrollBy.call(t,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):d.call(t,e.body,~~arguments[0].left+(t.scrollX||t.pageXOffset),~~arguments[0].top+(t.scrollY||t.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==u(arguments[0])){var t=arguments[0].left,e=arguments[0].top;d.call(this,this,void 0===t?this.scrollLeft:~~t,void 0===e?this.scrollTop:~~e)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==u(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==u(arguments[0])){var n=f(this),r=n.getBoundingClientRect(),s=this.getBoundingClientRect();n!==e.body?(d.call(this,n,n.scrollLeft+s.left-r.left,n.scrollTop+s.top-r.top),"fixed"!==t.getComputedStyle(n).position&&t.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):t.scrollBy({left:s.left,top:s.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function a(t,e){this.scrollLeft=t,this.scrollTop=e}function u(t){if(null===t||"object"!=typeof t||void 0===t.behavior||"auto"===t.behavior||"instant"===t.behavior)return!0;if("object"==typeof t&&"smooth"===t.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+t.behavior+" is not a valid value for enumeration ScrollBehavior.")}function c(t,e){return"Y"===e?t.clientHeight+o<t.scrollHeight:"X"===e?t.clientWidth+o<t.scrollWidth:void 0}function l(e,n){var r=t.getComputedStyle(e,null)["overflow"+n];return"auto"===r||"scroll"===r}function h(t){var e=c(t,"Y")&&l(t,"Y"),n=c(t,"X")&&l(t,"X");return e||n}function f(t){for(;t!==e.body&&!1===h(t);)t=t.parentNode||t.host;return t}function p(e){var n,r,i,o,a=(s()-e.startTime)/468;o=a=a>1?1:a,n=.5*(1-Math.cos(Math.PI*o)),r=e.startX+(e.x-e.startX)*n,i=e.startY+(e.y-e.startY)*n,e.method.call(e.scrollable,r,i),r===e.x&&i===e.y||t.requestAnimationFrame(p.bind(t,e))}function d(n,r,o){var u,c,l,h,f=s();n===e.body?(u=t,c=t.scrollX||t.pageXOffset,l=t.scrollY||t.pageYOffset,h=i.scroll):(u=n,c=n.scrollLeft,l=n.scrollTop,h=a),p({scrollable:u,method:h,startTime:f,startX:c,startY:l,x:r,y:o})}}}}));nn.polyfill,nn.polyfill();class rn extends v{constructor(t,e){return void 0===e&&(e={}),super(t,e),this.tour=t,this.classPrefix=this.tour.options?Ct(this.tour.options.classPrefix):"",this.styles=t.styles,this._resolvedAttachTo=null,y(this),this._setOptions(e),this}cancel(){this.tour.cancel(),this.trigger("cancel")}complete(){this.tour.complete(),this.trigger("complete")}destroy(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null),p(this.el)&&this.el.parentNode&&(this.el.parentNode.removeChild(this.el),this.el=null),this._updateStepTargetOnHide(),this.trigger("destroy")}getTour(){return this.tour}hide(){this.tour.modal.hide(),this.trigger("before-hide"),this.el&&(this.el.hidden=!0),this._updateStepTargetOnHide(),this.trigger("hide")}_resolveAttachToOptions(){return this._resolvedAttachTo=function(t){const e=t.options.attachTo||{},n=Object.assign({},e);if(d(n.element)&&(n.element=n.element.call(t)),g(n.element)){try{n.element=document.querySelector(n.element)}catch(t){}n.element||console.error("The element for this Shepherd step was not found "+e.element)}return n}(this),this._resolvedAttachTo}_getResolvedAttachToOptions(){return null===this._resolvedAttachTo?this._resolveAttachToOptions():this._resolvedAttachTo}isOpen(){return Boolean(this.el&&!this.el.hidden)}show(){if(d(this.options.beforeShowPromise)){const t=this.options.beforeShowPromise();if(!m(t))return t.then(()=>this._show())}this._show()}updateStepOptions(t){Object.assign(this.options,t),this.shepherdElementComponent&&this.shepherdElementComponent.$set({step:this})}getElement(){return this.el}getTarget(){return this.target}_createTooltipContent(){const t=this.id+"-description",e=this.id+"-label";return this.shepherdElementComponent=new en({target:this.tour.options.stepsContainer||document.body,props:{classPrefix:this.classPrefix,descriptionId:t,labelId:e,step:this,styles:this.styles}}),this.shepherdElementComponent.getElement()}_scrollTo(t){const{element:e}=this._getResolvedAttachToOptions();d(this.options.scrollToHandler)?this.options.scrollToHandler(e):e instanceof Element&&"function"==typeof e.scrollIntoView&&e.scrollIntoView(t)}_getClassOptions(t){const e=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions,n=t.classes?t.classes:"",r=e&&e.classes?e.classes:"",i=[...n.split(" "),...r.split(" ")],s=new Set(i);return Array.from(s).join(" ").trim()}_setOptions(t){void 0===t&&(t={});let e=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions;e=f({},e||{}),this.options=Object.assign({arrow:!0},e,t);const{when:n}=this.options;this.options.classes=this._getClassOptions(t),this.destroy(),this.id=this.options.id||"step-"+It(),n&&Object.keys(n).forEach(t=>{this.on(t,n[t],this)})}_setupElements(){m(this.el)||this.destroy(),this.el=this._createTooltipContent(),this.options.advanceOn&&b(this),$t(this)}_show(){this.trigger("before-show"),this._resolveAttachToOptions(),this._setupElements(),this.tour.modal||this.tour._setupModal(),this.tour.modal.setupForStep(this),this._styleTargetElementForStep(this),this.el.hidden=!1,this.options.scrollTo&&setTimeout(()=>{this._scrollTo(this.options.scrollTo)}),this.el.hidden=!1;const t=this.shepherdElementComponent.getElement(),e=this.target||document.body;e.classList.add(this.classPrefix+"shepherd-enabled"),e.classList.add(this.classPrefix+"shepherd-target"),t.classList.add("shepherd-enabled"),this.trigger("show")}_styleTargetElementForStep(t){const e=t.target;e&&(t.options.highlightClass&&e.classList.add(t.options.highlightClass),e.classList.remove("shepherd-target-click-disabled"),!1===t.options.canClickTarget&&e.classList.add("shepherd-target-click-disabled"))}_updateStepTargetOnHide(){const t=this.target||document.body;this.options.highlightClass&&t.classList.remove(this.options.highlightClass),t.classList.remove("shepherd-target-click-disabled",this.classPrefix+"shepherd-enabled",this.classPrefix+"shepherd-target")}}function sn(t){let e,n,r,i,s;return{c(){e=Ut("svg"),n=Ut("path"),zt(n,"d",t[2]),zt(e,"class",r=(t[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")},m(r,o){Lt(r,e,o),Nt(e,n),t[11](e),i||(s=Kt(e,"touchmove",t[3]),i=!0)},p(t,i){let[s]=i;4&s&&zt(n,"d",t[2]),2&s&&r!==(r=(t[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")&&zt(e,"class",r)},i:Tt,o:Tt,d(n){n&&Ht(e),t[11](null),i=!1,s()}}}function on(t,e,n){let{element:r,openingProperties:i}=e;It();let s,o=!1,a=void 0;u();function u(){n(4,i={width:0,height:0,x:0,y:0,r:0})}function c(){n(1,o=!1),p()}function l(t,e,r,s){if(void 0===t&&(t=0),void 0===e&&(e=0),s){const{y:o,height:a}=function(t,e){const n=t.getBoundingClientRect();let r=n.y||n.top,i=n.bottom||r+n.height;if(e){const t=e.getBoundingClientRect(),n=t.y||t.top,s=t.bottom||n+t.height;r=Math.max(r,n),i=Math.min(i,s)}return{y:r,height:Math.max(i-r,0)}}(s,r),{x:u,width:c,left:l}=s.getBoundingClientRect();n(4,i={width:c+2*t,height:a+2*t,x:(u||l)-t,y:o-t,r:e})}else u()}function h(){n(1,o=!0)}const f=t=>{t.preventDefault()};function p(){a&&(cancelAnimationFrame(a),a=void 0),window.removeEventListener("touchmove",f,{passive:!1})}return t.$$set=t=>{"element"in t&&n(0,r=t.element),"openingProperties"in t&&n(4,i=t.openingProperties)},t.$$.update=()=>{16&t.$$.dirty&&n(2,s=function(t){let{width:e,height:n,x:r=0,y:i=0,r:s=0}=t;const{innerWidth:o,innerHeight:a}=window;return`M${o},${a}H0V0H${o}V${a}ZM${r+s},${i}a${s},${s},0,0,0-${s},${s}V${n+i-s}a${s},${s},0,0,0,${s},${s}H${e+r-s}a${s},${s},0,0,0,${s}-${s}V${i+s}a${s},${s},0,0,0-${s}-${s}Z`}(i))},[r,o,s,t=>{t.stopPropagation()},i,()=>r,u,c,l,function(t){p(),t.tour.options.useModalOverlay?(!function(t){const{modalOverlayOpeningPadding:e,modalOverlayOpeningRadius:n}=t.options,r=function t(e){if(!e)return null;const n=e instanceof HTMLElement&&window.getComputedStyle(e).overflowY;return"hidden"!==n&&"visible"!==n&&e.scrollHeight>=e.clientHeight?e:t(e.parentElement)}(t.target),i=()=>{a=void 0,l(e,n,r,t.target),a=requestAnimationFrame(i)};i(),window.addEventListener("touchmove",f,{passive:!1})}(t),h()):c()},h,function(t){te[t?"unshift":"push"](()=>{r=t,n(0,r)})}]}class an extends we{constructor(t){super(),xe(this,t,on,sn,Bt,{element:0,openingProperties:4,getElement:5,closeModalOpening:6,hide:7,positionModal:8,setupForStep:9,show:10})}get getElement(){return this.$$.ctx[5]}get closeModalOpening(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[7]}get positionModal(){return this.$$.ctx[8]}get setupForStep(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}}const un=new v;Object.assign(un,{Tour:class extends v{constructor(t){void 0===t&&(t={}),super(t),y(this);this.options=Object.assign({},{exitOnEsc:!0,keyboardNavigation:!0},t),this.classPrefix=Ct(this.options.classPrefix),this.steps=[],this.addSteps(this.options.steps);return["active","cancel","complete","inactive","show","start"].map(t=>{(t=>{this.on(t,e=>{(e=e||{}).tour=this,un.trigger(t,e)})})(t)}),this._setTourID(),this}addStep(t,e){let n=t;return n instanceof rn?n.tour=this:n=new rn(this,n),m(e)?this.steps.push(n):this.steps.splice(e,0,n),n}addSteps(t){return Array.isArray(t)&&t.forEach(t=>{this.addStep(t)}),this}back(){const t=this.steps.indexOf(this.currentStep);this.show(t-1,!1)}cancel(){if(this.options.confirmCancel){const t=this.options.confirmCancelMessage||"Are you sure you want to stop the tour?";window.confirm(t)&&this._done("cancel")}else this._done("cancel")}complete(){this._done("complete")}getById(t){return this.steps.find(e=>e.id===t)}getCurrentStep(){return this.currentStep}hide(){const t=this.getCurrentStep();if(t)return t.hide()}isActive(){return un.activeTour===this}next(){const t=this.steps.indexOf(this.currentStep);t===this.steps.length-1?this.complete():this.show(t+1,!0)}removeStep(t){const e=this.getCurrentStep();this.steps.some((e,n)=>{if(e.id===t)return e.isOpen()&&e.hide(),e.destroy(),this.steps.splice(n,1),!0}),e&&e.id===t&&(this.currentStep=void 0,this.steps.length?this.show(0):this.cancel())}show(t,e){void 0===t&&(t=0),void 0===e&&(e=!0);const n=g(t)?this.getById(t):this.steps[t];if(n){this._updateStateBeforeShow();d(n.options.showOn)&&!n.options.showOn()?this._skipStep(n,e):(this.trigger("show",{step:n,previous:this.currentStep}),this.currentStep=n,n.show())}}start(){this.trigger("start"),this.focusedElBeforeOpen=document.activeElement,this.currentStep=null,this._setupModal(),this._setupActiveTour(),this.next()}_done(t){const e=this.steps.indexOf(this.currentStep);if(Array.isArray(this.steps)&&this.steps.forEach(t=>t.destroy()),function(t){if(t){const{steps:e}=t;e.forEach(t=>{t.options&&!1===t.options.canClickTarget&&t.options.attachTo&&t.target instanceof HTMLElement&&t.target.classList.remove("shepherd-target-click-disabled")})}}(this),this.trigger(t,{index:e}),un.activeTour=null,this.trigger("inactive",{tour:this}),this.modal&&this.modal.hide(),("cancel"===t||"complete"===t)&&this.modal){const t=document.querySelector(".shepherd-modal-overlay-container");t&&t.remove()}p(this.focusedElBeforeOpen)&&this.focusedElBeforeOpen.focus()}_setupActiveTour(){this.trigger("active",{tour:this}),un.activeTour=this}_setupModal(){this.modal=new an({target:this.options.modalContainer||document.body,props:{classPrefix:this.classPrefix,styles:this.styles}})}_skipStep(t,e){const n=this.steps.indexOf(t);if(n===this.steps.length-1)this.complete();else{const t=e?n+1:n-1;this.show(t,e)}}_updateStateBeforeShow(){this.currentStep&&this.currentStep.hide(),this.isActive()||this._setupActiveTour()}_setTourID(){const t=this.options.tourName||"tour";this.id=`${t}--${It()}`}},Step:rn});const cn="shepherd.guide_id",ln="shepherd.guide.current.step.id",hn="shepherd.guide.step.history",fn="shepherd.guide.pause";function pn(t,e,n,i,s,o,a){this.guideCancelSubscription=void 0,this.onPause=()=>{},this.onCancel=()=>{},this.startGuide=(t,e,r,i=!0)=>{if(i&&n.remove(hn),!e)return;const s=this._createGuide(t);this._addGuideSteps(s,e),this._startGuide(s,r)},this.resumeGuide=(t,e,r)=>{n.set(fn,!1),this.startGuide(t,e,r,!1)},this.isActive=()=>un.activeTour&&un.activeTour.isActive()&&un.activeTour.getCurrentStep().isOpen()&&!this.isPaused(),this.isPaused=()=>"true"===n.get(fn),this.getGuideId=()=>n.get(cn),this.getCurrentStepId=()=>n.get(ln),this.subscribeToGuideCancel=t=>{angular.isFunction(t)&&(this.onCancel=t)},this.subscribeToGuidePause=t=>{angular.isFunction(t)&&(this.onPause=t)},this._createGuide=t=>(this._subscribeToGuideCanceled(),new un.Tour({name:t,useModalOverlay:!0,confirmCancel:!0,confirmCancelMessage:e.instant("guide.confirm.cancel.message"),defaultStepOptions:{classes:"shadow-md bg-purple-dark",scrollTo:!0}})),this._addGuideSteps=(t,e)=>{if(e.length>0&&t.addStep(this._getFirstStep(t,e)),e.length>2)for(let n=1;n<e.length-1;n++)t.addStep(this._getMiddleStep(t,e,n));e.length>1&&t.addStep(this._getLastStep(t,e))},this._startGuide=(s,a)=>{n.remove(fn);let u=s.steps.findIndex(t=>t.options.id===a);u<0&&(u=0);const c=s.steps[u],l=c.options.url;l&&(t.url(l),i.reload()),c.options.attachTo?r.GuideUtils.waitFor(c.options.attachTo.element,c.options.maxWaitTime).then(()=>s.show(u)).catch(()=>{o.error(e.instant("guide.start.unexpected.error.message"))}):s.show(u)},this._subscribeToGuideCanceled=()=>{this.guideCancelSubscription||(this.guideCancelSubscription=un.on("cancel",()=>{this._clearLocaleStorage(),this.onCancel&&this.onCancel()}))},this._getFirstStep=function(t,e){const n=e.length>1?e[1]:void 0;return this._toGuideStep(t,void 0,e[0],n)},this._getMiddleStep=(t,e,n)=>this._toGuideStep(t,e[n-1],e[n],e[n+1]),this._getLastStep=(t,e)=>{const n=this._toGuideStep(t,e[e.length-2],e[e.length-1]);return n.buttons.push(this._getBackToGuidesButton(t)),n.buttons.push(this._getCancelButton(t)),n},this._getBackToGuidesButton=t=>this._getButton(e.instant("back.to.guides.btn"),()=>this._backToGuidesButton(t),!0),this._getCancelButton=t=>this._getButton(e.instant("common.close"),()=>this._cancelGuide(t,!1),!0),this._backToGuidesButton=e=>{t.path("guides"),this._cancelGuide(e,!1)},this._cancelGuide=(t,e=!0)=>{t.options.confirmCancel=e,t.cancel(),this.onCancel()&&this.onCancel()},this._toGuideStep=(t,n,r,i)=>{const s=this._toBaseGuideStep(t,e,r,()=>this._updateLocalStorage()),o=[];return n&&o.push(this._getPreviousButton(t)),i&&(o.push(this._getNextButton(t,r,i)),o.push(this._getPauseButton(t))),r.skipPoint&&o.push(this._getSkipButton(t)),s.buttons=o,s},this._getPauseButton=t=>this._getButton(e.instant("pause.btn"),()=>this._pauseGuide(t),!0),this._getSkipButton=t=>this._getButton(e.instant("skip.btn"),()=>this._skipSteps(t),!0),this._skipSteps=t=>{const e=t.getCurrentStep(),n=t.steps.findIndex(t=>e.id===t.id);this._startGuide(t,this._getNextSkipPointId(t.steps,n))},this._getNextSkipPointId=(t,e)=>{for(let n=e+1;n<t.length;n++){const e=t.at(n);if(e.options.skipPoint)return e.id}return t.at(t.length-1).id},this._pauseGuide=t=>{t.hide();const e=this._getStepWhichCanBePaused(t.steps,t.getCurrentStep().id);this._saveStep(e),n.set(fn,!0);let r=!1;for(;!r;){const t=this._getHistory();t&&t.length>0&&t.at(t.length-1)!==e.options.id?this._removeLastStepFromHistory():r=!0}this.onPause()&&this.onPause()},this._getStepWhichCanBePaused=(t,e)=>{const n=t.findIndex(t=>t.id===e),r=t[n];return r.options.canBePaused?r:n>0?this._getStepWhichCanBePaused(t,t[n-1].id):void 0},this._getPreviousButton=t=>{const n=e.instant("previous.btn"),r=this._getPreviousButtonAction(t);return this._getButton(n,r)},this._getPreviousButtonAction=n=>()=>{const r=this._getPreviousStepIdFromHistory();let i;i=-1===r?n.steps.at(0):n.steps.find(t=>t.options.id===r);const s=n.getCurrentStep();angular.isFunction(s.options.onPreviousClick)?s.options.onPreviousClick(n).then(t=>{!angular.isUndefined(t)&&null!==t&&t||(s.hide(),n.show(i.id))}).catch(()=>{o.error(e.instant("guide.unexpected.error.message")),n.hide()}):((i.options.forceReload||i.options.url&&i.options.url!==s.options.url)&&t.path(i.options.url),s.hide(),n.show(i.id))},this._getNextButton=(t,n,r)=>{const i=e.instant("next.btn"),s=u(t,n,r);return this._getButton(i,s)};const u=(n,r,i)=>()=>{let s=!0;if(angular.isFunction(r.onNextValidate)&&(s=r.onNextValidate(r)),s)if(angular.isFunction(r.onNextClick)){const t=r.onNextClick(n,r);t instanceof Promise&&t.catch(()=>{o.error(e.instant("guide.unexpected.error.message")),n.cancel()})}else(i.forceReload||i.url&&i.url!==r.url)&&t.path(i.url),n.next()};this._updateLocalStorage=()=>{const t=un.activeTour;if(!t)return;const e=t.getCurrentStep(),n=t.steps.findIndex(t=>t.id===e.id),r=this.getCurrentStepId(),i=t.steps.findIndex(t=>t.id===r);n>i?this._addStepToHistory(e):i>n&&this._removeLastStepFromHistory(),this._saveStep(e)},this._saveStep=t=>{t&&(n.set(cn,t.tour.options.name),n.set(ln,t.options.id))},this._addStepToHistory=t=>{const e=this._getHistory();e.push(t.options.id),n.set(hn,e)},this._getHistory=()=>{const t=n.get(hn);return t||[]},this._removeLastStepFromHistory=()=>{const t=this._getHistory();t.splice(t.length-1,1),n.set(hn,t)},this._getPreviousStepIdFromHistory=()=>{const t=this._getHistory();return t.length>1?t.at(t.length-2):-1},this._clearLocaleStorage=()=>{n.remove(cn),n.remove(fn),n.remove(ln),n.remove(hn)},this._toBaseGuideStep=(t,e,n,i)=>{let o;n.elementSelector&&(o={element:n.elementSelector,on:n.placement});const a=r.GuideUtils.unescapeHtml(r.GuideUtils.translateLocalMessage(e,s,n.title,n));let u="";if(n.stepsTotalN>1){const t=document.createElement("span");t.setAttribute("tooltip",e.instant("guide.block.progress.tooltip",{action:a})),t.setAttribute("tooltip-placement","bottom"),t.setAttribute("tooltip-trigger","mouseenter"),t.setAttribute("tooltip-append-to-body","false"),t.innerText=e.instant("guide.block.progress",{n:n.stepN+1,nn:n.stepsTotalN}),u=" — "+t.outerHTML}const c=this._toParagraph(r.GuideUtils.translateLocalMessage(e,s,n.content,n));let l="";n.extraContent&&(l=r.GuideUtils.translateLocalMessage(e,s,n.extraContent,n),l=this._toParagraph(l,n.extraContentClass));const h="readonly"!==n.type,f=n.extraPadding?n.extraPadding:0,p={id:n.id,title:a+u,text:c+l,url:n.url,maxWaitTime:n.maxWaitTime,cancelIcon:{enabled:!0},attachTo:o,modalOverlayOpeningPadding:f,modalOverlayOpeningRadius:0,canBePaused:n.canBePaused,advanceOn:n.advanceOn,showOn:n.showOn,scrollToHandler:n.scrollToHandler,classes:"guide-dialog",beforeShowPromise:n.beforeShowPromise,canClickTarget:h,keyboardNavigation:!1,skipPoint:n.skipPoint,onPreviousClick:n.onPreviousClick,when:{show:this._getShowFunction(t,n,i)}};return angular.isFunction(n.hide)&&(p.when.hide=n.hide(t)),p},this._getShowFunction=(t,e,n)=>angular.isFunction(e.show)?()=>{e.show(t)(),n(),this._whenStepShow(e)}:()=>{n(),this._whenStepShow(e)},this._whenStepShow=t=>{const e=un.activeTour.getCurrentStep(),n=e.getElement();this._addTotalProgress(e,n),this._addTypeIcon(n,t);const r=angular.element(n).scope();angular.isFunction(t.onScope)&&t.onScope(r),setTimeout(()=>r.$apply(()=>a(n)(r)))},this._toParagraph=(t,e)=>{if(t){const n=document.createElement("p");return e&&(n.className=e),n.innerHTML=t,n.outerHTML}return""},this._addTotalProgress=(t,n)=>{const r=un.activeTour.steps,i=n.querySelector(".shepherd-content"),s=document.createElement("div");s.className="shepherd-progress";const o=document.createElement("span");o.className="text-muted",o.innerText=e.instant("guide.total.progress",{n:r.indexOf(t)+1,nn:r.length}),o.setAttribute("tooltip",e.instant("guide.total.progress.tooltip")),o.setAttribute("tooltip-placement","left"),o.setAttribute("tooltip-trigger","mouseenter"),o.setAttribute("tooltip-append-to-body","false"),s.appendChild(o),i.appendChild(s)},this._addTypeIcon=(t,n)=>{let r,i;switch(n.type){case"clickable":r="focus",i="mouse";break;case"input":r="edit",i="input";break;default:r="info",i="info"}const s=document.createElement("span");s.className="shepherd-step-type icon-"+r+" icon-1-25x",s.setAttribute("tooltip",e.instant("guide.step-type."+i)),s.setAttribute("tooltip-placement","bottom-right"),s.setAttribute("tooltip-trigger","mouseenter"),s.setAttribute("tooltip-append-to-body","false"),angular.element(t.querySelector(".shepherd-header")).prepend(s)},this._getButton=(t,e,n)=>{const r={text:t,classes:n?"btn btn-secondary":"btn btn-primary",action:t=>{t.stopPropagation(),e()}};return r}}angular.module("graphdb.framework.guides.shepherd.services",["graphdb.framework.utils.localstorageadapter"]).service("ShepherdService",pn),pn.$inject=["$location","$translate","LocalStorageAdapter","$route","$interpolate","toastr","$compile"]},function(t,e){angular.module("graphdb.framework.rest.license.service",["ngFileUpload"]).factory("LicenseRestService",r),r.$inject=["$http","Upload"];const n="rest/graphdb-settings/license";function r(t,e){return{getLicenseInfo:function(){return t.get(n)},getHardcodedLicense:function(){return t.get(n+"/hardcoded")},sendLicenseToValidate:function(e){return t.post("rest/info/license/validate",e,{headers:{Accept:"application/json","Content-Type":"text/plain"}})},extractFromLicenseFile:function(t){return e.upload({url:"rest/info/license/to-base-64",file:t,headers:{Accept:"text/plain"}})},checkLicenseHardcoded:function(){return t.get(n+"/hardcoded")},registerLicense:function(e){const r=new Uint8Array(e.length);for(let t=0;t<r.length;t++)r[t]=e.charCodeAt(t);return t({method:"POST",url:n,headers:{"Content-Type":"application/octet-stream"},data:r,transformRequest:[]})},unregisterLicense:function(){return t({method:"DELETE",url:"rest/graphdb-settings/license"})},getInfo:function(){return t.get("rest/info/properties")},getVersion:function(e){return t.get("rest/info/version",{headers:{"X-GraphDB-Repository-Location":e}})},getStatistics:function(){return t.get("rest/graphdb-settings/statistics")},toggleStatistics:function(e){return t({method:"POST",url:"rest/graphdb-settings/statistics",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:"enabled="+e})}}}},function(t,e){angular.module("graphdb.framework.rest.repositories.service",[]).factory("RepositoriesRestService",n),n.$inject=["$http"];function n(t){return{getRepositories:function(e){return t.get("rest/repositories/all",{params:{location:e}})},getRepository:function(e){return t.get("rest/repositories/"+e.id,{params:{location:e.location}})},deleteRepository:function(e){return t.delete("rest/repositories/"+e.id,{params:{location:e.location}})},createRepository:function(e){return t.post("rest/repositories",e)},editRepository:function(e,n){return t.put("rest/repositories/"+e,n)},getRepositoryConfiguration:function(e){return t.get("rest/repositories/default-config/"+e)},getSize:function(e){return t.get(`rest/repositories/${e.id}/size`,{params:{location:e.location}})},getPrefix:function(e,n){return t.post(`rest/repositories/${e}/prefix`,null,{params:n})},getCluster:function(){return t.get("rest/repositories/cluster")},getRepositoryFileContent:function(e){return t.get("rest/repositories/file",{params:{fileLocation:e}})},updateRepositoryFileContent:function(e,n,r){return t.post("rest/repositories/file/update",JSON.stringify(n),{params:{fileLocation:e,location:r}})},validateOntopPropertiesConnection:function(e){return t.post("rest/repositories/ontop/test-connection",e.params.propertiesFile,{params:{location:e.location}})},restartRepository:function(e){return t.post(`rest/repositories/${e.id}/restart`,null,{params:{location:e.location}})},getSupportedDriversData:function(e){return t.get("rest/repositories/ontop/drivers",{params:{location:e.location}})},updatePropertiesFile:function(e,n,r){return t.post("rest/repositories/ontop/jdbc-properties",JSON.stringify(n),{params:{fileLocation:e,location:r}})},loadPropertiesFile:function(e,n){return t.get("rest/repositories/ontop/jdbc-properties",{params:{fileLocation:e,location:n}})},getRepositoriesFromKnownLocation:function(e){return t.get("rest/repositories?location="+e)}}}},function(t,e,n){"use strict";n.r(e);n(4),n(9),n(27),n(8),n(34),n(35);angular.module("graphdb.framework.core.services.repositories",["ngCookies","graphdb.framework.rest.repositories.service","graphdb.framework.rest.locations.service","graphdb.framework.rest.license.service","toastr"]).service("$repositories",["$http","toastr","$rootScope","$timeout","$location","productInfo","$jwtAuth","RepositoriesRestService","LocationsRestService","LicenseRestService","$translate","$q",function(t,e,n,r,i,s,o,a,u,c,l,h){this.repositoryStorageName="com.ontotext.graphdb.repository",this.repositoryStorageLocationName="com.ontotext.graphdb.repository.location",this.location={uri:"",label:"Local",local:!0},this.locationError="",this.loading=!0,this.repository={id:localStorage.getItem(this.repositoryStorageName)||"",location:localStorage.getItem(this.repositoryStorageLocationName)||""},this.locations=[this.location],this.repositories=new Map,this.locationsShouldReload=!0;const f=this,p=function(t,n){f.loading=!1,t&&(f.location={},f.locationError=n,f.repositories=new Map,f.setRepository(""),t.statusText?e.error(t.statusText,l.instant("repositories.service.error.loading.location")):e.error(l.instant("repositories.service.error.loading.location")))};let d;this.resetActiveRepository=function(){let t=f.repositories.get(this.repository.location),e=!1;t&&(e=t.find(t=>this.repository&&t.id===this.repository.id)),e?o.canReadRepo(this.repository)?n.$broadcast("repositoryIsSet",{newRepo:!1}):this.setRepository(""):this.setRepository(this.location.defaultRepository?{id:this.location.defaultRepository,location:this.location.uri}:"")},this.checkLocationsDegraded=function(t){this.locations.forEach(e=>{e.local||(e.errorMsg&&f.repositories.delete(e.uri)&&f.resetActiveRepository(),c.getVersion(e.uri).success((function(t){"object"==typeof t?t.productVersion!==s.productVersion&&(e.degradedReason=l.instant("repositories.service.different.gdb.version",{location:e.name})):e.degradedReason=l.instant("repositories.service.different.gdb.version",{location:e.name})})).error((function(n){e.errorMsg=n,t||(f.locationsShouldReload=!0)})))})},this.getDegradedReason=function(){let t=this.locations.find(t=>t.uri===this.repository.location);return t?t.degradedReason:""},this.clearLocationErrorMsg=function(t){let e=this.locations.find(e=>e.uri===t);e&&e.errorMsg&&(e.errorMsg=null)},this.initQuick=function(){this.hasActiveLocation()&&this.init(null,null,!0)},this.init=function(t,e,r){return this.loading=!0,r||(this.locationsShouldReload=!0),u.getActiveLocation().then((function(i){if(i.data){const s=i.data;if(s.active)return a.getRepositories().then((function(e){f.location=s,Object.entries(e.data).forEach(([t,e])=>{f.clearLocationErrorMsg(t),f.repositories.set(t,e)}),f.resetActiveRepository(),p(),f.checkLocationsDegraded(r),n.globalLocation=f.location,n.globalRepositories=f.getRepositories(),t&&t()})).catch((function(t){p(t),e&&e()}))}else p(),r&&(f.locationsShouldReload=!0),f.location="",f.repositories=new Map,f.setRepository("");n.globalLocation=f.location,n.globalRepositories=f.getRepositories()})).catch((function(t){p(t),e&&e()}))},this.getLocations=function(t){if(this.locationsShouldReload||d)return d||(this.locationsShouldReload=!1,this.locations=[this.location],d=u.getLocations(t).then(t=>(f.locations=t.data,this.locations)).catch((function(){r((function(){f.locationsShouldReload=!0}),2e3)})).finally(()=>{d=null})),d;const e=h.defer();return e.resolve(this.locations),e.promise},this.getActiveLocation=function(){return this.location},this.hasActiveLocation=function(){return!_.isEmpty(this.location)},this.getLocationError=function(){return this.locationError?this.locationError:l.instant("repositories.service.no.active.location")},this.isLoadingLocation=function(){return this.loading},this.getRepositories=function(){let t=[];return this.repositories.forEach(e=>t.push.apply(t,e)),t},this.getReadableRepositories=function(){return _.filter(this.getRepositories(),(function(t){return o.canReadRepo(t)}))},this.getWritableRepositories=function(){const t=this;return _.filter(this.getRepositories(),(function(e){return o.canWriteRepo(e)&&!t.isActiveRepoOntopType(e)}))},this.getActiveRepository=function(){return this.repository.id},this.getActiveRepositoryObject=function(){const t=this;let e=t.repositories.get(t.repository.location);return e?e.find(e=>e.id===t.repository.id):null},this.isSystemRepository=function(){return"SYSTEM"===this.repository.id},this.isActiveRepoOntopType=function(t){const e=this;let n;return t||(t=e.getActiveRepositoryObject()),t&&(n=e.repositories.get(t.location).find(e=>e.id===t.id),n)?"graphdb:OntopRepository"===n.sesameType:void 0===n},this.isActiveRepoFedXType=function(){const t=this;let e,n=t.getActiveRepositoryObject();return n&&(e=t.repositories.get(n.location).find(t=>t.id===n.id),e)?"graphdb:FedXRepository"===e.sesameType:void 0===e},this.getLocationFromUri=function(t){return this.locations.find(e=>e.uri===t)},this.setRepositoryHeaders=function(){t.defaults.headers.common["X-GraphDB-Repository"]=this.repository?this.repository.id:void 0,$.ajaxSetup().headers=$.ajaxSetup().headers||{},$.ajaxSetup().headers["X-GraphDB-Repository"]=this.repository?this.repository.id:void 0,t.defaults.headers.common["X-GraphDB-Repository-Location"]=this.repository?this.repository.location:void 0,$.ajaxSetup().headers=$.ajaxSetup().headers||{},$.ajaxSetup().headers["X-GraphDB-Repository-Location"]=this.repository?this.repository.location:void 0},f.setRepositoryHeaders(),this.setRepository=function(t){this.repository=t,t?(localStorage.setItem(f.repositoryStorageName,this.repository.id),localStorage.setItem(f.repositoryStorageLocationName,this.repository.location)):(localStorage.removeItem(f.repositoryStorageName),localStorage.removeItem(f.repositoryStorageLocationName)),f.setRepositoryHeaders(),n.$broadcast("repositoryIsSet",{newRepo:!0}),t&&!o.canReadRepo(t)&&this.setRepository(""),n.deniedPermissions={}},this.getDefaultRepository=function(){return this.hasActiveLocation()?this.location.defaultRepository:""},this.setDefaultRepository=function(t){if(!this.hasActiveLocation())return void e.error(l.instant("repositories.service.no.active.location"),l.instant("common.error"));const n=this;u.setDefaultRepository(t).success((function(){n.location.defaultRepository=t})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))}))},this.deleteLocation=function(t){return u.deleteLocation(encodeURIComponent(t)).success((function(){let e=f.getActiveRepositoryObject();e&&e.location===t&&(f.location="",f.setRepository("")),f.init()})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))}))},this.deleteRepository=function(t){return a.deleteRepository(t).success((function(){f.init()})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))})).finally(()=>{const e=f.getActiveRepositoryObject();e&&e.id===t.id&&e.location===t.location&&f.setRepository("")})},this.restartRepository=function(t){return a.restartRepository(t).success((function(){e.success(l.instant("repositories.service.restarting.repo",{repositoryId:t.id})),f.initQuick()})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))}))},this.getRepositoryTurtleConfig=function(e){return t.get("rest/repositories/"+e.id,{headers:{Accept:"text/turtle"}})},this.isRepoActive=function(t){return!!this.repository&&(t.id===this.repository.id&&t.location===this.repository.location)},this.getRepositoriesFromLocation=function(t){return this.repositories.get(t)},n.$on("securityInit",(function(t,e,n,r){(!e||n||r)&&f.init()}))}])},function(t,e,n){"use strict";n.r(e);n(5);var r=n(0);function i(){return{template:function(t,e){return'<object width="'+e.size+'" height="'+e.size+'" data="js/angular/templates/loader/ot-loader.svg?v=2.1.0-RC3">{{\'common.loading\' | translate}}</object>'}}}function s(){return{template:function(t,e){return'<object width="'+e.size+'" height="'+e.size+'" data="js/angular/templates/loader/ot-loader.svg?v=2.1.0-RC3"></object><div>{{\'common.loading\' | translate}}<div>'}}}function o(t){const e=function(t,n){n.timer=void 0,n.currentMessage=n.getMessage();const r=n.timeout[n.index%n.timeout.length];r&&(n.timer=t((function(){(n.index+1<n.message.length||0===n.message.length)&&(n.index++,e(t,n))}),1e3*r))};return{restrict:"EA",scope:{size:"@",trigger:"@",messageAttr:"=*message",timeoutAttr:"=*timeout",ngShow:"=",ngHide:"="},link:function(n){n.message=n.messageAttr,n.getMessage=function(){return n.message[n.index]},void 0===n.message?n.message=[""]:"function"==typeof n.message?(n.getMessage=n.message,n.message=[]):"object"!=typeof n.message&&(n.message=[n.message]),n.timeout=n.timeoutAttr,void 0===n.timeout?n.timeout=[0]:"object"!=typeof n.timeout&&(n.timeout=[n.timeout]),n.index=0,e(t,n);const r=function(r){n.timer&&t.cancel(n.timer),r&&(n.index=0,e(t,n))};n.$watch("ngShow",(function(t){r(t)})),n.$watch("ngHide",(function(t){r(!t)})),n.$on("$destroy",(function(){n.timer&&t.cancel(n.timer)}))},template:'<div class="ot-loader-new-content"><img width="{{size}}" height="{{size}}" src="js/angular/templates/loader/ot-loader.svg?v=2.1.0-RC3"/><div style="font-size: {{size/4}}px">{{currentMessage}}<div></div>'}}function a(t){return{restrict:"EA",transclude:!0,templateUrl:"js/angular/core/templates/core-errors.html",link:function(e,n,r){let i;e.setAttrs(r),e.setRestricted(),e.showRemoteLocations=!1,e.toggleShowRemoteLocations=()=>{e.showRemoteLocations=!e.showRemoteLocations},e.getAccessibleRepositories=function(){let t=t=>!0;return e.showRemoteLocations||(t=t=>t.local),e.isRestricted?e.getWritableRepositories().filter(t):e.getReadableRepositories().filter(t)},e.showPopoverForRepo=function(n,r){e.hidePopoverForRepo(),e.setPopoverRepo(r),t((function(){const t=$(n.toElement).find(".popover-anchor")[0];i=t,t&&!e.getActiveRepository()&&t.dispatchEvent(new Event("show"))})),n.stopPropagation()},e.hidePopoverForRepo=function(e){if(e){let t=e.relatedTarget;for(;t;){if(0===t.className.indexOf("popover"))return;t=t.parentElement}}i&&t((function(){i&&(i.dispatchEvent(new Event("hide")),i=null)})),e&&e.stopPropagation()}}}}function u(){return function(t,e){$(e).click((function(t){t.preventDefault(),t.stopPropagation()}))}}function c(){return{restrict:"A",require:"ngModel",link:function(t,e,n,r){t.multiRequired||(t.multiRequired=[]);const i=n.multiRequireElement,s=function(e){i&&i%1==0&&(t.multiRequired[i-1]=e)},o=function(){let e=!1,n=!1;for(let r=0;r<t.multiRequired.length;r++)t.multiRequired[r]?e=!0:n=!0;r.$setValidity("multiRequire",!(e&&n))};r.$parsers.unshift((function(t){return s(t),o(),t})),r.$formatters.unshift((function(t){return s(t),o(),t})),$("[multi-required]").on("blur keyup change focusout",(function(){o()}))}}}angular.module("graphdb.framework.core.directives",["graphdb.framework.core.services.repositories","graphdb.framework.utils.localstorageadapter"]).directive("ontoLoader",i).directive("ontoLoaderFancy",s).directive("ontoLoaderNew",o).directive("coreErrors",a).directive("eatClick",u).directive("multiRequired",c).directive("searchResourceInput",h).directive("keyboardShortcuts",f).directive("inactivePluginDirective",p),i.$inject=[],s.$inject=[],o.$inject=["$timeout"],a.$inject=["$timeout"],u.$inject=[],c.$inject=[];const l={table:"table",visual:"visual"};function h(t,e,n,i,s,o,a,u,c,h,f,p){return{restrict:"EA",scope:{namespacespromise:"=",autocompletepromisestatus:"=",textButton:"@",visualButton:"@",textCallback:"&",visualCallback:"&",placeholder:"@",uriValidation:"@",preserveInput:"@",empty:"=",clear:"=?clear",openInNewTab:"@",preserveSearch:"@",radioButtons:"@",clearInputIcon:"@"},templateUrl:"js/angular/core/templates/search-resource-input.html",link:function(d,g,m){g.autoCompleteStatus=void 0,g.autoCompleteWarning=!1,d.empty=!1,d.clear=!1,d.searchDisplayType=l;const v="true"===d.preserveSearch,y=g.find(".view-res-input");let b,x;d.textButtonLabel=d.textButton||"query.editor.table.btn",d.visualButtonLabel=d.visualButton||"query.editor.visual.btn",d.showClearInputIcon=!1,d.searchType=u.get(c.RDF_SEARCH_TYPE)||l.table,d.searchInput="",d.changeSearchType=function(t){d.searchType=t,u.set(c.RDF_SEARCH_TYPE,d.searchType)},d.$on("addStartFixedNodeAutomatically",(function(t,e){d.searchInput||!e.startIRI?d.checkIfValidAndSearchText():d.visualCallback({uri:e.startIRI,label:""})})),d.clearInput=function(){d.searchInput="",d.selectedElementIndex=-1,d.autoCompleteUriResults=[],d.showClearInputIcon=!1,u.remove(c.RDF_SEARCH_INPUT),u.remove(c.RDF_SEARCH_EXPANDED_URI),u.remove(c.RDF_RESOURCE_DESCRIPTION)},d.$watch("namespacespromise",(function(){angular.isDefined(d.namespacespromise)&&d.namespacespromise.success((function(t){g.namespaces=t.results.bindings.map((function(t){return{prefix:t.prefix.value,uri:t.namespace.value}}))})).error((function(t){const n=getError(t);e.error(n,f.instant("error.getting.namespaces.for.repo"))}))})),d.$watch("autocompletepromisestatus",(function(){!h.isActiveRepoFedXType()&&angular.isDefined(d.autocompletepromisestatus)&&d.autocompletepromisestatus.success((function(t){g.autoCompleteStatus=!!t,""!==d.searchInput&&d.onChange()})).error((function(){e.error(f.instant("explore.error.autocomplete"))}))})),d.$watch("empty",(function(){v||(d.searchInput="",d.empty=!1)})),d.$watch("clear",(function(){d.clear&&(d.clearInput(),d.clear=!1)})),s.$on("$translateChangeSuccess",(function(){m.$attr.placeholder?d.placeholder=m.$attr.placeholder:d.placeholder=f.instant("search.resources.msg")+"..."}));const w=function(e){const n=e.type||"uri";"true"===d.openInNewTab?E(!1,e):t.path("resource").search(n,e.uri)},S=function(e){const n=e.type||"uri";"true"===d.openInNewTab?E(!0,e):t.path("graphs-visualizations").search(n,e.uri)},E=function(t,e){const n=t?"graphs-visualizations":"resource";window.open(`${n}?uri=${encodeURIComponent(e.uri)}`)};angular.isUndefined(m.$attr.textCallback)&&(d.textCallback=w),angular.isUndefined(m.$attr.visualCallback)&&(d.visualCallback=S),m.$attr.textButton&&!d.textButton?d.textCallback=d.visualCallback:m.$attr.visualButton&&!d.visualButton&&(d.visualCallback=d.textCallback),m.$attr.placeholder?d.placeholder=m.$attr.placeholder:d.placeholder=f.instant("search.resources.msg")+"...",angular.isDefined(m.$attr.uriValidation)?d.uriValidation=m.$attr.uriValidation:d.uriValidation="true",angular.isDefined(m.$attr.preserveInput)&&(d.preserveInput=m.$attr.preserveInput),d.getResultItemHtml=function(t){return a.trustAsHtml(t.description)},d.searchRdfResource=function(t,e){if("prefix"===t.type)d.searchInput=D(t.value+":"),y.focus(),d.onChange();else{let n;n=angular.isUndefined(t)?d.searchInput:"object"==typeof t?t.value:t;let r="";if(t.description){const e=t.description.indexOf("<"+n+">");e>0&&(r=t.description.substring(0,e).replace(/<\/?b>/g,""))}e({uri:n,description:t.description,label:r,type:t.type}),v?(d.selectedElementIndex=d.activeSearchElm,u.set(c.RDF_SEARCH_EXPANDED_URI,b),u.set(c.RDF_SEARCH_INPUT,d.searchInput),u.set(c.RDF_RESOURCE_DESCRIPTION,t.description)):"true"===d.preserveInput?(d.searchInput=n,d.autoCompleteUriResults=[]):(d.searchInput="",d.autoCompleteUriResults=[])}},d.searchRdfResourceByEvent=function(t,e){d.searchType===l.visual||e.ctrlKey||e.metaKey?d.searchRdfResource(t,d.visualCallback):d.searchRdfResource(t,d.textCallback)};const F=function(t){const n=d.searchInput;""!==n?"false"!==d.uriValidation?g.autoCompleteStatus&&d.autoCompleteUriResults&&d.autoCompleteUriResults.length>0?"prefix"===d.autoCompleteUriResults[d.activeSearchElm].type?(d.searchInput=D(d.autoCompleteUriResults[d.activeSearchElm].value+":"),d.autoCompleteUriResults=[]):d.searchRdfResource(d.autoCompleteUriResults[d.activeSearchElm],t):C(n)?d.searchRdfResource(n,t):e.error(f.instant("invalid.uri.msg")):d.searchRdfResource(n,t):e.error(f.instant("fill.input.field.msg"))};function A(){let t=-1;const n=u.get(c.RDF_RESOURCE_DESCRIPTION);n&&d.autoCompleteUriResults&&(t=d.autoCompleteUriResults.findIndex(t=>t.description===n),d.selectedElementIndex=t,new Promise(t=>{const e=document.getElementById("auto-complete-results-wrapper").getBoundingClientRect();setTimeout(()=>{t(e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth))})}).then((function(){!function(){const t=$("#auto-complete-results-wrapper"),e=$("#auto_"+d.selectedElementIndex);t.animate({scrollTop:e.offset().top-t.offset().top+t.scrollTop()})}()})).catch((function(t){e.error(getError(t),f.instant("no.prev.search.element"))}))),d.activeSearchElm=-1===t?0:t}function C(t){const e=t.indexOf("<")>=0&&t.indexOf(">")>=0,n=-1===t.indexOf("<")&&-1===t.lastIndexOf(">"),r=/^<?(http|urn).*>?/.test(t)&&(e||n);let i=!1;if(r)if(t.indexOf("http")>=0){const e=t.indexOf("//");i=e>4&&t.substring(e+2).length>0}else t.indexOf("urn")>=0&&(i=t.substring(4).length>0);return r&&i}function D(t){if(!/^<?(http|urn).*>?/.test(t)){const e=t.split(":"),r=e[0],i=e[1];if(!angular.isUndefined(i)){const t=n.getNamespaceUriForPrefix(g.namespaces,r);if(b=t!==b?t:b,b)return y.val(b),b+i}}return t}d.checkIfValidAndSearchText=function(){F(d.textCallback)},d.checkIfValidAndSearchVisual=function(){F(d.visualCallback)},d.checkIfValidAndSearchEvent=function(t){d.searchType===l.visual||t.ctrlKey||t.metaKey?F(d.visualCallback):F(d.textCallback)},d.onChange=function(){return d.showClearInputIcon=d.clearInputIcon,v&&u.set(c.RDF_SEARCH_INPUT,d.searchInput),"false"!==d.uriValidation&&(d.searchInput=D(d.searchInput),g.autoCompleteStatus)?function(t){let e=t.replace(b,b+";");if(g.autoCompleteStatus)return";"===e.charAt(0)&&(e=e.slice(1)),e=function(t){let e=t;if(-1===e.indexOf(";")&&C(e)){e=e.replace(/<|>/g,"");const t=/[^/^#]*$/.exec(e)[0];return e.split(t)[0]+";"+t}return e}(e),x&&x.resolve(),x=o.defer(),i.getAutocompleteSuggestions(e,x.promise).then((function(t){x=null,d.autoCompleteUriResults=t.data.suggestions,d.activeSearchElm=0}));return Promise.resolve()}(d.searchInput):Promise.resolve()},d.onKeyDown=function(t){if(13===t.keyCode){if(t.preventDefault(),p.isActive())return;"false"!==d.uriValidation?g.autoCompleteStatus?d.checkIfValidAndSearchEvent(t):C(t.target.value)?d.searchRdfResourceByEvent(t.target.value,t):e.error(f.instant("invalid.uri.msg")):d.searchRdfResourceByEvent(t.target.value,t)}else if(d.searchInput.length>0&&!g.autoCompleteWarning&&!g.autoCompleteStatus){g.autoCompleteWarning=!0;const t=Object(r.decodeHTML)(f.instant("explore.autocomplete.warning.msg"));e.warning("",`<div class="autocomplete-toast"><a href="autocomplete">${t}</a></div>`,{allowHtml:!0})}if(g.autoCompleteStatus&&!angular.isUndefined(d.autoCompleteUriResults)){if(40===t.keyCode&&d.activeSearchElm<d.autoCompleteUriResults.length-1&&(d.activeSearchElm++,d.searchInput=d.autoCompleteUriResults[d.activeSearchElm].value,function(){const t=$("#auto-complete-results-wrapper"),e=t.children("div"),n=t.children("div.active");void 0!==n[0]&&n[0].offsetTop-e.height()-6-t.scrollTop()>170&&t.scrollTop(n[0].offsetTop-e.height()-6-170)}()),38===t.keyCode&&d.activeSearchElm>0&&(t.preventDefault(),d.activeSearchElm--,d.searchInput=d.autoCompleteUriResults[d.activeSearchElm].value,function(){const t=$("#auto-complete-results-wrapper"),e=t.children("div"),n=t.children("div.active");void 0!==n[0]&&n[0].offsetTop-e.height()-40<=t.scrollTop()&&t.scrollTop(t.scrollTop()-34)}()),27===t.keyCode){if(v)return;d.searchInput="",d.autoCompleteUriResults=[]}d.searchInput||d.clearInput()}},d.$on("rdfResourceSearchExpanded",(function(){(v?(d.preserveInput="true",d.searchInput=u.get(c.RDF_SEARCH_INPUT)||"",b=u.get(c.RDF_SEARCH_EXPANDED_URI),d.onChange()):Promise.resolve()).then((function(){A()}))})),d.setActiveClassOnMouseMove=function(t){g.autoCompleteStatus&&(d.activeSearchElm=t)}}}}function f(t){return{restrict:"AE",link:function(e,n,r){function i(t){27===t.keyCode&&(e.toggleCheatSheet(),e.$apply())}e.getTemplateUrl=function(){return r.templateUrl},e.shortcutsVisible=!1,e.toggleCheatSheet=function(){e.shortcutsVisible=!e.shortcutsVisible,e.shortcutsVisible?t.on("keydown",i):t.off("keydown",i)}},template:'<ng-include src="getTemplateUrl()" />'}}function p(t,e,n,i,s,o){return{restrict:"E",transclude:!0,scope:{loadSaved:"&",setPluginActive:"&",pluginName:"@",humanReadablePluginName:"@"},templateUrl:"js/angular/core/templates/inactive-plugin-warning-page.html",link:function(a){function u(){if(s.isLicenseValid()&&i.getActiveRepository()&&!i.isActiveRepoOntopType()&&!i.isActiveRepoFedXType())return e.checkPluginIsActive(a.pluginName).done((function(t){a.pluginIsActive=t.indexOf("true")>0,a.setPluginActive({isPluginActive:a.pluginIsActive})})).fail((function(e){t.error(getError(e),o.instant("check.active.plugin.failure"))}))}a.pluginIsActive=!0,a.activatePlugin=function(){const i=Object(r.decodeHTML)(o.instant("activate.plugin.warning.msg",{humanReadablePluginName:a.humanReadablePluginName}));n.openSimpleModal({title:o.instant("activate.plugin.confirmation"),message:`<p>${i}</p>`,warning:!0}).result.then((function(){e.activatePlugin(a.pluginName).done((function(){a.pluginIsActive=!0,a.setPluginActive({isPluginActive:a.pluginIsActive}),a.loadSaved()})).fail((function(e){t.error(getError(e),o.instant("activate.plugin.failure"))}))}))};const c=a.$on("repositoryIsSet",(function(){u()}));window.addEventListener("beforeunload",(function t(){c(),window.removeEventListener("beforeunload",t)})),a.$on("checkIsActive",u),u()}}}h.$inject=["$location","toastr","ClassInstanceDetailsService","AutocompleteRestService","$rootScope","$q","$sce","LocalStorageAdapter","LSKeys","$repositories","$translate","GuidesService"],f.$inject=["$document"],p.$inject=["toastr","RDF4JRepositoriesRestService","ModalService","$repositories","$licenseService","$translate"]},function(t,e,n){"use strict";n.r(e);n(4),n(23),n(24);var r=n(2);angular.module("graphdb.framework.core.services.jwtauth",["toastr","graphdb.framework.rest.security.service","graphdb.framework.core.services.openIDService"]).service("$jwtAuth",["$http","toastr","$location","$rootScope","SecurityRestService","$openIDAuth","$translate","$q",function(t,e,n,i,s,o,a,u){const c=this;i.deniedPermissions={},i.setPermissionDenied=function(t){return!("/"===t||"/login"===t||!c.isAuthenticated())&&(i.deniedPermissions[t]=!0,!0)},i.hasPermission=function(){const t=n.path();return!i.deniedPermissions[t]},i.redirectToLogin=function(t,e){return c.authTokenIsType("Bearer")&&(t=!0),c.clearAuthenticationInternal(),0!==n.url().indexOf("/login")&&(i.returnToUrl=n.url()),n.path("/login"),e?n.search("noaccess"):t&&n.search("expired"),new Promise(t=>{setTimeout(()=>{t(!0)},100)})},i.hasExternalAuthUser=function(){return c.hasExternalAuthUser()},this.authStorageName="com.ontotext.graphdb.auth",this.securityEnabled=!0,this.freeAccess=!1,this.hasOverrideAuth=!1,this.externalAuthUser=!1,this.securityInitialized=!1;const l=this;this.clearStorage=function(){localStorage.removeItem(l.authStorageName)},this.getAuthenticatedUserFromBackend=function(t,e){s.getAuthenticatedUser().success((function(t,e,n){l.auth&&l.auth.startsWith("GDB")?(l.externalAuthUser=!1,l.principal=t,i.$broadcast("securityInit",l.securityEnabled,!0,l.freeAccess)):l.openIDEnabled&&l.auth&&l.auth.startsWith("Bearer")?l.authenticate(t,l.auth):(l.externalAuthUser=!0,l.authenticate(t,""))})).error((function(){t||!l.freeAccess?i.redirectToLogin(!1,e):(l.securityInitialized=!0,l.hasExplicitAuthentication()||l.clearAuthentication())}))},this.initSecurity=function(){this.securityInitialized=!1,this.auth=localStorage.getItem(this.authStorageName),s.getSecurityConfig().then((function(t){if(l.securityEnabled=t.data.enabled,l.externalAuth=t.data.hasExternalAuth,l.authImplementation=t.data.authImplementation,l.openIDEnabled=t.data.openIdEnabled,l.passwordLoginEnabled=t.data.passwordLoginEnabled,l.securityEnabled){const e=t.data.freeAccess;l.freeAccess=e.enabled,l.freeAccess&&(l.freeAccessPrincipal={authorities:e.authorities,appSettings:e.appSettings}),l.openIDEnabled?(l.openIDConfig=t.data.methodSettings.openid,l.gdbUrl=n.absUrl().replace(n.url().substr(1),""),o.initOpenId(l.openIDConfig,l.gdbUrl,(function(t){l.auth=o.authHeaderGraphDB(),c.setAuthHeaders(),console.log("oidc: set id/access token as GraphDB auth"),l.getAuthenticatedUserFromBackend(!0,t)}),(function(){console.log("oidc: not logged or login error"),l.authTokenIsType("Bearer")?setTimeout(()=>{i.redirectToLogin(!0)},0):l.getAuthenticatedUserFromBackend()}))):l.getAuthenticatedUserFromBackend()}else{l.clearStorage();const e=t.data.overrideAuth;if(l.hasOverrideAuth=e.enabled,!l.hasOverrideAuth)return s.getAdminUser().then((function(t){l.principal={username:"admin",appSettings:t.data.appSettings,authorities:t.data.grantedAuthorities},i.$broadcast("securityInit",l.securityEnabled,!0,l.hasOverrideAuth)}));l.principal={username:"overrideauth",authorities:e.authorities,appSettings:e.appSettings},i.$broadcast("securityInit",l.securityEnabled,!0,l.hasOverrideAuth)}}))},this.initSecurity(),this.reinitializeSecurity=function(){this.securityInitialized||this.initSecurity()},this.isSecurityEnabled=function(){return this.securityEnabled},this.hasExternalAuth=function(){return this.externalAuth},this.getAuthImplementation=function(){return this.authImplementation},this.isFreeAccessEnabled=function(){return this.freeAccess},this.isDefaultAuthEnabled=function(){return this.hasOverrideAuth&&this.principal&&"overrideauth"===this.principal.username},this.getAuthToken=function(){return this.auth},this.authTokenIsType=function(t){return this.auth&&this.auth.startsWith(t)},this.loginOpenID=function(){o.login(this.openIDConfig,this.gdbUrl)},this.toggleSecurity=function(t){t!==this.securityEnabled&&(this.securityEnabled=t,s.toggleSecurity(t).then((function(){e.success(a.instant("jwt.auth.security.status",{status:a.instant(t?"enabled.status":"disabled.status")})),l.clearStorage(),l.initSecurity()}),(function(t){e.error(t.data.error.message,a.instant("common.error"))})))},this.toggleFreeAccess=function(t,n,r,o){(t!==this.freeAccess||o)&&(this.freeAccess=t,this.freeAccessPrincipal=t?{authorities:n,appSettings:r}:void 0,s.setFreeAccess({enabled:t?"true":"false",authorities:n,appSettings:r}).then((function(){o?e.success(a.instant("jwt.auth.free.access.updated.msg")):e.success(a.instant("jwt.auth.free.access.status",{status:a.instant(t?"enabled.status":"disabled.status")}))}),(function(t){e.error(t.data.error.message,a.instant("common.error"))})),i.$broadcast("securityInit",this.securityEnabled,this.hasExplicitAuthentication(),this.freeAccess))},this.setAuthHeaders=function(){return new Promise(e=>{const n=this.auth?this.auth:void 0;t.defaults.headers.common.Authorization=n,t.defaults.headers.common["X-Requested-With"]="XMLHttpRequest",$.ajaxSetup().headers=$.ajaxSetup().headers||{},$.ajaxSetup().headers.Authorization=n,$.ajaxSetup().headers["X-Requested-With"]="XMLHttpRequest",setTimeout(()=>{e(!0)})})},this.setAuthHeaders(),this.authenticate=function(t,e){return new Promise(n=>{l.clearStorage(),e&&(this.auth=e,localStorage.setItem(l.authStorageName,this.auth),this.externalAuthUser=!1),this.principal=t,i.deniedPermissions={},this.securityInitialized=!0,l.setAuthHeaders().then(()=>{i.$broadcast("securityInit",this.securityEnabled,l.hasExplicitAuthentication(),this.freeAccess)}),setTimeout(()=>{n(!0)})})},this.authenticateOpenID=function(t){this.clearStorage(),t&&(this.auth=t,localStorage.setItem(this.authStorageName,this.auth),this.externalAuthUser=!1)},this.hasExternalAuthUser=function(){return this.externalAuthUser},this.hasExplicitAuthentication=function(){return null!=this.auth||this.externalAuthUser},this.getPrincipal=function(){if(this.principal)return Promise.resolve(this.principal);const t=u.defer();return i.$on("securityInit",()=>{t.resolve(this.principal)}),t.promise},this.clearAuthenticationInternal=function(){o.softLogout(),this.auth=null,this.principal=this.freeAccessPrincipal,this.clearStorage(),this.setAuthHeaders()},this.clearAuthentication=function(){this.clearAuthenticationInternal(),i.$broadcast("securityInit",this.securityEnabled,!1,this.freeAccess)},this.isAuthenticated=function(){return!this.securityEnabled||this.hasExplicitAuthentication()},this.hasPermission=function(){},this.hasRole=function(t){if(void 0!==t&&(this.securityEnabled||this.hasOverrideAuth)){"string"==typeof t&&(t=[t]);const e=!_.isEmpty(this.principal);return!!e&&("IS_AUTHENTICATED_FULLY"===t[0]?e:_.intersection(t,this.principal.authorities).length>0)}return!0},this.isAdmin=function(){return this.hasRole(r.UserRole.ROLE_ADMIN)},this.checkForWrite=function(t,e){return"WRITE_REPO"===t?this.canWriteRepo(e):this.hasRole(t)},this.hasAdminRole=function(){return this.isAdmin()||this.hasRole(r.UserRole.ROLE_REPO_MANAGER)},this.canWriteRepo=function(t){return!!t&&(!this.securityEnabled&&!this.hasOverrideAuth||!_.isEmpty(this.principal)&&(!!this.hasAdminRole()||this.checkRights(t,"WRITE")))},this.canReadRepo=function(t){return!!t&&(!this.securityEnabled||!_.isEmpty(this.principal)&&(!!this.hasAdminRole()||this.checkRights(t,"READ")))},this.checkRights=function(t,e){if(t)for(let n=0;n<this.principal.authorities.length;n++){const r=this.principal.authorities[n],i=r.split("_",2),s=r.slice(i[0].length+i[1].length+2),o=t.location?`${t.id}@${t.location}`:t.id;if(i[0]===e&&(o===s||"SYSTEM"!==t.id&&"*"===s))return!0}return!1}}])},function(t,e){let n;angular.module("graphdb.framework.utils.uriutils",[]).factory("UriUtils",(function(){return{isValidIri:function(t){return void 0!==t&&!!t.match(n)},validateRdfUri:function(t){const e=t.indexOf("<")>=0&&t.indexOf(">")>=0,n=-1===t.indexOf("<")&&-1===t.lastIndexOf(">"),r=/^<?(http|urn).*>?/.test(t)&&(e||n);let i=!1;if(r)if(t.indexOf("http")>=0){const e=t.indexOf("//");i=e>4&&t.substring(e+2).length>0}else t.indexOf("urn")>=0&&(i=t.substring(4).length>0);return r&&i},shortenIri:function(t){const e=document.createElement("a");e.href=t;let n=e.hostname;return function(t){const e=t.split(".");for(let t=0,n=0;t<e.length;t++)if(parseInt(e[t],10)>=0&&parseInt(e[t],10)<=255?n++:n=0,4===n)return!0;return!1}(e.hostname)||(n=e.hostname.split(".")[0]),n+":"+e.port}}}));try{n=new RegExp("^[a-z](?:[-a-z0-9\\+\\.])*:(?:\\/\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:])*@)?(?:\\[(?:(?:(?:[0-9a-f]{1,4}:){6}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|::(?:[0-9a-f]{1,4}:){5}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:[0-9a-f]{1,4}:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|v[0-9a-f]+[-a-z0-9\\._~!\\$&'\\(\\)\\*\\+,;=:]+)\\]|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}|(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=@])*)(?::[0-9]*)?(?:\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))*)*|\\/(?:(?:(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))+)(?:\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))*)*)?|(?:(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))+)(?:\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))*)*|(?!(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@])))(?:\\?(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@])|[\\u{E000}-\\u{F8FF}\\u{F0000}-\\u{FFFFD}\\u{100000}-\\u{10FFFD}\\/\\?])*)?(?:#(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@])|[\\/\\?])*)?$","ui")}catch(t){n=new RegExp("^[a-z](?:[-a-z0-9\\+\\.])*:","i")}},function(t,e){angular.module("graphdb.framework.rest.monitoring.service",[]).factory("MonitoringRestService",n),n.$inject=["$http"];function n(t){return{monitorResources:function(){return t.get("rest/monitor/resource")},monitorGC:function(){return t.post("rest/monitor/resource/gc")},monitorQuery:function(){return t.get("rest/monitor/query")},abortQueryByAlias:function(e){return t.delete("rest/monitor/query?queryAlias="+encodeURIComponent(e))},deleteQuery:function(e){return t.delete("rest/monitor/query?queryId="+encodeURIComponent(e))},getQueryCount:function(){return t({url:"rest/monitor/query/count",method:"GET",timeout:1e4})},checkAutocompleteStatus:function(){return t.get("rest/autocomplete/enabled")}}}},function(t,e){angular.module("graphdb.framework.rest.rdf4j.repositories.service",[]).factory("RDF4JRepositoriesRestService",r),r.$inject=["$http","$repositories","$translate"];const n="select ?o where {\n?s <http://www.ontotext.com/owlim/system#listplugins> ?o .\nfilter(str(?s) = '{{pluginName}}')\n} ";function r(t,e,r){return{getNamespaces:function(e){return t.get(`repositories/${e}/namespaces`)},getRepositoryNamespaces:function(){return t.get(`repositories/${e.getActiveRepository()}/namespaces`)},updateNamespacePrefix:function(e,n,r){return t({url:`repositories/${e}/namespaces/${r}`,method:"PUT",data:n})},deleteNamespacePrefix:function(e,n){return t({url:`repositories/${e}/namespaces/${n}`,method:"DELETE"})},addStatements:function(e,n){return t({url:`repositories/${e}/statements`,method:"POST",data:n,headers:{"Content-Type":"application/x-www-form-urlencoded"}})},activatePlugin:function(t){return $.ajax({method:"POST",url:`repositories/${e.getActiveRepository()}/statements`,data:{update:"INSERT DATA { <u:a> <http://www.ontotext.com/owlim/system#startplugin> '{{pluginName}}' .}".replace("{{pluginName}}",t)}})},checkPluginIsActive:function(t){return $.ajax({method:"GET",url:"repositories/"+e.getActiveRepository(),data:{query:n.replace("{{pluginName}}",t)}})},getRepositorySize:function(){return t.get(`repositories/${e.getActiveRepository()}/size`)},getGraphs:i,resolveGraphs:function(){const t=e.getActiveRepository();let n=[];if(t)return i(t).success((function(t){t.results.bindings.unshift({contextID:{type:"default",value:"import.default.graph"}}),Object.keys(t.results.bindings).forEach((function(e){const n=t.results.bindings[e];"bnode"===n.contextID.type?n.contextID.value="_:"+n.contextID.value:"default"===n.contextID.type?n.contextID.uri="http://www.openrdf.org/schema/sesame#nil":n.contextID.uri=n.contextID.value})),t.results.bindings.unshift(allGraphs),n=t.results.bindings}));return n}};function i(e){return t.get(`repositories/${e}/contexts`)}}},function(t,e){function n(t,e,n,r){t.title=n,t.message=r,t.ok=function(){e.close()},t.cancel=function(){e.dismiss("cancel")}}function r(t,e,n,r,i){t.clipboardURI=n,t.ok=function(){try{document.getElementById("clipboardURI").select(),document.execCommand("copy"),r.success(i.instant("modal.ctr.copy.url.success"))}catch(t){r.error(i.instant("modal.ctr.copy.not.supported.warning"))}e.close()},t.cancel=function(){e.dismiss("cancel")}}function i(t,e,n,r,i){t.query=n,t.cancel=function(){e.dismiss("cancel")},t.selectQuery=function(){t.selectElement($("#create-query"))},t.copyQueryToClipboard=function(){try{t.selectQuery(),document.execCommand("copy"),e.close(),r.success(i.instant("modal.ctr.copy.query.success"))}catch(t){r.error(i.instant("modal.ctr.copy.not.supported.warning"))}},t.selectElement=function(t){if(t.length>0)if(window.getSelection){const e=window.getSelection();e.removeAllRanges();const n=document.createRange();n.selectNodeContents(t[0].firstChild),e.addRange(n)}else if(document.selection){const e=document.body.createTextRange();e.moveToElementText(t[0]),e.select()}}}angular.module("graphdb.framework.core.controllers",[]).controller("CopyToClipboardModalCtrl",r).controller("SimpleModalCtrl",n).controller("ViewQueryCtrl",i),n.$inject=["$scope","$modalInstance","title","message"],r.$inject=["$scope","$modalInstance","uri","toastr","$translate"],i.$inject=["$scope","$modalInstance","query","toastr","$translate"]},function(t,e){angular.module("graphdb.framework.rest.sparql.service",[]).factory("SparqlRestService",n),n.$inject=["$http"];function n(t){return{getSavedQueries:function(){return t.get("rest/sparql/saved-queries")},getSavedQuery:function(e,n){let r="";null!=n&&(r="&owner="+encodeURIComponent(n));return t.get(`rest/sparql/saved-queries?name=${encodeURIComponent(e)}${r}`)},addKnownPrefixes:function(e){return t.post("rest/sparql/add-known-prefixes",e)},editSavedQuery:function(e){return t.put("rest/sparql/saved-queries",e)},deleteSavedQuery:function(e){return t.delete("rest/sparql/saved-queries?name="+encodeURIComponent(e))},addNewSavedQuery:function(e){return t.post("rest/sparql/saved-queries",e)}}}},function(t,e){angular.module("graphdb.framework.rest.autocomplete.service",[]).factory("AutocompleteRestService",n);function n(t){return{checkAutocompleteStatus:function(){return t.get("rest/autocomplete/enabled")},refreshIndexStatus:function(){return t.get("rest/autocomplete/status")},refreshLabelConfig:function(){return t.get("rest/autocomplete/labels")},addLabelConfig:function(e){return t.put("rest/autocomplete/labels",e)},removeLabelConfig:function(e){return t.delete("rest/autocomplete/labels",{data:e,headers:{"Content-Type":"application/json;charset=utf-8"}})},toggleAutocomplete:function(e){return t.post("rest/autocomplete/enabled?enabled="+e)},refreshIndexIRIs:function(){return t.get("rest/autocomplete/iris")},toggleIndexIRIs:function(e){return t.post("rest/autocomplete/iris?enabled="+e)},buildIndex:function(){return t.post("rest/autocomplete/reindex")},interruptIndexing:function(){return t.post("rest/autocomplete/interrupt")},checkForPlugin:function(){return t.get("rest/autocomplete/plugin-found")},getAutocompleteSuggestions:function(e,n){return t.get("rest/autocomplete/query",{params:{q:e},timeout:n})}}}n.$inject=["$http"]},function(t,e){angular.module("graphdb.framework.rest.plugins.service",[]).factory("PluginsRestService",n);function n(t){return{togglePlugin:function(e,n,r){return n?t.post(`repositories/${e}/statements`,void 0,{params:{update:`INSERT DATA { <u:a> <http://www.ontotext.com/owlim/system#stopplugin> "${r}".}`}}):t.post(`repositories/${e}/statements`,void 0,{params:{update:`INSERT DATA { <u:a> <http://www.ontotext.com/owlim/system#startplugin> "${r}".}`}})},getPlugins:function(e){return t.get("repositories/"+e,{params:{query:"select ?s ?o where { ?s <http://www.ontotext.com/owlim/system#listplugins> ?o .}"}})}}}n.$inject=["$http"]},function(t,e,n){"use strict";n.r(e);n(5),n(7);var r=n(1);function i(t,e,n,i,s,o,a,u,c,l){this.guideResumeSubscription=void 0,this.languageChangeSubscription=void 0,this.guideCancelSubscription=void 0,this.init=()=>{this._subscribeToGuideResumed(),this._subscribeToGuideCancel(),this._subscribeToGuidePause()},this.startGuide=(t,n)=>{if(t&&t.options&&t.options.repositoryIdBase){const e=o.getRepositories();t.options.repositoryId=t.options.repositoryIdBase;for(let n=2;e.find(e=>e.id===t.options.repositoryId);n++)t.options.repositoryId=t.options.repositoryIdBase+n}const r=this._toStepsDescriptions(t);for(let t=0;t<r.length;t++)r[t].id=t;angular.isDefined(n)?s.resumeGuide(t.guideId,r,n):s.startGuide(t.guideId,r,n),e.$broadcast("guideStarted")},this.getGuides=()=>new Promise(e=>{t.get(r.GuideUtils.GUIDES_LIST_URL).success((function(t){angular.forEach(t,(t,e)=>{void 0===t.guideId&&(t.guideId=e)}),e(t)}))}),this.isActive=()=>s.isActive(),this._toStepsDescriptions=t=>{if(!t)return[];let e=[];return t.steps.forEach(n=>{e=e.concat(this._getSteps(n,t.options))}),e},this._getSteps=(t,s)=>{let o=[];if(angular.isArray(t))t.forEach(e=>{o=o.concat(this._getSteps(e,angular.extend({},t.options,s)))});else{const h=PluginRegistry.get("guide.step").find(e=>e.guideBlockName===t.guideBlockName);if(h){const f=angular.extend({},h.options,t.options,s);h.getSteps?o=o.concat(this._getSteps(angular.copy(h.getSteps(f,{$translate:n,$interpolate:i,GuideUtils:r.GuideUtils,$rootScope:e,toastr:a,$location:u,$route:c,$timeout:l})),s)):h.getStep?o.push(angular.copy(h.getStep(f,{GuideUtils:r.GuideUtils,$translate:n,toastr:a,$location:u,$route:c,$timeout:l}))):o=o.concat(this._getSteps(angular.copy(h,h.options),s))}}return o.forEach((t,e)=>{t.stepN=e,t.stepsTotalN=o.length,!t.title&&t.mainAction&&(t.title="guide.step-action."+t.mainAction)}),o},this._subscribeToGuideResumed=()=>{this.guideResumeSubscription||(this.guideResumeSubscription=e.$on("guideResume",()=>{const t=s.getGuideId();this.getGuides().then(e=>{const n=e.find(e=>e.guideId===t),r=s.getCurrentStepId();this.startGuide(n,r)})}))},this._subscribeToGuideCancel=()=>{s.subscribeToGuideCancel(()=>e.$broadcast("guideReset"))},this._subscribeToGuidePause=()=>{s.subscribeToGuidePause(()=>e.$broadcast("guidePaused"))}}angular.module("graphdb.framework.guides.services",["graphdb.framework.guides.shepherd.services"]).service("GuidesService",i),i.$inject=["$http","$rootScope","$translate","$interpolate","ShepherdService","$repositories","toastr","$location","$route","$timeout"]},function(t,e,n){"use strict";n.r(e);n(4);angular.module("graphdb.framework.core.interceptors.unauthorized",["ngCookies"]).factory("$unauthorizedInterceptor",["$q","$location","$rootScope","$translate",function(t,e,n,r){return{responseError:function(i){let s=!1;return 401===i.status?i.config.url.indexOf("rest/security/authenticated-user")<0&&!n.hasExternalAuthUser()&&(s=!0):403===i.status&&(n.setPermissionDenied(e.path())?console.log(r.instant("unauthorized.console.warning")):s=!0),s?Promise.resolve(n.redirectToLogin()).then(()=>t.reject(i)):t.reject(i)}}}])},,function(t,e,n){"use strict";n.r(e);var r=n(3);const i={headers:{"X-GraphDB-Repository-Location":void 0,"X-GraphDB-Repository":void 0,"X-Requested-With":void 0,Authorization:void 0}};angular.module("graphdb.framework.core.services.openIDService",["toastr"]).service("$openIDAuth",["$http","$location","$window","toastr","$translate",function(t,e,n,s,o){const a="com.ontotext.graphdb.openid.",u=this;function c(t){const e=[];for(let n in t)t.hasOwnProperty(n)&&e.push(`${n}=${encodeURIComponent(t[n])}`);return e.join("&")}this.login=function(t,e){const r=u.generateRandomString(),i=t.authFlow;if("code"===i){u.setStorageItem("pkce_state",r);const i=u.generateRandomString();u.setStorageItem("pkce_code_verifier",i);const s=u.pkceChallengeFromVerifier(i);n.location.href=u.getLoginUrl(r,s,e,t)}else"code_no_pkce"===i?(u.removeStorageItem("pkce_code_verifier"),n.location.href=u.getLoginUrl(r,"",e,t)):"implicit"===i?(u.setStorageItem("nonce",r),n.location.href=u.getLoginUrl(r,"",e,t)):(console.log("oidc: unknown auth flow: "+i),s.error(o.instant("openid.auth.unknown.flow",{authFlow:i})))},this.getLoginUrl=function(t,e,n,r){const i=[];let s="";switch(r.authFlow){case"code":s="code",i.push("state="+encodeURIComponent(t)),i.push("code_challenge="+encodeURIComponent(e)),i.push("code_challenge_method=S256");break;case"code_no_pkce":s="code";break;case"implicit":s="token id_token",i.push("nonce="+encodeURIComponent(t));break;default:throw new Error(o.instant("openid.auth.unknown.flow",{authFlow:r.authFlow}))}return i.unshift("response_type="+encodeURIComponent(s),"scope="+encodeURIComponent(u.getScope(r.extraScopes)),"client_id="+encodeURIComponent(r.clientId),"redirect_uri="+encodeURIComponent(n)),r.oracleDomain&&i.push("domain="+encodeURIComponent(r.oracleDomain)),r.authorizeParameters&&i.push(r.authorizeParameters),`${r.oidcAuthorizationEndpoint}?${i.join("&")}`},this.withOpenIdKeys=function(e,n){t.get(e,i).success((function(t){u.openIdKeys={},t.keys.forEach((function(t){u.openIdKeys[t.kid]=t})),n()}))},this.initOpenId=function(t,e,r,a){u.clientId=t.clientId,u.tokenType=t.tokenType,u.idTokenAudience=t.clientId,u.idTokenIssuer=t.issuer,u.accessTokenAudience=t.tokenAudience,u.accessTokenIssuer=t.tokenIssuer,u.openIdTokenUrl=t.oidcTokenEndpoint;let c=t.oidcJwksUri;t.proxyOidc&&(c="rest/openid/jwks",u.openIdTokenUrl="rest/openid/token"),u.openIdEndSessionUrl=t.oidcEndSessionEndpoint,u.supportsOfflineAccess=t.oidcScopesSupported.includes("offline_access"),t.oracleDomain&&(i.headers["X-OAuth-Identity-Domain-Name"]=t.oracleDomain),u.withOpenIdKeys(c,(function(){if(u.isLoggedIn=u.hasValidIdToken(),u.isLoggedIn)u.setupTokensRefresh(!1,r,a);else if(u.hasValidRefreshToken())u.refreshTokens(r,a);else{const i=r;r=function(){u.isLoggedIn=!0,i(!0)},u.softLogout();const c=u.parseQueryString(n.location.search.substring(1));if(c.code)"code"===t.authFlow?u.getStorageItem("pkce_state")!==c.state?(s.error(o.instant("openid.auth.invalid.pkce.state")),console.log("oidc: PKCE state mismatch "+u.getStorageItem("pkce_state")+" != "+c.state),a()):u.retrieveTokensByCode(c.code,e,r,a):"code_no_pkce"===t.authFlow&&u.retrieveTokensByCode(c.code,e,r,a);else{const t=u.parseQueryString(n.location.pathname.substring(1));t.id_token?u.saveTokens(t,!0,!1,r):a()}}}))},this.authHeaderGraphDB=function(){return"id"===u.getStorageItem("token_type")?"Bearer "+u.getToken("id"):"Bearer "+u.getToken("access")},this.softLogout=function(){u.isLoggedIn=!1,u.setToken("id",null),u.setToken("access",null),u.setToken("refresh",null)},this.hardLogout=function(t){u.softLogout(),u.openIdEndSessionUrl&&(n.location.href=`${u.openIdEndSessionUrl}?client_id=${encodeURIComponent(u.clientId)}&post_logout_redirect_uri=${encodeURIComponent(t)}`)},this.getToken=function(t){return u.getStorageItem(t+"_token")},this.setToken=function(t,e){e?u.setStorageItem(t+"_token",e):u.removeStorageItem(t+"_token")},this.tokenHeader=function(t){const e=u.getToken(t);if(e){try{const t=r.KJUR.jws.JWS.readSafeJSONString(Object(r.b64utoutf8)(e.split(".")[0]));if(t)return t}catch(t){}return{error:o.instant("openid.auth.not.jwt.token",{token:e})}}return{}},this.verifyToken=function(t){const e=u.getToken(t),n=u.tokenHeader(t);if(!n.kid)return"id"!==t?n.error?(console.log(`oidc: token ${t} is not a JWT token (token considered valid)`),!0):(console.log(`oidc: invalid token ${t} (token is empty)`),!1):(console.log("oidc: invalid token id (not a JWT token)"),!1);const i=u.openIdKeys[n.kid];if(!i)return console.log("oidc: no key to verify JWT token (token considered invalid)"),!1;const s=r.KEYUTIL.getKey(i),o={alg:[n.alg],iss:[u.idTokenIssuer]};return"id"===t?(o.aud=[u.idTokenAudience,u.idTokenIssuer],o.nonce=[u.getStorageItem("nonce")]):"access"===t&&(o.aud=[u.accessTokenAudience],o.iss=[u.accessTokenIssuer]),r.KJUR.jws.JWS.verifyJWT(e,s,o)},this.hasValidIdToken=function(){return u.getToken("id")?u.verifyToken("id")?(console.log("oidc: valid id token found"),!0):(console.log("oidc: stale id token"),!1):(console.log("oidc: no id token"),!1)},this.tokenPayload=function(t){const e=u.getToken(t);if(e){try{const t=r.KJUR.jws.JWS.readSafeJSONString(Object(r.b64utoutf8)(e.split(".")[1]));if(t)return t}catch(t){}return{error:o.instant("openid.auth.not.jwt.token",{token:e})}}return{}},this.saveTokens=function(t,n,r,i){(n||t.refresh_token)&&u.setToken("refresh",t.refresh_token),u.setToken("access",t.access_token),u.setToken("id",t.id_token),u.setStorageItem("token_type",u.tokenType),console.log("oidc: saved tokens"),u.setupTokensRefresh(n||r,i),u.removeStorageItem("pkce_state"),u.removeStorageItem("pkce_code_verifier"),n&&e.url("/")},this.retrieveTokensByCode=function(e,n,r,a){const l={grant_type:"authorization_code",client_id:u.clientId,redirect_uri:n,code:e},h=u.getStorageItem("pkce_code_verifier");h&&(l.code_verifier=h);const f={...i.headers,"Content-type":"application/x-www-form-urlencoded; charset=utf-8"};t({method:"POST",url:u.openIdTokenUrl,headers:f,transformRequest:c,data:l}).success((function(t){u.saveTokens(t,!0,!1,r)})).error((function(t){s.error(o.instant("openid.auth.cannot.retrieve.token.msg",{error:getError(t)})),a()}))},this.refreshTokens=function(e,n){if(u.hasValidRefreshToken()){const r={grant_type:"refresh_token",client_id:u.clientId,refresh_token:u.getToken("refresh")},a={...i.headers,"Content-type":"application/x-www-form-urlencoded; charset=utf-8"};t({method:"POST",url:u.openIdTokenUrl,headers:a,transformRequest:c,data:r}).success((function(t){console.log("oidc: refreshed tokens"),u.saveTokens(t,!1,!0,e),u.isLoggedIn=!0})).error((function(t){console.log("oidc: could not refresh tokens"),s.error(o.instant("openid.auth.cannot.refresh.token.msg",{error:getError(t)})),n&&n()}))}else console.log("oidc: refresh requested without a valid refresh token")},this.hasValidRefreshToken=function(){const t=u.tokenPayload("refresh");return!(t.nbf&&1e3*t.nbf-Date.now()>5e3)&&(!(t.exp&&Date.now()-1e3*t.exp>5e3)&&!(!t.iat&&!t.error))},this.setupTokensRefresh=function(t,e,n){if(u.hasValidRefreshToken()){clearTimeout(u.previousTimer);const r=u.tokenPayload("id");if(r.exp>0){const i=1e3*r.exp-Date.now()-6e4;if(!(t||i>1e3))return u.previousTimer=null,console.log("oidc: tokens will refresh now, "+i+"; "+t),void u.refreshTokens(e,n);u.previousTimer=setTimeout((function(){u.refreshTokens(e)}),i),console.log("oidc: tokens will refresh in "+i/1e3+" seconds at "+new Date(Date.now()+i))}}else console.log("oidc: no valid refresh token");e()},this.parseQueryString=function(t){const e={access_token:null,code:null,id_token:null,state:null};if(""===t)return e;return t.split("&").map((function(t){return t.split("=")})).forEach((function(t){e[t[0]]=decodeURIComponent(t[1])})),e},this.generateRandomString=function(){const t=new Uint32Array(28);return window.crypto.getRandomValues(t),Array.from(t,(function(t){return("0"+t.toString(16)).substr(-2)})).join("")},this.pkceChallengeFromVerifier=function(t){const e=new r.KJUR.crypto.MessageDigest({alg:"sha256",prov:"cryptojs"});return Object(r.hextob64u)(e.digestString(t))},this.getScope=function(t){let e="openid"+(u.supportsOfflineAccess?" offline_access":"");return t&&(e+=" "+t),console.log(`oidc: requesting scopes '${e}'`),e},this.setStorageItem=function(t,e){localStorage.setItem(a+t,e)},this.getStorageItem=function(t){return localStorage.getItem(a+t)},this.removeStorageItem=function(t){localStorage.removeItem(a+t)}}])},function(t,e){angular.module("graphdb.framework.rest.security.service",[]).factory("SecurityRestService",n),n.$inject=["$http"];function n(t){return{getUser:function(n){return t.get("rest/security/users/"+e(n))},getAdminUser:function(){return t.get("rest/security/users/admin")},getUsers:function(){return t.get("rest/security/users")},createUser:function(n){return t({method:"POST",url:"rest/security/users/"+e(n.username),data:{password:n.pass,appSettings:n.appSettings,grantedAuthorities:n.grantedAuthorities}})},updateUser:function(n){return t({method:"PUT",url:"rest/security/users/"+e(n.username),data:{password:n.pass,appSettings:n.appSettings,grantedAuthorities:n.grantedAuthorities}})},updateUserData:function(n){return t({method:"PATCH",url:"rest/security/users/"+e(n.username),data:{password:n.pass,appSettings:n.appSettings}})},deleteUser:function(n){return t.delete("rest/security/users/"+e(n))},getFreeAccess:function(){return t.get("rest/security/free-access")},setFreeAccess:function(e){return t.post("rest/security/free-access",e)},getSecurityConfig:function(){return t.get("rest/security/all")},toggleSecurity:function(e){return t.post("rest/security",e?"true":"false")},getRoles:function(){return t.get("rest/roles")},getRolesMapping:function(e){return t.get("rest/roles/mapping",{params:e})},getAuthenticatedUser:function(){return t.get("rest/security/authenticated-user")}};function e(t){return encodeURIComponent(t).replace(/[.!'()*]/g,(function(t){return"%"+t.charCodeAt(0).toString(16)}))}}},function(t,e){!function(t){t.getError=function(t,e,n){if(angular.isObject(t)&&t.status&&t.data)return getError(t.data,e,n);if(e&&403===e)return"Access is restricted";if(t){let r="Generic error";if(angular.isString(t))-1===t.indexOf("<html>")&&(r=t,r=r.replace(/^(([a-z0-9_]+\.)+[a-zA-Z0-9_]+: )+/,""));else if(angular.isObject(t)){if("message"in t&&(r=t.message),"error"in t&&(r=t.error.message),"responseJSON"in t&&"message"in t.responseJSON)return getError(t.responseJSON,e,n);"responseText"in t&&(r=t.responseText)}return n>0&&r.length>n&&(r=r.substr(0,n)+"..."),r}return"There is an error"}}(window)},function(t,e,n){"use strict";n.r(e);n(4),n(17),n(18),n(19),n(14),n(8),n(9),n(15),n(34),n(35),n(12),n(10),n(28);var r=n(2),i=(n(5),n(13),n(29),n(0)),s=(n(20),n(30),n(7));function o(t,e,n,r,i,s,o,a,u,c){function l(){t.getActiveRepository()&&(t.getNamespacesPromise=c.getNamespaces(t.getActiveRepository()).success((function(){h()})),t.getActiveRepositorySize())}function h(){s.isLicenseValid()&&(t.getAutocompletePromise=o.checkAutocompleteStatus())}t.doClear=!1,t.getActiveRepositorySize=function(){const e=r.getActiveRepositoryObject();e&&(t.activeRepositorySizeError=void 0,u.getSize(e).then((function(e){t.activeRepositorySize=e.data})).catch((function(e){t.activeRepositorySizeError=e.data.message})))},t.$on("autocompleteStatus",(function(){h()})),t.$on("repositoryIsSet",l),t.$on("$routeChangeSuccess",(function(t,n,r){r&&(i.isAuthenticated()||i.isFreeAccessEnabled()?l():e.redirectToLogin())})),t.onKeyDown=function(e){27===e.keyCode&&(t.doClear=!0)}}function a(t,e,n,o,a,u,c,l,h,f,p,d,g,m,v,y,b,x,w,S,E,F,A,C,D){t.descr=F.instant("main.gdb.description"),t.documentation="",t.menu=e,t.tutorialState=1!==S.get(E.TUTORIAL_STATE),t.userLoggedIn=!1,t.embedded=u.search().embedded,t.productInfo=f,t.guidePaused="true"===S.get(s.GUIDE_PAUSE);function I(){$(window).width()<=720?($(".container-fluid.main-container").addClass("expanded"),$(".main-menu").addClass("collapsed"),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right"),$(".toggle-menu").hide()):$(window).width()>720&&"collapsedMenu"===S.get(E.MENU_STATE)?($(".container-fluid.main-container").addClass("expanded"),$(".main-menu").addClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right")):($(".container-fluid.main-container").removeClass("expanded"),$(".main-menu").removeClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left"))}!function(){const e=new Date;t.currentYear=e.getFullYear(),t.previousYear=2002}(),$("#repositorySelectDropdown").on("hide.bs.dropdown",(function(t){D.isActive()&&t.preventDefault()})),t.$on("$routeChangeSuccess",(function(e,n,r){t.clicked=!1,$(".menu-element-root").removeClass("active"),p((function(){$(".menu-element.open a.menu-element-root").addClass("active"),$(".main-menu.collapsed .menu-element.open .menu-element-root").addClass("active")}),400),r&&l.checkLicenseStatus()})),t.resumeGuide=function(){h.$broadcast("guideResume")},h.$on("guideReset",(function(){t.guidePaused=!1,h.guidePaused=!1})),h.$on("guideStarted",(function(){t.guidePaused=!1,h.guidePaused=!1})),h.$on("guidePaused",(function(){t.guidePaused=!0,h.guidePaused=!0})),h.$on("$translateChangeSuccess",(function(){t.menu.forEach((function(t){t.label=F.instant(t.labelKey),t.children&&t.children.forEach((function(t){t.label=F.instant(t.labelKey)}))})),h.helpInfo=w.trustAsHtml(Object(i.decodeHTML)(F.instant(h.helpInfo))),h.title=Object(i.decodeHTML)(F.instant(h.title)),t.initTutorial()})),t.checkMenu=function(){return $(".main-menu").hasClass("collapsed")},t.copyToClipboard=function(t){d.openCopyToClipboardModal(t)},t.goToAddRepo=function(){u.path("/repository/create").search({previous:"home"})},t.goToEditRepo=function(t){u.path("repository/edit/"+t.id).search({previous:"home",location:t.location})},t.getLocationFromUri=function(t){return c.getLocationFromUri(t)},t.$on("$locationChangeSuccess",(function(){t.showFooter="/"===u.url()})),t.$on("repositoryIsSet",(function(){t.setRestricted(),S.clearClassHieararchyState()})),t.graphdbVersion=t.engineVersion=f.productVersion,t.workbenchVersion=f.Workbench,t.connectorsVersion=f.connectors,t.sesameVersion=f.sesame,t.select=function(e,n,r){$(".main-menu").hasClass("collapsed")?$(n.target).parents(".menu-element").children(".menu-element-root").hasClass("active")?(t.selected=e,t.clicked=!r):(!$(n.target).parents(".menu-element").hasClass("open")&&r?t.clicked=!0:t.clicked=!r,t.selected===e?t.selected=-1:t.selected=e):(!$(n.target).parents(".menu-element").hasClass("open")&&r?t.clicked=!0:t.clicked=!r,0!==$(n.target).parent(".menu-element").find(".sub-menu").length?($(n.target).parents(".menu-element").children(".menu-element-root").hasClass("active")?$(".sub-menu li.active").parents(".menu-element").children(".menu-element-root").removeClass("active"):$(".sub-menu li.active").parents(".menu-element").children(".menu-element-root").addClass("active"),t.selected===e?t.selected=-1:t.selected=e):(p((function(){$(n.target).parents(".menu-element").children(".menu-element-root").addClass("active")}),50),t.selected=e))},$("body").bind("click",(function(e){!$(e.target).parents(".main-menu").length&&$(".main-menu").hasClass("collapsed")&&(t.clicked=!1,t.selected=-1)})),t.isCurrentPath=function(t){return u.path()==="/"+t},t.isCurrentSubmenuChildPath=function(e){return 0!==e.children.length&&e.children.some((function(e){return t.isCurrentPath(e.href)}))},"/"===u.path()?t.selected=-1:(p((function(){const e=u.path().replace("/",""),n=$('a[href^="'+e+'"]');t.selected=n.closest(".menu-element").index()-1}),200),t.isCurrentPath(u.path())),t.popoverTemplate="js/angular/templates/repositorySize.html",t.securityEnabled=!0,t.isSecurityEnabled=function(){return n.isSecurityEnabled()},t.isFreeAccessEnabled=function(){return n.isFreeAccessEnabled()},t.hasExternalAuthUser=function(){return n.hasExternalAuthUser()},t.isDefaultAuthEnabled=function(){return n.isDefaultAuthEnabled()},t.isUserLoggedIn=function(){return t.userLoggedIn},t.hasActiveLocation=function(){return c.hasActiveLocation()},t.getActiveLocation=function(){return c.getActiveLocation()},t.isLoadingLocation=function(){return c.isLoadingLocation()},t.getRepositories=function(){return c.getRepositories()},t.getReadableRepositories=function(){return c.getReadableRepositories()},t.getWritableRepositories=function(){return c.getWritableRepositories()},t.getActiveRepository=function(){return c.getActiveRepository()},t.canWriteRepoInLocation=function(t){return n.canWriteRepo(t)},t.canWriteActiveRepo=function(t){const e=c.getActiveRepositoryObject();return!!e&&(n.canWriteRepo(e)&&("SYSTEM"!==e.id||!t))},t.getActiveRepositoryObject=function(){return c.getActiveRepositoryObject()},t.getActiveRepositoryShortLocation=function(){const t=c.getActiveRepositoryObject();if(t){const e=t.location;if(e)return"@"+A.shortenIri(e)}return""},t.isActiveRepoOntopType=function(){return c.isActiveRepoOntopType()},t.isActiveRepoFedXType=function(){return c.isActiveRepoFedXType()},t.isLicenseValid=function(){return l.isLicenseValid()},t.setAttrs=function(e){t.attrs=e},t.setRestricted=function(){t.attrs&&(t.isRestricted=t.attrs.hasOwnProperty("license")&&!l.isLicenseValid()||t.attrs.hasOwnProperty("write")&&t.isSecurityEnabled()&&!t.canWriteActiveRepo()||t.attrs.hasOwnProperty("ontop")&&t.isActiveRepoOntopType()||t.attrs.hasOwnProperty("fedx")&&t.isActiveRepoFedXType())},t.toHumanReadableType=function(t){switch(t){case"graphdb":return"Graphdb";case"system":return"System";case"ontop":return"Ontop";case"fedx":return"FedX";default:return"Unknown"}},t.setRepository=function(t){c.setRepository(t)},t.logout=function(){n.clearAuthentication(),a.success("Signed out"),n.freeAccess?c.resetActiveRepository():n.isSecurityEnabled()&&h.redirectToLogin()},t.isAdmin=function(){return t.hasRole(r.UserRole.ROLE_ADMIN)},t.isUser=function(){return t.hasRole(r.UserRole.ROLE_USER)},t.hasRole=function(t){return!!angular.isUndefined(t)||n.hasRole(t)},t.hasPermission=function(){return h.hasPermission()},t.canReadRepo=function(t){return n.canReadRepo(t)},t.checkForWrite=function(t,e){return n.checkForWrite(t,e)},t.setPopoverRepo=function(e){t.popoverRepo=e},t.isRepoActive=function(t){return c.isRepoActive(t)},t.getRepositorySize=function(){t.repositorySize={},t.popoverRepo&&(t.repositorySize.loading=!0,y.getSize(t.popoverRepo).then((function(e){t.repositorySize=e.data})))},t.getDegradedReason=function(){return c.getDegradedReason()},t.canManageRepositories=function(){return n.hasRole(r.UserRole.ROLE_REPO_MANAGER)&&!c.getDegradedReason()},t.getSavedQueries=function(){x.getSavedQueries().success((function(e){t.sampleQueries=e})).error((function(t){const e=getError(t);a.error(e,F.instant("query.editor.get.saved.queries.error"))}))},t.goToSparqlEditor=function(t){u.path("/sparql").search({savedQueryName:t.name,owner:t.owner,execute:!0})},t.declineTutorial=function(){S.set(E.TUTORIAL_STATE,1),t.tutorialState=!1},t.showTutorial=function(){t.tutorialState=!0,S.remove(E.TUTORIAL_STATE)},t.initTutorial=function(){if(!t.tutorialState&&"/"!==u.path())return;t.tutorialInfo=[{title:F.instant("main.info.title.welcome.page"),info:"<p>"+Object(i.decodeHTML)(F.instant("main.info.welcome.page"))+"</p><p>"+Object(i.decodeHTML)(F.instant("main.info.welcome.page.guides"))+"</p><p>"+Object(i.decodeHTML)(F.instant("main.info.welcome.page.footer"))+"</p>"},{title:F.instant("main.info.title.create.repo.page"),info:Object(i.decodeHTML)(F.instant("main.info.create.repo.page",{link:'<a href="https://graphdb.ontotext.com/documentation/'+f.productShortVersion+'/configuring-a-repository.html" target="_blank">'}))},{title:F.instant("main.info.title.load.sample.dataset"),info:F.instant("main.info.load.sample.dataset")},{title:F.instant("main.info.title.run.sparql.query"),info:Object(i.decodeHTML)(F.instant("main.info.run.sparql.query"))},{title:F.instant("menu.rest.api.label"),info:Object(i.decodeHTML)(F.instant("main.info.rest.api"))}],t.activePage=0,$(".pages-wrapper .page-slide").css("opacity",100);const e=$(".main-container")[0].offsetWidth+200;p((function(){const n=$(".pages-wrapper .page-slide");n.css("left",e+"px"),$(n[t.activePage]).css("left","0px"),$($(".btn-toolbar.pull-right .btn-group .btn")[0]).focus()}),50)},t.getTutorialPageHtml=function(t){return w.trustAsHtml(t.info)},t.checkSubMenuPosition=function(t){0===t?$(".main-menu.collapsed .sub-menu").removeClass("align-bottom"):$(window).height()<735?$(".main-menu.collapsed .sub-menu").addClass("align-bottom"):$(".main-menu.collapsed .sub-menu").removeClass("align-bottom")},I(),$(window).resize((function(){angular.isDefined(t.menuState)?$(window).width()<=720?($(".container-fluid.main-container").addClass("expanded"),$(".main-menu").addClass("collapsed"),$(".toggle-menu").hide(),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right")):$(window).width()>720&&t.menuState?$(".toggle-menu").show():($(".container-fluid.main-container").removeClass("expanded"),$(".main-menu").removeClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left")):I(),t.tutorialState&&"/"===u.path()&&t.initTutorial(),$(window).height()<735?($(".sub-menu").addClass("align-bottom"),$(".main-menu.collapsed li:nth-child(2) .sub-menu").removeClass("align-bottom")):$(".sub-menu").removeClass("align-bottom")})),t.slideToPage=function(e){const n=$(".main-container")[0].offsetWidth,r=$(".pages-wrapper .page-slide");r.css("opacity","0").delay(200).css("left",n+"px"),t.activePage=e,$(r[t.activePage]).css("opacity","100").css("left","0px")},t.slideNext=function(){let e=++t.activePage;e>=t.tutorialInfo.length&&(e=0),t.slideToPage(e),$($(".btn-toolbar.pull-right .btn-group .btn")[t.activePage]).focus()},t.toggleNavigation=function(){const e=$(".main-menu"),n=$(".sub-menu li.active");if(e.hasClass("collapsed"))n.parents(".menu-element").hasClass("open")?n.parents(".menu-element").children(".menu-element-root").removeClass("active"):n.parents(".menu-element").children(".menu-element-root").addClass("active"),$(".container-fluid.main-container").removeClass("expanded"),e.removeClass("collapsed"),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left"),h.$broadcast("onToggleNavWidth",!1);else{n.parents(".menu-element").children(".menu-element-root").addClass("active");const r=$(".menu-element");r.hasClass("open")&&(r.removeClass("open"),t.clicked=!1,t.selected=-1),$(".container-fluid.main-container").addClass("expanded"),e.addClass("collapsed"),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right"),$(".main-menu.collapsed .menu-element.clicked").removeClass("clicked"),h.$broadcast("onToggleNavWidth",!0)}},t.$on("onToggleNavWidth",(function(e,n){if(t.menuState=n,n?S.set(E.MENU_STATE,"collapsedMenu"):S.set(E.MENU_STATE,"expandedMenu"),t.tutorialState&&"/"===u.path()){const e=$(".pages-wrapper")[0].offsetWidth+200;p((function(){const n=$(".pages-wrapper .page-slide");n.css("left",e+"px"),$(n[t.activePage]).css("left","0px")}),50)}})),t.numberOfActiveImports=0,t.getNumberOfActiveImportsRunning=!1,t.getNumberOfActiveImports=function(){t.getNumberOfActiveImportsRunning||t.canWriteActiveRepo()&&"SYSTEM"!==t.getActiveRepository()&&(t.getNumberOfActiveImportsRunning=!0,o({method:"GET",url:"rest/repositories/"+t.getActiveRepository()+"/import/active",timeout:1e4}).success((function(e){t.numberOfActiveImports=e})).finally((function(){t.getNumberOfActiveImportsRunning=!1})))},t.getQueriesRunning=!1,t.skipGetQueriesTimes=0;const R=function(){let t=0,e=1;return{next:function(){const n=e;return e=t+e,t=n,n},reset:function(){t=0,e=1}}}();t.getQueries=function(){t.getQueriesRunning||(t.skipGetQueriesTimes>0?t.skipGetQueriesTimes--:c.getActiveRepository()&&"SYSTEM"!==c.getActiveRepository()&&!c.isActiveRepoOntopType()&&t.hasRole(r.UserRole.ROLE_USER)?(t.getQueriesRunning=!0,b.getQueryCount().success((function(e){t.queryCount=e,R.reset()})).error((function(){t.queryCount=0,t.skipGetQueriesTimes=R.next()})).finally((function(){t.getQueriesRunning=!1}))):t.queryCount=0)};const T=g((function(){t.getDegradedReason()||(t.getQueries(),t.getNumberOfActiveImports())}),2e3);t.$on("$destroy",(function(){g.cancel(T)})),n.securityInitialized&&t.getSavedQueries(),t.$on("securityInit",(function(e,r,i,s){t.securityEnabled=r,t.userLoggedIn=i,!r||i||s?(C.when(n.getPrincipal()).then(e=>{t.principal=e,t.isIgnoreSharedQueries=e&&e.appSettings.IGNORE_SHARED_QUERIES}),l.checkLicenseStatus(),t.getSavedQueries()):"/login"!==u.path()&&h.redirectToLogin()})),t.isEnterprise=function(){return"enterprise"===t.getProductType()},t.isFreeEdition=function(){return"free"===t.getProductType()},t.checkEdition=function(e){return null==e||_.indexOf(e,t.getProductType())>=0},t.showLicense=function(){return l.showLicense},t.getLicense=function(){return l.license},t.isLicenseHardcoded=function(){return l.isLicenseHardcoded},t.getProductType=function(){return l.productType},t.getProductTypeHuman=function(){return l.productTypeHuman},t.getHumanReadableSeconds=function(t,e){const n=Math.floor(t/86400),r=Math.floor(t%86400/3600),i=Math.floor(t%3600/60);let s;s=e&&t<10?t<1?_.ceil(t%60,1):_.round(t%60,1):_.round(t%60,0);let o="";return n&&(o+=n+"d "),(n||r)&&(o+=r+"h "),(n||r||i)&&(o+=i+"m "),o+=s+"s",o.replace(/( 0[a-z])+$/,"")},t.getHumanReadableTimestamp=function(t){const e=Date.now(),n=(e-t)/1e3;if(n<60)return F.instant("timestamp.moments.ago");if(n<600)return F.instant("timestamp.minutes.ago");{const r=new Date(e),i=new Date(t);if(r.getYear()===i.getYear()&&r.getMonth()===i.getMonth()&&r.getDate()===i.getDate())return m("date")(t,"'"+F.instant("timestamp.today.at")+"' HH:mm");if(n<86400)return m("date")(t,"'"+F.instant("timestamp.yesterday.at")+"' HH:mm")}return m("date")(t,"'"+F.instant("timestamp.on")+"' yyyy-MM-dd '"+F.instant("timestamp.at")+"' HH:mm")}}function u(t,e,n){t.getRepositorySize=function(e){n.getSize(e).then((function(e){t.size=e.data}))}}angular.module("graphdb.workbench.se.controllers",["graphdb.framework.core.services.jwtauth","graphdb.framework.core.services.repositories","graphdb.framework.core.services.licenseService","ngCookies","ngFileUpload","graphdb.framework.core","graphdb.framework.core.controllers","graphdb.framework.core.directives","graphdb.framework.rest.license.service","graphdb.framework.rest.autocomplete.service","graphdb.framework.rest.repositories.service","graphdb.framework.rest.sparql.service","graphdb.framework.rest.autocomplete.service","graphdb.framework.rest.plugins.service","graphdb.framework.rest.monitoring.service","graphdb.framework.rest.rdf4j.repositories.service","graphdb.framework.utils.localstorageadapter","graphdb.framework.core.services.autocompleteStatus","graphdb.framework.utils.uriutils","graphdb.framework.guides.directives","graphdb.framework.guides.services"]).controller("mainCtrl",a).controller("homeCtrl",o).controller("repositorySizeCtrl",u),o.$inject=["$scope","$rootScope","$http","$repositories","$jwtAuth","$licenseService","AutocompleteRestService","LicenseRestService","RepositoriesRestService","RDF4JRepositoriesRestService"],a.$inject=["$scope","$menuItems","$jwtAuth","$http","toastr","$location","$repositories","$licenseService","$rootScope","productInfo","$timeout","ModalService","$interval","$filter","LicenseRestService","RepositoriesRestService","MonitoringRestService","SparqlRestService","$sce","LocalStorageAdapter","LSKeys","$translate","UriUtils","$q","GuidesService"],u.$inject=["$scope","$http","RepositoriesRestService"]},function(t,e){angular.module("graphdb.framework.rest.locations.service",[]).factory("LocationsRestService",n),n.$inject=["$http"];function n(t){return{getLocations:function(e){return t.get("rest/locations",{timeout:e?e.promise:null})},addLocation:function(e){return t.post("rest/locations",e)},editLocation:function(e){return t.put("rest/locations",e)},deleteLocation:function(e){return t.delete("rest/locations?uri="+e)},getActiveLocation:function(){return t({method:"GET",url:"rest/locations/active",noCancelOnRouteChange:!0})},setDefaultRepository:function(e){return t({url:"rest/locations/active/default-repository",method:"POST",data:{defaultRepository:e}})},getLocationRpcAddress:function(e){return t.get("rest/info/rpc-address",{params:{location:e}})}}}},function(t,e){angular.module("graphdb.framework.core.services.licenseService",[]).service("$licenseService",["$rootScope","LicenseRestService","$translate",function(t,e,n){const r=this;this.checkLicenseStatus=function(){r.loadingLicense=!0,e.getHardcodedLicense().success((function(t){r.isLicenseHardcoded="true"===t})).error((function(){r.isLicenseHardcoded=!0})).then((function(){e.getLicenseInfo().then((function(t){r.license=t.data,r.showLicense=!0,r.loadingLicense=!1,i(r.license)}),(function(){r.license={message:n.instant("no.license.set.msg"),valid:!1},r.showLicense=!0,r.loadingLicense=!1,i(r.license)}))}))};const i=function(t){r.productType=t.productType,"standard"===r.productType?r.productTypeHuman="Standard":"enterprise"===r.productType?r.productTypeHuman="Enterprise":"free"===r.productType?r.productTypeHuman="Free":"graphdb"===r.productType&&(r.productTypeHuman="GraphDB")};this.checkLicenseStatus(),this.isLicenseValid=function(){return r.license&&r.license.valid}}])},function(t,e){angular.module("graphdb.framework.core.services.autocompleteStatus",[]).service("$autocompleteStatus",["$rootScope","AutocompleteRestService","LocalStorageAdapter","LSKeys","$repositories",function(t,e,n,r,i){const s=this;this.setAutocompleteStatus=function(e){n.set(r.AUTOCOMPLETE_ENABLED,e),t.$broadcast("autocompleteStatus",e)},t.$watch((function(){return n.get(r.AUTOCOMPLETE_ENABLED)}),(function(t){s.setAutocompleteStatus(t)}),!0),t.$on("repositoryIsSet",(function(){!i.getActiveRepository()||i.isActiveRepoOntopType()||i.isActiveRepoFedXType()||e.checkAutocompleteStatus().success((function(t){s.setAutocompleteStatus(t)}))}))}])},function(t,e){angular.module("graphdb.framework.guides.directives",[]).directive("guideSelector",(function(){return{}}))},function(t,e){
|
|
29
29
|
/**
|
|
30
30
|
* angular-cancel-on-navigate - AngularJS module that cancels HTTP requests on location change (navigation)
|
|
31
31
|
* @version v0.1.0
|
|
@@ -37,14 +37,14 @@ var at=function(){var t=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?
|
|
|
37
37
|
*/
|
|
38
38
|
angular.module("angularCancelOnNavigateModule",[]).config(["$httpProvider",function(t){t.interceptors.push("HttpRequestTimeoutInterceptor")}]).run(["$rootScope","HttpPendingRequestsService",function(t,e){t.$on("$locationChangeSuccess",(function(t,n,r){const i=new URL(n),s=new URL(r);i.origin===s.origin&&i.pathname===s.pathname||e.cancelAll()}))}]),angular.module("angularCancelOnNavigateModule").service("HttpPendingRequestsService",["$q",function(t){const e=[];return{newTimeout:function(){const n=t.defer();return e.push(n),n.promise},cancelAll:function(){angular.forEach(e,(function(t){t.promise.isGloballyCancelled=!0,t.resolve()})),e.length=0}}}]),angular.module("angularCancelOnNavigateModule").factory("HttpRequestTimeoutInterceptor",["$q","HttpPendingRequestsService",function(t,e){return{request:function(t){const n=t||{};return void 0!==n.timeout||n.noCancelOnRouteChange||(n.timeout=e.newTimeout()),n},responseError:function(e){return e.config.timeout&&e.config.timeout.isGloballyCancelled?t.defer().promise:t.reject(e)}}}])},function(t,e,n){"use strict";n.r(e);var r=n(0);function i(t,e,n,i,s,o,a,u,c,l){return{templateUrl:"js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html",restrict:"AE",link:function(s,h){function f(){u.isLicenseValid()&&(s.getAutocompletePromise=n.checkAutocompleteStatus())}function p(t){"search-box"===t.target.id||$(t.target).closest("#search-box").length||s.hideInput()}s.$on("autocompleteStatus",(function(){f()})),s.$on("repositoryIsSet",(function(){s.getActiveRepository()&&(s.getNamespacesPromise=i.getNamespaces(s.getActiveRepository()).success((function(){f()})))})),s.getActiveRepository=function(){return o.getActiveRepository()},s.showInput=function(){new Promise(t=>{h.find(".search-rdf-btn").addClass("hidden-xs-up"),h.find(".search-rdf-input").addClass("show-rdf-search-box"),e((function(){h.find(".close-rdf-search-btn").removeClass("hidden-xs-up"),h.find("search-resource-input .view-res-input").focus(),window.addEventListener("mousedown",p)}),200),s.isHomePage()?($("#search-resource-input-home input").focus(),c.info(Object(r.decodeHTML)(l.instant("search.resource.current.page.msg")),l.instant("search.resources.msg"),{allowHtml:!0})):(h.find(".search-rdf-btn").addClass("hidden-xs-up"),h.find(".search-rdf-input").addClass("show-rdf-search-box"),e((function(){h.find(".close-rdf-search-btn").removeClass("hidden-xs-up"),h.find("search-resource-input .view-res-input").focus(),window.addEventListener("mousedown",p)}),200)),setTimeout(()=>{t(!0)})}).then((function(){t.$broadcast("rdfResourceSearchExpanded")}))},s.hideInput=function(){h.find(".search-rdf-input").removeClass("show-rdf-search-box"),h.find(".close-rdf-search-btn").addClass("hidden-xs-up"),e((function(){h.find(".search-rdf-btn").removeClass("hidden-xs-up"),h.blur(),window.removeEventListener("mousedown",p)}),200)},s.onKeyDown=function(t){27===t.keyCode&&s.hideInput()},s.isHomePage=function(){return"/"===a.url()},s.isNotLoading=function(){return!s.isLoadingLocation()||s.isLoadingLocation()&&"/repository"===a.url()}}}}angular.module("graphdb.framework.core.directives.rdfresourcesearch.rdfresourcesearch",[]).directive("rdfResourceSearch",i),i.$inject=["$rootScope","$timeout","AutocompleteRestService","RDF4JRepositoriesRestService","RepositoriesRestService","$repositories","$location","$licenseService","toastr","$translate"]},function(t,e,n){"use strict";n.r(e);n(5);function r(t,e,n,r){return{templateUrl:"js/angular/core/directives/languageselector/templates/languageSelector.html",restrict:"E",link:function(i){const s=e.get(n.PREFERRED_LANG),o=navigator.languages;i.selectedLang={},i.languages=[{key:"en",name:"English"},{key:"fr",name:"Français"}],t.fallbackLanguage("en"),i.changeLanguage=function(s){i.selectedLang=s,t.use(s.key),e.set(n.PREFERRED_LANG,s.key),r.setLanguage(i.selectedLang.key),i.$broadcast("language-changed",{locale:s.key})},i.getLanguageTooltip=function(e){return e&&i.selectedLang?i.selectedLang.key!==e.key?t.instant("change.language.tooltip",{},void 0,e.key)+" "+e.name:t.instant("current.language.tooltip",{},void 0,e.key):""},new Promise(t=>{if(s)i.selectedLang=i.languages.find(t=>t.key===s);else if(o)for(let t of o)if(i.selectedLang=i.languages.find(e=>e.key===t),i.selectedLang)break;setTimeout(()=>{t(!0)})}).then((function(){i.selectedLang||(i.selectedLang=i.languages.find(t=>"en"===t.key)),t.use(i.selectedLang.key),r.setLanguage(i.selectedLang.key)}))}}}angular.module("graphdb.framework.core.directives.languageselector.languageselector",["graphdb.framework.utils.localstorageadapter"]).directive("languageSelector",r).service("$languageService",[function(){this.language="en",this.setLanguage=function(t){this.language=t},this.getLanguage=function(){return this.language}}]),r.$inject=["$translate","LocalStorageAdapter","LSKeys","$languageService"]},function(t,e){var n;
|
|
39
39
|
/*! 12.2.13 */
|
|
40
|
-
!window.XMLHttpRequest||window.FileAPI&&FileAPI.shouldLoad||(window.XMLHttpRequest.prototype.setRequestHeader=(n=window.XMLHttpRequest.prototype.setRequestHeader,function(t,e){if("__setXHR_"===t){var r=e(this);r instanceof Function&&r(this)}else n.apply(this,arguments)}));var r=angular.module("ngFileUpload",[]);r.version="12.2.13",r.service("UploadBase",["$http","$q","$timeout",function(t,e,n){function i(r){function i(t){c.notify&&c.notify(t),l.progressFunc&&n((function(){l.progressFunc(t)}))}function s(t){return null!=r._start&&a?{loaded:t.loaded+r._start,total:r._file&&r._file.size||t.total,type:t.type,config:r,lengthComputable:!0,target:t.target}:t}function u(){t(r).then((function(t){if(a&&r._chunkSize&&!r._finished&&r._file){var e=r._file&&r._file.size||0;i({loaded:Math.min(r._end,e),total:e,config:r,type:"progress"}),o.upload(r,!0)}else r._finished&&delete r._finished,c.resolve(t)}),(function(t){c.reject(t)}),(function(t){c.notify(t)}))}r.method=r.method||"POST",r.headers=r.headers||{};var c=r._deferred=r._deferred||e.defer(),l=c.promise;return r.disableProgress||(r.headers.__setXHR_=function(){return function(t){t&&t.upload&&t.upload.addEventListener&&(r.__XHR=t,r.xhrFn&&r.xhrFn(t),t.upload.addEventListener("progress",(function(t){t.config=r,i(s(t))}),!1),t.upload.addEventListener("load",(function(t){t.lengthComputable&&(t.config=r,i(s(t)))}),!1))}}),a?r._chunkSize&&r._end&&!r._finished?(r._start=r._end,r._end+=r._chunkSize,u()):r.resumeSizeUrl?t.get(r.resumeSizeUrl).then((function(t){r._start=r.resumeSizeResponseReader?r.resumeSizeResponseReader(t.data):parseInt((null==t.data.size?t.data:t.data.size).toString()),r._chunkSize&&(r._end=r._start+r._chunkSize),u()}),(function(t){throw t})):r.resumeSize?r.resumeSize().then((function(t){r._start=t,r._chunkSize&&(r._end=r._start+r._chunkSize),u()}),(function(t){throw t})):(r._chunkSize&&(r._start=0,r._end=r._start+r._chunkSize),u()):u(),l.success=function(t){return l.then((function(e){t(e.data,e.status,e.headers,r)})),l},l.error=function(t){return l.then(null,(function(e){t(e.data,e.status,e.headers,r)})),l},l.progress=function(t){return l.progressFunc=t,l.then(null,null,(function(e){t(e)})),l},l.abort=l.pause=function(){return r.__XHR&&n((function(){r.__XHR.abort()})),l},l.xhr=function(t){return r.xhrFn=function(e){return function(){e&&e.apply(l,arguments),t.apply(l,arguments)}}(r.xhrFn),l},o.promisesCount++,l.finally&&l.finally instanceof Function&&l.finally((function(){o.promisesCount--})),l}function s(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var o=this;o.promisesCount=0,this.isResumeSupported=function(){return window.Blob&&window.Blob.prototype.slice};var a=this.isResumeSupported();this.isUploadInProgress=function(){return o.promisesCount>0},this.rename=function(t,e){return t.ngfName=e,t},this.jsonBlob=function(t){null==t||angular.isString(t)||(t=JSON.stringify(t));var e=new window.Blob([t],{type:"application/json"});return e._ngfBlob=!0,e},this.json=function(t){return angular.toJson(t)},this.isFile=function(t){return null!=t&&(t instanceof window.Blob||t.flashId&&t.name&&t.size)},this.upload=function(t,e){function n(e,n){if(e._ngfBlob)return e;if(t._file=t._file||e,null!=t._start&&a){t._end&&t._end>=e.size&&(t._finished=!0,t._end=e.size);var r=e.slice(t._start,t._end||e.size);return r.name=e.name,r.ngfName=e.ngfName,t._chunkSize&&(n.append("_chunkSize",t._chunkSize),n.append("_currentChunkSize",t._end-t._start),n.append("_chunkNumber",Math.floor(t._start/t._chunkSize)),n.append("_totalSize",t._file.size)),r}return e}function r(e,i,s){if(void 0!==i)if(angular.isDate(i)&&(i=i.toISOString()),angular.isString(i))e.append(s,i);else if(o.isFile(i)){var a=n(i,e),u=s.split(",");u[1]&&(a.ngfName=u[1].replace(/^\s+|\s+$/g,""),s=u[0]),t._fileKey=t._fileKey||s,e.append(s,a,a.ngfName||a.name)}else if(angular.isObject(i)){if(i.$$ngfCircularDetection)throw"ngFileUpload: Circular reference in config.data. Make sure specified data for Upload.upload() has no circular reference: "+s;i.$$ngfCircularDetection=!0;try{for(var c in i)if(i.hasOwnProperty(c)&&"$$ngfCircularDetection"!==c){var l=null==t.objectKey?"[i]":t.objectKey;i.length&&parseInt(c)>-1&&(l=null==t.arrayKey?l:t.arrayKey),r(e,i[c],s+l.replace(/[ik]/g,c))}}finally{delete i.$$ngfCircularDetection}}else e.append(s,i)}return e||(t=s(t)),t._isDigested||(t._isDigested=!0,t._chunkSize=o.translateScalars(t.resumeChunkSize),t._chunkSize=t._chunkSize?parseInt(t._chunkSize.toString()):null,t.headers=t.headers||{},t.headers["Content-Type"]=void 0,t.transformRequest=t.transformRequest?angular.isArray(t.transformRequest)?t.transformRequest:[t.transformRequest]:[],t.transformRequest.push((function(e){var n,i=new window.FormData;for(n in e=e||t.fields||{},t.file&&(e.file=t.file),e)if(e.hasOwnProperty(n)){var s=e[n];t.formDataAppender?t.formDataAppender(i,n,s):r(i,s,n)}return i}))),i(t)},this.http=function(e){return(e=s(e)).transformRequest=e.transformRequest||function(e){return window.ArrayBuffer&&e instanceof window.ArrayBuffer||e instanceof window.Blob?e:t.defaults.transformRequest[0].apply(this,arguments)},e._chunkSize=o.translateScalars(e.resumeChunkSize),e._chunkSize=e._chunkSize?parseInt(e._chunkSize.toString()):null,i(e)},this.translateScalars=function(t){if(angular.isString(t)){if(t.search(/kb/i)===t.length-2)return parseFloat(1024*t.substring(0,t.length-2));if(t.search(/mb/i)===t.length-2)return parseFloat(1048576*t.substring(0,t.length-2));if(t.search(/gb/i)===t.length-2)return parseFloat(1073741824*t.substring(0,t.length-2));if(t.search(/b/i)===t.length-1)return parseFloat(t.substring(0,t.length-1));if(t.search(/s/i)===t.length-1)return parseFloat(t.substring(0,t.length-1));if(t.search(/m/i)===t.length-1)return parseFloat(60*t.substring(0,t.length-1));if(t.search(/h/i)===t.length-1)return parseFloat(3600*t.substring(0,t.length-1))}return t},this.urlToBlob=function(n){var r=e.defer();return t({url:n,method:"get",responseType:"arraybuffer"}).then((function(t){var e=new Uint8Array(t.data),i=t.headers("content-type")||"image/WebP",s=new window.Blob([e],{type:i}),o=n.match(/.*\/(.+?)(\?.*)?$/);o.length>1&&(s.name=o[1]),r.resolve(s)}),(function(t){r.reject(t)})),r.promise},this.setDefaults=function(t){this.defaults=t||{}},this.defaults={},this.version=r.version}]),r.service("Upload",["$parse","$timeout","$compile","$q","UploadExif",function(t,e,n,r,i){function s(t,e,n){var i=[u.emptyPromise()];return angular.forEach(t,(function(r,s){0===r.type.indexOf("image/jpeg")&&u.attrGetter("ngfFixOrientation",e,n,{$file:r})&&i.push(u.happyPromise(u.applyExifRotation(r),r).then((function(e){t.splice(s,1,e)})))})),r.all(i)}function o(t,e,n,i){var s=u.attrGetter("ngfResize",e,n);if(!s||!u.isResizeSupported()||!t.length)return u.emptyPromise();if(s instanceof Function){var o=r.defer();return s(t).then((function(r){a(r,t,e,n,i).then((function(t){o.resolve(t)}),(function(t){o.reject(t)}))}),(function(t){o.reject(t)}))}return a(s,t,e,n,i)}function a(t,e,n,i,s){function o(r,o){if(0===r.type.indexOf("image")){if(t.pattern&&!u.validatePattern(r,t.pattern))return;t.resizeIf=function(t,e){return u.attrGetter("ngfResizeIf",n,i,{$width:t,$height:e,$file:r})};var c=u.resize(r,t);a.push(c),c.then((function(t){e.splice(o,1,t)}),(function(t){r.$error="resize",(r.$errorMessages=r.$errorMessages||{}).resize=!0,r.$errorParam=(t?(t.message?t.message:t)+": ":"")+(r&&r.name),s.$ngfValidations.push({name:"resize",valid:!1}),u.applyModelValidation(s,e)}))}}for(var a=[u.emptyPromise()],c=0;c<e.length;c++)o(e[c],c);return r.all(a)}var u=i;return u.getAttrWithDefaults=function(t,e){if(null!=t[e])return t[e];var n=u.defaults[e];return null==n||angular.isString(n)?n:JSON.stringify(n)},u.attrGetter=function(e,n,r,i){var s=this.getAttrWithDefaults(n,e);if(!r)return s;try{return i?t(s)(r,i):t(s)(r)}catch(t){if(e.search(/min|max|pattern/i))return s;throw t}},u.shouldUpdateOn=function(t,e,n){var r=u.attrGetter("ngfModelOptions",e,n);return!r||!r.updateOn||r.updateOn.split(" ").indexOf(t)>-1},u.emptyPromise=function(){var t=r.defer(),n=arguments;return e((function(){t.resolve.apply(t,n)})),t.promise},u.rejectPromise=function(){var t=r.defer(),n=arguments;return e((function(){t.reject.apply(t,n)})),t.promise},u.happyPromise=function(t,n){var i=r.defer();return t.then((function(t){i.resolve(t)}),(function(t){e((function(){throw t})),i.resolve(n)})),i.promise},u.updateModel=function(n,r,i,a,c,l,h){function f(s,o,c,h,f){r.$$ngfPrevValidFiles=s,r.$$ngfPrevInvalidFiles=o;var p=s&&s.length?s[0]:null,d=o&&o.length?o[0]:null;n&&(u.applyModelValidation(n,s),n.$setViewValue(f?p:s)),a&&t(a)(i,{$files:s,$file:p,$newFiles:c,$duplicateFiles:h,$invalidFiles:o,$invalidFile:d,$event:l});var g=u.attrGetter("ngfModelInvalid",r);g&&e((function(){t(g).assign(i,f?d:o)})),e((function(){}))}function p(){function t(){e((function(){f(w?g.concat(b):b,w?m.concat(y):y,c,v,x)}),E&&E.debounce?E.debounce.change||E.debounce:0)}var s=S?d:b;o(s,r,i,n).then((function(){S?u.validate(d,w?g.length:0,n,r,i).then((function(e){b=e.validsFiles,y=e.invalidsFiles,t()})):t()}),(function(){for(var e=0;e<s.length;e++){var n=s[e];if("resize"===n.$error){var r=b.indexOf(n);r>-1&&(b.splice(r,1),y.push(n)),t()}}}))}var d,g,m,v=[],y=[],b=[];g=r.$$ngfPrevValidFiles||[],m=r.$$ngfPrevInvalidFiles||[],n&&n.$modelValue&&(g=function(t){return angular.isArray(t)?t:[t]}(n.$modelValue));var w=u.attrGetter("ngfKeep",r,i);d=(c||[]).slice(0),("distinct"===w||!0===u.attrGetter("ngfKeepDistinct",r,i))&&function(){function t(t,e){return t.name===e.name&&(t.$ngfOrigSize||t.size)===(e.$ngfOrigSize||e.size)&&t.type===e.type}function e(e){var n;for(n=0;n<g.length;n++)if(t(e,g[n]))return!0;for(n=0;n<m.length;n++)if(t(e,m[n]))return!0;return!1}if(c){d=[],v=[];for(var n=0;n<c.length;n++)e(c[n])?v.push(c[n]):d.push(c[n])}}();var x=!w&&!u.attrGetter("ngfMultiple",r,i)&&!u.attrGetter("multiple",r);if(!w||d.length){u.attrGetter("ngfBeforeModelChange",r,i,{$files:c,$file:c&&c.length?c[0]:null,$newFiles:d,$duplicateFiles:v,$event:l});var S=u.attrGetter("ngfValidateAfterResize",r,i),E=u.attrGetter("ngfModelOptions",r,i);u.validate(d,w?g.length:0,n,r,i).then((function(t){h?f(d,[],c,v,x):(E&&E.allowInvalid||S?b=d:(b=t.validFiles,y=t.invalidFiles),u.attrGetter("ngfFixOrientation",r,i)&&u.isExifSupported()?s(b,r,i).then((function(){p()})):p())}))}},u}]),r.directive("ngfSelect",["$parse","$timeout","$compile","Upload",function(t,e,n,r){function i(t){var e=t.match(/Android[^\d]*(\d+)\.(\d+)/);if(e&&e.length>2){var n=r.defaults.androidFixMinorVersion||4;return parseInt(e[1])<4||parseInt(e[1])===n&&parseInt(e[2])<n}return-1===t.indexOf("Chrome")&&/.*Windows.*Safari.*/.test(t)}function s(t,e,n,r,s,a,u,c){function l(){return"input"===e[0].tagName.toLowerCase()&&n.type&&"file"===n.type.toLowerCase()}function h(){return g("ngfChange")||g("ngfSelect")}function f(e){if(c.shouldUpdateOn("change",n,t)){var i=e.__files_||e.target&&e.target.files,s=[];if(!i)return;for(var o=0;o<i.length;o++)s.push(i[o]);c.updateModel(r,n,t,h(),s.length?s:null,e)}}function p(t,r){function i(e){t.attr("id","ngf-"+e),r.attr("id","ngf-label-"+e)}for(var s=0;s<e[0].attributes.length;s++){var o=e[0].attributes[s];"type"!==o.name&&"class"!==o.name&&"style"!==o.name&&("id"===o.name?(i(o.value),m.push(n.$observe("id",i))):t.attr(o.name,o.value||"required"!==o.name&&"multiple"!==o.name?o.value:o.name))}}function d(e){c.shouldUpdateOn("click",n,t)&&b.val()&&(b.val(null),c.updateModel(r,n,t,h(),null,e,!0))}var g=function(t,e){return c.attrGetter(t,n,e)};c.registerModelChangeValidator(r,n,t);var m=[];g("ngfMultiple")&&m.push(t.$watch(g("ngfMultiple"),(function(){b.attr("multiple",g("ngfMultiple",t))}))),g("ngfCapture")&&m.push(t.$watch(g("ngfCapture"),(function(){b.attr("capture",g("ngfCapture",t))}))),g("ngfAccept")&&m.push(t.$watch(g("ngfAccept"),(function(){b.attr("accept",g("ngfAccept",t))}))),m.push(n.$observe("accept",(function(){b.attr("accept",g("accept"))})));var v=0,y=0,b=e;l()||(b=function(){if(l())return e;var t=angular.element('<input type="file">'),n=angular.element("<label>upload</label>");return n.css("visibility","hidden").css("position","absolute").css("overflow","hidden").css("width","0px").css("height","0px").css("border","none").css("margin","0px").css("padding","0px").attr("tabindex","-1"),p(t,n),o.push({el:e,ref:n}),document.body.appendChild(n.append(t)[0]),t}()),b.bind("change",f),l()?e.bind("click",d):e.bind("click touchstart touchend",(function(n){if(e.attr("disabled"))return!1;if(!g("ngfSelectDisabled",t)){var r=function(t){var e=t.changedTouches||t.originalEvent&&t.originalEvent.changedTouches;if(e){if("touchstart"===t.type)return y=e[0].clientX,v=e[0].clientY,!0;if("touchend"===t.type){var n=e[0].clientX,r=e[0].clientY;if(Math.abs(n-y)>20||Math.abs(r-v)>20)return t.stopPropagation(),t.preventDefault(),!1}return!0}}(n);if(null!=r)return r;d(n);try{l()||document.body.contains(b[0])||(o.push({el:e,ref:b.parent()}),document.body.appendChild(b.parent()[0]),b.bind("change",f))}catch(t){}return i(navigator.userAgent)?setTimeout((function(){b[0].click()}),0):b[0].click(),!1}})),-1!==navigator.appVersion.indexOf("MSIE 10")&&b.bind("click",(function t(e){if(b&&!b.attr("__ngf_ie10_Fix_")){if(!b[0].parentNode)return void(b=null);e.preventDefault(),e.stopPropagation(),b.unbind("click");var n=b.clone();return b.replaceWith(n),(b=n).attr("__ngf_ie10_Fix_","true"),b.bind("change",f),b.bind("click",t),b[0].click(),!1}b.removeAttr("__ngf_ie10_Fix_")})),r&&r.$formatters.push((function(t){return(null==t||0===t.length)&&b.val()&&b.val(null),t})),t.$on("$destroy",(function(){l()||b.parent().remove(),angular.forEach(m,(function(t){t()}))})),a((function(){for(var t=0;t<o.length;t++){var e=o[t];document.body.contains(e.el[0])||(o.splice(t,1),e.ref.remove())}})),window.FileAPI&&window.FileAPI.ngfFixIE&&window.FileAPI.ngfFixIE(e,b,f)}var o=[];return{restrict:"AEC",require:"?ngModel",link:function(t,n,i,o){s(t,n,i,o,0,e,0,r)}}}]),function(){function t(t,e,n,r,i,s,o,a){function u(s){var o=t.attrGetter("ngfNoObjectUrl",i,n);t.dataUrl(s,o).finally((function(){e((function(){var t=(o?s.$ngfDataUrl:s.$ngfBlobUrl)||s.$ngfDataUrl;a?r.css("background-image","url('"+(t||"")+"')"):r.attr("src",t),t?r.removeClass("ng-hide"):r.addClass("ng-hide")}))}))}e((function(){var e=n.$watch(i[s],(function(e){var c=o;if("ngfThumbnail"===s&&(c||(c={width:r[0].naturalWidth||r[0].clientWidth,height:r[0].naturalHeight||r[0].clientHeight}),0===c.width&&window.getComputedStyle)){var l=getComputedStyle(r[0]);l.width&&l.width.indexOf("px")>-1&&l.height&&l.height.indexOf("px")>-1&&(c={width:parseInt(l.width.slice(0,-2)),height:parseInt(l.height.slice(0,-2))})}return angular.isString(e)?(r.removeClass("ng-hide"),a?r.css("background-image","url('"+e+"')"):r.attr("src",e)):void(!e||!e.type||0!==e.type.search(function(t){return"img"===t.tagName.toLowerCase()?"image":"audio"===t.tagName.toLowerCase()?"audio":"video"===t.tagName.toLowerCase()?"video":/./}(r[0]))||a&&0!==e.type.indexOf("image")?r.addClass("ng-hide"):c&&t.isResizeSupported()?(c.resizeIf=function(r,s){return t.attrGetter("ngfResizeIf",i,n,{$width:r,$height:s,$file:e})},t.resize(e,c).then((function(t){u(t)}),(function(t){throw t}))):u(e))}));n.$on("$destroy",(function(){e()}))}))}r.service("UploadDataUrl",["UploadBase","$timeout","$q",function(t,e,n){var r=t;return r.base64DataUrl=function(t){if(angular.isArray(t)){var e=n.defer(),i=0;return angular.forEach(t,(function(n){r.dataUrl(n,!0).finally((function(){if(++i===t.length){var n=[];angular.forEach(t,(function(t){n.push(t.$ngfDataUrl)})),e.resolve(n,t)}}))})),e.promise}return r.dataUrl(t,!0)},r.dataUrl=function(t,i){if(!t)return r.emptyPromise(t,t);if(i&&null!=t.$ngfDataUrl||!i&&null!=t.$ngfBlobUrl)return r.emptyPromise(i?t.$ngfDataUrl:t.$ngfBlobUrl,t);var s=i?t.$$ngfDataUrlPromise:t.$$ngfBlobUrlPromise;if(s)return s;var o=n.defer();return e((function(){if(window.FileReader&&t&&(!window.FileAPI||-1===navigator.userAgent.indexOf("MSIE 8")||t.size<2e4)&&(!window.FileAPI||-1===navigator.userAgent.indexOf("MSIE 9")||t.size<4e6)){var n=window.URL||window.webkitURL;if(n&&n.createObjectURL&&!i){var s;try{s=n.createObjectURL(t)}catch(n){return void e((function(){t.$ngfBlobUrl="",o.reject()}))}e((function(){if(t.$ngfBlobUrl=s,s){o.resolve(s,t),r.blobUrls=r.blobUrls||[],r.blobUrlsTotalSize=r.blobUrlsTotalSize||0,r.blobUrls.push({url:s,size:t.size}),r.blobUrlsTotalSize+=t.size||0;for(var e=r.defaults.blobUrlsMaxMemory||268435456,i=r.defaults.blobUrlsMaxQueueSize||200;(r.blobUrlsTotalSize>e||r.blobUrls.length>i)&&r.blobUrls.length>1;){var a=r.blobUrls.splice(0,1)[0];n.revokeObjectURL(a.url),r.blobUrlsTotalSize-=a.size}}}))}else{var a=new FileReader;a.onload=function(n){e((function(){t.$ngfDataUrl=n.target.result,o.resolve(n.target.result,t),e((function(){delete t.$ngfDataUrl}),1e3)}))},a.onerror=function(){e((function(){t.$ngfDataUrl="",o.reject()}))},a.readAsDataURL(t)}}else e((function(){t[i?"$ngfDataUrl":"$ngfBlobUrl"]="",o.reject()}))})),(s=i?t.$$ngfDataUrlPromise=o.promise:t.$$ngfBlobUrlPromise=o.promise).finally((function(){delete t[i?"$$ngfDataUrlPromise":"$$ngfBlobUrlPromise"]})),s},r}]),r.directive("ngfSrc",["Upload","$timeout",function(e,n){return{restrict:"AE",link:function(r,i,s){t(e,n,r,i,s,"ngfSrc",e.attrGetter("ngfResize",s,r),!1)}}}]),r.directive("ngfBackground",["Upload","$timeout",function(e,n){return{restrict:"AE",link:function(r,i,s){t(e,n,r,i,s,"ngfBackground",e.attrGetter("ngfResize",s,r),!0)}}}]),r.directive("ngfThumbnail",["Upload","$timeout",function(e,n){return{restrict:"AE",link:function(r,i,s){var o=e.attrGetter("ngfSize",s,r);t(e,n,r,i,s,"ngfThumbnail",o,e.attrGetter("ngfAsBackground",s,r))}}}]),r.config(["$compileProvider",function(t){t.imgSrcSanitizationWhitelist&&t.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|webcal|local|file|data|blob):/),t.aHrefSanitizationWhitelist&&t.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|webcal|local|file|data|blob):/)}]),r.filter("ngfDataUrl",["UploadDataUrl","$sce",function(t,e){return function(n,r,i){if(angular.isString(n))return e.trustAsResourceUrl(n);var s=n&&((r?n.$ngfDataUrl:n.$ngfBlobUrl)||n.$ngfDataUrl);return n&&!s?(!n.$ngfDataUrlFilterInProgress&&angular.isObject(n)&&(n.$ngfDataUrlFilterInProgress=!0,t.dataUrl(n,r)),""):(n&&delete n.$ngfDataUrlFilterInProgress,(n&&s?i?e.trustAsResourceUrl(s):s:n)||"")}}])}(),r.service("UploadValidate",["UploadDataUrl","$q","$timeout",function(t,e,n){var r=t;return r.validatePattern=function(t,e){if(!e)return!0;var n=function t(e){var n="",r=[];if(e.length>2&&"/"===e[0]&&"/"===e[e.length-1])n=e.substring(1,e.length-1);else{var i=e.split(",");if(i.length>1)for(var s=0;s<i.length;s++){var o=t(i[s]);o.regexp?(n+="("+o.regexp+")",s<i.length-1&&(n+="|")):r=r.concat(o.excludes)}else 0===e.indexOf("!")?r.push("^((?!"+t(e.substring(1)).regexp+").)*$"):(0===e.indexOf(".")&&(e="*"+e),n=(n="^"+e.replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]","g"),"\\$&")+"$").replace(/\\\*/g,".*").replace(/\\\?/g,"."))}return{regexp:n,excludes:r}}(e),r=!0;if(n.regexp&&n.regexp.length){var i=new RegExp(n.regexp,"i");r=null!=t.type&&i.test(t.type)||null!=t.name&&i.test(t.name)}for(var s=n.excludes.length;s--;){var o=new RegExp(n.excludes[s],"i");r=r&&(null==t.type||o.test(t.type))&&(null==t.name||o.test(t.name))}return r},r.ratioToFloat=function(t){var e=t.toString(),n=e.search(/[x:]/i);return n>-1?parseFloat(e.substring(0,n))/parseFloat(e.substring(n+1)):parseFloat(e)},r.registerModelChangeValidator=function(t,e,n){t&&t.$formatters.push((function(i){if(t.$dirty){var s=i;i&&!angular.isArray(i)&&(s=[i]),r.validate(s,0,t,e,n).then((function(){r.applyModelValidation(t,s)}))}return i}))},r.applyModelValidation=function(t,e){(function(t,e){null==e||t.$dirty||(t.$setDirty?t.$setDirty():t.$dirty=!0)})(t,e),angular.forEach(t.$ngfValidations,(function(e){t.$setValidity(e.name,e.valid)}))},r.getValidationAttr=function(t,e,n,i,s){var o="ngf"+n[0].toUpperCase()+n.substr(1),a=r.attrGetter(o,t,e,{$file:s});if(null==a&&(a=r.attrGetter("ngfValidate",t,e,{$file:s}))){var u=(i||n).split(".");a=a[u[0]],u.length>1&&(a=a&&a[u[1]])}return a},r.validate=function(t,n,i,s,o){function a(e,n,a){if(t){for(var u=t.length,c=null;u--;){var p=t[u];if(p){var d=r.getValidationAttr(s,o,e,n,p);null!=d&&(a(p,d,u)||(-1===l.indexOf(e)?(p.$error=e,(p.$errorMessages=p.$errorMessages||{})[e]=!0,p.$errorParam=d,-1===f.indexOf(p)&&f.push(p),h||t.splice(u,1),c=!1):t.splice(u,1)))}}null!==c&&i.$ngfValidations.push({name:e,valid:c})}}function u(n,a,u,p,d){function g(e,r,i){function s(s){if(s())if(-1===l.indexOf(n)){if(r.$error=n,(r.$errorMessages=r.$errorMessages||{})[n]=!0,r.$errorParam=i,-1===f.indexOf(r)&&f.push(r),!h){var o=t.indexOf(r);o>-1&&t.splice(o,1)}e.resolve(!1)}else{var a=t.indexOf(r);a>-1&&t.splice(a,1),e.resolve(!0)}else e.resolve(!0)}null!=i?p(r,i).then((function(t){s((function(){return!d(t,i)}))}),(function(){s((function(){return c("ngfValidateForce",{$file:r})}))})):e.resolve(!0)}var m=[r.emptyPromise(!0)];t&&(t=void 0===t.length?[t]:t,angular.forEach(t,(function(t){var i=e.defer();return m.push(i.promise),!u||null!=t.type&&0===t.type.search(u)?void("dimensions"===n&&null!=r.attrGetter("ngfDimensions",s)?r.imageDimensions(t).then((function(e){g(i,t,c("ngfDimensions",{$file:t,$width:e.width,$height:e.height}))}),(function(){i.resolve(!1)})):"duration"===n&&null!=r.attrGetter("ngfDuration",s)?r.mediaDuration(t).then((function(e){g(i,t,c("ngfDuration",{$file:t,$duration:e}))}),(function(){i.resolve(!1)})):g(i,t,r.getValidationAttr(s,o,n,a,t))):void i.resolve(!0)})));var v=e.defer();return e.all(m).then((function(t){for(var e=!0,r=0;r<t.length;r++)if(!t[r]){e=!1;break}i.$ngfValidations.push({name:n,valid:e}),v.resolve(e)})),v.promise}(i=i||{}).$ngfValidations=i.$ngfValidations||[],angular.forEach(i.$ngfValidations,(function(t){t.valid=!0}));var c=function(t,e){return r.attrGetter(t,s,o,e)},l=(r.attrGetter("ngfIgnoreInvalid",s,o)||"").split(" "),h=r.attrGetter("ngfRunAllValidations",s,o);if(null==t||0===t.length)return r.emptyPromise({validFiles:t,invalidFiles:[]});t=void 0===t.length?[t]:t.slice(0);var f=[];a("pattern",null,r.validatePattern),a("minSize","size.min",(function(t,e){return t.size+.1>=r.translateScalars(e)})),a("maxSize","size.max",(function(t,e){return t.size-.1<=r.translateScalars(e)}));var p=0;if(a("maxTotalSize",null,(function(e,n){return!((p+=e.size)>r.translateScalars(n))||(t.splice(0,t.length),!1)})),a("validateFn",null,(function(t,e){return!0===e||null===e||""===e})),!t.length)return r.emptyPromise({validFiles:[],invalidFiles:f});var d=e.defer(),g=[];return g.push(u("maxHeight","height.max",/image/,this.imageDimensions,(function(t,e){return t.height<=e}))),g.push(u("minHeight","height.min",/image/,this.imageDimensions,(function(t,e){return t.height>=e}))),g.push(u("maxWidth","width.max",/image/,this.imageDimensions,(function(t,e){return t.width<=e}))),g.push(u("minWidth","width.min",/image/,this.imageDimensions,(function(t,e){return t.width>=e}))),g.push(u("dimensions",null,/image/,(function(t,e){return r.emptyPromise(e)}),(function(t){return t}))),g.push(u("ratio",null,/image/,this.imageDimensions,(function(t,e){for(var n=e.toString().split(","),i=!1,s=0;s<n.length;s++)Math.abs(t.width/t.height-r.ratioToFloat(n[s]))<.01&&(i=!0);return i}))),g.push(u("maxRatio","ratio.max",/image/,this.imageDimensions,(function(t,e){return t.width/t.height-r.ratioToFloat(e)<1e-4}))),g.push(u("minRatio","ratio.min",/image/,this.imageDimensions,(function(t,e){return t.width/t.height-r.ratioToFloat(e)>-1e-4}))),g.push(u("maxDuration","duration.max",/audio|video/,this.mediaDuration,(function(t,e){return t<=r.translateScalars(e)}))),g.push(u("minDuration","duration.min",/audio|video/,this.mediaDuration,(function(t,e){return t>=r.translateScalars(e)}))),g.push(u("duration",null,/audio|video/,(function(t,e){return r.emptyPromise(e)}),(function(t){return t}))),g.push(u("validateAsyncFn",null,null,(function(t,e){return e}),(function(t){return!0===t||null===t||""===t}))),e.all(g).then((function(){if(h)for(var e=0;e<t.length;e++){t[e].$error&&t.splice(e--,1)}h=!1,a("maxFiles",null,(function(t,e,r){return e>n+r})),d.resolve({validFiles:t,invalidFiles:f})})),d.promise},r.imageDimensions=function(t){if(t.$ngfWidth&&t.$ngfHeight){var i=e.defer();return n((function(){i.resolve({width:t.$ngfWidth,height:t.$ngfHeight})})),i.promise}if(t.$ngfDimensionPromise)return t.$ngfDimensionPromise;var s=e.defer();return n((function(){return 0!==t.type.indexOf("image")?void s.reject("not image"):void r.dataUrl(t).then((function(e){function r(){var e=o[0].naturalWidth||o[0].clientWidth,n=o[0].naturalHeight||o[0].clientHeight;o.remove(),t.$ngfWidth=e,t.$ngfHeight=n,s.resolve({width:e,height:n})}function i(){o.remove(),s.reject("load error")}var o=angular.element("<img>").attr("src",e).css("visibility","hidden").css("position","fixed").css("max-width","none !important").css("max-height","none !important");o.on("load",r),o.on("error",i);var a=0;(function t(){n((function(){o[0].parentNode&&(o[0].clientWidth?r():a++>10?i():t())}),1e3)})(),angular.element(document.getElementsByTagName("body")[0]).append(o)}),(function(){s.reject("load error")}))})),t.$ngfDimensionPromise=s.promise,t.$ngfDimensionPromise.finally((function(){delete t.$ngfDimensionPromise})),t.$ngfDimensionPromise},r.mediaDuration=function(t){if(t.$ngfDuration){var i=e.defer();return n((function(){i.resolve(t.$ngfDuration)})),i.promise}if(t.$ngfDurationPromise)return t.$ngfDurationPromise;var s=e.defer();return n((function(){return 0!==t.type.indexOf("audio")&&0!==t.type.indexOf("video")?void s.reject("not media"):void r.dataUrl(t).then((function(e){function r(){var e=o[0].duration;t.$ngfDuration=e,o.remove(),s.resolve(e)}function i(){o.remove(),s.reject("load error")}var o=angular.element(0===t.type.indexOf("audio")?"<audio>":"<video>").attr("src",e).css("visibility","none").css("position","fixed");o.on("loadedmetadata",r),o.on("error",i);var a=0;(function t(){n((function(){o[0].parentNode&&(o[0].duration?r():a>10?i():t())}),1e3)})(),angular.element(document.body).append(o)}),(function(){s.reject("load error")}))})),t.$ngfDurationPromise=s.promise,t.$ngfDurationPromise.finally((function(){delete t.$ngfDurationPromise})),t.$ngfDurationPromise},r}]),r.service("UploadResize",["UploadValidate","$q",function(t,e){var n=t,r=function(t,r,i,s,o,a,u,c){var l=e.defer(),h=document.createElement("canvas"),f=document.createElement("img");return f.setAttribute("style","visibility:hidden;position:fixed;z-index:-100000"),document.body.appendChild(f),f.onload=function(){var t=f.width,e=f.height;if(f.parentNode.removeChild(f),null==c||!1!==c(t,e))try{if(a){var p=n.ratioToFloat(a);p>t/e?i=(r=t)/p:r=(i=e)*p}r||(r=t),i||(i=e);var d=function(t,e,n,r,i){var s=i?Math.max(n/t,r/e):Math.min(n/t,r/e);return{width:t*s,height:e*s,marginX:t*s-n,marginY:e*s-r}}(t,e,r,i,u);h.width=Math.min(d.width,r),h.height=Math.min(d.height,i),h.getContext("2d").drawImage(f,Math.min(0,-d.marginX/2),Math.min(0,-d.marginY/2),d.width,d.height),l.resolve(h.toDataURL(o||"image/WebP",s||.934))}catch(t){l.reject(t)}else l.reject("resizeIf")},f.onerror=function(){f.parentNode.removeChild(f),l.reject()},f.src=t,l.promise};return n.dataUrltoBlob=function(t,e,n){for(var r=t.split(","),i=r[0].match(/:(.*?);/)[1],s=atob(r[1]),o=s.length,a=new Uint8Array(o);o--;)a[o]=s.charCodeAt(o);var u=new window.Blob([a],{type:i});return u.name=e,u.$ngfOrigSize=n,u},n.isResizeSupported=function(){var t=document.createElement("canvas");return window.atob&&t.getContext&&t.getContext("2d")&&window.Blob},n.isResizeSupported()&&Object.defineProperty(window.Blob.prototype,"name",{get:function(){return this.$ngfName},set:function(t){this.$ngfName=t},configurable:!0}),n.resize=function(t,i){if(0!==t.type.indexOf("image"))return n.emptyPromise(t);var s=e.defer();return n.dataUrl(t,!0).then((function(e){r(e,i.width,i.height,i.quality,i.type||t.type,i.ratio,i.centerCrop,i.resizeIf).then((function(r){if("image/jpeg"===t.type&&!1!==i.restoreExif)try{r=n.restoreExif(e,r)}catch(t){setTimeout((function(){throw t}),1)}try{var o=n.dataUrltoBlob(r,t.name,t.size);s.resolve(o)}catch(t){s.reject(t)}}),(function(e){"resizeIf"===e&&s.resolve(t),s.reject(e)}))}),(function(t){s.reject(t)})),s.promise},n}]),function(){function t(t,n,r,i,s,o,a,u,c,l){function h(){return n.attr("disabled")||v("ngfDropDisabled",t)}function f(e,n,r){if(e){var i;try{i=e&&e.getData&&e.getData("text/html")}catch(t){}g(e.items,e.files,!1!==v("ngfAllowDir",t),v("multiple")||v("ngfMultiple",t)).then((function(t){t.length?p(t,n):d(r,i).then((function(t){p(t,n)}))}))}}function p(e,n){u.updateModel(i,r,t,v("ngfChange")||v("ngfDrop"),e,n)}function d(e,n){if(!u.shouldUpdateOn(e,r,t)||"string"!=typeof n)return u.rejectPromise([]);var i=[];n.replace(/<(img src|img [^>]* src) *=\"([^\"]*)\"/gi,(function(t,e,n){i.push(n)}));var s=[],o=[];if(i.length){angular.forEach(i,(function(t){s.push(u.urlToBlob(t).then((function(t){o.push(t)})))}));var a=l.defer();return l.all(s).then((function(){a.resolve(o)}),(function(t){a.reject(t)})),a.promise}return u.emptyPromise()}function g(e,n,i,s){function o(t,e){var n=l.defer();if(null!=t)if(t.isDirectory){var r=[u.emptyPromise()];if(f){var i={type:"directory"};i.name=i.path=(e||"")+t.name,p.push(i)}var s=t.createReader(),a=[],g=function(){s.readEntries((function(i){try{i.length?(a=a.concat(Array.prototype.slice.call(i||[],0)),g()):(angular.forEach(a.slice(0),(function(n){p.length<=c&&h>=d&&r.push(o(n,(e||"")+t.name+"/"))})),l.all(r).then((function(){n.resolve()}),(function(t){n.reject(t)})))}catch(t){n.reject(t)}}),(function(t){n.reject(t)}))};g()}else t.file((function(t){try{t.path=(e||"")+t.name,f&&(t=u.rename(t,t.path)),p.push(t),d+=t.size,n.resolve()}catch(t){n.reject(t)}}),(function(t){n.reject(t)}));return n.promise}var c=u.getValidationAttr(r,t,"maxFiles");null==c&&(c=Number.MAX_VALUE);var h=u.getValidationAttr(r,t,"maxTotalSize");null==h&&(h=Number.MAX_VALUE);var f=v("ngfIncludeDir",t),p=[],d=0,g=[u.emptyPromise()];if(e&&e.length>0&&"file:"!==a.location.protocol)for(var m=0;m<e.length;m++){if(e[m].webkitGetAsEntry&&e[m].webkitGetAsEntry()&&e[m].webkitGetAsEntry().isDirectory){var y=e[m].webkitGetAsEntry();if(y.isDirectory&&!i)continue;null!=y&&g.push(o(y))}else{var b=e[m].getAsFile();null!=b&&(p.push(b),d+=b.size)}if(p.length>c||d>h||!s&&p.length>0)break}else if(null!=n)for(var w=0;w<n.length;w++){var x=n.item(w);if((x.type||x.size>0)&&(p.push(x),d+=x.size),p.length>c||d>h||!s&&p.length>0)break}var S=l.defer();return l.all(g).then((function(){if(s||f||!p.length)S.resolve(p);else{for(var t=0;p[t]&&"directory"===p[t].type;)t++;S.resolve([p[t]])}}),(function(t){S.reject(t)})),S.promise}var m=e(),v=function(t,e,n){return u.attrGetter(t,r,e,n)};if(v("dropAvailable")&&o((function(){t[v("dropAvailable")]?t[v("dropAvailable")].value=m:t[v("dropAvailable")]=m})),m){null==v("ngfSelect")&&u.registerModelChangeValidator(i,r,t);var y,b=null,w=s(v("ngfStopPropagation")),x=1;n[0].addEventListener("dragover",(function(e){if(!h()&&u.shouldUpdateOn("drop",r,t)){if(e.preventDefault(),w(t)&&e.stopPropagation(),navigator.userAgent.indexOf("Chrome")>-1){var i=e.dataTransfer.effectAllowed;e.dataTransfer.dropEffect="move"===i||"linkMove"===i?"move":"copy"}o.cancel(b),y||(y="C",function(t,e,n,r){var i=v("ngfDragOverClass",t,{$event:n}),s="dragover";if(angular.isString(i))s=i;else if(i&&(i.delay&&(x=i.delay),i.accept||i.reject)){var o=n.dataTransfer.items;if(null!=o&&o.length)for(var a=i.pattern||v("ngfPattern",t,{$event:n}),c=o.length;c--;){if(!u.validatePattern(o[c],a)){s=i.reject;break}s=i.accept}else s=i.accept}r(s)}(t,0,e,(function(r){y=r,n.addClass(y),v("ngfDrag",t,{$isDragging:!0,$class:y,$event:e})})))}}),!1),n[0].addEventListener("dragenter",(function(e){!h()&&u.shouldUpdateOn("drop",r,t)&&(e.preventDefault(),w(t)&&e.stopPropagation())}),!1),n[0].addEventListener("dragleave",(function(e){!h()&&u.shouldUpdateOn("drop",r,t)&&(e.preventDefault(),w(t)&&e.stopPropagation(),b=o((function(){y&&n.removeClass(y),y=null,v("ngfDrag",t,{$isDragging:!1,$event:e})}),x||100))}),!1),n[0].addEventListener("drop",(function(e){!h()&&u.shouldUpdateOn("drop",r,t)&&(e.preventDefault(),w(t)&&e.stopPropagation(),y&&n.removeClass(y),y=null,f(e.dataTransfer,e,"dropUrl"))}),!1),n[0].addEventListener("paste",(function(e){navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&v("ngfEnableFirefoxPaste",t)&&e.preventDefault(),!h()&&u.shouldUpdateOn("paste",r,t)&&f(e.clipboardData||e.originalEvent.clipboardData,e,"pasteUrl")}),!1),navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&v("ngfEnableFirefoxPaste",t)&&(n.attr("contenteditable",!0),n.on("keypress",(function(t){t.metaKey||t.ctrlKey||t.preventDefault()})))}else!0===v("ngfHideOnDropNotAvailable",t)&&n.css("display","none")}function e(){var t=document.createElement("div");return"draggable"in t&&"ondrop"in t&&!/Edge\/12./i.test(navigator.userAgent)}r.directive("ngfDrop",["$parse","$timeout","$window","Upload","$http","$q",function(e,n,r,i,s,o){return{restrict:"AEC",require:"?ngModel",link:function(s,a,u,c){t(s,a,u,c,e,n,r,i,0,o)}}}]),r.directive("ngfNoFileDrop",(function(){return function(t,n){e()&&n.css("display","none")}})),r.directive("ngfDropAvailable",["$parse","$timeout","Upload",function(t,n,r){return function(i,s,o){if(e()){var a=t(r.attrGetter("ngfDropAvailable",o));n((function(){a(i),a.assign&&a.assign(i,!0)}))}}}])}(),r.service("UploadExif",["UploadResize","$q",function(t,e){var n=t;return n.isExifSupported=function(){return window.FileReader&&(new FileReader).readAsArrayBuffer&&n.isResizeSupported()},n.readOrientation=function(t){var n=e.defer(),r=new FileReader,i=t.slice?t.slice(0,65536):t;return r.readAsArrayBuffer(i),r.onerror=function(t){return n.reject(t)},r.onload=function(t){var e={orientation:1},r=new DataView(this.result);if(65496!==r.getUint16(0,!1))return n.resolve(e);for(var i=r.byteLength,s=2;i>s;){var o=r.getUint16(s,!1);if(s+=2,65505===o){if(1165519206!==r.getUint32(s+=2,!1))return n.resolve(e);var a=18761===r.getUint16(s+=6,!1);s+=r.getUint32(s+4,a);var u=r.getUint16(s,a);s+=2;for(var c=0;u>c;c++)if(274===r.getUint16(s+12*c,a)){var l=r.getUint16(s+12*c+8,a);return l>=2&&8>=l&&(r.setUint16(s+12*c+8,1,a),e.fixedArrayBuffer=t.target.result),e.orientation=l,n.resolve(e)}}else{if(65280!=(65280&o))break;s+=r.getUint16(s,!1)}}return n.resolve(e)},n.promise},n.applyExifRotation=function(t){if(0!==t.type.indexOf("image/jpeg"))return n.emptyPromise(t);var r=e.defer();return n.readOrientation(t).then((function(e){return e.orientation<2||e.orientation>8?r.resolve(t):void n.dataUrl(t,!0).then((function(i){var s=document.createElement("canvas"),o=document.createElement("img");o.onload=function(){try{s.width=e.orientation>4?o.height:o.width,s.height=e.orientation>4?o.width:o.height;var i=s.getContext("2d");(function(t,e,n,r){switch(e){case 2:return t.transform(-1,0,0,1,n,0);case 3:return t.transform(-1,0,0,-1,n,r);case 4:return t.transform(1,0,0,-1,0,r);case 5:return t.transform(0,1,1,0,0,0);case 6:return t.transform(0,1,-1,0,r,0);case 7:return t.transform(0,-1,-1,0,r,n);case 8:t.transform(0,-1,1,0,0,n)}})(i,e.orientation,o.width,o.height),i.drawImage(o,0,0);var a=s.toDataURL(t.type||"image/WebP",.934);a=n.restoreExif(function(t){for(var e="",n=new Uint8Array(t),r=n.byteLength,i=0;r>i;i++)e+=String.fromCharCode(n[i]);return window.btoa(e)}(e.fixedArrayBuffer),a);var u=n.dataUrltoBlob(a,t.name);r.resolve(u)}catch(t){return r.reject(t)}},o.onerror=function(){r.reject()},o.src=i}),(function(t){r.reject(t)}))}),(function(t){r.reject(t)})),r.promise},n.restoreExif=function(t,e){var n={KEY_STR:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode64:function(t){var e,n,r,i,s,o="",a="",u="",c=0;do{r=(e=t[c++])>>2,i=(3&e)<<4|(n=t[c++])>>4,s=(15&n)<<2|(a=t[c++])>>6,u=63&a,isNaN(n)?s=u=64:isNaN(a)&&(u=64),o=o+this.KEY_STR.charAt(r)+this.KEY_STR.charAt(i)+this.KEY_STR.charAt(s)+this.KEY_STR.charAt(u),e=n=a="",r=i=s=u=""}while(c<t.length);return o},restore:function(t,e){t.match("data:image/jpeg;base64,")&&(t=t.replace("data:image/jpeg;base64,",""));var n=this.decode64(t),r=this.slice2Segments(n),i=this.exifManipulation(e,r);return"data:image/jpeg;base64,"+this.encode64(i)},exifManipulation:function(t,e){var n=this.getExifArray(e),r=this.insertExif(t,n);return new Uint8Array(r)},getExifArray:function(t){for(var e,n=0;n<t.length;n++)if(255===(e=t[n])[0]&225===e[1])return e;return[]},insertExif:function(t,e){var n=t.replace("data:image/jpeg;base64,",""),r=this.decode64(n),i=r.indexOf(255,3),s=r.slice(0,i),o=r.slice(i),a=s;return(a=a.concat(e)).concat(o)},slice2Segments:function(t){for(var e=0,n=[];!(255===t[e]&218===t[e+1]);){if(255===t[e]&216===t[e+1])e+=2;else{var r=e+(256*t[e+2]+t[e+3])+2,i=t.slice(e,r);n.push(i),e=r}if(e>t.length)break}return n},decode64:function(t){var e,n,r,i,s="",o="",a=0,u=[];/[^A-Za-z0-9\+\/\=]/g.exec(t)&&console.log("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, NaNExpect errors in decoding."),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=this.KEY_STR.indexOf(t.charAt(a++))<<2|(r=this.KEY_STR.indexOf(t.charAt(a++)))>>4,n=(15&r)<<4|(i=this.KEY_STR.indexOf(t.charAt(a++)))>>2,s=(3&i)<<6|(o=this.KEY_STR.indexOf(t.charAt(a++))),u.push(e),64!==i&&u.push(n),64!==o&&u.push(s),e=n=s="",r=i=o=""}while(a<t.length);return u}};return n.restore(t,e)},n}])},function(t,e){
|
|
40
|
+
!window.XMLHttpRequest||window.FileAPI&&FileAPI.shouldLoad||(window.XMLHttpRequest.prototype.setRequestHeader=(n=window.XMLHttpRequest.prototype.setRequestHeader,function(t,e){if("__setXHR_"===t){var r=e(this);r instanceof Function&&r(this)}else n.apply(this,arguments)}));var r=angular.module("ngFileUpload",[]);r.version="12.2.13",r.service("UploadBase",["$http","$q","$timeout",function(t,e,n){function i(r){function i(t){c.notify&&c.notify(t),l.progressFunc&&n((function(){l.progressFunc(t)}))}function s(t){return null!=r._start&&a?{loaded:t.loaded+r._start,total:r._file&&r._file.size||t.total,type:t.type,config:r,lengthComputable:!0,target:t.target}:t}function u(){t(r).then((function(t){if(a&&r._chunkSize&&!r._finished&&r._file){var e=r._file&&r._file.size||0;i({loaded:Math.min(r._end,e),total:e,config:r,type:"progress"}),o.upload(r,!0)}else r._finished&&delete r._finished,c.resolve(t)}),(function(t){c.reject(t)}),(function(t){c.notify(t)}))}r.method=r.method||"POST",r.headers=r.headers||{};var c=r._deferred=r._deferred||e.defer(),l=c.promise;return r.disableProgress||(r.headers.__setXHR_=function(){return function(t){t&&t.upload&&t.upload.addEventListener&&(r.__XHR=t,r.xhrFn&&r.xhrFn(t),t.upload.addEventListener("progress",(function(t){t.config=r,i(s(t))}),!1),t.upload.addEventListener("load",(function(t){t.lengthComputable&&(t.config=r,i(s(t)))}),!1))}}),a?r._chunkSize&&r._end&&!r._finished?(r._start=r._end,r._end+=r._chunkSize,u()):r.resumeSizeUrl?t.get(r.resumeSizeUrl).then((function(t){r._start=r.resumeSizeResponseReader?r.resumeSizeResponseReader(t.data):parseInt((null==t.data.size?t.data:t.data.size).toString()),r._chunkSize&&(r._end=r._start+r._chunkSize),u()}),(function(t){throw t})):r.resumeSize?r.resumeSize().then((function(t){r._start=t,r._chunkSize&&(r._end=r._start+r._chunkSize),u()}),(function(t){throw t})):(r._chunkSize&&(r._start=0,r._end=r._start+r._chunkSize),u()):u(),l.success=function(t){return l.then((function(e){t(e.data,e.status,e.headers,r)})),l},l.error=function(t){return l.then(null,(function(e){t(e.data,e.status,e.headers,r)})),l},l.progress=function(t){return l.progressFunc=t,l.then(null,null,(function(e){t(e)})),l},l.abort=l.pause=function(){return r.__XHR&&n((function(){r.__XHR.abort()})),l},l.xhr=function(t){return r.xhrFn=function(e){return function(){e&&e.apply(l,arguments),t.apply(l,arguments)}}(r.xhrFn),l},o.promisesCount++,l.finally&&l.finally instanceof Function&&l.finally((function(){o.promisesCount--})),l}function s(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var o=this;o.promisesCount=0,this.isResumeSupported=function(){return window.Blob&&window.Blob.prototype.slice};var a=this.isResumeSupported();this.isUploadInProgress=function(){return o.promisesCount>0},this.rename=function(t,e){return t.ngfName=e,t},this.jsonBlob=function(t){null==t||angular.isString(t)||(t=JSON.stringify(t));var e=new window.Blob([t],{type:"application/json"});return e._ngfBlob=!0,e},this.json=function(t){return angular.toJson(t)},this.isFile=function(t){return null!=t&&(t instanceof window.Blob||t.flashId&&t.name&&t.size)},this.upload=function(t,e){function n(e,n){if(e._ngfBlob)return e;if(t._file=t._file||e,null!=t._start&&a){t._end&&t._end>=e.size&&(t._finished=!0,t._end=e.size);var r=e.slice(t._start,t._end||e.size);return r.name=e.name,r.ngfName=e.ngfName,t._chunkSize&&(n.append("_chunkSize",t._chunkSize),n.append("_currentChunkSize",t._end-t._start),n.append("_chunkNumber",Math.floor(t._start/t._chunkSize)),n.append("_totalSize",t._file.size)),r}return e}function r(e,i,s){if(void 0!==i)if(angular.isDate(i)&&(i=i.toISOString()),angular.isString(i))e.append(s,i);else if(o.isFile(i)){var a=n(i,e),u=s.split(",");u[1]&&(a.ngfName=u[1].replace(/^\s+|\s+$/g,""),s=u[0]),t._fileKey=t._fileKey||s,e.append(s,a,a.ngfName||a.name)}else if(angular.isObject(i)){if(i.$$ngfCircularDetection)throw"ngFileUpload: Circular reference in config.data. Make sure specified data for Upload.upload() has no circular reference: "+s;i.$$ngfCircularDetection=!0;try{for(var c in i)if(i.hasOwnProperty(c)&&"$$ngfCircularDetection"!==c){var l=null==t.objectKey?"[i]":t.objectKey;i.length&&parseInt(c)>-1&&(l=null==t.arrayKey?l:t.arrayKey),r(e,i[c],s+l.replace(/[ik]/g,c))}}finally{delete i.$$ngfCircularDetection}}else e.append(s,i)}return e||(t=s(t)),t._isDigested||(t._isDigested=!0,t._chunkSize=o.translateScalars(t.resumeChunkSize),t._chunkSize=t._chunkSize?parseInt(t._chunkSize.toString()):null,t.headers=t.headers||{},t.headers["Content-Type"]=void 0,t.transformRequest=t.transformRequest?angular.isArray(t.transformRequest)?t.transformRequest:[t.transformRequest]:[],t.transformRequest.push((function(e){var n,i=new window.FormData;for(n in e=e||t.fields||{},t.file&&(e.file=t.file),e)if(e.hasOwnProperty(n)){var s=e[n];t.formDataAppender?t.formDataAppender(i,n,s):r(i,s,n)}return i}))),i(t)},this.http=function(e){return(e=s(e)).transformRequest=e.transformRequest||function(e){return window.ArrayBuffer&&e instanceof window.ArrayBuffer||e instanceof window.Blob?e:t.defaults.transformRequest[0].apply(this,arguments)},e._chunkSize=o.translateScalars(e.resumeChunkSize),e._chunkSize=e._chunkSize?parseInt(e._chunkSize.toString()):null,i(e)},this.translateScalars=function(t){if(angular.isString(t)){if(t.search(/kb/i)===t.length-2)return parseFloat(1024*t.substring(0,t.length-2));if(t.search(/mb/i)===t.length-2)return parseFloat(1048576*t.substring(0,t.length-2));if(t.search(/gb/i)===t.length-2)return parseFloat(1073741824*t.substring(0,t.length-2));if(t.search(/b/i)===t.length-1)return parseFloat(t.substring(0,t.length-1));if(t.search(/s/i)===t.length-1)return parseFloat(t.substring(0,t.length-1));if(t.search(/m/i)===t.length-1)return parseFloat(60*t.substring(0,t.length-1));if(t.search(/h/i)===t.length-1)return parseFloat(3600*t.substring(0,t.length-1))}return t},this.urlToBlob=function(n){var r=e.defer();return t({url:n,method:"get",responseType:"arraybuffer"}).then((function(t){var e=new Uint8Array(t.data),i=t.headers("content-type")||"image/WebP",s=new window.Blob([e],{type:i}),o=n.match(/.*\/(.+?)(\?.*)?$/);o.length>1&&(s.name=o[1]),r.resolve(s)}),(function(t){r.reject(t)})),r.promise},this.setDefaults=function(t){this.defaults=t||{}},this.defaults={},this.version=r.version}]),r.service("Upload",["$parse","$timeout","$compile","$q","UploadExif",function(t,e,n,r,i){function s(t,e,n){var i=[u.emptyPromise()];return angular.forEach(t,(function(r,s){0===r.type.indexOf("image/jpeg")&&u.attrGetter("ngfFixOrientation",e,n,{$file:r})&&i.push(u.happyPromise(u.applyExifRotation(r),r).then((function(e){t.splice(s,1,e)})))})),r.all(i)}function o(t,e,n,i){var s=u.attrGetter("ngfResize",e,n);if(!s||!u.isResizeSupported()||!t.length)return u.emptyPromise();if(s instanceof Function){var o=r.defer();return s(t).then((function(r){a(r,t,e,n,i).then((function(t){o.resolve(t)}),(function(t){o.reject(t)}))}),(function(t){o.reject(t)}))}return a(s,t,e,n,i)}function a(t,e,n,i,s){function o(r,o){if(0===r.type.indexOf("image")){if(t.pattern&&!u.validatePattern(r,t.pattern))return;t.resizeIf=function(t,e){return u.attrGetter("ngfResizeIf",n,i,{$width:t,$height:e,$file:r})};var c=u.resize(r,t);a.push(c),c.then((function(t){e.splice(o,1,t)}),(function(t){r.$error="resize",(r.$errorMessages=r.$errorMessages||{}).resize=!0,r.$errorParam=(t?(t.message?t.message:t)+": ":"")+(r&&r.name),s.$ngfValidations.push({name:"resize",valid:!1}),u.applyModelValidation(s,e)}))}}for(var a=[u.emptyPromise()],c=0;c<e.length;c++)o(e[c],c);return r.all(a)}var u=i;return u.getAttrWithDefaults=function(t,e){if(null!=t[e])return t[e];var n=u.defaults[e];return null==n||angular.isString(n)?n:JSON.stringify(n)},u.attrGetter=function(e,n,r,i){var s=this.getAttrWithDefaults(n,e);if(!r)return s;try{return i?t(s)(r,i):t(s)(r)}catch(t){if(e.search(/min|max|pattern/i))return s;throw t}},u.shouldUpdateOn=function(t,e,n){var r=u.attrGetter("ngfModelOptions",e,n);return!r||!r.updateOn||r.updateOn.split(" ").indexOf(t)>-1},u.emptyPromise=function(){var t=r.defer(),n=arguments;return e((function(){t.resolve.apply(t,n)})),t.promise},u.rejectPromise=function(){var t=r.defer(),n=arguments;return e((function(){t.reject.apply(t,n)})),t.promise},u.happyPromise=function(t,n){var i=r.defer();return t.then((function(t){i.resolve(t)}),(function(t){e((function(){throw t})),i.resolve(n)})),i.promise},u.updateModel=function(n,r,i,a,c,l,h){function f(s,o,c,h,f){r.$$ngfPrevValidFiles=s,r.$$ngfPrevInvalidFiles=o;var p=s&&s.length?s[0]:null,d=o&&o.length?o[0]:null;n&&(u.applyModelValidation(n,s),n.$setViewValue(f?p:s)),a&&t(a)(i,{$files:s,$file:p,$newFiles:c,$duplicateFiles:h,$invalidFiles:o,$invalidFile:d,$event:l});var g=u.attrGetter("ngfModelInvalid",r);g&&e((function(){t(g).assign(i,f?d:o)})),e((function(){}))}function p(){function t(){e((function(){f(x?g.concat(b):b,x?m.concat(y):y,c,v,w)}),E&&E.debounce?E.debounce.change||E.debounce:0)}var s=S?d:b;o(s,r,i,n).then((function(){S?u.validate(d,x?g.length:0,n,r,i).then((function(e){b=e.validsFiles,y=e.invalidsFiles,t()})):t()}),(function(){for(var e=0;e<s.length;e++){var n=s[e];if("resize"===n.$error){var r=b.indexOf(n);r>-1&&(b.splice(r,1),y.push(n)),t()}}}))}var d,g,m,v=[],y=[],b=[];g=r.$$ngfPrevValidFiles||[],m=r.$$ngfPrevInvalidFiles||[],n&&n.$modelValue&&(g=function(t){return angular.isArray(t)?t:[t]}(n.$modelValue));var x=u.attrGetter("ngfKeep",r,i);d=(c||[]).slice(0),("distinct"===x||!0===u.attrGetter("ngfKeepDistinct",r,i))&&function(){function t(t,e){return t.name===e.name&&(t.$ngfOrigSize||t.size)===(e.$ngfOrigSize||e.size)&&t.type===e.type}function e(e){var n;for(n=0;n<g.length;n++)if(t(e,g[n]))return!0;for(n=0;n<m.length;n++)if(t(e,m[n]))return!0;return!1}if(c){d=[],v=[];for(var n=0;n<c.length;n++)e(c[n])?v.push(c[n]):d.push(c[n])}}();var w=!x&&!u.attrGetter("ngfMultiple",r,i)&&!u.attrGetter("multiple",r);if(!x||d.length){u.attrGetter("ngfBeforeModelChange",r,i,{$files:c,$file:c&&c.length?c[0]:null,$newFiles:d,$duplicateFiles:v,$event:l});var S=u.attrGetter("ngfValidateAfterResize",r,i),E=u.attrGetter("ngfModelOptions",r,i);u.validate(d,x?g.length:0,n,r,i).then((function(t){h?f(d,[],c,v,w):(E&&E.allowInvalid||S?b=d:(b=t.validFiles,y=t.invalidFiles),u.attrGetter("ngfFixOrientation",r,i)&&u.isExifSupported()?s(b,r,i).then((function(){p()})):p())}))}},u}]),r.directive("ngfSelect",["$parse","$timeout","$compile","Upload",function(t,e,n,r){function i(t){var e=t.match(/Android[^\d]*(\d+)\.(\d+)/);if(e&&e.length>2){var n=r.defaults.androidFixMinorVersion||4;return parseInt(e[1])<4||parseInt(e[1])===n&&parseInt(e[2])<n}return-1===t.indexOf("Chrome")&&/.*Windows.*Safari.*/.test(t)}function s(t,e,n,r,s,a,u,c){function l(){return"input"===e[0].tagName.toLowerCase()&&n.type&&"file"===n.type.toLowerCase()}function h(){return g("ngfChange")||g("ngfSelect")}function f(e){if(c.shouldUpdateOn("change",n,t)){var i=e.__files_||e.target&&e.target.files,s=[];if(!i)return;for(var o=0;o<i.length;o++)s.push(i[o]);c.updateModel(r,n,t,h(),s.length?s:null,e)}}function p(t,r){function i(e){t.attr("id","ngf-"+e),r.attr("id","ngf-label-"+e)}for(var s=0;s<e[0].attributes.length;s++){var o=e[0].attributes[s];"type"!==o.name&&"class"!==o.name&&"style"!==o.name&&("id"===o.name?(i(o.value),m.push(n.$observe("id",i))):t.attr(o.name,o.value||"required"!==o.name&&"multiple"!==o.name?o.value:o.name))}}function d(e){c.shouldUpdateOn("click",n,t)&&b.val()&&(b.val(null),c.updateModel(r,n,t,h(),null,e,!0))}var g=function(t,e){return c.attrGetter(t,n,e)};c.registerModelChangeValidator(r,n,t);var m=[];g("ngfMultiple")&&m.push(t.$watch(g("ngfMultiple"),(function(){b.attr("multiple",g("ngfMultiple",t))}))),g("ngfCapture")&&m.push(t.$watch(g("ngfCapture"),(function(){b.attr("capture",g("ngfCapture",t))}))),g("ngfAccept")&&m.push(t.$watch(g("ngfAccept"),(function(){b.attr("accept",g("ngfAccept",t))}))),m.push(n.$observe("accept",(function(){b.attr("accept",g("accept"))})));var v=0,y=0,b=e;l()||(b=function(){if(l())return e;var t=angular.element('<input type="file">'),n=angular.element("<label>upload</label>");return n.css("visibility","hidden").css("position","absolute").css("overflow","hidden").css("width","0px").css("height","0px").css("border","none").css("margin","0px").css("padding","0px").attr("tabindex","-1"),p(t,n),o.push({el:e,ref:n}),document.body.appendChild(n.append(t)[0]),t}()),b.bind("change",f),l()?e.bind("click",d):e.bind("click touchstart touchend",(function(n){if(e.attr("disabled"))return!1;if(!g("ngfSelectDisabled",t)){var r=function(t){var e=t.changedTouches||t.originalEvent&&t.originalEvent.changedTouches;if(e){if("touchstart"===t.type)return y=e[0].clientX,v=e[0].clientY,!0;if("touchend"===t.type){var n=e[0].clientX,r=e[0].clientY;if(Math.abs(n-y)>20||Math.abs(r-v)>20)return t.stopPropagation(),t.preventDefault(),!1}return!0}}(n);if(null!=r)return r;d(n);try{l()||document.body.contains(b[0])||(o.push({el:e,ref:b.parent()}),document.body.appendChild(b.parent()[0]),b.bind("change",f))}catch(t){}return i(navigator.userAgent)?setTimeout((function(){b[0].click()}),0):b[0].click(),!1}})),-1!==navigator.appVersion.indexOf("MSIE 10")&&b.bind("click",(function t(e){if(b&&!b.attr("__ngf_ie10_Fix_")){if(!b[0].parentNode)return void(b=null);e.preventDefault(),e.stopPropagation(),b.unbind("click");var n=b.clone();return b.replaceWith(n),(b=n).attr("__ngf_ie10_Fix_","true"),b.bind("change",f),b.bind("click",t),b[0].click(),!1}b.removeAttr("__ngf_ie10_Fix_")})),r&&r.$formatters.push((function(t){return(null==t||0===t.length)&&b.val()&&b.val(null),t})),t.$on("$destroy",(function(){l()||b.parent().remove(),angular.forEach(m,(function(t){t()}))})),a((function(){for(var t=0;t<o.length;t++){var e=o[t];document.body.contains(e.el[0])||(o.splice(t,1),e.ref.remove())}})),window.FileAPI&&window.FileAPI.ngfFixIE&&window.FileAPI.ngfFixIE(e,b,f)}var o=[];return{restrict:"AEC",require:"?ngModel",link:function(t,n,i,o){s(t,n,i,o,0,e,0,r)}}}]),function(){function t(t,e,n,r,i,s,o,a){function u(s){var o=t.attrGetter("ngfNoObjectUrl",i,n);t.dataUrl(s,o).finally((function(){e((function(){var t=(o?s.$ngfDataUrl:s.$ngfBlobUrl)||s.$ngfDataUrl;a?r.css("background-image","url('"+(t||"")+"')"):r.attr("src",t),t?r.removeClass("ng-hide"):r.addClass("ng-hide")}))}))}e((function(){var e=n.$watch(i[s],(function(e){var c=o;if("ngfThumbnail"===s&&(c||(c={width:r[0].naturalWidth||r[0].clientWidth,height:r[0].naturalHeight||r[0].clientHeight}),0===c.width&&window.getComputedStyle)){var l=getComputedStyle(r[0]);l.width&&l.width.indexOf("px")>-1&&l.height&&l.height.indexOf("px")>-1&&(c={width:parseInt(l.width.slice(0,-2)),height:parseInt(l.height.slice(0,-2))})}return angular.isString(e)?(r.removeClass("ng-hide"),a?r.css("background-image","url('"+e+"')"):r.attr("src",e)):void(!e||!e.type||0!==e.type.search(function(t){return"img"===t.tagName.toLowerCase()?"image":"audio"===t.tagName.toLowerCase()?"audio":"video"===t.tagName.toLowerCase()?"video":/./}(r[0]))||a&&0!==e.type.indexOf("image")?r.addClass("ng-hide"):c&&t.isResizeSupported()?(c.resizeIf=function(r,s){return t.attrGetter("ngfResizeIf",i,n,{$width:r,$height:s,$file:e})},t.resize(e,c).then((function(t){u(t)}),(function(t){throw t}))):u(e))}));n.$on("$destroy",(function(){e()}))}))}r.service("UploadDataUrl",["UploadBase","$timeout","$q",function(t,e,n){var r=t;return r.base64DataUrl=function(t){if(angular.isArray(t)){var e=n.defer(),i=0;return angular.forEach(t,(function(n){r.dataUrl(n,!0).finally((function(){if(++i===t.length){var n=[];angular.forEach(t,(function(t){n.push(t.$ngfDataUrl)})),e.resolve(n,t)}}))})),e.promise}return r.dataUrl(t,!0)},r.dataUrl=function(t,i){if(!t)return r.emptyPromise(t,t);if(i&&null!=t.$ngfDataUrl||!i&&null!=t.$ngfBlobUrl)return r.emptyPromise(i?t.$ngfDataUrl:t.$ngfBlobUrl,t);var s=i?t.$$ngfDataUrlPromise:t.$$ngfBlobUrlPromise;if(s)return s;var o=n.defer();return e((function(){if(window.FileReader&&t&&(!window.FileAPI||-1===navigator.userAgent.indexOf("MSIE 8")||t.size<2e4)&&(!window.FileAPI||-1===navigator.userAgent.indexOf("MSIE 9")||t.size<4e6)){var n=window.URL||window.webkitURL;if(n&&n.createObjectURL&&!i){var s;try{s=n.createObjectURL(t)}catch(n){return void e((function(){t.$ngfBlobUrl="",o.reject()}))}e((function(){if(t.$ngfBlobUrl=s,s){o.resolve(s,t),r.blobUrls=r.blobUrls||[],r.blobUrlsTotalSize=r.blobUrlsTotalSize||0,r.blobUrls.push({url:s,size:t.size}),r.blobUrlsTotalSize+=t.size||0;for(var e=r.defaults.blobUrlsMaxMemory||268435456,i=r.defaults.blobUrlsMaxQueueSize||200;(r.blobUrlsTotalSize>e||r.blobUrls.length>i)&&r.blobUrls.length>1;){var a=r.blobUrls.splice(0,1)[0];n.revokeObjectURL(a.url),r.blobUrlsTotalSize-=a.size}}}))}else{var a=new FileReader;a.onload=function(n){e((function(){t.$ngfDataUrl=n.target.result,o.resolve(n.target.result,t),e((function(){delete t.$ngfDataUrl}),1e3)}))},a.onerror=function(){e((function(){t.$ngfDataUrl="",o.reject()}))},a.readAsDataURL(t)}}else e((function(){t[i?"$ngfDataUrl":"$ngfBlobUrl"]="",o.reject()}))})),(s=i?t.$$ngfDataUrlPromise=o.promise:t.$$ngfBlobUrlPromise=o.promise).finally((function(){delete t[i?"$$ngfDataUrlPromise":"$$ngfBlobUrlPromise"]})),s},r}]),r.directive("ngfSrc",["Upload","$timeout",function(e,n){return{restrict:"AE",link:function(r,i,s){t(e,n,r,i,s,"ngfSrc",e.attrGetter("ngfResize",s,r),!1)}}}]),r.directive("ngfBackground",["Upload","$timeout",function(e,n){return{restrict:"AE",link:function(r,i,s){t(e,n,r,i,s,"ngfBackground",e.attrGetter("ngfResize",s,r),!0)}}}]),r.directive("ngfThumbnail",["Upload","$timeout",function(e,n){return{restrict:"AE",link:function(r,i,s){var o=e.attrGetter("ngfSize",s,r);t(e,n,r,i,s,"ngfThumbnail",o,e.attrGetter("ngfAsBackground",s,r))}}}]),r.config(["$compileProvider",function(t){t.imgSrcSanitizationWhitelist&&t.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|webcal|local|file|data|blob):/),t.aHrefSanitizationWhitelist&&t.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|webcal|local|file|data|blob):/)}]),r.filter("ngfDataUrl",["UploadDataUrl","$sce",function(t,e){return function(n,r,i){if(angular.isString(n))return e.trustAsResourceUrl(n);var s=n&&((r?n.$ngfDataUrl:n.$ngfBlobUrl)||n.$ngfDataUrl);return n&&!s?(!n.$ngfDataUrlFilterInProgress&&angular.isObject(n)&&(n.$ngfDataUrlFilterInProgress=!0,t.dataUrl(n,r)),""):(n&&delete n.$ngfDataUrlFilterInProgress,(n&&s?i?e.trustAsResourceUrl(s):s:n)||"")}}])}(),r.service("UploadValidate",["UploadDataUrl","$q","$timeout",function(t,e,n){var r=t;return r.validatePattern=function(t,e){if(!e)return!0;var n=function t(e){var n="",r=[];if(e.length>2&&"/"===e[0]&&"/"===e[e.length-1])n=e.substring(1,e.length-1);else{var i=e.split(",");if(i.length>1)for(var s=0;s<i.length;s++){var o=t(i[s]);o.regexp?(n+="("+o.regexp+")",s<i.length-1&&(n+="|")):r=r.concat(o.excludes)}else 0===e.indexOf("!")?r.push("^((?!"+t(e.substring(1)).regexp+").)*$"):(0===e.indexOf(".")&&(e="*"+e),n=(n="^"+e.replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]","g"),"\\$&")+"$").replace(/\\\*/g,".*").replace(/\\\?/g,"."))}return{regexp:n,excludes:r}}(e),r=!0;if(n.regexp&&n.regexp.length){var i=new RegExp(n.regexp,"i");r=null!=t.type&&i.test(t.type)||null!=t.name&&i.test(t.name)}for(var s=n.excludes.length;s--;){var o=new RegExp(n.excludes[s],"i");r=r&&(null==t.type||o.test(t.type))&&(null==t.name||o.test(t.name))}return r},r.ratioToFloat=function(t){var e=t.toString(),n=e.search(/[x:]/i);return n>-1?parseFloat(e.substring(0,n))/parseFloat(e.substring(n+1)):parseFloat(e)},r.registerModelChangeValidator=function(t,e,n){t&&t.$formatters.push((function(i){if(t.$dirty){var s=i;i&&!angular.isArray(i)&&(s=[i]),r.validate(s,0,t,e,n).then((function(){r.applyModelValidation(t,s)}))}return i}))},r.applyModelValidation=function(t,e){(function(t,e){null==e||t.$dirty||(t.$setDirty?t.$setDirty():t.$dirty=!0)})(t,e),angular.forEach(t.$ngfValidations,(function(e){t.$setValidity(e.name,e.valid)}))},r.getValidationAttr=function(t,e,n,i,s){var o="ngf"+n[0].toUpperCase()+n.substr(1),a=r.attrGetter(o,t,e,{$file:s});if(null==a&&(a=r.attrGetter("ngfValidate",t,e,{$file:s}))){var u=(i||n).split(".");a=a[u[0]],u.length>1&&(a=a&&a[u[1]])}return a},r.validate=function(t,n,i,s,o){function a(e,n,a){if(t){for(var u=t.length,c=null;u--;){var p=t[u];if(p){var d=r.getValidationAttr(s,o,e,n,p);null!=d&&(a(p,d,u)||(-1===l.indexOf(e)?(p.$error=e,(p.$errorMessages=p.$errorMessages||{})[e]=!0,p.$errorParam=d,-1===f.indexOf(p)&&f.push(p),h||t.splice(u,1),c=!1):t.splice(u,1)))}}null!==c&&i.$ngfValidations.push({name:e,valid:c})}}function u(n,a,u,p,d){function g(e,r,i){function s(s){if(s())if(-1===l.indexOf(n)){if(r.$error=n,(r.$errorMessages=r.$errorMessages||{})[n]=!0,r.$errorParam=i,-1===f.indexOf(r)&&f.push(r),!h){var o=t.indexOf(r);o>-1&&t.splice(o,1)}e.resolve(!1)}else{var a=t.indexOf(r);a>-1&&t.splice(a,1),e.resolve(!0)}else e.resolve(!0)}null!=i?p(r,i).then((function(t){s((function(){return!d(t,i)}))}),(function(){s((function(){return c("ngfValidateForce",{$file:r})}))})):e.resolve(!0)}var m=[r.emptyPromise(!0)];t&&(t=void 0===t.length?[t]:t,angular.forEach(t,(function(t){var i=e.defer();return m.push(i.promise),!u||null!=t.type&&0===t.type.search(u)?void("dimensions"===n&&null!=r.attrGetter("ngfDimensions",s)?r.imageDimensions(t).then((function(e){g(i,t,c("ngfDimensions",{$file:t,$width:e.width,$height:e.height}))}),(function(){i.resolve(!1)})):"duration"===n&&null!=r.attrGetter("ngfDuration",s)?r.mediaDuration(t).then((function(e){g(i,t,c("ngfDuration",{$file:t,$duration:e}))}),(function(){i.resolve(!1)})):g(i,t,r.getValidationAttr(s,o,n,a,t))):void i.resolve(!0)})));var v=e.defer();return e.all(m).then((function(t){for(var e=!0,r=0;r<t.length;r++)if(!t[r]){e=!1;break}i.$ngfValidations.push({name:n,valid:e}),v.resolve(e)})),v.promise}(i=i||{}).$ngfValidations=i.$ngfValidations||[],angular.forEach(i.$ngfValidations,(function(t){t.valid=!0}));var c=function(t,e){return r.attrGetter(t,s,o,e)},l=(r.attrGetter("ngfIgnoreInvalid",s,o)||"").split(" "),h=r.attrGetter("ngfRunAllValidations",s,o);if(null==t||0===t.length)return r.emptyPromise({validFiles:t,invalidFiles:[]});t=void 0===t.length?[t]:t.slice(0);var f=[];a("pattern",null,r.validatePattern),a("minSize","size.min",(function(t,e){return t.size+.1>=r.translateScalars(e)})),a("maxSize","size.max",(function(t,e){return t.size-.1<=r.translateScalars(e)}));var p=0;if(a("maxTotalSize",null,(function(e,n){return!((p+=e.size)>r.translateScalars(n))||(t.splice(0,t.length),!1)})),a("validateFn",null,(function(t,e){return!0===e||null===e||""===e})),!t.length)return r.emptyPromise({validFiles:[],invalidFiles:f});var d=e.defer(),g=[];return g.push(u("maxHeight","height.max",/image/,this.imageDimensions,(function(t,e){return t.height<=e}))),g.push(u("minHeight","height.min",/image/,this.imageDimensions,(function(t,e){return t.height>=e}))),g.push(u("maxWidth","width.max",/image/,this.imageDimensions,(function(t,e){return t.width<=e}))),g.push(u("minWidth","width.min",/image/,this.imageDimensions,(function(t,e){return t.width>=e}))),g.push(u("dimensions",null,/image/,(function(t,e){return r.emptyPromise(e)}),(function(t){return t}))),g.push(u("ratio",null,/image/,this.imageDimensions,(function(t,e){for(var n=e.toString().split(","),i=!1,s=0;s<n.length;s++)Math.abs(t.width/t.height-r.ratioToFloat(n[s]))<.01&&(i=!0);return i}))),g.push(u("maxRatio","ratio.max",/image/,this.imageDimensions,(function(t,e){return t.width/t.height-r.ratioToFloat(e)<1e-4}))),g.push(u("minRatio","ratio.min",/image/,this.imageDimensions,(function(t,e){return t.width/t.height-r.ratioToFloat(e)>-1e-4}))),g.push(u("maxDuration","duration.max",/audio|video/,this.mediaDuration,(function(t,e){return t<=r.translateScalars(e)}))),g.push(u("minDuration","duration.min",/audio|video/,this.mediaDuration,(function(t,e){return t>=r.translateScalars(e)}))),g.push(u("duration",null,/audio|video/,(function(t,e){return r.emptyPromise(e)}),(function(t){return t}))),g.push(u("validateAsyncFn",null,null,(function(t,e){return e}),(function(t){return!0===t||null===t||""===t}))),e.all(g).then((function(){if(h)for(var e=0;e<t.length;e++){t[e].$error&&t.splice(e--,1)}h=!1,a("maxFiles",null,(function(t,e,r){return e>n+r})),d.resolve({validFiles:t,invalidFiles:f})})),d.promise},r.imageDimensions=function(t){if(t.$ngfWidth&&t.$ngfHeight){var i=e.defer();return n((function(){i.resolve({width:t.$ngfWidth,height:t.$ngfHeight})})),i.promise}if(t.$ngfDimensionPromise)return t.$ngfDimensionPromise;var s=e.defer();return n((function(){return 0!==t.type.indexOf("image")?void s.reject("not image"):void r.dataUrl(t).then((function(e){function r(){var e=o[0].naturalWidth||o[0].clientWidth,n=o[0].naturalHeight||o[0].clientHeight;o.remove(),t.$ngfWidth=e,t.$ngfHeight=n,s.resolve({width:e,height:n})}function i(){o.remove(),s.reject("load error")}var o=angular.element("<img>").attr("src",e).css("visibility","hidden").css("position","fixed").css("max-width","none !important").css("max-height","none !important");o.on("load",r),o.on("error",i);var a=0;(function t(){n((function(){o[0].parentNode&&(o[0].clientWidth?r():a++>10?i():t())}),1e3)})(),angular.element(document.getElementsByTagName("body")[0]).append(o)}),(function(){s.reject("load error")}))})),t.$ngfDimensionPromise=s.promise,t.$ngfDimensionPromise.finally((function(){delete t.$ngfDimensionPromise})),t.$ngfDimensionPromise},r.mediaDuration=function(t){if(t.$ngfDuration){var i=e.defer();return n((function(){i.resolve(t.$ngfDuration)})),i.promise}if(t.$ngfDurationPromise)return t.$ngfDurationPromise;var s=e.defer();return n((function(){return 0!==t.type.indexOf("audio")&&0!==t.type.indexOf("video")?void s.reject("not media"):void r.dataUrl(t).then((function(e){function r(){var e=o[0].duration;t.$ngfDuration=e,o.remove(),s.resolve(e)}function i(){o.remove(),s.reject("load error")}var o=angular.element(0===t.type.indexOf("audio")?"<audio>":"<video>").attr("src",e).css("visibility","none").css("position","fixed");o.on("loadedmetadata",r),o.on("error",i);var a=0;(function t(){n((function(){o[0].parentNode&&(o[0].duration?r():a>10?i():t())}),1e3)})(),angular.element(document.body).append(o)}),(function(){s.reject("load error")}))})),t.$ngfDurationPromise=s.promise,t.$ngfDurationPromise.finally((function(){delete t.$ngfDurationPromise})),t.$ngfDurationPromise},r}]),r.service("UploadResize",["UploadValidate","$q",function(t,e){var n=t,r=function(t,r,i,s,o,a,u,c){var l=e.defer(),h=document.createElement("canvas"),f=document.createElement("img");return f.setAttribute("style","visibility:hidden;position:fixed;z-index:-100000"),document.body.appendChild(f),f.onload=function(){var t=f.width,e=f.height;if(f.parentNode.removeChild(f),null==c||!1!==c(t,e))try{if(a){var p=n.ratioToFloat(a);p>t/e?i=(r=t)/p:r=(i=e)*p}r||(r=t),i||(i=e);var d=function(t,e,n,r,i){var s=i?Math.max(n/t,r/e):Math.min(n/t,r/e);return{width:t*s,height:e*s,marginX:t*s-n,marginY:e*s-r}}(t,e,r,i,u);h.width=Math.min(d.width,r),h.height=Math.min(d.height,i),h.getContext("2d").drawImage(f,Math.min(0,-d.marginX/2),Math.min(0,-d.marginY/2),d.width,d.height),l.resolve(h.toDataURL(o||"image/WebP",s||.934))}catch(t){l.reject(t)}else l.reject("resizeIf")},f.onerror=function(){f.parentNode.removeChild(f),l.reject()},f.src=t,l.promise};return n.dataUrltoBlob=function(t,e,n){for(var r=t.split(","),i=r[0].match(/:(.*?);/)[1],s=atob(r[1]),o=s.length,a=new Uint8Array(o);o--;)a[o]=s.charCodeAt(o);var u=new window.Blob([a],{type:i});return u.name=e,u.$ngfOrigSize=n,u},n.isResizeSupported=function(){var t=document.createElement("canvas");return window.atob&&t.getContext&&t.getContext("2d")&&window.Blob},n.isResizeSupported()&&Object.defineProperty(window.Blob.prototype,"name",{get:function(){return this.$ngfName},set:function(t){this.$ngfName=t},configurable:!0}),n.resize=function(t,i){if(0!==t.type.indexOf("image"))return n.emptyPromise(t);var s=e.defer();return n.dataUrl(t,!0).then((function(e){r(e,i.width,i.height,i.quality,i.type||t.type,i.ratio,i.centerCrop,i.resizeIf).then((function(r){if("image/jpeg"===t.type&&!1!==i.restoreExif)try{r=n.restoreExif(e,r)}catch(t){setTimeout((function(){throw t}),1)}try{var o=n.dataUrltoBlob(r,t.name,t.size);s.resolve(o)}catch(t){s.reject(t)}}),(function(e){"resizeIf"===e&&s.resolve(t),s.reject(e)}))}),(function(t){s.reject(t)})),s.promise},n}]),function(){function t(t,n,r,i,s,o,a,u,c,l){function h(){return n.attr("disabled")||v("ngfDropDisabled",t)}function f(e,n,r){if(e){var i;try{i=e&&e.getData&&e.getData("text/html")}catch(t){}g(e.items,e.files,!1!==v("ngfAllowDir",t),v("multiple")||v("ngfMultiple",t)).then((function(t){t.length?p(t,n):d(r,i).then((function(t){p(t,n)}))}))}}function p(e,n){u.updateModel(i,r,t,v("ngfChange")||v("ngfDrop"),e,n)}function d(e,n){if(!u.shouldUpdateOn(e,r,t)||"string"!=typeof n)return u.rejectPromise([]);var i=[];n.replace(/<(img src|img [^>]* src) *=\"([^\"]*)\"/gi,(function(t,e,n){i.push(n)}));var s=[],o=[];if(i.length){angular.forEach(i,(function(t){s.push(u.urlToBlob(t).then((function(t){o.push(t)})))}));var a=l.defer();return l.all(s).then((function(){a.resolve(o)}),(function(t){a.reject(t)})),a.promise}return u.emptyPromise()}function g(e,n,i,s){function o(t,e){var n=l.defer();if(null!=t)if(t.isDirectory){var r=[u.emptyPromise()];if(f){var i={type:"directory"};i.name=i.path=(e||"")+t.name,p.push(i)}var s=t.createReader(),a=[],g=function(){s.readEntries((function(i){try{i.length?(a=a.concat(Array.prototype.slice.call(i||[],0)),g()):(angular.forEach(a.slice(0),(function(n){p.length<=c&&h>=d&&r.push(o(n,(e||"")+t.name+"/"))})),l.all(r).then((function(){n.resolve()}),(function(t){n.reject(t)})))}catch(t){n.reject(t)}}),(function(t){n.reject(t)}))};g()}else t.file((function(t){try{t.path=(e||"")+t.name,f&&(t=u.rename(t,t.path)),p.push(t),d+=t.size,n.resolve()}catch(t){n.reject(t)}}),(function(t){n.reject(t)}));return n.promise}var c=u.getValidationAttr(r,t,"maxFiles");null==c&&(c=Number.MAX_VALUE);var h=u.getValidationAttr(r,t,"maxTotalSize");null==h&&(h=Number.MAX_VALUE);var f=v("ngfIncludeDir",t),p=[],d=0,g=[u.emptyPromise()];if(e&&e.length>0&&"file:"!==a.location.protocol)for(var m=0;m<e.length;m++){if(e[m].webkitGetAsEntry&&e[m].webkitGetAsEntry()&&e[m].webkitGetAsEntry().isDirectory){var y=e[m].webkitGetAsEntry();if(y.isDirectory&&!i)continue;null!=y&&g.push(o(y))}else{var b=e[m].getAsFile();null!=b&&(p.push(b),d+=b.size)}if(p.length>c||d>h||!s&&p.length>0)break}else if(null!=n)for(var x=0;x<n.length;x++){var w=n.item(x);if((w.type||w.size>0)&&(p.push(w),d+=w.size),p.length>c||d>h||!s&&p.length>0)break}var S=l.defer();return l.all(g).then((function(){if(s||f||!p.length)S.resolve(p);else{for(var t=0;p[t]&&"directory"===p[t].type;)t++;S.resolve([p[t]])}}),(function(t){S.reject(t)})),S.promise}var m=e(),v=function(t,e,n){return u.attrGetter(t,r,e,n)};if(v("dropAvailable")&&o((function(){t[v("dropAvailable")]?t[v("dropAvailable")].value=m:t[v("dropAvailable")]=m})),m){null==v("ngfSelect")&&u.registerModelChangeValidator(i,r,t);var y,b=null,x=s(v("ngfStopPropagation")),w=1;n[0].addEventListener("dragover",(function(e){if(!h()&&u.shouldUpdateOn("drop",r,t)){if(e.preventDefault(),x(t)&&e.stopPropagation(),navigator.userAgent.indexOf("Chrome")>-1){var i=e.dataTransfer.effectAllowed;e.dataTransfer.dropEffect="move"===i||"linkMove"===i?"move":"copy"}o.cancel(b),y||(y="C",function(t,e,n,r){var i=v("ngfDragOverClass",t,{$event:n}),s="dragover";if(angular.isString(i))s=i;else if(i&&(i.delay&&(w=i.delay),i.accept||i.reject)){var o=n.dataTransfer.items;if(null!=o&&o.length)for(var a=i.pattern||v("ngfPattern",t,{$event:n}),c=o.length;c--;){if(!u.validatePattern(o[c],a)){s=i.reject;break}s=i.accept}else s=i.accept}r(s)}(t,0,e,(function(r){y=r,n.addClass(y),v("ngfDrag",t,{$isDragging:!0,$class:y,$event:e})})))}}),!1),n[0].addEventListener("dragenter",(function(e){!h()&&u.shouldUpdateOn("drop",r,t)&&(e.preventDefault(),x(t)&&e.stopPropagation())}),!1),n[0].addEventListener("dragleave",(function(e){!h()&&u.shouldUpdateOn("drop",r,t)&&(e.preventDefault(),x(t)&&e.stopPropagation(),b=o((function(){y&&n.removeClass(y),y=null,v("ngfDrag",t,{$isDragging:!1,$event:e})}),w||100))}),!1),n[0].addEventListener("drop",(function(e){!h()&&u.shouldUpdateOn("drop",r,t)&&(e.preventDefault(),x(t)&&e.stopPropagation(),y&&n.removeClass(y),y=null,f(e.dataTransfer,e,"dropUrl"))}),!1),n[0].addEventListener("paste",(function(e){navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&v("ngfEnableFirefoxPaste",t)&&e.preventDefault(),!h()&&u.shouldUpdateOn("paste",r,t)&&f(e.clipboardData||e.originalEvent.clipboardData,e,"pasteUrl")}),!1),navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&v("ngfEnableFirefoxPaste",t)&&(n.attr("contenteditable",!0),n.on("keypress",(function(t){t.metaKey||t.ctrlKey||t.preventDefault()})))}else!0===v("ngfHideOnDropNotAvailable",t)&&n.css("display","none")}function e(){var t=document.createElement("div");return"draggable"in t&&"ondrop"in t&&!/Edge\/12./i.test(navigator.userAgent)}r.directive("ngfDrop",["$parse","$timeout","$window","Upload","$http","$q",function(e,n,r,i,s,o){return{restrict:"AEC",require:"?ngModel",link:function(s,a,u,c){t(s,a,u,c,e,n,r,i,0,o)}}}]),r.directive("ngfNoFileDrop",(function(){return function(t,n){e()&&n.css("display","none")}})),r.directive("ngfDropAvailable",["$parse","$timeout","Upload",function(t,n,r){return function(i,s,o){if(e()){var a=t(r.attrGetter("ngfDropAvailable",o));n((function(){a(i),a.assign&&a.assign(i,!0)}))}}}])}(),r.service("UploadExif",["UploadResize","$q",function(t,e){var n=t;return n.isExifSupported=function(){return window.FileReader&&(new FileReader).readAsArrayBuffer&&n.isResizeSupported()},n.readOrientation=function(t){var n=e.defer(),r=new FileReader,i=t.slice?t.slice(0,65536):t;return r.readAsArrayBuffer(i),r.onerror=function(t){return n.reject(t)},r.onload=function(t){var e={orientation:1},r=new DataView(this.result);if(65496!==r.getUint16(0,!1))return n.resolve(e);for(var i=r.byteLength,s=2;i>s;){var o=r.getUint16(s,!1);if(s+=2,65505===o){if(1165519206!==r.getUint32(s+=2,!1))return n.resolve(e);var a=18761===r.getUint16(s+=6,!1);s+=r.getUint32(s+4,a);var u=r.getUint16(s,a);s+=2;for(var c=0;u>c;c++)if(274===r.getUint16(s+12*c,a)){var l=r.getUint16(s+12*c+8,a);return l>=2&&8>=l&&(r.setUint16(s+12*c+8,1,a),e.fixedArrayBuffer=t.target.result),e.orientation=l,n.resolve(e)}}else{if(65280!=(65280&o))break;s+=r.getUint16(s,!1)}}return n.resolve(e)},n.promise},n.applyExifRotation=function(t){if(0!==t.type.indexOf("image/jpeg"))return n.emptyPromise(t);var r=e.defer();return n.readOrientation(t).then((function(e){return e.orientation<2||e.orientation>8?r.resolve(t):void n.dataUrl(t,!0).then((function(i){var s=document.createElement("canvas"),o=document.createElement("img");o.onload=function(){try{s.width=e.orientation>4?o.height:o.width,s.height=e.orientation>4?o.width:o.height;var i=s.getContext("2d");(function(t,e,n,r){switch(e){case 2:return t.transform(-1,0,0,1,n,0);case 3:return t.transform(-1,0,0,-1,n,r);case 4:return t.transform(1,0,0,-1,0,r);case 5:return t.transform(0,1,1,0,0,0);case 6:return t.transform(0,1,-1,0,r,0);case 7:return t.transform(0,-1,-1,0,r,n);case 8:t.transform(0,-1,1,0,0,n)}})(i,e.orientation,o.width,o.height),i.drawImage(o,0,0);var a=s.toDataURL(t.type||"image/WebP",.934);a=n.restoreExif(function(t){for(var e="",n=new Uint8Array(t),r=n.byteLength,i=0;r>i;i++)e+=String.fromCharCode(n[i]);return window.btoa(e)}(e.fixedArrayBuffer),a);var u=n.dataUrltoBlob(a,t.name);r.resolve(u)}catch(t){return r.reject(t)}},o.onerror=function(){r.reject()},o.src=i}),(function(t){r.reject(t)}))}),(function(t){r.reject(t)})),r.promise},n.restoreExif=function(t,e){var n={KEY_STR:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode64:function(t){var e,n,r,i,s,o="",a="",u="",c=0;do{r=(e=t[c++])>>2,i=(3&e)<<4|(n=t[c++])>>4,s=(15&n)<<2|(a=t[c++])>>6,u=63&a,isNaN(n)?s=u=64:isNaN(a)&&(u=64),o=o+this.KEY_STR.charAt(r)+this.KEY_STR.charAt(i)+this.KEY_STR.charAt(s)+this.KEY_STR.charAt(u),e=n=a="",r=i=s=u=""}while(c<t.length);return o},restore:function(t,e){t.match("data:image/jpeg;base64,")&&(t=t.replace("data:image/jpeg;base64,",""));var n=this.decode64(t),r=this.slice2Segments(n),i=this.exifManipulation(e,r);return"data:image/jpeg;base64,"+this.encode64(i)},exifManipulation:function(t,e){var n=this.getExifArray(e),r=this.insertExif(t,n);return new Uint8Array(r)},getExifArray:function(t){for(var e,n=0;n<t.length;n++)if(255===(e=t[n])[0]&225===e[1])return e;return[]},insertExif:function(t,e){var n=t.replace("data:image/jpeg;base64,",""),r=this.decode64(n),i=r.indexOf(255,3),s=r.slice(0,i),o=r.slice(i),a=s;return(a=a.concat(e)).concat(o)},slice2Segments:function(t){for(var e=0,n=[];!(255===t[e]&218===t[e+1]);){if(255===t[e]&216===t[e+1])e+=2;else{var r=e+(256*t[e+2]+t[e+3])+2,i=t.slice(e,r);n.push(i),e=r}if(e>t.length)break}return n},decode64:function(t){var e,n,r,i,s="",o="",a=0,u=[];/[^A-Za-z0-9\+\/\=]/g.exec(t)&&console.log("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, NaNExpect errors in decoding."),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=this.KEY_STR.indexOf(t.charAt(a++))<<2|(r=this.KEY_STR.indexOf(t.charAt(a++)))>>4,n=(15&r)<<4|(i=this.KEY_STR.indexOf(t.charAt(a++)))>>2,s=(3&i)<<6|(o=this.KEY_STR.indexOf(t.charAt(a++))),u.push(e),64!==i&&u.push(n),64!==o&&u.push(s),e=n=s="",r=i=o=""}while(a<t.length);return u}};return n.restore(t,e)},n}])},function(t,e){
|
|
41
41
|
/*! 12.2.13 */
|
|
42
42
|
!function(){function t(t,e){window.XMLHttpRequest.prototype[t]=e(window.XMLHttpRequest.prototype[t])}function e(t,e,n){try{Object.defineProperty(t,e,{get:n})}catch(t){}}if(window.FileAPI||(window.FileAPI={}),!window.XMLHttpRequest)throw"AJAX is not supported. XMLHttpRequest is not defined.";if(FileAPI.shouldLoad=!window.FormData||FileAPI.forceLoad,FileAPI.shouldLoad){var n=function(t){if(!t.__listeners){t.upload||(t.upload={}),t.__listeners=[];var e=t.upload.addEventListener;t.upload.addEventListener=function(n,r){t.__listeners[n]=r,e&&e.apply(this,arguments)}}};t("open",(function(t){return function(e,r,i){n(this),this.__url=r;try{t.apply(this,[e,r,i])}catch(n){n.message.indexOf("Access is denied")>-1&&(this.__origError=n,t.apply(this,[e,"_fix_for_ie_crossdomain__",i]))}}})),t("getResponseHeader",(function(t){return function(e){return this.__fileApiXHR&&this.__fileApiXHR.getResponseHeader?this.__fileApiXHR.getResponseHeader(e):null==t?null:t.apply(this,[e])}})),t("getAllResponseHeaders",(function(t){return function(){return this.__fileApiXHR&&this.__fileApiXHR.getAllResponseHeaders?this.__fileApiXHR.getAllResponseHeaders():null==t?null:t.apply(this)}})),t("abort",(function(t){return function(){return this.__fileApiXHR&&this.__fileApiXHR.abort?this.__fileApiXHR.abort():null==t?null:t.apply(this)}})),t("setRequestHeader",(function(t){return function(e,r){if("__setXHR_"===e){n(this);var i=r(this);i instanceof Function&&i(this)}else this.__requestHeaders=this.__requestHeaders||{},this.__requestHeaders[e]=r,t.apply(this,arguments)}})),t("send",(function(t){return function(){var n=this;if(arguments[0]&&arguments[0].__isFileAPIShim){for(var r=arguments[0],i={url:n.__url,jsonp:!1,cache:!0,complete:function(t,r){t&&angular.isString(t)&&-1!==t.indexOf("#2174")&&(t=null),n.__completed=!0,!t&&n.__listeners.load&&n.__listeners.load({type:"load",loaded:n.__loaded,total:n.__total,target:n,lengthComputable:!0}),!t&&n.__listeners.loadend&&n.__listeners.loadend({type:"loadend",loaded:n.__loaded,total:n.__total,target:n,lengthComputable:!0}),"abort"===t&&n.__listeners.abort&&n.__listeners.abort({type:"abort",loaded:n.__loaded,total:n.__total,target:n,lengthComputable:!0}),void 0!==r.status&&e(n,"status",(function(){return 0===r.status&&t&&"abort"!==t?500:r.status})),void 0!==r.statusText&&e(n,"statusText",(function(){return r.statusText})),e(n,"readyState",(function(){return 4})),void 0!==r.response&&e(n,"response",(function(){return r.response}));var i=r.responseText||(t&&0===r.status&&"abort"!==t?t:void 0);e(n,"responseText",(function(){return i})),e(n,"response",(function(){return i})),t&&e(n,"err",(function(){return t})),n.__fileApiXHR=r,n.onreadystatechange&&n.onreadystatechange(),n.onload&&n.onload()},progress:function(t){if(t.target=n,n.__listeners.progress&&n.__listeners.progress(t),n.__total=t.total,n.__loaded=t.loaded,t.total===t.loaded){var e=this;setTimeout((function(){n.__completed||(n.getAllResponseHeaders=function(){},e.complete(null,{status:204,statusText:"No Content"}))}),FileAPI.noContentTimeout||1e4)}},headers:n.__requestHeaders,data:{},files:{}},s=0;s<r.data.length;s++){var o=r.data[s];null!=o.val&&null!=o.val.name&&null!=o.val.size&&null!=o.val.type?i.files[o.key]=o.val:i.data[o.key]=o.val}setTimeout((function(){if(!FileAPI.hasFlash)throw'Adode Flash Player need to be installed. To check ahead use "FileAPI.hasFlash"';n.__fileApiXHR=FileAPI.upload(i)}),1)}else{if(this.__origError)throw this.__origError;t.apply(n,arguments)}}})),window.XMLHttpRequest.__isFileAPIShim=!0,window.FormData=FormData=function(){return{append:function(t,e,n){e.__isFileAPIBlobShim&&(e=e.data[0]),this.data.push({key:t,val:e,name:n})},data:[],__isFileAPIShim:!0}},window.Blob=Blob=function(t){return{data:t,__isFileAPIBlobShim:!0}}}}(),function(){function t(){try{if(new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))return!0}catch(t){if(void 0!==navigator.mimeTypes["application/x-shockwave-flash"])return!0}return!1}function e(t){var e=0,n=0;if(window.jQuery)return jQuery(t).offset();if(t.offsetParent)do{e+=t.offsetLeft-t.scrollLeft,n+=t.offsetTop-t.scrollTop,t=t.offsetParent}while(t);return{left:e,top:n}}if(FileAPI.shouldLoad){if(FileAPI.hasFlash=t(),FileAPI.forceLoad&&(FileAPI.html5=!1),!FileAPI.upload){var n,r,i,s,o,a=document.createElement("script"),u=document.getElementsByTagName("script");if(window.FileAPI.jsUrl)n=window.FileAPI.jsUrl;else if(window.FileAPI.jsPath)r=window.FileAPI.jsPath;else for(i=0;i<u.length;i++)if((s=(o=u[i].src).search(/\/ng\-file\-upload[\-a-zA-z0-9\.]*\.js/))>-1){r=o.substring(0,s+1);break}null==FileAPI.staticPath&&(FileAPI.staticPath=r),a.setAttribute("src",n||r+"FileAPI.min.js"),document.getElementsByTagName("head")[0].appendChild(a)}FileAPI.ngfFixIE=function(n,r,i){if(!t())throw'Adode Flash Player need to be installed. To check ahead use "FileAPI.hasFlash"';n.bind("mouseenter",(function(){var t=r.parent();n.attr("disabled")?t&&t.removeClass("js-fileapi-wrapper"):(r.attr("__ngf_flash_")||(r.unbind("change"),r.unbind("click"),r.bind("change",(function(t){s.apply(this,[t]),i.apply(this,[t])})),r.attr("__ngf_flash_","true")),t.addClass("js-fileapi-wrapper"),function(t){return"input"===t[0].tagName.toLowerCase()&&t.attr("type")&&"file"===t.attr("type").toLowerCase()}(n)||(t.css("position","absolute").css("top",e(n[0]).top+"px").css("left",e(n[0]).left+"px").css("width",n[0].offsetWidth+"px").css("height",n[0].offsetHeight+"px").css("filter","alpha(opacity=0)").css("display",n.css("display")).css("overflow","hidden").css("z-index","900000").css("visibility","visible"),r.css("width",n[0].offsetWidth+"px").css("height",n[0].offsetHeight+"px").css("position","absolute").css("top","0px").css("left","0px")))}));var s=function(t){for(var e=FileAPI.getFiles(t),n=0;n<e.length;n++)void 0===e[n].size&&(e[n].size=0),void 0===e[n].name&&(e[n].name="file"),void 0===e[n].type&&(e[n].type="undefined");t.target||(t.target={}),t.target.files=e,t.target.files!==e&&(t.__files_=e),(t.__files_||t.target.files).item=function(e){return(t.__files_||t.target.files)[e]||null}}},FileAPI.disableFileInput=function(t,e){e?t.removeClass("js-fileapi-wrapper"):t.addClass("js-fileapi-wrapper")}}}(),window.FileReader||(window.FileReader=function(){var t=this,e=!1;this.listeners={},this.addEventListener=function(e,n){t.listeners[e]=t.listeners[e]||[],t.listeners[e].push(n)},this.removeEventListener=function(e,n){t.listeners[e]&&t.listeners[e].splice(t.listeners[e].indexOf(n),1)},this.dispatchEvent=function(e){var n=t.listeners[e.type];if(n)for(var r=0;r<n.length;r++)n[r].call(t,e)},this.onabort=this.onerror=this.onload=this.onloadstart=this.onloadend=this.onprogress=null;var n=function(e,n){var r={type:e,target:t,loaded:n.loaded,total:n.total,error:n.error};return null!=n.result&&(r.target.result=n.result),r},r=function(r){var i;e||(e=!0,t.onloadstart&&t.onloadstart(n("loadstart",r))),"load"===r.type?(t.onloadend&&t.onloadend(n("loadend",r)),i=n("load",r),t.onload&&t.onload(i),t.dispatchEvent(i)):"progress"===r.type?(i=n("progress",r),t.onprogress&&t.onprogress(i),t.dispatchEvent(i)):(i=n("error",r),t.onerror&&t.onerror(i),t.dispatchEvent(i))};this.readAsDataURL=function(t){FileAPI.readAsDataURL(t,r)},this.readAsText=function(t){FileAPI.readAsText(t,r)}})},,function(t,e,n){var r;
|
|
43
43
|
/*!
|
|
44
44
|
* angular-translate - v2.19.0 - 2021-09-02
|
|
45
45
|
*
|
|
46
46
|
* Copyright (c) 2021 The angular-translate team, Pascal Precht; Licensed MIT
|
|
47
|
-
*/void 0===(r=function(){return function(){function t(t){"use strict";var e=t.storageKey(),n=t.storage(),r=function(){var r=t.preferredLanguage();angular.isString(r)?t.use(r):n.put(e,t.use())};r.displayName="fallbackFromIncorrectStorageValue",n?n.get(e)?t.use(n.get(e)).catch(r):r():angular.isString(t.preferredLanguage())&&t.use(t.preferredLanguage())}function e(t,e,n,r){"use strict";var i,s,o,a,u,c,l,h,f,p,d,g,m,v,y,b,w={},x=[],S=t,E=[],F="translate-cloak",A=!1,C=!1,D=!0,I=".",$=!1,R=!1,T=0,_=!0,P="default",k={default:function(t){return(t||"").split("-").join("_")},java:function(t){var e=(t||"").split("-").join("_"),n=e.split("_");return n.length>1?n[0].toLowerCase()+"_"+n[1].toUpperCase():e},bcp47:function(t){var e=(t||"").split("_").join("-"),n=e.split("-");switch(n.length){case 1:n[0]=n[0].toLowerCase();break;case 2:n[0]=n[0].toLowerCase(),4===n[1].length?n[1]=n[1].charAt(0).toUpperCase()+n[1].slice(1).toLowerCase():n[1]=n[1].toUpperCase();break;case 3:n[0]=n[0].toLowerCase(),n[1]=n[1].charAt(0).toUpperCase()+n[1].slice(1).toLowerCase(),n[2]=n[2].toUpperCase();break;default:return e}return n.join("-")},"iso639-1":function(t){return(t||"").split("_").join("-").split("-")[0].toLowerCase()}},O=function(){if(angular.isFunction(r.getLocale))return r.getLocale();var t,n,i=e.$get().navigator,s=["language","browserLanguage","systemLanguage","userLanguage"];if(angular.isArray(i.languages))for(t=0;t<i.languages.length;t++)if((n=i.languages[t])&&n.length)return n;for(t=0;t<s.length;t++)if((n=i[s[t]])&&n.length)return n;return null};O.displayName="angular-translate/service: getFirstBrowserLanguage";var j=function(){var t=O()||"";return k[P]&&(t=k[P](t)),t};j.displayName="angular-translate/service: getLocale";var B=function(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},N=function(){return this.toString().replace(/^\s+|\s+$/g,"")},L=function(t){return angular.isString(t)?t.toLowerCase():t},H=function(t){if(t){for(var e,n=[],r=L(t),i=0,o=x.length;i<o;i++)n.push(L(x[i]));if((i=B(n,r))>-1)return x[i];if(s)for(var a in s)if(s.hasOwnProperty(a)){var u=!1,c=Object.prototype.hasOwnProperty.call(s,a)&&L(a)===L(t);if("*"===a.slice(-1)&&(u=L(a.slice(0,-1))===L(t.slice(0,a.length-1))),(c||u)&&(e=s[a],B(n,L(e))>-1))return e}var l=t.split("_");return l.length>1&&B(n,L(l[0]))>-1?l[0]:void 0}},M=function(t,e){if(!t&&!e)return w;if(t&&!e){if(angular.isString(t))return w[t]}else angular.isObject(w[t])||(w[t]={}),angular.extend(w[t],U(e));return this};this.translations=M,this.cloakClassName=function(t){return t?(F=t,this):F},this.allowNamespaces=function(t){return void 0===t?D:(D=t,this)},this.nestedObjectDelimeter=function(t){return t?(I=t,this):I};var U=function(t,e,n,r){var i,s,o;if(e||(e=[]),n||(n={}),!D)return t;for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(o=t[i],angular.isObject(o)?U(o,e.concat(i),n,i):(s=e.length?""+e.join(I)+I+i:i,e.length&&i===r&&(n[""+e.join(I)]="@:"+s),n[s]=o));return n};U.displayName="flatObject",this.addInterpolation=function(t){return E.push(t),this},this.useMessageFormatInterpolation=function(){return this.useInterpolation("$translateMessageFormatInterpolation")},this.useInterpolation=function(t){return p=t,this},this.useSanitizeValueStrategy=function(t){return n.useStrategy(t),this},this.preferredLanguage=function(t){return t?(V(t),this):i};var V=function(t){return t&&(i=t),i};this.translationNotFoundIndicator=function(t){return this.translationNotFoundIndicatorLeft(t),this.translationNotFoundIndicatorRight(t),this},this.translationNotFoundIndicatorLeft=function(t){return t?(m=t,this):m},this.translationNotFoundIndicatorRight=function(t){return t?(v=t,this):v},this.fallbackLanguage=function(t){return q(t),this};var q=function(t){return t?(angular.isString(t)?(a=!0,o=[t]):angular.isArray(t)&&(a=!1,o=t),angular.isString(i)&&B(o,i)<0&&o.push(i),this):a?o[0]:o};this.use=function(t){if(t){if(!w[t]&&!d)throw new Error("$translateProvider couldn't find translationTable for langKey: '"+t+"'");return u=t,this}return u},this.resolveClientLocale=function(){return j()};var K=function(t){return t?(S=t,this):h?h+S:S};this.storageKey=K,this.useUrlLoader=function(t,e){return this.useLoader("$translateUrlLoader",angular.extend({url:t},e))},this.useStaticFilesLoader=function(t){return this.useLoader("$translateStaticFilesLoader",t)},this.useLoader=function(t,e){return d=t,g=e||{},this},this.useLocalStorage=function(){return this.useStorage("$translateLocalStorage")},this.useCookieStorage=function(){return this.useStorage("$translateCookieStorage")},this.useStorage=function(t){return l=t,this},this.storagePrefix=function(t){return t?(h=t,this):t},this.useMissingTranslationHandlerLog=function(){return this.useMissingTranslationHandler("$translateMissingTranslationHandlerLog")},this.useMissingTranslationHandler=function(t){return f=t,this},this.usePostCompiling=function(t){return A=!!t,this},this.forceAsyncReload=function(t){return C=!!t,this},this.uniformLanguageTag=function(t){return t?angular.isString(t)&&(t={standard:t}):t={},P=t.standard,this},this.determinePreferredLanguage=function(t){var e=t&&angular.isFunction(t)?t():j();return i=x.length&&H(e)||e,this},this.registerAvailableLanguageKeys=function(t,e){return t?(x=t,e&&(s=e),this):x},this.useLoaderCache=function(t){return!1===t?y=void 0:!0===t?y=!0:void 0===t?y="$translationCache":t&&(y=t),this},this.directivePriority=function(t){return void 0===t?T:(T=t,this)},this.statefulFilter=function(t){return void 0===t?_:(_=t,this)},this.postProcess=function(t){return b=t||void 0,this},this.keepContent=function(t){return R=!!t,this},this.$get=["$log","$injector","$rootScope","$q",function(t,e,n,r){var s,h,P,k=e.get(p||"$translateDefaultInterpolation"),O=!1,L={},z={},G=function(t,e,n,a,c,f){!u&&i&&(u=i);var p=c&&c!==u?H(c)||c:u;if(c&&ot(c),angular.isArray(t))return function(t){for(var i={},s=[],o=function(t){var s=r.defer(),o=function(e){i[t]=e,s.resolve([t,e])};return G(t,e,n,a,c,f).then(o,o),s.promise},u=0,l=t.length;u<l;u++)s.push(o(t[u]));return r.all(s).then((function(){return i}))}(t);var d=r.defer();if(!t)throw new TypeError("translationId must be a not empty string");t=N.apply(t);var g=function(){var t=z[p]||z[i];if(h=0,l&&!t){var e=s.get(S);if(t=z[e],o&&o.length){var n=B(o,e);h=0===n?1:0,B(o,i)<0&&o.push(i)}}return t}();if(g){var m=function(){c||(p=u),rt(t,e,n,a,p,f).then(d.resolve,d.reject)};m.displayName="promiseResolved",g.finally(m).catch(angular.noop)}else rt(t,e,n,a,p,f).then(d.resolve,d.reject);return d.promise},W=function(t){return m&&(t=[m,t].join(" ")),v&&(t=[t,v].join(" ")),t},Y=function(t){u=t,l&&s.put(G.storageKey(),u),n.$emit("$translateChangeSuccess",{language:t}),k.setLocale(u);var e=function(t,e){L[e].setLocale(u)};e.displayName="eachInterpolatorLocaleSetter",angular.forEach(L,e),n.$emit("$translateChangeEnd",{language:t})},X=function(t){if(!t)throw"No language key specified for loading.";var i=r.defer();n.$emit("$translateLoadingStart",{language:t}),O=!0;var s=y;"string"==typeof s&&(s=e.get(s));var o=angular.extend({},g,{key:t,$http:angular.extend({},{cache:s},g.$http)}),a=function(e){var r={};n.$emit("$translateLoadingSuccess",{language:t}),angular.isArray(e)?angular.forEach(e,(function(t){angular.extend(r,U(t))})):angular.extend(r,U(e)),O=!1,i.resolve({key:t,table:r}),n.$emit("$translateLoadingEnd",{language:t})};a.displayName="onLoaderSuccess";var u=function(t){n.$emit("$translateLoadingError",{language:t}),i.reject(t),n.$emit("$translateLoadingEnd",{language:t})};return u.displayName="onLoaderError",e.get(d)(o).then(a,u),i.promise};if(l&&(!(s=e.get(l)).get||!s.put))throw new Error("Couldn't use storage '"+l+"', missing get() or put() method!");if(E.length){var J=function(t){var n=e.get(t);n.setLocale(i||u),L[n.getInterpolationIdentifier()]=n};J.displayName="interpolationFactoryAdder",angular.forEach(E,J)}var Z=function(t,e,n,i,s){var o=r.defer(),a=function(r){if(Object.prototype.hasOwnProperty.call(r,e)&&null!==r[e]){i.setLocale(t);var a=r[e];if("@:"===a.substr(0,2))Z(t,a.substr(2),n,i,s).then(o.resolve,o.reject);else{var c=i.interpolate(r[e],n,"service",s,e);c=st(e,r[e],c,n,t),o.resolve(c)}i.setLocale(u)}else o.reject()};return a.displayName="fallbackTranslationResolver",function(t){var e=r.defer();if(Object.prototype.hasOwnProperty.call(w,t))e.resolve(w[t]);else if(z[t]){var n=function(t){M(t.key,t.table),e.resolve(t.table)};n.displayName="translationTableResolver",z[t].then(n,e.reject)}else e.reject();return e.promise}(t).then(a,o.reject),o.promise},Q=function(t,e,n,r,i){var s,o=w[t];if(o&&Object.prototype.hasOwnProperty.call(o,e)&&null!==o[e]){if(r.setLocale(t),s=r.interpolate(o[e],n,"filter",i,e),s=st(e,o[e],s,n,t,i),!angular.isString(s)&&angular.isFunction(s.$$unwrapTrustedValue)){var a=s.$$unwrapTrustedValue();if("@:"===a.substr(0,2))return Q(t,a.substr(2),n,r,i)}else if("@:"===s.substr(0,2))return Q(t,s.substr(2),n,r,i);r.setLocale(u)}return s},tt=function(t,n,r,i){return f?e.get(f)(t,u,n,r,i):t},et=function(t,e,n,i,s,a){var u=r.defer();if(t<o.length){var c=o[t];Z(c,e,n,i,a).then((function(t){u.resolve(t)}),(function(){return et(t+1,e,n,i,s,a).then(u.resolve,u.reject)}))}else if(s)u.resolve(s);else{var l=tt(e,n,s);f&&l?u.resolve(l):u.reject(W(e))}return u.promise},nt=function(t,e,n,r,i){var s;if(t<o.length){var a=o[t];(s=Q(a,e,n,r,i))||""===s||(s=nt(t+1,e,n,r))}return s},rt=function(t,e,n,i,s,a){var u=r.defer(),c=s?w[s]:w,l=n?L[n]:k;if(c&&Object.prototype.hasOwnProperty.call(c,t)&&null!==c[t]){var p=c[t];if("@:"===p.substr(0,2))G(p.substr(2),e,n,i,s,a).then(u.resolve,u.reject);else{var d=l.interpolate(p,e,"service",a,t);d=st(t,p,d,e,s),u.resolve(d)}}else{var g;f&&!O&&(g=tt(t,e,i)),s&&o&&o.length?function(t,e,n,r,i){return et(P>0?P:h,t,e,n,r,i)}(t,e,l,i,a).then((function(t){u.resolve(t)}),(function(t){u.reject(W(t))})):f&&!O&&g?i?u.resolve(i):u.resolve(g):i?u.resolve(i):u.reject(W(t))}return u.promise},it=function(t,e,n,r,i){var s,a=r?w[r]:w,u=k;if(L&&Object.prototype.hasOwnProperty.call(L,n)&&(u=L[n]),a&&Object.prototype.hasOwnProperty.call(a,t)&&null!==a[t]){var c=a[t];"@:"===c.substr(0,2)?s=it(c.substr(2),e,n,r,i):(s=u.interpolate(c,e,"filter",i,t),s=st(t,c,s,e,r,i))}else{var l;f&&!O&&(l=tt(t,e,i)),r&&o&&o.length?(h=0,s=function(t,e,n,r){return nt(P>0?P:h,t,e,n,r)}(t,e,u,i)):s=f&&!O&&l?l:W(t)}return s},st=function(t,n,r,i,s,o){var a=b;return a&&("string"==typeof a&&(a=e.get(a)),a)?a(t,n,r,i,s,o):r},ot=function(t){w[t]||!d||z[t]||(z[t]=X(t).then((function(t){return M(t.key,t.table),t})))};G.preferredLanguage=function(t){return t&&V(t),i},G.cloakClassName=function(){return F},G.allowNamespaces=function(){return D},G.nestedObjectDelimeter=function(){return I},G.fallbackLanguage=function(t){if(null!=t){if(q(t),d&&o&&o.length)for(var e=0,n=o.length;e<n;e++)z[o[e]]||(z[o[e]]=X(o[e]));G.use(G.use())}return a?o[0]:o},G.useFallbackLanguage=function(t){if(null!=t)if(t){var e=B(o,t);e>-1&&(P=e)}else P=0},G.proposedLanguage=function(){return c},G.storage=function(){return s},G.negotiateLocale=H,G.use=function(t){if(!t)return u;var e=r.defer();e.promise.then(null,angular.noop),n.$emit("$translateChangeStart",{language:t});var i=H(t);return x.length>0&&!i?r.reject(t):(i&&(t=i),c=t,!C&&w[t]||!d||z[t]?z[t]?z[t].then((function(t){return c===t.key&&Y(t.key),e.resolve(t.key),t}),(function(t){return!u&&o&&o.length>0&&o[0]!==t?G.use(o[0]).then(e.resolve,e.reject):e.reject(t)})):(e.resolve(t),Y(t)):(z[t]=X(t).then((function(n){return M(n.key,n.table),e.resolve(n.key),c===t&&Y(n.key),n}),(function(t){return n.$emit("$translateChangeError",{language:t}),e.reject(t),n.$emit("$translateChangeEnd",{language:t}),r.reject(t)})),z[t].finally((function(){!function(t){c===t&&(c=void 0),z[t]=void 0}(t)})).catch(angular.noop)),e.promise)},G.resolveClientLocale=function(){return j()},G.storageKey=function(){return K()},G.isPostCompilingEnabled=function(){return A},G.isForceAsyncReloadEnabled=function(){return C},G.isKeepContent=function(){return R},G.refresh=function(t){if(!d)throw new Error("Couldn't refresh translation table, no loader registered!");n.$emit("$translateRefreshStart",{language:t});var e=r.defer(),i={};function s(t){var e=X(t);return z[t]=e,e.then((function(e){w[t]={},M(t,e.table),i[t]=!0}),angular.noop),e}if(e.promise.then((function(){for(var t in w)w.hasOwnProperty(t)&&(t in i||delete w[t]);u&&Y(u)}),angular.noop).finally((function(){n.$emit("$translateRefreshEnd",{language:t})})),t)w[t]?s(t).then(e.resolve,e.reject):e.reject();else{var a=o&&o.slice()||[];u&&-1===a.indexOf(u)&&a.push(u),r.all(a.map(s)).then(e.resolve,e.reject)}return e.promise},G.instant=function(t,e,n,r,s){var a=r&&r!==u?H(r)||r:u;if(null===t||angular.isUndefined(t))return t;if(r&&ot(r),angular.isArray(t)){for(var c={},l=0,h=t.length;l<h;l++)c[t[l]]=G.instant(t[l],e,n,r,s);return c}if(angular.isString(t)&&t.length<1)return t;t&&(t=N.apply(t));var p,d,g=[];i&&g.push(i),a&&g.push(a),o&&o.length&&(g=g.concat(o));for(var y=0,b=g.length;y<b;y++){var x=g[y];if(w[x]&&void 0!==w[x][t]&&(p=it(t,e,n,a,s)),void 0!==p)break}return p||""===p||(m||v?p=W(t):(p=k.interpolate(t,e,"filter",s),f&&!O&&(d=tt(t,e,s)),f&&!O&&d&&(p=d))),p},G.versionInfo=function(){return"2.19.0"},G.loaderCache=function(){return y},G.directivePriority=function(){return T},G.statefulFilter=function(){return _},G.isReady=function(){return $};var at=r.defer();at.promise.then((function(){$=!0})),G.onReady=function(t){var e=r.defer();return angular.isFunction(t)&&e.promise.then(t),$?e.resolve():at.promise.then(e.resolve),e.promise},G.getAvailableLanguageKeys=function(){return x.length>0?x:null},G.getTranslationTable=function(t){return(t=t||G.use())&&w[t]?angular.copy(w[t]):null};var ut=n.$on("$translateReady",(function(){at.resolve(),ut(),ut=null})),ct=n.$on("$translateChangeEnd",(function(){at.resolve(),ct(),ct=null}));if(d){if(angular.equals(w,{})&&G.use()&&G.use(G.use()),o&&o.length)for(var lt=function(t){return M(t.key,t.table),n.$emit("$translateChangeEnd",{language:t.key}),t},ht=0,ft=o.length;ht<ft;ht++){var pt=o[ht];!C&&w[pt]||(z[pt]=X(pt).then(lt))}}else n.$emit("$translateReady",{language:G.use()});return G}]}function n(t,e){"use strict";var n={setLocale:function(t){},getInterpolationIdentifier:function(){return"default"},useSanitizeValueStrategy:function(t){return e.useStrategy(t),this},interpolate:function(n,r,i,s,o){var a;return r=r||{},r=e.sanitize(r,"params",s,i),angular.isNumber(n)?a=""+n:angular.isString(n)?(a=t(n)(r),a=e.sanitize(a,"text",s,i)):a="",a}};return n}function r(t,e,n,r,i){"use strict";var s=function(){return this.toString().replace(/^\s+|\s+$/g,"")},o=function(t){return angular.isString(t)?t.toLowerCase():t};return{restrict:"AE",scope:!0,priority:t.directivePriority(),compile:function(a,u){var c=u.translateValues?u.translateValues:void 0,l=u.translateInterpolation?u.translateInterpolation:void 0,h=u.translateSanitizeStrategy?u.translateSanitizeStrategy:void 0,f=a[0].outerHTML.match(/translate-value-+/i),p="^(.*)("+e.startSymbol()+".*"+e.endSymbol()+")(.*)",d="^(.*)"+e.startSymbol()+"(.*)"+e.endSymbol()+"(.*)";return function(a,g,m){a.interpolateParams={},a.preText="",a.postText="",a.translateNamespace=function t(e){return e.translateNamespace?e.translateNamespace:e.$parent?t(e.$parent):void 0}(a);var v={},y=function(t){if(angular.isFunction(y._unwatchOld)&&(y._unwatchOld(),y._unwatchOld=void 0),angular.equals(t,"")||!angular.isDefined(t)){var n=s.apply(g.text()).replace(/\n/g," "),r=n.match(p);if(angular.isArray(r)){a.preText=r[1],a.postText=r[3],v.translate=e(r[2])(a.$parent);var i=n.match(d);angular.isArray(i)&&i[2]&&i[2].length&&(y._unwatchOld=a.$watch(i[2],(function(t){v.translate=t,F()})))}else v.translate=n||void 0}else v.translate=t;F()},b=function(t){m.$observe(t,(function(e){v[t]=e,F()}))};!function(t,e,n){if(e.translateValues&&angular.extend(t,r(e.translateValues)(a.$parent)),f)for(var i in n)Object.prototype.hasOwnProperty.call(e,i)&&"translateValue"===i.substr(0,14)&&"translateValues"!==i&&(t[o(i.substr(14,1))+i.substr(15)]=n[i])}(a.interpolateParams,m,u);var w=!0;for(var x in m.$observe("translate",(function(t){void 0===t?y(""):""===t&&w||(v.translate=t,F()),w=!1})),m)m.hasOwnProperty(x)&&"translateAttr"===x.substr(0,13)&&x.length>13&&b(x);if(m.$observe("translateDefault",(function(t){a.defaultText=t,F()})),h&&m.$observe("translateSanitizeStrategy",(function(t){a.sanitizeStrategy=r(t)(a.$parent),F()})),c&&m.$observe("translateValues",(function(t){t&&a.$parent.$watch((function(){angular.extend(a.interpolateParams,r(t)(a.$parent))}))})),f){var S=function(t){m.$observe(t,(function(e){var n=o(t.substr(14,1))+t.substr(15);a.interpolateParams[n]=e}))};for(var E in m)Object.prototype.hasOwnProperty.call(m,E)&&"translateValue"===E.substr(0,14)&&"translateValues"!==E&&S(E)}var F=function(){for(var t in v)v.hasOwnProperty(t)&&void 0!==v[t]&&A(t,v[t],a,a.interpolateParams,a.defaultText,a.translateNamespace)},A=function(e,n,r,i,s,o){n?(o&&"."===n.charAt(0)&&(n=o+n),t(n,i,l,s,r.translateLanguage,r.sanitizeStrategy).then((function(t){C(t,r,!0,e)}),(function(t){C(t,r,!1,e)}))):C(n,r,!1,e)},C=function(e,r,i,s){if(i||void 0!==r.defaultText&&(e=r.defaultText),"translate"===s){(i||!i&&!t.isKeepContent()&&void 0===m.translateKeepContent)&&g.empty().append(r.preText+e+r.postText);var o=t.isPostCompilingEnabled(),a=void 0!==u.translateCompile,c=a&&"false"!==u.translateCompile;(o&&!a||c)&&n(g.contents())(r)}else{var l=m.$attr[s];"data-"===l.substr(0,5)&&(l=l.substr(5)),l=l.substr(15),g.attr(l,e)}};(c||f||m.translateDefault)&&a.$watch("interpolateParams",F,!0),a.$on("translateLanguageChanged",F);var D=i.$on("$translateChangeSuccess",F);g.text().length?m.translate?y(m.translate):y(""):m.translate&&y(m.translate),F(),a.$on("$destroy",D)}}}}function i(t,e){"use strict";return{restrict:"A",priority:t.directivePriority(),link:function(n,r,i){var o,a,u,c={},l=function(){angular.forEach(o,(function(e,s){e&&(c[s]=!0,n.translateNamespace&&"."===e.charAt(0)&&(e=n.translateNamespace+e),t(e,a,i.translateInterpolation,void 0,n.translateLanguage,u).then((function(t){r.attr(s,t)}),(function(t){r.attr(s,t)})))})),angular.forEach(c,(function(t,e){o[e]||(r.removeAttr(e),delete c[e])}))};s(n,i.translateAttr,(function(t){o=t}),l),s(n,i.translateValues,(function(t){a=t}),l),s(n,i.translateSanitizeStrategy,(function(t){u=t}),l),i.translateValues&&n.$watch(i.translateValues,l,!0),n.$on("translateLanguageChanged",l);var h=e.$on("$translateChangeSuccess",l);l(),n.$on("$destroy",h)}}}function s(t,e,n,r){"use strict";e&&("::"===e.substr(0,2)?e=e.substr(2):t.$watch(e,(function(t){n(t),r()}),!0),n(t.$eval(e)))}function o(t,e){"use strict";return{compile:function(n){var r=function(e){e.addClass(t.cloakClassName())},i=function(e){e.removeClass(t.cloakClassName())};return r(n),function(n,s,o){var a=i.bind(this,s),u=r.bind(this,s);o.translateCloak&&o.translateCloak.length?(o.$observe("translateCloak",(function(e){t(e).then(a,u)})),e.$on("$translateChangeSuccess",(function(){t(o.translateCloak).then(a,u)}))):t.onReady(a)}}}}function a(){"use strict";return{restrict:"A",scope:!0,compile:function(){return{pre:function(t,e,n){t.translateNamespace=function t(e){return e.translateNamespace?e.translateNamespace:e.$parent?t(e.$parent):void 0}(t),t.translateNamespace&&"."===n.translateNamespace.charAt(0)?t.translateNamespace+=n.translateNamespace:t.translateNamespace=n.translateNamespace}}}}}function u(){"use strict";return{restrict:"A",scope:!0,compile:function(){return function(t,e,n){n.$observe("translateLanguage",(function(e){t.translateLanguage=e})),t.$watch("translateLanguage",(function(){t.$broadcast("translateLanguageChanged")}))}}}}function c(t,e){"use strict";var n=function(n,r,i,s){if(!angular.isObject(r)){var o=this||{__SCOPE_IS_NOT_AVAILABLE:"More info at https://github.com/angular/angular.js/commit/8863b9d04c722b278fa93c5d66ad1e578ad6eb1f"};r=t(r)(o)}return e.instant(n,r,i,s)};return e.statefulFilter()&&(n.$stateful=!0),n}function l(t){"use strict";return t("translations")}return t.$inject=["$translate"],e.$inject=["$STORAGE_KEY","$windowProvider","$translateSanitizationProvider","pascalprechtTranslateOverrider"],n.$inject=["$interpolate","$translateSanitization"],r.$inject=["$translate","$interpolate","$compile","$parse","$rootScope"],i.$inject=["$translate","$rootScope"],o.$inject=["$translate","$rootScope"],c.$inject=["$parse","$translate"],l.$inject=["$cacheFactory"],angular.module("pascalprecht.translate",["ng"]).run(t),t.displayName="runTranslate",angular.module("pascalprecht.translate").provider("$translateSanitization",(function(){"use strict";var t,e,n,r=null,i=!1,s=!1;(n={sanitize:function(t,e){return"text"===e&&(t=a(t)),t},escape:function(t,e){return"text"===e&&(t=o(t)),t},sanitizeParameters:function(t,e){return"params"===e&&(t=c(t,a)),t},escapeParameters:function(t,e){return"params"===e&&(t=c(t,o)),t},sce:function(t,e,n){return"text"===e?t=u(t):"params"===e&&"filter"!==n&&(t=c(t,o)),t},sceParameters:function(t,e){return"params"===e&&(t=c(t,u)),t}}).escaped=n.escapeParameters,this.addStrategy=function(t,e){return n[t]=e,this},this.removeStrategy=function(t){return delete n[t],this},this.useStrategy=function(t){return i=!0,r=t,this},this.$get=["$injector","$log",function(o,a){var u={};return o.has("$sanitize")&&(t=o.get("$sanitize")),o.has("$sce")&&(e=o.get("$sce")),{useStrategy:function(t){return function(e){t.useStrategy(e)}}(this),sanitize:function(t,e,c,l){return r||i||s||(a.warn("pascalprecht.translate.$translateSanitization: No sanitization strategy has been configured. This can have serious security implications. See http://angular-translate.github.io/docs/#/guide/19_security for details."),s=!0),c||null===c||(c=r),c?(l||(l="service"),function(t,e,r,i){return angular.forEach(i,(function(i){if(angular.isFunction(i))t=i(t,e,r);else if(angular.isFunction(n[i]))t=n[i](t,e,r);else{if(!angular.isString(n[i]))throw new Error("pascalprecht.translate.$translateSanitization: Unknown sanitization strategy: '"+i+"'");if(!u[n[i]])try{u[n[i]]=o.get(n[i])}catch(t){throw u[n[i]]=function(){},new Error("pascalprecht.translate.$translateSanitization: Unknown sanitization strategy: '"+i+"'")}t=u[n[i]](t,e,r)}})),t}(t,e,l,angular.isArray(c)?c:[c])):t}}}];var o=function(t){var e=angular.element("<div></div>");return e.text(t),e.html()},a=function(e){if(!t)throw new Error("pascalprecht.translate.$translateSanitization: Error cannot find $sanitize service. Either include the ngSanitize module (https://docs.angularjs.org/api/ngSanitize) or use a sanitization strategy which does not depend on $sanitize, such as 'escape'.");return t(e)},u=function(t){if(!e)throw new Error("pascalprecht.translate.$translateSanitization: Error cannot find $sce service.");return e.trustAsHtml(t)},c=function(t,e,n){if(angular.isDate(t))return t;if(angular.isObject(t)){var r=angular.isArray(t)?[]:{};if(n){if(n.indexOf(t)>-1)throw new Error("pascalprecht.translate.$translateSanitization: Error cannot interpolate parameter due recursive object")}else n=[];return n.push(t),angular.forEach(t,(function(t,i){angular.isFunction(t)||(r[i]=c(t,e,n))})),n.splice(-1,1),r}return angular.isNumber(t)||!0===t||!1===t||angular.isUndefined(t)||null===t?t:e(t)}})),angular.module("pascalprecht.translate").constant("pascalprechtTranslateOverrider",{}).provider("$translate",e),e.displayName="displayName",angular.module("pascalprecht.translate").factory("$translateDefaultInterpolation",n),n.displayName="$translateDefaultInterpolation",angular.module("pascalprecht.translate").constant("$STORAGE_KEY","NG_TRANSLATE_LANG_KEY"),angular.module("pascalprecht.translate").directive("translate",r),r.displayName="translateDirective",angular.module("pascalprecht.translate").directive("translateAttr",i),i.displayName="translateAttrDirective",angular.module("pascalprecht.translate").directive("translateCloak",o),o.displayName="translateCloakDirective",angular.module("pascalprecht.translate").directive("translateNamespace",a),a.displayName="translateNamespaceDirective",angular.module("pascalprecht.translate").directive("translateLanguage",u),u.displayName="translateLanguageDirective",angular.module("pascalprecht.translate").filter("translate",c),c.displayName="translateFilterFactory",angular.module("pascalprecht.translate").factory("$translationCache",l),l.displayName="$translationCache","pascalprecht.translate"}()}.apply(e,[]))||(t.exports=r)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){!function(t,e,n){"use strict";e.module("ngAnimate",["ng"]).directive("ngAnimateChildren",(function(){return function(t,n,r){r=r.ngAnimateChildren,e.isString(r)&&0===r.length?n.data("$$ngAnimateChildren",!0):t.$watch(r,(function(t){n.data("$$ngAnimateChildren",!!t)}))}})).factory("$$animateReflow",["$$rAF","$document",function(t,e){return function(e){return t((function(){e()}))}}]).config(["$provide","$animateProvider",function(r,i){function s(t){for(var e=0;e<t.length;e++){var n=t[e];if(1==n.nodeType)return n}}function o(t,e){return s(t)==s(e)}var a,u=e.noop,c=e.forEach,l=i.$$selectors,h=e.isArray,f=e.isString,p=e.isObject,d={running:!0};r.decorator("$animate",["$delegate","$$q","$injector","$sniffer","$rootElement","$$asyncCallback","$rootScope","$document","$templateRequest","$$jqLite",function(t,n,r,g,m,v,y,b,w,x){function S(t,e){var n=t.data("$$ngAnimateState")||{};return e&&(n.running=!0,n.structural=!0,t.data("$$ngAnimateState",n)),n.disabled||n.running&&n.structural}function E(t){var e,r=n.defer();return r.promise.$$cancelFn=function(){e&&e()},y.$$postDigest((function(){e=t((function(){r.resolve()}))})),r.promise}function F(t){if(p(t))return t.tempClasses&&f(t.tempClasses)&&(t.tempClasses=t.tempClasses.split(/\s+/)),t}function A(t,n,i,s){function o(t,e){var n=t[e],r=t["before"+e.charAt(0).toUpperCase()+e.substr(1)];if(n||r)return"leave"==e&&(r=n,n=null),F.push({event:e,fn:n}),x.push({event:e,fn:r}),!0}function a(e,n,r){var o=[];c(e,(function(t){t.fn&&o.push(t)}));var a=0;c(o,(function(e,c){var l=function(){t:{if(n){if((n[c]||u)(),++a<o.length)break t;n=null}r()}};switch(e.event){case"setClass":n.push(e.fn(t,p,d,l,s));break;case"animate":n.push(e.fn(t,i,s.from,s.to,l));break;case"addClass":n.push(e.fn(t,p||i,l,s));break;case"removeClass":n.push(e.fn(t,d||i,l,s));break;default:n.push(e.fn(t,l,s))}})),n&&0===n.length&&r()}var f=t[0];if(f){var p,d;s&&(s.to=s.to||{},s.from=s.from||{}),h(i)&&(p=i[0],d=i[1],p?d?i=p+" "+d:(i=p,n="addClass"):(i=d,n="removeClass"));var m="setClass"==n,v=m||"addClass"==n||"removeClass"==n||"animate"==n,y=t.attr("class")+" "+i;if(_(y)){var b=u,w=[],x=[],S=u,E=[],F=[];y=(" "+y).replace(/\s+/g,".");return c(function(t){if(t){var e=[],n={};t=t.substr(1).split("."),(g.transitions||g.animations)&&e.push(r.get(l[""]));for(var i=0;i<t.length;i++){var s=t[i],o=l[s];o&&!n[s]&&(e.push(r.get(o)),n[s]=!0)}return e}}(y),(function(t){!o(t,n)&&m&&(o(t,"addClass"),o(t,"removeClass"))})),{node:f,event:n,className:i,isClassBased:v,isSetClassOperation:m,applyStyles:function(){s&&t.css(e.extend(s.from||{},s.to||{}))},before:function(t){b=t,a(x,w,(function(){b=u,t()}))},after:function(t){S=t,a(F,E,(function(){S=u,t()}))},cancel:function(){w&&(c(w,(function(t){(t||u)(!0)})),b(!0)),E&&(c(E,(function(t){(t||u)(!0)})),S(!0))}}}}}function C(t,n,r,i,s,l,h,f){function p(e){var i="$animate:"+e;S&&S[i]&&0<S[i].length&&v((function(){r.triggerHandler(i,{event:t,className:n})}))}function g(){p("before")}function y(){p("after")}function b(){b.hasBeenRun||(b.hasBeenRun=!0,l())}function w(){if(!w.hasBeenRun){x&&x.applyStyles(),w.hasBeenRun=!0,h&&h.tempClasses&&c(h.tempClasses,(function(t){a.removeClass(r,t)}));var t=r.data("$$ngAnimateState");t&&(x&&x.isClassBased?I(r,n):(v((function(){var t=r.data("$$ngAnimateState")||{};$==t.index&&I(r,n)})),r.data("$$ngAnimateState",t))),p("close"),f()}}var x=A(r,t,n,h);if(!x)return b(),g(),y(),w(),u;t=x.event,n=x.className;var S=(S=e.element._data(x.node))&&S.events;if(i||(i=s?s.parent():r.parent()),function(t,n){if(d.disabled)return!0;if(o(t,m))return d.running;var r,i,s;do{if(0===n.length)break;var a=o(n,m),u=a?d:n.data("$$ngAnimateState")||{};if(u.disabled)return!0;a&&(s=!0),!1!==r&&(a=n.data("$$ngAnimateChildren"),e.isDefined(a)&&(r=a)),i=i||u.running||u.last&&!u.last.isClassBased}while(n=n.parent());return!s||!r&&i}(r,i))return b(),g(),y(),w(),u;var E=(i=r.data("$$ngAnimateState")||{}).active||{},F=i.totalActive||0,C=i.last;if(s=!1,0<F){if(F=[],x.isClassBased)"setClass"==C.event?(F.push(C),I(r,n)):E[n]&&((D=E[n]).event==t?s=!0:(F.push(D),I(r,n)));else if("leave"==t&&E["ng-leave"])s=!0;else{for(var D in E)F.push(E[D]);i={},I(r,!0)}0<F.length&&c(F,(function(t){t.cancel()}))}if(!x.isClassBased||x.isSetClassOperation||"animate"==t||s||(s="addClass"==t==r.hasClass(n)),s)return b(),g(),y(),p("close"),f(),u;E=i.active||{},F=i.totalActive||0,"leave"==t&&r.one("$destroy",(function(t){var n=(t=e.element(this)).data("$$ngAnimateState");n&&(n=n.active["ng-leave"])&&(n.cancel(),I(t,"ng-leave"))})),a.addClass(r,"ng-animate"),h&&h.tempClasses&&c(h.tempClasses,(function(t){a.addClass(r,t)}));var $=R++;return F++,E[n]=x,r.data("$$ngAnimateState",{last:x,active:E,index:$,totalActive:F}),g(),x.before((function(e){var i=r.data("$$ngAnimateState");e=e||!i||!i.active[n]||x.isClassBased&&i.active[n].event!=t,b(),!0===e?w():(y(),x.after(w))})),x.cancel}function D(t){(t=s(t))&&(t=e.isFunction(t.getElementsByClassName)?t.getElementsByClassName("ng-animate"):t.querySelectorAll(".ng-animate"),c(t,(function(t){(t=(t=e.element(t)).data("$$ngAnimateState"))&&t.active&&c(t.active,(function(t){t.cancel()}))})))}function I(t,e){if(o(t,m))d.disabled||(d.running=!1,d.structural=!1);else if(e){var n=t.data("$$ngAnimateState")||{},r=!0===e;!r&&n.active&&n.active[e]&&(n.totalActive--,delete n.active[e]),!r&&n.totalActive||(a.removeClass(t,"ng-animate"),t.removeData("$$ngAnimateState"))}}a=x,m.data("$$ngAnimateState",d);var $=y.$watch((function(){return w.totalPendingRequests}),(function(t,e){0===t&&($(),y.$$postDigest((function(){y.$$postDigest((function(){d.running=!1}))})))})),R=0,T=i.classNameFilter(),_=T?function(t){return T.test(t)}:function(){return!0};return{animate:function(t,n,r,i,o){return i=i||"ng-inline-animate",(o=F(o)||{}).from=r?n:null,o.to=r||n,E((function(n){return C("animate",i,e.element(s(t)),null,null,u,o,n)}))},enter:function(n,r,i,o){return o=F(o),n=e.element(n),r=r&&e.element(r),i=i&&e.element(i),S(n,!0),t.enter(n,r,i),E((function(t){return C("enter","ng-enter",e.element(s(n)),r,i,u,o,t)}))},leave:function(n,r){return r=F(r),D(n=e.element(n)),S(n,!0),E((function(i){return C("leave","ng-leave",e.element(s(n)),null,null,(function(){t.leave(n)}),r,i)}))},move:function(n,r,i,o){return o=F(o),n=e.element(n),r=r&&e.element(r),i=i&&e.element(i),D(n),S(n,!0),t.move(n,r,i),E((function(t){return C("move","ng-move",e.element(s(n)),r,i,u,o,t)}))},addClass:function(t,e,n){return this.setClass(t,e,[],n)},removeClass:function(t,e,n){return this.setClass(t,[],e,n)},setClass:function(n,r,i,o){if(o=F(o),n=e.element(n),S(n=e.element(s(n))))return t.$$setClassImmediately(n,r,i,o);var a,u=n.data("$$animateClasses"),l=!!u;return u||(u={classes:{}}),a=u.classes,r=h(r)?r:r.split(" "),c(r,(function(t){t&&t.length&&(a[t]=!0)})),i=h(i)?i:i.split(" "),c(i,(function(t){t&&t.length&&(a[t]=!1)})),l?(o&&u.options&&(u.options=e.extend(u.options||{},o)),u.promise):(n.data("$$animateClasses",u={classes:a,options:o}),u.promise=E((function(e){var r=n.parent(),i=s(n);if((o=i.parentNode)&&!o.$$NG_REMOVED&&!i.$$NG_REMOVED){i=n.data("$$animateClasses"),n.removeData("$$animateClasses");var o=n.data("$$ngAnimateState")||{},a=function(t,e,n){var r={};c(n=n||{},(function(t,e){c(e.split(" "),(function(e){r[e]=t}))}));var i=Object.create(null);c((t.attr("class")||"").split(/\s+/),(function(t){i[t]=!0}));var s=[],o=[];return c(e&&e.classes||[],(function(t,e){var n=i[e],a=r[e]||{};!1===t?(n||"addClass"==a.event)&&o.push(e):!0===t&&(n&&"removeClass"!=a.event||s.push(e))})),0<s.length+o.length&&[s.join(" "),o.join(" ")]}(n,i,o.active);return a?C("setClass",a,n,r,null,(function(){a[0]&&t.$$addClassImmediately(n,a[0]),a[1]&&t.$$removeClassImmediately(n,a[1])}),i.options,e):e()}e()})))},cancel:function(t){t.$$cancelFn()},enabled:function(t,e){switch(arguments.length){case 2:if(t)I(e);else{var n=e.data("$$ngAnimateState")||{};n.disabled=!0,e.data("$$ngAnimateState",n)}break;case 1:d.disabled=!t;break;default:t=!d.disabled}return!!t}}}]),i.register("",["$window","$sniffer","$timeout","$$animateReflow",function(r,i,o,l){function p(){R||(R=l((function(){P=[],R=null,T={}})))}function d(t,e){R&&R(),P.push(e),R=l((function(){c(P,(function(t){t()})),P=[],R=null,T={}}))}function g(t,n){var r=s(t);t=e.element(r),j.push(t),(r=Date.now()+n)<=O||(o.cancel(k),O=r,k=o((function(){!function(t){c(t,(function(t){(t=t.data("$$ngAnimateCSS3Data"))&&c(t.closeAnimationFns,(function(t){t()}))}))}(j),j=[]}),n,!1))}function m(t,e){var n=e?T[e]:null;if(!n){var i=0,s=0,o=0,a=0;c(t,(function(t){if(1==t.nodeType){t=r.getComputedStyle(t)||{},i=Math.max(v(t[A+"Duration"]),i),s=Math.max(v(t[A+"Delay"]),s),a=Math.max(v(t[D+"Delay"]),a);var e=v(t[D+"Duration"]);0<e&&(e*=parseInt(t[D+"IterationCount"],10)||1),o=Math.max(e,o)}})),n={total:0,transitionDelay:s,transitionDuration:i,animationDelay:a,animationDuration:o},e&&(T[e]=n)}return n}function v(t){var e=0;return t=f(t)?t.split(/\s*,\s*/):[],c(t,(function(t){e=Math.max(parseFloat(t)||0,e)})),e}function y(t,e,n,r){var i;t=0<=["ng-enter","ng-leave","ng-move"].indexOf(n),(u=(o=e.parent()).data("$$ngAnimateKey"))||(o.data("$$ngAnimateKey",++_),u=_),i=u+"-"+s(e).getAttribute("class");var o,u,c={};0<(u=T[o=i+" "+n]?++T[o].total:0)&&((i=!T[c=i+" "+(l=n+"-stagger")])&&a.addClass(e,l),c=m(e,c),i&&a.removeClass(e,l));a.addClass(e,n);var l=e.data("$$ngAnimateCSS3Data")||{},h=m(e,o);return i=h.transitionDuration,h=h.animationDuration,t&&0===i&&0===h?(a.removeClass(e,n),!1):(n=r||t&&0<i,t=0<h&&0<c.animationDelay&&0===c.animationDuration,e.data("$$ngAnimateCSS3Data",{stagger:c,cacheKey:o,running:l.running||0,itemIndex:u,blockTransition:n,closeAnimationFns:l.closeAnimationFns||[]}),o=s(e),n&&(b(o,!0),r&&e.css(r)),t&&(o.style[D+"PlayState"]="paused"),!0)}function b(t,e){t.style[A+"Property"]=e?"none":""}function w(t,e,n,r){if(y(t,e,n,r))return function(t){t&&E(e,n)}}function x(t,e,n,r,i){if(e.data("$$ngAnimateCSS3Data"))return function(t,e,n,r,i){function u(){e.off(_,l),a.removeClass(e,f),a.removeClass(e,p),R&&o.cancel(R),E(e,n);var t,r=s(e);for(t in d)r.style.removeProperty(d[t])}function l(t){t.stopPropagation();var e=t.originalEvent||t;t=e.$manualTimeStamp||e.timeStamp||Date.now(),e=parseFloat(e.elapsedTime.toFixed(3)),Math.max(t-T,0)>=A&&e>=F&&r()}var h=s(e);if(t=e.data("$$ngAnimateCSS3Data"),-1!=h.getAttribute("class").indexOf(n)&&t){var f="",p="";c(n.split(" "),(function(t,e){var n=(0<e?" ":"")+t;f+=n+"-active",p+=n+"-pending"}));var d=[],v=t.itemIndex,y=t.stagger,w=0;if(0<v){w=0,0<y.transitionDelay&&0===y.transitionDuration&&(w=y.transitionDelay*v);var x=0;0<y.animationDelay&&0===y.animationDuration&&(x=y.animationDelay*v,d.push($+"animation-play-state")),w=Math.round(100*Math.max(w,x))/100}w||(a.addClass(e,f),t.blockTransition&&b(h,!1));var S=m(e,t.cacheKey+" "+f),F=Math.max(S.transitionDuration,S.animationDuration);if(0!==F){!w&&i&&(S.transitionDuration||(e.css("transition",S.animationDuration+"s linear all"),d.push("transition")),e.css(i));var A=1e3*(v=Math.max(S.transitionDelay,S.animationDelay));0<d.length&&(";"!==(y=h.getAttribute("style")||"").charAt(y.length-1)&&(y+=";"),h.setAttribute("style",y+" "));var R,T=Date.now(),_=I+" "+C;v=1e3*(w+1.5*(v+F));return 0<w&&(a.addClass(e,p),R=o((function(){R=null,0<S.transitionDuration&&b(h,!1),0<S.animationDuration&&(h.style[D+"PlayState"]=""),a.addClass(e,f),a.removeClass(e,p),i&&(0===S.transitionDuration&&e.css("transition",S.animationDuration+"s linear all"),e.css(i),d.push("transition"))}),1e3*w,!1)),e.on(_,l),t.closeAnimationFns.push((function(){u(),r()})),t.running++,g(e,v),u}a.removeClass(e,f),E(e,n),r()}else r()}(t,e,n,r,i);E(e,n),r()}function S(t,e,n,r,i){var s=w(t,e,n,i.from);if(s){var o=s;return d(0,(function(){o=x(t,e,n,r,i.to)})),function(t){(o||u)(t)}}p(),r()}function E(t,e){a.removeClass(t,e);var n=t.data("$$ngAnimateCSS3Data");n&&(n.running&&n.running--,n.running&&0!==n.running||t.removeData("$$ngAnimateCSS3Data"))}function F(t,e){var n="";return t=h(t)?t:t.split(/\s+/),c(t,(function(t,r){t&&0<t.length&&(n+=(0<r?" ":"")+t+e)})),n}var A,C,D,I,$="";t.ontransitionend===n&&t.onwebkittransitionend!==n?($="-webkit-",A="WebkitTransition",C="webkitTransitionEnd transitionend"):(A="transition",C="transitionend"),t.onanimationend===n&&t.onwebkitanimationend!==n?($="-webkit-",D="WebkitAnimation",I="webkitAnimationEnd animationend"):(D="animation",I="animationend");var R,T={},_=0,P=[],k=null,O=0,j=[];return{animate:function(t,e,n,r,i,s){return(s=s||{}).from=n,s.to=r,S("animate",t,e,i,s)},enter:function(t,e,n){return S("enter",t,"ng-enter",e,n=n||{})},leave:function(t,e,n){return S("leave",t,"ng-leave",e,n=n||{})},move:function(t,e,n){return S("move",t,"ng-move",e,n=n||{})},beforeSetClass:function(t,e,n,r,i){if(i=i||{},i=w("setClass",t,e=F(n,"-remove")+" "+F(e,"-add"),i.from))return d(0,r),i;p(),r()},beforeAddClass:function(t,e,n,r){if(r=r||{},e=w("addClass",t,F(e,"-add"),r.from))return d(0,n),e;p(),n()},beforeRemoveClass:function(t,e,n,r){if(r=r||{},e=w("removeClass",t,F(e,"-remove"),r.from))return d(0,n),e;p(),n()},setClass:function(t,e,n,r,i){return i=i||{},x("setClass",t,(n=F(n,"-remove"))+" "+(e=F(e,"-add")),r,i.to)},addClass:function(t,e,n,r){return r=r||{},x("addClass",t,F(e,"-add"),n,r.to)},removeClass:function(t,e,n,r){return r=r||{},x("removeClass",t,F(e,"-remove"),n,r.to)}}}])}])}(window,window.angular)},function(t,e){!function(t,e,n){"use strict";e.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(t,n){var r,i={},s={},o=!1,a=e.copy,u=e.isUndefined;return n.addPollFn((function(){var e=n.cookies();r!=e&&(r=e,a(e,s),a(e,i),o&&t.$apply())}))(),o=!0,t.$watch((function(){var t,r,o;for(t in s)u(i[t])&&n.cookies(t,void 0);for(t in i)r=i[t],e.isString(r)||(r=""+r,i[t]=r),r!==s[t]&&(n.cookies(t,r),o=!0);if(o)for(t in r=n.cookies(),i)i[t]!==r[t]&&(u(r[t])?delete i[t]:i[t]=r[t])})),i}]).factory("$cookieStore",["$cookies",function(t){return{get:function(n){return(n=t[n])?e.fromJson(n):n},put:function(n,r){t[n]=e.toJson(r)},remove:function(e){delete t[e]}}}])}(window,window.angular)},function(t,e){!function(t,e,n){"use strict";function r(t,n,r){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(i,s,o,a,u){function c(){p&&(r.cancel(p),p=null),h&&(h.$destroy(),h=null),f&&((p=r.leave(f)).then((function(){p=null})),f=null)}function l(){var o=t.current&&t.current.locals;if(e.isDefined(o&&o.$template)){o=i.$new();var a=t.current;f=u(o,(function(t){r.enter(t,null,f||s).then((function(){!e.isDefined(d)||d&&!i.$eval(d)||n()})),c()})),(h=a.scope=o).$emit("$viewContentLoaded"),h.$eval(g)}else c()}var h,f,p,d=o.autoscroll,g=o.onload||"";i.$on("$routeChangeSuccess",l),l()}}}function i(t,e,n){return{restrict:"ECA",priority:-400,link:function(r,i){var s=n.current,o=s.locals;i.html(o.$template);var a=t(i.contents());s.controller&&(o.$scope=r,o=e(s.controller,o),s.controllerAs&&(r[s.controllerAs]=o),i.data("$ngControllerController",o),i.children().data("$ngControllerController",o)),a(r)}}}t=e.module("ngRoute",["ng"]).provider("$route",(function(){function t(t,n){return e.extend(Object.create(t),n)}function n(t,e){var n=e.caseInsensitiveMatch,r={originalPath:t,regexp:t},i=r.keys=[];return t=t.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?\*])?/g,(function(t,e,n,r){return t="?"===r?r:null,r="*"===r?r:null,i.push({name:n,optional:!!t}),e=e||"",(t?"":e)+"(?:"+(t?e:"")+(r?"(.+?)":"([^/]+)")+(t||"")+")"+(t||"")})).replace(/([\/$\*])/g,"\\$1"),r.regexp=new RegExp("^"+t+"$",n?"i":""),r}var r={};this.when=function(t,i){var s=e.copy(i);if(e.isUndefined(s.reloadOnSearch)&&(s.reloadOnSearch=!0),e.isUndefined(s.caseInsensitiveMatch)&&(s.caseInsensitiveMatch=this.caseInsensitiveMatch),r[t]=e.extend(s,t&&n(t,s)),t){var o="/"==t[t.length-1]?t.substr(0,t.length-1):t+"/";r[o]=e.extend({redirectTo:t},n(o,s))}return this},this.caseInsensitiveMatch=!1,this.otherwise=function(t){return"string"==typeof t&&(t={redirectTo:t}),this.when(null,t),this},this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest","$sce",function(n,i,o,a,u,c,l){function h(s){var o=v.current;(g=(d=function(){var n,s;return e.forEach(r,(function(r,o){var a;if(a=!s){var u=i.path();a=r.keys;var c={};if(r.regexp)if(u=r.regexp.exec(u)){for(var l=1,h=u.length;l<h;++l){var f=a[l-1],p=u[l];f&&p&&(c[f.name]=p)}a=c}else a=null;else a=null;a=n=a}a&&((s=t(r,{params:e.extend({},i.search(),n),pathParams:n})).$$route=r)})),s||r.null&&t(r.null,{params:{},pathParams:{}})}())&&o&&d.$$route===o.$$route&&e.equals(d.pathParams,o.pathParams)&&!d.reloadOnSearch&&!m)||!o&&!d||n.$broadcast("$routeChangeStart",d,o).defaultPrevented&&s&&s.preventDefault()}function f(){var t=v.current,r=d;g?(t.params=r.params,e.copy(t.params,o),n.$broadcast("$routeUpdate",t)):(r||t)&&(m=!1,(v.current=r)&&r.redirectTo&&(e.isString(r.redirectTo)?i.path(p(r.redirectTo,r.params)).search(r.params).replace():i.url(r.redirectTo(r.pathParams,i.path(),i.search())).replace()),a.when(r).then((function(){if(r){var t,n,i=e.extend({},r.resolve);return e.forEach(i,(function(t,n){i[n]=e.isString(t)?u.get(t):u.invoke(t,null,null,n)})),e.isDefined(t=r.template)?e.isFunction(t)&&(t=t(r.params)):e.isDefined(n=r.templateUrl)&&(e.isFunction(n)&&(n=n(r.params)),n=l.getTrustedResourceUrl(n),e.isDefined(n)&&(r.loadedTemplateUrl=n,t=c(n))),e.isDefined(t)&&(i.$template=t),a.all(i)}})).then((function(i){r==v.current&&(r&&(r.locals=i,e.copy(r.params,o)),n.$broadcast("$routeChangeSuccess",r,t))}),(function(e){r==v.current&&n.$broadcast("$routeChangeError",r,t,e)})))}function p(t,n){var r=[];return e.forEach((t||"").split(":"),(function(t,e){if(0===e)r.push(t);else{var i=t.match(/(\w+)(?:[?*])?(.*)/),s=i[1];r.push(n[s]),r.push(i[2]||""),delete n[s]}})),r.join("")}var d,g,m=!1,v={routes:r,reload:function(){m=!0,n.$evalAsync((function(){h(),f()}))},updateParams:function(t){if(!this.current||!this.current.$$route)throw s("norout");var n={},r=this;e.forEach(Object.keys(t),(function(e){r.current.pathParams[e]||(n[e]=t[e])})),t=e.extend({},this.current.params,t),i.path(p(this.current.$$route.originalPath,t)),i.search(e.extend({},i.search(),n))}};return n.$on("$locationChangeStart",h),n.$on("$locationChangeSuccess",f),v}]}));var s=e.$$minErr("ngRoute");t.provider("$routeParams",(function(){this.$get=function(){return{}}})),t.directive("ngView",r),t.directive("ngView",i),r.$inject=["$route","$anchorScroll","$animate"],i.$inject=["$compile","$controller","$route"]}(window,window.angular)},function(t,e){
|
|
47
|
+
*/void 0===(r=function(){return function(){function t(t){"use strict";var e=t.storageKey(),n=t.storage(),r=function(){var r=t.preferredLanguage();angular.isString(r)?t.use(r):n.put(e,t.use())};r.displayName="fallbackFromIncorrectStorageValue",n?n.get(e)?t.use(n.get(e)).catch(r):r():angular.isString(t.preferredLanguage())&&t.use(t.preferredLanguage())}function e(t,e,n,r){"use strict";var i,s,o,a,u,c,l,h,f,p,d,g,m,v,y,b,x={},w=[],S=t,E=[],F="translate-cloak",A=!1,C=!1,D=!0,$=".",I=!1,R=!1,T=0,_=!0,P="default",k={default:function(t){return(t||"").split("-").join("_")},java:function(t){var e=(t||"").split("-").join("_"),n=e.split("_");return n.length>1?n[0].toLowerCase()+"_"+n[1].toUpperCase():e},bcp47:function(t){var e=(t||"").split("_").join("-"),n=e.split("-");switch(n.length){case 1:n[0]=n[0].toLowerCase();break;case 2:n[0]=n[0].toLowerCase(),4===n[1].length?n[1]=n[1].charAt(0).toUpperCase()+n[1].slice(1).toLowerCase():n[1]=n[1].toUpperCase();break;case 3:n[0]=n[0].toLowerCase(),n[1]=n[1].charAt(0).toUpperCase()+n[1].slice(1).toLowerCase(),n[2]=n[2].toUpperCase();break;default:return e}return n.join("-")},"iso639-1":function(t){return(t||"").split("_").join("-").split("-")[0].toLowerCase()}},O=function(){if(angular.isFunction(r.getLocale))return r.getLocale();var t,n,i=e.$get().navigator,s=["language","browserLanguage","systemLanguage","userLanguage"];if(angular.isArray(i.languages))for(t=0;t<i.languages.length;t++)if((n=i.languages[t])&&n.length)return n;for(t=0;t<s.length;t++)if((n=i[s[t]])&&n.length)return n;return null};O.displayName="angular-translate/service: getFirstBrowserLanguage";var j=function(){var t=O()||"";return k[P]&&(t=k[P](t)),t};j.displayName="angular-translate/service: getLocale";var B=function(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1},N=function(){return this.toString().replace(/^\s+|\s+$/g,"")},L=function(t){return angular.isString(t)?t.toLowerCase():t},H=function(t){if(t){for(var e,n=[],r=L(t),i=0,o=w.length;i<o;i++)n.push(L(w[i]));if((i=B(n,r))>-1)return w[i];if(s)for(var a in s)if(s.hasOwnProperty(a)){var u=!1,c=Object.prototype.hasOwnProperty.call(s,a)&&L(a)===L(t);if("*"===a.slice(-1)&&(u=L(a.slice(0,-1))===L(t.slice(0,a.length-1))),(c||u)&&(e=s[a],B(n,L(e))>-1))return e}var l=t.split("_");return l.length>1&&B(n,L(l[0]))>-1?l[0]:void 0}},M=function(t,e){if(!t&&!e)return x;if(t&&!e){if(angular.isString(t))return x[t]}else angular.isObject(x[t])||(x[t]={}),angular.extend(x[t],U(e));return this};this.translations=M,this.cloakClassName=function(t){return t?(F=t,this):F},this.allowNamespaces=function(t){return void 0===t?D:(D=t,this)},this.nestedObjectDelimeter=function(t){return t?($=t,this):$};var U=function(t,e,n,r){var i,s,o;if(e||(e=[]),n||(n={}),!D)return t;for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(o=t[i],angular.isObject(o)?U(o,e.concat(i),n,i):(s=e.length?""+e.join($)+$+i:i,e.length&&i===r&&(n[""+e.join($)]="@:"+s),n[s]=o));return n};U.displayName="flatObject",this.addInterpolation=function(t){return E.push(t),this},this.useMessageFormatInterpolation=function(){return this.useInterpolation("$translateMessageFormatInterpolation")},this.useInterpolation=function(t){return p=t,this},this.useSanitizeValueStrategy=function(t){return n.useStrategy(t),this},this.preferredLanguage=function(t){return t?(V(t),this):i};var V=function(t){return t&&(i=t),i};this.translationNotFoundIndicator=function(t){return this.translationNotFoundIndicatorLeft(t),this.translationNotFoundIndicatorRight(t),this},this.translationNotFoundIndicatorLeft=function(t){return t?(m=t,this):m},this.translationNotFoundIndicatorRight=function(t){return t?(v=t,this):v},this.fallbackLanguage=function(t){return q(t),this};var q=function(t){return t?(angular.isString(t)?(a=!0,o=[t]):angular.isArray(t)&&(a=!1,o=t),angular.isString(i)&&B(o,i)<0&&o.push(i),this):a?o[0]:o};this.use=function(t){if(t){if(!x[t]&&!d)throw new Error("$translateProvider couldn't find translationTable for langKey: '"+t+"'");return u=t,this}return u},this.resolveClientLocale=function(){return j()};var K=function(t){return t?(S=t,this):h?h+S:S};this.storageKey=K,this.useUrlLoader=function(t,e){return this.useLoader("$translateUrlLoader",angular.extend({url:t},e))},this.useStaticFilesLoader=function(t){return this.useLoader("$translateStaticFilesLoader",t)},this.useLoader=function(t,e){return d=t,g=e||{},this},this.useLocalStorage=function(){return this.useStorage("$translateLocalStorage")},this.useCookieStorage=function(){return this.useStorage("$translateCookieStorage")},this.useStorage=function(t){return l=t,this},this.storagePrefix=function(t){return t?(h=t,this):t},this.useMissingTranslationHandlerLog=function(){return this.useMissingTranslationHandler("$translateMissingTranslationHandlerLog")},this.useMissingTranslationHandler=function(t){return f=t,this},this.usePostCompiling=function(t){return A=!!t,this},this.forceAsyncReload=function(t){return C=!!t,this},this.uniformLanguageTag=function(t){return t?angular.isString(t)&&(t={standard:t}):t={},P=t.standard,this},this.determinePreferredLanguage=function(t){var e=t&&angular.isFunction(t)?t():j();return i=w.length&&H(e)||e,this},this.registerAvailableLanguageKeys=function(t,e){return t?(w=t,e&&(s=e),this):w},this.useLoaderCache=function(t){return!1===t?y=void 0:!0===t?y=!0:void 0===t?y="$translationCache":t&&(y=t),this},this.directivePriority=function(t){return void 0===t?T:(T=t,this)},this.statefulFilter=function(t){return void 0===t?_:(_=t,this)},this.postProcess=function(t){return b=t||void 0,this},this.keepContent=function(t){return R=!!t,this},this.$get=["$log","$injector","$rootScope","$q",function(t,e,n,r){var s,h,P,k=e.get(p||"$translateDefaultInterpolation"),O=!1,L={},z={},G=function(t,e,n,a,c,f){!u&&i&&(u=i);var p=c&&c!==u?H(c)||c:u;if(c&&ot(c),angular.isArray(t))return function(t){for(var i={},s=[],o=function(t){var s=r.defer(),o=function(e){i[t]=e,s.resolve([t,e])};return G(t,e,n,a,c,f).then(o,o),s.promise},u=0,l=t.length;u<l;u++)s.push(o(t[u]));return r.all(s).then((function(){return i}))}(t);var d=r.defer();if(!t)throw new TypeError("translationId must be a not empty string");t=N.apply(t);var g=function(){var t=z[p]||z[i];if(h=0,l&&!t){var e=s.get(S);if(t=z[e],o&&o.length){var n=B(o,e);h=0===n?1:0,B(o,i)<0&&o.push(i)}}return t}();if(g){var m=function(){c||(p=u),rt(t,e,n,a,p,f).then(d.resolve,d.reject)};m.displayName="promiseResolved",g.finally(m).catch(angular.noop)}else rt(t,e,n,a,p,f).then(d.resolve,d.reject);return d.promise},W=function(t){return m&&(t=[m,t].join(" ")),v&&(t=[t,v].join(" ")),t},Y=function(t){u=t,l&&s.put(G.storageKey(),u),n.$emit("$translateChangeSuccess",{language:t}),k.setLocale(u);var e=function(t,e){L[e].setLocale(u)};e.displayName="eachInterpolatorLocaleSetter",angular.forEach(L,e),n.$emit("$translateChangeEnd",{language:t})},X=function(t){if(!t)throw"No language key specified for loading.";var i=r.defer();n.$emit("$translateLoadingStart",{language:t}),O=!0;var s=y;"string"==typeof s&&(s=e.get(s));var o=angular.extend({},g,{key:t,$http:angular.extend({},{cache:s},g.$http)}),a=function(e){var r={};n.$emit("$translateLoadingSuccess",{language:t}),angular.isArray(e)?angular.forEach(e,(function(t){angular.extend(r,U(t))})):angular.extend(r,U(e)),O=!1,i.resolve({key:t,table:r}),n.$emit("$translateLoadingEnd",{language:t})};a.displayName="onLoaderSuccess";var u=function(t){n.$emit("$translateLoadingError",{language:t}),i.reject(t),n.$emit("$translateLoadingEnd",{language:t})};return u.displayName="onLoaderError",e.get(d)(o).then(a,u),i.promise};if(l&&(!(s=e.get(l)).get||!s.put))throw new Error("Couldn't use storage '"+l+"', missing get() or put() method!");if(E.length){var J=function(t){var n=e.get(t);n.setLocale(i||u),L[n.getInterpolationIdentifier()]=n};J.displayName="interpolationFactoryAdder",angular.forEach(E,J)}var Z=function(t,e,n,i,s){var o=r.defer(),a=function(r){if(Object.prototype.hasOwnProperty.call(r,e)&&null!==r[e]){i.setLocale(t);var a=r[e];if("@:"===a.substr(0,2))Z(t,a.substr(2),n,i,s).then(o.resolve,o.reject);else{var c=i.interpolate(r[e],n,"service",s,e);c=st(e,r[e],c,n,t),o.resolve(c)}i.setLocale(u)}else o.reject()};return a.displayName="fallbackTranslationResolver",function(t){var e=r.defer();if(Object.prototype.hasOwnProperty.call(x,t))e.resolve(x[t]);else if(z[t]){var n=function(t){M(t.key,t.table),e.resolve(t.table)};n.displayName="translationTableResolver",z[t].then(n,e.reject)}else e.reject();return e.promise}(t).then(a,o.reject),o.promise},Q=function(t,e,n,r,i){var s,o=x[t];if(o&&Object.prototype.hasOwnProperty.call(o,e)&&null!==o[e]){if(r.setLocale(t),s=r.interpolate(o[e],n,"filter",i,e),s=st(e,o[e],s,n,t,i),!angular.isString(s)&&angular.isFunction(s.$$unwrapTrustedValue)){var a=s.$$unwrapTrustedValue();if("@:"===a.substr(0,2))return Q(t,a.substr(2),n,r,i)}else if("@:"===s.substr(0,2))return Q(t,s.substr(2),n,r,i);r.setLocale(u)}return s},tt=function(t,n,r,i){return f?e.get(f)(t,u,n,r,i):t},et=function(t,e,n,i,s,a){var u=r.defer();if(t<o.length){var c=o[t];Z(c,e,n,i,a).then((function(t){u.resolve(t)}),(function(){return et(t+1,e,n,i,s,a).then(u.resolve,u.reject)}))}else if(s)u.resolve(s);else{var l=tt(e,n,s);f&&l?u.resolve(l):u.reject(W(e))}return u.promise},nt=function(t,e,n,r,i){var s;if(t<o.length){var a=o[t];(s=Q(a,e,n,r,i))||""===s||(s=nt(t+1,e,n,r))}return s},rt=function(t,e,n,i,s,a){var u=r.defer(),c=s?x[s]:x,l=n?L[n]:k;if(c&&Object.prototype.hasOwnProperty.call(c,t)&&null!==c[t]){var p=c[t];if("@:"===p.substr(0,2))G(p.substr(2),e,n,i,s,a).then(u.resolve,u.reject);else{var d=l.interpolate(p,e,"service",a,t);d=st(t,p,d,e,s),u.resolve(d)}}else{var g;f&&!O&&(g=tt(t,e,i)),s&&o&&o.length?function(t,e,n,r,i){return et(P>0?P:h,t,e,n,r,i)}(t,e,l,i,a).then((function(t){u.resolve(t)}),(function(t){u.reject(W(t))})):f&&!O&&g?i?u.resolve(i):u.resolve(g):i?u.resolve(i):u.reject(W(t))}return u.promise},it=function(t,e,n,r,i){var s,a=r?x[r]:x,u=k;if(L&&Object.prototype.hasOwnProperty.call(L,n)&&(u=L[n]),a&&Object.prototype.hasOwnProperty.call(a,t)&&null!==a[t]){var c=a[t];"@:"===c.substr(0,2)?s=it(c.substr(2),e,n,r,i):(s=u.interpolate(c,e,"filter",i,t),s=st(t,c,s,e,r,i))}else{var l;f&&!O&&(l=tt(t,e,i)),r&&o&&o.length?(h=0,s=function(t,e,n,r){return nt(P>0?P:h,t,e,n,r)}(t,e,u,i)):s=f&&!O&&l?l:W(t)}return s},st=function(t,n,r,i,s,o){var a=b;return a&&("string"==typeof a&&(a=e.get(a)),a)?a(t,n,r,i,s,o):r},ot=function(t){x[t]||!d||z[t]||(z[t]=X(t).then((function(t){return M(t.key,t.table),t})))};G.preferredLanguage=function(t){return t&&V(t),i},G.cloakClassName=function(){return F},G.allowNamespaces=function(){return D},G.nestedObjectDelimeter=function(){return $},G.fallbackLanguage=function(t){if(null!=t){if(q(t),d&&o&&o.length)for(var e=0,n=o.length;e<n;e++)z[o[e]]||(z[o[e]]=X(o[e]));G.use(G.use())}return a?o[0]:o},G.useFallbackLanguage=function(t){if(null!=t)if(t){var e=B(o,t);e>-1&&(P=e)}else P=0},G.proposedLanguage=function(){return c},G.storage=function(){return s},G.negotiateLocale=H,G.use=function(t){if(!t)return u;var e=r.defer();e.promise.then(null,angular.noop),n.$emit("$translateChangeStart",{language:t});var i=H(t);return w.length>0&&!i?r.reject(t):(i&&(t=i),c=t,!C&&x[t]||!d||z[t]?z[t]?z[t].then((function(t){return c===t.key&&Y(t.key),e.resolve(t.key),t}),(function(t){return!u&&o&&o.length>0&&o[0]!==t?G.use(o[0]).then(e.resolve,e.reject):e.reject(t)})):(e.resolve(t),Y(t)):(z[t]=X(t).then((function(n){return M(n.key,n.table),e.resolve(n.key),c===t&&Y(n.key),n}),(function(t){return n.$emit("$translateChangeError",{language:t}),e.reject(t),n.$emit("$translateChangeEnd",{language:t}),r.reject(t)})),z[t].finally((function(){!function(t){c===t&&(c=void 0),z[t]=void 0}(t)})).catch(angular.noop)),e.promise)},G.resolveClientLocale=function(){return j()},G.storageKey=function(){return K()},G.isPostCompilingEnabled=function(){return A},G.isForceAsyncReloadEnabled=function(){return C},G.isKeepContent=function(){return R},G.refresh=function(t){if(!d)throw new Error("Couldn't refresh translation table, no loader registered!");n.$emit("$translateRefreshStart",{language:t});var e=r.defer(),i={};function s(t){var e=X(t);return z[t]=e,e.then((function(e){x[t]={},M(t,e.table),i[t]=!0}),angular.noop),e}if(e.promise.then((function(){for(var t in x)x.hasOwnProperty(t)&&(t in i||delete x[t]);u&&Y(u)}),angular.noop).finally((function(){n.$emit("$translateRefreshEnd",{language:t})})),t)x[t]?s(t).then(e.resolve,e.reject):e.reject();else{var a=o&&o.slice()||[];u&&-1===a.indexOf(u)&&a.push(u),r.all(a.map(s)).then(e.resolve,e.reject)}return e.promise},G.instant=function(t,e,n,r,s){var a=r&&r!==u?H(r)||r:u;if(null===t||angular.isUndefined(t))return t;if(r&&ot(r),angular.isArray(t)){for(var c={},l=0,h=t.length;l<h;l++)c[t[l]]=G.instant(t[l],e,n,r,s);return c}if(angular.isString(t)&&t.length<1)return t;t&&(t=N.apply(t));var p,d,g=[];i&&g.push(i),a&&g.push(a),o&&o.length&&(g=g.concat(o));for(var y=0,b=g.length;y<b;y++){var w=g[y];if(x[w]&&void 0!==x[w][t]&&(p=it(t,e,n,a,s)),void 0!==p)break}return p||""===p||(m||v?p=W(t):(p=k.interpolate(t,e,"filter",s),f&&!O&&(d=tt(t,e,s)),f&&!O&&d&&(p=d))),p},G.versionInfo=function(){return"2.19.0"},G.loaderCache=function(){return y},G.directivePriority=function(){return T},G.statefulFilter=function(){return _},G.isReady=function(){return I};var at=r.defer();at.promise.then((function(){I=!0})),G.onReady=function(t){var e=r.defer();return angular.isFunction(t)&&e.promise.then(t),I?e.resolve():at.promise.then(e.resolve),e.promise},G.getAvailableLanguageKeys=function(){return w.length>0?w:null},G.getTranslationTable=function(t){return(t=t||G.use())&&x[t]?angular.copy(x[t]):null};var ut=n.$on("$translateReady",(function(){at.resolve(),ut(),ut=null})),ct=n.$on("$translateChangeEnd",(function(){at.resolve(),ct(),ct=null}));if(d){if(angular.equals(x,{})&&G.use()&&G.use(G.use()),o&&o.length)for(var lt=function(t){return M(t.key,t.table),n.$emit("$translateChangeEnd",{language:t.key}),t},ht=0,ft=o.length;ht<ft;ht++){var pt=o[ht];!C&&x[pt]||(z[pt]=X(pt).then(lt))}}else n.$emit("$translateReady",{language:G.use()});return G}]}function n(t,e){"use strict";var n={setLocale:function(t){},getInterpolationIdentifier:function(){return"default"},useSanitizeValueStrategy:function(t){return e.useStrategy(t),this},interpolate:function(n,r,i,s,o){var a;return r=r||{},r=e.sanitize(r,"params",s,i),angular.isNumber(n)?a=""+n:angular.isString(n)?(a=t(n)(r),a=e.sanitize(a,"text",s,i)):a="",a}};return n}function r(t,e,n,r,i){"use strict";var s=function(){return this.toString().replace(/^\s+|\s+$/g,"")},o=function(t){return angular.isString(t)?t.toLowerCase():t};return{restrict:"AE",scope:!0,priority:t.directivePriority(),compile:function(a,u){var c=u.translateValues?u.translateValues:void 0,l=u.translateInterpolation?u.translateInterpolation:void 0,h=u.translateSanitizeStrategy?u.translateSanitizeStrategy:void 0,f=a[0].outerHTML.match(/translate-value-+/i),p="^(.*)("+e.startSymbol()+".*"+e.endSymbol()+")(.*)",d="^(.*)"+e.startSymbol()+"(.*)"+e.endSymbol()+"(.*)";return function(a,g,m){a.interpolateParams={},a.preText="",a.postText="",a.translateNamespace=function t(e){return e.translateNamespace?e.translateNamespace:e.$parent?t(e.$parent):void 0}(a);var v={},y=function(t){if(angular.isFunction(y._unwatchOld)&&(y._unwatchOld(),y._unwatchOld=void 0),angular.equals(t,"")||!angular.isDefined(t)){var n=s.apply(g.text()).replace(/\n/g," "),r=n.match(p);if(angular.isArray(r)){a.preText=r[1],a.postText=r[3],v.translate=e(r[2])(a.$parent);var i=n.match(d);angular.isArray(i)&&i[2]&&i[2].length&&(y._unwatchOld=a.$watch(i[2],(function(t){v.translate=t,F()})))}else v.translate=n||void 0}else v.translate=t;F()},b=function(t){m.$observe(t,(function(e){v[t]=e,F()}))};!function(t,e,n){if(e.translateValues&&angular.extend(t,r(e.translateValues)(a.$parent)),f)for(var i in n)Object.prototype.hasOwnProperty.call(e,i)&&"translateValue"===i.substr(0,14)&&"translateValues"!==i&&(t[o(i.substr(14,1))+i.substr(15)]=n[i])}(a.interpolateParams,m,u);var x=!0;for(var w in m.$observe("translate",(function(t){void 0===t?y(""):""===t&&x||(v.translate=t,F()),x=!1})),m)m.hasOwnProperty(w)&&"translateAttr"===w.substr(0,13)&&w.length>13&&b(w);if(m.$observe("translateDefault",(function(t){a.defaultText=t,F()})),h&&m.$observe("translateSanitizeStrategy",(function(t){a.sanitizeStrategy=r(t)(a.$parent),F()})),c&&m.$observe("translateValues",(function(t){t&&a.$parent.$watch((function(){angular.extend(a.interpolateParams,r(t)(a.$parent))}))})),f){var S=function(t){m.$observe(t,(function(e){var n=o(t.substr(14,1))+t.substr(15);a.interpolateParams[n]=e}))};for(var E in m)Object.prototype.hasOwnProperty.call(m,E)&&"translateValue"===E.substr(0,14)&&"translateValues"!==E&&S(E)}var F=function(){for(var t in v)v.hasOwnProperty(t)&&void 0!==v[t]&&A(t,v[t],a,a.interpolateParams,a.defaultText,a.translateNamespace)},A=function(e,n,r,i,s,o){n?(o&&"."===n.charAt(0)&&(n=o+n),t(n,i,l,s,r.translateLanguage,r.sanitizeStrategy).then((function(t){C(t,r,!0,e)}),(function(t){C(t,r,!1,e)}))):C(n,r,!1,e)},C=function(e,r,i,s){if(i||void 0!==r.defaultText&&(e=r.defaultText),"translate"===s){(i||!i&&!t.isKeepContent()&&void 0===m.translateKeepContent)&&g.empty().append(r.preText+e+r.postText);var o=t.isPostCompilingEnabled(),a=void 0!==u.translateCompile,c=a&&"false"!==u.translateCompile;(o&&!a||c)&&n(g.contents())(r)}else{var l=m.$attr[s];"data-"===l.substr(0,5)&&(l=l.substr(5)),l=l.substr(15),g.attr(l,e)}};(c||f||m.translateDefault)&&a.$watch("interpolateParams",F,!0),a.$on("translateLanguageChanged",F);var D=i.$on("$translateChangeSuccess",F);g.text().length?m.translate?y(m.translate):y(""):m.translate&&y(m.translate),F(),a.$on("$destroy",D)}}}}function i(t,e){"use strict";return{restrict:"A",priority:t.directivePriority(),link:function(n,r,i){var o,a,u,c={},l=function(){angular.forEach(o,(function(e,s){e&&(c[s]=!0,n.translateNamespace&&"."===e.charAt(0)&&(e=n.translateNamespace+e),t(e,a,i.translateInterpolation,void 0,n.translateLanguage,u).then((function(t){r.attr(s,t)}),(function(t){r.attr(s,t)})))})),angular.forEach(c,(function(t,e){o[e]||(r.removeAttr(e),delete c[e])}))};s(n,i.translateAttr,(function(t){o=t}),l),s(n,i.translateValues,(function(t){a=t}),l),s(n,i.translateSanitizeStrategy,(function(t){u=t}),l),i.translateValues&&n.$watch(i.translateValues,l,!0),n.$on("translateLanguageChanged",l);var h=e.$on("$translateChangeSuccess",l);l(),n.$on("$destroy",h)}}}function s(t,e,n,r){"use strict";e&&("::"===e.substr(0,2)?e=e.substr(2):t.$watch(e,(function(t){n(t),r()}),!0),n(t.$eval(e)))}function o(t,e){"use strict";return{compile:function(n){var r=function(e){e.addClass(t.cloakClassName())},i=function(e){e.removeClass(t.cloakClassName())};return r(n),function(n,s,o){var a=i.bind(this,s),u=r.bind(this,s);o.translateCloak&&o.translateCloak.length?(o.$observe("translateCloak",(function(e){t(e).then(a,u)})),e.$on("$translateChangeSuccess",(function(){t(o.translateCloak).then(a,u)}))):t.onReady(a)}}}}function a(){"use strict";return{restrict:"A",scope:!0,compile:function(){return{pre:function(t,e,n){t.translateNamespace=function t(e){return e.translateNamespace?e.translateNamespace:e.$parent?t(e.$parent):void 0}(t),t.translateNamespace&&"."===n.translateNamespace.charAt(0)?t.translateNamespace+=n.translateNamespace:t.translateNamespace=n.translateNamespace}}}}}function u(){"use strict";return{restrict:"A",scope:!0,compile:function(){return function(t,e,n){n.$observe("translateLanguage",(function(e){t.translateLanguage=e})),t.$watch("translateLanguage",(function(){t.$broadcast("translateLanguageChanged")}))}}}}function c(t,e){"use strict";var n=function(n,r,i,s){if(!angular.isObject(r)){var o=this||{__SCOPE_IS_NOT_AVAILABLE:"More info at https://github.com/angular/angular.js/commit/8863b9d04c722b278fa93c5d66ad1e578ad6eb1f"};r=t(r)(o)}return e.instant(n,r,i,s)};return e.statefulFilter()&&(n.$stateful=!0),n}function l(t){"use strict";return t("translations")}return t.$inject=["$translate"],e.$inject=["$STORAGE_KEY","$windowProvider","$translateSanitizationProvider","pascalprechtTranslateOverrider"],n.$inject=["$interpolate","$translateSanitization"],r.$inject=["$translate","$interpolate","$compile","$parse","$rootScope"],i.$inject=["$translate","$rootScope"],o.$inject=["$translate","$rootScope"],c.$inject=["$parse","$translate"],l.$inject=["$cacheFactory"],angular.module("pascalprecht.translate",["ng"]).run(t),t.displayName="runTranslate",angular.module("pascalprecht.translate").provider("$translateSanitization",(function(){"use strict";var t,e,n,r=null,i=!1,s=!1;(n={sanitize:function(t,e){return"text"===e&&(t=a(t)),t},escape:function(t,e){return"text"===e&&(t=o(t)),t},sanitizeParameters:function(t,e){return"params"===e&&(t=c(t,a)),t},escapeParameters:function(t,e){return"params"===e&&(t=c(t,o)),t},sce:function(t,e,n){return"text"===e?t=u(t):"params"===e&&"filter"!==n&&(t=c(t,o)),t},sceParameters:function(t,e){return"params"===e&&(t=c(t,u)),t}}).escaped=n.escapeParameters,this.addStrategy=function(t,e){return n[t]=e,this},this.removeStrategy=function(t){return delete n[t],this},this.useStrategy=function(t){return i=!0,r=t,this},this.$get=["$injector","$log",function(o,a){var u={};return o.has("$sanitize")&&(t=o.get("$sanitize")),o.has("$sce")&&(e=o.get("$sce")),{useStrategy:function(t){return function(e){t.useStrategy(e)}}(this),sanitize:function(t,e,c,l){return r||i||s||(a.warn("pascalprecht.translate.$translateSanitization: No sanitization strategy has been configured. This can have serious security implications. See http://angular-translate.github.io/docs/#/guide/19_security for details."),s=!0),c||null===c||(c=r),c?(l||(l="service"),function(t,e,r,i){return angular.forEach(i,(function(i){if(angular.isFunction(i))t=i(t,e,r);else if(angular.isFunction(n[i]))t=n[i](t,e,r);else{if(!angular.isString(n[i]))throw new Error("pascalprecht.translate.$translateSanitization: Unknown sanitization strategy: '"+i+"'");if(!u[n[i]])try{u[n[i]]=o.get(n[i])}catch(t){throw u[n[i]]=function(){},new Error("pascalprecht.translate.$translateSanitization: Unknown sanitization strategy: '"+i+"'")}t=u[n[i]](t,e,r)}})),t}(t,e,l,angular.isArray(c)?c:[c])):t}}}];var o=function(t){var e=angular.element("<div></div>");return e.text(t),e.html()},a=function(e){if(!t)throw new Error("pascalprecht.translate.$translateSanitization: Error cannot find $sanitize service. Either include the ngSanitize module (https://docs.angularjs.org/api/ngSanitize) or use a sanitization strategy which does not depend on $sanitize, such as 'escape'.");return t(e)},u=function(t){if(!e)throw new Error("pascalprecht.translate.$translateSanitization: Error cannot find $sce service.");return e.trustAsHtml(t)},c=function(t,e,n){if(angular.isDate(t))return t;if(angular.isObject(t)){var r=angular.isArray(t)?[]:{};if(n){if(n.indexOf(t)>-1)throw new Error("pascalprecht.translate.$translateSanitization: Error cannot interpolate parameter due recursive object")}else n=[];return n.push(t),angular.forEach(t,(function(t,i){angular.isFunction(t)||(r[i]=c(t,e,n))})),n.splice(-1,1),r}return angular.isNumber(t)||!0===t||!1===t||angular.isUndefined(t)||null===t?t:e(t)}})),angular.module("pascalprecht.translate").constant("pascalprechtTranslateOverrider",{}).provider("$translate",e),e.displayName="displayName",angular.module("pascalprecht.translate").factory("$translateDefaultInterpolation",n),n.displayName="$translateDefaultInterpolation",angular.module("pascalprecht.translate").constant("$STORAGE_KEY","NG_TRANSLATE_LANG_KEY"),angular.module("pascalprecht.translate").directive("translate",r),r.displayName="translateDirective",angular.module("pascalprecht.translate").directive("translateAttr",i),i.displayName="translateAttrDirective",angular.module("pascalprecht.translate").directive("translateCloak",o),o.displayName="translateCloakDirective",angular.module("pascalprecht.translate").directive("translateNamespace",a),a.displayName="translateNamespaceDirective",angular.module("pascalprecht.translate").directive("translateLanguage",u),u.displayName="translateLanguageDirective",angular.module("pascalprecht.translate").filter("translate",c),c.displayName="translateFilterFactory",angular.module("pascalprecht.translate").factory("$translationCache",l),l.displayName="$translationCache","pascalprecht.translate"}()}.apply(e,[]))||(t.exports=r)},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e){!function(t,e,n){"use strict";e.module("ngAnimate",["ng"]).directive("ngAnimateChildren",(function(){return function(t,n,r){r=r.ngAnimateChildren,e.isString(r)&&0===r.length?n.data("$$ngAnimateChildren",!0):t.$watch(r,(function(t){n.data("$$ngAnimateChildren",!!t)}))}})).factory("$$animateReflow",["$$rAF","$document",function(t,e){return function(e){return t((function(){e()}))}}]).config(["$provide","$animateProvider",function(r,i){function s(t){for(var e=0;e<t.length;e++){var n=t[e];if(1==n.nodeType)return n}}function o(t,e){return s(t)==s(e)}var a,u=e.noop,c=e.forEach,l=i.$$selectors,h=e.isArray,f=e.isString,p=e.isObject,d={running:!0};r.decorator("$animate",["$delegate","$$q","$injector","$sniffer","$rootElement","$$asyncCallback","$rootScope","$document","$templateRequest","$$jqLite",function(t,n,r,g,m,v,y,b,x,w){function S(t,e){var n=t.data("$$ngAnimateState")||{};return e&&(n.running=!0,n.structural=!0,t.data("$$ngAnimateState",n)),n.disabled||n.running&&n.structural}function E(t){var e,r=n.defer();return r.promise.$$cancelFn=function(){e&&e()},y.$$postDigest((function(){e=t((function(){r.resolve()}))})),r.promise}function F(t){if(p(t))return t.tempClasses&&f(t.tempClasses)&&(t.tempClasses=t.tempClasses.split(/\s+/)),t}function A(t,n,i,s){function o(t,e){var n=t[e],r=t["before"+e.charAt(0).toUpperCase()+e.substr(1)];if(n||r)return"leave"==e&&(r=n,n=null),F.push({event:e,fn:n}),w.push({event:e,fn:r}),!0}function a(e,n,r){var o=[];c(e,(function(t){t.fn&&o.push(t)}));var a=0;c(o,(function(e,c){var l=function(){t:{if(n){if((n[c]||u)(),++a<o.length)break t;n=null}r()}};switch(e.event){case"setClass":n.push(e.fn(t,p,d,l,s));break;case"animate":n.push(e.fn(t,i,s.from,s.to,l));break;case"addClass":n.push(e.fn(t,p||i,l,s));break;case"removeClass":n.push(e.fn(t,d||i,l,s));break;default:n.push(e.fn(t,l,s))}})),n&&0===n.length&&r()}var f=t[0];if(f){var p,d;s&&(s.to=s.to||{},s.from=s.from||{}),h(i)&&(p=i[0],d=i[1],p?d?i=p+" "+d:(i=p,n="addClass"):(i=d,n="removeClass"));var m="setClass"==n,v=m||"addClass"==n||"removeClass"==n||"animate"==n,y=t.attr("class")+" "+i;if(_(y)){var b=u,x=[],w=[],S=u,E=[],F=[];y=(" "+y).replace(/\s+/g,".");return c(function(t){if(t){var e=[],n={};t=t.substr(1).split("."),(g.transitions||g.animations)&&e.push(r.get(l[""]));for(var i=0;i<t.length;i++){var s=t[i],o=l[s];o&&!n[s]&&(e.push(r.get(o)),n[s]=!0)}return e}}(y),(function(t){!o(t,n)&&m&&(o(t,"addClass"),o(t,"removeClass"))})),{node:f,event:n,className:i,isClassBased:v,isSetClassOperation:m,applyStyles:function(){s&&t.css(e.extend(s.from||{},s.to||{}))},before:function(t){b=t,a(w,x,(function(){b=u,t()}))},after:function(t){S=t,a(F,E,(function(){S=u,t()}))},cancel:function(){x&&(c(x,(function(t){(t||u)(!0)})),b(!0)),E&&(c(E,(function(t){(t||u)(!0)})),S(!0))}}}}}function C(t,n,r,i,s,l,h,f){function p(e){var i="$animate:"+e;S&&S[i]&&0<S[i].length&&v((function(){r.triggerHandler(i,{event:t,className:n})}))}function g(){p("before")}function y(){p("after")}function b(){b.hasBeenRun||(b.hasBeenRun=!0,l())}function x(){if(!x.hasBeenRun){w&&w.applyStyles(),x.hasBeenRun=!0,h&&h.tempClasses&&c(h.tempClasses,(function(t){a.removeClass(r,t)}));var t=r.data("$$ngAnimateState");t&&(w&&w.isClassBased?$(r,n):(v((function(){var t=r.data("$$ngAnimateState")||{};I==t.index&&$(r,n)})),r.data("$$ngAnimateState",t))),p("close"),f()}}var w=A(r,t,n,h);if(!w)return b(),g(),y(),x(),u;t=w.event,n=w.className;var S=(S=e.element._data(w.node))&&S.events;if(i||(i=s?s.parent():r.parent()),function(t,n){if(d.disabled)return!0;if(o(t,m))return d.running;var r,i,s;do{if(0===n.length)break;var a=o(n,m),u=a?d:n.data("$$ngAnimateState")||{};if(u.disabled)return!0;a&&(s=!0),!1!==r&&(a=n.data("$$ngAnimateChildren"),e.isDefined(a)&&(r=a)),i=i||u.running||u.last&&!u.last.isClassBased}while(n=n.parent());return!s||!r&&i}(r,i))return b(),g(),y(),x(),u;var E=(i=r.data("$$ngAnimateState")||{}).active||{},F=i.totalActive||0,C=i.last;if(s=!1,0<F){if(F=[],w.isClassBased)"setClass"==C.event?(F.push(C),$(r,n)):E[n]&&((D=E[n]).event==t?s=!0:(F.push(D),$(r,n)));else if("leave"==t&&E["ng-leave"])s=!0;else{for(var D in E)F.push(E[D]);i={},$(r,!0)}0<F.length&&c(F,(function(t){t.cancel()}))}if(!w.isClassBased||w.isSetClassOperation||"animate"==t||s||(s="addClass"==t==r.hasClass(n)),s)return b(),g(),y(),p("close"),f(),u;E=i.active||{},F=i.totalActive||0,"leave"==t&&r.one("$destroy",(function(t){var n=(t=e.element(this)).data("$$ngAnimateState");n&&(n=n.active["ng-leave"])&&(n.cancel(),$(t,"ng-leave"))})),a.addClass(r,"ng-animate"),h&&h.tempClasses&&c(h.tempClasses,(function(t){a.addClass(r,t)}));var I=R++;return F++,E[n]=w,r.data("$$ngAnimateState",{last:w,active:E,index:I,totalActive:F}),g(),w.before((function(e){var i=r.data("$$ngAnimateState");e=e||!i||!i.active[n]||w.isClassBased&&i.active[n].event!=t,b(),!0===e?x():(y(),w.after(x))})),w.cancel}function D(t){(t=s(t))&&(t=e.isFunction(t.getElementsByClassName)?t.getElementsByClassName("ng-animate"):t.querySelectorAll(".ng-animate"),c(t,(function(t){(t=(t=e.element(t)).data("$$ngAnimateState"))&&t.active&&c(t.active,(function(t){t.cancel()}))})))}function $(t,e){if(o(t,m))d.disabled||(d.running=!1,d.structural=!1);else if(e){var n=t.data("$$ngAnimateState")||{},r=!0===e;!r&&n.active&&n.active[e]&&(n.totalActive--,delete n.active[e]),!r&&n.totalActive||(a.removeClass(t,"ng-animate"),t.removeData("$$ngAnimateState"))}}a=w,m.data("$$ngAnimateState",d);var I=y.$watch((function(){return x.totalPendingRequests}),(function(t,e){0===t&&(I(),y.$$postDigest((function(){y.$$postDigest((function(){d.running=!1}))})))})),R=0,T=i.classNameFilter(),_=T?function(t){return T.test(t)}:function(){return!0};return{animate:function(t,n,r,i,o){return i=i||"ng-inline-animate",(o=F(o)||{}).from=r?n:null,o.to=r||n,E((function(n){return C("animate",i,e.element(s(t)),null,null,u,o,n)}))},enter:function(n,r,i,o){return o=F(o),n=e.element(n),r=r&&e.element(r),i=i&&e.element(i),S(n,!0),t.enter(n,r,i),E((function(t){return C("enter","ng-enter",e.element(s(n)),r,i,u,o,t)}))},leave:function(n,r){return r=F(r),D(n=e.element(n)),S(n,!0),E((function(i){return C("leave","ng-leave",e.element(s(n)),null,null,(function(){t.leave(n)}),r,i)}))},move:function(n,r,i,o){return o=F(o),n=e.element(n),r=r&&e.element(r),i=i&&e.element(i),D(n),S(n,!0),t.move(n,r,i),E((function(t){return C("move","ng-move",e.element(s(n)),r,i,u,o,t)}))},addClass:function(t,e,n){return this.setClass(t,e,[],n)},removeClass:function(t,e,n){return this.setClass(t,[],e,n)},setClass:function(n,r,i,o){if(o=F(o),n=e.element(n),S(n=e.element(s(n))))return t.$$setClassImmediately(n,r,i,o);var a,u=n.data("$$animateClasses"),l=!!u;return u||(u={classes:{}}),a=u.classes,r=h(r)?r:r.split(" "),c(r,(function(t){t&&t.length&&(a[t]=!0)})),i=h(i)?i:i.split(" "),c(i,(function(t){t&&t.length&&(a[t]=!1)})),l?(o&&u.options&&(u.options=e.extend(u.options||{},o)),u.promise):(n.data("$$animateClasses",u={classes:a,options:o}),u.promise=E((function(e){var r=n.parent(),i=s(n);if((o=i.parentNode)&&!o.$$NG_REMOVED&&!i.$$NG_REMOVED){i=n.data("$$animateClasses"),n.removeData("$$animateClasses");var o=n.data("$$ngAnimateState")||{},a=function(t,e,n){var r={};c(n=n||{},(function(t,e){c(e.split(" "),(function(e){r[e]=t}))}));var i=Object.create(null);c((t.attr("class")||"").split(/\s+/),(function(t){i[t]=!0}));var s=[],o=[];return c(e&&e.classes||[],(function(t,e){var n=i[e],a=r[e]||{};!1===t?(n||"addClass"==a.event)&&o.push(e):!0===t&&(n&&"removeClass"!=a.event||s.push(e))})),0<s.length+o.length&&[s.join(" "),o.join(" ")]}(n,i,o.active);return a?C("setClass",a,n,r,null,(function(){a[0]&&t.$$addClassImmediately(n,a[0]),a[1]&&t.$$removeClassImmediately(n,a[1])}),i.options,e):e()}e()})))},cancel:function(t){t.$$cancelFn()},enabled:function(t,e){switch(arguments.length){case 2:if(t)$(e);else{var n=e.data("$$ngAnimateState")||{};n.disabled=!0,e.data("$$ngAnimateState",n)}break;case 1:d.disabled=!t;break;default:t=!d.disabled}return!!t}}}]),i.register("",["$window","$sniffer","$timeout","$$animateReflow",function(r,i,o,l){function p(){R||(R=l((function(){P=[],R=null,T={}})))}function d(t,e){R&&R(),P.push(e),R=l((function(){c(P,(function(t){t()})),P=[],R=null,T={}}))}function g(t,n){var r=s(t);t=e.element(r),j.push(t),(r=Date.now()+n)<=O||(o.cancel(k),O=r,k=o((function(){!function(t){c(t,(function(t){(t=t.data("$$ngAnimateCSS3Data"))&&c(t.closeAnimationFns,(function(t){t()}))}))}(j),j=[]}),n,!1))}function m(t,e){var n=e?T[e]:null;if(!n){var i=0,s=0,o=0,a=0;c(t,(function(t){if(1==t.nodeType){t=r.getComputedStyle(t)||{},i=Math.max(v(t[A+"Duration"]),i),s=Math.max(v(t[A+"Delay"]),s),a=Math.max(v(t[D+"Delay"]),a);var e=v(t[D+"Duration"]);0<e&&(e*=parseInt(t[D+"IterationCount"],10)||1),o=Math.max(e,o)}})),n={total:0,transitionDelay:s,transitionDuration:i,animationDelay:a,animationDuration:o},e&&(T[e]=n)}return n}function v(t){var e=0;return t=f(t)?t.split(/\s*,\s*/):[],c(t,(function(t){e=Math.max(parseFloat(t)||0,e)})),e}function y(t,e,n,r){var i;t=0<=["ng-enter","ng-leave","ng-move"].indexOf(n),(u=(o=e.parent()).data("$$ngAnimateKey"))||(o.data("$$ngAnimateKey",++_),u=_),i=u+"-"+s(e).getAttribute("class");var o,u,c={};0<(u=T[o=i+" "+n]?++T[o].total:0)&&((i=!T[c=i+" "+(l=n+"-stagger")])&&a.addClass(e,l),c=m(e,c),i&&a.removeClass(e,l));a.addClass(e,n);var l=e.data("$$ngAnimateCSS3Data")||{},h=m(e,o);return i=h.transitionDuration,h=h.animationDuration,t&&0===i&&0===h?(a.removeClass(e,n),!1):(n=r||t&&0<i,t=0<h&&0<c.animationDelay&&0===c.animationDuration,e.data("$$ngAnimateCSS3Data",{stagger:c,cacheKey:o,running:l.running||0,itemIndex:u,blockTransition:n,closeAnimationFns:l.closeAnimationFns||[]}),o=s(e),n&&(b(o,!0),r&&e.css(r)),t&&(o.style[D+"PlayState"]="paused"),!0)}function b(t,e){t.style[A+"Property"]=e?"none":""}function x(t,e,n,r){if(y(t,e,n,r))return function(t){t&&E(e,n)}}function w(t,e,n,r,i){if(e.data("$$ngAnimateCSS3Data"))return function(t,e,n,r,i){function u(){e.off(_,l),a.removeClass(e,f),a.removeClass(e,p),R&&o.cancel(R),E(e,n);var t,r=s(e);for(t in d)r.style.removeProperty(d[t])}function l(t){t.stopPropagation();var e=t.originalEvent||t;t=e.$manualTimeStamp||e.timeStamp||Date.now(),e=parseFloat(e.elapsedTime.toFixed(3)),Math.max(t-T,0)>=A&&e>=F&&r()}var h=s(e);if(t=e.data("$$ngAnimateCSS3Data"),-1!=h.getAttribute("class").indexOf(n)&&t){var f="",p="";c(n.split(" "),(function(t,e){var n=(0<e?" ":"")+t;f+=n+"-active",p+=n+"-pending"}));var d=[],v=t.itemIndex,y=t.stagger,x=0;if(0<v){x=0,0<y.transitionDelay&&0===y.transitionDuration&&(x=y.transitionDelay*v);var w=0;0<y.animationDelay&&0===y.animationDuration&&(w=y.animationDelay*v,d.push(I+"animation-play-state")),x=Math.round(100*Math.max(x,w))/100}x||(a.addClass(e,f),t.blockTransition&&b(h,!1));var S=m(e,t.cacheKey+" "+f),F=Math.max(S.transitionDuration,S.animationDuration);if(0!==F){!x&&i&&(S.transitionDuration||(e.css("transition",S.animationDuration+"s linear all"),d.push("transition")),e.css(i));var A=1e3*(v=Math.max(S.transitionDelay,S.animationDelay));0<d.length&&(";"!==(y=h.getAttribute("style")||"").charAt(y.length-1)&&(y+=";"),h.setAttribute("style",y+" "));var R,T=Date.now(),_=$+" "+C;v=1e3*(x+1.5*(v+F));return 0<x&&(a.addClass(e,p),R=o((function(){R=null,0<S.transitionDuration&&b(h,!1),0<S.animationDuration&&(h.style[D+"PlayState"]=""),a.addClass(e,f),a.removeClass(e,p),i&&(0===S.transitionDuration&&e.css("transition",S.animationDuration+"s linear all"),e.css(i),d.push("transition"))}),1e3*x,!1)),e.on(_,l),t.closeAnimationFns.push((function(){u(),r()})),t.running++,g(e,v),u}a.removeClass(e,f),E(e,n),r()}else r()}(t,e,n,r,i);E(e,n),r()}function S(t,e,n,r,i){var s=x(t,e,n,i.from);if(s){var o=s;return d(0,(function(){o=w(t,e,n,r,i.to)})),function(t){(o||u)(t)}}p(),r()}function E(t,e){a.removeClass(t,e);var n=t.data("$$ngAnimateCSS3Data");n&&(n.running&&n.running--,n.running&&0!==n.running||t.removeData("$$ngAnimateCSS3Data"))}function F(t,e){var n="";return t=h(t)?t:t.split(/\s+/),c(t,(function(t,r){t&&0<t.length&&(n+=(0<r?" ":"")+t+e)})),n}var A,C,D,$,I="";t.ontransitionend===n&&t.onwebkittransitionend!==n?(I="-webkit-",A="WebkitTransition",C="webkitTransitionEnd transitionend"):(A="transition",C="transitionend"),t.onanimationend===n&&t.onwebkitanimationend!==n?(I="-webkit-",D="WebkitAnimation",$="webkitAnimationEnd animationend"):(D="animation",$="animationend");var R,T={},_=0,P=[],k=null,O=0,j=[];return{animate:function(t,e,n,r,i,s){return(s=s||{}).from=n,s.to=r,S("animate",t,e,i,s)},enter:function(t,e,n){return S("enter",t,"ng-enter",e,n=n||{})},leave:function(t,e,n){return S("leave",t,"ng-leave",e,n=n||{})},move:function(t,e,n){return S("move",t,"ng-move",e,n=n||{})},beforeSetClass:function(t,e,n,r,i){if(i=i||{},i=x("setClass",t,e=F(n,"-remove")+" "+F(e,"-add"),i.from))return d(0,r),i;p(),r()},beforeAddClass:function(t,e,n,r){if(r=r||{},e=x("addClass",t,F(e,"-add"),r.from))return d(0,n),e;p(),n()},beforeRemoveClass:function(t,e,n,r){if(r=r||{},e=x("removeClass",t,F(e,"-remove"),r.from))return d(0,n),e;p(),n()},setClass:function(t,e,n,r,i){return i=i||{},w("setClass",t,(n=F(n,"-remove"))+" "+(e=F(e,"-add")),r,i.to)},addClass:function(t,e,n,r){return r=r||{},w("addClass",t,F(e,"-add"),n,r.to)},removeClass:function(t,e,n,r){return r=r||{},w("removeClass",t,F(e,"-remove"),n,r.to)}}}])}])}(window,window.angular)},function(t,e){!function(t,e,n){"use strict";e.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(t,n){var r,i={},s={},o=!1,a=e.copy,u=e.isUndefined;return n.addPollFn((function(){var e=n.cookies();r!=e&&(r=e,a(e,s),a(e,i),o&&t.$apply())}))(),o=!0,t.$watch((function(){var t,r,o;for(t in s)u(i[t])&&n.cookies(t,void 0);for(t in i)r=i[t],e.isString(r)||(r=""+r,i[t]=r),r!==s[t]&&(n.cookies(t,r),o=!0);if(o)for(t in r=n.cookies(),i)i[t]!==r[t]&&(u(r[t])?delete i[t]:i[t]=r[t])})),i}]).factory("$cookieStore",["$cookies",function(t){return{get:function(n){return(n=t[n])?e.fromJson(n):n},put:function(n,r){t[n]=e.toJson(r)},remove:function(e){delete t[e]}}}])}(window,window.angular)},function(t,e){!function(t,e,n){"use strict";function r(t,n,r){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(i,s,o,a,u){function c(){p&&(r.cancel(p),p=null),h&&(h.$destroy(),h=null),f&&((p=r.leave(f)).then((function(){p=null})),f=null)}function l(){var o=t.current&&t.current.locals;if(e.isDefined(o&&o.$template)){o=i.$new();var a=t.current;f=u(o,(function(t){r.enter(t,null,f||s).then((function(){!e.isDefined(d)||d&&!i.$eval(d)||n()})),c()})),(h=a.scope=o).$emit("$viewContentLoaded"),h.$eval(g)}else c()}var h,f,p,d=o.autoscroll,g=o.onload||"";i.$on("$routeChangeSuccess",l),l()}}}function i(t,e,n){return{restrict:"ECA",priority:-400,link:function(r,i){var s=n.current,o=s.locals;i.html(o.$template);var a=t(i.contents());s.controller&&(o.$scope=r,o=e(s.controller,o),s.controllerAs&&(r[s.controllerAs]=o),i.data("$ngControllerController",o),i.children().data("$ngControllerController",o)),a(r)}}}t=e.module("ngRoute",["ng"]).provider("$route",(function(){function t(t,n){return e.extend(Object.create(t),n)}function n(t,e){var n=e.caseInsensitiveMatch,r={originalPath:t,regexp:t},i=r.keys=[];return t=t.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?\*])?/g,(function(t,e,n,r){return t="?"===r?r:null,r="*"===r?r:null,i.push({name:n,optional:!!t}),e=e||"",(t?"":e)+"(?:"+(t?e:"")+(r?"(.+?)":"([^/]+)")+(t||"")+")"+(t||"")})).replace(/([\/$\*])/g,"\\$1"),r.regexp=new RegExp("^"+t+"$",n?"i":""),r}var r={};this.when=function(t,i){var s=e.copy(i);if(e.isUndefined(s.reloadOnSearch)&&(s.reloadOnSearch=!0),e.isUndefined(s.caseInsensitiveMatch)&&(s.caseInsensitiveMatch=this.caseInsensitiveMatch),r[t]=e.extend(s,t&&n(t,s)),t){var o="/"==t[t.length-1]?t.substr(0,t.length-1):t+"/";r[o]=e.extend({redirectTo:t},n(o,s))}return this},this.caseInsensitiveMatch=!1,this.otherwise=function(t){return"string"==typeof t&&(t={redirectTo:t}),this.when(null,t),this},this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest","$sce",function(n,i,o,a,u,c,l){function h(s){var o=v.current;(g=(d=function(){var n,s;return e.forEach(r,(function(r,o){var a;if(a=!s){var u=i.path();a=r.keys;var c={};if(r.regexp)if(u=r.regexp.exec(u)){for(var l=1,h=u.length;l<h;++l){var f=a[l-1],p=u[l];f&&p&&(c[f.name]=p)}a=c}else a=null;else a=null;a=n=a}a&&((s=t(r,{params:e.extend({},i.search(),n),pathParams:n})).$$route=r)})),s||r.null&&t(r.null,{params:{},pathParams:{}})}())&&o&&d.$$route===o.$$route&&e.equals(d.pathParams,o.pathParams)&&!d.reloadOnSearch&&!m)||!o&&!d||n.$broadcast("$routeChangeStart",d,o).defaultPrevented&&s&&s.preventDefault()}function f(){var t=v.current,r=d;g?(t.params=r.params,e.copy(t.params,o),n.$broadcast("$routeUpdate",t)):(r||t)&&(m=!1,(v.current=r)&&r.redirectTo&&(e.isString(r.redirectTo)?i.path(p(r.redirectTo,r.params)).search(r.params).replace():i.url(r.redirectTo(r.pathParams,i.path(),i.search())).replace()),a.when(r).then((function(){if(r){var t,n,i=e.extend({},r.resolve);return e.forEach(i,(function(t,n){i[n]=e.isString(t)?u.get(t):u.invoke(t,null,null,n)})),e.isDefined(t=r.template)?e.isFunction(t)&&(t=t(r.params)):e.isDefined(n=r.templateUrl)&&(e.isFunction(n)&&(n=n(r.params)),n=l.getTrustedResourceUrl(n),e.isDefined(n)&&(r.loadedTemplateUrl=n,t=c(n))),e.isDefined(t)&&(i.$template=t),a.all(i)}})).then((function(i){r==v.current&&(r&&(r.locals=i,e.copy(r.params,o)),n.$broadcast("$routeChangeSuccess",r,t))}),(function(e){r==v.current&&n.$broadcast("$routeChangeError",r,t,e)})))}function p(t,n){var r=[];return e.forEach((t||"").split(":"),(function(t,e){if(0===e)r.push(t);else{var i=t.match(/(\w+)(?:[?*])?(.*)/),s=i[1];r.push(n[s]),r.push(i[2]||""),delete n[s]}})),r.join("")}var d,g,m=!1,v={routes:r,reload:function(){m=!0,n.$evalAsync((function(){h(),f()}))},updateParams:function(t){if(!this.current||!this.current.$$route)throw s("norout");var n={},r=this;e.forEach(Object.keys(t),(function(e){r.current.pathParams[e]||(n[e]=t[e])})),t=e.extend({},this.current.params,t),i.path(p(this.current.$$route.originalPath,t)),i.search(e.extend({},i.search(),n))}};return n.$on("$locationChangeStart",h),n.$on("$locationChangeSuccess",f),v}]}));var s=e.$$minErr("ngRoute");t.provider("$routeParams",(function(){this.$get=function(){return{}}})),t.directive("ngView",r),t.directive("ngView",i),r.$inject=["$route","$anchorScroll","$animate"],i.$inject=["$compile","$controller","$route"]}(window,window.angular)},function(t,e){
|
|
48
48
|
/**
|
|
49
49
|
* An Angular module that gives you access to the browsers local storage
|
|
50
50
|
* @version v0.1.5 - 2014-11-04
|
|
@@ -52,7 +52,7 @@ angular.module("angularCancelOnNavigateModule",[]).config(["$httpProvider",funct
|
|
|
52
52
|
* @author grevory <greg@gregpike.ca>
|
|
53
53
|
* @license MIT License, http://www.opensource.org/licenses/MIT
|
|
54
54
|
*/
|
|
55
|
-
!function(t,e){"use strict";var n=e.isDefined,r=e.isUndefined,i=e.isNumber,s=e.isObject,o=e.isArray,a=e.extend,u=e.toJson,c=e.fromJson;e.module("LocalStorageModule",[]).provider("localStorageService",(function(){this.prefix="ls",this.storageType="localStorage",this.cookie={expiry:30,path:"/"},this.notify={setItem:!0,removeItem:!1},this.setPrefix=function(t){return this.prefix=t,this},this.setStorageType=function(t){return this.storageType=t,this},this.setStorageCookie=function(t,e){return this.cookie={expiry:t,path:e},this},this.setStorageCookieDomain=function(t){return this.cookie.domain=t,this},this.setNotify=function(t,e){return this.notify={setItem:t,removeItem:e},this},this.$get=["$rootScope","$window","$document","$parse",function(t,e,l,h){var f,p=this,d=p.prefix,g=p.cookie,m=p.notify,v=p.storageType;l?l[0]&&(l=l[0]):l=document,"."!==d.substr(-1)&&(d=d?d+".":"");var y=function(t){return d+t},b=function(){try{var n=v in e&&null!==e[v],r=y("__"+Math.round(1e7*Math.random()));return n&&((f=e[v]).setItem(r,""),f.removeItem(r)),n}catch(e){return v="cookie",t.$broadcast("LocalStorageModule.notification.error",e.message),!1}}(),w=function(e,n){if(r(n)?n=null:(s(n)||o(n)||i(+n||n))&&(n=u(n)),!b||"cookie"===p.storageType)return b||t.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),m.setItem&&t.$broadcast("LocalStorageModule.notification.setitem",{key:e,newvalue:n,storageType:"cookie"}),F(e,n);try{(s(n)||o(n))&&(n=u(n)),f&&f.setItem(y(e),n),m.setItem&&t.$broadcast("LocalStorageModule.notification.setitem",{key:e,newvalue:n,storageType:p.storageType})}catch(r){return t.$broadcast("LocalStorageModule.notification.error",r.message),F(e,n)}return!0},x=function(e){if(!b||"cookie"===p.storageType)return b||t.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),A(e);var n=f?f.getItem(y(e)):null;return n&&"null"!==n?"{"===n.charAt(0)||"["===n.charAt(0)||function(t){return/^-?\d+\.?\d*$/.test(t.replace(/["']/g,""))}(n)?c(n):n:null},S=function(e){if(!b||"cookie"===p.storageType)return b||t.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),m.removeItem&&t.$broadcast("LocalStorageModule.notification.removeitem",{key:e,storageType:"cookie"}),C(e);try{f.removeItem(y(e)),m.removeItem&&t.$broadcast("LocalStorageModule.notification.removeitem",{key:e,storageType:p.storageType})}catch(n){return t.$broadcast("LocalStorageModule.notification.error",n.message),C(e)}return!0},E=function(){try{return e.navigator.cookieEnabled||"cookie"in l&&(l.cookie.length>0||(l.cookie="test").indexOf.call(l.cookie,"test")>-1)}catch(e){return t.$broadcast("LocalStorageModule.notification.error",e.message),!1}}(),F=function(e,n){if(r(n))return!1;if((o(n)||s(n))&&(n=u(n)),!E)return t.$broadcast("LocalStorageModule.notification.error","COOKIES_NOT_SUPPORTED"),!1;try{var i="",a=new Date,c="";if(null===n?(a.setTime(a.getTime()+-864e5),i="; expires="+a.toGMTString(),n=""):0!==g.expiry&&(a.setTime(a.getTime()+24*g.expiry*60*60*1e3),i="; expires="+a.toGMTString()),e){var h="; path="+g.path;g.domain&&(c="; domain="+g.domain),l.cookie=y(e)+"="+encodeURIComponent(n)+i+h+c}}catch(e){return t.$broadcast("LocalStorageModule.notification.error",e.message),!1}return!0},A=function(e){if(!E)return t.$broadcast("LocalStorageModule.notification.error","COOKIES_NOT_SUPPORTED"),!1;for(var n=l.cookie&&l.cookie.split(";")||[],r=0;r<n.length;r++){for(var i=n[r];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(y(e)+"=")){var s=decodeURIComponent(i.substring(d.length+e.length+1,i.length));try{var o=JSON.parse(s);return c(o)}catch(t){return s}}}return null},C=function(t){F(t,null)},D=function(){for(var t=null,e=d.length,n=l.cookie.split(";"),r=0;r<n.length;r++){for(t=n[r];" "===t.charAt(0);)t=t.substring(1,t.length);var i=t.substring(e,t.indexOf("="));C(i)}};return{isSupported:b,getStorageType:function(){return v},set:w,add:w,get:x,keys:function(){if(!b)return t.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),!1;var e=d.length,n=[];for(var r in f)if(r.substr(0,e)===d)try{n.push(r.substr(e))}catch(e){return t.$broadcast("LocalStorageModule.notification.error",e.Description),[]}return n},remove:S,clearAll:function(e){e=e||"";var n=d.slice(0,-1),r=new RegExp(n+"."+e);if(!b||"cookie"===p.storageType)return b||t.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),D();var i=d.length;for(var s in f)if(r.test(s))try{S(s.substr(i))}catch(e){return t.$broadcast("LocalStorageModule.notification.error",e.message),D()}return!0},bind:function(t,e,r,i){var o=x(i=i||e);return null===o&&n(r)?o=r:s(o)&&s(r)&&(o=a(r,o)),h(e).assign(t,o),t.$watch(e,(function(t){w(i,t)}),s(t[e]))},deriveKey:y,length:function(){for(var t=0,n=e[v],r=0;r<n.length;r++)0===n.key(r).indexOf(d)&&t++;return t},cookie:{isSupported:E,set:F,add:F,get:A,remove:C,clearAll:D}}}]}))}(window,window.angular)},function(t,e){!function(t,e,n){"use strict";function r(t){var e,n={};for(t=t.split(","),e=0;e<t.length;e++)n[t[e]]=!0;return n}function i(t){if(!t)return"";var e=D.exec(t);t=e[1];var n=e[3];return(e=e[2])&&(C.innerHTML=e.replace(/</g,"<"),e="textContent"in C?C.textContent:C.innerText),t+e+n}function s(t){return t.replace(/&/g,"&").replace(m,(function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+((t=t.charCodeAt(1))-56320)+65536)+";"})).replace(v,(function(t){return"&#"+t.charCodeAt(0)+";"})).replace(/</g,"<").replace(/>/g,">")}function o(t,n){var r=!1,i=e.bind(t,t.push);return{start:function(t,o,a){t=e.lowercase(t),!r&&S[t]&&(r=t),r||!0!==E[t]||(i("<"),i(t),e.forEach(o,(function(r,o){var a=e.lowercase(o),u="img"===t&&"src"===a||"background"===a;!0!==A[a]||!0===F[a]&&!n(r,u)||(i(" "),i(o),i('="'),i(s(r)),i('"'))})),i(a?"/>":">"))},end:function(t){t=e.lowercase(t),r||!0!==E[t]||(i("</"),i(t),i(">")),t==r&&(r=!1)},chars:function(t){r||i(s(t))}}}var a=e.$$minErr("$sanitize"),u=/^<((?:[a-zA-Z])[\w:-]*)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*(>?)/,c=/^<\/\s*([\w:-]+)[^>]*>/,l=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,h=/^</,f=/^<\//,p=/\x3c!--(.*?)--\x3e/g,d=/<!DOCTYPE([^>]*?)>/i,g=/<!\[CDATA\[(.*?)]]\x3e/g,m=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,v=/([^\#-~| |!])/g,y=r("area,br,col,hr,img,wbr");t=r("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),n=r("rp,rt");var b=e.extend({},n,t),w=e.extend({},t,r("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul")),x=e.extend({},n,r("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var"));t=r("animate,animateColor,animateMotion,animateTransform,circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,set,stop,svg,switch,text,title,tspan,use");var S=r("script,style"),E=e.extend({},y,w,x,b,t),F=r("background,cite,href,longdesc,src,usemap,xlink:href");t=r("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,target,title,type,valign,value,vspace,width"),n=r("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,attributeName,attributeType,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan");var A=e.extend({},F,n,t),C=document.createElement("pre"),D=/^(\s*)([\s\S]*?)(\s*)$/;e.module("ngSanitize",[]).provider("$sanitize",(function(){this.$get=["$$sanitizeUri",function(t){return function(n){var r=[];return function(t,n){function r(t,r,o,a){if(r=e.lowercase(r),w[r])for(;E.last()&&x[E.last()];)s("",E.last());b[r]&&E.last()==r&&s("",r),(a=y[r]||!!a)||E.push(r);var u={};o.replace(l,(function(t,e,n,r,s){u[e]=i(n||r||s||"")})),n.start&&n.start(r,u,a)}function s(t,r){var i,s=0;if(r=e.lowercase(r))for(s=E.length-1;0<=s&&E[s]!=r;s--);if(0<=s){for(i=E.length-1;i>=s;i--)n.end&&n.end(E[i]);E.length=s}}"string"!=typeof t&&(t=null==t?"":""+t);var o,m,v,E=[],F=t;for(E.last=function(){return E[E.length-1]};t;){if(v="",m=!0,E.last()&&S[E.last()]?(t=t.replace(new RegExp("(.*)<\\s*\\/\\s*"+E.last()+"[^>]*>","i"),(function(t,e){return e=e.replace(p,"$1").replace(g,"$1"),n.chars&&n.chars(i(e)),""})),s(0,E.last())):(0===t.indexOf("\x3c!--")?0<=(o=t.indexOf("--",4))&&t.lastIndexOf("--\x3e",o)===o&&(n.comment&&n.comment(t.substring(4,o)),t=t.substring(o+3),m=!1):d.test(t)?(o=t.match(d))&&(t=t.replace(o[0],""),m=!1):f.test(t)?(o=t.match(c))&&(t=t.substring(o[0].length),o[0].replace(c,s),m=!1):h.test(t)&&((o=t.match(u))?(o[4]&&(t=t.substring(o[0].length),o[0].replace(u,r)),m=!1):(v+="<",t=t.substring(1))),m&&(v+=0>(o=t.indexOf("<"))?t:t.substring(0,o),t=0>o?"":t.substring(o),n.chars&&n.chars(i(v)))),t==F)throw a("badparse",t);F=t}s()}(n,o(r,(function(e,n){return!/^unsafe/.test(t(e,n))}))),r.join("")}}]})),e.module("ngSanitize").filter("linky",["$sanitize",function(t){var n=/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/,r=/^mailto:/;return function(i,s){function a(t){t&&p.push(function(t){var n=[];return o(n,e.noop).chars(t),n.join("")}(t))}function u(t,n){p.push("<a "),e.isDefined(s)&&p.push('target="',s,'" '),p.push('href="',t.replace(/"/g,"""),'">'),a(n),p.push("</a>")}if(!i)return i;for(var c,l,h,f=i,p=[];c=f.match(n);)l=c[0],c[2]||c[4]||(l=(c[3]?"http://":"mailto:")+l),h=c.index,a(f.substr(0,h)),u(l,c[0].replace(r,"")),f=f.substring(h+c[0].length);return a(f),t(p.join(""))}}])}(window,window.angular)},function(t,e,n){n(178),t.exports="toastr"},function(t,e){!function(){"use strict";function t(t,e,n,r,i,s,o){var a,u=0,c=[],l="",h={},f=o.defer();return{active:function(){return c.length},clear:function(t){if(1===arguments.length&&!t)return;if(t)p(t.toastId);else for(var e=0;e<c.length;e++)p(c[e].toastId)},error:function(t,e,n){return d(g().iconClasses.error,t,e,n)},info:function(t,e,n){return d(g().iconClasses.info,t,e,n)},remove:p,success:function(t,e,n){return d(g().iconClasses.success,t,e,n)},warning:function(t,e,n){return d(g().iconClasses.warning,t,e,n)},refreshTimer:function(t,e){t&&t.isOpened&&c.indexOf(t)>=0&&t.scope.refreshTimer(e)}};function p(e,n){var r=function(t){for(var e=0;e<c.length;e++)if(c[e].toastId===t)return c[e]}(e);r&&!r.deleting&&(r.deleting=!0,r.isOpened=!1,t.leave(r.el).then((function(){r.scope.options.onHidden&&r.scope.options.onHidden(!!n,r),r.scope.$destroy();var t=c.indexOf(r);delete h[r.scope.message],c.splice(t,1);var e=s.maxOpened;e&&c.length>=e&&c[e-1].open.resolve(),c.length||(a.remove(),a=null,f=o.defer())})))}function d(n,s,d,m){return angular.isObject(d)&&(m=d,d=null),function(n){var s=g();if(function(){var t=s.preventDuplicates&&n.message===l,e=s.preventOpenDuplicates&&h[n.message];if(t||e)return!0;return l=n.message,h[n.message]=!0,!1}())return;var d=function(){var t={toastId:u++,isOpened:!1,scope:r.$new(),open:o.defer()};t.iconClass=n.iconClass,n.optionsOverride&&(angular.extend(s,function(t){for(var e=["containerId","iconClasses","maxOpened","newestOnTop","positionClass","preventDuplicates","preventOpenDuplicates","templates"],n=0,r=e.length;n<r;n++)delete t[e[n]];return t}(n.optionsOverride)),t.iconClass=n.optionsOverride.iconClass||t.iconClass);return function(t,e,n){n.allowHtml?(t.scope.allowHtml=!0,t.scope.title=i.trustAsHtml(e.title),t.scope.message=i.trustAsHtml(e.message)):(t.scope.title=e.title,t.scope.message=e.message);t.scope.toastType=t.iconClass,t.scope.toastId=t.toastId,t.scope.extraData=n.extraData,t.scope.options={extendedTimeOut:n.extendedTimeOut,messageClass:n.messageClass,onHidden:n.onHidden,onShown:r("onShown"),onTap:r("onTap"),progressBar:n.progressBar,tapToDismiss:n.tapToDismiss,timeOut:n.timeOut,titleClass:n.titleClass,toastClass:n.toastClass},n.closeButton&&(t.scope.options.closeHtml=n.closeHtml);function r(e){if(n[e])return function(){n[e](t)}}}(t,n,s),t.el=function(t){var n=angular.element("<div toast></div>");return e.get("$compile")(n)(t)}(t.scope),t}();if(c.push(d),function(){return s.autoDismiss&&s.maxOpened&&c.length>s.maxOpened}())for(var m=c.slice(0,c.length-s.maxOpened),v=0,y=m.length;v<y;v++)p(m[v].toastId);(s.maxOpened&&c.length<=s.maxOpened||!s.maxOpened)&&d.open.resolve();return d.open.promise.then((function(){(function(e){if(a)return f.promise;(a=angular.element("<div></div>")).attr("id",e.containerId),a.addClass(e.positionClass),a.css({"pointer-events":"auto"});var n=angular.element(document.querySelector(e.target));if(!n||!n.length)throw"Target for toasts doesn't exist";return t.enter(a,n).then((function(){f.resolve()})),f.promise})(s).then((function(){if(d.isOpened=!0,s.newestOnTop)t.enter(d.el,a).then((function(){d.scope.init()}));else{var e=a[0].lastChild?angular.element(a[0].lastChild):null;t.enter(d.el,a,e).then((function(){d.scope.init()}))}}))})),d}({iconClass:n,message:s,optionsOverride:m,title:d})}function g(){return angular.extend({},s)}}angular.module("toastr",[]).factory("toastr",t),t.$inject=["$animate","$injector","$document","$rootScope","$sce","toastrConfig","$q"]}(),function(){"use strict";angular.module("toastr").constant("toastrConfig",{allowHtml:!1,autoDismiss:!1,closeButton:!1,closeHtml:"<button>×</button>",containerId:"toast-container",extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},maxOpened:0,messageClass:"toast-message",newestOnTop:!0,onHidden:null,onShown:null,onTap:null,positionClass:"toast-top-right",preventDuplicates:!1,preventOpenDuplicates:!1,progressBar:!1,tapToDismiss:!0,target:"body",templates:{toast:"directives/toast/toast.html",progressbar:"directives/progressbar/progressbar.html"},timeOut:5e3,titleClass:"toast-title",toastClass:"toast"})}(),function(){"use strict";function t(t){return{require:"^toast",templateUrl:function(){return t.templates.progressbar},link:function(t,e,n,r){var i,s,o;function a(){var t=(o-(new Date).getTime())/s*100;e.css("width",t+"%")}r.progressBar=t,t.start=function(t){i&&clearInterval(i),s=parseFloat(t),o=(new Date).getTime()+s,i=setInterval(a,10)},t.stop=function(){i&&clearInterval(i)},t.$on("$destroy",(function(){clearInterval(i)}))}}}angular.module("toastr").directive("progressBar",t),t.$inject=["toastrConfig"]}(),function(){"use strict";angular.module("toastr").controller("ToastController",(function(){this.progressBar=null,this.startProgressBar=function(t){this.progressBar&&this.progressBar.start(t)},this.stopProgressBar=function(){this.progressBar&&this.progressBar.stop()}}))}(),function(){"use strict";function t(t,e,n,r){return{templateUrl:function(){return n.templates.toast},controller:"ToastController",link:function(n,i,s,o){var a;if(n.toastClass=n.options.toastClass,n.titleClass=n.options.titleClass,n.messageClass=n.options.messageClass,n.progressBar=n.options.progressBar,function(){return n.options.closeHtml}()){var u=angular.element(n.options.closeHtml),c=t.get("$compile");u.addClass("toast-close-button"),u.attr("ng-click","close(true, $event)"),c(u)(n),i.children().prepend(u)}function l(t){return o.startProgressBar(t),e((function(){o.stopProgressBar(),r.remove(n.toastId)}),t,1)}n.init=function(){n.options.timeOut&&(a=l(n.options.timeOut)),n.options.onShown&&n.options.onShown()},i.on("mouseenter",(function(){n.progressBar=!1,o.stopProgressBar(),a&&e.cancel(a)})),n.tapToast=function(){angular.isFunction(n.options.onTap)&&n.options.onTap(),n.options.tapToDismiss&&n.close(!0)},n.close=function(t,e){e&&angular.isFunction(e.stopPropagation)&&e.stopPropagation(),r.remove(n.toastId,t)},n.refreshTimer=function(t){a&&(e.cancel(a),a=l(t||n.options.timeOut))},i.on("mouseleave",(function(){0===n.options.timeOut&&0===n.options.extendedTimeOut||(n.$apply((function(){n.progressBar=n.options.progressBar})),a=l(n.options.extendedTimeOut))}))}}}angular.module("toastr").directive("toast",t),t.$inject=["$injector","$interval","toastrConfig","toastr"]}(),angular.module("toastr").run(["$templateCache",function(t){t.put("directives/progressbar/progressbar.html",'<div class="toast-progress"></div>\n'),t.put("directives/toast/toast.html",'<div class="{{toastClass}} {{toastType}}" ng-click="tapToast()">\n <div ng-switch on="allowHtml">\n <div ng-switch-default ng-if="title" class="{{titleClass}}" aria-label="{{title}}">{{title}}</div>\n <div ng-switch-default class="{{messageClass}}" aria-label="{{message}}">{{message}}</div>\n <div ng-switch-when="true" ng-if="title" class="{{titleClass}}" ng-bind-html="title"></div>\n <div ng-switch-when="true" class="{{messageClass}}" ng-bind-html="message"></div>\n </div>\n <progress-bar ng-if="progressBar"></progress-bar>\n</div>\n')}])},function(t,e,n){(function(t,r){var i;
|
|
55
|
+
!function(t,e){"use strict";var n=e.isDefined,r=e.isUndefined,i=e.isNumber,s=e.isObject,o=e.isArray,a=e.extend,u=e.toJson,c=e.fromJson;e.module("LocalStorageModule",[]).provider("localStorageService",(function(){this.prefix="ls",this.storageType="localStorage",this.cookie={expiry:30,path:"/"},this.notify={setItem:!0,removeItem:!1},this.setPrefix=function(t){return this.prefix=t,this},this.setStorageType=function(t){return this.storageType=t,this},this.setStorageCookie=function(t,e){return this.cookie={expiry:t,path:e},this},this.setStorageCookieDomain=function(t){return this.cookie.domain=t,this},this.setNotify=function(t,e){return this.notify={setItem:t,removeItem:e},this},this.$get=["$rootScope","$window","$document","$parse",function(t,e,l,h){var f,p=this,d=p.prefix,g=p.cookie,m=p.notify,v=p.storageType;l?l[0]&&(l=l[0]):l=document,"."!==d.substr(-1)&&(d=d?d+".":"");var y=function(t){return d+t},b=function(){try{var n=v in e&&null!==e[v],r=y("__"+Math.round(1e7*Math.random()));return n&&((f=e[v]).setItem(r,""),f.removeItem(r)),n}catch(e){return v="cookie",t.$broadcast("LocalStorageModule.notification.error",e.message),!1}}(),x=function(e,n){if(r(n)?n=null:(s(n)||o(n)||i(+n||n))&&(n=u(n)),!b||"cookie"===p.storageType)return b||t.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),m.setItem&&t.$broadcast("LocalStorageModule.notification.setitem",{key:e,newvalue:n,storageType:"cookie"}),F(e,n);try{(s(n)||o(n))&&(n=u(n)),f&&f.setItem(y(e),n),m.setItem&&t.$broadcast("LocalStorageModule.notification.setitem",{key:e,newvalue:n,storageType:p.storageType})}catch(r){return t.$broadcast("LocalStorageModule.notification.error",r.message),F(e,n)}return!0},w=function(e){if(!b||"cookie"===p.storageType)return b||t.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),A(e);var n=f?f.getItem(y(e)):null;return n&&"null"!==n?"{"===n.charAt(0)||"["===n.charAt(0)||function(t){return/^-?\d+\.?\d*$/.test(t.replace(/["']/g,""))}(n)?c(n):n:null},S=function(e){if(!b||"cookie"===p.storageType)return b||t.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),m.removeItem&&t.$broadcast("LocalStorageModule.notification.removeitem",{key:e,storageType:"cookie"}),C(e);try{f.removeItem(y(e)),m.removeItem&&t.$broadcast("LocalStorageModule.notification.removeitem",{key:e,storageType:p.storageType})}catch(n){return t.$broadcast("LocalStorageModule.notification.error",n.message),C(e)}return!0},E=function(){try{return e.navigator.cookieEnabled||"cookie"in l&&(l.cookie.length>0||(l.cookie="test").indexOf.call(l.cookie,"test")>-1)}catch(e){return t.$broadcast("LocalStorageModule.notification.error",e.message),!1}}(),F=function(e,n){if(r(n))return!1;if((o(n)||s(n))&&(n=u(n)),!E)return t.$broadcast("LocalStorageModule.notification.error","COOKIES_NOT_SUPPORTED"),!1;try{var i="",a=new Date,c="";if(null===n?(a.setTime(a.getTime()+-864e5),i="; expires="+a.toGMTString(),n=""):0!==g.expiry&&(a.setTime(a.getTime()+24*g.expiry*60*60*1e3),i="; expires="+a.toGMTString()),e){var h="; path="+g.path;g.domain&&(c="; domain="+g.domain),l.cookie=y(e)+"="+encodeURIComponent(n)+i+h+c}}catch(e){return t.$broadcast("LocalStorageModule.notification.error",e.message),!1}return!0},A=function(e){if(!E)return t.$broadcast("LocalStorageModule.notification.error","COOKIES_NOT_SUPPORTED"),!1;for(var n=l.cookie&&l.cookie.split(";")||[],r=0;r<n.length;r++){for(var i=n[r];" "===i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(y(e)+"=")){var s=decodeURIComponent(i.substring(d.length+e.length+1,i.length));try{var o=JSON.parse(s);return c(o)}catch(t){return s}}}return null},C=function(t){F(t,null)},D=function(){for(var t=null,e=d.length,n=l.cookie.split(";"),r=0;r<n.length;r++){for(t=n[r];" "===t.charAt(0);)t=t.substring(1,t.length);var i=t.substring(e,t.indexOf("="));C(i)}};return{isSupported:b,getStorageType:function(){return v},set:x,add:x,get:w,keys:function(){if(!b)return t.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),!1;var e=d.length,n=[];for(var r in f)if(r.substr(0,e)===d)try{n.push(r.substr(e))}catch(e){return t.$broadcast("LocalStorageModule.notification.error",e.Description),[]}return n},remove:S,clearAll:function(e){e=e||"";var n=d.slice(0,-1),r=new RegExp(n+"."+e);if(!b||"cookie"===p.storageType)return b||t.$broadcast("LocalStorageModule.notification.warning","LOCAL_STORAGE_NOT_SUPPORTED"),D();var i=d.length;for(var s in f)if(r.test(s))try{S(s.substr(i))}catch(e){return t.$broadcast("LocalStorageModule.notification.error",e.message),D()}return!0},bind:function(t,e,r,i){var o=w(i=i||e);return null===o&&n(r)?o=r:s(o)&&s(r)&&(o=a(r,o)),h(e).assign(t,o),t.$watch(e,(function(t){x(i,t)}),s(t[e]))},deriveKey:y,length:function(){for(var t=0,n=e[v],r=0;r<n.length;r++)0===n.key(r).indexOf(d)&&t++;return t},cookie:{isSupported:E,set:F,add:F,get:A,remove:C,clearAll:D}}}]}))}(window,window.angular)},function(t,e){!function(t,e,n){"use strict";function r(t){var e,n={};for(t=t.split(","),e=0;e<t.length;e++)n[t[e]]=!0;return n}function i(t){if(!t)return"";var e=D.exec(t);t=e[1];var n=e[3];return(e=e[2])&&(C.innerHTML=e.replace(/</g,"<"),e="textContent"in C?C.textContent:C.innerText),t+e+n}function s(t){return t.replace(/&/g,"&").replace(m,(function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+((t=t.charCodeAt(1))-56320)+65536)+";"})).replace(v,(function(t){return"&#"+t.charCodeAt(0)+";"})).replace(/</g,"<").replace(/>/g,">")}function o(t,n){var r=!1,i=e.bind(t,t.push);return{start:function(t,o,a){t=e.lowercase(t),!r&&S[t]&&(r=t),r||!0!==E[t]||(i("<"),i(t),e.forEach(o,(function(r,o){var a=e.lowercase(o),u="img"===t&&"src"===a||"background"===a;!0!==A[a]||!0===F[a]&&!n(r,u)||(i(" "),i(o),i('="'),i(s(r)),i('"'))})),i(a?"/>":">"))},end:function(t){t=e.lowercase(t),r||!0!==E[t]||(i("</"),i(t),i(">")),t==r&&(r=!1)},chars:function(t){r||i(s(t))}}}var a=e.$$minErr("$sanitize"),u=/^<((?:[a-zA-Z])[\w:-]*)((?:\s+[\w:-]+(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)\s*(>?)/,c=/^<\/\s*([\w:-]+)[^>]*>/,l=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,h=/^</,f=/^<\//,p=/\x3c!--(.*?)--\x3e/g,d=/<!DOCTYPE([^>]*?)>/i,g=/<!\[CDATA\[(.*?)]]\x3e/g,m=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,v=/([^\#-~| |!])/g,y=r("area,br,col,hr,img,wbr");t=r("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),n=r("rp,rt");var b=e.extend({},n,t),x=e.extend({},t,r("address,article,aside,blockquote,caption,center,del,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,map,menu,nav,ol,pre,script,section,table,ul")),w=e.extend({},n,r("a,abbr,acronym,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,q,ruby,rp,rt,s,samp,small,span,strike,strong,sub,sup,time,tt,u,var"));t=r("animate,animateColor,animateMotion,animateTransform,circle,defs,desc,ellipse,font-face,font-face-name,font-face-src,g,glyph,hkern,image,linearGradient,line,marker,metadata,missing-glyph,mpath,path,polygon,polyline,radialGradient,rect,set,stop,svg,switch,text,title,tspan,use");var S=r("script,style"),E=e.extend({},y,x,w,b,t),F=r("background,cite,href,longdesc,src,usemap,xlink:href");t=r("abbr,align,alt,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,coords,dir,face,headers,height,hreflang,hspace,ismap,lang,language,nohref,nowrap,rel,rev,rows,rowspan,rules,scope,scrolling,shape,size,span,start,summary,target,title,type,valign,value,vspace,width"),n=r("accent-height,accumulate,additive,alphabetic,arabic-form,ascent,attributeName,attributeType,baseProfile,bbox,begin,by,calcMode,cap-height,class,color,color-rendering,content,cx,cy,d,dx,dy,descent,display,dur,end,fill,fill-rule,font-family,font-size,font-stretch,font-style,font-variant,font-weight,from,fx,fy,g1,g2,glyph-name,gradientUnits,hanging,height,horiz-adv-x,horiz-origin-x,ideographic,k,keyPoints,keySplines,keyTimes,lang,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mathematical,max,min,offset,opacity,orient,origin,overline-position,overline-thickness,panose-1,path,pathLength,points,preserveAspectRatio,r,refX,refY,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,rotate,rx,ry,slope,stemh,stemv,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,systemLanguage,target,text-anchor,to,transform,type,u1,u2,underline-position,underline-thickness,unicode,unicode-range,units-per-em,values,version,viewBox,visibility,width,widths,x,x-height,x1,x2,xlink:actuate,xlink:arcrole,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,xml:space,xmlns,xmlns:xlink,y,y1,y2,zoomAndPan");var A=e.extend({},F,n,t),C=document.createElement("pre"),D=/^(\s*)([\s\S]*?)(\s*)$/;e.module("ngSanitize",[]).provider("$sanitize",(function(){this.$get=["$$sanitizeUri",function(t){return function(n){var r=[];return function(t,n){function r(t,r,o,a){if(r=e.lowercase(r),x[r])for(;E.last()&&w[E.last()];)s("",E.last());b[r]&&E.last()==r&&s("",r),(a=y[r]||!!a)||E.push(r);var u={};o.replace(l,(function(t,e,n,r,s){u[e]=i(n||r||s||"")})),n.start&&n.start(r,u,a)}function s(t,r){var i,s=0;if(r=e.lowercase(r))for(s=E.length-1;0<=s&&E[s]!=r;s--);if(0<=s){for(i=E.length-1;i>=s;i--)n.end&&n.end(E[i]);E.length=s}}"string"!=typeof t&&(t=null==t?"":""+t);var o,m,v,E=[],F=t;for(E.last=function(){return E[E.length-1]};t;){if(v="",m=!0,E.last()&&S[E.last()]?(t=t.replace(new RegExp("(.*)<\\s*\\/\\s*"+E.last()+"[^>]*>","i"),(function(t,e){return e=e.replace(p,"$1").replace(g,"$1"),n.chars&&n.chars(i(e)),""})),s(0,E.last())):(0===t.indexOf("\x3c!--")?0<=(o=t.indexOf("--",4))&&t.lastIndexOf("--\x3e",o)===o&&(n.comment&&n.comment(t.substring(4,o)),t=t.substring(o+3),m=!1):d.test(t)?(o=t.match(d))&&(t=t.replace(o[0],""),m=!1):f.test(t)?(o=t.match(c))&&(t=t.substring(o[0].length),o[0].replace(c,s),m=!1):h.test(t)&&((o=t.match(u))?(o[4]&&(t=t.substring(o[0].length),o[0].replace(u,r)),m=!1):(v+="<",t=t.substring(1))),m&&(v+=0>(o=t.indexOf("<"))?t:t.substring(0,o),t=0>o?"":t.substring(o),n.chars&&n.chars(i(v)))),t==F)throw a("badparse",t);F=t}s()}(n,o(r,(function(e,n){return!/^unsafe/.test(t(e,n))}))),r.join("")}}]})),e.module("ngSanitize").filter("linky",["$sanitize",function(t){var n=/((ftp|https?):\/\/|(www\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\S*[^\s.;,(){}<>"\u201d\u2019]/,r=/^mailto:/;return function(i,s){function a(t){t&&p.push(function(t){var n=[];return o(n,e.noop).chars(t),n.join("")}(t))}function u(t,n){p.push("<a "),e.isDefined(s)&&p.push('target="',s,'" '),p.push('href="',t.replace(/"/g,"""),'">'),a(n),p.push("</a>")}if(!i)return i;for(var c,l,h,f=i,p=[];c=f.match(n);)l=c[0],c[2]||c[4]||(l=(c[3]?"http://":"mailto:")+l),h=c.index,a(f.substr(0,h)),u(l,c[0].replace(r,"")),f=f.substring(h+c[0].length);return a(f),t(p.join(""))}}])}(window,window.angular)},function(t,e,n){n(178),t.exports="toastr"},function(t,e){!function(){"use strict";function t(t,e,n,r,i,s,o){var a,u=0,c=[],l="",h={},f=o.defer();return{active:function(){return c.length},clear:function(t){if(1===arguments.length&&!t)return;if(t)p(t.toastId);else for(var e=0;e<c.length;e++)p(c[e].toastId)},error:function(t,e,n){return d(g().iconClasses.error,t,e,n)},info:function(t,e,n){return d(g().iconClasses.info,t,e,n)},remove:p,success:function(t,e,n){return d(g().iconClasses.success,t,e,n)},warning:function(t,e,n){return d(g().iconClasses.warning,t,e,n)},refreshTimer:function(t,e){t&&t.isOpened&&c.indexOf(t)>=0&&t.scope.refreshTimer(e)}};function p(e,n){var r=function(t){for(var e=0;e<c.length;e++)if(c[e].toastId===t)return c[e]}(e);r&&!r.deleting&&(r.deleting=!0,r.isOpened=!1,t.leave(r.el).then((function(){r.scope.options.onHidden&&r.scope.options.onHidden(!!n,r),r.scope.$destroy();var t=c.indexOf(r);delete h[r.scope.message],c.splice(t,1);var e=s.maxOpened;e&&c.length>=e&&c[e-1].open.resolve(),c.length||(a.remove(),a=null,f=o.defer())})))}function d(n,s,d,m){return angular.isObject(d)&&(m=d,d=null),function(n){var s=g();if(function(){var t=s.preventDuplicates&&n.message===l,e=s.preventOpenDuplicates&&h[n.message];if(t||e)return!0;return l=n.message,h[n.message]=!0,!1}())return;var d=function(){var t={toastId:u++,isOpened:!1,scope:r.$new(),open:o.defer()};t.iconClass=n.iconClass,n.optionsOverride&&(angular.extend(s,function(t){for(var e=["containerId","iconClasses","maxOpened","newestOnTop","positionClass","preventDuplicates","preventOpenDuplicates","templates"],n=0,r=e.length;n<r;n++)delete t[e[n]];return t}(n.optionsOverride)),t.iconClass=n.optionsOverride.iconClass||t.iconClass);return function(t,e,n){n.allowHtml?(t.scope.allowHtml=!0,t.scope.title=i.trustAsHtml(e.title),t.scope.message=i.trustAsHtml(e.message)):(t.scope.title=e.title,t.scope.message=e.message);t.scope.toastType=t.iconClass,t.scope.toastId=t.toastId,t.scope.extraData=n.extraData,t.scope.options={extendedTimeOut:n.extendedTimeOut,messageClass:n.messageClass,onHidden:n.onHidden,onShown:r("onShown"),onTap:r("onTap"),progressBar:n.progressBar,tapToDismiss:n.tapToDismiss,timeOut:n.timeOut,titleClass:n.titleClass,toastClass:n.toastClass},n.closeButton&&(t.scope.options.closeHtml=n.closeHtml);function r(e){if(n[e])return function(){n[e](t)}}}(t,n,s),t.el=function(t){var n=angular.element("<div toast></div>");return e.get("$compile")(n)(t)}(t.scope),t}();if(c.push(d),function(){return s.autoDismiss&&s.maxOpened&&c.length>s.maxOpened}())for(var m=c.slice(0,c.length-s.maxOpened),v=0,y=m.length;v<y;v++)p(m[v].toastId);(s.maxOpened&&c.length<=s.maxOpened||!s.maxOpened)&&d.open.resolve();return d.open.promise.then((function(){(function(e){if(a)return f.promise;(a=angular.element("<div></div>")).attr("id",e.containerId),a.addClass(e.positionClass),a.css({"pointer-events":"auto"});var n=angular.element(document.querySelector(e.target));if(!n||!n.length)throw"Target for toasts doesn't exist";return t.enter(a,n).then((function(){f.resolve()})),f.promise})(s).then((function(){if(d.isOpened=!0,s.newestOnTop)t.enter(d.el,a).then((function(){d.scope.init()}));else{var e=a[0].lastChild?angular.element(a[0].lastChild):null;t.enter(d.el,a,e).then((function(){d.scope.init()}))}}))})),d}({iconClass:n,message:s,optionsOverride:m,title:d})}function g(){return angular.extend({},s)}}angular.module("toastr",[]).factory("toastr",t),t.$inject=["$animate","$injector","$document","$rootScope","$sce","toastrConfig","$q"]}(),function(){"use strict";angular.module("toastr").constant("toastrConfig",{allowHtml:!1,autoDismiss:!1,closeButton:!1,closeHtml:"<button>×</button>",containerId:"toast-container",extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},maxOpened:0,messageClass:"toast-message",newestOnTop:!0,onHidden:null,onShown:null,onTap:null,positionClass:"toast-top-right",preventDuplicates:!1,preventOpenDuplicates:!1,progressBar:!1,tapToDismiss:!0,target:"body",templates:{toast:"directives/toast/toast.html",progressbar:"directives/progressbar/progressbar.html"},timeOut:5e3,titleClass:"toast-title",toastClass:"toast"})}(),function(){"use strict";function t(t){return{require:"^toast",templateUrl:function(){return t.templates.progressbar},link:function(t,e,n,r){var i,s,o;function a(){var t=(o-(new Date).getTime())/s*100;e.css("width",t+"%")}r.progressBar=t,t.start=function(t){i&&clearInterval(i),s=parseFloat(t),o=(new Date).getTime()+s,i=setInterval(a,10)},t.stop=function(){i&&clearInterval(i)},t.$on("$destroy",(function(){clearInterval(i)}))}}}angular.module("toastr").directive("progressBar",t),t.$inject=["toastrConfig"]}(),function(){"use strict";angular.module("toastr").controller("ToastController",(function(){this.progressBar=null,this.startProgressBar=function(t){this.progressBar&&this.progressBar.start(t)},this.stopProgressBar=function(){this.progressBar&&this.progressBar.stop()}}))}(),function(){"use strict";function t(t,e,n,r){return{templateUrl:function(){return n.templates.toast},controller:"ToastController",link:function(n,i,s,o){var a;if(n.toastClass=n.options.toastClass,n.titleClass=n.options.titleClass,n.messageClass=n.options.messageClass,n.progressBar=n.options.progressBar,function(){return n.options.closeHtml}()){var u=angular.element(n.options.closeHtml),c=t.get("$compile");u.addClass("toast-close-button"),u.attr("ng-click","close(true, $event)"),c(u)(n),i.children().prepend(u)}function l(t){return o.startProgressBar(t),e((function(){o.stopProgressBar(),r.remove(n.toastId)}),t,1)}n.init=function(){n.options.timeOut&&(a=l(n.options.timeOut)),n.options.onShown&&n.options.onShown()},i.on("mouseenter",(function(){n.progressBar=!1,o.stopProgressBar(),a&&e.cancel(a)})),n.tapToast=function(){angular.isFunction(n.options.onTap)&&n.options.onTap(),n.options.tapToDismiss&&n.close(!0)},n.close=function(t,e){e&&angular.isFunction(e.stopPropagation)&&e.stopPropagation(),r.remove(n.toastId,t)},n.refreshTimer=function(t){a&&(e.cancel(a),a=l(t||n.options.timeOut))},i.on("mouseleave",(function(){0===n.options.timeOut&&0===n.options.extendedTimeOut||(n.$apply((function(){n.progressBar=n.options.progressBar})),a=l(n.options.extendedTimeOut))}))}}}angular.module("toastr").directive("toast",t),t.$inject=["$injector","$interval","toastrConfig","toastr"]}(),angular.module("toastr").run(["$templateCache",function(t){t.put("directives/progressbar/progressbar.html",'<div class="toast-progress"></div>\n'),t.put("directives/toast/toast.html",'<div class="{{toastClass}} {{toastType}}" ng-click="tapToast()">\n <div ng-switch on="allowHtml">\n <div ng-switch-default ng-if="title" class="{{titleClass}}" aria-label="{{title}}">{{title}}</div>\n <div ng-switch-default class="{{messageClass}}" aria-label="{{message}}">{{message}}</div>\n <div ng-switch-when="true" ng-if="title" class="{{titleClass}}" ng-bind-html="title"></div>\n <div ng-switch-when="true" class="{{messageClass}}" ng-bind-html="message"></div>\n </div>\n <progress-bar ng-if="progressBar"></progress-bar>\n</div>\n')}])},function(t,e,n){(function(t,r){var i;
|
|
56
56
|
/**
|
|
57
57
|
* @license
|
|
58
58
|
* Lodash <https://lodash.com/>
|
|
@@ -60,20 +60,20 @@ angular.module("angularCancelOnNavigateModule",[]).config(["$httpProvider",funct
|
|
|
60
60
|
* Released under MIT license <https://lodash.com/license>
|
|
61
61
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
62
62
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
63
|
-
*/(function(){var s="Expected a function",o="__lodash_placeholder__",a=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],u="[object Arguments]",c="[object Array]",l="[object Boolean]",h="[object Date]",f="[object Error]",p="[object Function]",d="[object GeneratorFunction]",g="[object Map]",m="[object Number]",v="[object Object]",y="[object RegExp]",b="[object Set]",w="[object String]",x="[object Symbol]",S="[object WeakMap]",E="[object ArrayBuffer]",F="[object DataView]",A="[object Float32Array]",C="[object Float64Array]",D="[object Int8Array]",I="[object Int16Array]",$="[object Int32Array]",R="[object Uint8Array]",T="[object Uint16Array]",_="[object Uint32Array]",P=/\b__p \+= '';/g,k=/\b(__p \+=) '' \+/g,O=/(__e\(.*?\)|\b__t\)) \+\n'';/g,j=/&(?:amp|lt|gt|quot|#39);/g,B=/[&<>"']/g,N=RegExp(j.source),L=RegExp(B.source),H=/<%-([\s\S]+?)%>/g,M=/<%([\s\S]+?)%>/g,U=/<%=([\s\S]+?)%>/g,V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q=/^\w*$/,K=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z=/[\\^$.*+?()[\]{}|]/g,G=RegExp(z.source),W=/^\s+/,Y=/\s/,X=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,J=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,Q=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,tt=/[()=,{}\[\]\/\s]/,et=/\\(\\)?/g,nt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rt=/\w*$/,it=/^[-+]0x[0-9a-f]+$/i,st=/^0b[01]+$/i,ot=/^\[object .+?Constructor\]$/,at=/^0o[0-7]+$/i,ut=/^(?:0|[1-9]\d*)$/,ct=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,lt=/($^)/,ht=/['\n\r\u2028\u2029\\]/g,ft="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",pt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",dt="[\\ud800-\\udfff]",gt="["+pt+"]",mt="["+ft+"]",vt="\\d+",yt="[\\u2700-\\u27bf]",bt="[a-z\\xdf-\\xf6\\xf8-\\xff]",wt="[^\\ud800-\\udfff"+pt+vt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",xt="\\ud83c[\\udffb-\\udfff]",St="[^\\ud800-\\udfff]",Et="(?:\\ud83c[\\udde6-\\uddff]){2}",Ft="[\\ud800-\\udbff][\\udc00-\\udfff]",At="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ct="(?:"+bt+"|"+wt+")",Dt="(?:"+At+"|"+wt+")",It="(?:"+mt+"|"+xt+")"+"?",$t="[\\ufe0e\\ufe0f]?"+It+("(?:\\u200d(?:"+[St,Et,Ft].join("|")+")[\\ufe0e\\ufe0f]?"+It+")*"),Rt="(?:"+[yt,Et,Ft].join("|")+")"+$t,Tt="(?:"+[St+mt+"?",mt,Et,Ft,dt].join("|")+")",_t=RegExp("['’]","g"),Pt=RegExp(mt,"g"),kt=RegExp(xt+"(?="+xt+")|"+Tt+$t,"g"),Ot=RegExp([At+"?"+bt+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[gt,At,"$"].join("|")+")",Dt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[gt,At+Ct,"$"].join("|")+")",At+"?"+Ct+"+(?:['’](?:d|ll|m|re|s|t|ve))?",At+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vt,Rt].join("|"),"g"),jt=RegExp("[\\u200d\\ud800-\\udfff"+ft+"\\ufe0e\\ufe0f]"),Bt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Lt=-1,Ht={};Ht[A]=Ht[C]=Ht[D]=Ht[I]=Ht[$]=Ht[R]=Ht["[object Uint8ClampedArray]"]=Ht[T]=Ht[_]=!0,Ht[u]=Ht[c]=Ht[E]=Ht[l]=Ht[F]=Ht[h]=Ht[f]=Ht[p]=Ht[g]=Ht[m]=Ht[v]=Ht[y]=Ht[b]=Ht[w]=Ht[S]=!1;var Mt={};Mt[u]=Mt[c]=Mt[E]=Mt[F]=Mt[l]=Mt[h]=Mt[A]=Mt[C]=Mt[D]=Mt[I]=Mt[$]=Mt[g]=Mt[m]=Mt[v]=Mt[y]=Mt[b]=Mt[w]=Mt[x]=Mt[R]=Mt["[object Uint8ClampedArray]"]=Mt[T]=Mt[_]=!0,Mt[f]=Mt[p]=Mt[S]=!1;var Ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Vt=parseFloat,qt=parseInt,Kt="object"==typeof t&&t&&t.Object===Object&&t,zt="object"==typeof self&&self&&self.Object===Object&&self,Gt=Kt||zt||Function("return this")(),Wt=e&&!e.nodeType&&e,Yt=Wt&&"object"==typeof r&&r&&!r.nodeType&&r,Xt=Yt&&Yt.exports===Wt,Jt=Xt&&Kt.process,Zt=function(){try{var t=Yt&&Yt.require&&Yt.require("util").types;return t||Jt&&Jt.binding&&Jt.binding("util")}catch(t){}}(),Qt=Zt&&Zt.isArrayBuffer,te=Zt&&Zt.isDate,ee=Zt&&Zt.isMap,ne=Zt&&Zt.isRegExp,re=Zt&&Zt.isSet,ie=Zt&&Zt.isTypedArray;function se(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function oe(t,e,n,r){for(var i=-1,s=null==t?0:t.length;++i<s;){var o=t[i];e(r,o,n(o),t)}return r}function ae(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function ue(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function ce(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function le(t,e){for(var n=-1,r=null==t?0:t.length,i=0,s=[];++n<r;){var o=t[n];e(o,n,t)&&(s[i++]=o)}return s}function he(t,e){return!!(null==t?0:t.length)&&xe(t,e,0)>-1}function fe(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function pe(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function de(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function ge(t,e,n,r){var i=-1,s=null==t?0:t.length;for(r&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}function me(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function ve(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var ye=Ae("length");function be(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function we(t,e,n,r){for(var i=t.length,s=n+(r?1:-1);r?s--:++s<i;)if(e(t[s],s,t))return s;return-1}function xe(t,e,n){return e==e?function(t,e,n){var r=n-1,i=t.length;for(;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):we(t,Ee,n)}function Se(t,e,n,r){for(var i=n-1,s=t.length;++i<s;)if(r(t[i],e))return i;return-1}function Ee(t){return t!=t}function Fe(t,e){var n=null==t?0:t.length;return n?Ie(t,e)/n:NaN}function Ae(t){return function(e){return null==e?void 0:e[t]}}function Ce(t){return function(e){return null==t?void 0:t[e]}}function De(t,e,n,r,i){return i(t,(function(t,i,s){n=r?(r=!1,t):e(n,t,i,s)})),n}function Ie(t,e){for(var n,r=-1,i=t.length;++r<i;){var s=e(t[r]);void 0!==s&&(n=void 0===n?s:n+s)}return n}function $e(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Re(t){return t?t.slice(0,We(t)+1).replace(W,""):t}function Te(t){return function(e){return t(e)}}function _e(t,e){return pe(e,(function(e){return t[e]}))}function Pe(t,e){return t.has(e)}function ke(t,e){for(var n=-1,r=t.length;++n<r&&xe(e,t[n],0)>-1;);return n}function Oe(t,e){for(var n=t.length;n--&&xe(e,t[n],0)>-1;);return n}function je(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var Be=Ce({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Ne=Ce({"&":"&","<":"<",">":">",'"':""","'":"'"});function Le(t){return"\\"+Ut[t]}function He(t){return jt.test(t)}function Me(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function Ue(t,e){return function(n){return t(e(n))}}function Ve(t,e){for(var n=-1,r=t.length,i=0,s=[];++n<r;){var a=t[n];a!==e&&a!==o||(t[n]=o,s[i++]=n)}return s}function qe(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function Ke(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function ze(t){return He(t)?function(t){var e=kt.lastIndex=0;for(;kt.test(t);)++e;return e}(t):ye(t)}function Ge(t){return He(t)?function(t){return t.match(kt)||[]}(t):function(t){return t.split("")}(t)}function We(t){for(var e=t.length;e--&&Y.test(t.charAt(e)););return e}var Ye=Ce({"&":"&","<":"<",">":">",""":'"',"'":"'"});var Xe=function t(e){var n,r=(e=null==e?Gt:Xe.defaults(Gt.Object(),e,Xe.pick(Gt,Nt))).Array,i=e.Date,Y=e.Error,ft=e.Function,pt=e.Math,dt=e.Object,gt=e.RegExp,mt=e.String,vt=e.TypeError,yt=r.prototype,bt=ft.prototype,wt=dt.prototype,xt=e["__core-js_shared__"],St=bt.toString,Et=wt.hasOwnProperty,Ft=0,At=(n=/[^.]+$/.exec(xt&&xt.keys&&xt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Ct=wt.toString,Dt=St.call(dt),It=Gt._,$t=gt("^"+St.call(Et).replace(z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Rt=Xt?e.Buffer:void 0,Tt=e.Symbol,kt=e.Uint8Array,jt=Rt?Rt.allocUnsafe:void 0,Ut=Ue(dt.getPrototypeOf,dt),Kt=dt.create,zt=wt.propertyIsEnumerable,Wt=yt.splice,Yt=Tt?Tt.isConcatSpreadable:void 0,Jt=Tt?Tt.iterator:void 0,Zt=Tt?Tt.toStringTag:void 0,ye=function(){try{var t=ts(dt,"defineProperty");return t({},"",{}),t}catch(t){}}(),Ce=e.clearTimeout!==Gt.clearTimeout&&e.clearTimeout,Je=i&&i.now!==Gt.Date.now&&i.now,Ze=e.setTimeout!==Gt.setTimeout&&e.setTimeout,Qe=pt.ceil,tn=pt.floor,en=dt.getOwnPropertySymbols,nn=Rt?Rt.isBuffer:void 0,rn=e.isFinite,sn=yt.join,on=Ue(dt.keys,dt),an=pt.max,un=pt.min,cn=i.now,ln=e.parseInt,hn=pt.random,fn=yt.reverse,pn=ts(e,"DataView"),dn=ts(e,"Map"),gn=ts(e,"Promise"),mn=ts(e,"Set"),vn=ts(e,"WeakMap"),yn=ts(dt,"create"),bn=vn&&new vn,wn={},xn=Ds(pn),Sn=Ds(dn),En=Ds(gn),Fn=Ds(mn),An=Ds(vn),Cn=Tt?Tt.prototype:void 0,Dn=Cn?Cn.valueOf:void 0,In=Cn?Cn.toString:void 0;function $n(t){if(Ko(t)&&!ko(t)&&!(t instanceof Pn)){if(t instanceof _n)return t;if(Et.call(t,"__wrapped__"))return Is(t)}return new _n(t)}var Rn=function(){function t(){}return function(e){if(!qo(e))return{};if(Kt)return Kt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Tn(){}function _n(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function Pn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function kn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function On(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function jn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Bn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new jn;++e<n;)this.add(t[e])}function Nn(t){var e=this.__data__=new On(t);this.size=e.size}function Ln(t,e){var n=ko(t),r=!n&&Po(t),i=!n&&!r&&No(t),s=!n&&!r&&!i&&Qo(t),o=n||r||i||s,a=o?$e(t.length,mt):[],u=a.length;for(var c in t)!e&&!Et.call(t,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||as(c,u))||a.push(c);return a}function Hn(t){var e=t.length;return e?t[Br(0,e-1)]:void 0}function Mn(t,e){return Fs(yi(t),Xn(e,0,t.length))}function Un(t){return Fs(yi(t))}function Vn(t,e,n){(void 0!==n&&!Ro(t[e],n)||void 0===n&&!(e in t))&&Wn(t,e,n)}function qn(t,e,n){var r=t[e];Et.call(t,e)&&Ro(r,n)&&(void 0!==n||e in t)||Wn(t,e,n)}function Kn(t,e){for(var n=t.length;n--;)if(Ro(t[n][0],e))return n;return-1}function zn(t,e,n,r){return er(t,(function(t,i,s){e(r,t,n(t),s)})),r}function Gn(t,e){return t&&bi(e,xa(e),t)}function Wn(t,e,n){"__proto__"==e&&ye?ye(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Yn(t,e){for(var n=-1,i=e.length,s=r(i),o=null==t;++n<i;)s[n]=o?void 0:ma(t,e[n]);return s}function Xn(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}function Jn(t,e,n,r,i,s){var o,a=1&e,c=2&e,f=4&e;if(n&&(o=i?n(t,r,i,s):n(t)),void 0!==o)return o;if(!qo(t))return t;var S=ko(t);if(S){if(o=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&Et.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!a)return yi(t,o)}else{var P=rs(t),k=P==p||P==d;if(No(t))return fi(t,a);if(P==v||P==u||k&&!i){if(o=c||k?{}:ss(t),!a)return c?function(t,e){return bi(t,ns(t),e)}(t,function(t,e){return t&&bi(e,Sa(e),t)}(o,t)):function(t,e){return bi(t,es(t),e)}(t,Gn(o,t))}else{if(!Mt[P])return i?t:{};o=function(t,e,n){var r=t.constructor;switch(e){case E:return pi(t);case l:case h:return new r(+t);case F:return function(t,e){var n=e?pi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case A:case C:case D:case I:case $:case R:case"[object Uint8ClampedArray]":case T:case _:return di(t,n);case g:return new r;case m:case w:return new r(t);case y:return function(t){var e=new t.constructor(t.source,rt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case b:return new r;case x:return i=t,Dn?dt(Dn.call(i)):{}}var i}(t,P,a)}}s||(s=new Nn);var O=s.get(t);if(O)return O;s.set(t,o),Xo(t)?t.forEach((function(r){o.add(Jn(r,e,n,r,t,s))})):zo(t)&&t.forEach((function(r,i){o.set(i,Jn(r,e,n,i,t,s))}));var j=S?void 0:(f?c?Gi:zi:c?Sa:xa)(t);return ae(j||t,(function(r,i){j&&(r=t[i=r]),qn(o,i,Jn(r,e,n,i,t,s))})),o}function Zn(t,e,n){var r=n.length;if(null==t)return!r;for(t=dt(t);r--;){var i=n[r],s=e[i],o=t[i];if(void 0===o&&!(i in t)||!s(o))return!1}return!0}function Qn(t,e,n){if("function"!=typeof t)throw new vt(s);return ws((function(){t.apply(void 0,n)}),e)}function tr(t,e,n,r){var i=-1,s=he,o=!0,a=t.length,u=[],c=e.length;if(!a)return u;n&&(e=pe(e,Te(n))),r?(s=fe,o=!1):e.length>=200&&(s=Pe,o=!1,e=new Bn(e));t:for(;++i<a;){var l=t[i],h=null==n?l:n(l);if(l=r||0!==l?l:0,o&&h==h){for(var f=c;f--;)if(e[f]===h)continue t;u.push(l)}else s(e,h,r)||u.push(l)}return u}$n.templateSettings={escape:H,evaluate:M,interpolate:U,variable:"",imports:{_:$n}},$n.prototype=Tn.prototype,$n.prototype.constructor=$n,_n.prototype=Rn(Tn.prototype),_n.prototype.constructor=_n,Pn.prototype=Rn(Tn.prototype),Pn.prototype.constructor=Pn,kn.prototype.clear=function(){this.__data__=yn?yn(null):{},this.size=0},kn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},kn.prototype.get=function(t){var e=this.__data__;if(yn){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Et.call(e,t)?e[t]:void 0},kn.prototype.has=function(t){var e=this.__data__;return yn?void 0!==e[t]:Et.call(e,t)},kn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=yn&&void 0===e?"__lodash_hash_undefined__":e,this},On.prototype.clear=function(){this.__data__=[],this.size=0},On.prototype.delete=function(t){var e=this.__data__,n=Kn(e,t);return!(n<0)&&(n==e.length-1?e.pop():Wt.call(e,n,1),--this.size,!0)},On.prototype.get=function(t){var e=this.__data__,n=Kn(e,t);return n<0?void 0:e[n][1]},On.prototype.has=function(t){return Kn(this.__data__,t)>-1},On.prototype.set=function(t,e){var n=this.__data__,r=Kn(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},jn.prototype.clear=function(){this.size=0,this.__data__={hash:new kn,map:new(dn||On),string:new kn}},jn.prototype.delete=function(t){var e=Zi(this,t).delete(t);return this.size-=e?1:0,e},jn.prototype.get=function(t){return Zi(this,t).get(t)},jn.prototype.has=function(t){return Zi(this,t).has(t)},jn.prototype.set=function(t,e){var n=Zi(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Bn.prototype.add=Bn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Bn.prototype.has=function(t){return this.__data__.has(t)},Nn.prototype.clear=function(){this.__data__=new On,this.size=0},Nn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Nn.prototype.get=function(t){return this.__data__.get(t)},Nn.prototype.has=function(t){return this.__data__.has(t)},Nn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof On){var r=n.__data__;if(!dn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new jn(r)}return n.set(t,e),this.size=n.size,this};var er=Si(cr),nr=Si(lr,!0);function rr(t,e){var n=!0;return er(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function ir(t,e,n){for(var r=-1,i=t.length;++r<i;){var s=t[r],o=e(s);if(null!=o&&(void 0===a?o==o&&!Zo(o):n(o,a)))var a=o,u=s}return u}function sr(t,e){var n=[];return er(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function or(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=os),i||(i=[]);++s<o;){var a=t[s];e>0&&n(a)?e>1?or(a,e-1,n,r,i):de(i,a):r||(i[i.length]=a)}return i}var ar=Ei(),ur=Ei(!0);function cr(t,e){return t&&ar(t,e,xa)}function lr(t,e){return t&&ur(t,e,xa)}function hr(t,e){return le(e,(function(e){return Mo(t[e])}))}function fr(t,e){for(var n=0,r=(e=ui(e,t)).length;null!=t&&n<r;)t=t[Cs(e[n++])];return n&&n==r?t:void 0}function pr(t,e,n){var r=e(t);return ko(t)?r:de(r,n(t))}function dr(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Zt&&Zt in dt(t)?function(t){var e=Et.call(t,Zt),n=t[Zt];try{t[Zt]=void 0;var r=!0}catch(t){}var i=Ct.call(t);r&&(e?t[Zt]=n:delete t[Zt]);return i}(t):function(t){return Ct.call(t)}(t)}function gr(t,e){return t>e}function mr(t,e){return null!=t&&Et.call(t,e)}function vr(t,e){return null!=t&&e in dt(t)}function yr(t,e,n){for(var i=n?fe:he,s=t[0].length,o=t.length,a=o,u=r(o),c=1/0,l=[];a--;){var h=t[a];a&&e&&(h=pe(h,Te(e))),c=un(h.length,c),u[a]=!n&&(e||s>=120&&h.length>=120)?new Bn(a&&h):void 0}h=t[0];var f=-1,p=u[0];t:for(;++f<s&&l.length<c;){var d=h[f],g=e?e(d):d;if(d=n||0!==d?d:0,!(p?Pe(p,g):i(l,g,n))){for(a=o;--a;){var m=u[a];if(!(m?Pe(m,g):i(t[a],g,n)))continue t}p&&p.push(g),l.push(d)}}return l}function br(t,e,n){var r=null==(t=ms(t,e=ui(e,t)))?t:t[Cs(Ls(e))];return null==r?void 0:se(r,t,n)}function wr(t){return Ko(t)&&dr(t)==u}function xr(t,e,n,r,i){return t===e||(null==t||null==e||!Ko(t)&&!Ko(e)?t!=t&&e!=e:function(t,e,n,r,i,s){var o=ko(t),a=ko(e),p=o?c:rs(t),d=a?c:rs(e),S=(p=p==u?v:p)==v,A=(d=d==u?v:d)==v,C=p==d;if(C&&No(t)){if(!No(e))return!1;o=!0,S=!1}if(C&&!S)return s||(s=new Nn),o||Qo(t)?qi(t,e,n,r,i,s):function(t,e,n,r,i,s,o){switch(n){case F:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case E:return!(t.byteLength!=e.byteLength||!s(new kt(t),new kt(e)));case l:case h:case m:return Ro(+t,+e);case f:return t.name==e.name&&t.message==e.message;case y:case w:return t==e+"";case g:var a=Me;case b:var u=1&r;if(a||(a=qe),t.size!=e.size&&!u)return!1;var c=o.get(t);if(c)return c==e;r|=2,o.set(t,e);var p=qi(a(t),a(e),r,i,s,o);return o.delete(t),p;case x:if(Dn)return Dn.call(t)==Dn.call(e)}return!1}(t,e,p,n,r,i,s);if(!(1&n)){var D=S&&Et.call(t,"__wrapped__"),I=A&&Et.call(e,"__wrapped__");if(D||I){var $=D?t.value():t,R=I?e.value():e;return s||(s=new Nn),i($,R,n,r,s)}}if(!C)return!1;return s||(s=new Nn),function(t,e,n,r,i,s){var o=1&n,a=zi(t),u=a.length,c=zi(e).length;if(u!=c&&!o)return!1;var l=u;for(;l--;){var h=a[l];if(!(o?h in e:Et.call(e,h)))return!1}var f=s.get(t),p=s.get(e);if(f&&p)return f==e&&p==t;var d=!0;s.set(t,e),s.set(e,t);var g=o;for(;++l<u;){h=a[l];var m=t[h],v=e[h];if(r)var y=o?r(v,m,h,e,t,s):r(m,v,h,t,e,s);if(!(void 0===y?m===v||i(m,v,n,r,s):y)){d=!1;break}g||(g="constructor"==h)}if(d&&!g){var b=t.constructor,w=e.constructor;b==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,n,r,i,s)}(t,e,n,r,xr,i))}function Sr(t,e,n,r){var i=n.length,s=i,o=!r;if(null==t)return!s;for(t=dt(t);i--;){var a=n[i];if(o&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<s;){var u=(a=n[i])[0],c=t[u],l=a[1];if(o&&a[2]){if(void 0===c&&!(u in t))return!1}else{var h=new Nn;if(r)var f=r(c,l,u,t,e,h);if(!(void 0===f?xr(l,c,3,r,h):f))return!1}}return!0}function Er(t){return!(!qo(t)||(e=t,At&&At in e))&&(Mo(t)?$t:ot).test(Ds(t));var e}function Fr(t){return"function"==typeof t?t:null==t?Ga:"object"==typeof t?ko(t)?Rr(t[0],t[1]):$r(t):nu(t)}function Ar(t){if(!fs(t))return on(t);var e=[];for(var n in dt(t))Et.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Cr(t){if(!qo(t))return function(t){var e=[];if(null!=t)for(var n in dt(t))e.push(n);return e}(t);var e=fs(t),n=[];for(var r in t)("constructor"!=r||!e&&Et.call(t,r))&&n.push(r);return n}function Dr(t,e){return t<e}function Ir(t,e){var n=-1,i=jo(t)?r(t.length):[];return er(t,(function(t,r,s){i[++n]=e(t,r,s)})),i}function $r(t){var e=Qi(t);return 1==e.length&&e[0][2]?ds(e[0][0],e[0][1]):function(n){return n===t||Sr(n,t,e)}}function Rr(t,e){return cs(t)&&ps(e)?ds(Cs(t),e):function(n){var r=ma(n,t);return void 0===r&&r===e?va(n,t):xr(e,r,3)}}function Tr(t,e,n,r,i){t!==e&&ar(e,(function(s,o){if(i||(i=new Nn),qo(s))!function(t,e,n,r,i,s,o){var a=ys(t,n),u=ys(e,n),c=o.get(u);if(c)return void Vn(t,n,c);var l=s?s(a,u,n+"",t,e,o):void 0,h=void 0===l;if(h){var f=ko(u),p=!f&&No(u),d=!f&&!p&&Qo(u);l=u,f||p||d?ko(a)?l=a:Bo(a)?l=yi(a):p?(h=!1,l=fi(u,!0)):d?(h=!1,l=di(u,!0)):l=[]:Wo(u)||Po(u)?(l=a,Po(a)?l=aa(a):qo(a)&&!Mo(a)||(l=ss(u))):h=!1}h&&(o.set(u,l),i(l,u,r,s,o),o.delete(u));Vn(t,n,l)}(t,e,o,n,Tr,r,i);else{var a=r?r(ys(t,o),s,o+"",t,e,i):void 0;void 0===a&&(a=s),Vn(t,o,a)}}),Sa)}function _r(t,e){var n=t.length;if(n)return as(e+=e<0?n:0,n)?t[e]:void 0}function Pr(t,e,n){e=e.length?pe(e,(function(t){return ko(t)?function(e){return fr(e,1===t.length?t[0]:t)}:t})):[Ga];var r=-1;return e=pe(e,Te(Ji())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(Ir(t,(function(t,n,i){return{criteria:pe(e,(function(e){return e(t)})),index:++r,value:t}})),(function(t,e){return function(t,e,n){var r=-1,i=t.criteria,s=e.criteria,o=i.length,a=n.length;for(;++r<o;){var u=gi(i[r],s[r]);if(u){if(r>=a)return u;var c=n[r];return u*("desc"==c?-1:1)}}return t.index-e.index}(t,e,n)}))}function kr(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=fr(t,o);n(a,o)&&Ur(s,ui(o,t),a)}return s}function Or(t,e,n,r){var i=r?Se:xe,s=-1,o=e.length,a=t;for(t===e&&(e=yi(e)),n&&(a=pe(t,Te(n)));++s<o;)for(var u=0,c=e[s],l=n?n(c):c;(u=i(a,l,u,r))>-1;)a!==t&&Wt.call(a,u,1),Wt.call(t,u,1);return t}function jr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==s){var s=i;as(i)?Wt.call(t,i,1):ti(t,i)}}return t}function Br(t,e){return t+tn(hn()*(e-t+1))}function Nr(t,e){var n="";if(!t||e<1||e>9007199254740991)return n;do{e%2&&(n+=t),(e=tn(e/2))&&(t+=t)}while(e);return n}function Lr(t,e){return xs(gs(t,e,Ga),t+"")}function Hr(t){return Hn(Ra(t))}function Mr(t,e){var n=Ra(t);return Fs(n,Xn(e,0,n.length))}function Ur(t,e,n,r){if(!qo(t))return t;for(var i=-1,s=(e=ui(e,t)).length,o=s-1,a=t;null!=a&&++i<s;){var u=Cs(e[i]),c=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(i!=o){var l=a[u];void 0===(c=r?r(l,u,a):void 0)&&(c=qo(l)?l:as(e[i+1])?[]:{})}qn(a,u,c),a=a[u]}return t}var Vr=bn?function(t,e){return bn.set(t,e),t}:Ga,qr=ye?function(t,e){return ye(t,"toString",{configurable:!0,enumerable:!1,value:qa(e),writable:!0})}:Ga;function Kr(t){return Fs(Ra(t))}function zr(t,e,n){var i=-1,s=t.length;e<0&&(e=-e>s?0:s+e),(n=n>s?s:n)<0&&(n+=s),s=e>n?0:n-e>>>0,e>>>=0;for(var o=r(s);++i<s;)o[i]=t[i+e];return o}function Gr(t,e){var n;return er(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function Wr(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var s=r+i>>>1,o=t[s];null!==o&&!Zo(o)&&(n?o<=e:o<e)?r=s+1:i=s}return i}return Yr(t,e,Ga,n)}function Yr(t,e,n,r){var i=0,s=null==t?0:t.length;if(0===s)return 0;for(var o=(e=n(e))!=e,a=null===e,u=Zo(e),c=void 0===e;i<s;){var l=tn((i+s)/2),h=n(t[l]),f=void 0!==h,p=null===h,d=h==h,g=Zo(h);if(o)var m=r||d;else m=c?d&&(r||f):a?d&&f&&(r||!p):u?d&&f&&!p&&(r||!g):!p&&!g&&(r?h<=e:h<e);m?i=l+1:s=l}return un(s,4294967294)}function Xr(t,e){for(var n=-1,r=t.length,i=0,s=[];++n<r;){var o=t[n],a=e?e(o):o;if(!n||!Ro(a,u)){var u=a;s[i++]=0===o?0:o}}return s}function Jr(t){return"number"==typeof t?t:Zo(t)?NaN:+t}function Zr(t){if("string"==typeof t)return t;if(ko(t))return pe(t,Zr)+"";if(Zo(t))return In?In.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Qr(t,e,n){var r=-1,i=he,s=t.length,o=!0,a=[],u=a;if(n)o=!1,i=fe;else if(s>=200){var c=e?null:Ni(t);if(c)return qe(c);o=!1,i=Pe,u=new Bn}else u=e?[]:a;t:for(;++r<s;){var l=t[r],h=e?e(l):l;if(l=n||0!==l?l:0,o&&h==h){for(var f=u.length;f--;)if(u[f]===h)continue t;e&&u.push(h),a.push(l)}else i(u,h,n)||(u!==a&&u.push(h),a.push(l))}return a}function ti(t,e){return null==(t=ms(t,e=ui(e,t)))||delete t[Cs(Ls(e))]}function ei(t,e,n,r){return Ur(t,e,n(fr(t,e)),r)}function ni(t,e,n,r){for(var i=t.length,s=r?i:-1;(r?s--:++s<i)&&e(t[s],s,t););return n?zr(t,r?0:s,r?s+1:i):zr(t,r?s+1:0,r?i:s)}function ri(t,e){var n=t;return n instanceof Pn&&(n=n.value()),ge(e,(function(t,e){return e.func.apply(e.thisArg,de([t],e.args))}),n)}function ii(t,e,n){var i=t.length;if(i<2)return i?Qr(t[0]):[];for(var s=-1,o=r(i);++s<i;)for(var a=t[s],u=-1;++u<i;)u!=s&&(o[s]=tr(o[s]||a,t[u],e,n));return Qr(or(o,1),e,n)}function si(t,e,n){for(var r=-1,i=t.length,s=e.length,o={};++r<i;){var a=r<s?e[r]:void 0;n(o,t[r],a)}return o}function oi(t){return Bo(t)?t:[]}function ai(t){return"function"==typeof t?t:Ga}function ui(t,e){return ko(t)?t:cs(t,e)?[t]:As(ua(t))}var ci=Lr;function li(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:zr(t,e,n)}var hi=Ce||function(t){return Gt.clearTimeout(t)};function fi(t,e){if(e)return t.slice();var n=t.length,r=jt?jt(n):new t.constructor(n);return t.copy(r),r}function pi(t){var e=new t.constructor(t.byteLength);return new kt(e).set(new kt(t)),e}function di(t,e){var n=e?pi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function gi(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,s=Zo(t),o=void 0!==e,a=null===e,u=e==e,c=Zo(e);if(!a&&!c&&!s&&t>e||s&&o&&u&&!a&&!c||r&&o&&u||!n&&u||!i)return 1;if(!r&&!s&&!c&&t<e||c&&n&&i&&!r&&!s||a&&n&&i||!o&&i||!u)return-1}return 0}function mi(t,e,n,i){for(var s=-1,o=t.length,a=n.length,u=-1,c=e.length,l=an(o-a,0),h=r(c+l),f=!i;++u<c;)h[u]=e[u];for(;++s<a;)(f||s<o)&&(h[n[s]]=t[s]);for(;l--;)h[u++]=t[s++];return h}function vi(t,e,n,i){for(var s=-1,o=t.length,a=-1,u=n.length,c=-1,l=e.length,h=an(o-u,0),f=r(h+l),p=!i;++s<h;)f[s]=t[s];for(var d=s;++c<l;)f[d+c]=e[c];for(;++a<u;)(p||s<o)&&(f[d+n[a]]=t[s++]);return f}function yi(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function bi(t,e,n,r){var i=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var a=e[s],u=r?r(n[a],t[a],a,n,t):void 0;void 0===u&&(u=t[a]),i?Wn(n,a,u):qn(n,a,u)}return n}function wi(t,e){return function(n,r){var i=ko(n)?oe:zn,s=e?e():{};return i(n,t,Ji(r,2),s)}}function xi(t){return Lr((function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(s=t.length>3&&"function"==typeof s?(i--,s):void 0,o&&us(n[0],n[1],o)&&(s=i<3?void 0:s,i=1),e=dt(e);++r<i;){var a=n[r];a&&t(e,a,r,s)}return e}))}function Si(t,e){return function(n,r){if(null==n)return n;if(!jo(n))return t(n,r);for(var i=n.length,s=e?i:-1,o=dt(n);(e?s--:++s<i)&&!1!==r(o[s],s,o););return n}}function Ei(t){return function(e,n,r){for(var i=-1,s=dt(e),o=r(e),a=o.length;a--;){var u=o[t?a:++i];if(!1===n(s[u],u,s))break}return e}}function Fi(t){return function(e){var n=He(e=ua(e))?Ge(e):void 0,r=n?n[0]:e.charAt(0),i=n?li(n,1).join(""):e.slice(1);return r[t]()+i}}function Ai(t){return function(e){return ge(Ma(Pa(e).replace(_t,"")),t,"")}}function Ci(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Rn(t.prototype),r=t.apply(n,e);return qo(r)?r:n}}function Di(t){return function(e,n,r){var i=dt(e);if(!jo(e)){var s=Ji(n,3);e=xa(e),n=function(t){return s(i[t],t,i)}}var o=t(e,n,r);return o>-1?i[s?e[o]:o]:void 0}}function Ii(t){return Ki((function(e){var n=e.length,r=n,i=_n.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if("function"!=typeof o)throw new vt(s);if(i&&!a&&"wrapper"==Yi(o))var a=new _n([],!0)}for(r=a?r:n;++r<n;){var u=Yi(o=e[r]),c="wrapper"==u?Wi(o):void 0;a=c&&ls(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?a[Yi(c[0])].apply(a,c[3]):1==o.length&&ls(o)?a[u]():a.thru(o)}return function(){var t=arguments,r=t[0];if(a&&1==t.length&&ko(r))return a.plant(r).value();for(var i=0,s=n?e[i].apply(this,t):r;++i<n;)s=e[i].call(this,s);return s}}))}function $i(t,e,n,i,s,o,a,u,c,l){var h=128&e,f=1&e,p=2&e,d=24&e,g=512&e,m=p?void 0:Ci(t);return function v(){for(var y=arguments.length,b=r(y),w=y;w--;)b[w]=arguments[w];if(d)var x=Xi(v),S=je(b,x);if(i&&(b=mi(b,i,s,d)),o&&(b=vi(b,o,a,d)),y-=S,d&&y<l){var E=Ve(b,x);return ji(t,e,$i,v.placeholder,n,b,E,u,c,l-y)}var F=f?n:this,A=p?F[t]:t;return y=b.length,u?b=vs(b,u):g&&y>1&&b.reverse(),h&&c<y&&(b.length=c),this&&this!==Gt&&this instanceof v&&(A=m||Ci(A)),A.apply(F,b)}}function Ri(t,e){return function(n,r){return function(t,e,n,r){return cr(t,(function(t,i,s){e(r,n(t),i,s)})),r}(n,t,e(r),{})}}function Ti(t,e){return function(n,r){var i;if(void 0===n&&void 0===r)return e;if(void 0!==n&&(i=n),void 0!==r){if(void 0===i)return r;"string"==typeof n||"string"==typeof r?(n=Zr(n),r=Zr(r)):(n=Jr(n),r=Jr(r)),i=t(n,r)}return i}}function _i(t){return Ki((function(e){return e=pe(e,Te(Ji())),Lr((function(n){var r=this;return t(e,(function(t){return se(t,r,n)}))}))}))}function Pi(t,e){var n=(e=void 0===e?" ":Zr(e)).length;if(n<2)return n?Nr(e,t):e;var r=Nr(e,Qe(t/ze(e)));return He(e)?li(Ge(r),0,t).join(""):r.slice(0,t)}function ki(t){return function(e,n,i){return i&&"number"!=typeof i&&us(e,n,i)&&(n=i=void 0),e=ra(e),void 0===n?(n=e,e=0):n=ra(n),function(t,e,n,i){for(var s=-1,o=an(Qe((e-t)/(n||1)),0),a=r(o);o--;)a[i?o:++s]=t,t+=n;return a}(e,n,i=void 0===i?e<n?1:-1:ra(i),t)}}function Oi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=oa(e),n=oa(n)),t(e,n)}}function ji(t,e,n,r,i,s,o,a,u,c){var l=8&e;e|=l?32:64,4&(e&=~(l?64:32))||(e&=-4);var h=[t,e,i,l?s:void 0,l?o:void 0,l?void 0:s,l?void 0:o,a,u,c],f=n.apply(void 0,h);return ls(t)&&bs(f,h),f.placeholder=r,Ss(f,t,e)}function Bi(t){var e=pt[t];return function(t,n){if(t=oa(t),(n=null==n?0:un(ia(n),292))&&rn(t)){var r=(ua(t)+"e").split("e");return+((r=(ua(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Ni=mn&&1/qe(new mn([,-0]))[1]==1/0?function(t){return new mn(t)}:Za;function Li(t){return function(e){var n=rs(e);return n==g?Me(e):n==b?Ke(e):function(t,e){return pe(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Hi(t,e,n,i,a,u,c,l){var h=2&e;if(!h&&"function"!=typeof t)throw new vt(s);var f=i?i.length:0;if(f||(e&=-97,i=a=void 0),c=void 0===c?c:an(ia(c),0),l=void 0===l?l:ia(l),f-=a?a.length:0,64&e){var p=i,d=a;i=a=void 0}var g=h?void 0:Wi(t),m=[t,e,n,i,a,p,d,u,c,l];if(g&&function(t,e){var n=t[1],r=e[1],i=n|r,s=i<131,a=128==r&&8==n||128==r&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!s&&!a)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var u=e[3];if(u){var c=t[3];t[3]=c?mi(c,u,e[4]):u,t[4]=c?Ve(t[3],o):e[4]}(u=e[5])&&(c=t[5],t[5]=c?vi(c,u,e[6]):u,t[6]=c?Ve(t[5],o):e[6]);(u=e[7])&&(t[7]=u);128&r&&(t[8]=null==t[8]?e[8]:un(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=i}(m,g),t=m[0],e=m[1],n=m[2],i=m[3],a=m[4],!(l=m[9]=void 0===m[9]?h?0:t.length:an(m[9]-f,0))&&24&e&&(e&=-25),e&&1!=e)v=8==e||16==e?function(t,e,n){var i=Ci(t);return function s(){for(var o=arguments.length,a=r(o),u=o,c=Xi(s);u--;)a[u]=arguments[u];var l=o<3&&a[0]!==c&&a[o-1]!==c?[]:Ve(a,c);if((o-=l.length)<n)return ji(t,e,$i,s.placeholder,void 0,a,l,void 0,void 0,n-o);var h=this&&this!==Gt&&this instanceof s?i:t;return se(h,this,a)}}(t,e,l):32!=e&&33!=e||a.length?$i.apply(void 0,m):function(t,e,n,i){var s=1&e,o=Ci(t);return function e(){for(var a=-1,u=arguments.length,c=-1,l=i.length,h=r(l+u),f=this&&this!==Gt&&this instanceof e?o:t;++c<l;)h[c]=i[c];for(;u--;)h[c++]=arguments[++a];return se(f,s?n:this,h)}}(t,e,n,i);else var v=function(t,e,n){var r=1&e,i=Ci(t);return function e(){var s=this&&this!==Gt&&this instanceof e?i:t;return s.apply(r?n:this,arguments)}}(t,e,n);return Ss((g?Vr:bs)(v,m),t,e)}function Mi(t,e,n,r){return void 0===t||Ro(t,wt[n])&&!Et.call(r,n)?e:t}function Ui(t,e,n,r,i,s){return qo(t)&&qo(e)&&(s.set(e,t),Tr(t,e,void 0,Ui,s),s.delete(e)),t}function Vi(t){return Wo(t)?void 0:t}function qi(t,e,n,r,i,s){var o=1&n,a=t.length,u=e.length;if(a!=u&&!(o&&u>a))return!1;var c=s.get(t),l=s.get(e);if(c&&l)return c==e&&l==t;var h=-1,f=!0,p=2&n?new Bn:void 0;for(s.set(t,e),s.set(e,t);++h<a;){var d=t[h],g=e[h];if(r)var m=o?r(g,d,h,e,t,s):r(d,g,h,t,e,s);if(void 0!==m){if(m)continue;f=!1;break}if(p){if(!ve(e,(function(t,e){if(!Pe(p,e)&&(d===t||i(d,t,n,r,s)))return p.push(e)}))){f=!1;break}}else if(d!==g&&!i(d,g,n,r,s)){f=!1;break}}return s.delete(t),s.delete(e),f}function Ki(t){return xs(gs(t,void 0,ks),t+"")}function zi(t){return pr(t,xa,es)}function Gi(t){return pr(t,Sa,ns)}var Wi=bn?function(t){return bn.get(t)}:Za;function Yi(t){for(var e=t.name+"",n=wn[e],r=Et.call(wn,e)?n.length:0;r--;){var i=n[r],s=i.func;if(null==s||s==t)return i.name}return e}function Xi(t){return(Et.call($n,"placeholder")?$n:t).placeholder}function Ji(){var t=$n.iteratee||Wa;return t=t===Wa?Fr:t,arguments.length?t(arguments[0],arguments[1]):t}function Zi(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function Qi(t){for(var e=xa(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,ps(i)]}return e}function ts(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Er(n)?n:void 0}var es=en?function(t){return null==t?[]:(t=dt(t),le(en(t),(function(e){return zt.call(t,e)})))}:su,ns=en?function(t){for(var e=[];t;)de(e,es(t)),t=Ut(t);return e}:su,rs=dr;function is(t,e,n){for(var r=-1,i=(e=ui(e,t)).length,s=!1;++r<i;){var o=Cs(e[r]);if(!(s=null!=t&&n(t,o)))break;t=t[o]}return s||++r!=i?s:!!(i=null==t?0:t.length)&&Vo(i)&&as(o,i)&&(ko(t)||Po(t))}function ss(t){return"function"!=typeof t.constructor||fs(t)?{}:Rn(Ut(t))}function os(t){return ko(t)||Po(t)||!!(Yt&&t&&t[Yt])}function as(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&ut.test(t))&&t>-1&&t%1==0&&t<e}function us(t,e,n){if(!qo(n))return!1;var r=typeof e;return!!("number"==r?jo(n)&&as(e,n.length):"string"==r&&e in n)&&Ro(n[e],t)}function cs(t,e){if(ko(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Zo(t))||(q.test(t)||!V.test(t)||null!=e&&t in dt(e))}function ls(t){var e=Yi(t),n=$n[e];if("function"!=typeof n||!(e in Pn.prototype))return!1;if(t===n)return!0;var r=Wi(n);return!!r&&t===r[0]}(pn&&rs(new pn(new ArrayBuffer(1)))!=F||dn&&rs(new dn)!=g||gn&&"[object Promise]"!=rs(gn.resolve())||mn&&rs(new mn)!=b||vn&&rs(new vn)!=S)&&(rs=function(t){var e=dr(t),n=e==v?t.constructor:void 0,r=n?Ds(n):"";if(r)switch(r){case xn:return F;case Sn:return g;case En:return"[object Promise]";case Fn:return b;case An:return S}return e});var hs=xt?Mo:ou;function fs(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||wt)}function ps(t){return t==t&&!qo(t)}function ds(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in dt(n)))}}function gs(t,e,n){return e=an(void 0===e?t.length-1:e,0),function(){for(var i=arguments,s=-1,o=an(i.length-e,0),a=r(o);++s<o;)a[s]=i[e+s];s=-1;for(var u=r(e+1);++s<e;)u[s]=i[s];return u[e]=n(a),se(t,this,u)}}function ms(t,e){return e.length<2?t:fr(t,zr(e,0,-1))}function vs(t,e){for(var n=t.length,r=un(e.length,n),i=yi(t);r--;){var s=e[r];t[r]=as(s,n)?i[s]:void 0}return t}function ys(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var bs=Es(Vr),ws=Ze||function(t,e){return Gt.setTimeout(t,e)},xs=Es(qr);function Ss(t,e,n){var r=e+"";return xs(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(X,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return ae(a,(function(n){var r="_."+n[0];e&n[1]&&!he(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(J);return e?e[1].split(Z):[]}(r),n)))}function Es(t){var e=0,n=0;return function(){var r=cn(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Fs(t,e){var n=-1,r=t.length,i=r-1;for(e=void 0===e?r:e;++n<e;){var s=Br(n,i),o=t[s];t[s]=t[n],t[n]=o}return t.length=e,t}var As=function(t){var e=Fo(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(K,(function(t,n,r,i){e.push(r?i.replace(et,"$1"):n||t)})),e}));function Cs(t){if("string"==typeof t||Zo(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Ds(t){if(null!=t){try{return St.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Is(t){if(t instanceof Pn)return t.clone();var e=new _n(t.__wrapped__,t.__chain__);return e.__actions__=yi(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var $s=Lr((function(t,e){return Bo(t)?tr(t,or(e,1,Bo,!0)):[]})),Rs=Lr((function(t,e){var n=Ls(e);return Bo(n)&&(n=void 0),Bo(t)?tr(t,or(e,1,Bo,!0),Ji(n,2)):[]})),Ts=Lr((function(t,e){var n=Ls(e);return Bo(n)&&(n=void 0),Bo(t)?tr(t,or(e,1,Bo,!0),void 0,n):[]}));function _s(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ia(n);return i<0&&(i=an(r+i,0)),we(t,Ji(e,3),i)}function Ps(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return void 0!==n&&(i=ia(n),i=n<0?an(r+i,0):un(i,r-1)),we(t,Ji(e,3),i,!0)}function ks(t){return(null==t?0:t.length)?or(t,1):[]}function Os(t){return t&&t.length?t[0]:void 0}var js=Lr((function(t){var e=pe(t,oi);return e.length&&e[0]===t[0]?yr(e):[]})),Bs=Lr((function(t){var e=Ls(t),n=pe(t,oi);return e===Ls(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?yr(n,Ji(e,2)):[]})),Ns=Lr((function(t){var e=Ls(t),n=pe(t,oi);return(e="function"==typeof e?e:void 0)&&n.pop(),n.length&&n[0]===t[0]?yr(n,void 0,e):[]}));function Ls(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var Hs=Lr(Ms);function Ms(t,e){return t&&t.length&&e&&e.length?Or(t,e):t}var Us=Ki((function(t,e){var n=null==t?0:t.length,r=Yn(t,e);return jr(t,pe(e,(function(t){return as(t,n)?+t:t})).sort(gi)),r}));function Vs(t){return null==t?t:fn.call(t)}var qs=Lr((function(t){return Qr(or(t,1,Bo,!0))})),Ks=Lr((function(t){var e=Ls(t);return Bo(e)&&(e=void 0),Qr(or(t,1,Bo,!0),Ji(e,2))})),zs=Lr((function(t){var e=Ls(t);return e="function"==typeof e?e:void 0,Qr(or(t,1,Bo,!0),void 0,e)}));function Gs(t){if(!t||!t.length)return[];var e=0;return t=le(t,(function(t){if(Bo(t))return e=an(t.length,e),!0})),$e(e,(function(e){return pe(t,Ae(e))}))}function Ws(t,e){if(!t||!t.length)return[];var n=Gs(t);return null==e?n:pe(n,(function(t){return se(e,void 0,t)}))}var Ys=Lr((function(t,e){return Bo(t)?tr(t,e):[]})),Xs=Lr((function(t){return ii(le(t,Bo))})),Js=Lr((function(t){var e=Ls(t);return Bo(e)&&(e=void 0),ii(le(t,Bo),Ji(e,2))})),Zs=Lr((function(t){var e=Ls(t);return e="function"==typeof e?e:void 0,ii(le(t,Bo),void 0,e)})),Qs=Lr(Gs);var to=Lr((function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,Ws(t,n)}));function eo(t){var e=$n(t);return e.__chain__=!0,e}function no(t,e){return e(t)}var ro=Ki((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return Yn(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Pn&&as(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:no,args:[i],thisArg:void 0}),new _n(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(i)}));var io=wi((function(t,e,n){Et.call(t,n)?++t[n]:Wn(t,n,1)}));var so=Di(_s),oo=Di(Ps);function ao(t,e){return(ko(t)?ae:er)(t,Ji(e,3))}function uo(t,e){return(ko(t)?ue:nr)(t,Ji(e,3))}var co=wi((function(t,e,n){Et.call(t,n)?t[n].push(e):Wn(t,n,[e])}));var lo=Lr((function(t,e,n){var i=-1,s="function"==typeof e,o=jo(t)?r(t.length):[];return er(t,(function(t){o[++i]=s?se(e,t,n):br(t,e,n)})),o})),ho=wi((function(t,e,n){Wn(t,n,e)}));function fo(t,e){return(ko(t)?pe:Ir)(t,Ji(e,3))}var po=wi((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var go=Lr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&us(t,e[0],e[1])?e=[]:n>2&&us(e[0],e[1],e[2])&&(e=[e[0]]),Pr(t,or(e,1),[])})),mo=Je||function(){return Gt.Date.now()};function vo(t,e,n){return e=n?void 0:e,Hi(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function yo(t,e){var n;if("function"!=typeof e)throw new vt(s);return t=ia(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var bo=Lr((function(t,e,n){var r=1;if(n.length){var i=Ve(n,Xi(bo));r|=32}return Hi(t,r,e,n,i)})),wo=Lr((function(t,e,n){var r=3;if(n.length){var i=Ve(n,Xi(wo));r|=32}return Hi(e,r,t,n,i)}));function xo(t,e,n){var r,i,o,a,u,c,l=0,h=!1,f=!1,p=!0;if("function"!=typeof t)throw new vt(s);function d(e){var n=r,s=i;return r=i=void 0,l=e,a=t.apply(s,n)}function g(t){return l=t,u=ws(v,e),h?d(t):a}function m(t){var n=t-c;return void 0===c||n>=e||n<0||f&&t-l>=o}function v(){var t=mo();if(m(t))return y(t);u=ws(v,function(t){var n=e-(t-c);return f?un(n,o-(t-l)):n}(t))}function y(t){return u=void 0,p&&r?d(t):(r=i=void 0,a)}function b(){var t=mo(),n=m(t);if(r=arguments,i=this,c=t,n){if(void 0===u)return g(c);if(f)return hi(u),u=ws(v,e),d(c)}return void 0===u&&(u=ws(v,e)),a}return e=oa(e)||0,qo(n)&&(h=!!n.leading,o=(f="maxWait"in n)?an(oa(n.maxWait)||0,e):o,p="trailing"in n?!!n.trailing:p),b.cancel=function(){void 0!==u&&hi(u),l=0,r=c=i=u=void 0},b.flush=function(){return void 0===u?a:y(mo())},b}var So=Lr((function(t,e){return Qn(t,1,e)})),Eo=Lr((function(t,e,n){return Qn(t,oa(e)||0,n)}));function Fo(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new vt(s);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=t.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(Fo.Cache||jn),n}function Ao(t){if("function"!=typeof t)throw new vt(s);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Fo.Cache=jn;var Co=ci((function(t,e){var n=(e=1==e.length&&ko(e[0])?pe(e[0],Te(Ji())):pe(or(e,1),Te(Ji()))).length;return Lr((function(r){for(var i=-1,s=un(r.length,n);++i<s;)r[i]=e[i].call(this,r[i]);return se(t,this,r)}))})),Do=Lr((function(t,e){return Hi(t,32,void 0,e,Ve(e,Xi(Do)))})),Io=Lr((function(t,e){return Hi(t,64,void 0,e,Ve(e,Xi(Io)))})),$o=Ki((function(t,e){return Hi(t,256,void 0,void 0,void 0,e)}));function Ro(t,e){return t===e||t!=t&&e!=e}var To=Oi(gr),_o=Oi((function(t,e){return t>=e})),Po=wr(function(){return arguments}())?wr:function(t){return Ko(t)&&Et.call(t,"callee")&&!zt.call(t,"callee")},ko=r.isArray,Oo=Qt?Te(Qt):function(t){return Ko(t)&&dr(t)==E};function jo(t){return null!=t&&Vo(t.length)&&!Mo(t)}function Bo(t){return Ko(t)&&jo(t)}var No=nn||ou,Lo=te?Te(te):function(t){return Ko(t)&&dr(t)==h};function Ho(t){if(!Ko(t))return!1;var e=dr(t);return e==f||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!Wo(t)}function Mo(t){if(!qo(t))return!1;var e=dr(t);return e==p||e==d||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Uo(t){return"number"==typeof t&&t==ia(t)}function Vo(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function qo(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ko(t){return null!=t&&"object"==typeof t}var zo=ee?Te(ee):function(t){return Ko(t)&&rs(t)==g};function Go(t){return"number"==typeof t||Ko(t)&&dr(t)==m}function Wo(t){if(!Ko(t)||dr(t)!=v)return!1;var e=Ut(t);if(null===e)return!0;var n=Et.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&St.call(n)==Dt}var Yo=ne?Te(ne):function(t){return Ko(t)&&dr(t)==y};var Xo=re?Te(re):function(t){return Ko(t)&&rs(t)==b};function Jo(t){return"string"==typeof t||!ko(t)&&Ko(t)&&dr(t)==w}function Zo(t){return"symbol"==typeof t||Ko(t)&&dr(t)==x}var Qo=ie?Te(ie):function(t){return Ko(t)&&Vo(t.length)&&!!Ht[dr(t)]};var ta=Oi(Dr),ea=Oi((function(t,e){return t<=e}));function na(t){if(!t)return[];if(jo(t))return Jo(t)?Ge(t):yi(t);if(Jt&&t[Jt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Jt]());var e=rs(t);return(e==g?Me:e==b?qe:Ra)(t)}function ra(t){return t?(t=oa(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ia(t){var e=ra(t),n=e%1;return e==e?n?e-n:e:0}function sa(t){return t?Xn(ia(t),0,4294967295):0}function oa(t){if("number"==typeof t)return t;if(Zo(t))return NaN;if(qo(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=qo(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Re(t);var n=st.test(t);return n||at.test(t)?qt(t.slice(2),n?2:8):it.test(t)?NaN:+t}function aa(t){return bi(t,Sa(t))}function ua(t){return null==t?"":Zr(t)}var ca=xi((function(t,e){if(fs(e)||jo(e))bi(e,xa(e),t);else for(var n in e)Et.call(e,n)&&qn(t,n,e[n])})),la=xi((function(t,e){bi(e,Sa(e),t)})),ha=xi((function(t,e,n,r){bi(e,Sa(e),t,r)})),fa=xi((function(t,e,n,r){bi(e,xa(e),t,r)})),pa=Ki(Yn);var da=Lr((function(t,e){t=dt(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&us(e[0],e[1],i)&&(r=1);++n<r;)for(var s=e[n],o=Sa(s),a=-1,u=o.length;++a<u;){var c=o[a],l=t[c];(void 0===l||Ro(l,wt[c])&&!Et.call(t,c))&&(t[c]=s[c])}return t})),ga=Lr((function(t){return t.push(void 0,Ui),se(Fa,void 0,t)}));function ma(t,e,n){var r=null==t?void 0:fr(t,e);return void 0===r?n:r}function va(t,e){return null!=t&&is(t,e,vr)}var ya=Ri((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ct.call(e)),t[e]=n}),qa(Ga)),ba=Ri((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ct.call(e)),Et.call(t,e)?t[e].push(n):t[e]=[n]}),Ji),wa=Lr(br);function xa(t){return jo(t)?Ln(t):Ar(t)}function Sa(t){return jo(t)?Ln(t,!0):Cr(t)}var Ea=xi((function(t,e,n){Tr(t,e,n)})),Fa=xi((function(t,e,n,r){Tr(t,e,n,r)})),Aa=Ki((function(t,e){var n={};if(null==t)return n;var r=!1;e=pe(e,(function(e){return e=ui(e,t),r||(r=e.length>1),e})),bi(t,Gi(t),n),r&&(n=Jn(n,7,Vi));for(var i=e.length;i--;)ti(n,e[i]);return n}));var Ca=Ki((function(t,e){return null==t?{}:function(t,e){return kr(t,e,(function(e,n){return va(t,n)}))}(t,e)}));function Da(t,e){if(null==t)return{};var n=pe(Gi(t),(function(t){return[t]}));return e=Ji(e),kr(t,n,(function(t,n){return e(t,n[0])}))}var Ia=Li(xa),$a=Li(Sa);function Ra(t){return null==t?[]:_e(t,xa(t))}var Ta=Ai((function(t,e,n){return e=e.toLowerCase(),t+(n?_a(e):e)}));function _a(t){return Ha(ua(t).toLowerCase())}function Pa(t){return(t=ua(t))&&t.replace(ct,Be).replace(Pt,"")}var ka=Ai((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Oa=Ai((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),ja=Fi("toLowerCase");var Ba=Ai((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Na=Ai((function(t,e,n){return t+(n?" ":"")+Ha(e)}));var La=Ai((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ha=Fi("toUpperCase");function Ma(t,e,n){return t=ua(t),void 0===(e=n?void 0:e)?function(t){return Bt.test(t)}(t)?function(t){return t.match(Ot)||[]}(t):function(t){return t.match(Q)||[]}(t):t.match(e)||[]}var Ua=Lr((function(t,e){try{return se(t,void 0,e)}catch(t){return Ho(t)?t:new Y(t)}})),Va=Ki((function(t,e){return ae(e,(function(e){e=Cs(e),Wn(t,e,bo(t[e],t))})),t}));function qa(t){return function(){return t}}var Ka=Ii(),za=Ii(!0);function Ga(t){return t}function Wa(t){return Fr("function"==typeof t?t:Jn(t,1))}var Ya=Lr((function(t,e){return function(n){return br(n,t,e)}})),Xa=Lr((function(t,e){return function(n){return br(t,n,e)}}));function Ja(t,e,n){var r=xa(e),i=hr(e,r);null!=n||qo(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=hr(e,xa(e)));var s=!(qo(n)&&"chain"in n&&!n.chain),o=Mo(t);return ae(i,(function(n){var r=e[n];t[n]=r,o&&(t.prototype[n]=function(){var e=this.__chain__;if(s||e){var n=t(this.__wrapped__),i=n.__actions__=yi(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,de([this.value()],arguments))})})),t}function Za(){}var Qa=_i(pe),tu=_i(ce),eu=_i(ve);function nu(t){return cs(t)?Ae(Cs(t)):function(t){return function(e){return fr(e,t)}}(t)}var ru=ki(),iu=ki(!0);function su(){return[]}function ou(){return!1}var au=Ti((function(t,e){return t+e}),0),uu=Bi("ceil"),cu=Ti((function(t,e){return t/e}),1),lu=Bi("floor");var hu,fu=Ti((function(t,e){return t*e}),1),pu=Bi("round"),du=Ti((function(t,e){return t-e}),0);return $n.after=function(t,e){if("function"!=typeof e)throw new vt(s);return t=ia(t),function(){if(--t<1)return e.apply(this,arguments)}},$n.ary=vo,$n.assign=ca,$n.assignIn=la,$n.assignInWith=ha,$n.assignWith=fa,$n.at=pa,$n.before=yo,$n.bind=bo,$n.bindAll=Va,$n.bindKey=wo,$n.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return ko(t)?t:[t]},$n.chain=eo,$n.chunk=function(t,e,n){e=(n?us(t,e,n):void 0===e)?1:an(ia(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var s=0,o=0,a=r(Qe(i/e));s<i;)a[o++]=zr(t,s,s+=e);return a},$n.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var s=t[e];s&&(i[r++]=s)}return i},$n.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return de(ko(n)?yi(n):[n],or(e,1))},$n.cond=function(t){var e=null==t?0:t.length,n=Ji();return t=e?pe(t,(function(t){if("function"!=typeof t[1])throw new vt(s);return[n(t[0]),t[1]]})):[],Lr((function(n){for(var r=-1;++r<e;){var i=t[r];if(se(i[0],this,n))return se(i[1],this,n)}}))},$n.conforms=function(t){return function(t){var e=xa(t);return function(n){return Zn(n,t,e)}}(Jn(t,1))},$n.constant=qa,$n.countBy=io,$n.create=function(t,e){var n=Rn(t);return null==e?n:Gn(n,e)},$n.curry=function t(e,n,r){var i=Hi(e,8,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return i.placeholder=t.placeholder,i},$n.curryRight=function t(e,n,r){var i=Hi(e,16,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return i.placeholder=t.placeholder,i},$n.debounce=xo,$n.defaults=da,$n.defaultsDeep=ga,$n.defer=So,$n.delay=Eo,$n.difference=$s,$n.differenceBy=Rs,$n.differenceWith=Ts,$n.drop=function(t,e,n){var r=null==t?0:t.length;return r?zr(t,(e=n||void 0===e?1:ia(e))<0?0:e,r):[]},$n.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?zr(t,0,(e=r-(e=n||void 0===e?1:ia(e)))<0?0:e):[]},$n.dropRightWhile=function(t,e){return t&&t.length?ni(t,Ji(e,3),!0,!0):[]},$n.dropWhile=function(t,e){return t&&t.length?ni(t,Ji(e,3),!0):[]},$n.fill=function(t,e,n,r){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&us(t,e,n)&&(n=0,r=i),function(t,e,n,r){var i=t.length;for((n=ia(n))<0&&(n=-n>i?0:i+n),(r=void 0===r||r>i?i:ia(r))<0&&(r+=i),r=n>r?0:sa(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},$n.filter=function(t,e){return(ko(t)?le:sr)(t,Ji(e,3))},$n.flatMap=function(t,e){return or(fo(t,e),1)},$n.flatMapDeep=function(t,e){return or(fo(t,e),1/0)},$n.flatMapDepth=function(t,e,n){return n=void 0===n?1:ia(n),or(fo(t,e),n)},$n.flatten=ks,$n.flattenDeep=function(t){return(null==t?0:t.length)?or(t,1/0):[]},$n.flattenDepth=function(t,e){return(null==t?0:t.length)?or(t,e=void 0===e?1:ia(e)):[]},$n.flip=function(t){return Hi(t,512)},$n.flow=Ka,$n.flowRight=za,$n.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},$n.functions=function(t){return null==t?[]:hr(t,xa(t))},$n.functionsIn=function(t){return null==t?[]:hr(t,Sa(t))},$n.groupBy=co,$n.initial=function(t){return(null==t?0:t.length)?zr(t,0,-1):[]},$n.intersection=js,$n.intersectionBy=Bs,$n.intersectionWith=Ns,$n.invert=ya,$n.invertBy=ba,$n.invokeMap=lo,$n.iteratee=Wa,$n.keyBy=ho,$n.keys=xa,$n.keysIn=Sa,$n.map=fo,$n.mapKeys=function(t,e){var n={};return e=Ji(e,3),cr(t,(function(t,r,i){Wn(n,e(t,r,i),t)})),n},$n.mapValues=function(t,e){var n={};return e=Ji(e,3),cr(t,(function(t,r,i){Wn(n,r,e(t,r,i))})),n},$n.matches=function(t){return $r(Jn(t,1))},$n.matchesProperty=function(t,e){return Rr(t,Jn(e,1))},$n.memoize=Fo,$n.merge=Ea,$n.mergeWith=Fa,$n.method=Ya,$n.methodOf=Xa,$n.mixin=Ja,$n.negate=Ao,$n.nthArg=function(t){return t=ia(t),Lr((function(e){return _r(e,t)}))},$n.omit=Aa,$n.omitBy=function(t,e){return Da(t,Ao(Ji(e)))},$n.once=function(t){return yo(2,t)},$n.orderBy=function(t,e,n,r){return null==t?[]:(ko(e)||(e=null==e?[]:[e]),ko(n=r?void 0:n)||(n=null==n?[]:[n]),Pr(t,e,n))},$n.over=Qa,$n.overArgs=Co,$n.overEvery=tu,$n.overSome=eu,$n.partial=Do,$n.partialRight=Io,$n.partition=po,$n.pick=Ca,$n.pickBy=Da,$n.property=nu,$n.propertyOf=function(t){return function(e){return null==t?void 0:fr(t,e)}},$n.pull=Hs,$n.pullAll=Ms,$n.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Or(t,e,Ji(n,2)):t},$n.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Or(t,e,void 0,n):t},$n.pullAt=Us,$n.range=ru,$n.rangeRight=iu,$n.rearg=$o,$n.reject=function(t,e){return(ko(t)?le:sr)(t,Ao(Ji(e,3)))},$n.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],s=t.length;for(e=Ji(e,3);++r<s;){var o=t[r];e(o,r,t)&&(n.push(o),i.push(r))}return jr(t,i),n},$n.rest=function(t,e){if("function"!=typeof t)throw new vt(s);return Lr(t,e=void 0===e?e:ia(e))},$n.reverse=Vs,$n.sampleSize=function(t,e,n){return e=(n?us(t,e,n):void 0===e)?1:ia(e),(ko(t)?Mn:Mr)(t,e)},$n.set=function(t,e,n){return null==t?t:Ur(t,e,n)},$n.setWith=function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:Ur(t,e,n,r)},$n.shuffle=function(t){return(ko(t)?Un:Kr)(t)},$n.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&us(t,e,n)?(e=0,n=r):(e=null==e?0:ia(e),n=void 0===n?r:ia(n)),zr(t,e,n)):[]},$n.sortBy=go,$n.sortedUniq=function(t){return t&&t.length?Xr(t):[]},$n.sortedUniqBy=function(t,e){return t&&t.length?Xr(t,Ji(e,2)):[]},$n.split=function(t,e,n){return n&&"number"!=typeof n&&us(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=ua(t))&&("string"==typeof e||null!=e&&!Yo(e))&&!(e=Zr(e))&&He(t)?li(Ge(t),0,n):t.split(e,n):[]},$n.spread=function(t,e){if("function"!=typeof t)throw new vt(s);return e=null==e?0:an(ia(e),0),Lr((function(n){var r=n[e],i=li(n,0,e);return r&&de(i,r),se(t,this,i)}))},$n.tail=function(t){var e=null==t?0:t.length;return e?zr(t,1,e):[]},$n.take=function(t,e,n){return t&&t.length?zr(t,0,(e=n||void 0===e?1:ia(e))<0?0:e):[]},$n.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?zr(t,(e=r-(e=n||void 0===e?1:ia(e)))<0?0:e,r):[]},$n.takeRightWhile=function(t,e){return t&&t.length?ni(t,Ji(e,3),!1,!0):[]},$n.takeWhile=function(t,e){return t&&t.length?ni(t,Ji(e,3)):[]},$n.tap=function(t,e){return e(t),t},$n.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new vt(s);return qo(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),xo(t,e,{leading:r,maxWait:e,trailing:i})},$n.thru=no,$n.toArray=na,$n.toPairs=Ia,$n.toPairsIn=$a,$n.toPath=function(t){return ko(t)?pe(t,Cs):Zo(t)?[t]:yi(As(ua(t)))},$n.toPlainObject=aa,$n.transform=function(t,e,n){var r=ko(t),i=r||No(t)||Qo(t);if(e=Ji(e,4),null==n){var s=t&&t.constructor;n=i?r?new s:[]:qo(t)&&Mo(s)?Rn(Ut(t)):{}}return(i?ae:cr)(t,(function(t,r,i){return e(n,t,r,i)})),n},$n.unary=function(t){return vo(t,1)},$n.union=qs,$n.unionBy=Ks,$n.unionWith=zs,$n.uniq=function(t){return t&&t.length?Qr(t):[]},$n.uniqBy=function(t,e){return t&&t.length?Qr(t,Ji(e,2)):[]},$n.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Qr(t,void 0,e):[]},$n.unset=function(t,e){return null==t||ti(t,e)},$n.unzip=Gs,$n.unzipWith=Ws,$n.update=function(t,e,n){return null==t?t:ei(t,e,ai(n))},$n.updateWith=function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:ei(t,e,ai(n),r)},$n.values=Ra,$n.valuesIn=function(t){return null==t?[]:_e(t,Sa(t))},$n.without=Ys,$n.words=Ma,$n.wrap=function(t,e){return Do(ai(e),t)},$n.xor=Xs,$n.xorBy=Js,$n.xorWith=Zs,$n.zip=Qs,$n.zipObject=function(t,e){return si(t||[],e||[],qn)},$n.zipObjectDeep=function(t,e){return si(t||[],e||[],Ur)},$n.zipWith=to,$n.entries=Ia,$n.entriesIn=$a,$n.extend=la,$n.extendWith=ha,Ja($n,$n),$n.add=au,$n.attempt=Ua,$n.camelCase=Ta,$n.capitalize=_a,$n.ceil=uu,$n.clamp=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=oa(n))==n?n:0),void 0!==e&&(e=(e=oa(e))==e?e:0),Xn(oa(t),e,n)},$n.clone=function(t){return Jn(t,4)},$n.cloneDeep=function(t){return Jn(t,5)},$n.cloneDeepWith=function(t,e){return Jn(t,5,e="function"==typeof e?e:void 0)},$n.cloneWith=function(t,e){return Jn(t,4,e="function"==typeof e?e:void 0)},$n.conformsTo=function(t,e){return null==e||Zn(t,e,xa(e))},$n.deburr=Pa,$n.defaultTo=function(t,e){return null==t||t!=t?e:t},$n.divide=cu,$n.endsWith=function(t,e,n){t=ua(t),e=Zr(e);var r=t.length,i=n=void 0===n?r:Xn(ia(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},$n.eq=Ro,$n.escape=function(t){return(t=ua(t))&&L.test(t)?t.replace(B,Ne):t},$n.escapeRegExp=function(t){return(t=ua(t))&&G.test(t)?t.replace(z,"\\$&"):t},$n.every=function(t,e,n){var r=ko(t)?ce:rr;return n&&us(t,e,n)&&(e=void 0),r(t,Ji(e,3))},$n.find=so,$n.findIndex=_s,$n.findKey=function(t,e){return be(t,Ji(e,3),cr)},$n.findLast=oo,$n.findLastIndex=Ps,$n.findLastKey=function(t,e){return be(t,Ji(e,3),lr)},$n.floor=lu,$n.forEach=ao,$n.forEachRight=uo,$n.forIn=function(t,e){return null==t?t:ar(t,Ji(e,3),Sa)},$n.forInRight=function(t,e){return null==t?t:ur(t,Ji(e,3),Sa)},$n.forOwn=function(t,e){return t&&cr(t,Ji(e,3))},$n.forOwnRight=function(t,e){return t&&lr(t,Ji(e,3))},$n.get=ma,$n.gt=To,$n.gte=_o,$n.has=function(t,e){return null!=t&&is(t,e,mr)},$n.hasIn=va,$n.head=Os,$n.identity=Ga,$n.includes=function(t,e,n,r){t=jo(t)?t:Ra(t),n=n&&!r?ia(n):0;var i=t.length;return n<0&&(n=an(i+n,0)),Jo(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&xe(t,e,n)>-1},$n.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ia(n);return i<0&&(i=an(r+i,0)),xe(t,e,i)},$n.inRange=function(t,e,n){return e=ra(e),void 0===n?(n=e,e=0):n=ra(n),function(t,e,n){return t>=un(e,n)&&t<an(e,n)}(t=oa(t),e,n)},$n.invoke=wa,$n.isArguments=Po,$n.isArray=ko,$n.isArrayBuffer=Oo,$n.isArrayLike=jo,$n.isArrayLikeObject=Bo,$n.isBoolean=function(t){return!0===t||!1===t||Ko(t)&&dr(t)==l},$n.isBuffer=No,$n.isDate=Lo,$n.isElement=function(t){return Ko(t)&&1===t.nodeType&&!Wo(t)},$n.isEmpty=function(t){if(null==t)return!0;if(jo(t)&&(ko(t)||"string"==typeof t||"function"==typeof t.splice||No(t)||Qo(t)||Po(t)))return!t.length;var e=rs(t);if(e==g||e==b)return!t.size;if(fs(t))return!Ar(t).length;for(var n in t)if(Et.call(t,n))return!1;return!0},$n.isEqual=function(t,e){return xr(t,e)},$n.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===r?xr(t,e,void 0,n):!!r},$n.isError=Ho,$n.isFinite=function(t){return"number"==typeof t&&rn(t)},$n.isFunction=Mo,$n.isInteger=Uo,$n.isLength=Vo,$n.isMap=zo,$n.isMatch=function(t,e){return t===e||Sr(t,e,Qi(e))},$n.isMatchWith=function(t,e,n){return n="function"==typeof n?n:void 0,Sr(t,e,Qi(e),n)},$n.isNaN=function(t){return Go(t)&&t!=+t},$n.isNative=function(t){if(hs(t))throw new Y("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Er(t)},$n.isNil=function(t){return null==t},$n.isNull=function(t){return null===t},$n.isNumber=Go,$n.isObject=qo,$n.isObjectLike=Ko,$n.isPlainObject=Wo,$n.isRegExp=Yo,$n.isSafeInteger=function(t){return Uo(t)&&t>=-9007199254740991&&t<=9007199254740991},$n.isSet=Xo,$n.isString=Jo,$n.isSymbol=Zo,$n.isTypedArray=Qo,$n.isUndefined=function(t){return void 0===t},$n.isWeakMap=function(t){return Ko(t)&&rs(t)==S},$n.isWeakSet=function(t){return Ko(t)&&"[object WeakSet]"==dr(t)},$n.join=function(t,e){return null==t?"":sn.call(t,e)},$n.kebabCase=ka,$n.last=Ls,$n.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=ia(n))<0?an(r+i,0):un(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):we(t,Ee,i,!0)},$n.lowerCase=Oa,$n.lowerFirst=ja,$n.lt=ta,$n.lte=ea,$n.max=function(t){return t&&t.length?ir(t,Ga,gr):void 0},$n.maxBy=function(t,e){return t&&t.length?ir(t,Ji(e,2),gr):void 0},$n.mean=function(t){return Fe(t,Ga)},$n.meanBy=function(t,e){return Fe(t,Ji(e,2))},$n.min=function(t){return t&&t.length?ir(t,Ga,Dr):void 0},$n.minBy=function(t,e){return t&&t.length?ir(t,Ji(e,2),Dr):void 0},$n.stubArray=su,$n.stubFalse=ou,$n.stubObject=function(){return{}},$n.stubString=function(){return""},$n.stubTrue=function(){return!0},$n.multiply=fu,$n.nth=function(t,e){return t&&t.length?_r(t,ia(e)):void 0},$n.noConflict=function(){return Gt._===this&&(Gt._=It),this},$n.noop=Za,$n.now=mo,$n.pad=function(t,e,n){t=ua(t);var r=(e=ia(e))?ze(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Pi(tn(i),n)+t+Pi(Qe(i),n)},$n.padEnd=function(t,e,n){t=ua(t);var r=(e=ia(e))?ze(t):0;return e&&r<e?t+Pi(e-r,n):t},$n.padStart=function(t,e,n){t=ua(t);var r=(e=ia(e))?ze(t):0;return e&&r<e?Pi(e-r,n)+t:t},$n.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),ln(ua(t).replace(W,""),e||0)},$n.random=function(t,e,n){if(n&&"boolean"!=typeof n&&us(t,e,n)&&(e=n=void 0),void 0===n&&("boolean"==typeof e?(n=e,e=void 0):"boolean"==typeof t&&(n=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=ra(t),void 0===e?(e=t,t=0):e=ra(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=hn();return un(t+i*(e-t+Vt("1e-"+((i+"").length-1))),e)}return Br(t,e)},$n.reduce=function(t,e,n){var r=ko(t)?ge:De,i=arguments.length<3;return r(t,Ji(e,4),n,i,er)},$n.reduceRight=function(t,e,n){var r=ko(t)?me:De,i=arguments.length<3;return r(t,Ji(e,4),n,i,nr)},$n.repeat=function(t,e,n){return e=(n?us(t,e,n):void 0===e)?1:ia(e),Nr(ua(t),e)},$n.replace=function(){var t=arguments,e=ua(t[0]);return t.length<3?e:e.replace(t[1],t[2])},$n.result=function(t,e,n){var r=-1,i=(e=ui(e,t)).length;for(i||(i=1,t=void 0);++r<i;){var s=null==t?void 0:t[Cs(e[r])];void 0===s&&(r=i,s=n),t=Mo(s)?s.call(t):s}return t},$n.round=pu,$n.runInContext=t,$n.sample=function(t){return(ko(t)?Hn:Hr)(t)},$n.size=function(t){if(null==t)return 0;if(jo(t))return Jo(t)?ze(t):t.length;var e=rs(t);return e==g||e==b?t.size:Ar(t).length},$n.snakeCase=Ba,$n.some=function(t,e,n){var r=ko(t)?ve:Gr;return n&&us(t,e,n)&&(e=void 0),r(t,Ji(e,3))},$n.sortedIndex=function(t,e){return Wr(t,e)},$n.sortedIndexBy=function(t,e,n){return Yr(t,e,Ji(n,2))},$n.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=Wr(t,e);if(r<n&&Ro(t[r],e))return r}return-1},$n.sortedLastIndex=function(t,e){return Wr(t,e,!0)},$n.sortedLastIndexBy=function(t,e,n){return Yr(t,e,Ji(n,2),!0)},$n.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var n=Wr(t,e,!0)-1;if(Ro(t[n],e))return n}return-1},$n.startCase=Na,$n.startsWith=function(t,e,n){return t=ua(t),n=null==n?0:Xn(ia(n),0,t.length),e=Zr(e),t.slice(n,n+e.length)==e},$n.subtract=du,$n.sum=function(t){return t&&t.length?Ie(t,Ga):0},$n.sumBy=function(t,e){return t&&t.length?Ie(t,Ji(e,2)):0},$n.template=function(t,e,n){var r=$n.templateSettings;n&&us(t,e,n)&&(e=void 0),t=ua(t),e=ha({},e,r,Mi);var i,s,o=ha({},e.imports,r.imports,Mi),a=xa(o),u=_e(o,a),c=0,l=e.interpolate||lt,h="__p += '",f=gt((e.escape||lt).source+"|"+l.source+"|"+(l===U?nt:lt).source+"|"+(e.evaluate||lt).source+"|$","g"),p="//# sourceURL="+(Et.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Lt+"]")+"\n";t.replace(f,(function(e,n,r,o,a,u){return r||(r=o),h+=t.slice(c,u).replace(ht,Le),n&&(i=!0,h+="' +\n__e("+n+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=u+e.length,e})),h+="';\n";var d=Et.call(e,"variable")&&e.variable;if(d){if(tt.test(d))throw new Y("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(P,""):h).replace(k,"$1").replace(O,"$1;"),h="function("+(d||"obj")+") {\n"+(d?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=Ua((function(){return ft(a,p+"return "+h).apply(void 0,u)}));if(g.source=h,Ho(g))throw g;return g},$n.times=function(t,e){if((t=ia(t))<1||t>9007199254740991)return[];var n=4294967295,r=un(t,4294967295);t-=4294967295;for(var i=$e(r,e=Ji(e));++n<t;)e(n);return i},$n.toFinite=ra,$n.toInteger=ia,$n.toLength=sa,$n.toLower=function(t){return ua(t).toLowerCase()},$n.toNumber=oa,$n.toSafeInteger=function(t){return t?Xn(ia(t),-9007199254740991,9007199254740991):0===t?t:0},$n.toString=ua,$n.toUpper=function(t){return ua(t).toUpperCase()},$n.trim=function(t,e,n){if((t=ua(t))&&(n||void 0===e))return Re(t);if(!t||!(e=Zr(e)))return t;var r=Ge(t),i=Ge(e);return li(r,ke(r,i),Oe(r,i)+1).join("")},$n.trimEnd=function(t,e,n){if((t=ua(t))&&(n||void 0===e))return t.slice(0,We(t)+1);if(!t||!(e=Zr(e)))return t;var r=Ge(t);return li(r,0,Oe(r,Ge(e))+1).join("")},$n.trimStart=function(t,e,n){if((t=ua(t))&&(n||void 0===e))return t.replace(W,"");if(!t||!(e=Zr(e)))return t;var r=Ge(t);return li(r,ke(r,Ge(e))).join("")},$n.truncate=function(t,e){var n=30,r="...";if(qo(e)){var i="separator"in e?e.separator:i;n="length"in e?ia(e.length):n,r="omission"in e?Zr(e.omission):r}var s=(t=ua(t)).length;if(He(t)){var o=Ge(t);s=o.length}if(n>=s)return t;var a=n-ze(r);if(a<1)return r;var u=o?li(o,0,a).join(""):t.slice(0,a);if(void 0===i)return u+r;if(o&&(a+=u.length-a),Yo(i)){if(t.slice(a).search(i)){var c,l=u;for(i.global||(i=gt(i.source,ua(rt.exec(i))+"g")),i.lastIndex=0;c=i.exec(l);)var h=c.index;u=u.slice(0,void 0===h?a:h)}}else if(t.indexOf(Zr(i),a)!=a){var f=u.lastIndexOf(i);f>-1&&(u=u.slice(0,f))}return u+r},$n.unescape=function(t){return(t=ua(t))&&N.test(t)?t.replace(j,Ye):t},$n.uniqueId=function(t){var e=++Ft;return ua(t)+e},$n.upperCase=La,$n.upperFirst=Ha,$n.each=ao,$n.eachRight=uo,$n.first=Os,Ja($n,(hu={},cr($n,(function(t,e){Et.call($n.prototype,e)||(hu[e]=t)})),hu),{chain:!1}),$n.VERSION="4.17.21",ae(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){$n[t].placeholder=$n})),ae(["drop","take"],(function(t,e){Pn.prototype[t]=function(n){n=void 0===n?1:an(ia(n),0);var r=this.__filtered__&&!e?new Pn(this):this.clone();return r.__filtered__?r.__takeCount__=un(n,r.__takeCount__):r.__views__.push({size:un(n,4294967295),type:t+(r.__dir__<0?"Right":"")}),r},Pn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ae(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Pn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Ji(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),ae(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Pn.prototype[t]=function(){return this[n](1).value()[0]}})),ae(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Pn.prototype[t]=function(){return this.__filtered__?new Pn(this):this[n](1)}})),Pn.prototype.compact=function(){return this.filter(Ga)},Pn.prototype.find=function(t){return this.filter(t).head()},Pn.prototype.findLast=function(t){return this.reverse().find(t)},Pn.prototype.invokeMap=Lr((function(t,e){return"function"==typeof t?new Pn(this):this.map((function(n){return br(n,t,e)}))})),Pn.prototype.reject=function(t){return this.filter(Ao(Ji(t)))},Pn.prototype.slice=function(t,e){t=ia(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Pn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=ia(e))<0?n.dropRight(-e):n.take(e-t)),n)},Pn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Pn.prototype.toArray=function(){return this.take(4294967295)},cr(Pn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=$n[r?"take"+("last"==e?"Right":""):e],s=r||/^find/.test(e);i&&($n.prototype[e]=function(){var e=this.__wrapped__,o=r?[1]:arguments,a=e instanceof Pn,u=o[0],c=a||ko(e),l=function(t){var e=i.apply($n,de([t],o));return r&&h?e[0]:e};c&&n&&"function"==typeof u&&1!=u.length&&(a=c=!1);var h=this.__chain__,f=!!this.__actions__.length,p=s&&!h,d=a&&!f;if(!s&&c){e=d?e:new Pn(this);var g=t.apply(e,o);return g.__actions__.push({func:no,args:[l],thisArg:void 0}),new _n(g,h)}return p&&d?t.apply(this,o):(g=this.thru(l),p?r?g.value()[0]:g.value():g)})})),ae(["pop","push","shift","sort","splice","unshift"],(function(t){var e=yt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);$n.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(ko(i)?i:[],t)}return this[n]((function(n){return e.apply(ko(n)?n:[],t)}))}})),cr(Pn.prototype,(function(t,e){var n=$n[e];if(n){var r=n.name+"";Et.call(wn,r)||(wn[r]=[]),wn[r].push({name:e,func:n})}})),wn[$i(void 0,2).name]=[{name:"wrapper",func:void 0}],Pn.prototype.clone=function(){var t=new Pn(this.__wrapped__);return t.__actions__=yi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=yi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=yi(this.__views__),t},Pn.prototype.reverse=function(){if(this.__filtered__){var t=new Pn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Pn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=ko(t),r=e<0,i=n?t.length:0,s=function(t,e,n){var r=-1,i=n.length;for(;++r<i;){var s=n[r],o=s.size;switch(s.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=un(e,t+o);break;case"takeRight":t=an(t,e-o)}}return{start:t,end:e}}(0,i,this.__views__),o=s.start,a=s.end,u=a-o,c=r?a:o-1,l=this.__iteratees__,h=l.length,f=0,p=un(u,this.__takeCount__);if(!n||!r&&i==u&&p==u)return ri(t,this.__actions__);var d=[];t:for(;u--&&f<p;){for(var g=-1,m=t[c+=e];++g<h;){var v=l[g],y=v.iteratee,b=v.type,w=y(m);if(2==b)m=w;else if(!w){if(1==b)continue t;break t}}d[f++]=m}return d},$n.prototype.at=ro,$n.prototype.chain=function(){return eo(this)},$n.prototype.commit=function(){return new _n(this.value(),this.__chain__)},$n.prototype.next=function(){void 0===this.__values__&&(this.__values__=na(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},$n.prototype.plant=function(t){for(var e,n=this;n instanceof Tn;){var r=Is(n);r.__index__=0,r.__values__=void 0,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},$n.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Pn){var e=t;return this.__actions__.length&&(e=new Pn(this)),(e=e.reverse()).__actions__.push({func:no,args:[Vs],thisArg:void 0}),new _n(e,this.__chain__)}return this.thru(Vs)},$n.prototype.toJSON=$n.prototype.valueOf=$n.prototype.value=function(){return ri(this.__wrapped__,this.__actions__)},$n.prototype.first=$n.prototype.head,Jt&&($n.prototype[Jt]=function(){return this}),$n}();Gt._=Xe,void 0===(i=function(){return Xe}.call(e,n,e,r))||(r.exports=i)}).call(this)}).call(this,n(6),n(180)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){angular.module("ui.bootstrap",["ui.bootstrap.tpls","ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.bindHtml","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.dropdown","ui.bootstrap.modal","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.transition","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.tpls",["template/accordion/accordion-group.html","template/accordion/accordion.html","template/alert/alert.html","template/carousel/carousel.html","template/carousel/slide.html","template/datepicker/datepicker.html","template/datepicker/day.html","template/datepicker/month.html","template/datepicker/popup.html","template/datepicker/year.html","template/modal/backdrop.html","template/modal/window.html","template/pagination/pager.html","template/pagination/pagination.html","template/tooltip/tooltip-html-popup.html","template/tooltip/tooltip-html-unsafe-popup.html","template/tooltip/tooltip-popup.html","template/tooltip/tooltip-template-popup.html","template/popover/popover-template.html","template/popover/popover.html","template/progressbar/bar.html","template/progressbar/progress.html","template/progressbar/progressbar.html","template/rating/rating.html","template/tabs/tab.html","template/tabs/tabset.html","template/timepicker/timepicker.html","template/typeahead/typeahead-match.html","template/typeahead/typeahead-popup.html"]),angular.module("ui.bootstrap.collapse",[]).directive("collapse",["$animate",function(t){return{link:function(e,n,r){function i(){n.removeClass("collapse").addClass("collapsing"),t.addClass(n,"in",{to:{height:n[0].scrollHeight+"px"}}).then(s)}function s(){n.removeClass("collapsing"),n.css({height:"auto"})}function o(){n.css({height:n[0].scrollHeight+"px"}).removeClass("collapse").addClass("collapsing"),t.removeClass(n,"in",{to:{height:"0"}}).then(a)}function a(){n.css({height:"0"}),n.removeClass("collapsing"),n.addClass("collapse")}e.$watch(r.collapse,(function(t){t?o():i()}))}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("accordionConfig",{closeOthers:!0}).controller("AccordionController",["$scope","$attrs","accordionConfig",function(t,e,n){this.groups=[],this.closeOthers=function(r){(angular.isDefined(e.closeOthers)?t.$eval(e.closeOthers):n.closeOthers)&&angular.forEach(this.groups,(function(t){t!==r&&(t.isOpen=!1)}))},this.addGroup=function(t){var e=this;this.groups.push(t),t.$on("$destroy",(function(){e.removeGroup(t)}))},this.removeGroup=function(t){var e=this.groups.indexOf(t);-1!==e&&this.groups.splice(e,1)}}]).directive("accordion",(function(){return{restrict:"EA",controller:"AccordionController",transclude:!0,replace:!1,templateUrl:"template/accordion/accordion.html"}})).directive("accordionGroup",(function(){return{require:"^accordion",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/accordion/accordion-group.html",scope:{heading:"@",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(t){this.heading=t}},link:function(t,e,n,r){r.addGroup(t),t.$watch("isOpen",(function(e){e&&r.closeOthers(t)})),t.toggleOpen=function(){t.isDisabled||(t.isOpen=!t.isOpen)}}}})).directive("accordionHeading",(function(){return{restrict:"EA",transclude:!0,template:"",replace:!0,require:"^accordionGroup",link:function(t,e,n,r,i){r.setHeading(i(t,angular.noop))}}})).directive("accordionTransclude",(function(){return{require:"^accordionGroup",link:function(t,e,n,r){t.$watch((function(){return r[n.accordionTransclude]}),(function(t){t&&(e.html(""),e.append(t))}))}}})),angular.module("ui.bootstrap.alert",[]).controller("AlertController",["$scope","$attrs",function(t,e){t.closeable="close"in e,this.close=t.close}]).directive("alert",(function(){return{restrict:"EA",controller:"AlertController",templateUrl:"template/alert/alert.html",transclude:!0,replace:!0,scope:{type:"@",close:"&"}}})).directive("dismissOnTimeout",["$timeout",function(t){return{require:"alert",link:function(e,n,r,i){t((function(){i.close()}),parseInt(r.dismissOnTimeout,10))}}}]),angular.module("ui.bootstrap.bindHtml",[]).directive("bindHtmlUnsafe",(function(){return function(t,e,n){e.addClass("ng-binding").data("$binding",n.bindHtmlUnsafe),t.$watch(n.bindHtmlUnsafe,(function(t){e.html(t||"")}))}})),angular.module("ui.bootstrap.buttons",[]).constant("buttonConfig",{activeClass:"active",toggleEvent:"click"}).controller("ButtonsController",["buttonConfig",function(t){this.activeClass=t.activeClass||"active",this.toggleEvent=t.toggleEvent||"click"}]).directive("btnRadio",(function(){return{require:["btnRadio","ngModel"],controller:"ButtonsController",link:function(t,e,n,r){var i=r[0],s=r[1];s.$render=function(){e.toggleClass(i.activeClass,angular.equals(s.$modelValue,t.$eval(n.btnRadio)))},e.bind(i.toggleEvent,(function(){var r=e.hasClass(i.activeClass);(!r||angular.isDefined(n.uncheckable))&&t.$apply((function(){s.$setViewValue(r?null:t.$eval(n.btnRadio)),s.$render()}))}))}}})).directive("btnCheckbox",(function(){return{require:["btnCheckbox","ngModel"],controller:"ButtonsController",link:function(t,e,n,r){function i(){return s(n.btnCheckboxTrue,!0)}function s(e,n){var r=t.$eval(e);return angular.isDefined(r)?r:n}var o=r[0],a=r[1];a.$render=function(){e.toggleClass(o.activeClass,angular.equals(a.$modelValue,i()))},e.bind(o.toggleEvent,(function(){t.$apply((function(){a.$setViewValue(e.hasClass(o.activeClass)?s(n.btnCheckboxFalse,!1):i()),a.$render()}))}))}}})),angular.module("ui.bootstrap.carousel",[]).controller("CarouselController",["$scope","$interval","$animate",function(t,e,n){function r(t){if(angular.isUndefined(l[t].index))return l[t];var e;for(l.length,e=0;e<l.length;++e)if(l[e].index==t)return l[e]}function i(){s();var n=+t.interval;!isNaN(n)&&n>0&&(a=e(o,n))}function s(){a&&(e.cancel(a),a=null)}function o(){var e=+t.interval;u&&!isNaN(e)&&e>0?t.next():t.pause()}var a,u,c=this,l=c.slides=t.slides=[],h=-1;c.currentSlide=null;var f=!1;c.select=t.select=function(e,r){var s=c.indexOfSlide(e);void 0===r&&(r=s>c.getCurrentIndex()?"next":"prev"),e&&e!==c.currentSlide&&(f||(angular.extend(e,{direction:r,active:!0}),angular.extend(c.currentSlide||{},{direction:r,active:!1}),n.enabled()&&!t.noTransition&&e.$element&&(t.$currentTransition=!0,e.$element.one("$animate:close",(function(){t.$currentTransition=null}))),c.currentSlide=e,h=s,i()))},t.$on("$destroy",(function(){f=!0})),c.getCurrentIndex=function(){return c.currentSlide&&angular.isDefined(c.currentSlide.index)?+c.currentSlide.index:h},c.indexOfSlide=function(t){return angular.isDefined(t.index)?+t.index:l.indexOf(t)},t.next=function(){var e=(c.getCurrentIndex()+1)%l.length;return t.$currentTransition?void 0:c.select(r(e),"next")},t.prev=function(){var e=c.getCurrentIndex()-1<0?l.length-1:c.getCurrentIndex()-1;return t.$currentTransition?void 0:c.select(r(e),"prev")},t.isActive=function(t){return c.currentSlide===t},t.$watch("interval",i),t.$on("$destroy",s),t.play=function(){u||(u=!0,i())},t.pause=function(){t.noPause||(u=!1,s())},c.addSlide=function(e,n){e.$element=n,l.push(e),1===l.length||e.active?(c.select(l[l.length-1]),1==l.length&&t.play()):e.active=!1},c.removeSlide=function(t){angular.isDefined(t.index)&&l.sort((function(t,e){return+t.index>+e.index}));var e=l.indexOf(t);l.splice(e,1),l.length>0&&t.active?c.select(e>=l.length?l[e-1]:l[e]):h>e&&h--}}]).directive("carousel",[function(){return{restrict:"EA",transclude:!0,replace:!0,controller:"CarouselController",require:"carousel",templateUrl:"template/carousel/carousel.html",scope:{interval:"=",noTransition:"=",noPause:"="}}}]).directive("slide",(function(){return{require:"^carousel",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/carousel/slide.html",scope:{active:"=?",index:"=?"},link:function(t,e,n,r){r.addSlide(t,e),t.$on("$destroy",(function(){r.removeSlide(t)})),t.$watch("active",(function(e){e&&r.select(t)}))}}})).animation(".item",["$animate",function(t){return{beforeAddClass:function(e,n,r){if("active"==n&&e.parent()&&!e.parent().scope().noTransition){var i=!1,s=e.isolateScope().direction,o="next"==s?"left":"right";return e.addClass(s),t.addClass(e,o).then((function(){i||e.removeClass(o+" "+s),r()})),function(){i=!0}}r()},beforeRemoveClass:function(e,n,r){if("active"==n&&e.parent()&&!e.parent().scope().noTransition){var i=!1,s="next"==e.isolateScope().direction?"left":"right";return t.addClass(e,s).then((function(){i||e.removeClass(s),r()})),function(){i=!0}}r()}}}]),angular.module("ui.bootstrap.dateparser",[]).service("dateParser",["$locale","orderByFilter",function(t,e){function n(t){var n=[],r=t.split("");return angular.forEach(i,(function(e,i){var s=t.indexOf(i);if(s>-1){t=t.split(""),r[s]="("+e.regex+")",t[s]="$";for(var o=s+1,a=s+i.length;a>o;o++)r[o]="",t[o]="$";t=t.join(""),n.push({index:s,apply:e.apply})}})),{regex:new RegExp("^"+r.join("")+"$"),map:e(n,"index")}}var r=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;this.parsers={};var i={yyyy:{regex:"\\d{4}",apply:function(t){this.year=+t}},yy:{regex:"\\d{2}",apply:function(t){this.year=+t+2e3}},y:{regex:"\\d{1,4}",apply:function(t){this.year=+t}},MMMM:{regex:t.DATETIME_FORMATS.MONTH.join("|"),apply:function(e){this.month=t.DATETIME_FORMATS.MONTH.indexOf(e)}},MMM:{regex:t.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(e){this.month=t.DATETIME_FORMATS.SHORTMONTH.indexOf(e)}},MM:{regex:"0[1-9]|1[0-2]",apply:function(t){this.month=t-1}},M:{regex:"[1-9]|1[0-2]",apply:function(t){this.month=t-1}},dd:{regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(t){this.date=+t}},d:{regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(t){this.date=+t}},EEEE:{regex:t.DATETIME_FORMATS.DAY.join("|")},EEE:{regex:t.DATETIME_FORMATS.SHORTDAY.join("|")},HH:{regex:"(?:0|1)[0-9]|2[0-3]",apply:function(t){this.hours=+t}},H:{regex:"1?[0-9]|2[0-3]",apply:function(t){this.hours=+t}},mm:{regex:"[0-5][0-9]",apply:function(t){this.minutes=+t}},m:{regex:"[0-9]|[1-5][0-9]",apply:function(t){this.minutes=+t}},sss:{regex:"[0-9][0-9][0-9]",apply:function(t){this.milliseconds=+t}},ss:{regex:"[0-5][0-9]",apply:function(t){this.seconds=+t}},s:{regex:"[0-9]|[1-5][0-9]",apply:function(t){this.seconds=+t}}};this.parse=function(e,i,s){if(!angular.isString(e)||!i)return e;i=(i=t.DATETIME_FORMATS[i]||i).replace(r,"\\$&"),this.parsers[i]||(this.parsers[i]=n(i));var o=this.parsers[i],a=o.regex,u=o.map,c=e.match(a);if(c&&c.length){var l,h;l=s?{year:s.getFullYear(),month:s.getMonth(),date:s.getDate(),hours:s.getHours(),minutes:s.getMinutes(),seconds:s.getSeconds(),milliseconds:s.getMilliseconds()}:{year:1900,month:0,date:1,hours:0,minutes:0,seconds:0,milliseconds:0};for(var f=1,p=c.length;p>f;f++){var d=u[f-1];d.apply&&d.apply.call(l,c[f])}return function(t,e,n){return!(1>n)&&(1===e&&n>28?29===n&&(t%4==0&&t%100!=0||t%400==0):3!==e&&5!==e&&8!==e&&10!==e||31>n)}(l.year,l.month,l.date)&&(h=new Date(l.year,l.month,l.date,l.hours,l.minutes,l.seconds,l.milliseconds||0)),h}}}]),angular.module("ui.bootstrap.position",[]).factory("$position",["$document","$window",function(t,e){function n(t){return"static"===(function(t,n){return t.currentStyle?t.currentStyle[n]:e.getComputedStyle?e.getComputedStyle(t)[n]:t.style[n]}(t,"position")||"static")}var r=function(e){for(var r=t[0],i=e.offsetParent||r;i&&i!==r&&n(i);)i=i.offsetParent;return i||r};return{position:function(e){var n=this.offset(e),i={top:0,left:0},s=r(e[0]);s!=t[0]&&((i=this.offset(angular.element(s))).top+=s.clientTop-s.scrollTop,i.left+=s.clientLeft-s.scrollLeft);var o=e[0].getBoundingClientRect();return{width:o.width||e.prop("offsetWidth"),height:o.height||e.prop("offsetHeight"),top:n.top-i.top,left:n.left-i.left}},offset:function(n){var r=n[0].getBoundingClientRect();return{width:r.width||n.prop("offsetWidth"),height:r.height||n.prop("offsetHeight"),top:r.top+(e.pageYOffset||t[0].documentElement.scrollTop),left:r.left+(e.pageXOffset||t[0].documentElement.scrollLeft)}},positionElements:function(t,e,n,r){var i,s,o,a,u=n.split("-"),c=u[0],l=u[1]||"center";i=r?this.offset(t):this.position(t),s=e.prop("offsetWidth"),o=e.prop("offsetHeight");var h={center:function(){return i.left+i.width/2-s/2},left:function(){return i.left},right:function(){return i.left+i.width}},f={center:function(){return i.top+i.height/2-o/2},top:function(){return i.top},bottom:function(){return i.top+i.height}};switch(c){case"right":a={top:f[l](),left:h[c]()};break;case"left":a={top:f[l](),left:i.left-s};break;case"bottom":a={top:f[c](),left:h[l]()};break;default:a={top:i.top-o,left:h[l]()}}return a}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.position"]).constant("datepickerConfig",{formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",datepickerMode:"day",minMode:"day",maxMode:"year",showWeeks:!0,startingDay:0,yearRange:20,minDate:null,maxDate:null,shortcutPropagation:!1}).controller("DatepickerController",["$scope","$attrs","$parse","$interpolate","$timeout","$log","dateFilter","datepickerConfig",function(t,e,n,r,i,s,o,a){var u=this,c={$setViewValue:angular.noop};this.modes=["day","month","year"],angular.forEach(["formatDay","formatMonth","formatYear","formatDayHeader","formatDayTitle","formatMonthTitle","minMode","maxMode","showWeeks","startingDay","yearRange","shortcutPropagation"],(function(n,i){u[n]=angular.isDefined(e[n])?8>i?r(e[n])(t.$parent):t.$parent.$eval(e[n]):a[n]})),angular.forEach(["minDate","maxDate"],(function(r){e[r]?t.$parent.$watch(n(e[r]),(function(t){u[r]=t?new Date(t):null,u.refreshView()})):u[r]=a[r]?new Date(a[r]):null})),t.datepickerMode=t.datepickerMode||a.datepickerMode,t.maxMode=u.maxMode,t.uniqueId="datepicker-"+t.$id+"-"+Math.floor(1e4*Math.random()),angular.isDefined(e.initDate)?(this.activeDate=t.$parent.$eval(e.initDate)||new Date,t.$parent.$watch(e.initDate,(function(t){t&&(c.$isEmpty(c.$modelValue)||c.$invalid)&&(u.activeDate=t,u.refreshView())}))):this.activeDate=new Date,t.isActive=function(e){return 0===u.compare(e.date,u.activeDate)&&(t.activeDateId=e.uid,!0)},this.init=function(t){(c=t).$render=function(){u.render()}},this.render=function(){if(c.$viewValue){var t=new Date(c.$viewValue),e=!isNaN(t);e?this.activeDate=t:s.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.'),c.$setValidity("date",e)}this.refreshView()},this.refreshView=function(){if(this.element){this._refreshView();var t=c.$viewValue?new Date(c.$viewValue):null;c.$setValidity("date-disabled",!t||this.element&&!this.isDisabled(t))}},this.createDateObject=function(t,e){var n=c.$viewValue?new Date(c.$viewValue):null;return{date:t,label:o(t,e),selected:n&&0===this.compare(t,n),disabled:this.isDisabled(t),current:0===this.compare(t,new Date),customClass:this.customClass(t)}},this.isDisabled=function(n){return this.minDate&&this.compare(n,this.minDate)<0||this.maxDate&&this.compare(n,this.maxDate)>0||e.dateDisabled&&t.dateDisabled({date:n,mode:t.datepickerMode})},this.customClass=function(e){return t.customClass({date:e,mode:t.datepickerMode})},this.split=function(t,e){for(var n=[];t.length>0;)n.push(t.splice(0,e));return n},t.select=function(e){if(t.datepickerMode===u.minMode){var n=c.$viewValue?new Date(c.$viewValue):new Date(0,0,0,0,0,0,0);n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),c.$setViewValue(n),c.$render()}else u.activeDate=e,t.datepickerMode=u.modes[u.modes.indexOf(t.datepickerMode)-1]},t.move=function(t){var e=u.activeDate.getFullYear()+t*(u.step.years||0),n=u.activeDate.getMonth()+t*(u.step.months||0);u.activeDate.setFullYear(e,n,1),u.refreshView()},t.toggleMode=function(e){e=e||1,t.datepickerMode===u.maxMode&&1===e||t.datepickerMode===u.minMode&&-1===e||(t.datepickerMode=u.modes[u.modes.indexOf(t.datepickerMode)+e])},t.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var l=function(){i((function(){u.element[0].focus()}),0,!1)};t.$on("datepicker.focus",l),t.keydown=function(e){var n=t.keys[e.which];if(n&&!e.shiftKey&&!e.altKey)if(e.preventDefault(),u.shortcutPropagation||e.stopPropagation(),"enter"===n||"space"===n){if(u.isDisabled(u.activeDate))return;t.select(u.activeDate),l()}else!e.ctrlKey||"up"!==n&&"down"!==n?(u.handleKeyDown(n,e),u.refreshView()):(t.toggleMode("up"===n?1:-1),l())}}]).directive("datepicker",(function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/datepicker.html",scope:{datepickerMode:"=?",dateDisabled:"&",customClass:"&",shortcutPropagation:"&?"},require:["datepicker","?^ngModel"],controller:"DatepickerController",link:function(t,e,n,r){var i=r[0],s=r[1];s&&i.init(s)}}})).directive("daypicker",["dateFilter",function(t){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/day.html",require:"^datepicker",link:function(e,n,r,i){function s(t,e){return 1!==e||t%4!=0||t%100==0&&t%400!=0?a[e]:29}function o(t){var e=new Date(t);e.setDate(e.getDate()+4-(e.getDay()||7));var n=e.getTime();return e.setMonth(0),e.setDate(1),Math.floor(Math.round((n-e)/864e5)/7)+1}e.showWeeks=i.showWeeks,i.step={months:1},i.element=n;var a=[31,28,31,30,31,30,31,31,30,31,30,31];i._refreshView=function(){var n=i.activeDate.getFullYear(),r=i.activeDate.getMonth(),s=new Date(n,r,1),a=i.startingDay-s.getDay(),u=a>0?7-a:-a,c=new Date(s);u>0&&c.setDate(1-u);for(var l=function(t,e){var n=new Array(e),r=new Date(t),i=0;for(r.setHours(12);e>i;)n[i++]=new Date(r),r.setDate(r.getDate()+1);return n}(c,42),h=0;42>h;h++)l[h]=angular.extend(i.createDateObject(l[h],i.formatDay),{secondary:l[h].getMonth()!==r,uid:e.uniqueId+"-"+h});e.labels=new Array(7);for(var f=0;7>f;f++)e.labels[f]={abbr:t(l[f].date,i.formatDayHeader),full:t(l[f].date,"EEEE")};if(e.title=t(i.activeDate,i.formatDayTitle),e.rows=i.split(l,7),e.showWeeks){e.weekNumbers=[];for(var p=(11-i.startingDay)%7,d=e.rows.length,g=0;d>g;g++)e.weekNumbers.push(o(e.rows[g][p].date))}},i.compare=function(t,e){return new Date(t.getFullYear(),t.getMonth(),t.getDate())-new Date(e.getFullYear(),e.getMonth(),e.getDate())},i.handleKeyDown=function(t){var e=i.activeDate.getDate();if("left"===t)e-=1;else if("up"===t)e-=7;else if("right"===t)e+=1;else if("down"===t)e+=7;else if("pageup"===t||"pagedown"===t){var n=i.activeDate.getMonth()+("pageup"===t?-1:1);i.activeDate.setMonth(n,1),e=Math.min(s(i.activeDate.getFullYear(),i.activeDate.getMonth()),e)}else"home"===t?e=1:"end"===t&&(e=s(i.activeDate.getFullYear(),i.activeDate.getMonth()));i.activeDate.setDate(e)},i.refreshView()}}}]).directive("monthpicker",["dateFilter",function(t){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/month.html",require:"^datepicker",link:function(e,n,r,i){i.step={years:1},i.element=n,i._refreshView=function(){for(var n=new Array(12),r=i.activeDate.getFullYear(),s=0;12>s;s++)n[s]=angular.extend(i.createDateObject(new Date(r,s,1),i.formatMonth),{uid:e.uniqueId+"-"+s});e.title=t(i.activeDate,i.formatMonthTitle),e.rows=i.split(n,3)},i.compare=function(t,e){return new Date(t.getFullYear(),t.getMonth())-new Date(e.getFullYear(),e.getMonth())},i.handleKeyDown=function(t){var e=i.activeDate.getMonth();if("left"===t)e-=1;else if("up"===t)e-=3;else if("right"===t)e+=1;else if("down"===t)e+=3;else if("pageup"===t||"pagedown"===t){var n=i.activeDate.getFullYear()+("pageup"===t?-1:1);i.activeDate.setFullYear(n)}else"home"===t?e=0:"end"===t&&(e=11);i.activeDate.setMonth(e)},i.refreshView()}}}]).directive("yearpicker",["dateFilter",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/year.html",require:"^datepicker",link:function(t,e,n,r){function i(t){return parseInt((t-1)/s,10)*s+1}var s=r.yearRange;r.step={years:s},r.element=e,r._refreshView=function(){for(var e=new Array(s),n=0,o=i(r.activeDate.getFullYear());s>n;n++)e[n]=angular.extend(r.createDateObject(new Date(o+n,0,1),r.formatYear),{uid:t.uniqueId+"-"+n});t.title=[e[0].label,e[s-1].label].join(" - "),t.rows=r.split(e,5)},r.compare=function(t,e){return t.getFullYear()-e.getFullYear()},r.handleKeyDown=function(t){var e=r.activeDate.getFullYear();"left"===t?e-=1:"up"===t?e-=5:"right"===t?e+=1:"down"===t?e+=5:"pageup"===t||"pagedown"===t?e+=("pageup"===t?-1:1)*r.step.years:"home"===t?e=i(r.activeDate.getFullYear()):"end"===t&&(e=i(r.activeDate.getFullYear())+s-1),r.activeDate.setFullYear(e)},r.refreshView()}}}]).constant("datepickerPopupConfig",{datepickerPopup:"yyyy-MM-dd",html5Types:{date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm:ss.sss",month:"yyyy-MM"},currentText:"Today",clearText:"Clear",closeText:"Done",closeOnDateSelection:!0,appendToBody:!1,showButtonBar:!0}).directive("datepickerPopup",["$compile","$parse","$document","$position","dateFilter","dateParser","datepickerPopupConfig",function(t,e,n,r,i,s,o){return{restrict:"EA",require:"ngModel",scope:{isOpen:"=?",currentText:"@",clearText:"@",closeText:"@",dateDisabled:"&",customClass:"&"},link:function(a,u,c,l){function h(t){return t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))}var f,p=angular.isDefined(c.closeOnDateSelection)?a.$parent.$eval(c.closeOnDateSelection):o.closeOnDateSelection,d=angular.isDefined(c.datepickerAppendToBody)?a.$parent.$eval(c.datepickerAppendToBody):o.appendToBody;a.showButtonBar=angular.isDefined(c.showButtonBar)?a.$parent.$eval(c.showButtonBar):o.showButtonBar,a.getText=function(t){return a[t+"Text"]||o[t+"Text"]};var g=!1;if(o.html5Types[c.type]?(f=o.html5Types[c.type],g=!0):(f=c.datepickerPopup||o.datepickerPopup,c.$observe("datepickerPopup",(function(t){var e=t||o.datepickerPopup;if(e!==f&&(f=e,l.$modelValue=null,!f))throw new Error("datepickerPopup must have a date format specified.")}))),!f)throw new Error("datepickerPopup must have a date format specified.");if(g&&c.datepickerPopup)throw new Error("HTML5 date input types do not support custom formats.");var m=angular.element("<div datepicker-popup-wrap><div datepicker></div></div>");m.attr({"ng-model":"date","ng-change":"dateSelection()"});var v=angular.element(m.children()[0]);if(g&&"month"==c.type&&(v.attr("datepicker-mode",'"month"'),v.attr("min-mode","month")),c.datepickerOptions){var y=a.$parent.$eval(c.datepickerOptions);y.initDate&&(a.initDate=y.initDate,v.attr("init-date","initDate"),delete y.initDate),angular.forEach(y,(function(t,e){v.attr(h(e),t)}))}a.watchData={},angular.forEach(["minDate","maxDate","datepickerMode","initDate","shortcutPropagation"],(function(t){if(c[t]){var n=e(c[t]);if(a.$parent.$watch(n,(function(e){a.watchData[t]=e})),v.attr(h(t),"watchData."+t),"datepickerMode"===t){var r=n.assign;a.$watch("watchData."+t,(function(t,e){t!==e&&r(a.$parent,t)}))}}})),c.dateDisabled&&v.attr("date-disabled","dateDisabled({ date: date, mode: mode })"),c.showWeeks&&v.attr("show-weeks",c.showWeeks),c.customClass&&v.attr("custom-class","customClass({ date: date, mode: mode })"),g?l.$formatters.push((function(t){return a.date=t,t})):(l.$$parserName="date",l.$validators.date=function(t,e){var n=t||e;if(angular.isNumber(n)&&(n=new Date(n)),n){if(angular.isDate(n)&&!isNaN(n))return!0;if(angular.isString(n)){var r=s.parse(n,f)||new Date(n);return!isNaN(r)}return!1}return!0},l.$parsers.unshift((function(t){if(angular.isNumber(t)&&(t=new Date(t)),!t)return null;if(angular.isDate(t)&&!isNaN(t))return t;if(angular.isString(t)){var e=s.parse(t,f,a.date)||new Date(t);return isNaN(e)?void 0:e}})),l.$formatters.push((function(t){return a.date=t,l.$isEmpty(t)?t:i(t,f)}))),a.dateSelection=function(t){angular.isDefined(t)&&(a.date=t);var e=a.date?i(a.date,f):"";u.val(e),l.$setViewValue(e),p&&(a.isOpen=!1,u[0].focus())},l.$viewChangeListeners.push((function(){a.date=s.parse(l.$viewValue,f,a.date)||new Date(l.$viewValue)}));var b=function(t){a.isOpen&&t.target!==u[0]&&a.$apply((function(){a.isOpen=!1}))},w=function(t){a.keydown(t)};u.bind("keydown",w),a.keydown=function(t){27===t.which?(t.preventDefault(),a.isOpen&&t.stopPropagation(),a.close()):40!==t.which||a.isOpen||(a.isOpen=!0)},a.$watch("isOpen",(function(t){t?(a.$broadcast("datepicker.focus"),a.position=d?r.offset(u):r.position(u),a.position.top=a.position.top+u.prop("offsetHeight"),n.bind("click",b)):n.unbind("click",b)})),a.select=function(t){if("today"===t){var e=new Date;angular.isDate(a.date)?(t=new Date(a.date)).setFullYear(e.getFullYear(),e.getMonth(),e.getDate()):t=new Date(e.setHours(0,0,0,0))}a.dateSelection(t)},a.close=function(){a.isOpen=!1,u[0].focus()};var x=t(m)(a);m.remove(),d?n.find("body").append(x):u.after(x),a.$on("$destroy",(function(){x.remove(),u.unbind("keydown",w),n.unbind("click",b)}))}}}]).directive("datepickerPopupWrap",(function(){return{restrict:"EA",replace:!0,transclude:!0,templateUrl:"template/datepicker/popup.html",link:function(t,e){e.bind("click",(function(t){t.preventDefault(),t.stopPropagation()}))}}})),angular.module("ui.bootstrap.dropdown",["ui.bootstrap.position"]).constant("dropdownConfig",{openClass:"open"}).service("dropdownService",["$document","$rootScope",function(t,e){var n=null;this.open=function(e){n||(t.bind("click",r),t.bind("keydown",i)),n&&n!==e&&(n.isOpen=!1),n=e},this.close=function(e){n===e&&(n=null,t.unbind("click",r),t.unbind("keydown",i))};var r=function(t){if(n&&(!t||"disabled"!==n.getAutoClose())){var r=n.getToggleElement();if(!(t&&r&&r[0].contains(t.target))){var i=n.getElement();t&&"outsideClick"===n.getAutoClose()&&i&&i[0].contains(t.target)||(n.isOpen=!1,e.$$phase||n.$apply())}}},i=function(t){27===t.which&&(n.focusToggleElement(),r())}}]).controller("DropdownController",["$scope","$attrs","$parse","dropdownConfig","dropdownService","$animate","$position","$document",function(t,e,n,r,i,s,o,a){var u,c=this,l=t.$new(),h=r.openClass,f=angular.noop,p=e.onToggle?n(e.onToggle):angular.noop,d=!1;this.init=function(r){c.$element=r,e.isOpen&&(u=n(e.isOpen),f=u.assign,t.$watch(u,(function(t){l.isOpen=!!t}))),(d=angular.isDefined(e.dropdownAppendToBody))&&c.dropdownMenu&&(a.find("body").append(c.dropdownMenu),r.on("$destroy",(function(){c.dropdownMenu.remove()})))},this.toggle=function(t){return l.isOpen=arguments.length?!!t:!l.isOpen},this.isOpen=function(){return l.isOpen},l.getToggleElement=function(){return c.toggleElement},l.getAutoClose=function(){return e.autoClose||"always"},l.getElement=function(){return c.$element},l.focusToggleElement=function(){c.toggleElement&&c.toggleElement[0].focus()},l.$watch("isOpen",(function(e,n){if(d&&c.dropdownMenu){var r=o.positionElements(c.$element,c.dropdownMenu,"bottom-left",!0);c.dropdownMenu.css({top:r.top+"px",left:r.left+"px",display:e?"block":"none"})}s[e?"addClass":"removeClass"](c.$element,h),e?(l.focusToggleElement(),i.open(l)):i.close(l),f(t,e),angular.isDefined(e)&&e!==n&&p(t,{open:!!e})})),t.$on("$locationChangeSuccess",(function(){l.isOpen=!1})),t.$on("$destroy",(function(){l.$destroy()}))}]).directive("dropdown",(function(){return{controller:"DropdownController",link:function(t,e,n,r){r.init(e)}}})).directive("dropdownMenu",(function(){return{restrict:"AC",require:"?^dropdown",link:function(t,e,n,r){r&&(r.dropdownMenu=e)}}})).directive("dropdownToggle",(function(){return{require:"?^dropdown",link:function(t,e,n,r){if(r){r.toggleElement=e;var i=function(i){i.preventDefault(),e.hasClass("disabled")||n.disabled||t.$apply((function(){r.toggle()}))};e.bind("click",i),e.attr({"aria-haspopup":!0,"aria-expanded":!1}),t.$watch(r.isOpen,(function(t){e.attr("aria-expanded",!!t)})),t.$on("$destroy",(function(){e.unbind("click",i)}))}}}})),angular.module("ui.bootstrap.modal",[]).factory("$$stackedMap",(function(){return{createNew:function(){var t=[];return{add:function(e,n){t.push({key:e,value:n})},get:function(e){for(var n=0;n<t.length;n++)if(e==t[n].key)return t[n]},keys:function(){for(var e=[],n=0;n<t.length;n++)e.push(t[n].key);return e},top:function(){return t[t.length-1]},remove:function(e){for(var n=-1,r=0;r<t.length;r++)if(e==t[r].key){n=r;break}return t.splice(n,1)[0]},removeTop:function(){return t.splice(t.length-1,1)[0]},length:function(){return t.length}}}}})).directive("modalBackdrop",["$timeout",function(t){function e(e){e.animate=!1,t((function(){e.animate=!0}))}return{restrict:"EA",replace:!0,templateUrl:"template/modal/backdrop.html",compile:function(t,n){return t.addClass(n.backdropClass),e}}}]).directive("modalWindow",["$modalStack","$q",function(t,e){return{restrict:"EA",scope:{index:"@",animate:"="},replace:!0,transclude:!0,templateUrl:function(t,e){return e.templateUrl||"template/modal/window.html"},link:function(n,r,i){r.addClass(i.windowClass||""),n.size=i.size,n.close=function(e){var n=t.getTop();n&&n.value.backdrop&&"static"!=n.value.backdrop&&e.target===e.currentTarget&&(e.preventDefault(),e.stopPropagation(),t.dismiss(n.key,"backdrop click"))},n.$isRendered=!0;var s=e.defer();i.$observe("modalRender",(function(t){"true"==t&&s.resolve()})),s.promise.then((function(){n.animate=!0;var e=r[0].querySelectorAll("[autofocus]");e.length?e[0].focus():r[0].focus();var i=t.getTop();i&&t.modalRendered(i.key)}))}}}]).directive("modalAnimationClass",[function(){return{compile:function(t,e){e.modalAnimation&&t.addClass(e.modalAnimationClass)}}}]).directive("modalTransclude",(function(){return{link:function(t,e,n,r,i){i(t.$parent,(function(t){e.empty(),e.append(t)}))}}})).factory("$modalStack",["$animate","$timeout","$document","$compile","$rootScope","$$stackedMap",function(t,e,n,r,i,s){function o(){for(var t=-1,e=p.keys(),n=0;n<e.length;n++)p.get(e[n]).value.backdrop&&(t=n);return t}function a(t){var e=n.find("body").eq(0),r=p.get(t).value;p.remove(t),u(r.modalDomEl,r.modalScope,(function(){e.toggleClass(f,p.length()>0),function(){if(l&&-1==o()){u(l,h,(function(){null})),l=void 0,h=void 0}}()}))}function u(n,r,s){function o(){o.done||(o.done=!0,n.remove(),r.$destroy(),s&&s())}r.animate=!1,n.attr("modal-animation")&&t.enabled()?n.one("$animate:close",(function(){i.$evalAsync(o)})):e(o)}function c(t,e,n){return!t.value.modalScope.$broadcast("modal.closing",e,n).defaultPrevented}var l,h,f="modal-open",p=s.createNew(),d={};return i.$watch(o,(function(t){h&&(h.index=t)})),n.bind("keydown",(function(t){var e;27===t.which&&((e=p.top())&&e.value.keyboard&&(t.preventDefault(),i.$apply((function(){d.dismiss(e.key,"escape key press")}))))})),d.open=function(t,e){var s=n[0].activeElement;p.add(t,{deferred:e.deferred,renderDeferred:e.renderDeferred,modalScope:e.scope,backdrop:e.backdrop,keyboard:e.keyboard});var a=n.find("body").eq(0),u=o();if(u>=0&&!l){(h=i.$new(!0)).index=u;var c=angular.element('<div modal-backdrop="modal-backdrop"></div>');c.attr("backdrop-class",e.backdropClass),e.animation&&c.attr("modal-animation","true"),l=r(c)(h),a.append(l)}var d=angular.element('<div modal-window="modal-window"></div>');d.attr({"template-url":e.windowTemplateUrl,"window-class":e.windowClass,size:e.size,index:p.length()-1,animate:"animate"}).html(e.content),e.animation&&d.attr("modal-animation","true");var g=r(d)(e.scope);p.top().value.modalDomEl=g,p.top().value.modalOpener=s,a.append(g),a.addClass(f)},d.close=function(t,e){var n=p.get(t);return n&&c(n,e,!0)?(n.value.deferred.resolve(e),a(t),n.value.modalOpener.focus(),!0):!n},d.dismiss=function(t,e){var n=p.get(t);return n&&c(n,e,!1)?(n.value.deferred.reject(e),a(t),n.value.modalOpener.focus(),!0):!n},d.dismissAll=function(t){for(var e=this.getTop();e&&this.dismiss(e.key,t);)e=this.getTop()},d.getTop=function(){return p.top()},d.modalRendered=function(t){var e=p.get(t);e&&e.value.renderDeferred.resolve()},d}]).provider("$modal",(function(){var t={options:{animation:!0,backdrop:!0,keyboard:!0},$get:["$injector","$rootScope","$q","$templateRequest","$controller","$modalStack",function(e,n,r,i,s,o){function a(t){return t.template?r.when(t.template):i(angular.isFunction(t.templateUrl)?t.templateUrl():t.templateUrl)}function u(t){var n=[];return angular.forEach(t,(function(t){(angular.isFunction(t)||angular.isArray(t))&&n.push(r.when(e.invoke(t)))})),n}var c={open:function(e){var i=r.defer(),c=r.defer(),l=r.defer(),h={result:i.promise,opened:c.promise,rendered:l.promise,close:function(t){return o.close(h,t)},dismiss:function(t){return o.dismiss(h,t)}};if((e=angular.extend({},t.options,e)).resolve=e.resolve||{},!e.template&&!e.templateUrl)throw new Error("One of template or templateUrl options is required.");var f=r.all([a(e)].concat(u(e.resolve)));return f.then((function(t){var r=(e.scope||n).$new();r.$close=h.close,r.$dismiss=h.dismiss;var a,u={},c=1;e.controller&&(u.$scope=r,u.$modalInstance=h,angular.forEach(e.resolve,(function(e,n){u[n]=t[c++]})),a=s(e.controller,u),e.controllerAs&&(r[e.controllerAs]=a)),o.open(h,{scope:r,deferred:i,renderDeferred:l,content:t[0],animation:e.animation,backdrop:e.backdrop,keyboard:e.keyboard,backdropClass:e.backdropClass,windowClass:e.windowClass,windowTemplateUrl:e.windowTemplateUrl,size:e.size})}),(function(t){i.reject(t)})),f.then((function(){c.resolve(!0)}),(function(t){c.reject(t)})),h}};return c}]};return t})),angular.module("ui.bootstrap.pagination",[]).controller("PaginationController",["$scope","$attrs","$parse",function(t,e,n){var r=this,i={$setViewValue:angular.noop},s=e.numPages?n(e.numPages).assign:angular.noop;this.init=function(o,a){i=o,this.config=a,i.$render=function(){r.render()},e.itemsPerPage?t.$parent.$watch(n(e.itemsPerPage),(function(e){r.itemsPerPage=parseInt(e,10),t.totalPages=r.calculateTotalPages()})):this.itemsPerPage=a.itemsPerPage,t.$watch("totalItems",(function(){t.totalPages=r.calculateTotalPages()})),t.$watch("totalPages",(function(e){s(t.$parent,e),t.page>e?t.selectPage(e):i.$render()}))},this.calculateTotalPages=function(){var e=this.itemsPerPage<1?1:Math.ceil(t.totalItems/this.itemsPerPage);return Math.max(e||0,1)},this.render=function(){t.page=parseInt(i.$viewValue,10)||1},t.selectPage=function(e,n){t.page!==e&&e>0&&e<=t.totalPages&&(n&&n.target&&n.target.blur(),i.$setViewValue(e),i.$render())},t.getText=function(e){return t[e+"Text"]||r.config[e+"Text"]},t.noPrevious=function(){return 1===t.page},t.noNext=function(){return t.page===t.totalPages}}]).constant("paginationConfig",{itemsPerPage:10,boundaryLinks:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0}).directive("pagination",["$parse","paginationConfig",function(t,e){return{restrict:"EA",scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@"},require:["pagination","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pagination.html",replace:!0,link:function(n,r,i,s){function o(t,e,n){return{number:t,text:e,active:n}}var a=s[0],u=s[1];if(u){var c=angular.isDefined(i.maxSize)?n.$parent.$eval(i.maxSize):e.maxSize,l=angular.isDefined(i.rotate)?n.$parent.$eval(i.rotate):e.rotate;n.boundaryLinks=angular.isDefined(i.boundaryLinks)?n.$parent.$eval(i.boundaryLinks):e.boundaryLinks,n.directionLinks=angular.isDefined(i.directionLinks)?n.$parent.$eval(i.directionLinks):e.directionLinks,a.init(u,e),i.maxSize&&n.$parent.$watch(t(i.maxSize),(function(t){c=parseInt(t,10),a.render()}));var h=a.render;a.render=function(){h(),n.page>0&&n.page<=n.totalPages&&(n.pages=function(t,e){var n=[],r=1,i=e,s=angular.isDefined(c)&&e>c;s&&(l?(i=(r=Math.max(t-Math.floor(c/2),1))+c-1)>e&&(r=(i=e)-c+1):(r=(Math.ceil(t/c)-1)*c+1,i=Math.min(r+c-1,e)));for(var a=r;i>=a;a++){var u=o(a,a,a===t);n.push(u)}if(s&&!l){if(r>1){var h=o(r-1,"...",!1);n.unshift(h)}if(e>i){var f=o(i+1,"...",!1);n.push(f)}}return n}(n.page,n.totalPages))}}}}}]).constant("pagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("pager",["pagerConfig",function(t){return{restrict:"EA",scope:{totalItems:"=",previousText:"@",nextText:"@"},require:["pager","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pager.html",replace:!0,link:function(e,n,r,i){var s=i[0],o=i[1];o&&(e.align=angular.isDefined(r.align)?e.$parent.$eval(r.align):t.align,s.init(o,t))}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).provider("$tooltip",(function(){var t={placement:"top",animation:!0,popupDelay:0,useContentExp:!1},e={mouseenter:"mouseleave",click:"click",focus:"blur"},n={};this.options=function(t){angular.extend(n,t)},this.setTriggers=function(t){angular.extend(e,t)},this.$get=["$window","$compile","$timeout","$document","$position","$interpolate",function(r,i,s,o,a,u){return function(r,c,l,h){function f(t){var n=t||h.trigger||l;return{show:n,hide:e[n]||n}}h=angular.extend({},t,n,h);var p=function(t){return t.replace(/[A-Z]/g,(function(t,e){return(e?"-":"")+t.toLowerCase()}))}(r),d=u.startSymbol(),g=u.endSymbol(),m="<div "+p+'-popup title="'+d+"title"+g+'" '+(h.useContentExp?'content-exp="contentExp()" ':'content="'+d+"content"+g+'" ')+'placement="'+d+"placement"+g+'" popup-class="'+d+"popupClass"+g+'" animation="animation" is-open="isOpen"origin-scope="origScope" ></div>';return{restrict:"EA",compile:function(){var t=i(m);return function(e,n,i){function u(){F.isOpen?p():l()}function l(){(!E||e.$eval(i[c+"Enable"]))&&(F.popupClass=i[c+"Class"],function(){var t=i[c+"Placement"];F.placement=angular.isDefined(t)?t:h.placement}(),function(){var t=i[c+"PopupDelay"],e=parseInt(t,10);F.popupDelay=isNaN(e)?h.popupDelay:e}(),F.popupDelay?w||(w=s(d,F.popupDelay,!1)).then((function(t){t()})):d()())}function p(){e.$apply((function(){g()}))}function d(){return w=null,b&&(s.cancel(b),b=null),(h.useContentExp?F.contentExp():F.content)?(v&&m(),y=F.$new(),v=t(y,(function(t){x?o.find("body").append(t):n.after(t)})),y.$watch((function(){s(A,0,!1)})),h.useContentExp&&y.$watch("contentExp()",(function(t){!t&&F.isOpen&&g()})),v.css({top:0,left:0,display:"block"}),F.$digest(),A(),F.isOpen=!0,F.$apply(),A):angular.noop}function g(){F.isOpen=!1,s.cancel(w),w=null,F.animation?b||(b=s(m,500)):m()}function m(){b=null,v&&(v.remove(),v=null),y&&(y.$destroy(),y=null)}var v,y,b,w,x=!!angular.isDefined(h.appendToBody)&&h.appendToBody,S=f(void 0),E=angular.isDefined(i[c+"Enable"]),F=e.$new(!0),A=function(){if(v){var t=a.positionElements(n,v,F.placement,x);t.top+="px",t.left+="px",v.css(t)}};F.origScope=e,F.isOpen=!1,F.contentExp=function(){return e.$eval(i[r])},h.useContentExp||i.$observe(r,(function(t){F.content=t,!t&&F.isOpen&&g()})),i.$observe("disabled",(function(t){t&&F.isOpen&&g()})),i.$observe(c+"Title",(function(t){F.title=t}));var C=function(){n.unbind(S.show,l),n.unbind(S.hide,p)};!function(){var t=i[c+"Trigger"];C(),(S=f(t)).show===S.hide?n.bind(S.show,u):(n.bind(S.show,l),n.bind(S.hide,p))}();var D=e.$eval(i[c+"Animation"]);F.animation=angular.isDefined(D)?!!D:h.animation;var I=e.$eval(i[c+"AppendToBody"]);(x=angular.isDefined(I)?I:x)&&e.$on("$locationChangeSuccess",(function(){F.isOpen&&g()})),e.$on("$destroy",(function(){s.cancel(b),s.cancel(w),C(),m(),F=null}))}}}}}]})).directive("tooltipTemplateTransclude",["$animate","$sce","$compile","$templateRequest",function(t,e,n,r){return{link:function(i,s,o){var a,u,c,l=i.$eval(o.tooltipTemplateTranscludeScope),h=0,f=function(){u&&(u.remove(),u=null),a&&(a.$destroy(),a=null),c&&(t.leave(c).then((function(){u=null})),u=c,c=null)};i.$watch(e.parseAsResourceUrl(o.tooltipTemplateTransclude),(function(e){var o=++h;e?(r(e,!0).then((function(r){if(o===h){var i=l.$new(),u=n(r)(i,(function(e){f(),t.enter(e,s)}));c=u,(a=i).$emit("$includeContentLoaded",e)}}),(function(){o===h&&(f(),i.$emit("$includeContentError",e))})),i.$emit("$includeContentRequested",e)):f()})),i.$on("$destroy",f)}}}]).directive("tooltipClasses",(function(){return{restrict:"A",link:function(t,e,n){t.placement&&e.addClass(t.placement),t.popupClass&&e.addClass(t.popupClass),t.animation()&&e.addClass(n.tooltipAnimationClass)}}})).directive("tooltipPopup",(function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-popup.html"}})).directive("tooltip",["$tooltip",function(t){return t("tooltip","tooltip","mouseenter")}]).directive("tooltipTemplatePopup",(function(){return{restrict:"EA",replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"template/tooltip/tooltip-template-popup.html"}})).directive("tooltipTemplate",["$tooltip",function(t){return t("tooltipTemplate","tooltip","mouseenter",{useContentExp:!0})}]).directive("tooltipHtmlPopup",(function(){return{restrict:"EA",replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-popup.html"}})).directive("tooltipHtml",["$tooltip",function(t){return t("tooltipHtml","tooltip","mouseenter",{useContentExp:!0})}]).directive("tooltipHtmlUnsafePopup",(function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-unsafe-popup.html"}})).value("tooltipHtmlUnsafeSuppressDeprecated",!1).directive("tooltipHtmlUnsafe",["$tooltip","tooltipHtmlUnsafeSuppressDeprecated","$log",function(t,e,n){return e||n.warn("tooltip-html-unsafe is now deprecated. Use tooltip-html or tooltip-template instead."),t("tooltipHtmlUnsafe","tooltip","mouseenter")}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("popoverTemplatePopup",(function(){return{restrict:"EA",replace:!0,scope:{title:"@",contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"template/popover/popover-template.html"}})).directive("popoverTemplate",["$tooltip",function(t){return t("popoverTemplate","popover","click",{useContentExp:!0})}]).directive("popoverPopup",(function(){return{restrict:"EA",replace:!0,scope:{title:"@",content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/popover/popover.html"}})).directive("popover",["$tooltip",function(t){return t("popover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("progressConfig",{animate:!0,max:100}).controller("ProgressController",["$scope","$attrs","progressConfig",function(t,e,n){var r=this,i=angular.isDefined(e.animate)?t.$parent.$eval(e.animate):n.animate;this.bars=[],t.max=angular.isDefined(t.max)?t.max:n.max,this.addBar=function(e,n){i||n.css({transition:"none"}),this.bars.push(e),e.$watch("value",(function(n){e.percent=+(100*n/t.max).toFixed(2)})),e.$on("$destroy",(function(){n=null,r.removeBar(e)}))},this.removeBar=function(t){this.bars.splice(this.bars.indexOf(t),1)}}]).directive("progress",(function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",require:"progress",scope:{},templateUrl:"template/progressbar/progress.html"}})).directive("bar",(function(){return{restrict:"EA",replace:!0,transclude:!0,require:"^progress",scope:{value:"=",max:"=?",type:"@"},templateUrl:"template/progressbar/bar.html",link:function(t,e,n,r){r.addBar(t,e)}}})).directive("progressbar",(function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",scope:{value:"=",max:"=?",type:"@"},templateUrl:"template/progressbar/progressbar.html",link:function(t,e,n,r){r.addBar(t,angular.element(e.children()[0]))}}})),angular.module("ui.bootstrap.rating",[]).constant("ratingConfig",{max:5,stateOn:null,stateOff:null}).controller("RatingController",["$scope","$attrs","ratingConfig",function(t,e,n){var r={$setViewValue:angular.noop};this.init=function(i){(r=i).$render=this.render,r.$formatters.push((function(t){return angular.isNumber(t)&&t<<0!==t&&(t=Math.round(t)),t})),this.stateOn=angular.isDefined(e.stateOn)?t.$parent.$eval(e.stateOn):n.stateOn,this.stateOff=angular.isDefined(e.stateOff)?t.$parent.$eval(e.stateOff):n.stateOff;var s=angular.isDefined(e.ratingStates)?t.$parent.$eval(e.ratingStates):new Array(angular.isDefined(e.max)?t.$parent.$eval(e.max):n.max);t.range=this.buildTemplateObjects(s)},this.buildTemplateObjects=function(t){for(var e=0,n=t.length;n>e;e++)t[e]=angular.extend({index:e},{stateOn:this.stateOn,stateOff:this.stateOff},t[e]);return t},t.rate=function(e){!t.readonly&&e>=0&&e<=t.range.length&&(r.$setViewValue(e),r.$render())},t.enter=function(e){t.readonly||(t.value=e),t.onHover({value:e})},t.reset=function(){t.value=r.$viewValue,t.onLeave()},t.onKeydown=function(e){/(37|38|39|40)/.test(e.which)&&(e.preventDefault(),e.stopPropagation(),t.rate(t.value+(38===e.which||39===e.which?1:-1)))},this.render=function(){t.value=r.$viewValue}}]).directive("rating",(function(){return{restrict:"EA",require:["rating","ngModel"],scope:{readonly:"=?",onHover:"&",onLeave:"&"},controller:"RatingController",templateUrl:"template/rating/rating.html",replace:!0,link:function(t,e,n,r){var i=r[0],s=r[1];i.init(s)}}})),angular.module("ui.bootstrap.tabs",[]).controller("TabsetController",["$scope",function(t){var e,n=this,r=n.tabs=t.tabs=[];n.select=function(t){angular.forEach(r,(function(e){e.active&&e!==t&&(e.active=!1,e.onDeselect())})),t.active=!0,t.onSelect()},n.addTab=function(t){r.push(t),1===r.length&&!1!==t.active?t.active=!0:t.active?n.select(t):t.active=!1},n.removeTab=function(t){var i=r.indexOf(t);if(t.active&&r.length>1&&!e){var s=i==r.length-1?i-1:i+1;n.select(r[s])}r.splice(i,1)},t.$on("$destroy",(function(){e=!0}))}]).directive("tabset",(function(){return{restrict:"EA",transclude:!0,replace:!0,scope:{type:"@"},controller:"TabsetController",templateUrl:"template/tabs/tabset.html",link:function(t,e,n){t.vertical=!!angular.isDefined(n.vertical)&&t.$parent.$eval(n.vertical),t.justified=!!angular.isDefined(n.justified)&&t.$parent.$eval(n.justified)}}})).directive("tab",["$parse","$log",function(t,e){return{require:"^tabset",restrict:"EA",replace:!0,templateUrl:"template/tabs/tab.html",transclude:!0,scope:{active:"=?",heading:"@",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},compile:function(n,r,i){return function(n,r,s,o){n.$watch("active",(function(t){t&&o.select(n)})),n.disabled=!1,s.disable&&n.$parent.$watch(t(s.disable),(function(t){n.disabled=!!t})),s.disabled&&(e.warn('Use of "disabled" attribute has been deprecated, please use "disable"'),n.$parent.$watch(t(s.disabled),(function(t){n.disabled=!!t}))),n.select=function(){n.disabled||(n.active=!0)},o.addTab(n),n.$on("$destroy",(function(){o.removeTab(n)})),n.$transcludeFn=i}}}}]).directive("tabHeadingTransclude",[function(){return{restrict:"A",require:"^tab",link:function(t,e){t.$watch("headingElement",(function(t){t&&(e.html(""),e.append(t))}))}}}]).directive("tabContentTransclude",(function(){return{restrict:"A",require:"^tabset",link:function(t,e,n){var r=t.$eval(n.tabContentTransclude);r.$transcludeFn(r.$parent,(function(t){angular.forEach(t,(function(t){!function(t){return t.tagName&&(t.hasAttribute("tab-heading")||t.hasAttribute("data-tab-heading")||"tab-heading"===t.tagName.toLowerCase()||"data-tab-heading"===t.tagName.toLowerCase())}(t)?e.append(t):r.headingElement=t}))}))}}})),angular.module("ui.bootstrap.timepicker",[]).constant("timepickerConfig",{hourStep:1,minuteStep:1,showMeridian:!0,meridians:null,readonlyInput:!1,mousewheel:!0,arrowkeys:!0}).controller("TimepickerController",["$scope","$attrs","$parse","$log","$locale","timepickerConfig",function(t,e,n,r,i,s){function o(){var e=parseInt(t.hours,10);return(t.showMeridian?e>0&&13>e:e>=0&&24>e)?(t.showMeridian&&(12===e&&(e=0),t.meridian===g[1]&&(e+=12)),e):void 0}function a(){var e=parseInt(t.minutes,10);return e>=0&&60>e?e:void 0}function u(t){return angular.isDefined(t)&&t.toString().length<2?"0"+t:t.toString()}function c(t){l(),d.$setViewValue(new Date(p)),h(t)}function l(){d.$setValidity("time",!0),t.invalidHours=!1,t.invalidMinutes=!1}function h(e){var n=p.getHours(),r=p.getMinutes();t.showMeridian&&(n=0===n||12===n?12:n%12),t.hours="h"===e?n:u(n),"m"!==e&&(t.minutes=u(r)),t.meridian=p.getHours()<12?g[0]:g[1]}function f(t){var e=new Date(p.getTime()+6e4*t);p.setHours(e.getHours(),e.getMinutes()),c()}var p=new Date,d={$setViewValue:angular.noop},g=angular.isDefined(e.meridians)?t.$parent.$eval(e.meridians):s.meridians||i.DATETIME_FORMATS.AMPMS;this.init=function(n,r){(d=n).$render=this.render,d.$formatters.unshift((function(t){return t?new Date(t):null}));var i=r.eq(0),o=r.eq(1);(angular.isDefined(e.mousewheel)?t.$parent.$eval(e.mousewheel):s.mousewheel)&&this.setupMousewheelEvents(i,o),(angular.isDefined(e.arrowkeys)?t.$parent.$eval(e.arrowkeys):s.arrowkeys)&&this.setupArrowkeyEvents(i,o),t.readonlyInput=angular.isDefined(e.readonlyInput)?t.$parent.$eval(e.readonlyInput):s.readonlyInput,this.setupInputEvents(i,o)};var m=s.hourStep;e.hourStep&&t.$parent.$watch(n(e.hourStep),(function(t){m=parseInt(t,10)}));var v=s.minuteStep;e.minuteStep&&t.$parent.$watch(n(e.minuteStep),(function(t){v=parseInt(t,10)})),t.showMeridian=s.showMeridian,e.showMeridian&&t.$parent.$watch(n(e.showMeridian),(function(e){if(t.showMeridian=!!e,d.$error.time){var n=o(),r=a();angular.isDefined(n)&&angular.isDefined(r)&&(p.setHours(n),c())}else h()})),this.setupMousewheelEvents=function(e,n){var r=function(t){t.originalEvent&&(t=t.originalEvent);var e=t.wheelDelta?t.wheelDelta:-t.deltaY;return t.detail||e>0};e.bind("mousewheel wheel",(function(e){t.$apply(r(e)?t.incrementHours():t.decrementHours()),e.preventDefault()})),n.bind("mousewheel wheel",(function(e){t.$apply(r(e)?t.incrementMinutes():t.decrementMinutes()),e.preventDefault()}))},this.setupArrowkeyEvents=function(e,n){e.bind("keydown",(function(e){38===e.which?(e.preventDefault(),t.incrementHours(),t.$apply()):40===e.which&&(e.preventDefault(),t.decrementHours(),t.$apply())})),n.bind("keydown",(function(e){38===e.which?(e.preventDefault(),t.incrementMinutes(),t.$apply()):40===e.which&&(e.preventDefault(),t.decrementMinutes(),t.$apply())}))},this.setupInputEvents=function(e,n){if(t.readonlyInput)return t.updateHours=angular.noop,void(t.updateMinutes=angular.noop);var r=function(e,n){d.$setViewValue(null),d.$setValidity("time",!1),angular.isDefined(e)&&(t.invalidHours=e),angular.isDefined(n)&&(t.invalidMinutes=n)};t.updateHours=function(){var t=o();angular.isDefined(t)?(p.setHours(t),c("h")):r(!0)},e.bind("blur",(function(){!t.invalidHours&&t.hours<10&&t.$apply((function(){t.hours=u(t.hours)}))})),t.updateMinutes=function(){var t=a();angular.isDefined(t)?(p.setMinutes(t),c("m")):r(void 0,!0)},n.bind("blur",(function(){!t.invalidMinutes&&t.minutes<10&&t.$apply((function(){t.minutes=u(t.minutes)}))}))},this.render=function(){var t=d.$viewValue;isNaN(t)?(d.$setValidity("time",!1),r.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(t&&(p=t),l(),h())},t.incrementHours=function(){f(60*m)},t.decrementHours=function(){f(60*-m)},t.incrementMinutes=function(){f(v)},t.decrementMinutes=function(){f(-v)},t.toggleMeridian=function(){f(720*(p.getHours()<12?1:-1))}}]).directive("timepicker",(function(){return{restrict:"EA",require:["timepicker","?^ngModel"],controller:"TimepickerController",replace:!0,scope:{},templateUrl:"template/timepicker/timepicker.html",link:function(t,e,n,r){var i=r[0],s=r[1];s&&i.init(s,e.find("input"))}}})),angular.module("ui.bootstrap.transition",[]).value("$transitionSuppressDeprecated",!1).factory("$transition",["$q","$timeout","$rootScope","$log","$transitionSuppressDeprecated",function(t,e,n,r,i){function s(t){for(var e in t)if(void 0!==a.style[e])return t[e]}i||r.warn("$transition is now deprecated. Use $animate from ngAnimate instead.");var o=function(r,i,s){s=s||{};var a=t.defer(),u=o[s.animation?"animationEndEventName":"transitionEndEventName"],c=function(){n.$apply((function(){r.unbind(u,c),a.resolve(r)}))};return u&&r.bind(u,c),e((function(){angular.isString(i)?r.addClass(i):angular.isFunction(i)?i(r):angular.isObject(i)&&r.css(i),u||a.resolve(r)})),a.promise.cancel=function(){u&&r.unbind(u,c),a.reject("Transition cancelled")},a.promise},a=document.createElement("trans");return o.transitionEndEventName=s({WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}),o.animationEndEventName=s({WebkitTransition:"webkitAnimationEnd",MozTransition:"animationend",OTransition:"oAnimationEnd",transition:"animationend"}),o}]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).factory("typeaheadParser",["$parse",function(t){var e=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(n){var r=n.match(e);if(!r)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+n+'".');return{itemName:r[3],source:t(r[4]),viewMapper:t(r[2]||r[1]),modelMapper:t(r[1])}}}}]).directive("typeahead",["$compile","$parse","$q","$timeout","$document","$position","typeaheadParser",function(t,e,n,r,i,s,o){var a=[9,13,27,38,40];return{require:"ngModel",link:function(u,c,l,h){var f,p=u.$eval(l.typeaheadMinLength)||1,d=u.$eval(l.typeaheadWaitMs)||0,g=!1!==u.$eval(l.typeaheadEditable),m=e(l.typeaheadLoading).assign||angular.noop,v=e(l.typeaheadOnSelect),y=l.typeaheadInputFormatter?e(l.typeaheadInputFormatter):void 0,b=!!l.typeaheadAppendToBody&&u.$eval(l.typeaheadAppendToBody),w=!1!==u.$eval(l.typeaheadFocusFirst),x=e(l.ngModel).assign,S=o.parse(l.typeahead),E=u.$new();u.$on("$destroy",(function(){E.$destroy()}));var F="typeahead-"+E.$id+"-"+Math.floor(1e4*Math.random());c.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":F});var A=angular.element("<div typeahead-popup></div>");A.attr({id:F,matches:"matches",active:"activeIdx",select:"select(activeIdx)",query:"query",position:"position"}),angular.isDefined(l.typeaheadTemplateUrl)&&A.attr("template-url",l.typeaheadTemplateUrl);var C=function(){E.matches=[],E.activeIdx=-1,c.attr("aria-expanded",!1)},D=function(t){return F+"-option-"+t};E.$watch("activeIdx",(function(t){0>t?c.removeAttr("aria-activedescendant"):c.attr("aria-activedescendant",D(t))}));var I=function(t){var e={$viewValue:t};m(u,!0),n.when(S.source(u,e)).then((function(n){var r=t===h.$viewValue;if(r&&f)if(n&&n.length>0){E.activeIdx=w?0:-1,E.matches.length=0;for(var i=0;i<n.length;i++)e[S.itemName]=n[i],E.matches.push({id:D(i),label:S.viewMapper(E,e),model:n[i]});E.query=t,E.position=b?s.offset(c):s.position(c),E.position.top=E.position.top+c.prop("offsetHeight"),c.attr("aria-expanded",!0)}else C();r&&m(u,!1)}),(function(){C(),m(u,!1)}))};C(),E.query=void 0;var $,R=function(){$&&r.cancel($)};h.$parsers.unshift((function(t){return f=!0,t&&t.length>=p?d>0?(R(),function(t){$=r((function(){I(t)}),d)}(t)):I(t):(m(u,!1),R(),C()),g?t:t?void h.$setValidity("editable",!1):(h.$setValidity("editable",!0),t)})),h.$formatters.push((function(t){var e,n={};return g||h.$setValidity("editable",!0),y?(n.$model=t,y(u,n)):(n[S.itemName]=t,e=S.viewMapper(u,n),n[S.itemName]=void 0,e!==S.viewMapper(u,n)?e:t)})),E.select=function(t){var e,n,i={};i[S.itemName]=n=E.matches[t].model,e=S.modelMapper(u,i),x(u,e),h.$setValidity("editable",!0),h.$setValidity("parse",!0),v(u,{$item:n,$model:e,$label:S.viewMapper(u,i)}),C(),r((function(){c[0].focus()}),0,!1)},c.bind("keydown",(function(t){0!==E.matches.length&&-1!==a.indexOf(t.which)&&(-1!=E.activeIdx||13!==t.which&&9!==t.which)&&(t.preventDefault(),40===t.which?(E.activeIdx=(E.activeIdx+1)%E.matches.length,E.$digest()):38===t.which?(E.activeIdx=(E.activeIdx>0?E.activeIdx:E.matches.length)-1,E.$digest()):13===t.which||9===t.which?E.$apply((function(){E.select(E.activeIdx)})):27===t.which&&(t.stopPropagation(),C(),E.$digest()))})),c.bind("blur",(function(){f=!1}));var T=function(t){c[0]!==t.target&&(C(),E.$digest())};i.bind("click",T),u.$on("$destroy",(function(){i.unbind("click",T),b&&_.remove(),A.remove()}));var _=t(A)(E);b?i.find("body").append(_):c.after(_)}}}]).directive("typeaheadPopup",(function(){return{restrict:"EA",scope:{matches:"=",query:"=",active:"=",position:"=",select:"&"},replace:!0,templateUrl:"template/typeahead/typeahead-popup.html",link:function(t,e,n){t.templateUrl=n.templateUrl,t.isOpen=function(){return t.matches.length>0},t.isActive=function(e){return t.active==e},t.selectActive=function(e){t.active=e},t.selectMatch=function(e){t.select({activeIdx:e})}}}})).directive("typeaheadMatch",["$templateRequest","$compile","$parse",function(t,e,n){return{restrict:"EA",scope:{index:"=",match:"=",query:"="},link:function(r,i,s){var o=n(s.templateUrl)(r.$parent)||"template/typeahead/typeahead-match.html";t(o).then((function(t){e(t.trim())(r,(function(t){i.replaceWith(t)}))}))}}}]).filter("typeaheadHighlight",(function(){return function(t,e){return e?(""+t).replace(new RegExp(function(t){return t.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}(e),"gi"),"<strong>$&</strong>"):t}})),angular.module("template/accordion/accordion-group.html",[]).run(["$templateCache",function(t){t.put("template/accordion/accordion-group.html",'<div class="panel panel-default">\n <div class="panel-heading">\n <h4 class="panel-title">\n <a href="javascript:void(0)" tabindex="0" class="accordion-toggle" ng-click="toggleOpen()" accordion-transclude="heading"><span ng-class="{\'text-muted\': isDisabled}">{{heading}}</span></a>\n </h4>\n </div>\n <div class="panel-collapse collapse" collapse="!isOpen">\n\t <div class="panel-body" ng-transclude></div>\n </div>\n</div>\n')}]),angular.module("template/accordion/accordion.html",[]).run(["$templateCache",function(t){t.put("template/accordion/accordion.html",'<div class="panel-group" ng-transclude></div>')}]),angular.module("template/alert/alert.html",[]).run(["$templateCache",function(t){t.put("template/alert/alert.html",'<div class="alert" ng-class="[\'alert-\' + (type || \'warning\'), closeable ? \'alert-dismissable\' : null]" role="alert">\n <button ng-show="closeable" type="button" class="close" ng-click="close()">\n <span aria-hidden="true">×</span>\n <span class="sr-only">Close</span>\n </button>\n <div ng-transclude></div>\n</div>\n')}]),angular.module("template/carousel/carousel.html",[]).run(["$templateCache",function(t){t.put("template/carousel/carousel.html",'<div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel" ng-swipe-right="prev()" ng-swipe-left="next()">\n <ol class="carousel-indicators" ng-show="slides.length > 1">\n <li ng-repeat="slide in slides | orderBy:\'index\' track by $index" ng-class="{active: isActive(slide)}" ng-click="select(slide)"></li>\n </ol>\n <div class="carousel-inner" ng-transclude></div>\n <a class="left carousel-control" ng-click="prev()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-left"></span></a>\n <a class="right carousel-control" ng-click="next()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-right"></span></a>\n</div>\n')}]),angular.module("template/carousel/slide.html",[]).run(["$templateCache",function(t){t.put("template/carousel/slide.html",'<div ng-class="{\n \'active\': active\n }" class="item text-center" ng-transclude></div>\n')}]),angular.module("template/datepicker/datepicker.html",[]).run(["$templateCache",function(t){t.put("template/datepicker/datepicker.html",'<div ng-switch="datepickerMode" role="application" ng-keydown="keydown($event)">\n <daypicker ng-switch-when="day" tabindex="0"></daypicker>\n <monthpicker ng-switch-when="month" tabindex="0"></monthpicker>\n <yearpicker ng-switch-when="year" tabindex="0"></yearpicker>\n</div>')}]),angular.module("template/datepicker/day.html",[]).run(["$templateCache",function(t){t.put("template/datepicker/day.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="{{5 + showWeeks}}"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n <tr>\n <th ng-show="showWeeks" class="text-center"></th>\n <th ng-repeat="label in labels track by $index" class="text-center"><small aria-label="{{label.full}}">{{label.abbr}}</small></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-show="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}" ng-class="dt.customClass">\n <button type="button" style="width:100%;" class="btn btn-default btn-sm" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-muted\': dt.secondary, \'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/datepicker/month.html",[]).run(["$templateCache",function(t){t.put("template/datepicker/month.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/datepicker/popup.html",[]).run(["$templateCache",function(t){t.put("template/datepicker/popup.html",'<ul class="dropdown-menu" ng-style="{display: (isOpen && \'block\') || \'none\', top: position.top+\'px\', left: position.left+\'px\'}" ng-keydown="keydown($event)">\n\t<li ng-transclude></li>\n\t<li ng-if="showButtonBar" style="padding:10px 9px 2px">\n\t\t<span class="btn-group pull-left">\n\t\t\t<button type="button" class="btn btn-sm btn-info" ng-click="select(\'today\')">{{ getText(\'current\') }}</button>\n\t\t\t<button type="button" class="btn btn-sm btn-danger" ng-click="select(null)">{{ getText(\'clear\') }}</button>\n\t\t</span>\n\t\t<button type="button" class="btn btn-sm btn-success pull-right" ng-click="close()">{{ getText(\'close\') }}</button>\n\t</li>\n</ul>\n')}]),angular.module("template/datepicker/year.html",[]).run(["$templateCache",function(t){t.put("template/datepicker/year.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="3"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/modal/backdrop.html",[]).run(["$templateCache",function(t){t.put("template/modal/backdrop.html",'<div class="modal-backdrop"\n modal-animation-class="fade"\n ng-class="{in: animate}"\n ng-style="{\'z-index\': 1040 + (index && 1 || 0) + index*10}"\n></div>\n')}]),angular.module("template/modal/window.html",[]).run(["$templateCache",function(t){t.put("template/modal/window.html",'<div modal-render="{{$isRendered}}" tabindex="-1" role="dialog" class="modal"\n modal-animation-class="fade"\n\tng-class="{in: animate}" ng-style="{\'z-index\': 1050 + index*10, display: \'block\'}" ng-click="close($event)">\n <div class="modal-dialog" ng-class="size ? \'modal-\' + size : \'\'"><div class="modal-content" modal-transclude></div></div>\n</div>\n')}]),angular.module("template/pagination/pager.html",[]).run(["$templateCache",function(t){t.put("template/pagination/pager.html",'<ul class="pager">\n <li ng-class="{disabled: noPrevious(), previous: align}"><a href ng-click="selectPage(page - 1, $event)">{{getText(\'previous\')}}</a></li>\n <li ng-class="{disabled: noNext(), next: align}"><a href ng-click="selectPage(page + 1, $event)">{{getText(\'next\')}}</a></li>\n</ul>')}]),angular.module("template/pagination/pagination.html",[]).run(["$templateCache",function(t){t.put("template/pagination/pagination.html",'<ul class="pagination">\n <li ng-if="boundaryLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(1, $event)">{{getText(\'first\')}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(page - 1, $event)">{{getText(\'previous\')}}</a></li>\n <li ng-repeat="page in pages track by $index" ng-class="{active: page.active}"><a href ng-click="selectPage(page.number, $event)">{{page.text}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(page + 1, $event)">{{getText(\'next\')}}</a></li>\n <li ng-if="boundaryLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(totalPages, $event)">{{getText(\'last\')}}</a></li>\n</ul>')}]),angular.module("template/tooltip/tooltip-html-popup.html",[]).run(["$templateCache",function(t){t.put("template/tooltip/tooltip-html-popup.html",'<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind-html="contentExp()"></div>\n</div>\n')}]),angular.module("template/tooltip/tooltip-html-unsafe-popup.html",[]).run(["$templateCache",function(t){t.put("template/tooltip/tooltip-html-unsafe-popup.html",'<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" bind-html-unsafe="content"></div>\n</div>\n')}]),angular.module("template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function(t){t.put("template/tooltip/tooltip-popup.html",'<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind="content"></div>\n</div>\n')}]),angular.module("template/tooltip/tooltip-template-popup.html",[]).run(["$templateCache",function(t){t.put("template/tooltip/tooltip-template-popup.html",'<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner"\n tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n</div>\n')}]),angular.module("template/popover/popover-template.html",[]).run(["$templateCache",function(t){t.put("template/popover/popover-template.html",'<div class="popover"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-if="title"></h3>\n <div class="popover-content"\n tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n </div>\n</div>\n')}]),angular.module("template/popover/popover-window.html",[]).run(["$templateCache",function(t){t.put("template/popover/popover-window.html",'<div class="popover {{placement}}" ng-class="{ in: isOpen, fade: animation }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-show="title"></h3>\n <div class="popover-content" tooltip-template-transclude></div>\n </div>\n</div>\n')}]),angular.module("template/popover/popover.html",[]).run(["$templateCache",function(t){t.put("template/popover/popover.html",'<div class="popover"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-if="title"></h3>\n <div class="popover-content" ng-bind="content"></div>\n </div>\n</div>\n')}]),angular.module("template/progressbar/bar.html",[]).run(["$templateCache",function(t){t.put("template/progressbar/bar.html",'<div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n')}]),angular.module("template/progressbar/progress.html",[]).run(["$templateCache",function(t){t.put("template/progressbar/progress.html",'<div class="progress" ng-transclude></div>')}]),angular.module("template/progressbar/progressbar.html",[]).run(["$templateCache",function(t){t.put("template/progressbar/progressbar.html",'<div class="progress">\n <div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n</div>\n')}]),angular.module("template/rating/rating.html",[]).run(["$templateCache",function(t){t.put("template/rating/rating.html",'<span ng-mouseleave="reset()" ng-keydown="onKeydown($event)" tabindex="0" role="slider" aria-valuemin="0" aria-valuemax="{{range.length}}" aria-valuenow="{{value}}">\n <i ng-repeat="r in range track by $index" ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" class="glyphicon" ng-class="$index < value && (r.stateOn || \'glyphicon-star\') || (r.stateOff || \'glyphicon-star-empty\')">\n <span class="sr-only">({{ $index < value ? \'*\' : \' \' }})</span>\n </i>\n</span>')}]),angular.module("template/tabs/tab.html",[]).run(["$templateCache",function(t){t.put("template/tabs/tab.html",'<li ng-class="{active: active, disabled: disabled}">\n <a href ng-click="select()" tab-heading-transclude>{{heading}}</a>\n</li>\n')}]),angular.module("template/tabs/tabset.html",[]).run(["$templateCache",function(t){t.put("template/tabs/tabset.html",'<div>\n <ul class="nav nav-{{type || \'tabs\'}}" ng-class="{\'nav-stacked\': vertical, \'nav-justified\': justified}" ng-transclude></ul>\n <div class="tab-content">\n <div class="tab-pane" \n ng-repeat="tab in tabs" \n ng-class="{active: tab.active}"\n tab-content-transclude="tab">\n </div>\n </div>\n</div>\n')}]),angular.module("template/timepicker/timepicker.html",[]).run(["$templateCache",function(t){t.put("template/timepicker/timepicker.html",'<table>\n\t<tbody>\n\t\t<tr class="text-center">\n\t\t\t<td><a ng-click="incrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n\t\t\t<td> </td>\n\t\t\t<td><a ng-click="incrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n\t\t\t<td ng-show="showMeridian"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class="form-group" ng-class="{\'has-error\': invalidHours}">\n\t\t\t\t<input style="width:50px;" type="text" ng-model="hours" ng-change="updateHours()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n\t\t\t</td>\n\t\t\t<td>:</td>\n\t\t\t<td class="form-group" ng-class="{\'has-error\': invalidMinutes}">\n\t\t\t\t<input style="width:50px;" type="text" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n\t\t\t</td>\n\t\t\t<td ng-show="showMeridian"><button type="button" class="btn btn-default text-center" ng-click="toggleMeridian()">{{meridian}}</button></td>\n\t\t</tr>\n\t\t<tr class="text-center">\n\t\t\t<td><a ng-click="decrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n\t\t\t<td> </td>\n\t\t\t<td><a ng-click="decrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n\t\t\t<td ng-show="showMeridian"></td>\n\t\t</tr>\n\t</tbody>\n</table>\n')}]),angular.module("template/typeahead/typeahead-match.html",[]).run(["$templateCache",function(t){t.put("template/typeahead/typeahead-match.html",'<a tabindex="-1" bind-html-unsafe="match.label | typeaheadHighlight:query"></a>')}]),angular.module("template/typeahead/typeahead-popup.html",[]).run(["$templateCache",function(t){t.put("template/typeahead/typeahead-popup.html",'<ul class="dropdown-menu" ng-show="isOpen()" ng-style="{top: position.top+\'px\', left: position.left+\'px\'}" style="display: block;" role="listbox" aria-hidden="{{!isOpen()}}">\n <li ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)" role="option" id="{{match.id}}">\n <div typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>\n </li>\n</ul>\n')}]),!angular.$$csp()&&angular.element(document).find("head").prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>')},function(t,e,n){var r,i,s;s=function(){angular.module("jlareau.bowser",[]).factory("bowser",(function(){
|
|
63
|
+
*/(function(){var s="Expected a function",o="__lodash_placeholder__",a=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],u="[object Arguments]",c="[object Array]",l="[object Boolean]",h="[object Date]",f="[object Error]",p="[object Function]",d="[object GeneratorFunction]",g="[object Map]",m="[object Number]",v="[object Object]",y="[object RegExp]",b="[object Set]",x="[object String]",w="[object Symbol]",S="[object WeakMap]",E="[object ArrayBuffer]",F="[object DataView]",A="[object Float32Array]",C="[object Float64Array]",D="[object Int8Array]",$="[object Int16Array]",I="[object Int32Array]",R="[object Uint8Array]",T="[object Uint16Array]",_="[object Uint32Array]",P=/\b__p \+= '';/g,k=/\b(__p \+=) '' \+/g,O=/(__e\(.*?\)|\b__t\)) \+\n'';/g,j=/&(?:amp|lt|gt|quot|#39);/g,B=/[&<>"']/g,N=RegExp(j.source),L=RegExp(B.source),H=/<%-([\s\S]+?)%>/g,M=/<%([\s\S]+?)%>/g,U=/<%=([\s\S]+?)%>/g,V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q=/^\w*$/,K=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z=/[\\^$.*+?()[\]{}|]/g,G=RegExp(z.source),W=/^\s+/,Y=/\s/,X=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,J=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,Q=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,tt=/[()=,{}\[\]\/\s]/,et=/\\(\\)?/g,nt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rt=/\w*$/,it=/^[-+]0x[0-9a-f]+$/i,st=/^0b[01]+$/i,ot=/^\[object .+?Constructor\]$/,at=/^0o[0-7]+$/i,ut=/^(?:0|[1-9]\d*)$/,ct=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,lt=/($^)/,ht=/['\n\r\u2028\u2029\\]/g,ft="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",pt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",dt="[\\ud800-\\udfff]",gt="["+pt+"]",mt="["+ft+"]",vt="\\d+",yt="[\\u2700-\\u27bf]",bt="[a-z\\xdf-\\xf6\\xf8-\\xff]",xt="[^\\ud800-\\udfff"+pt+vt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",wt="\\ud83c[\\udffb-\\udfff]",St="[^\\ud800-\\udfff]",Et="(?:\\ud83c[\\udde6-\\uddff]){2}",Ft="[\\ud800-\\udbff][\\udc00-\\udfff]",At="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ct="(?:"+bt+"|"+xt+")",Dt="(?:"+At+"|"+xt+")",$t="(?:"+mt+"|"+wt+")"+"?",It="[\\ufe0e\\ufe0f]?"+$t+("(?:\\u200d(?:"+[St,Et,Ft].join("|")+")[\\ufe0e\\ufe0f]?"+$t+")*"),Rt="(?:"+[yt,Et,Ft].join("|")+")"+It,Tt="(?:"+[St+mt+"?",mt,Et,Ft,dt].join("|")+")",_t=RegExp("['’]","g"),Pt=RegExp(mt,"g"),kt=RegExp(wt+"(?="+wt+")|"+Tt+It,"g"),Ot=RegExp([At+"?"+bt+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[gt,At,"$"].join("|")+")",Dt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[gt,At+Ct,"$"].join("|")+")",At+"?"+Ct+"+(?:['’](?:d|ll|m|re|s|t|ve))?",At+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vt,Rt].join("|"),"g"),jt=RegExp("[\\u200d\\ud800-\\udfff"+ft+"\\ufe0e\\ufe0f]"),Bt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Lt=-1,Ht={};Ht[A]=Ht[C]=Ht[D]=Ht[$]=Ht[I]=Ht[R]=Ht["[object Uint8ClampedArray]"]=Ht[T]=Ht[_]=!0,Ht[u]=Ht[c]=Ht[E]=Ht[l]=Ht[F]=Ht[h]=Ht[f]=Ht[p]=Ht[g]=Ht[m]=Ht[v]=Ht[y]=Ht[b]=Ht[x]=Ht[S]=!1;var Mt={};Mt[u]=Mt[c]=Mt[E]=Mt[F]=Mt[l]=Mt[h]=Mt[A]=Mt[C]=Mt[D]=Mt[$]=Mt[I]=Mt[g]=Mt[m]=Mt[v]=Mt[y]=Mt[b]=Mt[x]=Mt[w]=Mt[R]=Mt["[object Uint8ClampedArray]"]=Mt[T]=Mt[_]=!0,Mt[f]=Mt[p]=Mt[S]=!1;var Ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Vt=parseFloat,qt=parseInt,Kt="object"==typeof t&&t&&t.Object===Object&&t,zt="object"==typeof self&&self&&self.Object===Object&&self,Gt=Kt||zt||Function("return this")(),Wt=e&&!e.nodeType&&e,Yt=Wt&&"object"==typeof r&&r&&!r.nodeType&&r,Xt=Yt&&Yt.exports===Wt,Jt=Xt&&Kt.process,Zt=function(){try{var t=Yt&&Yt.require&&Yt.require("util").types;return t||Jt&&Jt.binding&&Jt.binding("util")}catch(t){}}(),Qt=Zt&&Zt.isArrayBuffer,te=Zt&&Zt.isDate,ee=Zt&&Zt.isMap,ne=Zt&&Zt.isRegExp,re=Zt&&Zt.isSet,ie=Zt&&Zt.isTypedArray;function se(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function oe(t,e,n,r){for(var i=-1,s=null==t?0:t.length;++i<s;){var o=t[i];e(r,o,n(o),t)}return r}function ae(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function ue(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function ce(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function le(t,e){for(var n=-1,r=null==t?0:t.length,i=0,s=[];++n<r;){var o=t[n];e(o,n,t)&&(s[i++]=o)}return s}function he(t,e){return!!(null==t?0:t.length)&&we(t,e,0)>-1}function fe(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function pe(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function de(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function ge(t,e,n,r){var i=-1,s=null==t?0:t.length;for(r&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}function me(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function ve(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var ye=Ae("length");function be(t,e,n){var r;return n(t,(function(t,n,i){if(e(t,n,i))return r=n,!1})),r}function xe(t,e,n,r){for(var i=t.length,s=n+(r?1:-1);r?s--:++s<i;)if(e(t[s],s,t))return s;return-1}function we(t,e,n){return e==e?function(t,e,n){var r=n-1,i=t.length;for(;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):xe(t,Ee,n)}function Se(t,e,n,r){for(var i=n-1,s=t.length;++i<s;)if(r(t[i],e))return i;return-1}function Ee(t){return t!=t}function Fe(t,e){var n=null==t?0:t.length;return n?$e(t,e)/n:NaN}function Ae(t){return function(e){return null==e?void 0:e[t]}}function Ce(t){return function(e){return null==t?void 0:t[e]}}function De(t,e,n,r,i){return i(t,(function(t,i,s){n=r?(r=!1,t):e(n,t,i,s)})),n}function $e(t,e){for(var n,r=-1,i=t.length;++r<i;){var s=e(t[r]);void 0!==s&&(n=void 0===n?s:n+s)}return n}function Ie(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function Re(t){return t?t.slice(0,We(t)+1).replace(W,""):t}function Te(t){return function(e){return t(e)}}function _e(t,e){return pe(e,(function(e){return t[e]}))}function Pe(t,e){return t.has(e)}function ke(t,e){for(var n=-1,r=t.length;++n<r&&we(e,t[n],0)>-1;);return n}function Oe(t,e){for(var n=t.length;n--&&we(e,t[n],0)>-1;);return n}function je(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var Be=Ce({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Ne=Ce({"&":"&","<":"<",">":">",'"':""","'":"'"});function Le(t){return"\\"+Ut[t]}function He(t){return jt.test(t)}function Me(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function Ue(t,e){return function(n){return t(e(n))}}function Ve(t,e){for(var n=-1,r=t.length,i=0,s=[];++n<r;){var a=t[n];a!==e&&a!==o||(t[n]=o,s[i++]=n)}return s}function qe(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}function Ke(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=[t,t]})),n}function ze(t){return He(t)?function(t){var e=kt.lastIndex=0;for(;kt.test(t);)++e;return e}(t):ye(t)}function Ge(t){return He(t)?function(t){return t.match(kt)||[]}(t):function(t){return t.split("")}(t)}function We(t){for(var e=t.length;e--&&Y.test(t.charAt(e)););return e}var Ye=Ce({"&":"&","<":"<",">":">",""":'"',"'":"'"});var Xe=function t(e){var n,r=(e=null==e?Gt:Xe.defaults(Gt.Object(),e,Xe.pick(Gt,Nt))).Array,i=e.Date,Y=e.Error,ft=e.Function,pt=e.Math,dt=e.Object,gt=e.RegExp,mt=e.String,vt=e.TypeError,yt=r.prototype,bt=ft.prototype,xt=dt.prototype,wt=e["__core-js_shared__"],St=bt.toString,Et=xt.hasOwnProperty,Ft=0,At=(n=/[^.]+$/.exec(wt&&wt.keys&&wt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Ct=xt.toString,Dt=St.call(dt),$t=Gt._,It=gt("^"+St.call(Et).replace(z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Rt=Xt?e.Buffer:void 0,Tt=e.Symbol,kt=e.Uint8Array,jt=Rt?Rt.allocUnsafe:void 0,Ut=Ue(dt.getPrototypeOf,dt),Kt=dt.create,zt=xt.propertyIsEnumerable,Wt=yt.splice,Yt=Tt?Tt.isConcatSpreadable:void 0,Jt=Tt?Tt.iterator:void 0,Zt=Tt?Tt.toStringTag:void 0,ye=function(){try{var t=ts(dt,"defineProperty");return t({},"",{}),t}catch(t){}}(),Ce=e.clearTimeout!==Gt.clearTimeout&&e.clearTimeout,Je=i&&i.now!==Gt.Date.now&&i.now,Ze=e.setTimeout!==Gt.setTimeout&&e.setTimeout,Qe=pt.ceil,tn=pt.floor,en=dt.getOwnPropertySymbols,nn=Rt?Rt.isBuffer:void 0,rn=e.isFinite,sn=yt.join,on=Ue(dt.keys,dt),an=pt.max,un=pt.min,cn=i.now,ln=e.parseInt,hn=pt.random,fn=yt.reverse,pn=ts(e,"DataView"),dn=ts(e,"Map"),gn=ts(e,"Promise"),mn=ts(e,"Set"),vn=ts(e,"WeakMap"),yn=ts(dt,"create"),bn=vn&&new vn,xn={},wn=Ds(pn),Sn=Ds(dn),En=Ds(gn),Fn=Ds(mn),An=Ds(vn),Cn=Tt?Tt.prototype:void 0,Dn=Cn?Cn.valueOf:void 0,$n=Cn?Cn.toString:void 0;function In(t){if(Ko(t)&&!ko(t)&&!(t instanceof Pn)){if(t instanceof _n)return t;if(Et.call(t,"__wrapped__"))return $s(t)}return new _n(t)}var Rn=function(){function t(){}return function(e){if(!qo(e))return{};if(Kt)return Kt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Tn(){}function _n(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function Pn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function kn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function On(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function jn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Bn(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new jn;++e<n;)this.add(t[e])}function Nn(t){var e=this.__data__=new On(t);this.size=e.size}function Ln(t,e){var n=ko(t),r=!n&&Po(t),i=!n&&!r&&No(t),s=!n&&!r&&!i&&Qo(t),o=n||r||i||s,a=o?Ie(t.length,mt):[],u=a.length;for(var c in t)!e&&!Et.call(t,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||as(c,u))||a.push(c);return a}function Hn(t){var e=t.length;return e?t[Br(0,e-1)]:void 0}function Mn(t,e){return Fs(yi(t),Xn(e,0,t.length))}function Un(t){return Fs(yi(t))}function Vn(t,e,n){(void 0!==n&&!Ro(t[e],n)||void 0===n&&!(e in t))&&Wn(t,e,n)}function qn(t,e,n){var r=t[e];Et.call(t,e)&&Ro(r,n)&&(void 0!==n||e in t)||Wn(t,e,n)}function Kn(t,e){for(var n=t.length;n--;)if(Ro(t[n][0],e))return n;return-1}function zn(t,e,n,r){return er(t,(function(t,i,s){e(r,t,n(t),s)})),r}function Gn(t,e){return t&&bi(e,wa(e),t)}function Wn(t,e,n){"__proto__"==e&&ye?ye(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Yn(t,e){for(var n=-1,i=e.length,s=r(i),o=null==t;++n<i;)s[n]=o?void 0:ma(t,e[n]);return s}function Xn(t,e,n){return t==t&&(void 0!==n&&(t=t<=n?t:n),void 0!==e&&(t=t>=e?t:e)),t}function Jn(t,e,n,r,i,s){var o,a=1&e,c=2&e,f=4&e;if(n&&(o=i?n(t,r,i,s):n(t)),void 0!==o)return o;if(!qo(t))return t;var S=ko(t);if(S){if(o=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&Et.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!a)return yi(t,o)}else{var P=rs(t),k=P==p||P==d;if(No(t))return fi(t,a);if(P==v||P==u||k&&!i){if(o=c||k?{}:ss(t),!a)return c?function(t,e){return bi(t,ns(t),e)}(t,function(t,e){return t&&bi(e,Sa(e),t)}(o,t)):function(t,e){return bi(t,es(t),e)}(t,Gn(o,t))}else{if(!Mt[P])return i?t:{};o=function(t,e,n){var r=t.constructor;switch(e){case E:return pi(t);case l:case h:return new r(+t);case F:return function(t,e){var n=e?pi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case A:case C:case D:case $:case I:case R:case"[object Uint8ClampedArray]":case T:case _:return di(t,n);case g:return new r;case m:case x:return new r(t);case y:return function(t){var e=new t.constructor(t.source,rt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case b:return new r;case w:return i=t,Dn?dt(Dn.call(i)):{}}var i}(t,P,a)}}s||(s=new Nn);var O=s.get(t);if(O)return O;s.set(t,o),Xo(t)?t.forEach((function(r){o.add(Jn(r,e,n,r,t,s))})):zo(t)&&t.forEach((function(r,i){o.set(i,Jn(r,e,n,i,t,s))}));var j=S?void 0:(f?c?Gi:zi:c?Sa:wa)(t);return ae(j||t,(function(r,i){j&&(r=t[i=r]),qn(o,i,Jn(r,e,n,i,t,s))})),o}function Zn(t,e,n){var r=n.length;if(null==t)return!r;for(t=dt(t);r--;){var i=n[r],s=e[i],o=t[i];if(void 0===o&&!(i in t)||!s(o))return!1}return!0}function Qn(t,e,n){if("function"!=typeof t)throw new vt(s);return xs((function(){t.apply(void 0,n)}),e)}function tr(t,e,n,r){var i=-1,s=he,o=!0,a=t.length,u=[],c=e.length;if(!a)return u;n&&(e=pe(e,Te(n))),r?(s=fe,o=!1):e.length>=200&&(s=Pe,o=!1,e=new Bn(e));t:for(;++i<a;){var l=t[i],h=null==n?l:n(l);if(l=r||0!==l?l:0,o&&h==h){for(var f=c;f--;)if(e[f]===h)continue t;u.push(l)}else s(e,h,r)||u.push(l)}return u}In.templateSettings={escape:H,evaluate:M,interpolate:U,variable:"",imports:{_:In}},In.prototype=Tn.prototype,In.prototype.constructor=In,_n.prototype=Rn(Tn.prototype),_n.prototype.constructor=_n,Pn.prototype=Rn(Tn.prototype),Pn.prototype.constructor=Pn,kn.prototype.clear=function(){this.__data__=yn?yn(null):{},this.size=0},kn.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},kn.prototype.get=function(t){var e=this.__data__;if(yn){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return Et.call(e,t)?e[t]:void 0},kn.prototype.has=function(t){var e=this.__data__;return yn?void 0!==e[t]:Et.call(e,t)},kn.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=yn&&void 0===e?"__lodash_hash_undefined__":e,this},On.prototype.clear=function(){this.__data__=[],this.size=0},On.prototype.delete=function(t){var e=this.__data__,n=Kn(e,t);return!(n<0)&&(n==e.length-1?e.pop():Wt.call(e,n,1),--this.size,!0)},On.prototype.get=function(t){var e=this.__data__,n=Kn(e,t);return n<0?void 0:e[n][1]},On.prototype.has=function(t){return Kn(this.__data__,t)>-1},On.prototype.set=function(t,e){var n=this.__data__,r=Kn(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},jn.prototype.clear=function(){this.size=0,this.__data__={hash:new kn,map:new(dn||On),string:new kn}},jn.prototype.delete=function(t){var e=Zi(this,t).delete(t);return this.size-=e?1:0,e},jn.prototype.get=function(t){return Zi(this,t).get(t)},jn.prototype.has=function(t){return Zi(this,t).has(t)},jn.prototype.set=function(t,e){var n=Zi(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Bn.prototype.add=Bn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Bn.prototype.has=function(t){return this.__data__.has(t)},Nn.prototype.clear=function(){this.__data__=new On,this.size=0},Nn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Nn.prototype.get=function(t){return this.__data__.get(t)},Nn.prototype.has=function(t){return this.__data__.has(t)},Nn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof On){var r=n.__data__;if(!dn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new jn(r)}return n.set(t,e),this.size=n.size,this};var er=Si(cr),nr=Si(lr,!0);function rr(t,e){var n=!0;return er(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function ir(t,e,n){for(var r=-1,i=t.length;++r<i;){var s=t[r],o=e(s);if(null!=o&&(void 0===a?o==o&&!Zo(o):n(o,a)))var a=o,u=s}return u}function sr(t,e){var n=[];return er(t,(function(t,r,i){e(t,r,i)&&n.push(t)})),n}function or(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=os),i||(i=[]);++s<o;){var a=t[s];e>0&&n(a)?e>1?or(a,e-1,n,r,i):de(i,a):r||(i[i.length]=a)}return i}var ar=Ei(),ur=Ei(!0);function cr(t,e){return t&&ar(t,e,wa)}function lr(t,e){return t&&ur(t,e,wa)}function hr(t,e){return le(e,(function(e){return Mo(t[e])}))}function fr(t,e){for(var n=0,r=(e=ui(e,t)).length;null!=t&&n<r;)t=t[Cs(e[n++])];return n&&n==r?t:void 0}function pr(t,e,n){var r=e(t);return ko(t)?r:de(r,n(t))}function dr(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Zt&&Zt in dt(t)?function(t){var e=Et.call(t,Zt),n=t[Zt];try{t[Zt]=void 0;var r=!0}catch(t){}var i=Ct.call(t);r&&(e?t[Zt]=n:delete t[Zt]);return i}(t):function(t){return Ct.call(t)}(t)}function gr(t,e){return t>e}function mr(t,e){return null!=t&&Et.call(t,e)}function vr(t,e){return null!=t&&e in dt(t)}function yr(t,e,n){for(var i=n?fe:he,s=t[0].length,o=t.length,a=o,u=r(o),c=1/0,l=[];a--;){var h=t[a];a&&e&&(h=pe(h,Te(e))),c=un(h.length,c),u[a]=!n&&(e||s>=120&&h.length>=120)?new Bn(a&&h):void 0}h=t[0];var f=-1,p=u[0];t:for(;++f<s&&l.length<c;){var d=h[f],g=e?e(d):d;if(d=n||0!==d?d:0,!(p?Pe(p,g):i(l,g,n))){for(a=o;--a;){var m=u[a];if(!(m?Pe(m,g):i(t[a],g,n)))continue t}p&&p.push(g),l.push(d)}}return l}function br(t,e,n){var r=null==(t=ms(t,e=ui(e,t)))?t:t[Cs(Ls(e))];return null==r?void 0:se(r,t,n)}function xr(t){return Ko(t)&&dr(t)==u}function wr(t,e,n,r,i){return t===e||(null==t||null==e||!Ko(t)&&!Ko(e)?t!=t&&e!=e:function(t,e,n,r,i,s){var o=ko(t),a=ko(e),p=o?c:rs(t),d=a?c:rs(e),S=(p=p==u?v:p)==v,A=(d=d==u?v:d)==v,C=p==d;if(C&&No(t)){if(!No(e))return!1;o=!0,S=!1}if(C&&!S)return s||(s=new Nn),o||Qo(t)?qi(t,e,n,r,i,s):function(t,e,n,r,i,s,o){switch(n){case F:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case E:return!(t.byteLength!=e.byteLength||!s(new kt(t),new kt(e)));case l:case h:case m:return Ro(+t,+e);case f:return t.name==e.name&&t.message==e.message;case y:case x:return t==e+"";case g:var a=Me;case b:var u=1&r;if(a||(a=qe),t.size!=e.size&&!u)return!1;var c=o.get(t);if(c)return c==e;r|=2,o.set(t,e);var p=qi(a(t),a(e),r,i,s,o);return o.delete(t),p;case w:if(Dn)return Dn.call(t)==Dn.call(e)}return!1}(t,e,p,n,r,i,s);if(!(1&n)){var D=S&&Et.call(t,"__wrapped__"),$=A&&Et.call(e,"__wrapped__");if(D||$){var I=D?t.value():t,R=$?e.value():e;return s||(s=new Nn),i(I,R,n,r,s)}}if(!C)return!1;return s||(s=new Nn),function(t,e,n,r,i,s){var o=1&n,a=zi(t),u=a.length,c=zi(e).length;if(u!=c&&!o)return!1;var l=u;for(;l--;){var h=a[l];if(!(o?h in e:Et.call(e,h)))return!1}var f=s.get(t),p=s.get(e);if(f&&p)return f==e&&p==t;var d=!0;s.set(t,e),s.set(e,t);var g=o;for(;++l<u;){h=a[l];var m=t[h],v=e[h];if(r)var y=o?r(v,m,h,e,t,s):r(m,v,h,t,e,s);if(!(void 0===y?m===v||i(m,v,n,r,s):y)){d=!1;break}g||(g="constructor"==h)}if(d&&!g){var b=t.constructor,x=e.constructor;b==x||!("constructor"in t)||!("constructor"in e)||"function"==typeof b&&b instanceof b&&"function"==typeof x&&x instanceof x||(d=!1)}return s.delete(t),s.delete(e),d}(t,e,n,r,i,s)}(t,e,n,r,wr,i))}function Sr(t,e,n,r){var i=n.length,s=i,o=!r;if(null==t)return!s;for(t=dt(t);i--;){var a=n[i];if(o&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<s;){var u=(a=n[i])[0],c=t[u],l=a[1];if(o&&a[2]){if(void 0===c&&!(u in t))return!1}else{var h=new Nn;if(r)var f=r(c,l,u,t,e,h);if(!(void 0===f?wr(l,c,3,r,h):f))return!1}}return!0}function Er(t){return!(!qo(t)||(e=t,At&&At in e))&&(Mo(t)?It:ot).test(Ds(t));var e}function Fr(t){return"function"==typeof t?t:null==t?Ga:"object"==typeof t?ko(t)?Rr(t[0],t[1]):Ir(t):nu(t)}function Ar(t){if(!fs(t))return on(t);var e=[];for(var n in dt(t))Et.call(t,n)&&"constructor"!=n&&e.push(n);return e}function Cr(t){if(!qo(t))return function(t){var e=[];if(null!=t)for(var n in dt(t))e.push(n);return e}(t);var e=fs(t),n=[];for(var r in t)("constructor"!=r||!e&&Et.call(t,r))&&n.push(r);return n}function Dr(t,e){return t<e}function $r(t,e){var n=-1,i=jo(t)?r(t.length):[];return er(t,(function(t,r,s){i[++n]=e(t,r,s)})),i}function Ir(t){var e=Qi(t);return 1==e.length&&e[0][2]?ds(e[0][0],e[0][1]):function(n){return n===t||Sr(n,t,e)}}function Rr(t,e){return cs(t)&&ps(e)?ds(Cs(t),e):function(n){var r=ma(n,t);return void 0===r&&r===e?va(n,t):wr(e,r,3)}}function Tr(t,e,n,r,i){t!==e&&ar(e,(function(s,o){if(i||(i=new Nn),qo(s))!function(t,e,n,r,i,s,o){var a=ys(t,n),u=ys(e,n),c=o.get(u);if(c)return void Vn(t,n,c);var l=s?s(a,u,n+"",t,e,o):void 0,h=void 0===l;if(h){var f=ko(u),p=!f&&No(u),d=!f&&!p&&Qo(u);l=u,f||p||d?ko(a)?l=a:Bo(a)?l=yi(a):p?(h=!1,l=fi(u,!0)):d?(h=!1,l=di(u,!0)):l=[]:Wo(u)||Po(u)?(l=a,Po(a)?l=aa(a):qo(a)&&!Mo(a)||(l=ss(u))):h=!1}h&&(o.set(u,l),i(l,u,r,s,o),o.delete(u));Vn(t,n,l)}(t,e,o,n,Tr,r,i);else{var a=r?r(ys(t,o),s,o+"",t,e,i):void 0;void 0===a&&(a=s),Vn(t,o,a)}}),Sa)}function _r(t,e){var n=t.length;if(n)return as(e+=e<0?n:0,n)?t[e]:void 0}function Pr(t,e,n){e=e.length?pe(e,(function(t){return ko(t)?function(e){return fr(e,1===t.length?t[0]:t)}:t})):[Ga];var r=-1;return e=pe(e,Te(Ji())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}($r(t,(function(t,n,i){return{criteria:pe(e,(function(e){return e(t)})),index:++r,value:t}})),(function(t,e){return function(t,e,n){var r=-1,i=t.criteria,s=e.criteria,o=i.length,a=n.length;for(;++r<o;){var u=gi(i[r],s[r]);if(u){if(r>=a)return u;var c=n[r];return u*("desc"==c?-1:1)}}return t.index-e.index}(t,e,n)}))}function kr(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=fr(t,o);n(a,o)&&Ur(s,ui(o,t),a)}return s}function Or(t,e,n,r){var i=r?Se:we,s=-1,o=e.length,a=t;for(t===e&&(e=yi(e)),n&&(a=pe(t,Te(n)));++s<o;)for(var u=0,c=e[s],l=n?n(c):c;(u=i(a,l,u,r))>-1;)a!==t&&Wt.call(a,u,1),Wt.call(t,u,1);return t}function jr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==s){var s=i;as(i)?Wt.call(t,i,1):ti(t,i)}}return t}function Br(t,e){return t+tn(hn()*(e-t+1))}function Nr(t,e){var n="";if(!t||e<1||e>9007199254740991)return n;do{e%2&&(n+=t),(e=tn(e/2))&&(t+=t)}while(e);return n}function Lr(t,e){return ws(gs(t,e,Ga),t+"")}function Hr(t){return Hn(Ra(t))}function Mr(t,e){var n=Ra(t);return Fs(n,Xn(e,0,n.length))}function Ur(t,e,n,r){if(!qo(t))return t;for(var i=-1,s=(e=ui(e,t)).length,o=s-1,a=t;null!=a&&++i<s;){var u=Cs(e[i]),c=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return t;if(i!=o){var l=a[u];void 0===(c=r?r(l,u,a):void 0)&&(c=qo(l)?l:as(e[i+1])?[]:{})}qn(a,u,c),a=a[u]}return t}var Vr=bn?function(t,e){return bn.set(t,e),t}:Ga,qr=ye?function(t,e){return ye(t,"toString",{configurable:!0,enumerable:!1,value:qa(e),writable:!0})}:Ga;function Kr(t){return Fs(Ra(t))}function zr(t,e,n){var i=-1,s=t.length;e<0&&(e=-e>s?0:s+e),(n=n>s?s:n)<0&&(n+=s),s=e>n?0:n-e>>>0,e>>>=0;for(var o=r(s);++i<s;)o[i]=t[i+e];return o}function Gr(t,e){var n;return er(t,(function(t,r,i){return!(n=e(t,r,i))})),!!n}function Wr(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=2147483647){for(;r<i;){var s=r+i>>>1,o=t[s];null!==o&&!Zo(o)&&(n?o<=e:o<e)?r=s+1:i=s}return i}return Yr(t,e,Ga,n)}function Yr(t,e,n,r){var i=0,s=null==t?0:t.length;if(0===s)return 0;for(var o=(e=n(e))!=e,a=null===e,u=Zo(e),c=void 0===e;i<s;){var l=tn((i+s)/2),h=n(t[l]),f=void 0!==h,p=null===h,d=h==h,g=Zo(h);if(o)var m=r||d;else m=c?d&&(r||f):a?d&&f&&(r||!p):u?d&&f&&!p&&(r||!g):!p&&!g&&(r?h<=e:h<e);m?i=l+1:s=l}return un(s,4294967294)}function Xr(t,e){for(var n=-1,r=t.length,i=0,s=[];++n<r;){var o=t[n],a=e?e(o):o;if(!n||!Ro(a,u)){var u=a;s[i++]=0===o?0:o}}return s}function Jr(t){return"number"==typeof t?t:Zo(t)?NaN:+t}function Zr(t){if("string"==typeof t)return t;if(ko(t))return pe(t,Zr)+"";if(Zo(t))return $n?$n.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Qr(t,e,n){var r=-1,i=he,s=t.length,o=!0,a=[],u=a;if(n)o=!1,i=fe;else if(s>=200){var c=e?null:Ni(t);if(c)return qe(c);o=!1,i=Pe,u=new Bn}else u=e?[]:a;t:for(;++r<s;){var l=t[r],h=e?e(l):l;if(l=n||0!==l?l:0,o&&h==h){for(var f=u.length;f--;)if(u[f]===h)continue t;e&&u.push(h),a.push(l)}else i(u,h,n)||(u!==a&&u.push(h),a.push(l))}return a}function ti(t,e){return null==(t=ms(t,e=ui(e,t)))||delete t[Cs(Ls(e))]}function ei(t,e,n,r){return Ur(t,e,n(fr(t,e)),r)}function ni(t,e,n,r){for(var i=t.length,s=r?i:-1;(r?s--:++s<i)&&e(t[s],s,t););return n?zr(t,r?0:s,r?s+1:i):zr(t,r?s+1:0,r?i:s)}function ri(t,e){var n=t;return n instanceof Pn&&(n=n.value()),ge(e,(function(t,e){return e.func.apply(e.thisArg,de([t],e.args))}),n)}function ii(t,e,n){var i=t.length;if(i<2)return i?Qr(t[0]):[];for(var s=-1,o=r(i);++s<i;)for(var a=t[s],u=-1;++u<i;)u!=s&&(o[s]=tr(o[s]||a,t[u],e,n));return Qr(or(o,1),e,n)}function si(t,e,n){for(var r=-1,i=t.length,s=e.length,o={};++r<i;){var a=r<s?e[r]:void 0;n(o,t[r],a)}return o}function oi(t){return Bo(t)?t:[]}function ai(t){return"function"==typeof t?t:Ga}function ui(t,e){return ko(t)?t:cs(t,e)?[t]:As(ua(t))}var ci=Lr;function li(t,e,n){var r=t.length;return n=void 0===n?r:n,!e&&n>=r?t:zr(t,e,n)}var hi=Ce||function(t){return Gt.clearTimeout(t)};function fi(t,e){if(e)return t.slice();var n=t.length,r=jt?jt(n):new t.constructor(n);return t.copy(r),r}function pi(t){var e=new t.constructor(t.byteLength);return new kt(e).set(new kt(t)),e}function di(t,e){var n=e?pi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function gi(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,s=Zo(t),o=void 0!==e,a=null===e,u=e==e,c=Zo(e);if(!a&&!c&&!s&&t>e||s&&o&&u&&!a&&!c||r&&o&&u||!n&&u||!i)return 1;if(!r&&!s&&!c&&t<e||c&&n&&i&&!r&&!s||a&&n&&i||!o&&i||!u)return-1}return 0}function mi(t,e,n,i){for(var s=-1,o=t.length,a=n.length,u=-1,c=e.length,l=an(o-a,0),h=r(c+l),f=!i;++u<c;)h[u]=e[u];for(;++s<a;)(f||s<o)&&(h[n[s]]=t[s]);for(;l--;)h[u++]=t[s++];return h}function vi(t,e,n,i){for(var s=-1,o=t.length,a=-1,u=n.length,c=-1,l=e.length,h=an(o-u,0),f=r(h+l),p=!i;++s<h;)f[s]=t[s];for(var d=s;++c<l;)f[d+c]=e[c];for(;++a<u;)(p||s<o)&&(f[d+n[a]]=t[s++]);return f}function yi(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function bi(t,e,n,r){var i=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var a=e[s],u=r?r(n[a],t[a],a,n,t):void 0;void 0===u&&(u=t[a]),i?Wn(n,a,u):qn(n,a,u)}return n}function xi(t,e){return function(n,r){var i=ko(n)?oe:zn,s=e?e():{};return i(n,t,Ji(r,2),s)}}function wi(t){return Lr((function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(s=t.length>3&&"function"==typeof s?(i--,s):void 0,o&&us(n[0],n[1],o)&&(s=i<3?void 0:s,i=1),e=dt(e);++r<i;){var a=n[r];a&&t(e,a,r,s)}return e}))}function Si(t,e){return function(n,r){if(null==n)return n;if(!jo(n))return t(n,r);for(var i=n.length,s=e?i:-1,o=dt(n);(e?s--:++s<i)&&!1!==r(o[s],s,o););return n}}function Ei(t){return function(e,n,r){for(var i=-1,s=dt(e),o=r(e),a=o.length;a--;){var u=o[t?a:++i];if(!1===n(s[u],u,s))break}return e}}function Fi(t){return function(e){var n=He(e=ua(e))?Ge(e):void 0,r=n?n[0]:e.charAt(0),i=n?li(n,1).join(""):e.slice(1);return r[t]()+i}}function Ai(t){return function(e){return ge(Ma(Pa(e).replace(_t,"")),t,"")}}function Ci(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=Rn(t.prototype),r=t.apply(n,e);return qo(r)?r:n}}function Di(t){return function(e,n,r){var i=dt(e);if(!jo(e)){var s=Ji(n,3);e=wa(e),n=function(t){return s(i[t],t,i)}}var o=t(e,n,r);return o>-1?i[s?e[o]:o]:void 0}}function $i(t){return Ki((function(e){var n=e.length,r=n,i=_n.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if("function"!=typeof o)throw new vt(s);if(i&&!a&&"wrapper"==Yi(o))var a=new _n([],!0)}for(r=a?r:n;++r<n;){var u=Yi(o=e[r]),c="wrapper"==u?Wi(o):void 0;a=c&&ls(c[0])&&424==c[1]&&!c[4].length&&1==c[9]?a[Yi(c[0])].apply(a,c[3]):1==o.length&&ls(o)?a[u]():a.thru(o)}return function(){var t=arguments,r=t[0];if(a&&1==t.length&&ko(r))return a.plant(r).value();for(var i=0,s=n?e[i].apply(this,t):r;++i<n;)s=e[i].call(this,s);return s}}))}function Ii(t,e,n,i,s,o,a,u,c,l){var h=128&e,f=1&e,p=2&e,d=24&e,g=512&e,m=p?void 0:Ci(t);return function v(){for(var y=arguments.length,b=r(y),x=y;x--;)b[x]=arguments[x];if(d)var w=Xi(v),S=je(b,w);if(i&&(b=mi(b,i,s,d)),o&&(b=vi(b,o,a,d)),y-=S,d&&y<l){var E=Ve(b,w);return ji(t,e,Ii,v.placeholder,n,b,E,u,c,l-y)}var F=f?n:this,A=p?F[t]:t;return y=b.length,u?b=vs(b,u):g&&y>1&&b.reverse(),h&&c<y&&(b.length=c),this&&this!==Gt&&this instanceof v&&(A=m||Ci(A)),A.apply(F,b)}}function Ri(t,e){return function(n,r){return function(t,e,n,r){return cr(t,(function(t,i,s){e(r,n(t),i,s)})),r}(n,t,e(r),{})}}function Ti(t,e){return function(n,r){var i;if(void 0===n&&void 0===r)return e;if(void 0!==n&&(i=n),void 0!==r){if(void 0===i)return r;"string"==typeof n||"string"==typeof r?(n=Zr(n),r=Zr(r)):(n=Jr(n),r=Jr(r)),i=t(n,r)}return i}}function _i(t){return Ki((function(e){return e=pe(e,Te(Ji())),Lr((function(n){var r=this;return t(e,(function(t){return se(t,r,n)}))}))}))}function Pi(t,e){var n=(e=void 0===e?" ":Zr(e)).length;if(n<2)return n?Nr(e,t):e;var r=Nr(e,Qe(t/ze(e)));return He(e)?li(Ge(r),0,t).join(""):r.slice(0,t)}function ki(t){return function(e,n,i){return i&&"number"!=typeof i&&us(e,n,i)&&(n=i=void 0),e=ra(e),void 0===n?(n=e,e=0):n=ra(n),function(t,e,n,i){for(var s=-1,o=an(Qe((e-t)/(n||1)),0),a=r(o);o--;)a[i?o:++s]=t,t+=n;return a}(e,n,i=void 0===i?e<n?1:-1:ra(i),t)}}function Oi(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=oa(e),n=oa(n)),t(e,n)}}function ji(t,e,n,r,i,s,o,a,u,c){var l=8&e;e|=l?32:64,4&(e&=~(l?64:32))||(e&=-4);var h=[t,e,i,l?s:void 0,l?o:void 0,l?void 0:s,l?void 0:o,a,u,c],f=n.apply(void 0,h);return ls(t)&&bs(f,h),f.placeholder=r,Ss(f,t,e)}function Bi(t){var e=pt[t];return function(t,n){if(t=oa(t),(n=null==n?0:un(ia(n),292))&&rn(t)){var r=(ua(t)+"e").split("e");return+((r=(ua(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var Ni=mn&&1/qe(new mn([,-0]))[1]==1/0?function(t){return new mn(t)}:Za;function Li(t){return function(e){var n=rs(e);return n==g?Me(e):n==b?Ke(e):function(t,e){return pe(e,(function(e){return[e,t[e]]}))}(e,t(e))}}function Hi(t,e,n,i,a,u,c,l){var h=2&e;if(!h&&"function"!=typeof t)throw new vt(s);var f=i?i.length:0;if(f||(e&=-97,i=a=void 0),c=void 0===c?c:an(ia(c),0),l=void 0===l?l:ia(l),f-=a?a.length:0,64&e){var p=i,d=a;i=a=void 0}var g=h?void 0:Wi(t),m=[t,e,n,i,a,p,d,u,c,l];if(g&&function(t,e){var n=t[1],r=e[1],i=n|r,s=i<131,a=128==r&&8==n||128==r&&256==n&&t[7].length<=e[8]||384==r&&e[7].length<=e[8]&&8==n;if(!s&&!a)return t;1&r&&(t[2]=e[2],i|=1&n?0:4);var u=e[3];if(u){var c=t[3];t[3]=c?mi(c,u,e[4]):u,t[4]=c?Ve(t[3],o):e[4]}(u=e[5])&&(c=t[5],t[5]=c?vi(c,u,e[6]):u,t[6]=c?Ve(t[5],o):e[6]);(u=e[7])&&(t[7]=u);128&r&&(t[8]=null==t[8]?e[8]:un(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=i}(m,g),t=m[0],e=m[1],n=m[2],i=m[3],a=m[4],!(l=m[9]=void 0===m[9]?h?0:t.length:an(m[9]-f,0))&&24&e&&(e&=-25),e&&1!=e)v=8==e||16==e?function(t,e,n){var i=Ci(t);return function s(){for(var o=arguments.length,a=r(o),u=o,c=Xi(s);u--;)a[u]=arguments[u];var l=o<3&&a[0]!==c&&a[o-1]!==c?[]:Ve(a,c);if((o-=l.length)<n)return ji(t,e,Ii,s.placeholder,void 0,a,l,void 0,void 0,n-o);var h=this&&this!==Gt&&this instanceof s?i:t;return se(h,this,a)}}(t,e,l):32!=e&&33!=e||a.length?Ii.apply(void 0,m):function(t,e,n,i){var s=1&e,o=Ci(t);return function e(){for(var a=-1,u=arguments.length,c=-1,l=i.length,h=r(l+u),f=this&&this!==Gt&&this instanceof e?o:t;++c<l;)h[c]=i[c];for(;u--;)h[c++]=arguments[++a];return se(f,s?n:this,h)}}(t,e,n,i);else var v=function(t,e,n){var r=1&e,i=Ci(t);return function e(){var s=this&&this!==Gt&&this instanceof e?i:t;return s.apply(r?n:this,arguments)}}(t,e,n);return Ss((g?Vr:bs)(v,m),t,e)}function Mi(t,e,n,r){return void 0===t||Ro(t,xt[n])&&!Et.call(r,n)?e:t}function Ui(t,e,n,r,i,s){return qo(t)&&qo(e)&&(s.set(e,t),Tr(t,e,void 0,Ui,s),s.delete(e)),t}function Vi(t){return Wo(t)?void 0:t}function qi(t,e,n,r,i,s){var o=1&n,a=t.length,u=e.length;if(a!=u&&!(o&&u>a))return!1;var c=s.get(t),l=s.get(e);if(c&&l)return c==e&&l==t;var h=-1,f=!0,p=2&n?new Bn:void 0;for(s.set(t,e),s.set(e,t);++h<a;){var d=t[h],g=e[h];if(r)var m=o?r(g,d,h,e,t,s):r(d,g,h,t,e,s);if(void 0!==m){if(m)continue;f=!1;break}if(p){if(!ve(e,(function(t,e){if(!Pe(p,e)&&(d===t||i(d,t,n,r,s)))return p.push(e)}))){f=!1;break}}else if(d!==g&&!i(d,g,n,r,s)){f=!1;break}}return s.delete(t),s.delete(e),f}function Ki(t){return ws(gs(t,void 0,ks),t+"")}function zi(t){return pr(t,wa,es)}function Gi(t){return pr(t,Sa,ns)}var Wi=bn?function(t){return bn.get(t)}:Za;function Yi(t){for(var e=t.name+"",n=xn[e],r=Et.call(xn,e)?n.length:0;r--;){var i=n[r],s=i.func;if(null==s||s==t)return i.name}return e}function Xi(t){return(Et.call(In,"placeholder")?In:t).placeholder}function Ji(){var t=In.iteratee||Wa;return t=t===Wa?Fr:t,arguments.length?t(arguments[0],arguments[1]):t}function Zi(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function Qi(t){for(var e=wa(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,ps(i)]}return e}function ts(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Er(n)?n:void 0}var es=en?function(t){return null==t?[]:(t=dt(t),le(en(t),(function(e){return zt.call(t,e)})))}:su,ns=en?function(t){for(var e=[];t;)de(e,es(t)),t=Ut(t);return e}:su,rs=dr;function is(t,e,n){for(var r=-1,i=(e=ui(e,t)).length,s=!1;++r<i;){var o=Cs(e[r]);if(!(s=null!=t&&n(t,o)))break;t=t[o]}return s||++r!=i?s:!!(i=null==t?0:t.length)&&Vo(i)&&as(o,i)&&(ko(t)||Po(t))}function ss(t){return"function"!=typeof t.constructor||fs(t)?{}:Rn(Ut(t))}function os(t){return ko(t)||Po(t)||!!(Yt&&t&&t[Yt])}function as(t,e){var n=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==n||"symbol"!=n&&ut.test(t))&&t>-1&&t%1==0&&t<e}function us(t,e,n){if(!qo(n))return!1;var r=typeof e;return!!("number"==r?jo(n)&&as(e,n.length):"string"==r&&e in n)&&Ro(n[e],t)}function cs(t,e){if(ko(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Zo(t))||(q.test(t)||!V.test(t)||null!=e&&t in dt(e))}function ls(t){var e=Yi(t),n=In[e];if("function"!=typeof n||!(e in Pn.prototype))return!1;if(t===n)return!0;var r=Wi(n);return!!r&&t===r[0]}(pn&&rs(new pn(new ArrayBuffer(1)))!=F||dn&&rs(new dn)!=g||gn&&"[object Promise]"!=rs(gn.resolve())||mn&&rs(new mn)!=b||vn&&rs(new vn)!=S)&&(rs=function(t){var e=dr(t),n=e==v?t.constructor:void 0,r=n?Ds(n):"";if(r)switch(r){case wn:return F;case Sn:return g;case En:return"[object Promise]";case Fn:return b;case An:return S}return e});var hs=wt?Mo:ou;function fs(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||xt)}function ps(t){return t==t&&!qo(t)}function ds(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in dt(n)))}}function gs(t,e,n){return e=an(void 0===e?t.length-1:e,0),function(){for(var i=arguments,s=-1,o=an(i.length-e,0),a=r(o);++s<o;)a[s]=i[e+s];s=-1;for(var u=r(e+1);++s<e;)u[s]=i[s];return u[e]=n(a),se(t,this,u)}}function ms(t,e){return e.length<2?t:fr(t,zr(e,0,-1))}function vs(t,e){for(var n=t.length,r=un(e.length,n),i=yi(t);r--;){var s=e[r];t[r]=as(s,n)?i[s]:void 0}return t}function ys(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var bs=Es(Vr),xs=Ze||function(t,e){return Gt.setTimeout(t,e)},ws=Es(qr);function Ss(t,e,n){var r=e+"";return ws(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(X,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return ae(a,(function(n){var r="_."+n[0];e&n[1]&&!he(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(J);return e?e[1].split(Z):[]}(r),n)))}function Es(t){var e=0,n=0;return function(){var r=cn(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Fs(t,e){var n=-1,r=t.length,i=r-1;for(e=void 0===e?r:e;++n<e;){var s=Br(n,i),o=t[s];t[s]=t[n],t[n]=o}return t.length=e,t}var As=function(t){var e=Fo(t,(function(t){return 500===n.size&&n.clear(),t})),n=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(K,(function(t,n,r,i){e.push(r?i.replace(et,"$1"):n||t)})),e}));function Cs(t){if("string"==typeof t||Zo(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function Ds(t){if(null!=t){try{return St.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function $s(t){if(t instanceof Pn)return t.clone();var e=new _n(t.__wrapped__,t.__chain__);return e.__actions__=yi(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var Is=Lr((function(t,e){return Bo(t)?tr(t,or(e,1,Bo,!0)):[]})),Rs=Lr((function(t,e){var n=Ls(e);return Bo(n)&&(n=void 0),Bo(t)?tr(t,or(e,1,Bo,!0),Ji(n,2)):[]})),Ts=Lr((function(t,e){var n=Ls(e);return Bo(n)&&(n=void 0),Bo(t)?tr(t,or(e,1,Bo,!0),void 0,n):[]}));function _s(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ia(n);return i<0&&(i=an(r+i,0)),xe(t,Ji(e,3),i)}function Ps(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return void 0!==n&&(i=ia(n),i=n<0?an(r+i,0):un(i,r-1)),xe(t,Ji(e,3),i,!0)}function ks(t){return(null==t?0:t.length)?or(t,1):[]}function Os(t){return t&&t.length?t[0]:void 0}var js=Lr((function(t){var e=pe(t,oi);return e.length&&e[0]===t[0]?yr(e):[]})),Bs=Lr((function(t){var e=Ls(t),n=pe(t,oi);return e===Ls(n)?e=void 0:n.pop(),n.length&&n[0]===t[0]?yr(n,Ji(e,2)):[]})),Ns=Lr((function(t){var e=Ls(t),n=pe(t,oi);return(e="function"==typeof e?e:void 0)&&n.pop(),n.length&&n[0]===t[0]?yr(n,void 0,e):[]}));function Ls(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}var Hs=Lr(Ms);function Ms(t,e){return t&&t.length&&e&&e.length?Or(t,e):t}var Us=Ki((function(t,e){var n=null==t?0:t.length,r=Yn(t,e);return jr(t,pe(e,(function(t){return as(t,n)?+t:t})).sort(gi)),r}));function Vs(t){return null==t?t:fn.call(t)}var qs=Lr((function(t){return Qr(or(t,1,Bo,!0))})),Ks=Lr((function(t){var e=Ls(t);return Bo(e)&&(e=void 0),Qr(or(t,1,Bo,!0),Ji(e,2))})),zs=Lr((function(t){var e=Ls(t);return e="function"==typeof e?e:void 0,Qr(or(t,1,Bo,!0),void 0,e)}));function Gs(t){if(!t||!t.length)return[];var e=0;return t=le(t,(function(t){if(Bo(t))return e=an(t.length,e),!0})),Ie(e,(function(e){return pe(t,Ae(e))}))}function Ws(t,e){if(!t||!t.length)return[];var n=Gs(t);return null==e?n:pe(n,(function(t){return se(e,void 0,t)}))}var Ys=Lr((function(t,e){return Bo(t)?tr(t,e):[]})),Xs=Lr((function(t){return ii(le(t,Bo))})),Js=Lr((function(t){var e=Ls(t);return Bo(e)&&(e=void 0),ii(le(t,Bo),Ji(e,2))})),Zs=Lr((function(t){var e=Ls(t);return e="function"==typeof e?e:void 0,ii(le(t,Bo),void 0,e)})),Qs=Lr(Gs);var to=Lr((function(t){var e=t.length,n=e>1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,Ws(t,n)}));function eo(t){var e=In(t);return e.__chain__=!0,e}function no(t,e){return e(t)}var ro=Ki((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return Yn(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Pn&&as(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:no,args:[i],thisArg:void 0}),new _n(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(i)}));var io=xi((function(t,e,n){Et.call(t,n)?++t[n]:Wn(t,n,1)}));var so=Di(_s),oo=Di(Ps);function ao(t,e){return(ko(t)?ae:er)(t,Ji(e,3))}function uo(t,e){return(ko(t)?ue:nr)(t,Ji(e,3))}var co=xi((function(t,e,n){Et.call(t,n)?t[n].push(e):Wn(t,n,[e])}));var lo=Lr((function(t,e,n){var i=-1,s="function"==typeof e,o=jo(t)?r(t.length):[];return er(t,(function(t){o[++i]=s?se(e,t,n):br(t,e,n)})),o})),ho=xi((function(t,e,n){Wn(t,n,e)}));function fo(t,e){return(ko(t)?pe:$r)(t,Ji(e,3))}var po=xi((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var go=Lr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&us(t,e[0],e[1])?e=[]:n>2&&us(e[0],e[1],e[2])&&(e=[e[0]]),Pr(t,or(e,1),[])})),mo=Je||function(){return Gt.Date.now()};function vo(t,e,n){return e=n?void 0:e,Hi(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function yo(t,e){var n;if("function"!=typeof e)throw new vt(s);return t=ia(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var bo=Lr((function(t,e,n){var r=1;if(n.length){var i=Ve(n,Xi(bo));r|=32}return Hi(t,r,e,n,i)})),xo=Lr((function(t,e,n){var r=3;if(n.length){var i=Ve(n,Xi(xo));r|=32}return Hi(e,r,t,n,i)}));function wo(t,e,n){var r,i,o,a,u,c,l=0,h=!1,f=!1,p=!0;if("function"!=typeof t)throw new vt(s);function d(e){var n=r,s=i;return r=i=void 0,l=e,a=t.apply(s,n)}function g(t){return l=t,u=xs(v,e),h?d(t):a}function m(t){var n=t-c;return void 0===c||n>=e||n<0||f&&t-l>=o}function v(){var t=mo();if(m(t))return y(t);u=xs(v,function(t){var n=e-(t-c);return f?un(n,o-(t-l)):n}(t))}function y(t){return u=void 0,p&&r?d(t):(r=i=void 0,a)}function b(){var t=mo(),n=m(t);if(r=arguments,i=this,c=t,n){if(void 0===u)return g(c);if(f)return hi(u),u=xs(v,e),d(c)}return void 0===u&&(u=xs(v,e)),a}return e=oa(e)||0,qo(n)&&(h=!!n.leading,o=(f="maxWait"in n)?an(oa(n.maxWait)||0,e):o,p="trailing"in n?!!n.trailing:p),b.cancel=function(){void 0!==u&&hi(u),l=0,r=c=i=u=void 0},b.flush=function(){return void 0===u?a:y(mo())},b}var So=Lr((function(t,e){return Qn(t,1,e)})),Eo=Lr((function(t,e,n){return Qn(t,oa(e)||0,n)}));function Fo(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new vt(s);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=t.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(Fo.Cache||jn),n}function Ao(t){if("function"!=typeof t)throw new vt(s);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Fo.Cache=jn;var Co=ci((function(t,e){var n=(e=1==e.length&&ko(e[0])?pe(e[0],Te(Ji())):pe(or(e,1),Te(Ji()))).length;return Lr((function(r){for(var i=-1,s=un(r.length,n);++i<s;)r[i]=e[i].call(this,r[i]);return se(t,this,r)}))})),Do=Lr((function(t,e){return Hi(t,32,void 0,e,Ve(e,Xi(Do)))})),$o=Lr((function(t,e){return Hi(t,64,void 0,e,Ve(e,Xi($o)))})),Io=Ki((function(t,e){return Hi(t,256,void 0,void 0,void 0,e)}));function Ro(t,e){return t===e||t!=t&&e!=e}var To=Oi(gr),_o=Oi((function(t,e){return t>=e})),Po=xr(function(){return arguments}())?xr:function(t){return Ko(t)&&Et.call(t,"callee")&&!zt.call(t,"callee")},ko=r.isArray,Oo=Qt?Te(Qt):function(t){return Ko(t)&&dr(t)==E};function jo(t){return null!=t&&Vo(t.length)&&!Mo(t)}function Bo(t){return Ko(t)&&jo(t)}var No=nn||ou,Lo=te?Te(te):function(t){return Ko(t)&&dr(t)==h};function Ho(t){if(!Ko(t))return!1;var e=dr(t);return e==f||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!Wo(t)}function Mo(t){if(!qo(t))return!1;var e=dr(t);return e==p||e==d||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Uo(t){return"number"==typeof t&&t==ia(t)}function Vo(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function qo(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ko(t){return null!=t&&"object"==typeof t}var zo=ee?Te(ee):function(t){return Ko(t)&&rs(t)==g};function Go(t){return"number"==typeof t||Ko(t)&&dr(t)==m}function Wo(t){if(!Ko(t)||dr(t)!=v)return!1;var e=Ut(t);if(null===e)return!0;var n=Et.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&St.call(n)==Dt}var Yo=ne?Te(ne):function(t){return Ko(t)&&dr(t)==y};var Xo=re?Te(re):function(t){return Ko(t)&&rs(t)==b};function Jo(t){return"string"==typeof t||!ko(t)&&Ko(t)&&dr(t)==x}function Zo(t){return"symbol"==typeof t||Ko(t)&&dr(t)==w}var Qo=ie?Te(ie):function(t){return Ko(t)&&Vo(t.length)&&!!Ht[dr(t)]};var ta=Oi(Dr),ea=Oi((function(t,e){return t<=e}));function na(t){if(!t)return[];if(jo(t))return Jo(t)?Ge(t):yi(t);if(Jt&&t[Jt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Jt]());var e=rs(t);return(e==g?Me:e==b?qe:Ra)(t)}function ra(t){return t?(t=oa(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ia(t){var e=ra(t),n=e%1;return e==e?n?e-n:e:0}function sa(t){return t?Xn(ia(t),0,4294967295):0}function oa(t){if("number"==typeof t)return t;if(Zo(t))return NaN;if(qo(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=qo(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Re(t);var n=st.test(t);return n||at.test(t)?qt(t.slice(2),n?2:8):it.test(t)?NaN:+t}function aa(t){return bi(t,Sa(t))}function ua(t){return null==t?"":Zr(t)}var ca=wi((function(t,e){if(fs(e)||jo(e))bi(e,wa(e),t);else for(var n in e)Et.call(e,n)&&qn(t,n,e[n])})),la=wi((function(t,e){bi(e,Sa(e),t)})),ha=wi((function(t,e,n,r){bi(e,Sa(e),t,r)})),fa=wi((function(t,e,n,r){bi(e,wa(e),t,r)})),pa=Ki(Yn);var da=Lr((function(t,e){t=dt(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&us(e[0],e[1],i)&&(r=1);++n<r;)for(var s=e[n],o=Sa(s),a=-1,u=o.length;++a<u;){var c=o[a],l=t[c];(void 0===l||Ro(l,xt[c])&&!Et.call(t,c))&&(t[c]=s[c])}return t})),ga=Lr((function(t){return t.push(void 0,Ui),se(Fa,void 0,t)}));function ma(t,e,n){var r=null==t?void 0:fr(t,e);return void 0===r?n:r}function va(t,e){return null!=t&&is(t,e,vr)}var ya=Ri((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ct.call(e)),t[e]=n}),qa(Ga)),ba=Ri((function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=Ct.call(e)),Et.call(t,e)?t[e].push(n):t[e]=[n]}),Ji),xa=Lr(br);function wa(t){return jo(t)?Ln(t):Ar(t)}function Sa(t){return jo(t)?Ln(t,!0):Cr(t)}var Ea=wi((function(t,e,n){Tr(t,e,n)})),Fa=wi((function(t,e,n,r){Tr(t,e,n,r)})),Aa=Ki((function(t,e){var n={};if(null==t)return n;var r=!1;e=pe(e,(function(e){return e=ui(e,t),r||(r=e.length>1),e})),bi(t,Gi(t),n),r&&(n=Jn(n,7,Vi));for(var i=e.length;i--;)ti(n,e[i]);return n}));var Ca=Ki((function(t,e){return null==t?{}:function(t,e){return kr(t,e,(function(e,n){return va(t,n)}))}(t,e)}));function Da(t,e){if(null==t)return{};var n=pe(Gi(t),(function(t){return[t]}));return e=Ji(e),kr(t,n,(function(t,n){return e(t,n[0])}))}var $a=Li(wa),Ia=Li(Sa);function Ra(t){return null==t?[]:_e(t,wa(t))}var Ta=Ai((function(t,e,n){return e=e.toLowerCase(),t+(n?_a(e):e)}));function _a(t){return Ha(ua(t).toLowerCase())}function Pa(t){return(t=ua(t))&&t.replace(ct,Be).replace(Pt,"")}var ka=Ai((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Oa=Ai((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),ja=Fi("toLowerCase");var Ba=Ai((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Na=Ai((function(t,e,n){return t+(n?" ":"")+Ha(e)}));var La=Ai((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Ha=Fi("toUpperCase");function Ma(t,e,n){return t=ua(t),void 0===(e=n?void 0:e)?function(t){return Bt.test(t)}(t)?function(t){return t.match(Ot)||[]}(t):function(t){return t.match(Q)||[]}(t):t.match(e)||[]}var Ua=Lr((function(t,e){try{return se(t,void 0,e)}catch(t){return Ho(t)?t:new Y(t)}})),Va=Ki((function(t,e){return ae(e,(function(e){e=Cs(e),Wn(t,e,bo(t[e],t))})),t}));function qa(t){return function(){return t}}var Ka=$i(),za=$i(!0);function Ga(t){return t}function Wa(t){return Fr("function"==typeof t?t:Jn(t,1))}var Ya=Lr((function(t,e){return function(n){return br(n,t,e)}})),Xa=Lr((function(t,e){return function(n){return br(t,n,e)}}));function Ja(t,e,n){var r=wa(e),i=hr(e,r);null!=n||qo(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=hr(e,wa(e)));var s=!(qo(n)&&"chain"in n&&!n.chain),o=Mo(t);return ae(i,(function(n){var r=e[n];t[n]=r,o&&(t.prototype[n]=function(){var e=this.__chain__;if(s||e){var n=t(this.__wrapped__),i=n.__actions__=yi(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,de([this.value()],arguments))})})),t}function Za(){}var Qa=_i(pe),tu=_i(ce),eu=_i(ve);function nu(t){return cs(t)?Ae(Cs(t)):function(t){return function(e){return fr(e,t)}}(t)}var ru=ki(),iu=ki(!0);function su(){return[]}function ou(){return!1}var au=Ti((function(t,e){return t+e}),0),uu=Bi("ceil"),cu=Ti((function(t,e){return t/e}),1),lu=Bi("floor");var hu,fu=Ti((function(t,e){return t*e}),1),pu=Bi("round"),du=Ti((function(t,e){return t-e}),0);return In.after=function(t,e){if("function"!=typeof e)throw new vt(s);return t=ia(t),function(){if(--t<1)return e.apply(this,arguments)}},In.ary=vo,In.assign=ca,In.assignIn=la,In.assignInWith=ha,In.assignWith=fa,In.at=pa,In.before=yo,In.bind=bo,In.bindAll=Va,In.bindKey=xo,In.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return ko(t)?t:[t]},In.chain=eo,In.chunk=function(t,e,n){e=(n?us(t,e,n):void 0===e)?1:an(ia(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var s=0,o=0,a=r(Qe(i/e));s<i;)a[o++]=zr(t,s,s+=e);return a},In.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var s=t[e];s&&(i[r++]=s)}return i},In.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return de(ko(n)?yi(n):[n],or(e,1))},In.cond=function(t){var e=null==t?0:t.length,n=Ji();return t=e?pe(t,(function(t){if("function"!=typeof t[1])throw new vt(s);return[n(t[0]),t[1]]})):[],Lr((function(n){for(var r=-1;++r<e;){var i=t[r];if(se(i[0],this,n))return se(i[1],this,n)}}))},In.conforms=function(t){return function(t){var e=wa(t);return function(n){return Zn(n,t,e)}}(Jn(t,1))},In.constant=qa,In.countBy=io,In.create=function(t,e){var n=Rn(t);return null==e?n:Gn(n,e)},In.curry=function t(e,n,r){var i=Hi(e,8,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return i.placeholder=t.placeholder,i},In.curryRight=function t(e,n,r){var i=Hi(e,16,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return i.placeholder=t.placeholder,i},In.debounce=wo,In.defaults=da,In.defaultsDeep=ga,In.defer=So,In.delay=Eo,In.difference=Is,In.differenceBy=Rs,In.differenceWith=Ts,In.drop=function(t,e,n){var r=null==t?0:t.length;return r?zr(t,(e=n||void 0===e?1:ia(e))<0?0:e,r):[]},In.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?zr(t,0,(e=r-(e=n||void 0===e?1:ia(e)))<0?0:e):[]},In.dropRightWhile=function(t,e){return t&&t.length?ni(t,Ji(e,3),!0,!0):[]},In.dropWhile=function(t,e){return t&&t.length?ni(t,Ji(e,3),!0):[]},In.fill=function(t,e,n,r){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&us(t,e,n)&&(n=0,r=i),function(t,e,n,r){var i=t.length;for((n=ia(n))<0&&(n=-n>i?0:i+n),(r=void 0===r||r>i?i:ia(r))<0&&(r+=i),r=n>r?0:sa(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},In.filter=function(t,e){return(ko(t)?le:sr)(t,Ji(e,3))},In.flatMap=function(t,e){return or(fo(t,e),1)},In.flatMapDeep=function(t,e){return or(fo(t,e),1/0)},In.flatMapDepth=function(t,e,n){return n=void 0===n?1:ia(n),or(fo(t,e),n)},In.flatten=ks,In.flattenDeep=function(t){return(null==t?0:t.length)?or(t,1/0):[]},In.flattenDepth=function(t,e){return(null==t?0:t.length)?or(t,e=void 0===e?1:ia(e)):[]},In.flip=function(t){return Hi(t,512)},In.flow=Ka,In.flowRight=za,In.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},In.functions=function(t){return null==t?[]:hr(t,wa(t))},In.functionsIn=function(t){return null==t?[]:hr(t,Sa(t))},In.groupBy=co,In.initial=function(t){return(null==t?0:t.length)?zr(t,0,-1):[]},In.intersection=js,In.intersectionBy=Bs,In.intersectionWith=Ns,In.invert=ya,In.invertBy=ba,In.invokeMap=lo,In.iteratee=Wa,In.keyBy=ho,In.keys=wa,In.keysIn=Sa,In.map=fo,In.mapKeys=function(t,e){var n={};return e=Ji(e,3),cr(t,(function(t,r,i){Wn(n,e(t,r,i),t)})),n},In.mapValues=function(t,e){var n={};return e=Ji(e,3),cr(t,(function(t,r,i){Wn(n,r,e(t,r,i))})),n},In.matches=function(t){return Ir(Jn(t,1))},In.matchesProperty=function(t,e){return Rr(t,Jn(e,1))},In.memoize=Fo,In.merge=Ea,In.mergeWith=Fa,In.method=Ya,In.methodOf=Xa,In.mixin=Ja,In.negate=Ao,In.nthArg=function(t){return t=ia(t),Lr((function(e){return _r(e,t)}))},In.omit=Aa,In.omitBy=function(t,e){return Da(t,Ao(Ji(e)))},In.once=function(t){return yo(2,t)},In.orderBy=function(t,e,n,r){return null==t?[]:(ko(e)||(e=null==e?[]:[e]),ko(n=r?void 0:n)||(n=null==n?[]:[n]),Pr(t,e,n))},In.over=Qa,In.overArgs=Co,In.overEvery=tu,In.overSome=eu,In.partial=Do,In.partialRight=$o,In.partition=po,In.pick=Ca,In.pickBy=Da,In.property=nu,In.propertyOf=function(t){return function(e){return null==t?void 0:fr(t,e)}},In.pull=Hs,In.pullAll=Ms,In.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?Or(t,e,Ji(n,2)):t},In.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?Or(t,e,void 0,n):t},In.pullAt=Us,In.range=ru,In.rangeRight=iu,In.rearg=Io,In.reject=function(t,e){return(ko(t)?le:sr)(t,Ao(Ji(e,3)))},In.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],s=t.length;for(e=Ji(e,3);++r<s;){var o=t[r];e(o,r,t)&&(n.push(o),i.push(r))}return jr(t,i),n},In.rest=function(t,e){if("function"!=typeof t)throw new vt(s);return Lr(t,e=void 0===e?e:ia(e))},In.reverse=Vs,In.sampleSize=function(t,e,n){return e=(n?us(t,e,n):void 0===e)?1:ia(e),(ko(t)?Mn:Mr)(t,e)},In.set=function(t,e,n){return null==t?t:Ur(t,e,n)},In.setWith=function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:Ur(t,e,n,r)},In.shuffle=function(t){return(ko(t)?Un:Kr)(t)},In.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&us(t,e,n)?(e=0,n=r):(e=null==e?0:ia(e),n=void 0===n?r:ia(n)),zr(t,e,n)):[]},In.sortBy=go,In.sortedUniq=function(t){return t&&t.length?Xr(t):[]},In.sortedUniqBy=function(t,e){return t&&t.length?Xr(t,Ji(e,2)):[]},In.split=function(t,e,n){return n&&"number"!=typeof n&&us(t,e,n)&&(e=n=void 0),(n=void 0===n?4294967295:n>>>0)?(t=ua(t))&&("string"==typeof e||null!=e&&!Yo(e))&&!(e=Zr(e))&&He(t)?li(Ge(t),0,n):t.split(e,n):[]},In.spread=function(t,e){if("function"!=typeof t)throw new vt(s);return e=null==e?0:an(ia(e),0),Lr((function(n){var r=n[e],i=li(n,0,e);return r&&de(i,r),se(t,this,i)}))},In.tail=function(t){var e=null==t?0:t.length;return e?zr(t,1,e):[]},In.take=function(t,e,n){return t&&t.length?zr(t,0,(e=n||void 0===e?1:ia(e))<0?0:e):[]},In.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?zr(t,(e=r-(e=n||void 0===e?1:ia(e)))<0?0:e,r):[]},In.takeRightWhile=function(t,e){return t&&t.length?ni(t,Ji(e,3),!1,!0):[]},In.takeWhile=function(t,e){return t&&t.length?ni(t,Ji(e,3)):[]},In.tap=function(t,e){return e(t),t},In.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new vt(s);return qo(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),wo(t,e,{leading:r,maxWait:e,trailing:i})},In.thru=no,In.toArray=na,In.toPairs=$a,In.toPairsIn=Ia,In.toPath=function(t){return ko(t)?pe(t,Cs):Zo(t)?[t]:yi(As(ua(t)))},In.toPlainObject=aa,In.transform=function(t,e,n){var r=ko(t),i=r||No(t)||Qo(t);if(e=Ji(e,4),null==n){var s=t&&t.constructor;n=i?r?new s:[]:qo(t)&&Mo(s)?Rn(Ut(t)):{}}return(i?ae:cr)(t,(function(t,r,i){return e(n,t,r,i)})),n},In.unary=function(t){return vo(t,1)},In.union=qs,In.unionBy=Ks,In.unionWith=zs,In.uniq=function(t){return t&&t.length?Qr(t):[]},In.uniqBy=function(t,e){return t&&t.length?Qr(t,Ji(e,2)):[]},In.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Qr(t,void 0,e):[]},In.unset=function(t,e){return null==t||ti(t,e)},In.unzip=Gs,In.unzipWith=Ws,In.update=function(t,e,n){return null==t?t:ei(t,e,ai(n))},In.updateWith=function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:ei(t,e,ai(n),r)},In.values=Ra,In.valuesIn=function(t){return null==t?[]:_e(t,Sa(t))},In.without=Ys,In.words=Ma,In.wrap=function(t,e){return Do(ai(e),t)},In.xor=Xs,In.xorBy=Js,In.xorWith=Zs,In.zip=Qs,In.zipObject=function(t,e){return si(t||[],e||[],qn)},In.zipObjectDeep=function(t,e){return si(t||[],e||[],Ur)},In.zipWith=to,In.entries=$a,In.entriesIn=Ia,In.extend=la,In.extendWith=ha,Ja(In,In),In.add=au,In.attempt=Ua,In.camelCase=Ta,In.capitalize=_a,In.ceil=uu,In.clamp=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=oa(n))==n?n:0),void 0!==e&&(e=(e=oa(e))==e?e:0),Xn(oa(t),e,n)},In.clone=function(t){return Jn(t,4)},In.cloneDeep=function(t){return Jn(t,5)},In.cloneDeepWith=function(t,e){return Jn(t,5,e="function"==typeof e?e:void 0)},In.cloneWith=function(t,e){return Jn(t,4,e="function"==typeof e?e:void 0)},In.conformsTo=function(t,e){return null==e||Zn(t,e,wa(e))},In.deburr=Pa,In.defaultTo=function(t,e){return null==t||t!=t?e:t},In.divide=cu,In.endsWith=function(t,e,n){t=ua(t),e=Zr(e);var r=t.length,i=n=void 0===n?r:Xn(ia(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},In.eq=Ro,In.escape=function(t){return(t=ua(t))&&L.test(t)?t.replace(B,Ne):t},In.escapeRegExp=function(t){return(t=ua(t))&&G.test(t)?t.replace(z,"\\$&"):t},In.every=function(t,e,n){var r=ko(t)?ce:rr;return n&&us(t,e,n)&&(e=void 0),r(t,Ji(e,3))},In.find=so,In.findIndex=_s,In.findKey=function(t,e){return be(t,Ji(e,3),cr)},In.findLast=oo,In.findLastIndex=Ps,In.findLastKey=function(t,e){return be(t,Ji(e,3),lr)},In.floor=lu,In.forEach=ao,In.forEachRight=uo,In.forIn=function(t,e){return null==t?t:ar(t,Ji(e,3),Sa)},In.forInRight=function(t,e){return null==t?t:ur(t,Ji(e,3),Sa)},In.forOwn=function(t,e){return t&&cr(t,Ji(e,3))},In.forOwnRight=function(t,e){return t&&lr(t,Ji(e,3))},In.get=ma,In.gt=To,In.gte=_o,In.has=function(t,e){return null!=t&&is(t,e,mr)},In.hasIn=va,In.head=Os,In.identity=Ga,In.includes=function(t,e,n,r){t=jo(t)?t:Ra(t),n=n&&!r?ia(n):0;var i=t.length;return n<0&&(n=an(i+n,0)),Jo(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&we(t,e,n)>-1},In.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:ia(n);return i<0&&(i=an(r+i,0)),we(t,e,i)},In.inRange=function(t,e,n){return e=ra(e),void 0===n?(n=e,e=0):n=ra(n),function(t,e,n){return t>=un(e,n)&&t<an(e,n)}(t=oa(t),e,n)},In.invoke=xa,In.isArguments=Po,In.isArray=ko,In.isArrayBuffer=Oo,In.isArrayLike=jo,In.isArrayLikeObject=Bo,In.isBoolean=function(t){return!0===t||!1===t||Ko(t)&&dr(t)==l},In.isBuffer=No,In.isDate=Lo,In.isElement=function(t){return Ko(t)&&1===t.nodeType&&!Wo(t)},In.isEmpty=function(t){if(null==t)return!0;if(jo(t)&&(ko(t)||"string"==typeof t||"function"==typeof t.splice||No(t)||Qo(t)||Po(t)))return!t.length;var e=rs(t);if(e==g||e==b)return!t.size;if(fs(t))return!Ar(t).length;for(var n in t)if(Et.call(t,n))return!1;return!0},In.isEqual=function(t,e){return wr(t,e)},In.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:void 0)?n(t,e):void 0;return void 0===r?wr(t,e,void 0,n):!!r},In.isError=Ho,In.isFinite=function(t){return"number"==typeof t&&rn(t)},In.isFunction=Mo,In.isInteger=Uo,In.isLength=Vo,In.isMap=zo,In.isMatch=function(t,e){return t===e||Sr(t,e,Qi(e))},In.isMatchWith=function(t,e,n){return n="function"==typeof n?n:void 0,Sr(t,e,Qi(e),n)},In.isNaN=function(t){return Go(t)&&t!=+t},In.isNative=function(t){if(hs(t))throw new Y("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Er(t)},In.isNil=function(t){return null==t},In.isNull=function(t){return null===t},In.isNumber=Go,In.isObject=qo,In.isObjectLike=Ko,In.isPlainObject=Wo,In.isRegExp=Yo,In.isSafeInteger=function(t){return Uo(t)&&t>=-9007199254740991&&t<=9007199254740991},In.isSet=Xo,In.isString=Jo,In.isSymbol=Zo,In.isTypedArray=Qo,In.isUndefined=function(t){return void 0===t},In.isWeakMap=function(t){return Ko(t)&&rs(t)==S},In.isWeakSet=function(t){return Ko(t)&&"[object WeakSet]"==dr(t)},In.join=function(t,e){return null==t?"":sn.call(t,e)},In.kebabCase=ka,In.last=Ls,In.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=ia(n))<0?an(r+i,0):un(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):xe(t,Ee,i,!0)},In.lowerCase=Oa,In.lowerFirst=ja,In.lt=ta,In.lte=ea,In.max=function(t){return t&&t.length?ir(t,Ga,gr):void 0},In.maxBy=function(t,e){return t&&t.length?ir(t,Ji(e,2),gr):void 0},In.mean=function(t){return Fe(t,Ga)},In.meanBy=function(t,e){return Fe(t,Ji(e,2))},In.min=function(t){return t&&t.length?ir(t,Ga,Dr):void 0},In.minBy=function(t,e){return t&&t.length?ir(t,Ji(e,2),Dr):void 0},In.stubArray=su,In.stubFalse=ou,In.stubObject=function(){return{}},In.stubString=function(){return""},In.stubTrue=function(){return!0},In.multiply=fu,In.nth=function(t,e){return t&&t.length?_r(t,ia(e)):void 0},In.noConflict=function(){return Gt._===this&&(Gt._=$t),this},In.noop=Za,In.now=mo,In.pad=function(t,e,n){t=ua(t);var r=(e=ia(e))?ze(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Pi(tn(i),n)+t+Pi(Qe(i),n)},In.padEnd=function(t,e,n){t=ua(t);var r=(e=ia(e))?ze(t):0;return e&&r<e?t+Pi(e-r,n):t},In.padStart=function(t,e,n){t=ua(t);var r=(e=ia(e))?ze(t):0;return e&&r<e?Pi(e-r,n)+t:t},In.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),ln(ua(t).replace(W,""),e||0)},In.random=function(t,e,n){if(n&&"boolean"!=typeof n&&us(t,e,n)&&(e=n=void 0),void 0===n&&("boolean"==typeof e?(n=e,e=void 0):"boolean"==typeof t&&(n=t,t=void 0)),void 0===t&&void 0===e?(t=0,e=1):(t=ra(t),void 0===e?(e=t,t=0):e=ra(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=hn();return un(t+i*(e-t+Vt("1e-"+((i+"").length-1))),e)}return Br(t,e)},In.reduce=function(t,e,n){var r=ko(t)?ge:De,i=arguments.length<3;return r(t,Ji(e,4),n,i,er)},In.reduceRight=function(t,e,n){var r=ko(t)?me:De,i=arguments.length<3;return r(t,Ji(e,4),n,i,nr)},In.repeat=function(t,e,n){return e=(n?us(t,e,n):void 0===e)?1:ia(e),Nr(ua(t),e)},In.replace=function(){var t=arguments,e=ua(t[0]);return t.length<3?e:e.replace(t[1],t[2])},In.result=function(t,e,n){var r=-1,i=(e=ui(e,t)).length;for(i||(i=1,t=void 0);++r<i;){var s=null==t?void 0:t[Cs(e[r])];void 0===s&&(r=i,s=n),t=Mo(s)?s.call(t):s}return t},In.round=pu,In.runInContext=t,In.sample=function(t){return(ko(t)?Hn:Hr)(t)},In.size=function(t){if(null==t)return 0;if(jo(t))return Jo(t)?ze(t):t.length;var e=rs(t);return e==g||e==b?t.size:Ar(t).length},In.snakeCase=Ba,In.some=function(t,e,n){var r=ko(t)?ve:Gr;return n&&us(t,e,n)&&(e=void 0),r(t,Ji(e,3))},In.sortedIndex=function(t,e){return Wr(t,e)},In.sortedIndexBy=function(t,e,n){return Yr(t,e,Ji(n,2))},In.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=Wr(t,e);if(r<n&&Ro(t[r],e))return r}return-1},In.sortedLastIndex=function(t,e){return Wr(t,e,!0)},In.sortedLastIndexBy=function(t,e,n){return Yr(t,e,Ji(n,2),!0)},In.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var n=Wr(t,e,!0)-1;if(Ro(t[n],e))return n}return-1},In.startCase=Na,In.startsWith=function(t,e,n){return t=ua(t),n=null==n?0:Xn(ia(n),0,t.length),e=Zr(e),t.slice(n,n+e.length)==e},In.subtract=du,In.sum=function(t){return t&&t.length?$e(t,Ga):0},In.sumBy=function(t,e){return t&&t.length?$e(t,Ji(e,2)):0},In.template=function(t,e,n){var r=In.templateSettings;n&&us(t,e,n)&&(e=void 0),t=ua(t),e=ha({},e,r,Mi);var i,s,o=ha({},e.imports,r.imports,Mi),a=wa(o),u=_e(o,a),c=0,l=e.interpolate||lt,h="__p += '",f=gt((e.escape||lt).source+"|"+l.source+"|"+(l===U?nt:lt).source+"|"+(e.evaluate||lt).source+"|$","g"),p="//# sourceURL="+(Et.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Lt+"]")+"\n";t.replace(f,(function(e,n,r,o,a,u){return r||(r=o),h+=t.slice(c,u).replace(ht,Le),n&&(i=!0,h+="' +\n__e("+n+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=u+e.length,e})),h+="';\n";var d=Et.call(e,"variable")&&e.variable;if(d){if(tt.test(d))throw new Y("Invalid `variable` option passed into `_.template`")}else h="with (obj) {\n"+h+"\n}\n";h=(s?h.replace(P,""):h).replace(k,"$1").replace(O,"$1;"),h="function("+(d||"obj")+") {\n"+(d?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=Ua((function(){return ft(a,p+"return "+h).apply(void 0,u)}));if(g.source=h,Ho(g))throw g;return g},In.times=function(t,e){if((t=ia(t))<1||t>9007199254740991)return[];var n=4294967295,r=un(t,4294967295);t-=4294967295;for(var i=Ie(r,e=Ji(e));++n<t;)e(n);return i},In.toFinite=ra,In.toInteger=ia,In.toLength=sa,In.toLower=function(t){return ua(t).toLowerCase()},In.toNumber=oa,In.toSafeInteger=function(t){return t?Xn(ia(t),-9007199254740991,9007199254740991):0===t?t:0},In.toString=ua,In.toUpper=function(t){return ua(t).toUpperCase()},In.trim=function(t,e,n){if((t=ua(t))&&(n||void 0===e))return Re(t);if(!t||!(e=Zr(e)))return t;var r=Ge(t),i=Ge(e);return li(r,ke(r,i),Oe(r,i)+1).join("")},In.trimEnd=function(t,e,n){if((t=ua(t))&&(n||void 0===e))return t.slice(0,We(t)+1);if(!t||!(e=Zr(e)))return t;var r=Ge(t);return li(r,0,Oe(r,Ge(e))+1).join("")},In.trimStart=function(t,e,n){if((t=ua(t))&&(n||void 0===e))return t.replace(W,"");if(!t||!(e=Zr(e)))return t;var r=Ge(t);return li(r,ke(r,Ge(e))).join("")},In.truncate=function(t,e){var n=30,r="...";if(qo(e)){var i="separator"in e?e.separator:i;n="length"in e?ia(e.length):n,r="omission"in e?Zr(e.omission):r}var s=(t=ua(t)).length;if(He(t)){var o=Ge(t);s=o.length}if(n>=s)return t;var a=n-ze(r);if(a<1)return r;var u=o?li(o,0,a).join(""):t.slice(0,a);if(void 0===i)return u+r;if(o&&(a+=u.length-a),Yo(i)){if(t.slice(a).search(i)){var c,l=u;for(i.global||(i=gt(i.source,ua(rt.exec(i))+"g")),i.lastIndex=0;c=i.exec(l);)var h=c.index;u=u.slice(0,void 0===h?a:h)}}else if(t.indexOf(Zr(i),a)!=a){var f=u.lastIndexOf(i);f>-1&&(u=u.slice(0,f))}return u+r},In.unescape=function(t){return(t=ua(t))&&N.test(t)?t.replace(j,Ye):t},In.uniqueId=function(t){var e=++Ft;return ua(t)+e},In.upperCase=La,In.upperFirst=Ha,In.each=ao,In.eachRight=uo,In.first=Os,Ja(In,(hu={},cr(In,(function(t,e){Et.call(In.prototype,e)||(hu[e]=t)})),hu),{chain:!1}),In.VERSION="4.17.21",ae(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){In[t].placeholder=In})),ae(["drop","take"],(function(t,e){Pn.prototype[t]=function(n){n=void 0===n?1:an(ia(n),0);var r=this.__filtered__&&!e?new Pn(this):this.clone();return r.__filtered__?r.__takeCount__=un(n,r.__takeCount__):r.__views__.push({size:un(n,4294967295),type:t+(r.__dir__<0?"Right":"")}),r},Pn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ae(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Pn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Ji(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),ae(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Pn.prototype[t]=function(){return this[n](1).value()[0]}})),ae(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Pn.prototype[t]=function(){return this.__filtered__?new Pn(this):this[n](1)}})),Pn.prototype.compact=function(){return this.filter(Ga)},Pn.prototype.find=function(t){return this.filter(t).head()},Pn.prototype.findLast=function(t){return this.reverse().find(t)},Pn.prototype.invokeMap=Lr((function(t,e){return"function"==typeof t?new Pn(this):this.map((function(n){return br(n,t,e)}))})),Pn.prototype.reject=function(t){return this.filter(Ao(Ji(t)))},Pn.prototype.slice=function(t,e){t=ia(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Pn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=ia(e))<0?n.dropRight(-e):n.take(e-t)),n)},Pn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Pn.prototype.toArray=function(){return this.take(4294967295)},cr(Pn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=In[r?"take"+("last"==e?"Right":""):e],s=r||/^find/.test(e);i&&(In.prototype[e]=function(){var e=this.__wrapped__,o=r?[1]:arguments,a=e instanceof Pn,u=o[0],c=a||ko(e),l=function(t){var e=i.apply(In,de([t],o));return r&&h?e[0]:e};c&&n&&"function"==typeof u&&1!=u.length&&(a=c=!1);var h=this.__chain__,f=!!this.__actions__.length,p=s&&!h,d=a&&!f;if(!s&&c){e=d?e:new Pn(this);var g=t.apply(e,o);return g.__actions__.push({func:no,args:[l],thisArg:void 0}),new _n(g,h)}return p&&d?t.apply(this,o):(g=this.thru(l),p?r?g.value()[0]:g.value():g)})})),ae(["pop","push","shift","sort","splice","unshift"],(function(t){var e=yt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);In.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(ko(i)?i:[],t)}return this[n]((function(n){return e.apply(ko(n)?n:[],t)}))}})),cr(Pn.prototype,(function(t,e){var n=In[e];if(n){var r=n.name+"";Et.call(xn,r)||(xn[r]=[]),xn[r].push({name:e,func:n})}})),xn[Ii(void 0,2).name]=[{name:"wrapper",func:void 0}],Pn.prototype.clone=function(){var t=new Pn(this.__wrapped__);return t.__actions__=yi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=yi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=yi(this.__views__),t},Pn.prototype.reverse=function(){if(this.__filtered__){var t=new Pn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Pn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=ko(t),r=e<0,i=n?t.length:0,s=function(t,e,n){var r=-1,i=n.length;for(;++r<i;){var s=n[r],o=s.size;switch(s.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=un(e,t+o);break;case"takeRight":t=an(t,e-o)}}return{start:t,end:e}}(0,i,this.__views__),o=s.start,a=s.end,u=a-o,c=r?a:o-1,l=this.__iteratees__,h=l.length,f=0,p=un(u,this.__takeCount__);if(!n||!r&&i==u&&p==u)return ri(t,this.__actions__);var d=[];t:for(;u--&&f<p;){for(var g=-1,m=t[c+=e];++g<h;){var v=l[g],y=v.iteratee,b=v.type,x=y(m);if(2==b)m=x;else if(!x){if(1==b)continue t;break t}}d[f++]=m}return d},In.prototype.at=ro,In.prototype.chain=function(){return eo(this)},In.prototype.commit=function(){return new _n(this.value(),this.__chain__)},In.prototype.next=function(){void 0===this.__values__&&(this.__values__=na(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},In.prototype.plant=function(t){for(var e,n=this;n instanceof Tn;){var r=$s(n);r.__index__=0,r.__values__=void 0,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},In.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Pn){var e=t;return this.__actions__.length&&(e=new Pn(this)),(e=e.reverse()).__actions__.push({func:no,args:[Vs],thisArg:void 0}),new _n(e,this.__chain__)}return this.thru(Vs)},In.prototype.toJSON=In.prototype.valueOf=In.prototype.value=function(){return ri(this.__wrapped__,this.__actions__)},In.prototype.first=In.prototype.head,Jt&&(In.prototype[Jt]=function(){return this}),In}();Gt._=Xe,void 0===(i=function(){return Xe}.call(e,n,e,r))||(r.exports=i)}).call(this)}).call(this,n(6),n(180)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){angular.module("ui.bootstrap",["ui.bootstrap.tpls","ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.bindHtml","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.position","ui.bootstrap.datepicker","ui.bootstrap.dropdown","ui.bootstrap.modal","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.transition","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.tpls",["template/accordion/accordion-group.html","template/accordion/accordion.html","template/alert/alert.html","template/carousel/carousel.html","template/carousel/slide.html","template/datepicker/datepicker.html","template/datepicker/day.html","template/datepicker/month.html","template/datepicker/popup.html","template/datepicker/year.html","template/modal/backdrop.html","template/modal/window.html","template/pagination/pager.html","template/pagination/pagination.html","template/tooltip/tooltip-html-popup.html","template/tooltip/tooltip-html-unsafe-popup.html","template/tooltip/tooltip-popup.html","template/tooltip/tooltip-template-popup.html","template/popover/popover-template.html","template/popover/popover.html","template/progressbar/bar.html","template/progressbar/progress.html","template/progressbar/progressbar.html","template/rating/rating.html","template/tabs/tab.html","template/tabs/tabset.html","template/timepicker/timepicker.html","template/typeahead/typeahead-match.html","template/typeahead/typeahead-popup.html"]),angular.module("ui.bootstrap.collapse",[]).directive("collapse",["$animate",function(t){return{link:function(e,n,r){function i(){n.removeClass("collapse").addClass("collapsing"),t.addClass(n,"in",{to:{height:n[0].scrollHeight+"px"}}).then(s)}function s(){n.removeClass("collapsing"),n.css({height:"auto"})}function o(){n.css({height:n[0].scrollHeight+"px"}).removeClass("collapse").addClass("collapsing"),t.removeClass(n,"in",{to:{height:"0"}}).then(a)}function a(){n.css({height:"0"}),n.removeClass("collapsing"),n.addClass("collapse")}e.$watch(r.collapse,(function(t){t?o():i()}))}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("accordionConfig",{closeOthers:!0}).controller("AccordionController",["$scope","$attrs","accordionConfig",function(t,e,n){this.groups=[],this.closeOthers=function(r){(angular.isDefined(e.closeOthers)?t.$eval(e.closeOthers):n.closeOthers)&&angular.forEach(this.groups,(function(t){t!==r&&(t.isOpen=!1)}))},this.addGroup=function(t){var e=this;this.groups.push(t),t.$on("$destroy",(function(){e.removeGroup(t)}))},this.removeGroup=function(t){var e=this.groups.indexOf(t);-1!==e&&this.groups.splice(e,1)}}]).directive("accordion",(function(){return{restrict:"EA",controller:"AccordionController",transclude:!0,replace:!1,templateUrl:"template/accordion/accordion.html"}})).directive("accordionGroup",(function(){return{require:"^accordion",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/accordion/accordion-group.html",scope:{heading:"@",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(t){this.heading=t}},link:function(t,e,n,r){r.addGroup(t),t.$watch("isOpen",(function(e){e&&r.closeOthers(t)})),t.toggleOpen=function(){t.isDisabled||(t.isOpen=!t.isOpen)}}}})).directive("accordionHeading",(function(){return{restrict:"EA",transclude:!0,template:"",replace:!0,require:"^accordionGroup",link:function(t,e,n,r,i){r.setHeading(i(t,angular.noop))}}})).directive("accordionTransclude",(function(){return{require:"^accordionGroup",link:function(t,e,n,r){t.$watch((function(){return r[n.accordionTransclude]}),(function(t){t&&(e.html(""),e.append(t))}))}}})),angular.module("ui.bootstrap.alert",[]).controller("AlertController",["$scope","$attrs",function(t,e){t.closeable="close"in e,this.close=t.close}]).directive("alert",(function(){return{restrict:"EA",controller:"AlertController",templateUrl:"template/alert/alert.html",transclude:!0,replace:!0,scope:{type:"@",close:"&"}}})).directive("dismissOnTimeout",["$timeout",function(t){return{require:"alert",link:function(e,n,r,i){t((function(){i.close()}),parseInt(r.dismissOnTimeout,10))}}}]),angular.module("ui.bootstrap.bindHtml",[]).directive("bindHtmlUnsafe",(function(){return function(t,e,n){e.addClass("ng-binding").data("$binding",n.bindHtmlUnsafe),t.$watch(n.bindHtmlUnsafe,(function(t){e.html(t||"")}))}})),angular.module("ui.bootstrap.buttons",[]).constant("buttonConfig",{activeClass:"active",toggleEvent:"click"}).controller("ButtonsController",["buttonConfig",function(t){this.activeClass=t.activeClass||"active",this.toggleEvent=t.toggleEvent||"click"}]).directive("btnRadio",(function(){return{require:["btnRadio","ngModel"],controller:"ButtonsController",link:function(t,e,n,r){var i=r[0],s=r[1];s.$render=function(){e.toggleClass(i.activeClass,angular.equals(s.$modelValue,t.$eval(n.btnRadio)))},e.bind(i.toggleEvent,(function(){var r=e.hasClass(i.activeClass);(!r||angular.isDefined(n.uncheckable))&&t.$apply((function(){s.$setViewValue(r?null:t.$eval(n.btnRadio)),s.$render()}))}))}}})).directive("btnCheckbox",(function(){return{require:["btnCheckbox","ngModel"],controller:"ButtonsController",link:function(t,e,n,r){function i(){return s(n.btnCheckboxTrue,!0)}function s(e,n){var r=t.$eval(e);return angular.isDefined(r)?r:n}var o=r[0],a=r[1];a.$render=function(){e.toggleClass(o.activeClass,angular.equals(a.$modelValue,i()))},e.bind(o.toggleEvent,(function(){t.$apply((function(){a.$setViewValue(e.hasClass(o.activeClass)?s(n.btnCheckboxFalse,!1):i()),a.$render()}))}))}}})),angular.module("ui.bootstrap.carousel",[]).controller("CarouselController",["$scope","$interval","$animate",function(t,e,n){function r(t){if(angular.isUndefined(l[t].index))return l[t];var e;for(l.length,e=0;e<l.length;++e)if(l[e].index==t)return l[e]}function i(){s();var n=+t.interval;!isNaN(n)&&n>0&&(a=e(o,n))}function s(){a&&(e.cancel(a),a=null)}function o(){var e=+t.interval;u&&!isNaN(e)&&e>0?t.next():t.pause()}var a,u,c=this,l=c.slides=t.slides=[],h=-1;c.currentSlide=null;var f=!1;c.select=t.select=function(e,r){var s=c.indexOfSlide(e);void 0===r&&(r=s>c.getCurrentIndex()?"next":"prev"),e&&e!==c.currentSlide&&(f||(angular.extend(e,{direction:r,active:!0}),angular.extend(c.currentSlide||{},{direction:r,active:!1}),n.enabled()&&!t.noTransition&&e.$element&&(t.$currentTransition=!0,e.$element.one("$animate:close",(function(){t.$currentTransition=null}))),c.currentSlide=e,h=s,i()))},t.$on("$destroy",(function(){f=!0})),c.getCurrentIndex=function(){return c.currentSlide&&angular.isDefined(c.currentSlide.index)?+c.currentSlide.index:h},c.indexOfSlide=function(t){return angular.isDefined(t.index)?+t.index:l.indexOf(t)},t.next=function(){var e=(c.getCurrentIndex()+1)%l.length;return t.$currentTransition?void 0:c.select(r(e),"next")},t.prev=function(){var e=c.getCurrentIndex()-1<0?l.length-1:c.getCurrentIndex()-1;return t.$currentTransition?void 0:c.select(r(e),"prev")},t.isActive=function(t){return c.currentSlide===t},t.$watch("interval",i),t.$on("$destroy",s),t.play=function(){u||(u=!0,i())},t.pause=function(){t.noPause||(u=!1,s())},c.addSlide=function(e,n){e.$element=n,l.push(e),1===l.length||e.active?(c.select(l[l.length-1]),1==l.length&&t.play()):e.active=!1},c.removeSlide=function(t){angular.isDefined(t.index)&&l.sort((function(t,e){return+t.index>+e.index}));var e=l.indexOf(t);l.splice(e,1),l.length>0&&t.active?c.select(e>=l.length?l[e-1]:l[e]):h>e&&h--}}]).directive("carousel",[function(){return{restrict:"EA",transclude:!0,replace:!0,controller:"CarouselController",require:"carousel",templateUrl:"template/carousel/carousel.html",scope:{interval:"=",noTransition:"=",noPause:"="}}}]).directive("slide",(function(){return{require:"^carousel",restrict:"EA",transclude:!0,replace:!0,templateUrl:"template/carousel/slide.html",scope:{active:"=?",index:"=?"},link:function(t,e,n,r){r.addSlide(t,e),t.$on("$destroy",(function(){r.removeSlide(t)})),t.$watch("active",(function(e){e&&r.select(t)}))}}})).animation(".item",["$animate",function(t){return{beforeAddClass:function(e,n,r){if("active"==n&&e.parent()&&!e.parent().scope().noTransition){var i=!1,s=e.isolateScope().direction,o="next"==s?"left":"right";return e.addClass(s),t.addClass(e,o).then((function(){i||e.removeClass(o+" "+s),r()})),function(){i=!0}}r()},beforeRemoveClass:function(e,n,r){if("active"==n&&e.parent()&&!e.parent().scope().noTransition){var i=!1,s="next"==e.isolateScope().direction?"left":"right";return t.addClass(e,s).then((function(){i||e.removeClass(s),r()})),function(){i=!0}}r()}}}]),angular.module("ui.bootstrap.dateparser",[]).service("dateParser",["$locale","orderByFilter",function(t,e){function n(t){var n=[],r=t.split("");return angular.forEach(i,(function(e,i){var s=t.indexOf(i);if(s>-1){t=t.split(""),r[s]="("+e.regex+")",t[s]="$";for(var o=s+1,a=s+i.length;a>o;o++)r[o]="",t[o]="$";t=t.join(""),n.push({index:s,apply:e.apply})}})),{regex:new RegExp("^"+r.join("")+"$"),map:e(n,"index")}}var r=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;this.parsers={};var i={yyyy:{regex:"\\d{4}",apply:function(t){this.year=+t}},yy:{regex:"\\d{2}",apply:function(t){this.year=+t+2e3}},y:{regex:"\\d{1,4}",apply:function(t){this.year=+t}},MMMM:{regex:t.DATETIME_FORMATS.MONTH.join("|"),apply:function(e){this.month=t.DATETIME_FORMATS.MONTH.indexOf(e)}},MMM:{regex:t.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(e){this.month=t.DATETIME_FORMATS.SHORTMONTH.indexOf(e)}},MM:{regex:"0[1-9]|1[0-2]",apply:function(t){this.month=t-1}},M:{regex:"[1-9]|1[0-2]",apply:function(t){this.month=t-1}},dd:{regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(t){this.date=+t}},d:{regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(t){this.date=+t}},EEEE:{regex:t.DATETIME_FORMATS.DAY.join("|")},EEE:{regex:t.DATETIME_FORMATS.SHORTDAY.join("|")},HH:{regex:"(?:0|1)[0-9]|2[0-3]",apply:function(t){this.hours=+t}},H:{regex:"1?[0-9]|2[0-3]",apply:function(t){this.hours=+t}},mm:{regex:"[0-5][0-9]",apply:function(t){this.minutes=+t}},m:{regex:"[0-9]|[1-5][0-9]",apply:function(t){this.minutes=+t}},sss:{regex:"[0-9][0-9][0-9]",apply:function(t){this.milliseconds=+t}},ss:{regex:"[0-5][0-9]",apply:function(t){this.seconds=+t}},s:{regex:"[0-9]|[1-5][0-9]",apply:function(t){this.seconds=+t}}};this.parse=function(e,i,s){if(!angular.isString(e)||!i)return e;i=(i=t.DATETIME_FORMATS[i]||i).replace(r,"\\$&"),this.parsers[i]||(this.parsers[i]=n(i));var o=this.parsers[i],a=o.regex,u=o.map,c=e.match(a);if(c&&c.length){var l,h;l=s?{year:s.getFullYear(),month:s.getMonth(),date:s.getDate(),hours:s.getHours(),minutes:s.getMinutes(),seconds:s.getSeconds(),milliseconds:s.getMilliseconds()}:{year:1900,month:0,date:1,hours:0,minutes:0,seconds:0,milliseconds:0};for(var f=1,p=c.length;p>f;f++){var d=u[f-1];d.apply&&d.apply.call(l,c[f])}return function(t,e,n){return!(1>n)&&(1===e&&n>28?29===n&&(t%4==0&&t%100!=0||t%400==0):3!==e&&5!==e&&8!==e&&10!==e||31>n)}(l.year,l.month,l.date)&&(h=new Date(l.year,l.month,l.date,l.hours,l.minutes,l.seconds,l.milliseconds||0)),h}}}]),angular.module("ui.bootstrap.position",[]).factory("$position",["$document","$window",function(t,e){function n(t){return"static"===(function(t,n){return t.currentStyle?t.currentStyle[n]:e.getComputedStyle?e.getComputedStyle(t)[n]:t.style[n]}(t,"position")||"static")}var r=function(e){for(var r=t[0],i=e.offsetParent||r;i&&i!==r&&n(i);)i=i.offsetParent;return i||r};return{position:function(e){var n=this.offset(e),i={top:0,left:0},s=r(e[0]);s!=t[0]&&((i=this.offset(angular.element(s))).top+=s.clientTop-s.scrollTop,i.left+=s.clientLeft-s.scrollLeft);var o=e[0].getBoundingClientRect();return{width:o.width||e.prop("offsetWidth"),height:o.height||e.prop("offsetHeight"),top:n.top-i.top,left:n.left-i.left}},offset:function(n){var r=n[0].getBoundingClientRect();return{width:r.width||n.prop("offsetWidth"),height:r.height||n.prop("offsetHeight"),top:r.top+(e.pageYOffset||t[0].documentElement.scrollTop),left:r.left+(e.pageXOffset||t[0].documentElement.scrollLeft)}},positionElements:function(t,e,n,r){var i,s,o,a,u=n.split("-"),c=u[0],l=u[1]||"center";i=r?this.offset(t):this.position(t),s=e.prop("offsetWidth"),o=e.prop("offsetHeight");var h={center:function(){return i.left+i.width/2-s/2},left:function(){return i.left},right:function(){return i.left+i.width}},f={center:function(){return i.top+i.height/2-o/2},top:function(){return i.top},bottom:function(){return i.top+i.height}};switch(c){case"right":a={top:f[l](),left:h[c]()};break;case"left":a={top:f[l](),left:i.left-s};break;case"bottom":a={top:f[c](),left:h[l]()};break;default:a={top:i.top-o,left:h[l]()}}return a}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.position"]).constant("datepickerConfig",{formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",datepickerMode:"day",minMode:"day",maxMode:"year",showWeeks:!0,startingDay:0,yearRange:20,minDate:null,maxDate:null,shortcutPropagation:!1}).controller("DatepickerController",["$scope","$attrs","$parse","$interpolate","$timeout","$log","dateFilter","datepickerConfig",function(t,e,n,r,i,s,o,a){var u=this,c={$setViewValue:angular.noop};this.modes=["day","month","year"],angular.forEach(["formatDay","formatMonth","formatYear","formatDayHeader","formatDayTitle","formatMonthTitle","minMode","maxMode","showWeeks","startingDay","yearRange","shortcutPropagation"],(function(n,i){u[n]=angular.isDefined(e[n])?8>i?r(e[n])(t.$parent):t.$parent.$eval(e[n]):a[n]})),angular.forEach(["minDate","maxDate"],(function(r){e[r]?t.$parent.$watch(n(e[r]),(function(t){u[r]=t?new Date(t):null,u.refreshView()})):u[r]=a[r]?new Date(a[r]):null})),t.datepickerMode=t.datepickerMode||a.datepickerMode,t.maxMode=u.maxMode,t.uniqueId="datepicker-"+t.$id+"-"+Math.floor(1e4*Math.random()),angular.isDefined(e.initDate)?(this.activeDate=t.$parent.$eval(e.initDate)||new Date,t.$parent.$watch(e.initDate,(function(t){t&&(c.$isEmpty(c.$modelValue)||c.$invalid)&&(u.activeDate=t,u.refreshView())}))):this.activeDate=new Date,t.isActive=function(e){return 0===u.compare(e.date,u.activeDate)&&(t.activeDateId=e.uid,!0)},this.init=function(t){(c=t).$render=function(){u.render()}},this.render=function(){if(c.$viewValue){var t=new Date(c.$viewValue),e=!isNaN(t);e?this.activeDate=t:s.error('Datepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.'),c.$setValidity("date",e)}this.refreshView()},this.refreshView=function(){if(this.element){this._refreshView();var t=c.$viewValue?new Date(c.$viewValue):null;c.$setValidity("date-disabled",!t||this.element&&!this.isDisabled(t))}},this.createDateObject=function(t,e){var n=c.$viewValue?new Date(c.$viewValue):null;return{date:t,label:o(t,e),selected:n&&0===this.compare(t,n),disabled:this.isDisabled(t),current:0===this.compare(t,new Date),customClass:this.customClass(t)}},this.isDisabled=function(n){return this.minDate&&this.compare(n,this.minDate)<0||this.maxDate&&this.compare(n,this.maxDate)>0||e.dateDisabled&&t.dateDisabled({date:n,mode:t.datepickerMode})},this.customClass=function(e){return t.customClass({date:e,mode:t.datepickerMode})},this.split=function(t,e){for(var n=[];t.length>0;)n.push(t.splice(0,e));return n},t.select=function(e){if(t.datepickerMode===u.minMode){var n=c.$viewValue?new Date(c.$viewValue):new Date(0,0,0,0,0,0,0);n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),c.$setViewValue(n),c.$render()}else u.activeDate=e,t.datepickerMode=u.modes[u.modes.indexOf(t.datepickerMode)-1]},t.move=function(t){var e=u.activeDate.getFullYear()+t*(u.step.years||0),n=u.activeDate.getMonth()+t*(u.step.months||0);u.activeDate.setFullYear(e,n,1),u.refreshView()},t.toggleMode=function(e){e=e||1,t.datepickerMode===u.maxMode&&1===e||t.datepickerMode===u.minMode&&-1===e||(t.datepickerMode=u.modes[u.modes.indexOf(t.datepickerMode)+e])},t.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var l=function(){i((function(){u.element[0].focus()}),0,!1)};t.$on("datepicker.focus",l),t.keydown=function(e){var n=t.keys[e.which];if(n&&!e.shiftKey&&!e.altKey)if(e.preventDefault(),u.shortcutPropagation||e.stopPropagation(),"enter"===n||"space"===n){if(u.isDisabled(u.activeDate))return;t.select(u.activeDate),l()}else!e.ctrlKey||"up"!==n&&"down"!==n?(u.handleKeyDown(n,e),u.refreshView()):(t.toggleMode("up"===n?1:-1),l())}}]).directive("datepicker",(function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/datepicker.html",scope:{datepickerMode:"=?",dateDisabled:"&",customClass:"&",shortcutPropagation:"&?"},require:["datepicker","?^ngModel"],controller:"DatepickerController",link:function(t,e,n,r){var i=r[0],s=r[1];s&&i.init(s)}}})).directive("daypicker",["dateFilter",function(t){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/day.html",require:"^datepicker",link:function(e,n,r,i){function s(t,e){return 1!==e||t%4!=0||t%100==0&&t%400!=0?a[e]:29}function o(t){var e=new Date(t);e.setDate(e.getDate()+4-(e.getDay()||7));var n=e.getTime();return e.setMonth(0),e.setDate(1),Math.floor(Math.round((n-e)/864e5)/7)+1}e.showWeeks=i.showWeeks,i.step={months:1},i.element=n;var a=[31,28,31,30,31,30,31,31,30,31,30,31];i._refreshView=function(){var n=i.activeDate.getFullYear(),r=i.activeDate.getMonth(),s=new Date(n,r,1),a=i.startingDay-s.getDay(),u=a>0?7-a:-a,c=new Date(s);u>0&&c.setDate(1-u);for(var l=function(t,e){var n=new Array(e),r=new Date(t),i=0;for(r.setHours(12);e>i;)n[i++]=new Date(r),r.setDate(r.getDate()+1);return n}(c,42),h=0;42>h;h++)l[h]=angular.extend(i.createDateObject(l[h],i.formatDay),{secondary:l[h].getMonth()!==r,uid:e.uniqueId+"-"+h});e.labels=new Array(7);for(var f=0;7>f;f++)e.labels[f]={abbr:t(l[f].date,i.formatDayHeader),full:t(l[f].date,"EEEE")};if(e.title=t(i.activeDate,i.formatDayTitle),e.rows=i.split(l,7),e.showWeeks){e.weekNumbers=[];for(var p=(11-i.startingDay)%7,d=e.rows.length,g=0;d>g;g++)e.weekNumbers.push(o(e.rows[g][p].date))}},i.compare=function(t,e){return new Date(t.getFullYear(),t.getMonth(),t.getDate())-new Date(e.getFullYear(),e.getMonth(),e.getDate())},i.handleKeyDown=function(t){var e=i.activeDate.getDate();if("left"===t)e-=1;else if("up"===t)e-=7;else if("right"===t)e+=1;else if("down"===t)e+=7;else if("pageup"===t||"pagedown"===t){var n=i.activeDate.getMonth()+("pageup"===t?-1:1);i.activeDate.setMonth(n,1),e=Math.min(s(i.activeDate.getFullYear(),i.activeDate.getMonth()),e)}else"home"===t?e=1:"end"===t&&(e=s(i.activeDate.getFullYear(),i.activeDate.getMonth()));i.activeDate.setDate(e)},i.refreshView()}}}]).directive("monthpicker",["dateFilter",function(t){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/month.html",require:"^datepicker",link:function(e,n,r,i){i.step={years:1},i.element=n,i._refreshView=function(){for(var n=new Array(12),r=i.activeDate.getFullYear(),s=0;12>s;s++)n[s]=angular.extend(i.createDateObject(new Date(r,s,1),i.formatMonth),{uid:e.uniqueId+"-"+s});e.title=t(i.activeDate,i.formatMonthTitle),e.rows=i.split(n,3)},i.compare=function(t,e){return new Date(t.getFullYear(),t.getMonth())-new Date(e.getFullYear(),e.getMonth())},i.handleKeyDown=function(t){var e=i.activeDate.getMonth();if("left"===t)e-=1;else if("up"===t)e-=3;else if("right"===t)e+=1;else if("down"===t)e+=3;else if("pageup"===t||"pagedown"===t){var n=i.activeDate.getFullYear()+("pageup"===t?-1:1);i.activeDate.setFullYear(n)}else"home"===t?e=0:"end"===t&&(e=11);i.activeDate.setMonth(e)},i.refreshView()}}}]).directive("yearpicker",["dateFilter",function(){return{restrict:"EA",replace:!0,templateUrl:"template/datepicker/year.html",require:"^datepicker",link:function(t,e,n,r){function i(t){return parseInt((t-1)/s,10)*s+1}var s=r.yearRange;r.step={years:s},r.element=e,r._refreshView=function(){for(var e=new Array(s),n=0,o=i(r.activeDate.getFullYear());s>n;n++)e[n]=angular.extend(r.createDateObject(new Date(o+n,0,1),r.formatYear),{uid:t.uniqueId+"-"+n});t.title=[e[0].label,e[s-1].label].join(" - "),t.rows=r.split(e,5)},r.compare=function(t,e){return t.getFullYear()-e.getFullYear()},r.handleKeyDown=function(t){var e=r.activeDate.getFullYear();"left"===t?e-=1:"up"===t?e-=5:"right"===t?e+=1:"down"===t?e+=5:"pageup"===t||"pagedown"===t?e+=("pageup"===t?-1:1)*r.step.years:"home"===t?e=i(r.activeDate.getFullYear()):"end"===t&&(e=i(r.activeDate.getFullYear())+s-1),r.activeDate.setFullYear(e)},r.refreshView()}}}]).constant("datepickerPopupConfig",{datepickerPopup:"yyyy-MM-dd",html5Types:{date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm:ss.sss",month:"yyyy-MM"},currentText:"Today",clearText:"Clear",closeText:"Done",closeOnDateSelection:!0,appendToBody:!1,showButtonBar:!0}).directive("datepickerPopup",["$compile","$parse","$document","$position","dateFilter","dateParser","datepickerPopupConfig",function(t,e,n,r,i,s,o){return{restrict:"EA",require:"ngModel",scope:{isOpen:"=?",currentText:"@",clearText:"@",closeText:"@",dateDisabled:"&",customClass:"&"},link:function(a,u,c,l){function h(t){return t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))}var f,p=angular.isDefined(c.closeOnDateSelection)?a.$parent.$eval(c.closeOnDateSelection):o.closeOnDateSelection,d=angular.isDefined(c.datepickerAppendToBody)?a.$parent.$eval(c.datepickerAppendToBody):o.appendToBody;a.showButtonBar=angular.isDefined(c.showButtonBar)?a.$parent.$eval(c.showButtonBar):o.showButtonBar,a.getText=function(t){return a[t+"Text"]||o[t+"Text"]};var g=!1;if(o.html5Types[c.type]?(f=o.html5Types[c.type],g=!0):(f=c.datepickerPopup||o.datepickerPopup,c.$observe("datepickerPopup",(function(t){var e=t||o.datepickerPopup;if(e!==f&&(f=e,l.$modelValue=null,!f))throw new Error("datepickerPopup must have a date format specified.")}))),!f)throw new Error("datepickerPopup must have a date format specified.");if(g&&c.datepickerPopup)throw new Error("HTML5 date input types do not support custom formats.");var m=angular.element("<div datepicker-popup-wrap><div datepicker></div></div>");m.attr({"ng-model":"date","ng-change":"dateSelection()"});var v=angular.element(m.children()[0]);if(g&&"month"==c.type&&(v.attr("datepicker-mode",'"month"'),v.attr("min-mode","month")),c.datepickerOptions){var y=a.$parent.$eval(c.datepickerOptions);y.initDate&&(a.initDate=y.initDate,v.attr("init-date","initDate"),delete y.initDate),angular.forEach(y,(function(t,e){v.attr(h(e),t)}))}a.watchData={},angular.forEach(["minDate","maxDate","datepickerMode","initDate","shortcutPropagation"],(function(t){if(c[t]){var n=e(c[t]);if(a.$parent.$watch(n,(function(e){a.watchData[t]=e})),v.attr(h(t),"watchData."+t),"datepickerMode"===t){var r=n.assign;a.$watch("watchData."+t,(function(t,e){t!==e&&r(a.$parent,t)}))}}})),c.dateDisabled&&v.attr("date-disabled","dateDisabled({ date: date, mode: mode })"),c.showWeeks&&v.attr("show-weeks",c.showWeeks),c.customClass&&v.attr("custom-class","customClass({ date: date, mode: mode })"),g?l.$formatters.push((function(t){return a.date=t,t})):(l.$$parserName="date",l.$validators.date=function(t,e){var n=t||e;if(angular.isNumber(n)&&(n=new Date(n)),n){if(angular.isDate(n)&&!isNaN(n))return!0;if(angular.isString(n)){var r=s.parse(n,f)||new Date(n);return!isNaN(r)}return!1}return!0},l.$parsers.unshift((function(t){if(angular.isNumber(t)&&(t=new Date(t)),!t)return null;if(angular.isDate(t)&&!isNaN(t))return t;if(angular.isString(t)){var e=s.parse(t,f,a.date)||new Date(t);return isNaN(e)?void 0:e}})),l.$formatters.push((function(t){return a.date=t,l.$isEmpty(t)?t:i(t,f)}))),a.dateSelection=function(t){angular.isDefined(t)&&(a.date=t);var e=a.date?i(a.date,f):"";u.val(e),l.$setViewValue(e),p&&(a.isOpen=!1,u[0].focus())},l.$viewChangeListeners.push((function(){a.date=s.parse(l.$viewValue,f,a.date)||new Date(l.$viewValue)}));var b=function(t){a.isOpen&&t.target!==u[0]&&a.$apply((function(){a.isOpen=!1}))},x=function(t){a.keydown(t)};u.bind("keydown",x),a.keydown=function(t){27===t.which?(t.preventDefault(),a.isOpen&&t.stopPropagation(),a.close()):40!==t.which||a.isOpen||(a.isOpen=!0)},a.$watch("isOpen",(function(t){t?(a.$broadcast("datepicker.focus"),a.position=d?r.offset(u):r.position(u),a.position.top=a.position.top+u.prop("offsetHeight"),n.bind("click",b)):n.unbind("click",b)})),a.select=function(t){if("today"===t){var e=new Date;angular.isDate(a.date)?(t=new Date(a.date)).setFullYear(e.getFullYear(),e.getMonth(),e.getDate()):t=new Date(e.setHours(0,0,0,0))}a.dateSelection(t)},a.close=function(){a.isOpen=!1,u[0].focus()};var w=t(m)(a);m.remove(),d?n.find("body").append(w):u.after(w),a.$on("$destroy",(function(){w.remove(),u.unbind("keydown",x),n.unbind("click",b)}))}}}]).directive("datepickerPopupWrap",(function(){return{restrict:"EA",replace:!0,transclude:!0,templateUrl:"template/datepicker/popup.html",link:function(t,e){e.bind("click",(function(t){t.preventDefault(),t.stopPropagation()}))}}})),angular.module("ui.bootstrap.dropdown",["ui.bootstrap.position"]).constant("dropdownConfig",{openClass:"open"}).service("dropdownService",["$document","$rootScope",function(t,e){var n=null;this.open=function(e){n||(t.bind("click",r),t.bind("keydown",i)),n&&n!==e&&(n.isOpen=!1),n=e},this.close=function(e){n===e&&(n=null,t.unbind("click",r),t.unbind("keydown",i))};var r=function(t){if(n&&(!t||"disabled"!==n.getAutoClose())){var r=n.getToggleElement();if(!(t&&r&&r[0].contains(t.target))){var i=n.getElement();t&&"outsideClick"===n.getAutoClose()&&i&&i[0].contains(t.target)||(n.isOpen=!1,e.$$phase||n.$apply())}}},i=function(t){27===t.which&&(n.focusToggleElement(),r())}}]).controller("DropdownController",["$scope","$attrs","$parse","dropdownConfig","dropdownService","$animate","$position","$document",function(t,e,n,r,i,s,o,a){var u,c=this,l=t.$new(),h=r.openClass,f=angular.noop,p=e.onToggle?n(e.onToggle):angular.noop,d=!1;this.init=function(r){c.$element=r,e.isOpen&&(u=n(e.isOpen),f=u.assign,t.$watch(u,(function(t){l.isOpen=!!t}))),(d=angular.isDefined(e.dropdownAppendToBody))&&c.dropdownMenu&&(a.find("body").append(c.dropdownMenu),r.on("$destroy",(function(){c.dropdownMenu.remove()})))},this.toggle=function(t){return l.isOpen=arguments.length?!!t:!l.isOpen},this.isOpen=function(){return l.isOpen},l.getToggleElement=function(){return c.toggleElement},l.getAutoClose=function(){return e.autoClose||"always"},l.getElement=function(){return c.$element},l.focusToggleElement=function(){c.toggleElement&&c.toggleElement[0].focus()},l.$watch("isOpen",(function(e,n){if(d&&c.dropdownMenu){var r=o.positionElements(c.$element,c.dropdownMenu,"bottom-left",!0);c.dropdownMenu.css({top:r.top+"px",left:r.left+"px",display:e?"block":"none"})}s[e?"addClass":"removeClass"](c.$element,h),e?(l.focusToggleElement(),i.open(l)):i.close(l),f(t,e),angular.isDefined(e)&&e!==n&&p(t,{open:!!e})})),t.$on("$locationChangeSuccess",(function(){l.isOpen=!1})),t.$on("$destroy",(function(){l.$destroy()}))}]).directive("dropdown",(function(){return{controller:"DropdownController",link:function(t,e,n,r){r.init(e)}}})).directive("dropdownMenu",(function(){return{restrict:"AC",require:"?^dropdown",link:function(t,e,n,r){r&&(r.dropdownMenu=e)}}})).directive("dropdownToggle",(function(){return{require:"?^dropdown",link:function(t,e,n,r){if(r){r.toggleElement=e;var i=function(i){i.preventDefault(),e.hasClass("disabled")||n.disabled||t.$apply((function(){r.toggle()}))};e.bind("click",i),e.attr({"aria-haspopup":!0,"aria-expanded":!1}),t.$watch(r.isOpen,(function(t){e.attr("aria-expanded",!!t)})),t.$on("$destroy",(function(){e.unbind("click",i)}))}}}})),angular.module("ui.bootstrap.modal",[]).factory("$$stackedMap",(function(){return{createNew:function(){var t=[];return{add:function(e,n){t.push({key:e,value:n})},get:function(e){for(var n=0;n<t.length;n++)if(e==t[n].key)return t[n]},keys:function(){for(var e=[],n=0;n<t.length;n++)e.push(t[n].key);return e},top:function(){return t[t.length-1]},remove:function(e){for(var n=-1,r=0;r<t.length;r++)if(e==t[r].key){n=r;break}return t.splice(n,1)[0]},removeTop:function(){return t.splice(t.length-1,1)[0]},length:function(){return t.length}}}}})).directive("modalBackdrop",["$timeout",function(t){function e(e){e.animate=!1,t((function(){e.animate=!0}))}return{restrict:"EA",replace:!0,templateUrl:"template/modal/backdrop.html",compile:function(t,n){return t.addClass(n.backdropClass),e}}}]).directive("modalWindow",["$modalStack","$q",function(t,e){return{restrict:"EA",scope:{index:"@",animate:"="},replace:!0,transclude:!0,templateUrl:function(t,e){return e.templateUrl||"template/modal/window.html"},link:function(n,r,i){r.addClass(i.windowClass||""),n.size=i.size,n.close=function(e){var n=t.getTop();n&&n.value.backdrop&&"static"!=n.value.backdrop&&e.target===e.currentTarget&&(e.preventDefault(),e.stopPropagation(),t.dismiss(n.key,"backdrop click"))},n.$isRendered=!0;var s=e.defer();i.$observe("modalRender",(function(t){"true"==t&&s.resolve()})),s.promise.then((function(){n.animate=!0;var e=r[0].querySelectorAll("[autofocus]");e.length?e[0].focus():r[0].focus();var i=t.getTop();i&&t.modalRendered(i.key)}))}}}]).directive("modalAnimationClass",[function(){return{compile:function(t,e){e.modalAnimation&&t.addClass(e.modalAnimationClass)}}}]).directive("modalTransclude",(function(){return{link:function(t,e,n,r,i){i(t.$parent,(function(t){e.empty(),e.append(t)}))}}})).factory("$modalStack",["$animate","$timeout","$document","$compile","$rootScope","$$stackedMap",function(t,e,n,r,i,s){function o(){for(var t=-1,e=p.keys(),n=0;n<e.length;n++)p.get(e[n]).value.backdrop&&(t=n);return t}function a(t){var e=n.find("body").eq(0),r=p.get(t).value;p.remove(t),u(r.modalDomEl,r.modalScope,(function(){e.toggleClass(f,p.length()>0),function(){if(l&&-1==o()){u(l,h,(function(){null})),l=void 0,h=void 0}}()}))}function u(n,r,s){function o(){o.done||(o.done=!0,n.remove(),r.$destroy(),s&&s())}r.animate=!1,n.attr("modal-animation")&&t.enabled()?n.one("$animate:close",(function(){i.$evalAsync(o)})):e(o)}function c(t,e,n){return!t.value.modalScope.$broadcast("modal.closing",e,n).defaultPrevented}var l,h,f="modal-open",p=s.createNew(),d={};return i.$watch(o,(function(t){h&&(h.index=t)})),n.bind("keydown",(function(t){var e;27===t.which&&((e=p.top())&&e.value.keyboard&&(t.preventDefault(),i.$apply((function(){d.dismiss(e.key,"escape key press")}))))})),d.open=function(t,e){var s=n[0].activeElement;p.add(t,{deferred:e.deferred,renderDeferred:e.renderDeferred,modalScope:e.scope,backdrop:e.backdrop,keyboard:e.keyboard});var a=n.find("body").eq(0),u=o();if(u>=0&&!l){(h=i.$new(!0)).index=u;var c=angular.element('<div modal-backdrop="modal-backdrop"></div>');c.attr("backdrop-class",e.backdropClass),e.animation&&c.attr("modal-animation","true"),l=r(c)(h),a.append(l)}var d=angular.element('<div modal-window="modal-window"></div>');d.attr({"template-url":e.windowTemplateUrl,"window-class":e.windowClass,size:e.size,index:p.length()-1,animate:"animate"}).html(e.content),e.animation&&d.attr("modal-animation","true");var g=r(d)(e.scope);p.top().value.modalDomEl=g,p.top().value.modalOpener=s,a.append(g),a.addClass(f)},d.close=function(t,e){var n=p.get(t);return n&&c(n,e,!0)?(n.value.deferred.resolve(e),a(t),n.value.modalOpener.focus(),!0):!n},d.dismiss=function(t,e){var n=p.get(t);return n&&c(n,e,!1)?(n.value.deferred.reject(e),a(t),n.value.modalOpener.focus(),!0):!n},d.dismissAll=function(t){for(var e=this.getTop();e&&this.dismiss(e.key,t);)e=this.getTop()},d.getTop=function(){return p.top()},d.modalRendered=function(t){var e=p.get(t);e&&e.value.renderDeferred.resolve()},d}]).provider("$modal",(function(){var t={options:{animation:!0,backdrop:!0,keyboard:!0},$get:["$injector","$rootScope","$q","$templateRequest","$controller","$modalStack",function(e,n,r,i,s,o){function a(t){return t.template?r.when(t.template):i(angular.isFunction(t.templateUrl)?t.templateUrl():t.templateUrl)}function u(t){var n=[];return angular.forEach(t,(function(t){(angular.isFunction(t)||angular.isArray(t))&&n.push(r.when(e.invoke(t)))})),n}var c={open:function(e){var i=r.defer(),c=r.defer(),l=r.defer(),h={result:i.promise,opened:c.promise,rendered:l.promise,close:function(t){return o.close(h,t)},dismiss:function(t){return o.dismiss(h,t)}};if((e=angular.extend({},t.options,e)).resolve=e.resolve||{},!e.template&&!e.templateUrl)throw new Error("One of template or templateUrl options is required.");var f=r.all([a(e)].concat(u(e.resolve)));return f.then((function(t){var r=(e.scope||n).$new();r.$close=h.close,r.$dismiss=h.dismiss;var a,u={},c=1;e.controller&&(u.$scope=r,u.$modalInstance=h,angular.forEach(e.resolve,(function(e,n){u[n]=t[c++]})),a=s(e.controller,u),e.controllerAs&&(r[e.controllerAs]=a)),o.open(h,{scope:r,deferred:i,renderDeferred:l,content:t[0],animation:e.animation,backdrop:e.backdrop,keyboard:e.keyboard,backdropClass:e.backdropClass,windowClass:e.windowClass,windowTemplateUrl:e.windowTemplateUrl,size:e.size})}),(function(t){i.reject(t)})),f.then((function(){c.resolve(!0)}),(function(t){c.reject(t)})),h}};return c}]};return t})),angular.module("ui.bootstrap.pagination",[]).controller("PaginationController",["$scope","$attrs","$parse",function(t,e,n){var r=this,i={$setViewValue:angular.noop},s=e.numPages?n(e.numPages).assign:angular.noop;this.init=function(o,a){i=o,this.config=a,i.$render=function(){r.render()},e.itemsPerPage?t.$parent.$watch(n(e.itemsPerPage),(function(e){r.itemsPerPage=parseInt(e,10),t.totalPages=r.calculateTotalPages()})):this.itemsPerPage=a.itemsPerPage,t.$watch("totalItems",(function(){t.totalPages=r.calculateTotalPages()})),t.$watch("totalPages",(function(e){s(t.$parent,e),t.page>e?t.selectPage(e):i.$render()}))},this.calculateTotalPages=function(){var e=this.itemsPerPage<1?1:Math.ceil(t.totalItems/this.itemsPerPage);return Math.max(e||0,1)},this.render=function(){t.page=parseInt(i.$viewValue,10)||1},t.selectPage=function(e,n){t.page!==e&&e>0&&e<=t.totalPages&&(n&&n.target&&n.target.blur(),i.$setViewValue(e),i.$render())},t.getText=function(e){return t[e+"Text"]||r.config[e+"Text"]},t.noPrevious=function(){return 1===t.page},t.noNext=function(){return t.page===t.totalPages}}]).constant("paginationConfig",{itemsPerPage:10,boundaryLinks:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0}).directive("pagination",["$parse","paginationConfig",function(t,e){return{restrict:"EA",scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@"},require:["pagination","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pagination.html",replace:!0,link:function(n,r,i,s){function o(t,e,n){return{number:t,text:e,active:n}}var a=s[0],u=s[1];if(u){var c=angular.isDefined(i.maxSize)?n.$parent.$eval(i.maxSize):e.maxSize,l=angular.isDefined(i.rotate)?n.$parent.$eval(i.rotate):e.rotate;n.boundaryLinks=angular.isDefined(i.boundaryLinks)?n.$parent.$eval(i.boundaryLinks):e.boundaryLinks,n.directionLinks=angular.isDefined(i.directionLinks)?n.$parent.$eval(i.directionLinks):e.directionLinks,a.init(u,e),i.maxSize&&n.$parent.$watch(t(i.maxSize),(function(t){c=parseInt(t,10),a.render()}));var h=a.render;a.render=function(){h(),n.page>0&&n.page<=n.totalPages&&(n.pages=function(t,e){var n=[],r=1,i=e,s=angular.isDefined(c)&&e>c;s&&(l?(i=(r=Math.max(t-Math.floor(c/2),1))+c-1)>e&&(r=(i=e)-c+1):(r=(Math.ceil(t/c)-1)*c+1,i=Math.min(r+c-1,e)));for(var a=r;i>=a;a++){var u=o(a,a,a===t);n.push(u)}if(s&&!l){if(r>1){var h=o(r-1,"...",!1);n.unshift(h)}if(e>i){var f=o(i+1,"...",!1);n.push(f)}}return n}(n.page,n.totalPages))}}}}}]).constant("pagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("pager",["pagerConfig",function(t){return{restrict:"EA",scope:{totalItems:"=",previousText:"@",nextText:"@"},require:["pager","?ngModel"],controller:"PaginationController",templateUrl:"template/pagination/pager.html",replace:!0,link:function(e,n,r,i){var s=i[0],o=i[1];o&&(e.align=angular.isDefined(r.align)?e.$parent.$eval(r.align):t.align,s.init(o,t))}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).provider("$tooltip",(function(){var t={placement:"top",animation:!0,popupDelay:0,useContentExp:!1},e={mouseenter:"mouseleave",click:"click",focus:"blur"},n={};this.options=function(t){angular.extend(n,t)},this.setTriggers=function(t){angular.extend(e,t)},this.$get=["$window","$compile","$timeout","$document","$position","$interpolate",function(r,i,s,o,a,u){return function(r,c,l,h){function f(t){var n=t||h.trigger||l;return{show:n,hide:e[n]||n}}h=angular.extend({},t,n,h);var p=function(t){return t.replace(/[A-Z]/g,(function(t,e){return(e?"-":"")+t.toLowerCase()}))}(r),d=u.startSymbol(),g=u.endSymbol(),m="<div "+p+'-popup title="'+d+"title"+g+'" '+(h.useContentExp?'content-exp="contentExp()" ':'content="'+d+"content"+g+'" ')+'placement="'+d+"placement"+g+'" popup-class="'+d+"popupClass"+g+'" animation="animation" is-open="isOpen"origin-scope="origScope" ></div>';return{restrict:"EA",compile:function(){var t=i(m);return function(e,n,i){function u(){F.isOpen?p():l()}function l(){(!E||e.$eval(i[c+"Enable"]))&&(F.popupClass=i[c+"Class"],function(){var t=i[c+"Placement"];F.placement=angular.isDefined(t)?t:h.placement}(),function(){var t=i[c+"PopupDelay"],e=parseInt(t,10);F.popupDelay=isNaN(e)?h.popupDelay:e}(),F.popupDelay?x||(x=s(d,F.popupDelay,!1)).then((function(t){t()})):d()())}function p(){e.$apply((function(){g()}))}function d(){return x=null,b&&(s.cancel(b),b=null),(h.useContentExp?F.contentExp():F.content)?(v&&m(),y=F.$new(),v=t(y,(function(t){w?o.find("body").append(t):n.after(t)})),y.$watch((function(){s(A,0,!1)})),h.useContentExp&&y.$watch("contentExp()",(function(t){!t&&F.isOpen&&g()})),v.css({top:0,left:0,display:"block"}),F.$digest(),A(),F.isOpen=!0,F.$apply(),A):angular.noop}function g(){F.isOpen=!1,s.cancel(x),x=null,F.animation?b||(b=s(m,500)):m()}function m(){b=null,v&&(v.remove(),v=null),y&&(y.$destroy(),y=null)}var v,y,b,x,w=!!angular.isDefined(h.appendToBody)&&h.appendToBody,S=f(void 0),E=angular.isDefined(i[c+"Enable"]),F=e.$new(!0),A=function(){if(v){var t=a.positionElements(n,v,F.placement,w);t.top+="px",t.left+="px",v.css(t)}};F.origScope=e,F.isOpen=!1,F.contentExp=function(){return e.$eval(i[r])},h.useContentExp||i.$observe(r,(function(t){F.content=t,!t&&F.isOpen&&g()})),i.$observe("disabled",(function(t){t&&F.isOpen&&g()})),i.$observe(c+"Title",(function(t){F.title=t}));var C=function(){n.unbind(S.show,l),n.unbind(S.hide,p)};!function(){var t=i[c+"Trigger"];C(),(S=f(t)).show===S.hide?n.bind(S.show,u):(n.bind(S.show,l),n.bind(S.hide,p))}();var D=e.$eval(i[c+"Animation"]);F.animation=angular.isDefined(D)?!!D:h.animation;var $=e.$eval(i[c+"AppendToBody"]);(w=angular.isDefined($)?$:w)&&e.$on("$locationChangeSuccess",(function(){F.isOpen&&g()})),e.$on("$destroy",(function(){s.cancel(b),s.cancel(x),C(),m(),F=null}))}}}}}]})).directive("tooltipTemplateTransclude",["$animate","$sce","$compile","$templateRequest",function(t,e,n,r){return{link:function(i,s,o){var a,u,c,l=i.$eval(o.tooltipTemplateTranscludeScope),h=0,f=function(){u&&(u.remove(),u=null),a&&(a.$destroy(),a=null),c&&(t.leave(c).then((function(){u=null})),u=c,c=null)};i.$watch(e.parseAsResourceUrl(o.tooltipTemplateTransclude),(function(e){var o=++h;e?(r(e,!0).then((function(r){if(o===h){var i=l.$new(),u=n(r)(i,(function(e){f(),t.enter(e,s)}));c=u,(a=i).$emit("$includeContentLoaded",e)}}),(function(){o===h&&(f(),i.$emit("$includeContentError",e))})),i.$emit("$includeContentRequested",e)):f()})),i.$on("$destroy",f)}}}]).directive("tooltipClasses",(function(){return{restrict:"A",link:function(t,e,n){t.placement&&e.addClass(t.placement),t.popupClass&&e.addClass(t.popupClass),t.animation()&&e.addClass(n.tooltipAnimationClass)}}})).directive("tooltipPopup",(function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-popup.html"}})).directive("tooltip",["$tooltip",function(t){return t("tooltip","tooltip","mouseenter")}]).directive("tooltipTemplatePopup",(function(){return{restrict:"EA",replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"template/tooltip/tooltip-template-popup.html"}})).directive("tooltipTemplate",["$tooltip",function(t){return t("tooltipTemplate","tooltip","mouseenter",{useContentExp:!0})}]).directive("tooltipHtmlPopup",(function(){return{restrict:"EA",replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-popup.html"}})).directive("tooltipHtml",["$tooltip",function(t){return t("tooltipHtml","tooltip","mouseenter",{useContentExp:!0})}]).directive("tooltipHtmlUnsafePopup",(function(){return{restrict:"EA",replace:!0,scope:{content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/tooltip/tooltip-html-unsafe-popup.html"}})).value("tooltipHtmlUnsafeSuppressDeprecated",!1).directive("tooltipHtmlUnsafe",["$tooltip","tooltipHtmlUnsafeSuppressDeprecated","$log",function(t,e,n){return e||n.warn("tooltip-html-unsafe is now deprecated. Use tooltip-html or tooltip-template instead."),t("tooltipHtmlUnsafe","tooltip","mouseenter")}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("popoverTemplatePopup",(function(){return{restrict:"EA",replace:!0,scope:{title:"@",contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"template/popover/popover-template.html"}})).directive("popoverTemplate",["$tooltip",function(t){return t("popoverTemplate","popover","click",{useContentExp:!0})}]).directive("popoverPopup",(function(){return{restrict:"EA",replace:!0,scope:{title:"@",content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"template/popover/popover.html"}})).directive("popover",["$tooltip",function(t){return t("popover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("progressConfig",{animate:!0,max:100}).controller("ProgressController",["$scope","$attrs","progressConfig",function(t,e,n){var r=this,i=angular.isDefined(e.animate)?t.$parent.$eval(e.animate):n.animate;this.bars=[],t.max=angular.isDefined(t.max)?t.max:n.max,this.addBar=function(e,n){i||n.css({transition:"none"}),this.bars.push(e),e.$watch("value",(function(n){e.percent=+(100*n/t.max).toFixed(2)})),e.$on("$destroy",(function(){n=null,r.removeBar(e)}))},this.removeBar=function(t){this.bars.splice(this.bars.indexOf(t),1)}}]).directive("progress",(function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",require:"progress",scope:{},templateUrl:"template/progressbar/progress.html"}})).directive("bar",(function(){return{restrict:"EA",replace:!0,transclude:!0,require:"^progress",scope:{value:"=",max:"=?",type:"@"},templateUrl:"template/progressbar/bar.html",link:function(t,e,n,r){r.addBar(t,e)}}})).directive("progressbar",(function(){return{restrict:"EA",replace:!0,transclude:!0,controller:"ProgressController",scope:{value:"=",max:"=?",type:"@"},templateUrl:"template/progressbar/progressbar.html",link:function(t,e,n,r){r.addBar(t,angular.element(e.children()[0]))}}})),angular.module("ui.bootstrap.rating",[]).constant("ratingConfig",{max:5,stateOn:null,stateOff:null}).controller("RatingController",["$scope","$attrs","ratingConfig",function(t,e,n){var r={$setViewValue:angular.noop};this.init=function(i){(r=i).$render=this.render,r.$formatters.push((function(t){return angular.isNumber(t)&&t<<0!==t&&(t=Math.round(t)),t})),this.stateOn=angular.isDefined(e.stateOn)?t.$parent.$eval(e.stateOn):n.stateOn,this.stateOff=angular.isDefined(e.stateOff)?t.$parent.$eval(e.stateOff):n.stateOff;var s=angular.isDefined(e.ratingStates)?t.$parent.$eval(e.ratingStates):new Array(angular.isDefined(e.max)?t.$parent.$eval(e.max):n.max);t.range=this.buildTemplateObjects(s)},this.buildTemplateObjects=function(t){for(var e=0,n=t.length;n>e;e++)t[e]=angular.extend({index:e},{stateOn:this.stateOn,stateOff:this.stateOff},t[e]);return t},t.rate=function(e){!t.readonly&&e>=0&&e<=t.range.length&&(r.$setViewValue(e),r.$render())},t.enter=function(e){t.readonly||(t.value=e),t.onHover({value:e})},t.reset=function(){t.value=r.$viewValue,t.onLeave()},t.onKeydown=function(e){/(37|38|39|40)/.test(e.which)&&(e.preventDefault(),e.stopPropagation(),t.rate(t.value+(38===e.which||39===e.which?1:-1)))},this.render=function(){t.value=r.$viewValue}}]).directive("rating",(function(){return{restrict:"EA",require:["rating","ngModel"],scope:{readonly:"=?",onHover:"&",onLeave:"&"},controller:"RatingController",templateUrl:"template/rating/rating.html",replace:!0,link:function(t,e,n,r){var i=r[0],s=r[1];i.init(s)}}})),angular.module("ui.bootstrap.tabs",[]).controller("TabsetController",["$scope",function(t){var e,n=this,r=n.tabs=t.tabs=[];n.select=function(t){angular.forEach(r,(function(e){e.active&&e!==t&&(e.active=!1,e.onDeselect())})),t.active=!0,t.onSelect()},n.addTab=function(t){r.push(t),1===r.length&&!1!==t.active?t.active=!0:t.active?n.select(t):t.active=!1},n.removeTab=function(t){var i=r.indexOf(t);if(t.active&&r.length>1&&!e){var s=i==r.length-1?i-1:i+1;n.select(r[s])}r.splice(i,1)},t.$on("$destroy",(function(){e=!0}))}]).directive("tabset",(function(){return{restrict:"EA",transclude:!0,replace:!0,scope:{type:"@"},controller:"TabsetController",templateUrl:"template/tabs/tabset.html",link:function(t,e,n){t.vertical=!!angular.isDefined(n.vertical)&&t.$parent.$eval(n.vertical),t.justified=!!angular.isDefined(n.justified)&&t.$parent.$eval(n.justified)}}})).directive("tab",["$parse","$log",function(t,e){return{require:"^tabset",restrict:"EA",replace:!0,templateUrl:"template/tabs/tab.html",transclude:!0,scope:{active:"=?",heading:"@",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},compile:function(n,r,i){return function(n,r,s,o){n.$watch("active",(function(t){t&&o.select(n)})),n.disabled=!1,s.disable&&n.$parent.$watch(t(s.disable),(function(t){n.disabled=!!t})),s.disabled&&(e.warn('Use of "disabled" attribute has been deprecated, please use "disable"'),n.$parent.$watch(t(s.disabled),(function(t){n.disabled=!!t}))),n.select=function(){n.disabled||(n.active=!0)},o.addTab(n),n.$on("$destroy",(function(){o.removeTab(n)})),n.$transcludeFn=i}}}}]).directive("tabHeadingTransclude",[function(){return{restrict:"A",require:"^tab",link:function(t,e){t.$watch("headingElement",(function(t){t&&(e.html(""),e.append(t))}))}}}]).directive("tabContentTransclude",(function(){return{restrict:"A",require:"^tabset",link:function(t,e,n){var r=t.$eval(n.tabContentTransclude);r.$transcludeFn(r.$parent,(function(t){angular.forEach(t,(function(t){!function(t){return t.tagName&&(t.hasAttribute("tab-heading")||t.hasAttribute("data-tab-heading")||"tab-heading"===t.tagName.toLowerCase()||"data-tab-heading"===t.tagName.toLowerCase())}(t)?e.append(t):r.headingElement=t}))}))}}})),angular.module("ui.bootstrap.timepicker",[]).constant("timepickerConfig",{hourStep:1,minuteStep:1,showMeridian:!0,meridians:null,readonlyInput:!1,mousewheel:!0,arrowkeys:!0}).controller("TimepickerController",["$scope","$attrs","$parse","$log","$locale","timepickerConfig",function(t,e,n,r,i,s){function o(){var e=parseInt(t.hours,10);return(t.showMeridian?e>0&&13>e:e>=0&&24>e)?(t.showMeridian&&(12===e&&(e=0),t.meridian===g[1]&&(e+=12)),e):void 0}function a(){var e=parseInt(t.minutes,10);return e>=0&&60>e?e:void 0}function u(t){return angular.isDefined(t)&&t.toString().length<2?"0"+t:t.toString()}function c(t){l(),d.$setViewValue(new Date(p)),h(t)}function l(){d.$setValidity("time",!0),t.invalidHours=!1,t.invalidMinutes=!1}function h(e){var n=p.getHours(),r=p.getMinutes();t.showMeridian&&(n=0===n||12===n?12:n%12),t.hours="h"===e?n:u(n),"m"!==e&&(t.minutes=u(r)),t.meridian=p.getHours()<12?g[0]:g[1]}function f(t){var e=new Date(p.getTime()+6e4*t);p.setHours(e.getHours(),e.getMinutes()),c()}var p=new Date,d={$setViewValue:angular.noop},g=angular.isDefined(e.meridians)?t.$parent.$eval(e.meridians):s.meridians||i.DATETIME_FORMATS.AMPMS;this.init=function(n,r){(d=n).$render=this.render,d.$formatters.unshift((function(t){return t?new Date(t):null}));var i=r.eq(0),o=r.eq(1);(angular.isDefined(e.mousewheel)?t.$parent.$eval(e.mousewheel):s.mousewheel)&&this.setupMousewheelEvents(i,o),(angular.isDefined(e.arrowkeys)?t.$parent.$eval(e.arrowkeys):s.arrowkeys)&&this.setupArrowkeyEvents(i,o),t.readonlyInput=angular.isDefined(e.readonlyInput)?t.$parent.$eval(e.readonlyInput):s.readonlyInput,this.setupInputEvents(i,o)};var m=s.hourStep;e.hourStep&&t.$parent.$watch(n(e.hourStep),(function(t){m=parseInt(t,10)}));var v=s.minuteStep;e.minuteStep&&t.$parent.$watch(n(e.minuteStep),(function(t){v=parseInt(t,10)})),t.showMeridian=s.showMeridian,e.showMeridian&&t.$parent.$watch(n(e.showMeridian),(function(e){if(t.showMeridian=!!e,d.$error.time){var n=o(),r=a();angular.isDefined(n)&&angular.isDefined(r)&&(p.setHours(n),c())}else h()})),this.setupMousewheelEvents=function(e,n){var r=function(t){t.originalEvent&&(t=t.originalEvent);var e=t.wheelDelta?t.wheelDelta:-t.deltaY;return t.detail||e>0};e.bind("mousewheel wheel",(function(e){t.$apply(r(e)?t.incrementHours():t.decrementHours()),e.preventDefault()})),n.bind("mousewheel wheel",(function(e){t.$apply(r(e)?t.incrementMinutes():t.decrementMinutes()),e.preventDefault()}))},this.setupArrowkeyEvents=function(e,n){e.bind("keydown",(function(e){38===e.which?(e.preventDefault(),t.incrementHours(),t.$apply()):40===e.which&&(e.preventDefault(),t.decrementHours(),t.$apply())})),n.bind("keydown",(function(e){38===e.which?(e.preventDefault(),t.incrementMinutes(),t.$apply()):40===e.which&&(e.preventDefault(),t.decrementMinutes(),t.$apply())}))},this.setupInputEvents=function(e,n){if(t.readonlyInput)return t.updateHours=angular.noop,void(t.updateMinutes=angular.noop);var r=function(e,n){d.$setViewValue(null),d.$setValidity("time",!1),angular.isDefined(e)&&(t.invalidHours=e),angular.isDefined(n)&&(t.invalidMinutes=n)};t.updateHours=function(){var t=o();angular.isDefined(t)?(p.setHours(t),c("h")):r(!0)},e.bind("blur",(function(){!t.invalidHours&&t.hours<10&&t.$apply((function(){t.hours=u(t.hours)}))})),t.updateMinutes=function(){var t=a();angular.isDefined(t)?(p.setMinutes(t),c("m")):r(void 0,!0)},n.bind("blur",(function(){!t.invalidMinutes&&t.minutes<10&&t.$apply((function(){t.minutes=u(t.minutes)}))}))},this.render=function(){var t=d.$viewValue;isNaN(t)?(d.$setValidity("time",!1),r.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(t&&(p=t),l(),h())},t.incrementHours=function(){f(60*m)},t.decrementHours=function(){f(60*-m)},t.incrementMinutes=function(){f(v)},t.decrementMinutes=function(){f(-v)},t.toggleMeridian=function(){f(720*(p.getHours()<12?1:-1))}}]).directive("timepicker",(function(){return{restrict:"EA",require:["timepicker","?^ngModel"],controller:"TimepickerController",replace:!0,scope:{},templateUrl:"template/timepicker/timepicker.html",link:function(t,e,n,r){var i=r[0],s=r[1];s&&i.init(s,e.find("input"))}}})),angular.module("ui.bootstrap.transition",[]).value("$transitionSuppressDeprecated",!1).factory("$transition",["$q","$timeout","$rootScope","$log","$transitionSuppressDeprecated",function(t,e,n,r,i){function s(t){for(var e in t)if(void 0!==a.style[e])return t[e]}i||r.warn("$transition is now deprecated. Use $animate from ngAnimate instead.");var o=function(r,i,s){s=s||{};var a=t.defer(),u=o[s.animation?"animationEndEventName":"transitionEndEventName"],c=function(){n.$apply((function(){r.unbind(u,c),a.resolve(r)}))};return u&&r.bind(u,c),e((function(){angular.isString(i)?r.addClass(i):angular.isFunction(i)?i(r):angular.isObject(i)&&r.css(i),u||a.resolve(r)})),a.promise.cancel=function(){u&&r.unbind(u,c),a.reject("Transition cancelled")},a.promise},a=document.createElement("trans");return o.transitionEndEventName=s({WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}),o.animationEndEventName=s({WebkitTransition:"webkitAnimationEnd",MozTransition:"animationend",OTransition:"oAnimationEnd",transition:"animationend"}),o}]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.position","ui.bootstrap.bindHtml"]).factory("typeaheadParser",["$parse",function(t){var e=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(n){var r=n.match(e);if(!r)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+n+'".');return{itemName:r[3],source:t(r[4]),viewMapper:t(r[2]||r[1]),modelMapper:t(r[1])}}}}]).directive("typeahead",["$compile","$parse","$q","$timeout","$document","$position","typeaheadParser",function(t,e,n,r,i,s,o){var a=[9,13,27,38,40];return{require:"ngModel",link:function(u,c,l,h){var f,p=u.$eval(l.typeaheadMinLength)||1,d=u.$eval(l.typeaheadWaitMs)||0,g=!1!==u.$eval(l.typeaheadEditable),m=e(l.typeaheadLoading).assign||angular.noop,v=e(l.typeaheadOnSelect),y=l.typeaheadInputFormatter?e(l.typeaheadInputFormatter):void 0,b=!!l.typeaheadAppendToBody&&u.$eval(l.typeaheadAppendToBody),x=!1!==u.$eval(l.typeaheadFocusFirst),w=e(l.ngModel).assign,S=o.parse(l.typeahead),E=u.$new();u.$on("$destroy",(function(){E.$destroy()}));var F="typeahead-"+E.$id+"-"+Math.floor(1e4*Math.random());c.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":F});var A=angular.element("<div typeahead-popup></div>");A.attr({id:F,matches:"matches",active:"activeIdx",select:"select(activeIdx)",query:"query",position:"position"}),angular.isDefined(l.typeaheadTemplateUrl)&&A.attr("template-url",l.typeaheadTemplateUrl);var C=function(){E.matches=[],E.activeIdx=-1,c.attr("aria-expanded",!1)},D=function(t){return F+"-option-"+t};E.$watch("activeIdx",(function(t){0>t?c.removeAttr("aria-activedescendant"):c.attr("aria-activedescendant",D(t))}));var $=function(t){var e={$viewValue:t};m(u,!0),n.when(S.source(u,e)).then((function(n){var r=t===h.$viewValue;if(r&&f)if(n&&n.length>0){E.activeIdx=x?0:-1,E.matches.length=0;for(var i=0;i<n.length;i++)e[S.itemName]=n[i],E.matches.push({id:D(i),label:S.viewMapper(E,e),model:n[i]});E.query=t,E.position=b?s.offset(c):s.position(c),E.position.top=E.position.top+c.prop("offsetHeight"),c.attr("aria-expanded",!0)}else C();r&&m(u,!1)}),(function(){C(),m(u,!1)}))};C(),E.query=void 0;var I,R=function(){I&&r.cancel(I)};h.$parsers.unshift((function(t){return f=!0,t&&t.length>=p?d>0?(R(),function(t){I=r((function(){$(t)}),d)}(t)):$(t):(m(u,!1),R(),C()),g?t:t?void h.$setValidity("editable",!1):(h.$setValidity("editable",!0),t)})),h.$formatters.push((function(t){var e,n={};return g||h.$setValidity("editable",!0),y?(n.$model=t,y(u,n)):(n[S.itemName]=t,e=S.viewMapper(u,n),n[S.itemName]=void 0,e!==S.viewMapper(u,n)?e:t)})),E.select=function(t){var e,n,i={};i[S.itemName]=n=E.matches[t].model,e=S.modelMapper(u,i),w(u,e),h.$setValidity("editable",!0),h.$setValidity("parse",!0),v(u,{$item:n,$model:e,$label:S.viewMapper(u,i)}),C(),r((function(){c[0].focus()}),0,!1)},c.bind("keydown",(function(t){0!==E.matches.length&&-1!==a.indexOf(t.which)&&(-1!=E.activeIdx||13!==t.which&&9!==t.which)&&(t.preventDefault(),40===t.which?(E.activeIdx=(E.activeIdx+1)%E.matches.length,E.$digest()):38===t.which?(E.activeIdx=(E.activeIdx>0?E.activeIdx:E.matches.length)-1,E.$digest()):13===t.which||9===t.which?E.$apply((function(){E.select(E.activeIdx)})):27===t.which&&(t.stopPropagation(),C(),E.$digest()))})),c.bind("blur",(function(){f=!1}));var T=function(t){c[0]!==t.target&&(C(),E.$digest())};i.bind("click",T),u.$on("$destroy",(function(){i.unbind("click",T),b&&_.remove(),A.remove()}));var _=t(A)(E);b?i.find("body").append(_):c.after(_)}}}]).directive("typeaheadPopup",(function(){return{restrict:"EA",scope:{matches:"=",query:"=",active:"=",position:"=",select:"&"},replace:!0,templateUrl:"template/typeahead/typeahead-popup.html",link:function(t,e,n){t.templateUrl=n.templateUrl,t.isOpen=function(){return t.matches.length>0},t.isActive=function(e){return t.active==e},t.selectActive=function(e){t.active=e},t.selectMatch=function(e){t.select({activeIdx:e})}}}})).directive("typeaheadMatch",["$templateRequest","$compile","$parse",function(t,e,n){return{restrict:"EA",scope:{index:"=",match:"=",query:"="},link:function(r,i,s){var o=n(s.templateUrl)(r.$parent)||"template/typeahead/typeahead-match.html";t(o).then((function(t){e(t.trim())(r,(function(t){i.replaceWith(t)}))}))}}}]).filter("typeaheadHighlight",(function(){return function(t,e){return e?(""+t).replace(new RegExp(function(t){return t.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}(e),"gi"),"<strong>$&</strong>"):t}})),angular.module("template/accordion/accordion-group.html",[]).run(["$templateCache",function(t){t.put("template/accordion/accordion-group.html",'<div class="panel panel-default">\n <div class="panel-heading">\n <h4 class="panel-title">\n <a href="javascript:void(0)" tabindex="0" class="accordion-toggle" ng-click="toggleOpen()" accordion-transclude="heading"><span ng-class="{\'text-muted\': isDisabled}">{{heading}}</span></a>\n </h4>\n </div>\n <div class="panel-collapse collapse" collapse="!isOpen">\n\t <div class="panel-body" ng-transclude></div>\n </div>\n</div>\n')}]),angular.module("template/accordion/accordion.html",[]).run(["$templateCache",function(t){t.put("template/accordion/accordion.html",'<div class="panel-group" ng-transclude></div>')}]),angular.module("template/alert/alert.html",[]).run(["$templateCache",function(t){t.put("template/alert/alert.html",'<div class="alert" ng-class="[\'alert-\' + (type || \'warning\'), closeable ? \'alert-dismissable\' : null]" role="alert">\n <button ng-show="closeable" type="button" class="close" ng-click="close()">\n <span aria-hidden="true">×</span>\n <span class="sr-only">Close</span>\n </button>\n <div ng-transclude></div>\n</div>\n')}]),angular.module("template/carousel/carousel.html",[]).run(["$templateCache",function(t){t.put("template/carousel/carousel.html",'<div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel" ng-swipe-right="prev()" ng-swipe-left="next()">\n <ol class="carousel-indicators" ng-show="slides.length > 1">\n <li ng-repeat="slide in slides | orderBy:\'index\' track by $index" ng-class="{active: isActive(slide)}" ng-click="select(slide)"></li>\n </ol>\n <div class="carousel-inner" ng-transclude></div>\n <a class="left carousel-control" ng-click="prev()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-left"></span></a>\n <a class="right carousel-control" ng-click="next()" ng-show="slides.length > 1"><span class="glyphicon glyphicon-chevron-right"></span></a>\n</div>\n')}]),angular.module("template/carousel/slide.html",[]).run(["$templateCache",function(t){t.put("template/carousel/slide.html",'<div ng-class="{\n \'active\': active\n }" class="item text-center" ng-transclude></div>\n')}]),angular.module("template/datepicker/datepicker.html",[]).run(["$templateCache",function(t){t.put("template/datepicker/datepicker.html",'<div ng-switch="datepickerMode" role="application" ng-keydown="keydown($event)">\n <daypicker ng-switch-when="day" tabindex="0"></daypicker>\n <monthpicker ng-switch-when="month" tabindex="0"></monthpicker>\n <yearpicker ng-switch-when="year" tabindex="0"></yearpicker>\n</div>')}]),angular.module("template/datepicker/day.html",[]).run(["$templateCache",function(t){t.put("template/datepicker/day.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="{{5 + showWeeks}}"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n <tr>\n <th ng-show="showWeeks" class="text-center"></th>\n <th ng-repeat="label in labels track by $index" class="text-center"><small aria-label="{{label.full}}">{{label.abbr}}</small></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-show="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}" ng-class="dt.customClass">\n <button type="button" style="width:100%;" class="btn btn-default btn-sm" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-muted\': dt.secondary, \'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/datepicker/month.html",[]).run(["$templateCache",function(t){t.put("template/datepicker/month.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/datepicker/popup.html",[]).run(["$templateCache",function(t){t.put("template/datepicker/popup.html",'<ul class="dropdown-menu" ng-style="{display: (isOpen && \'block\') || \'none\', top: position.top+\'px\', left: position.left+\'px\'}" ng-keydown="keydown($event)">\n\t<li ng-transclude></li>\n\t<li ng-if="showButtonBar" style="padding:10px 9px 2px">\n\t\t<span class="btn-group pull-left">\n\t\t\t<button type="button" class="btn btn-sm btn-info" ng-click="select(\'today\')">{{ getText(\'current\') }}</button>\n\t\t\t<button type="button" class="btn btn-sm btn-danger" ng-click="select(null)">{{ getText(\'clear\') }}</button>\n\t\t</span>\n\t\t<button type="button" class="btn btn-sm btn-success pull-right" ng-click="close()">{{ getText(\'close\') }}</button>\n\t</li>\n</ul>\n')}]),angular.module("template/datepicker/year.html",[]).run(["$templateCache",function(t){t.put("template/datepicker/year.html",'<table role="grid" aria-labelledby="{{uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="3"><button id="{{uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1" style="width:100%;"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row track by dt.date" class="text-center" role="gridcell" id="{{dt.uid}}" aria-disabled="{{!!dt.disabled}}">\n <button type="button" style="width:100%;" class="btn btn-default" ng-class="{\'btn-info\': dt.selected, active: isActive(dt)}" ng-click="select(dt.date)" ng-disabled="dt.disabled" tabindex="-1"><span ng-class="{\'text-info\': dt.current}">{{dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("template/modal/backdrop.html",[]).run(["$templateCache",function(t){t.put("template/modal/backdrop.html",'<div class="modal-backdrop"\n modal-animation-class="fade"\n ng-class="{in: animate}"\n ng-style="{\'z-index\': 1040 + (index && 1 || 0) + index*10}"\n></div>\n')}]),angular.module("template/modal/window.html",[]).run(["$templateCache",function(t){t.put("template/modal/window.html",'<div modal-render="{{$isRendered}}" tabindex="-1" role="dialog" class="modal"\n modal-animation-class="fade"\n\tng-class="{in: animate}" ng-style="{\'z-index\': 1050 + index*10, display: \'block\'}" ng-click="close($event)">\n <div class="modal-dialog" ng-class="size ? \'modal-\' + size : \'\'"><div class="modal-content" modal-transclude></div></div>\n</div>\n')}]),angular.module("template/pagination/pager.html",[]).run(["$templateCache",function(t){t.put("template/pagination/pager.html",'<ul class="pager">\n <li ng-class="{disabled: noPrevious(), previous: align}"><a href ng-click="selectPage(page - 1, $event)">{{getText(\'previous\')}}</a></li>\n <li ng-class="{disabled: noNext(), next: align}"><a href ng-click="selectPage(page + 1, $event)">{{getText(\'next\')}}</a></li>\n</ul>')}]),angular.module("template/pagination/pagination.html",[]).run(["$templateCache",function(t){t.put("template/pagination/pagination.html",'<ul class="pagination">\n <li ng-if="boundaryLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(1, $event)">{{getText(\'first\')}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noPrevious()}"><a href ng-click="selectPage(page - 1, $event)">{{getText(\'previous\')}}</a></li>\n <li ng-repeat="page in pages track by $index" ng-class="{active: page.active}"><a href ng-click="selectPage(page.number, $event)">{{page.text}}</a></li>\n <li ng-if="directionLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(page + 1, $event)">{{getText(\'next\')}}</a></li>\n <li ng-if="boundaryLinks" ng-class="{disabled: noNext()}"><a href ng-click="selectPage(totalPages, $event)">{{getText(\'last\')}}</a></li>\n</ul>')}]),angular.module("template/tooltip/tooltip-html-popup.html",[]).run(["$templateCache",function(t){t.put("template/tooltip/tooltip-html-popup.html",'<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind-html="contentExp()"></div>\n</div>\n')}]),angular.module("template/tooltip/tooltip-html-unsafe-popup.html",[]).run(["$templateCache",function(t){t.put("template/tooltip/tooltip-html-unsafe-popup.html",'<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" bind-html-unsafe="content"></div>\n</div>\n')}]),angular.module("template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function(t){t.put("template/tooltip/tooltip-popup.html",'<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind="content"></div>\n</div>\n')}]),angular.module("template/tooltip/tooltip-template-popup.html",[]).run(["$templateCache",function(t){t.put("template/tooltip/tooltip-template-popup.html",'<div class="tooltip"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner"\n tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n</div>\n')}]),angular.module("template/popover/popover-template.html",[]).run(["$templateCache",function(t){t.put("template/popover/popover-template.html",'<div class="popover"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-if="title"></h3>\n <div class="popover-content"\n tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n </div>\n</div>\n')}]),angular.module("template/popover/popover-window.html",[]).run(["$templateCache",function(t){t.put("template/popover/popover-window.html",'<div class="popover {{placement}}" ng-class="{ in: isOpen, fade: animation }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-show="title"></h3>\n <div class="popover-content" tooltip-template-transclude></div>\n </div>\n</div>\n')}]),angular.module("template/popover/popover.html",[]).run(["$templateCache",function(t){t.put("template/popover/popover.html",'<div class="popover"\n tooltip-animation-class="fade"\n tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="title" ng-if="title"></h3>\n <div class="popover-content" ng-bind="content"></div>\n </div>\n</div>\n')}]),angular.module("template/progressbar/bar.html",[]).run(["$templateCache",function(t){t.put("template/progressbar/bar.html",'<div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n')}]),angular.module("template/progressbar/progress.html",[]).run(["$templateCache",function(t){t.put("template/progressbar/progress.html",'<div class="progress" ng-transclude></div>')}]),angular.module("template/progressbar/progressbar.html",[]).run(["$templateCache",function(t){t.put("template/progressbar/progressbar.html",'<div class="progress">\n <div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" ng-transclude></div>\n</div>\n')}]),angular.module("template/rating/rating.html",[]).run(["$templateCache",function(t){t.put("template/rating/rating.html",'<span ng-mouseleave="reset()" ng-keydown="onKeydown($event)" tabindex="0" role="slider" aria-valuemin="0" aria-valuemax="{{range.length}}" aria-valuenow="{{value}}">\n <i ng-repeat="r in range track by $index" ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" class="glyphicon" ng-class="$index < value && (r.stateOn || \'glyphicon-star\') || (r.stateOff || \'glyphicon-star-empty\')">\n <span class="sr-only">({{ $index < value ? \'*\' : \' \' }})</span>\n </i>\n</span>')}]),angular.module("template/tabs/tab.html",[]).run(["$templateCache",function(t){t.put("template/tabs/tab.html",'<li ng-class="{active: active, disabled: disabled}">\n <a href ng-click="select()" tab-heading-transclude>{{heading}}</a>\n</li>\n')}]),angular.module("template/tabs/tabset.html",[]).run(["$templateCache",function(t){t.put("template/tabs/tabset.html",'<div>\n <ul class="nav nav-{{type || \'tabs\'}}" ng-class="{\'nav-stacked\': vertical, \'nav-justified\': justified}" ng-transclude></ul>\n <div class="tab-content">\n <div class="tab-pane" \n ng-repeat="tab in tabs" \n ng-class="{active: tab.active}"\n tab-content-transclude="tab">\n </div>\n </div>\n</div>\n')}]),angular.module("template/timepicker/timepicker.html",[]).run(["$templateCache",function(t){t.put("template/timepicker/timepicker.html",'<table>\n\t<tbody>\n\t\t<tr class="text-center">\n\t\t\t<td><a ng-click="incrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n\t\t\t<td> </td>\n\t\t\t<td><a ng-click="incrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n\t\t\t<td ng-show="showMeridian"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class="form-group" ng-class="{\'has-error\': invalidHours}">\n\t\t\t\t<input style="width:50px;" type="text" ng-model="hours" ng-change="updateHours()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n\t\t\t</td>\n\t\t\t<td>:</td>\n\t\t\t<td class="form-group" ng-class="{\'has-error\': invalidMinutes}">\n\t\t\t\t<input style="width:50px;" type="text" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2">\n\t\t\t</td>\n\t\t\t<td ng-show="showMeridian"><button type="button" class="btn btn-default text-center" ng-click="toggleMeridian()">{{meridian}}</button></td>\n\t\t</tr>\n\t\t<tr class="text-center">\n\t\t\t<td><a ng-click="decrementHours()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n\t\t\t<td> </td>\n\t\t\t<td><a ng-click="decrementMinutes()" class="btn btn-link"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n\t\t\t<td ng-show="showMeridian"></td>\n\t\t</tr>\n\t</tbody>\n</table>\n')}]),angular.module("template/typeahead/typeahead-match.html",[]).run(["$templateCache",function(t){t.put("template/typeahead/typeahead-match.html",'<a tabindex="-1" bind-html-unsafe="match.label | typeaheadHighlight:query"></a>')}]),angular.module("template/typeahead/typeahead-popup.html",[]).run(["$templateCache",function(t){t.put("template/typeahead/typeahead-popup.html",'<ul class="dropdown-menu" ng-show="isOpen()" ng-style="{top: position.top+\'px\', left: position.left+\'px\'}" style="display: block;" role="listbox" aria-hidden="{{!isOpen()}}">\n <li ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index)" role="option" id="{{match.id}}">\n <div typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>\n </li>\n</ul>\n')}]),!angular.$$csp()&&angular.element(document).find("head").prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>')},function(t,e,n){var r,i,s;s=function(){angular.module("jlareau.bowser",[]).factory("bowser",(function(){
|
|
64
64
|
/*!
|
|
65
65
|
* Bowser - a browser detector
|
|
66
66
|
* https://github.com/ded/bowser
|
|
67
67
|
* MIT License | (c) Dustin Diaz 2015
|
|
68
68
|
*/
|
|
69
|
-
var t=!0;function e(e){function n(t){var n=e.match(t);return n&&n.length>1&&n[1]||""}var r,i,s,o=n(/(ipod|iphone|ipad)/i).toLowerCase(),a=!/like android/i.test(e)&&/android/i.test(e),u=/nexus\s*[0-6]\s*/i.test(e),c=!u&&/nexus\s*[0-9]+/i.test(e),l=/CrOS/.test(e),h=/silk/i.test(e),f=/sailfish/i.test(e),p=/tizen/i.test(e),d=/(web|hpw)os/i.test(e),g=/windows phone/i.test(e),m=!g&&/windows/i.test(e),v=!o&&!h&&/macintosh/i.test(e),y=!a&&!f&&!p&&!d&&/linux/i.test(e),b=n(/edge\/(\d+(\.\d+)?)/i),
|
|
69
|
+
var t=!0;function e(e){function n(t){var n=e.match(t);return n&&n.length>1&&n[1]||""}var r,i,s,o=n(/(ipod|iphone|ipad)/i).toLowerCase(),a=!/like android/i.test(e)&&/android/i.test(e),u=/nexus\s*[0-6]\s*/i.test(e),c=!u&&/nexus\s*[0-9]+/i.test(e),l=/CrOS/.test(e),h=/silk/i.test(e),f=/sailfish/i.test(e),p=/tizen/i.test(e),d=/(web|hpw)os/i.test(e),g=/windows phone/i.test(e),m=!g&&/windows/i.test(e),v=!o&&!h&&/macintosh/i.test(e),y=!a&&!f&&!p&&!d&&/linux/i.test(e),b=n(/edge\/(\d+(\.\d+)?)/i),x=n(/version\/(\d+(\.\d+)?)/i),w=/tablet/i.test(e),S=!w&&/[^-]mobi/i.test(e),E=/xbox/i.test(e);/opera|opr|opios/i.test(e)?r={name:"Opera",opera:t,version:x||n(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(e)?r={name:"Opera Coast",coast:t,version:x||n(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(e)?r={name:"Yandex Browser",yandexbrowser:t,version:x||n(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(e)?r={name:"UC Browser",ucbrowser:t,version:n(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(e)?r={name:"Maxthon",maxthon:t,version:n(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(e)?r={name:"Epiphany",epiphany:t,version:n(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(e)?r={name:"Puffin",puffin:t,version:n(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(e)?r={name:"Sleipnir",sleipnir:t,version:n(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(e)?r={name:"K-Meleon",kMeleon:t,version:n(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:g?(r={name:"Windows Phone",windowsphone:t},b?(r.msedge=t,r.version=b):(r.msie=t,r.version=n(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(e)?r={name:"Internet Explorer",msie:t,version:n(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:l?r={name:"Chrome",chromeos:t,chromeBook:t,chrome:t,version:n(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/chrome.+? edge/i.test(e)?r={name:"Microsoft Edge",msedge:t,version:b}:/vivaldi/i.test(e)?r={name:"Vivaldi",vivaldi:t,version:n(/vivaldi\/(\d+(\.\d+)?)/i)||x}:f?r={name:"Sailfish",sailfish:t,version:n(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(e)?r={name:"SeaMonkey",seamonkey:t,version:n(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(e)?(r={name:"Firefox",firefox:t,version:n(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(e)&&(r.firefoxos=t)):h?r={name:"Amazon Silk",silk:t,version:n(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(e)?r={name:"PhantomJS",phantom:t,version:n(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(e)?r={name:"SlimerJS",slimer:t,version:n(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(e)||/rim\stablet/i.test(e)?r={name:"BlackBerry",blackberry:t,version:x||n(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:d?(r={name:"WebOS",webos:t,version:x||n(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(e)&&(r.touchpad=t)):/bada/i.test(e)?r={name:"Bada",bada:t,version:n(/dolfin\/(\d+(\.\d+)?)/i)}:p?r={name:"Tizen",tizen:t,version:n(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||x}:/qupzilla/i.test(e)?r={name:"QupZilla",qupzilla:t,version:n(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||x}:/chromium/i.test(e)?r={name:"Chromium",chromium:t,version:n(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||x}:/chrome|crios|crmo/i.test(e)?r={name:"Chrome",chrome:t,version:n(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:a?r={name:"Android",version:x}:/safari|applewebkit/i.test(e)?(r={name:"Safari",safari:t},x&&(r.version=x)):o?(r={name:"iphone"==o?"iPhone":"ipad"==o?"iPad":"iPod"},x&&(r.version=x)):r=/googlebot/i.test(e)?{name:"Googlebot",googlebot:t,version:n(/googlebot\/(\d+(\.\d+))/i)||x}:{name:n(/^(.*)\/(.*) /),version:(i=/^(.*)\/(.*) /,s=e.match(i),s&&s.length>1&&s[2]||"")},!r.msedge&&/(apple)?webkit/i.test(e)?(/(apple)?webkit\/537\.36/i.test(e)?(r.name=r.name||"Blink",r.blink=t):(r.name=r.name||"Webkit",r.webkit=t),!r.version&&x&&(r.version=x)):!r.opera&&/gecko\//i.test(e)&&(r.name=r.name||"Gecko",r.gecko=t,r.version=r.version||n(/gecko\/(\d+(\.\d+)?)/i)),r.msedge||!a&&!r.silk?o?(r[o]=t,r.ios=t):v?r.mac=t:E?r.xbox=t:m?r.windows=t:y&&(r.linux=t):r.android=t;var F="";r.windowsphone?F=n(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):o?F=(F=n(/os (\d+([_\s]\d+)*) like mac os x/i)).replace(/[_\s]/g,"."):a?F=n(/android[ \/-](\d+(\.\d+)*)/i):r.webos?F=n(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):r.blackberry?F=n(/rim\stablet\sos\s(\d+(\.\d+)*)/i):r.bada?F=n(/bada\/(\d+(\.\d+)*)/i):r.tizen&&(F=n(/tizen[\/\s](\d+(\.\d+)*)/i)),F&&(r.osversion=F);var A=F.split(".")[0];return w||c||"ipad"==o||a&&(3==A||A>=4&&!S)||r.silk?r.tablet=t:(S||"iphone"==o||"ipod"==o||a||u||r.blackberry||r.webos||r.bada)&&(r.mobile=t),r.msedge||r.msie&&r.version>=10||r.yandexbrowser&&r.version>=15||r.vivaldi&&r.version>=1||r.chrome&&r.version>=20||r.firefox&&r.version>=20||r.safari&&r.version>=6||r.opera&&r.version>=10||r.ios&&r.osversion&&r.osversion.split(".")[0]>=6||r.blackberry&&r.version>=10.1?r.a=t:r.msie&&r.version<10||r.chrome&&r.version<20||r.firefox&&r.version<20||r.safari&&r.version<6||r.opera&&r.version<10||r.ios&&r.osversion&&r.osversion.split(".")[0]<6?r.c=t:r.x=t,r}var n=e("undefined"!=typeof navigator?navigator.userAgent:"");return n.test=function(t){for(var e=0;e<t.length;++e){var r=t[e];if("string"==typeof r&&r in n)return!0}return!1},n._detect=e,n}))},t.exports?t.exports=s():void 0===(i="function"==typeof(r=s)?r.call(e,n,e,t):r)||(t.exports=i)},function(t,e){!function(t){var e,n,r,i=t.jQuery||t.angular.element,s=t.document.documentElement,o=i(s);return c("change",u),e=u,n=(t.jQuery||t.angular.element).prototype,r=n.val,n.val=function(t){var n=r.apply(this,arguments);return arguments.length>0&&l(this,(function(n){e(n,t)})),n},i.prototype.checkAndTriggerAutoFillEvent=function(){var t,e;for(t=0;t<this.length;t++)a(e=this[t])||(u(e),h(e))},c("blur",(function(e){t.setTimeout((function(){(function(t){for(;t;){if("FORM"===t.nodeName)return i(t);t=t.parentNode}return i()})(e).find("input").checkAndTriggerAutoFillEvent()}),20)})),void t.document.addEventListener("DOMContentLoaded",(function(){l(document.getElementsByTagName("input"),u),t.setTimeout((function(){o.find("input").checkAndTriggerAutoFillEvent()}),200)}),!1);function a(t){"$$currentValue"in t||(t.$$currentValue=t.getAttribute("value"));var e=t.value,n=t.$$currentValue;return!e&&!n||e===n}function u(t){t.$$currentValue=t.value}function c(t,e){s.addEventListener(t,(function(t){var n=t.target;e(n)}),!0)}function l(t,e){if(t.forEach)return t.forEach(e);var n;for(n=0;n<t.length;n++)e(t[n])}function h(e){var n=t.document.createEvent("HTMLEvents");n.initEvent("change",!0,!0),e.dispatchEvent(n)}}(window)},function(t,e,n){"use strict";(function(t){
|
|
70
70
|
/*!
|
|
71
71
|
* The buffer module from node.js, for the browser.
|
|
72
72
|
*
|
|
73
73
|
* @author Feross Aboukhadijeh <http://feross.org>
|
|
74
74
|
* @license MIT
|
|
75
75
|
*/
|
|
76
|
-
var r=n(185),i=n(186),s=n(187);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(o()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=f(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,n),i=(t=a(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(u.isBuffer(e)){var n=0|p(e.length);return 0===(t=a(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?a(t,0):f(t,e);if("Buffer"===e.type&&s(e.data))return f(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(l(e),t=a(t,e<0?0:0|p(e)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function f(t,e){var n=e.length<0?0:0|p(e.length);t=a(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function p(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return M(t).length;default:if(r)return H(t).length;e=(""+e).toLowerCase(),r=!0}}function g(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return $(this,e,n);case"utf8":case"utf-8":return C(this,e,n);case"ascii":return D(this,e,n);case"latin1":case"binary":return I(this,e,n);case"base64":return A(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function v(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,i){var s,o=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;o=2,a/=2,u/=2,n/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var l=-1;for(s=n;s<a;s++)if(c(t,s)===c(e,-1===l?0:s-l)){if(-1===l&&(l=s),s-l+1===u)return l*o}else-1!==l&&(s-=s-l),l=-1}else for(n+u>a&&(n=a-u),s=n;s>=0;s--){for(var h=!0,f=0;f<u;f++)if(c(t,s+f)!==c(e,f)){h=!1;break}if(h)return s}return-1}function b(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var s=e.length;if(s%2!=0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var o=0;o<r;++o){var a=parseInt(e.substr(2*o,2),16);if(isNaN(a))return o;t[n+o]=a}return o}function w(t,e,n,r){return U(H(e,t.length-n),t,n,r)}function x(t,e,n,r){return U(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function S(t,e,n,r){return x(t,e,n,r)}function E(t,e,n,r){return U(M(e),t,n,r)}function F(t,e,n,r){return U(function(t,e){for(var n,r,i,s=[],o=0;o<t.length&&!((e-=2)<0);++o)n=t.charCodeAt(o),r=n>>8,i=n%256,s.push(i),s.push(r);return s}(e,t.length-n),t,n,r)}function A(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function C(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var s,o,a,u,c=t[i],l=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128==(192&(s=t[i+1]))&&(u=(31&c)<<6|63&s)>127&&(l=u);break;case 3:s=t[i+1],o=t[i+2],128==(192&s)&&128==(192&o)&&(u=(15&c)<<12|(63&s)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:s=t[i+1],o=t[i+2],a=t[i+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(u=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=o(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,n){return c(null,t,e,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,n){return function(t,e,n,r){return l(e),e<=0?a(t,e):void 0!==n?"string"==typeof r?a(t,e).fill(n,r):a(t,e).fill(n):a(t,e)}(null,t,e,n)},u.allocUnsafe=function(t){return h(null,t)},u.allocUnsafeSlow=function(t){return h(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,s=Math.min(n,r);i<s;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!s(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=u.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var o=t[n];if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?C(this,0,t):g.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,n,r,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var s=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(e>>>=0),a=Math.min(s,o),c=this.slice(r,i),l=t.slice(e,n),h=0;h<a;++h)if(c[h]!==l[h]){s=c[h],o=l[h];break}return s<o?-1:o<s?1:0},u.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},u.prototype.indexOf=function(t,e,n){return v(this,t,e,n,!0)},u.prototype.lastIndexOf=function(t,e,n){return v(this,t,e,n,!1)},u.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return w(this,t,e,n);case"ascii":return x(this,t,e,n);case"latin1":case"binary":return S(this,t,e,n);case"base64":return E(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function D(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function I(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function $(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",s=e;s<n;++s)i+=L(t[s]);return i}function R(t,e,n){for(var r=t.slice(e,n),i="",s=0;s<r.length;s+=2)i+=String.fromCharCode(r[s]+256*r[s+1]);return i}function T(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function _(t,e,n,r,i,s){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function P(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,s=Math.min(t.length-n,2);i<s;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function k(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,s=Math.min(t.length-n,4);i<s;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function O(t,e,n,r,i,s){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function j(t,e,n,r,s){return s||O(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function B(t,e,n,r,s){return s||O(t,0,n,8),i.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=u.prototype;else{var i=e-t;n=new u(i,void 0);for(var s=0;s<i;++s)n[s]=this[s+t]}return n},u.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=this[t],i=1,s=0;++s<e&&(i*=256);)r+=this[t+s]*i;return r},u.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=this[t],i=1,s=0;++s<e&&(i*=256);)r+=this[t+s]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=e,i=1,s=this[t+--r];r>0&&(i*=256);)s+=this[t+--r]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*e)),s},u.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||_(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,s=0;for(this[e]=255&t;++s<n&&(i*=256);)this[e+s]=t/i&255;return e+n},u.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||_(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):k(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):k(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);_(this,t,e,n,i-1,-i)}var s=0,o=1,a=0;for(this[e]=255&t;++s<n&&(o*=256);)t<0&&0===a&&0!==this[e+s-1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);_(this,t,e,n,i-1,-i)}var s=n-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):k(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):k(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return j(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return j(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return B(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return B(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,s=r-n;if(this===t&&n<e&&e<r)for(i=s-1;i>=0;--i)t[i+e]=this[i+n];else if(s<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<s;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+s),e);return s},u.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var s;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=e;s<n;++s)this[s]=t;else{var o=u.isBuffer(t)?t:H(new u(t,r).toString()),a=o.length;for(s=0;s<n-e;++s)this[s+e]=o[s%a]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,e){var n;e=e||1/0;for(var r=t.length,i=null,s=[],o=0;o<r;++o){if((n=t.charCodeAt(o))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(e-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function M(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(N,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function U(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(6))},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=c(t),o=r[0],a=r[1],u=new s(function(t,e,n){return 3*(e+n)/4-n}(0,o,a)),l=0,h=a>0?o-4:o;for(n=0;n<h;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],u[l++]=e>>16&255,u[l++]=e>>8&255,u[l++]=255&e;2===a&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,u[l++]=255&e);1===a&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,s=[],o=0,a=n-i;o<a;o+=16383)s.push(l(t,o,o+16383>a?a:o+16383));1===i?(e=t[n-1],s.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],s.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return s.join("")};for(var r=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=o.length;a<u;++a)r[a]=o[a],i[o.charCodeAt(a)]=a;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,n){for(var i,s,o=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),o.push(r[(s=i)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){
|
|
76
|
+
var r=n(185),i=n(186),s=n(187);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(o()<e)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=u.prototype:(null===t&&(t=new u(e)),t.length=e),t}function u(t,e,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return c(this,t,e,n)}function c(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);u.TYPED_ARRAY_SUPPORT?(t=e).__proto__=u.prototype:t=f(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|d(e,n),i=(t=a(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(u.isBuffer(e)){var n=0|p(e.length);return 0===(t=a(t,n)).length||e.copy(t,0,0,n),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?a(t,0):f(t,e);if("Buffer"===e.type&&s(e.data))return f(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(l(e),t=a(t,e<0?0:0|p(e)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function f(t,e){var n=e.length<0?0:0|p(e.length);t=a(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function p(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return M(t).length;default:if(r)return H(t).length;e=(""+e).toLowerCase(),r=!0}}function g(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,n);case"utf8":case"utf-8":return C(this,e,n);case"ascii":return D(this,e,n);case"latin1":case"binary":return $(this,e,n);case"base64":return A(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function v(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=u.from(e,r)),u.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,i){var s,o=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;o=2,a/=2,u/=2,n/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var l=-1;for(s=n;s<a;s++)if(c(t,s)===c(e,-1===l?0:s-l)){if(-1===l&&(l=s),s-l+1===u)return l*o}else-1!==l&&(s-=s-l),l=-1}else for(n+u>a&&(n=a-u),s=n;s>=0;s--){for(var h=!0,f=0;f<u;f++)if(c(t,s+f)!==c(e,f)){h=!1;break}if(h)return s}return-1}function b(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var s=e.length;if(s%2!=0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var o=0;o<r;++o){var a=parseInt(e.substr(2*o,2),16);if(isNaN(a))return o;t[n+o]=a}return o}function x(t,e,n,r){return U(H(e,t.length-n),t,n,r)}function w(t,e,n,r){return U(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function S(t,e,n,r){return w(t,e,n,r)}function E(t,e,n,r){return U(M(e),t,n,r)}function F(t,e,n,r){return U(function(t,e){for(var n,r,i,s=[],o=0;o<t.length&&!((e-=2)<0);++o)n=t.charCodeAt(o),r=n>>8,i=n%256,s.push(i),s.push(r);return s}(e,t.length-n),t,n,r)}function A(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function C(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var s,o,a,u,c=t[i],l=null,h=c>239?4:c>223?3:c>191?2:1;if(i+h<=n)switch(h){case 1:c<128&&(l=c);break;case 2:128==(192&(s=t[i+1]))&&(u=(31&c)<<6|63&s)>127&&(l=u);break;case 3:s=t[i+1],o=t[i+2],128==(192&s)&&128==(192&o)&&(u=(15&c)<<12|(63&s)<<6|63&o)>2047&&(u<55296||u>57343)&&(l=u);break;case 4:s=t[i+1],o=t[i+2],a=t[i+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(u=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&u<1114112&&(l=u)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),i+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=4096));return n}(r)}e.Buffer=u,e.SlowBuffer=function(t){+t!=t&&(t=0);return u.alloc(+t)},e.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=o(),u.poolSize=8192,u._augment=function(t){return t.__proto__=u.prototype,t},u.from=function(t,e,n){return c(null,t,e,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(t,e,n){return function(t,e,n,r){return l(e),e<=0?a(t,e):void 0!==n?"string"==typeof r?a(t,e).fill(n,r):a(t,e).fill(n):a(t,e)}(null,t,e,n)},u.allocUnsafe=function(t){return h(null,t)},u.allocUnsafeSlow=function(t){return h(null,t)},u.isBuffer=function(t){return!(null==t||!t._isBuffer)},u.compare=function(t,e){if(!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,s=Math.min(n,r);i<s;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(t,e){if(!s(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return u.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=u.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var o=t[n];if(!u.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},u.byteLength=d,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)m(this,e,e+1);return this},u.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},u.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},u.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?C(this,0,t):g.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},u.prototype.compare=function(t,e,n,r,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var s=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(e>>>=0),a=Math.min(s,o),c=this.slice(r,i),l=t.slice(e,n),h=0;h<a;++h)if(c[h]!==l[h]){s=c[h],o=l[h];break}return s<o?-1:o<s?1:0},u.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},u.prototype.indexOf=function(t,e,n){return v(this,t,e,n,!0)},u.prototype.lastIndexOf=function(t,e,n){return v(this,t,e,n,!1)},u.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return x(this,t,e,n);case"ascii":return w(this,t,e,n);case"latin1":case"binary":return S(this,t,e,n);case"base64":return E(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return F(this,t,e,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function D(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function $(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function I(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",s=e;s<n;++s)i+=L(t[s]);return i}function R(t,e,n){for(var r=t.slice(e,n),i="",s=0;s<r.length;s+=2)i+=String.fromCharCode(r[s]+256*r[s+1]);return i}function T(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function _(t,e,n,r,i,s){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function P(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,s=Math.min(t.length-n,2);i<s;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function k(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,s=Math.min(t.length-n,4);i<s;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function O(t,e,n,r,i,s){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function j(t,e,n,r,s){return s||O(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function B(t,e,n,r,s){return s||O(t,0,n,8),i.write(t,e,n,r,52,8),n+8}u.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=u.prototype;else{var i=e-t;n=new u(i,void 0);for(var s=0;s<i;++s)n[s]=this[s+t]}return n},u.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=this[t],i=1,s=0;++s<e&&(i*=256);)r+=this[t+s]*i;return r},u.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},u.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=this[t],i=1,s=0;++s<e&&(i*=256);)r+=this[t+s]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||T(t,e,this.length);for(var r=e,i=1,s=this[t+--r];r>0&&(i*=256);)s+=this[t+--r]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*e)),s},u.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||_(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,s=0;for(this[e]=255&t;++s<n&&(i*=256);)this[e+s]=t/i&255;return e+n},u.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||_(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,s=1;for(this[e+i]=255&t;--i>=0&&(s*=256);)this[e+i]=t/s&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):k(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):k(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);_(this,t,e,n,i-1,-i)}var s=0,o=1,a=0;for(this[e]=255&t;++s<n&&(o*=256);)t<0&&0===a&&0!==this[e+s-1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+n},u.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);_(this,t,e,n,i-1,-i)}var s=n-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):P(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):P(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):k(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||_(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):k(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return j(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return j(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return B(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return B(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,s=r-n;if(this===t&&n<e&&e<r)for(i=s-1;i>=0;--i)t[i+e]=this[i+n];else if(s<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<s;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+s),e);return s},u.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var s;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(s=e;s<n;++s)this[s]=t;else{var o=u.isBuffer(t)?t:H(new u(t,r).toString()),a=o.length;for(s=0;s<n-e;++s)this[s+e]=o[s%a]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function L(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,e){var n;e=e||1/0;for(var r=t.length,i=null,s=[],o=0;o<r;++o){if((n=t.charCodeAt(o))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(e-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;s.push(n)}else if(n<2048){if((e-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function M(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(N,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function U(t,e,n,r){for(var i=0;i<r&&!(i+n>=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(6))},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=c(t),o=r[0],a=r[1],u=new s(function(t,e,n){return 3*(e+n)/4-n}(0,o,a)),l=0,h=a>0?o-4:o;for(n=0;n<h;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],u[l++]=e>>16&255,u[l++]=e>>8&255,u[l++]=255&e;2===a&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,u[l++]=255&e);1===a&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e);return u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,s=[],o=0,a=n-i;o<a;o+=16383)s.push(l(t,o,o+16383>a?a:o+16383));1===i?(e=t[n-1],s.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],s.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return s.join("")};for(var r=[],i=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=o.length;a<u;++a)r[a]=o[a],i[o.charCodeAt(a)]=a;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function l(t,e,n){for(var i,s,o=[],a=e;a<n;a+=3)i=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),o.push(r[(s=i)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){
|
|
77
77
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
78
78
|
e.read=function(t,e,n,r,i){var s,o,a=8*i-r-1,u=(1<<a)-1,c=u>>1,l=-7,h=n?i-1:0,f=n?-1:1,p=t[e+h];for(h+=f,s=p&(1<<-l)-1,p>>=-l,l+=a;l>0;s=256*s+t[e+h],h+=f,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=r;l>0;o=256*o+t[e+h],h+=f,l-=8);if(0===s)s=1-c;else{if(s===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),s-=c}return(p?-1:1)*o*Math.pow(2,s-r)},e.write=function(t,e,n,r,i,s){var o,a,u,c=8*s-i-1,l=(1<<c)-1,h=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,d=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),(e+=o+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(o++,u/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(e*u-1)*Math.pow(2,i),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[n+p]=255&a,p+=d,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;t[n+p]=255&o,p+=d,o/=256,c-=8);t[n+p-d]|=128*g}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){
|
|
79
79
|
/**
|
|
@@ -83,10 +83,10 @@ e.read=function(t,e,n,r,i){var s,o,a=8*i-r-1,u=(1<<a)-1,c=u>>1,l=-7,h=n?i-1:0,f=
|
|
|
83
83
|
* @license MIT
|
|
84
84
|
* @author Olivier Combe <olivier.combe@gmail.com>
|
|
85
85
|
*/
|
|
86
|
-
!function(n,r){"use strict";var i=["ng","oc.lazyLoad"],s={},o=[],a=[],u=[],c=[],l=n.noop,h={},f=[];n.module("oc.lazyLoad",["ng"]).provider("$ocLazyLoad",["$controllerProvider","$provide","$compileProvider","$filterProvider","$injector","$animateProvider",function(t,e,p,m,v,y){var b={},w={$controllerProvider:t,$compileProvider:p,$filterProvider:m,$provide:e,$injector:v,$animateProvider:y},x=!1,S=!1,E=[],F={};E.push=function(t){-1===this.indexOf(t)&&Array.prototype.push.apply(this,arguments)},this.config=function(t){n.isDefined(t.modules)&&(n.isArray(t.modules)?n.forEach(t.modules,(function(t){b[t.name]=t})):b[t.modules.name]=t.modules),n.isDefined(t.debug)&&(x=t.debug),n.isDefined(t.events)&&(S=t.events)},this._init=function(t){if(0===a.length){var e=[t],s=["ng:app","ng-app","x-ng-app","data-ng-app"],o=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/,u=function(t){return t&&e.push(t)};n.forEach(s,(function(e){s[e]=!0,u(document.getElementById(e)),e=e.replace(":","\\:"),void 0!==t[0]&&t[0].querySelectorAll&&(n.forEach(t[0].querySelectorAll("."+e),u),n.forEach(t[0].querySelectorAll("."+e+"\\:"),u),n.forEach(t[0].querySelectorAll("["+e+"]"),u))})),n.forEach(e,(function(e){if(0===a.length){var r=" "+t.className+" ",i=o.exec(r);i?a.push((i[2]||"").replace(/\s+/g,",")):n.forEach(e.attributes,(function(t){0===a.length&&s[t.name]&&a.push(t.value)}))}}))}0!==a.length||(r.jasmine||r.mocha)&&n.isDefined(n.mock)||console.error("No module found during bootstrap, unable to init ocLazyLoad. You should always use the ng-app directive or angular.boostrap when you use ocLazyLoad.");n.forEach(a,(function(t){!function t(e){if(-1===i.indexOf(e)){i.push(e);var r=n.module(e);$(null,r._invokeQueue,e),$(null,r._configBlocks,e),n.forEach(r.requires,t)}}(t)})),a=[],c.pop()};var A=function(t){try{return JSON.stringify(t)}catch(r){var e=[];return JSON.stringify(t,(function(t,r){if(n.isObject(r)&&null!==r){if(-1!==e.indexOf(r))return;e.push(r)}return r}))}},C=function(t){var e,n,r=0;if(0==t.length)return r;for(e=0,n=t.length;e<n;e++)r=(r<<5)-r+t.charCodeAt(e),r|=0;return r};function D(t,e,r){if(e){var s,o,a,c=[];for(s=e.length-1;s>=0;s--)if(o=e[s],n.isString(o)||(o=R(o)),o&&-1===f.indexOf(o)&&(!b[o]||-1!==u.indexOf(o))){var p=-1===i.indexOf(o);if(a=g(o),p&&(i.push(o),D(t,a.requires,r)),a._runBlocks.length>0)for(h[o]=[];a._runBlocks.length>0;)h[o].push(a._runBlocks.shift());n.isDefined(h[o])&&(p||r.rerun)&&(c=c.concat(h[o])),$(t,a._invokeQueue,o,r.reconfig),$(t,a._configBlocks,o,r.reconfig),l(p?"ocLazyLoad.moduleLoaded":"ocLazyLoad.moduleReloaded",o),e.pop(),f.push(o)}var d=t.getInstanceInjector();n.forEach(c,(function(t){d.invoke(t)}))}}function I(t,e){var r=t[2][0],i=t[1],o=!1;n.isUndefined(s[e])&&(s[e]={}),n.isUndefined(s[e][i])&&(s[e][i]={});var a=function(t,r){s[e][i].hasOwnProperty(t)||(s[e][i][t]=[]),function(t,e){var r,i=!0;e.length&&(r=u(t),n.forEach(e,(function(t){i=i&&u(t)!==r})));return i}(r,s[e][i][t])&&(o=!0,s[e][i][t].push(r),l("ocLazyLoad.componentLoaded",[e,i,t]))};function u(t){return n.isArray(t)?C(t.toString()):n.isObject(t)?C(A(t)):n.isDefined(t)&&null!==t?C(t.toString()):t}if(n.isString(r))a(r,t[2][1]);else{if(!n.isObject(r))return!1;n.forEach(r,(function(t,e){n.isString(t)?a(t,r[1]):a(e,t)}))}return o}function $(t,e,r,i){var s,a,u,c;if(e)for(s=0,a=e.length;s<a;s++)if(u=e[s],n.isArray(u)){if(null!==t){if(!t.hasOwnProperty(u[0]))throw new Error("unsupported provider "+u[0]);c=t[u[0]]}var l=I(u,r);if("invoke"!==u[1])l&&n.isDefined(c)&&c[u[1]].apply(c,u[2]);else{var h=function(t){var e=o.indexOf(r+"-"+t);(-1===e||i)&&(-1===e&&o.push(r+"-"+t),n.isDefined(c)&&c[u[1]].apply(c,u[2]))};if(n.isFunction(u[2][0]))h(u[2][0]);else if(n.isArray(u[2][0]))for(var f=0,p=u[2][0].length;f<p;f++)n.isFunction(u[2][0][f])&&h(u[2][0][f])}}}function R(t){var e=null;return n.isString(t)?e=t:n.isObject(t)&&t.hasOwnProperty("name")&&n.isString(t.name)&&(e=t.name),e}function T(t){if(!n.isString(t))return!1;try{return g(t)}catch(t){if(/No module/.test(t)||t.message.indexOf("$injector:nomod")>-1)return!1}}this.$get=["$log","$rootElement","$rootScope","$cacheFactory","$q",function(t,e,r,o,u){var h,p=o("ocLazyLoad");function m(e){var n=u.defer();return t.error(e.message),n.reject(e),n.promise}return x||((t={}).error=n.noop,t.warn=n.noop,t.info=n.noop),w.getInstanceInjector=function(){return h||(h=e.data("$injector")||n.injector())},{_broadcast:l=function(e,n){S&&r.$broadcast(e,n),x&&t.info(e,n)},_$log:t,_getFilesCache:function(){return p},toggleWatch:function(t){t?c.push(!0):c.pop()},getModuleConfig:function(t){if(!n.isString(t))throw new Error("You need to give the name of the module to get");return b[t]?n.copy(b[t]):null},setModuleConfig:function(t){if(!n.isObject(t))throw new Error("You need to give the module config object to set");return b[t.name]=t,t},getModules:function(){return i},isLoaded:function(t){var e=function(t){var e=i.indexOf(t)>-1;return e||(e=!!T(t)),e};if(n.isString(t)&&(t=[t]),n.isArray(t)){var r,s;for(r=0,s=t.length;r<s;r++)if(!e(t[r]))return!1;return!0}throw new Error("You need to define the module(s) name(s)")},_getModuleName:R,_getModule:function(t){try{return g(t)}catch(e){throw(/No module/.test(e)||e.message.indexOf("$injector:nomod")>-1)&&(e.message='The module "'+A(t)+'" that you are trying to load does not exist. '+e.message),e}},moduleExists:T,_loadDependencies:function(t,e){var r,i,s,o=[],a=this;if(null===(t=a._getModuleName(t)))return u.when();try{r=a._getModule(t)}catch(t){return m(t)}return i=a.getRequires(r),n.forEach(i,(function(r){if(n.isString(r)){var i=a.getModuleConfig(r);if(null===i)return void E.push(r);r=i,i.name=void 0}if(a.moduleExists(r.name))return 0!==(s=r.files.filter((function(t){return a.getModuleConfig(r.name).files.indexOf(t)<0}))).length&&a._$log.warn('Module "',t,'" attempted to redefine configuration for dependency. "',r.name,'"\n Additional Files Loaded:',s),n.isDefined(a.filesLoader)?void o.push(a.filesLoader(r,e).then((function(){return a._loadDependencies(r)}))):m(new Error("Error: New dependencies need to be loaded from external files ("+r.files+"), but no loader has been defined."));if(n.isArray(r)){var u=[];n.forEach(r,(function(t){var e=a.getModuleConfig(t);null===e?u.push(t):e.files&&(u=u.concat(e.files))})),u.length>0&&(r={files:u})}else n.isObject(r)&&r.hasOwnProperty("name")&&r.name&&(a.setModuleConfig(r),E.push(r.name));if(n.isDefined(r.files)&&0!==r.files.length){if(!n.isDefined(a.filesLoader))return m(new Error('Error: the module "'+r.name+'" is defined in external files ('+r.files+"), but no loader has been defined."));o.push(a.filesLoader(r,e).then((function(){return a._loadDependencies(r)})))}})),u.all(o)},inject:function(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=!(arguments.length<=2||void 0===arguments[2])&&arguments[2],i=this,s=u.defer();if(n.isDefined(t)&&null!==t){if(n.isArray(t)){var o=[];return n.forEach(t,(function(t){o.push(i.inject(t,e,r))})),u.all(o)}i._addToLoadList(i._getModuleName(t),!0,r)}if(a.length>0){var c=a.slice(),l=function t(n){E.push(n),F[n]=s.promise,i._loadDependencies(n,e).then((function(){try{f=[],D(w,E,e)}catch(t){return i._$log.error(t.message),void s.reject(t)}a.length>0?t(a.shift()):s.resolve(c)}),(function(t){s.reject(t)}))};l(a.shift())}else{if(e&&e.name&&F[e.name])return F[e.name];s.resolve()}return s.promise},getRequires:function(t){var e=[];return n.forEach(t.requires,(function(t){-1===i.indexOf(t)&&e.push(t)})),e},_invokeQueue:$,_registerInvokeList:I,_register:D,_addToLoadList:d,_unregister:function(t){n.isDefined(t)&&n.isArray(t)&&n.forEach(t,(function(t){s[t]=void 0}))}}}],this._init(n.element(r.document))}]);var p=n.bootstrap;n.bootstrap=function(t,e,r){return i=["ng","oc.lazyLoad"],s={},o=[],a=[],u=[],c=[],l=n.noop,h={},f=[],n.forEach(e.slice(),(function(t){d(t,!0,!0)})),p(t,e,r)};var d=function(t,e,r){(c.length>0||e)&&n.isString(t)&&-1===a.indexOf(t)&&(a.push(t),r&&u.push(t))},g=n.module;n.module=function(t,e,n){return d(t,!1,!0),g(t,e,n)},t.exports===e&&(t.exports="oc.lazyLoad")}(angular,window),function(t){"use strict";t.module("oc.lazyLoad").directive("ocLazyLoad",["$ocLazyLoad","$compile","$animate","$parse","$timeout",function(e,n,r,i,s){return{restrict:"A",terminal:!0,priority:1e3,compile:function(s,o){var a=s[0].innerHTML;return s.html(""),function(s,o,u){var c=i(u.ocLazyLoad);s.$watch((function(){return c(s)||u.ocLazyLoad}),(function(i){t.isDefined(i)&&e.load(i).then((function(){r.enter(a,o),n(o.contents())(s)}))}),!0)}}}}])}(angular),function(t){"use strict";t.module("oc.lazyLoad").config(["$provide",function(e){e.decorator("$ocLazyLoad",["$delegate","$q","$window","$interval",function(e,n,r,i){var s=!1,o=r.document.getElementsByTagName("head")[0]||r.document.getElementsByTagName("body")[0];return e.buildElement=function(a,u,c){var l,h,f=n.defer(),p=e._getFilesCache(),d=function(t){var e=(new Date).getTime();return t.indexOf("?")>=0?"&"===t.substring(0,t.length-1)?t+"_dc="+e:t+"&_dc="+e:t+"?_dc="+e};switch(t.isUndefined(p.get(u))&&p.put(u,f.promise),a){case"css":(l=r.document.createElement("link")).type="text/css",l.rel="stylesheet",l.href=!1===c.cache?d(u):u;break;case"js":(l=r.document.createElement("script")).src=!1===c.cache?d(u):u;break;default:p.remove(u),f.reject(new Error('Requested type "'+a+'" is not known. Could not inject "'+u+'"'))}l.onload=l.onreadystatechange=function(t){l.readyState&&!/^c|loade/.test(l.readyState)||h||(l.onload=l.onreadystatechange=null,h=1,e._broadcast("ocLazyLoad.fileLoaded",u),f.resolve(l))},l.onerror=function(){p.remove(u),f.reject(new Error("Unable to load "+u))},l.async=c.serie?0:1;var g=o.lastChild;if(c.insertBefore){var m=t.element(t.isDefined(window.jQuery)?c.insertBefore:document.querySelector(c.insertBefore));m&&m.length>0&&(g=m[0])}if(g.parentNode.insertBefore(l,g),"css"==a){var v=r.navigator.userAgent.toLowerCase();if(v.indexOf("phantomjs/1.9")>-1)s=!0;else if(/iP(hone|od|ad)/.test(r.navigator.platform)){var y=r.navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),b=parseFloat([parseInt(y[1],10),parseInt(y[2],10),parseInt(y[3]||0,10)].join("."));s=b<6}else if(v.indexOf("android")>-1){var w=parseFloat(v.slice(v.indexOf("android")+8));s=w<4.4}else if(v.indexOf("safari")>-1){var x=v.match(/version\/([\.\d]+)/i);s=x&&x[1]&&parseFloat(x[1])<6}if(s)var S=1e3,E=i((function(){try{l.sheet.cssRules,i.cancel(E),l.onload()}catch(t){--S<=0&&l.onerror()}}),20)}return f.promise},e}])}])}(angular),function(t){"use strict";t.module("oc.lazyLoad").config(["$provide",function(e){e.decorator("$ocLazyLoad",["$delegate","$q",function(e,n){return e.filesLoader=function(r){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],s=[],o=[],a=[],u=[],c=null,l=e._getFilesCache();e.toggleWatch(!0),t.extend(i,r);var h=function(n){var r,h=null;if(t.isObject(n)&&(h=n.type,n=n.path),c=l.get(n),t.isUndefined(c)||!1===i.cache){if(null!==(r=/^(css|less|html|htm|js)?(?=!)/.exec(n))&&(h=r[1],n=n.substr(r[1].length+1,n.length)),!h)if(null!==(r=/[.](css|less|html|htm|js)?((\?|#).*)?$/.exec(n)))h=r[1];else{if(e.jsLoader.hasOwnProperty("ocLazyLoadLoader")||!e.jsLoader.hasOwnProperty("requirejs"))return void e._$log.error("File type could not be determined. "+n);h="js"}"css"!==h&&"less"!==h||-1!==s.indexOf(n)?"html"!==h&&"htm"!==h||-1!==o.indexOf(n)?"js"===h||-1===a.indexOf(n)?a.push(n):e._$log.error("File type is not valid. "+n):o.push(n):s.push(n)}else c&&u.push(c)};if(i.serie?h(i.files.shift()):t.forEach(i.files,(function(t){h(t)})),s.length>0){var f=n.defer();e.cssLoader(s,(function(n){t.isDefined(n)&&e.cssLoader.hasOwnProperty("ocLazyLoadLoader")?(e._$log.error(n),f.reject(n)):f.resolve()}),i),u.push(f.promise)}if(o.length>0){var p=n.defer();e.templatesLoader(o,(function(n){t.isDefined(n)&&e.templatesLoader.hasOwnProperty("ocLazyLoadLoader")?(e._$log.error(n),p.reject(n)):p.resolve()}),i),u.push(p.promise)}if(a.length>0){var d=n.defer();e.jsLoader(a,(function(n){t.isDefined(n)&&(e.jsLoader.hasOwnProperty("ocLazyLoadLoader")||e.jsLoader.hasOwnProperty("requirejs"))?(e._$log.error(n),d.reject(n)):d.resolve()}),i),u.push(d.promise)}if(0===u.length){var g=n.defer(),m="Error: no file to load has been found, if you're trying to load an existing module you should use the 'inject' method instead of 'load'.";return e._$log.error(m),g.reject(m),g.promise}return i.serie&&i.files.length>0?n.all(u).then((function(){return e.filesLoader(r,i)})):n.all(u).finally((function(t){return e.toggleWatch(!1),t}))},e.load=function(r){var i,s=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=this,a=null,u=[],c=n.defer(),l=t.copy(r),h=t.copy(s);if(t.isArray(l))return t.forEach(l,(function(t){u.push(o.load(t,h))})),n.all(u).then((function(t){c.resolve(t)}),(function(t){c.reject(t)})),c.promise;if(t.isString(l)?(a=o.getModuleConfig(l))||(a={files:[l]}):t.isObject(l)&&(a=t.isDefined(l.path)&&t.isDefined(l.type)?{files:[l]}:o.setModuleConfig(l)),null===a){var f=o._getModuleName(l);return i='Module "'+(f||"unknown")+'" is not configured, cannot load.',e._$log.error(i),c.reject(new Error(i)),c.promise}t.isDefined(a.template)&&(t.isUndefined(a.files)&&(a.files=[]),t.isString(a.template)?a.files.push(a.template):t.isArray(a.template)&&a.files.concat(a.template));var p=t.extend({},h,a);return t.isUndefined(a.files)&&t.isDefined(a.name)&&e.moduleExists(a.name)?e.inject(a.name,p,!0):(e.filesLoader(a,p).then((function(){e.inject(null,p).then((function(t){c.resolve(t)}),(function(t){c.reject(t)}))}),(function(t){c.reject(t)})),c.promise)},e}])}])}(angular),function(t){"use strict";t.module("oc.lazyLoad").config(["$provide",function(e){e.decorator("$ocLazyLoad",["$delegate","$q",function(e,n){return e.cssLoader=function(r,i,s){var o=[];t.forEach(r,(function(t){o.push(e.buildElement("css",t,s))})),n.all(o).then((function(){i()}),(function(t){i(t)}))},e.cssLoader.ocLazyLoadLoader=!0,e}])}])}(angular),function(t){"use strict";t.module("oc.lazyLoad").config(["$provide",function(e){e.decorator("$ocLazyLoad",["$delegate","$q",function(e,n){return e.jsLoader=function(r,i,s){var o=[];t.forEach(r,(function(t){o.push(e.buildElement("js",t,s))})),n.all(o).then((function(){i()}),(function(t){i(t)}))},e.jsLoader.ocLazyLoadLoader=!0,e}])}])}(angular),function(t){"use strict";t.module("oc.lazyLoad").config(["$provide",function(e){e.decorator("$ocLazyLoad",["$delegate","$templateCache","$q","$http",function(e,n,r,i){return e.templatesLoader=function(s,o,a){var u=[],c=e._getFilesCache();return t.forEach(s,(function(e){var s=r.defer();u.push(s.promise),i.get(e,a).then((function(r){var i=r.data;t.isString(i)&&i.length>0&&t.forEach(t.element(i),(function(t){"SCRIPT"===t.nodeName&&"text/ng-template"===t.type&&n.put(t.id,t.innerHTML)})),t.isUndefined(c.get(e))&&c.put(e,!0),s.resolve()})).catch((function(t){s.reject(new Error('Unable to load template file "'+e+'": '+t.data))}))})),r.all(u).then((function(){o()}),(function(t){o(t)}))},e.templatesLoader.ocLazyLoadLoader=!0,e}])}])}(angular),Array.prototype.indexOf||(Array.prototype.indexOf=function(t,e){var n;if(null==this)throw new TypeError('"this" is null or not defined');var r=Object(this),i=r.length>>>0;if(0===i)return-1;var s=+e||0;if(Math.abs(s)===1/0&&(s=0),s>=i)return-1;for(n=Math.max(s>=0?s:i-Math.abs(s),0);n<i;){if(n in r&&r[n]===t)return n;n++}return-1})},function(t,e,n){var r;
|
|
86
|
+
!function(n,r){"use strict";var i=["ng","oc.lazyLoad"],s={},o=[],a=[],u=[],c=[],l=n.noop,h={},f=[];n.module("oc.lazyLoad",["ng"]).provider("$ocLazyLoad",["$controllerProvider","$provide","$compileProvider","$filterProvider","$injector","$animateProvider",function(t,e,p,m,v,y){var b={},x={$controllerProvider:t,$compileProvider:p,$filterProvider:m,$provide:e,$injector:v,$animateProvider:y},w=!1,S=!1,E=[],F={};E.push=function(t){-1===this.indexOf(t)&&Array.prototype.push.apply(this,arguments)},this.config=function(t){n.isDefined(t.modules)&&(n.isArray(t.modules)?n.forEach(t.modules,(function(t){b[t.name]=t})):b[t.modules.name]=t.modules),n.isDefined(t.debug)&&(w=t.debug),n.isDefined(t.events)&&(S=t.events)},this._init=function(t){if(0===a.length){var e=[t],s=["ng:app","ng-app","x-ng-app","data-ng-app"],o=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/,u=function(t){return t&&e.push(t)};n.forEach(s,(function(e){s[e]=!0,u(document.getElementById(e)),e=e.replace(":","\\:"),void 0!==t[0]&&t[0].querySelectorAll&&(n.forEach(t[0].querySelectorAll("."+e),u),n.forEach(t[0].querySelectorAll("."+e+"\\:"),u),n.forEach(t[0].querySelectorAll("["+e+"]"),u))})),n.forEach(e,(function(e){if(0===a.length){var r=" "+t.className+" ",i=o.exec(r);i?a.push((i[2]||"").replace(/\s+/g,",")):n.forEach(e.attributes,(function(t){0===a.length&&s[t.name]&&a.push(t.value)}))}}))}0!==a.length||(r.jasmine||r.mocha)&&n.isDefined(n.mock)||console.error("No module found during bootstrap, unable to init ocLazyLoad. You should always use the ng-app directive or angular.boostrap when you use ocLazyLoad.");n.forEach(a,(function(t){!function t(e){if(-1===i.indexOf(e)){i.push(e);var r=n.module(e);I(null,r._invokeQueue,e),I(null,r._configBlocks,e),n.forEach(r.requires,t)}}(t)})),a=[],c.pop()};var A=function(t){try{return JSON.stringify(t)}catch(r){var e=[];return JSON.stringify(t,(function(t,r){if(n.isObject(r)&&null!==r){if(-1!==e.indexOf(r))return;e.push(r)}return r}))}},C=function(t){var e,n,r=0;if(0==t.length)return r;for(e=0,n=t.length;e<n;e++)r=(r<<5)-r+t.charCodeAt(e),r|=0;return r};function D(t,e,r){if(e){var s,o,a,c=[];for(s=e.length-1;s>=0;s--)if(o=e[s],n.isString(o)||(o=R(o)),o&&-1===f.indexOf(o)&&(!b[o]||-1!==u.indexOf(o))){var p=-1===i.indexOf(o);if(a=g(o),p&&(i.push(o),D(t,a.requires,r)),a._runBlocks.length>0)for(h[o]=[];a._runBlocks.length>0;)h[o].push(a._runBlocks.shift());n.isDefined(h[o])&&(p||r.rerun)&&(c=c.concat(h[o])),I(t,a._invokeQueue,o,r.reconfig),I(t,a._configBlocks,o,r.reconfig),l(p?"ocLazyLoad.moduleLoaded":"ocLazyLoad.moduleReloaded",o),e.pop(),f.push(o)}var d=t.getInstanceInjector();n.forEach(c,(function(t){d.invoke(t)}))}}function $(t,e){var r=t[2][0],i=t[1],o=!1;n.isUndefined(s[e])&&(s[e]={}),n.isUndefined(s[e][i])&&(s[e][i]={});var a=function(t,r){s[e][i].hasOwnProperty(t)||(s[e][i][t]=[]),function(t,e){var r,i=!0;e.length&&(r=u(t),n.forEach(e,(function(t){i=i&&u(t)!==r})));return i}(r,s[e][i][t])&&(o=!0,s[e][i][t].push(r),l("ocLazyLoad.componentLoaded",[e,i,t]))};function u(t){return n.isArray(t)?C(t.toString()):n.isObject(t)?C(A(t)):n.isDefined(t)&&null!==t?C(t.toString()):t}if(n.isString(r))a(r,t[2][1]);else{if(!n.isObject(r))return!1;n.forEach(r,(function(t,e){n.isString(t)?a(t,r[1]):a(e,t)}))}return o}function I(t,e,r,i){var s,a,u,c;if(e)for(s=0,a=e.length;s<a;s++)if(u=e[s],n.isArray(u)){if(null!==t){if(!t.hasOwnProperty(u[0]))throw new Error("unsupported provider "+u[0]);c=t[u[0]]}var l=$(u,r);if("invoke"!==u[1])l&&n.isDefined(c)&&c[u[1]].apply(c,u[2]);else{var h=function(t){var e=o.indexOf(r+"-"+t);(-1===e||i)&&(-1===e&&o.push(r+"-"+t),n.isDefined(c)&&c[u[1]].apply(c,u[2]))};if(n.isFunction(u[2][0]))h(u[2][0]);else if(n.isArray(u[2][0]))for(var f=0,p=u[2][0].length;f<p;f++)n.isFunction(u[2][0][f])&&h(u[2][0][f])}}}function R(t){var e=null;return n.isString(t)?e=t:n.isObject(t)&&t.hasOwnProperty("name")&&n.isString(t.name)&&(e=t.name),e}function T(t){if(!n.isString(t))return!1;try{return g(t)}catch(t){if(/No module/.test(t)||t.message.indexOf("$injector:nomod")>-1)return!1}}this.$get=["$log","$rootElement","$rootScope","$cacheFactory","$q",function(t,e,r,o,u){var h,p=o("ocLazyLoad");function m(e){var n=u.defer();return t.error(e.message),n.reject(e),n.promise}return w||((t={}).error=n.noop,t.warn=n.noop,t.info=n.noop),x.getInstanceInjector=function(){return h||(h=e.data("$injector")||n.injector())},{_broadcast:l=function(e,n){S&&r.$broadcast(e,n),w&&t.info(e,n)},_$log:t,_getFilesCache:function(){return p},toggleWatch:function(t){t?c.push(!0):c.pop()},getModuleConfig:function(t){if(!n.isString(t))throw new Error("You need to give the name of the module to get");return b[t]?n.copy(b[t]):null},setModuleConfig:function(t){if(!n.isObject(t))throw new Error("You need to give the module config object to set");return b[t.name]=t,t},getModules:function(){return i},isLoaded:function(t){var e=function(t){var e=i.indexOf(t)>-1;return e||(e=!!T(t)),e};if(n.isString(t)&&(t=[t]),n.isArray(t)){var r,s;for(r=0,s=t.length;r<s;r++)if(!e(t[r]))return!1;return!0}throw new Error("You need to define the module(s) name(s)")},_getModuleName:R,_getModule:function(t){try{return g(t)}catch(e){throw(/No module/.test(e)||e.message.indexOf("$injector:nomod")>-1)&&(e.message='The module "'+A(t)+'" that you are trying to load does not exist. '+e.message),e}},moduleExists:T,_loadDependencies:function(t,e){var r,i,s,o=[],a=this;if(null===(t=a._getModuleName(t)))return u.when();try{r=a._getModule(t)}catch(t){return m(t)}return i=a.getRequires(r),n.forEach(i,(function(r){if(n.isString(r)){var i=a.getModuleConfig(r);if(null===i)return void E.push(r);r=i,i.name=void 0}if(a.moduleExists(r.name))return 0!==(s=r.files.filter((function(t){return a.getModuleConfig(r.name).files.indexOf(t)<0}))).length&&a._$log.warn('Module "',t,'" attempted to redefine configuration for dependency. "',r.name,'"\n Additional Files Loaded:',s),n.isDefined(a.filesLoader)?void o.push(a.filesLoader(r,e).then((function(){return a._loadDependencies(r)}))):m(new Error("Error: New dependencies need to be loaded from external files ("+r.files+"), but no loader has been defined."));if(n.isArray(r)){var u=[];n.forEach(r,(function(t){var e=a.getModuleConfig(t);null===e?u.push(t):e.files&&(u=u.concat(e.files))})),u.length>0&&(r={files:u})}else n.isObject(r)&&r.hasOwnProperty("name")&&r.name&&(a.setModuleConfig(r),E.push(r.name));if(n.isDefined(r.files)&&0!==r.files.length){if(!n.isDefined(a.filesLoader))return m(new Error('Error: the module "'+r.name+'" is defined in external files ('+r.files+"), but no loader has been defined."));o.push(a.filesLoader(r,e).then((function(){return a._loadDependencies(r)})))}})),u.all(o)},inject:function(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],r=!(arguments.length<=2||void 0===arguments[2])&&arguments[2],i=this,s=u.defer();if(n.isDefined(t)&&null!==t){if(n.isArray(t)){var o=[];return n.forEach(t,(function(t){o.push(i.inject(t,e,r))})),u.all(o)}i._addToLoadList(i._getModuleName(t),!0,r)}if(a.length>0){var c=a.slice(),l=function t(n){E.push(n),F[n]=s.promise,i._loadDependencies(n,e).then((function(){try{f=[],D(x,E,e)}catch(t){return i._$log.error(t.message),void s.reject(t)}a.length>0?t(a.shift()):s.resolve(c)}),(function(t){s.reject(t)}))};l(a.shift())}else{if(e&&e.name&&F[e.name])return F[e.name];s.resolve()}return s.promise},getRequires:function(t){var e=[];return n.forEach(t.requires,(function(t){-1===i.indexOf(t)&&e.push(t)})),e},_invokeQueue:I,_registerInvokeList:$,_register:D,_addToLoadList:d,_unregister:function(t){n.isDefined(t)&&n.isArray(t)&&n.forEach(t,(function(t){s[t]=void 0}))}}}],this._init(n.element(r.document))}]);var p=n.bootstrap;n.bootstrap=function(t,e,r){return i=["ng","oc.lazyLoad"],s={},o=[],a=[],u=[],c=[],l=n.noop,h={},f=[],n.forEach(e.slice(),(function(t){d(t,!0,!0)})),p(t,e,r)};var d=function(t,e,r){(c.length>0||e)&&n.isString(t)&&-1===a.indexOf(t)&&(a.push(t),r&&u.push(t))},g=n.module;n.module=function(t,e,n){return d(t,!1,!0),g(t,e,n)},t.exports===e&&(t.exports="oc.lazyLoad")}(angular,window),function(t){"use strict";t.module("oc.lazyLoad").directive("ocLazyLoad",["$ocLazyLoad","$compile","$animate","$parse","$timeout",function(e,n,r,i,s){return{restrict:"A",terminal:!0,priority:1e3,compile:function(s,o){var a=s[0].innerHTML;return s.html(""),function(s,o,u){var c=i(u.ocLazyLoad);s.$watch((function(){return c(s)||u.ocLazyLoad}),(function(i){t.isDefined(i)&&e.load(i).then((function(){r.enter(a,o),n(o.contents())(s)}))}),!0)}}}}])}(angular),function(t){"use strict";t.module("oc.lazyLoad").config(["$provide",function(e){e.decorator("$ocLazyLoad",["$delegate","$q","$window","$interval",function(e,n,r,i){var s=!1,o=r.document.getElementsByTagName("head")[0]||r.document.getElementsByTagName("body")[0];return e.buildElement=function(a,u,c){var l,h,f=n.defer(),p=e._getFilesCache(),d=function(t){var e=(new Date).getTime();return t.indexOf("?")>=0?"&"===t.substring(0,t.length-1)?t+"_dc="+e:t+"&_dc="+e:t+"?_dc="+e};switch(t.isUndefined(p.get(u))&&p.put(u,f.promise),a){case"css":(l=r.document.createElement("link")).type="text/css",l.rel="stylesheet",l.href=!1===c.cache?d(u):u;break;case"js":(l=r.document.createElement("script")).src=!1===c.cache?d(u):u;break;default:p.remove(u),f.reject(new Error('Requested type "'+a+'" is not known. Could not inject "'+u+'"'))}l.onload=l.onreadystatechange=function(t){l.readyState&&!/^c|loade/.test(l.readyState)||h||(l.onload=l.onreadystatechange=null,h=1,e._broadcast("ocLazyLoad.fileLoaded",u),f.resolve(l))},l.onerror=function(){p.remove(u),f.reject(new Error("Unable to load "+u))},l.async=c.serie?0:1;var g=o.lastChild;if(c.insertBefore){var m=t.element(t.isDefined(window.jQuery)?c.insertBefore:document.querySelector(c.insertBefore));m&&m.length>0&&(g=m[0])}if(g.parentNode.insertBefore(l,g),"css"==a){var v=r.navigator.userAgent.toLowerCase();if(v.indexOf("phantomjs/1.9")>-1)s=!0;else if(/iP(hone|od|ad)/.test(r.navigator.platform)){var y=r.navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),b=parseFloat([parseInt(y[1],10),parseInt(y[2],10),parseInt(y[3]||0,10)].join("."));s=b<6}else if(v.indexOf("android")>-1){var x=parseFloat(v.slice(v.indexOf("android")+8));s=x<4.4}else if(v.indexOf("safari")>-1){var w=v.match(/version\/([\.\d]+)/i);s=w&&w[1]&&parseFloat(w[1])<6}if(s)var S=1e3,E=i((function(){try{l.sheet.cssRules,i.cancel(E),l.onload()}catch(t){--S<=0&&l.onerror()}}),20)}return f.promise},e}])}])}(angular),function(t){"use strict";t.module("oc.lazyLoad").config(["$provide",function(e){e.decorator("$ocLazyLoad",["$delegate","$q",function(e,n){return e.filesLoader=function(r){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],s=[],o=[],a=[],u=[],c=null,l=e._getFilesCache();e.toggleWatch(!0),t.extend(i,r);var h=function(n){var r,h=null;if(t.isObject(n)&&(h=n.type,n=n.path),c=l.get(n),t.isUndefined(c)||!1===i.cache){if(null!==(r=/^(css|less|html|htm|js)?(?=!)/.exec(n))&&(h=r[1],n=n.substr(r[1].length+1,n.length)),!h)if(null!==(r=/[.](css|less|html|htm|js)?((\?|#).*)?$/.exec(n)))h=r[1];else{if(e.jsLoader.hasOwnProperty("ocLazyLoadLoader")||!e.jsLoader.hasOwnProperty("requirejs"))return void e._$log.error("File type could not be determined. "+n);h="js"}"css"!==h&&"less"!==h||-1!==s.indexOf(n)?"html"!==h&&"htm"!==h||-1!==o.indexOf(n)?"js"===h||-1===a.indexOf(n)?a.push(n):e._$log.error("File type is not valid. "+n):o.push(n):s.push(n)}else c&&u.push(c)};if(i.serie?h(i.files.shift()):t.forEach(i.files,(function(t){h(t)})),s.length>0){var f=n.defer();e.cssLoader(s,(function(n){t.isDefined(n)&&e.cssLoader.hasOwnProperty("ocLazyLoadLoader")?(e._$log.error(n),f.reject(n)):f.resolve()}),i),u.push(f.promise)}if(o.length>0){var p=n.defer();e.templatesLoader(o,(function(n){t.isDefined(n)&&e.templatesLoader.hasOwnProperty("ocLazyLoadLoader")?(e._$log.error(n),p.reject(n)):p.resolve()}),i),u.push(p.promise)}if(a.length>0){var d=n.defer();e.jsLoader(a,(function(n){t.isDefined(n)&&(e.jsLoader.hasOwnProperty("ocLazyLoadLoader")||e.jsLoader.hasOwnProperty("requirejs"))?(e._$log.error(n),d.reject(n)):d.resolve()}),i),u.push(d.promise)}if(0===u.length){var g=n.defer(),m="Error: no file to load has been found, if you're trying to load an existing module you should use the 'inject' method instead of 'load'.";return e._$log.error(m),g.reject(m),g.promise}return i.serie&&i.files.length>0?n.all(u).then((function(){return e.filesLoader(r,i)})):n.all(u).finally((function(t){return e.toggleWatch(!1),t}))},e.load=function(r){var i,s=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=this,a=null,u=[],c=n.defer(),l=t.copy(r),h=t.copy(s);if(t.isArray(l))return t.forEach(l,(function(t){u.push(o.load(t,h))})),n.all(u).then((function(t){c.resolve(t)}),(function(t){c.reject(t)})),c.promise;if(t.isString(l)?(a=o.getModuleConfig(l))||(a={files:[l]}):t.isObject(l)&&(a=t.isDefined(l.path)&&t.isDefined(l.type)?{files:[l]}:o.setModuleConfig(l)),null===a){var f=o._getModuleName(l);return i='Module "'+(f||"unknown")+'" is not configured, cannot load.',e._$log.error(i),c.reject(new Error(i)),c.promise}t.isDefined(a.template)&&(t.isUndefined(a.files)&&(a.files=[]),t.isString(a.template)?a.files.push(a.template):t.isArray(a.template)&&a.files.concat(a.template));var p=t.extend({},h,a);return t.isUndefined(a.files)&&t.isDefined(a.name)&&e.moduleExists(a.name)?e.inject(a.name,p,!0):(e.filesLoader(a,p).then((function(){e.inject(null,p).then((function(t){c.resolve(t)}),(function(t){c.reject(t)}))}),(function(t){c.reject(t)})),c.promise)},e}])}])}(angular),function(t){"use strict";t.module("oc.lazyLoad").config(["$provide",function(e){e.decorator("$ocLazyLoad",["$delegate","$q",function(e,n){return e.cssLoader=function(r,i,s){var o=[];t.forEach(r,(function(t){o.push(e.buildElement("css",t,s))})),n.all(o).then((function(){i()}),(function(t){i(t)}))},e.cssLoader.ocLazyLoadLoader=!0,e}])}])}(angular),function(t){"use strict";t.module("oc.lazyLoad").config(["$provide",function(e){e.decorator("$ocLazyLoad",["$delegate","$q",function(e,n){return e.jsLoader=function(r,i,s){var o=[];t.forEach(r,(function(t){o.push(e.buildElement("js",t,s))})),n.all(o).then((function(){i()}),(function(t){i(t)}))},e.jsLoader.ocLazyLoadLoader=!0,e}])}])}(angular),function(t){"use strict";t.module("oc.lazyLoad").config(["$provide",function(e){e.decorator("$ocLazyLoad",["$delegate","$templateCache","$q","$http",function(e,n,r,i){return e.templatesLoader=function(s,o,a){var u=[],c=e._getFilesCache();return t.forEach(s,(function(e){var s=r.defer();u.push(s.promise),i.get(e,a).then((function(r){var i=r.data;t.isString(i)&&i.length>0&&t.forEach(t.element(i),(function(t){"SCRIPT"===t.nodeName&&"text/ng-template"===t.type&&n.put(t.id,t.innerHTML)})),t.isUndefined(c.get(e))&&c.put(e,!0),s.resolve()})).catch((function(t){s.reject(new Error('Unable to load template file "'+e+'": '+t.data))}))})),r.all(u).then((function(){o()}),(function(t){o(t)}))},e.templatesLoader.ocLazyLoadLoader=!0,e}])}])}(angular),Array.prototype.indexOf||(Array.prototype.indexOf=function(t,e){var n;if(null==this)throw new TypeError('"this" is null or not defined');var r=Object(this),i=r.length>>>0;if(0===i)return-1;var s=+e||0;if(Math.abs(s)===1/0&&(s=0),s>=i)return-1;for(n=Math.max(s>=0?s:i-Math.abs(s),0);n<i;){if(n in r&&r[n]===t)return n;n++}return-1})},function(t,e,n){var r;
|
|
87
87
|
/*!
|
|
88
88
|
* angular-translate - v2.19.0 - 2021-09-02
|
|
89
89
|
*
|
|
90
90
|
* Copyright (c) 2021 The angular-translate team, Pascal Precht; Licensed MIT
|
|
91
91
|
*/void 0===(r=function(){return function(){function t(t,e){"use strict";return function(n){if(!n||!(angular.isArray(n.files)||angular.isString(n.prefix)&&angular.isString(n.suffix)))throw new Error("Couldn't load static files, no files and prefix or suffix specified!");n.files||(n.files=[{prefix:n.prefix,suffix:n.suffix}]);for(var r=function(r){if(!r||!angular.isString(r.prefix)||!angular.isString(r.suffix))throw new Error("Couldn't load static file, no prefix or suffix specified!");var i=[r.prefix,n.key,r.suffix].join("");return angular.isObject(n.fileMap)&&n.fileMap[i]&&(i=n.fileMap[i]),e(angular.extend({url:i,method:"GET"},n.$http)).then((function(t){return t.data}),(function(){return t.reject(n.key)}))},i=[],s=n.files.length,o=0;o<s;o++)i.push(r({prefix:n.files[o].prefix,key:n.key,suffix:n.files[o].suffix}));return t.all(i).then((function(t){for(var e=t.length,n={},r=0;r<e;r++)for(var i in t[r])n[i]=t[r][i];return n}))}}return t.$inject=["$q","$http"],angular.module("pascalprecht.translate").factory("$translateStaticFilesLoader",t),t.displayName="$translateStaticFilesLoader","pascalprecht.translate"}()}.apply(e,[]))||(t.exports=r)},function(t,e,n){var r={"./autocomplete/app":[97,9,32],"./autocomplete/app.js":[97,9,32],"./autocomplete/controllers":[53,9,44],"./autocomplete/controllers.js":[53,9,44],"./autocomplete/plugin":[98,7,45],"./autocomplete/plugin.js":[98,7,45],"./autocomplete/templates/modal/add-label.html":[191,7,125],"./clustermanagement/app":[99,9,7,9,1,3,21],"./clustermanagement/app.js":[99,9,7,9,1,3,21],"./clustermanagement/cluster-drawing.service":[49,9,3,46],"./clustermanagement/cluster-drawing.service.js":[49,9,3,46],"./clustermanagement/controllers":[45,9,3],"./clustermanagement/controllers.js":[45,9,3],"./clustermanagement/directives":[55,9,3,27],"./clustermanagement/directives.js":[55,9,3,27],"./clustermanagement/plugin":[100,7,47],"./clustermanagement/plugin.js":[100,7,47],"./clustermanagement/templates/modal/add-nodes-dialog.html":[192,7,126],"./clustermanagement/templates/modal/cluster-create-dialog.html":[193,7,127],"./clustermanagement/templates/modal/cluster-delete-dialog.html":[194,7,128],"./clustermanagement/templates/modal/cluster-edit-dialog.html":[195,7,129],"./clustermanagement/templates/modal/remove-nodes-dialog.html":[196,7,130],"./controllers":[26,9],"./controllers.js":[26,9],"./core/angularCancelOnNavigateModule":[31,7],"./core/angularCancelOnNavigateModule.js":[31,7],"./core/controllers":[16,7],"./core/controllers.js":[16,7],"./core/directives":[11,9],"./core/directives.js":[11,9],"./core/directives/fit-text.directive":[56,7,48],"./core/directives/fit-text.directive.js":[56,7,48],"./core/directives/languageselector/language-selector.directive":[33,9],"./core/directives/languageselector/language-selector.directive.js":[33,9],"./core/directives/languageselector/templates/languageSelector.html":[197,7,131],"./core/directives/paginations":[40,7,49],"./core/directives/paginations.js":[40,7,49],"./core/directives/queryeditor/query-editor.controller":[43,9,50],"./core/directives/queryeditor/query-editor.controller.js":[43,9,50],"./core/directives/queryeditor/query-editor.directive":[44,9,0,23],"./core/directives/queryeditor/query-editor.directive.js":[44,9,0,23],"./core/directives/queryeditor/sparql-tab.directive":[42,9,51],"./core/directives/queryeditor/sparql-tab.directive.js":[42,9,51],"./core/directives/queryeditor/templates/query-editor.html":[198,7,132],"./core/directives/queryeditor/templates/query-sample.html":[199,7,133],"./core/directives/rdfresourcesearch/rdf-resource-search.directive":[32,9],"./core/directives/rdfresourcesearch/rdf-resource-search.directive.js":[32,9],"./core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html":[200,7,134],"./core/interceptors/unauthorized.interceptor":[21,9],"./core/interceptors/unauthorized.interceptor.js":[21,9],"./core/loading-hint":[22,7,52],"./core/loading-hint.js":[22,7,52],"./core/services":[4,9],"./core/services.js":[4,9],"./core/services/autocomplete-status.service":[29,7],"./core/services/autocomplete-status.service.js":[29,7],"./core/services/jwt-auth.service":[12,9],"./core/services/jwt-auth.service.js":[12,9],"./core/services/license.service":[28,7],"./core/services/license.service.js":[28,7],"./core/services/openid-auth.service":[23,9],"./core/services/openid-auth.service.js":[23,9],"./core/services/repositories.service":[10,9],"./core/services/repositories.service.js":[10,9],"./core/templates/core-errors.html":[201,7,135],"./core/templates/inactive-plugin-warning-page.html":[202,7,136],"./core/templates/modal/copy-to-clipboard-modal.html":[203,7,137],"./core/templates/modal/modal-simple.html":[204,7,138],"./core/templates/modal/modal-warning.html":[205,7,139],"./core/templates/search-resource-input.html":[206,7,140],"./explore/app":[101,9,6,0,8,15],"./explore/app.js":[101,9,6,0,8,15],"./explore/controllers":[95,9,0,8],"./explore/controllers.js":[95,9,0,8],"./explore/directives":[58,9,53],"./explore/directives.js":[58,9,53],"./explore/plugin":[102,7,54],"./explore/plugin.js":[102,7,54],"./explore/statements.service":[57,7,55],"./explore/statements.service.js":[57,7,55],"./explore/templates/viewTrig.html":[207,7,141],"./export/app":[103,9,12],"./export/app.js":[103,9,12],"./export/controllers":[59,9,34],"./export/controllers.js":[59,9,34],"./export/plugin":[104,7,56],"./export/plugin.js":[104,7,56],"./externalsync/app":[105,9,24],"./externalsync/app.js":[105,9,24],"./externalsync/controllers":[41,9,35],"./externalsync/controllers.js":[41,9,35],"./externalsync/directives":[60,9,57],"./externalsync/directives.js":[60,9,57],"./externalsync/plugin":[106,7,58],"./externalsync/plugin.js":[106,7,58],"./externalsync/templates/deleteConnector.html":[208,7,142],"./graphexplore/app":[107,9,7,9,20,0,11],"./graphexplore/app.js":[107,9,7,9,20,0,11],"./graphexplore/controllers/dependencies-chord.controller":[67,7,59],"./graphexplore/controllers/dependencies-chord.controller.js":[67,7,59],"./graphexplore/controllers/domain-range-graph.controller":[66,9,60],"./graphexplore/controllers/domain-range-graph.controller.js":[66,9,60],"./graphexplore/controllers/graphs-config.controller":[69,9,36],"./graphexplore/controllers/graphs-config.controller.js":[69,9,36],"./graphexplore/controllers/graphs-visualizations.controller":[68,9,25],"./graphexplore/controllers/graphs-visualizations.controller.js":[68,9,25],"./graphexplore/controllers/rdf-class-hierarchy.controller":[65,9,61],"./graphexplore/controllers/rdf-class-hierarchy.controller.js":[65,9,61],"./graphexplore/directives/dependencies-chord.directive":[74,9,29],"./graphexplore/directives/dependencies-chord.directive.js":[74,9,29],"./graphexplore/directives/domain-range-graph.directive":[71,9,30],"./graphexplore/directives/domain-range-graph.directive.js":[71,9,30],"./graphexplore/directives/list-items-search-filter.directive":[75,7,62],"./graphexplore/directives/list-items-search-filter.directive.js":[75,7,62],"./graphexplore/directives/rdf-class-hierarchy.directive":[70,9,18],"./graphexplore/directives/rdf-class-hierarchy.directive.js":[70,9,18],"./graphexplore/directives/rdfs-comment-label.directive":[73,7,63],"./graphexplore/directives/rdfs-comment-label.directive.js":[73,7,63],"./graphexplore/directives/search-icon-input.directive":[76,7,64],"./graphexplore/directives/search-icon-input.directive.js":[76,7,64],"./graphexplore/directives/system-repo-warning.directive":[72,7,65],"./graphexplore/directives/system-repo-warning.directive.js":[72,7,65],"./graphexplore/plugin":[108,7,66],"./graphexplore/plugin.js":[108,7,66],"./graphexplore/services/rdfs-label-comment.service":[62,7,67],"./graphexplore/services/rdfs-label-comment.service.js":[62,7,67],"./graphexplore/services/ui-scroll.service":[61,7,68],"./graphexplore/services/ui-scroll.service.js":[61,7,68],"./graphexplore/templates/listItemsSearchFilterTemplate.html":[209,7,143],"./graphexplore/templates/modal/save-graph.html":[210,7,144],"./graphexplore/templates/rdfClassHierarchyClassCountSliderHelpTemplate.html":[211,7,145],"./graphexplore/templates/rdfsCommentLabelTemplate.html":[212,7,146],"./graphexplore/templates/searchIconInputTemplate.html":[213,7,147],"./graphexplore/templates/systemRepoWarningTemplate.html":[214,7,148],"./guides/app":[109,9,28],"./guides/app.js":[109,9,28],"./guides/controllers":[77,9,33],"./guides/controllers.js":[77,9,33],"./guides/directives":[30,7],"./guides/directives.js":[30,7],"./guides/guide-utils":[1,9],"./guides/guide-utils.js":[1,9],"./guides/guides.service":[20,9],"./guides/guides.service.js":[20,9],"./guides/plugin":[110,7,69],"./guides/plugin.js":[110,7,69],"./guides/steps/complex/class-hierarchy/plugin":[111,7,70],"./guides/steps/complex/class-hierarchy/plugin.js":[111,7,70],"./guides/steps/complex/create-repository/plugin":[112,7,71],"./guides/steps/complex/create-repository/plugin.js":[112,7,71],"./guides/steps/complex/download-guide-resource/plugin":[113,7,72],"./guides/steps/complex/download-guide-resource/plugin.js":[113,7,72],"./guides/steps/complex/enable-autocomplete/plugin":[114,7,73],"./guides/steps/complex/enable-autocomplete/plugin.js":[114,7,73],"./guides/steps/complex/execute-sparql-query/plugin":[115,7,74],"./guides/steps/complex/execute-sparql-query/plugin.js":[115,7,74],"./guides/steps/complex/import-rdf-file/plugin":[116,7,75],"./guides/steps/complex/import-rdf-file/plugin.js":[116,7,75],"./guides/steps/complex/main-menu/plugin":[117,7,76],"./guides/steps/complex/main-menu/plugin.js":[117,7,76],"./guides/steps/complex/select-repository/plugin":[118,7,77],"./guides/steps/complex/select-repository/plugin.js":[118,7,77],"./guides/steps/complex/table-graph/plugin":[119,7,78],"./guides/steps/complex/table-graph/plugin.js":[119,7,78],"./guides/steps/complex/visual-graph/plugin":[120,7,79],"./guides/steps/complex/visual-graph/plugin.js":[120,7,79],"./guides/steps/core/plugin":[121,7,80],"./guides/steps/core/plugin.js":[121,7,80],"./guides/tour-lib-services/shepherd.service":[7,9],"./guides/tour-lib-services/shepherd.service.js":[7,9],"./import/app":[122,9,31],"./import/app.js":[122,9,31],"./import/controllers":[78,9,81],"./import/controllers.js":[78,9,81],"./import/directives":[79,9,82],"./import/directives.js":[79,9,82],"./import/plugin":[123,7,83],"./import/plugin.js":[123,7,83],"./import/templates/commonInfo.html":[215,7,149],"./import/templates/filesTable.html":[216,7,150],"./import/templates/importInfo.html":[217,7,151],"./import/templates/settingsModal.html":[218,7,152],"./import/templates/textSnippet.html":[219,7,153],"./import/templates/uploadInfo.html":[220,7,154],"./import/templates/urlImport.html":[221,7,155],"./jdbc/app":[124,9,0,1,2,4,16],"./jdbc/app.js":[124,9,0,1,2,4,16],"./jdbc/controllers":[80,9,37],"./jdbc/controllers.js":[80,9,37],"./jdbc/plugin":[125,7,84],"./jdbc/plugin.js":[125,7,84],"./namespaces/app":[126,9,6,22],"./namespaces/app.js":[126,9,6,22],"./namespaces/controllers":[82,9,85],"./namespaces/controllers.js":[82,9,85],"./namespaces/directives":[83,7,86],"./namespaces/directives.js":[83,7,86],"./namespaces/plugin":[127,7,87],"./namespaces/plugin.js":[127,7,87],"./plugin":[129,7,89],"./plugin-registry":[128,7,88],"./plugin-registry.js":[128,7,88],"./plugin.js":[129,7,89],"./plugins/app":[130,9,38],"./plugins/app.js":[130,9,38],"./plugins/controllers":[84,9,90],"./plugins/controllers.js":[84,9,90],"./plugins/plugin":[131,7,91],"./plugins/plugin.js":[131,7,91],"./queries/app":[132,9,39],"./queries/app.js":[132,9,39],"./queries/controllers":[85,9,92],"./queries/controllers.js":[85,9,92],"./queries/plugin":[133,7,93],"./queries/plugin.js":[133,7,93],"./rdfrank/app":[134,9,26],"./rdfrank/app.js":[134,9,26],"./rdfrank/plugin":[135,7,94],"./rdfrank/plugin.js":[135,7,94],"./rdfrank/templates/filter-list.html":[222,7,156],"./repositories/app":[136,9,5,19],"./repositories/app.js":[136,9,5,19],"./repositories/controllers":[52,9,5],"./repositories/controllers.js":[52,9,5],"./repositories/fedx-repo.directive":[88,7,95],"./repositories/fedx-repo.directive.js":[88,7,95],"./repositories/ontop-repo.directive":[87,9,5,96],"./repositories/ontop-repo.directive.js":[87,9,5,96],"./repositories/plugin":[137,7,97],"./repositories/plugin.js":[137,7,97],"./repositories/repository.constants":[47,9,98],"./repositories/repository.constants.js":[47,9,98],"./repositories/templates/fedx-repo.html":[223,7,157],"./repositories/templates/ontop-repo.html":[224,7,158],"./resources/app":[138,9,7,1,4,40],"./resources/app.js":[138,9,7,1,4,40],"./resources/controllers":[51,9,1,4],"./resources/controllers.js":[51,9,1,4],"./resources/plugin":[139,7,99],"./resources/plugin.js":[139,7,99],"./rest/autocomplete.rest.service":[18,7],"./rest/autocomplete.rest.service.js":[18,7],"./rest/cluster.rest.service":[54,7,100],"./rest/cluster.rest.service.js":[54,7,100],"./rest/connectors.rest.service":[39,7,101],"./rest/connectors.rest.service.js":[39,7,101],"./rest/graph-config.rest.service":[64,7,102],"./rest/graph-config.rest.service.js":[64,7,102],"./rest/graph-data.rest.service":[48,7,103],"./rest/graph-data.rest.service.js":[48,7,103],"./rest/jdbc.rest.service":[81,7,104],"./rest/jdbc.rest.service.js":[81,7,104],"./rest/license.rest.service":[8,7],"./rest/license.rest.service.js":[8,7],"./rest/locations.rest.service":[27,7],"./rest/locations.rest.service.js":[27,7],"./rest/monitoring.rest.service":[14,7],"./rest/monitoring.rest.service.js":[14,7],"./rest/plugins.rest.service":[19,7],"./rest/plugins.rest.service.js":[19,7],"./rest/rdf4j.repositories.rest.service":[15,7],"./rest/rdf4j.repositories.rest.service.js":[15,7],"./rest/rdfrank.rest.service":[86,7,105],"./rest/rdfrank.rest.service.js":[86,7,105],"./rest/repositories.rest.service":[9,7],"./rest/repositories.rest.service.js":[9,7],"./rest/saved-graphs.rest.service":[63,7,106],"./rest/saved-graphs.rest.service.js":[63,7,106],"./rest/security.rest.service":[24,7],"./rest/security.rest.service.js":[24,7],"./rest/similarity.rest.service":[90,7,107],"./rest/similarity.rest.service.js":[90,7,107],"./rest/sparql-templates.rest.service":[91,7,108],"./rest/sparql-templates.rest.service.js":[91,7,108],"./rest/sparql.rest.service":[17,7],"./rest/sparql.rest.service.js":[17,7],"./security/app":[140,9,10,109],"./security/app.js":[140,9,10,109],"./security/controllers":[96,9,10],"./security/controllers.js":[96,9,10],"./security/plugin":[141,7,110],"./security/plugin.js":[141,7,110],"./security/templates/modal/default-authorities.html":[225,7,159],"./security/templates/roles.html":[226,7,160],"./security/templates/user.html":[227,7,161],"./security/templates/users.html":[228,7,162],"./settings/app":[89,9,41],"./settings/app.js":[89,9,41],"./settings/controllers":[50,9,111],"./settings/controllers.js":[50,9,111],"./settings/modal/location-settings.html":[229,7,163],"./settings/modal/validate-license.html":[230,7,164],"./settings/plugin":[142,7,112],"./settings/plugin.js":[142,7,112],"./similarity/app":[143,9,0,2,13],"./similarity/app.js":[143,9,0,2,13],"./similarity/controllers/create-index.controller":[93,9,42],"./similarity/controllers/create-index.controller.js":[93,9,42],"./similarity/controllers/similarity-list.controller":[92,9,0,113],"./similarity/controllers/similarity-list.controller.js":[92,9,0,113],"./similarity/plugin":[144,7,114],"./similarity/plugin.js":[144,7,114],"./sparql-template/app":[147,9,0,1,2,4,17],"./sparql-template/app.js":[147,9,0,1,2,4,17],"./sparql-template/controllers":[94,9,43],"./sparql-template/controllers.js":[94,9,43],"./sparql-template/plugin":[148,7,115],"./sparql-template/plugin.js":[148,7,115],"./sparql/app":[145,9,6,0,2,14],"./sparql/app.js":[145,9,6,0,2,14],"./sparql/plugin":[146,7,116],"./sparql/plugin.js":[146,7,116],"./stats/app":[149,9,117],"./stats/app.js":[149,9,117],"./stats/plugin":[150,7,118],"./stats/plugin.js":[150,7,118],"./templates/graphdb-small.svg":[231,7,172],"./templates/loader/ot-loader.svg":[232,7,173],"./templates/modal/add-fedx-remote-repo.html":[233,7,165],"./templates/modal/add-location.html":[234,7,166],"./templates/modal/edit-location.html":[235,7,167],"./templates/modal/editRepoFile.html":[236,7,168],"./templates/modal/upload-repository-config.html":[237,7,169],"./templates/repositorySize.html":[238,7,170],"./templates/titlePopoverTemplate.html":[239,7,171],"./treeview/ng-tree":[151,7,119],"./treeview/ng-tree.js":[151,7,119],"./utils/error-utils":[25,7],"./utils/error-utils.js":[25,7],"./utils/file-types":[46,7,120],"./utils/file-types.js":[46,7,120],"./utils/local-storage-adapter":[5,7],"./utils/local-storage-adapter.js":[5,7],"./utils/notifications":[38,7,121],"./utils/notifications.js":[38,7,121],"./utils/uri-utils":[13,7],"./utils/uri-utils.js":[13,7],"./utils/user-utils":[2,9],"./utils/user-utils.js":[2,9]};function i(t){if(!n.o(r,t))return Promise.resolve().then((function(){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}));var e=r[t],i=e[0];return Promise.all(e.slice(2).map(n.e)).then((function(){return n.t(i,e[1])}))}i.keys=function(){return Object.keys(r)},i.id=190,t.exports=i}]);
|
|
92
|
-
//# sourceMappingURL=bundle.
|
|
92
|
+
//# sourceMappingURL=bundle.22ecad5921060aa35ed6.bundle.js.map
|