diff --git a/_docs/README.md b/_docs/README.md index b98e4cb..5f1d78f 100644 --- a/_docs/README.md +++ b/_docs/README.md @@ -1,7 +1,7 @@ # From here you should be able to access the application -[Go to the chat](/solid-app/index.html) +[Go to the chat](https://arquisoft.github.io/dechat_en1b/) # Summary diff --git a/docs/404.html b/docs/404.html index 662555b..2bbca72 100644 --- a/docs/404.html +++ b/docs/404.html @@ -12,5 +12,5 @@ - + diff --git a/docs/docs/01. Introduction and Goals.html b/docs/docs/01. Introduction and Goals.html index 069ed9d..01eeac2 100644 --- a/docs/docs/01. Introduction and Goals.html +++ b/docs/docs/01. Introduction and Goals.html @@ -460,7 +460,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Introduction and Goals","level":"1.2","depth":1,"next":{"title":"Architecture Constraints","level":"1.3","depth":1,"path":"02. Architecture Constraints.md","ref":"02. Architecture Constraints.md","articles":[]},"previous":{"title":"Introduction","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"01. Introduction and Goals.md","mtime":"2019-04-10T18:58:31.407Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-21T23:33:37.598Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Introduction and Goals","level":"1.2","depth":1,"next":{"title":"Architecture Constraints","level":"1.3","depth":1,"path":"02. Architecture Constraints.md","ref":"02. Architecture Constraints.md","articles":[]},"previous":{"title":"Introduction","level":"1.1","depth":1,"path":"README.md","ref":"README.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"01. Introduction and Goals.md","mtime":"2019-04-01T15:28:05.722Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-22T13:31:45.254Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/docs/02. Architecture Constraints.html b/docs/docs/02. Architecture Constraints.html index 47f3f2f..12ced49 100644 --- a/docs/docs/02. Architecture Constraints.html +++ b/docs/docs/02. Architecture Constraints.html @@ -444,7 +444,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Architecture Constraints","level":"1.3","depth":1,"next":{"title":"Context and scope","level":"1.4","depth":1,"path":"03. Context and scope.md","ref":"03. Context and scope.md","articles":[]},"previous":{"title":"Introduction and Goals","level":"1.2","depth":1,"path":"01. Introduction and Goals.md","ref":"01. Introduction and Goals.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"02. Architecture Constraints.md","mtime":"2019-04-10T18:58:31.408Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-21T23:33:37.598Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Architecture Constraints","level":"1.3","depth":1,"next":{"title":"Context and scope","level":"1.4","depth":1,"path":"03. Context and scope.md","ref":"03. Context and scope.md","articles":[]},"previous":{"title":"Introduction and Goals","level":"1.2","depth":1,"path":"01. Introduction and Goals.md","ref":"01. Introduction and Goals.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"02. Architecture Constraints.md","mtime":"2019-04-01T15:28:05.723Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-22T13:31:45.254Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/docs/03. Context and scope.html b/docs/docs/03. Context and scope.html index cb337e1..93deb62 100644 --- a/docs/docs/03. Context and scope.html +++ b/docs/docs/03. Context and scope.html @@ -401,7 +401,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Context and scope","level":"1.4","depth":1,"next":{"title":"Solution Strategy","level":"1.5","depth":1,"path":"04. Solution Strategy.md","ref":"04. Solution Strategy.md","articles":[]},"previous":{"title":"Architecture Constraints","level":"1.3","depth":1,"path":"02. Architecture Constraints.md","ref":"02. Architecture Constraints.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"03. Context and scope.md","mtime":"2019-04-10T18:58:31.410Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-21T23:33:37.598Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Context and scope","level":"1.4","depth":1,"next":{"title":"Solution Strategy","level":"1.5","depth":1,"path":"04. Solution Strategy.md","ref":"04. Solution Strategy.md","articles":[]},"previous":{"title":"Architecture Constraints","level":"1.3","depth":1,"path":"02. Architecture Constraints.md","ref":"02. Architecture Constraints.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"03. Context and scope.md","mtime":"2019-02-27T18:31:40.005Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-22T13:31:45.254Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/docs/04. Solution Strategy.html b/docs/docs/04. Solution Strategy.html index 8beb971..d27ac64 100644 --- a/docs/docs/04. Solution Strategy.html +++ b/docs/docs/04. Solution Strategy.html @@ -435,7 +435,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Solution Strategy","level":"1.5","depth":1,"next":{"title":"Building Block View","level":"1.6","depth":1,"path":"05. Building Block View.md","ref":"05. Building Block View.md","articles":[]},"previous":{"title":"Context and scope","level":"1.4","depth":1,"path":"03. Context and scope.md","ref":"03. Context and scope.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"04. Solution Strategy.md","mtime":"2019-04-10T18:58:31.413Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-21T23:33:37.598Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Solution Strategy","level":"1.5","depth":1,"next":{"title":"Building Block View","level":"1.6","depth":1,"path":"05. Building Block View.md","ref":"05. Building Block View.md","articles":[]},"previous":{"title":"Context and scope","level":"1.4","depth":1,"path":"03. Context and scope.md","ref":"03. Context and scope.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"04. Solution Strategy.md","mtime":"2019-04-01T15:28:05.722Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-22T13:31:45.254Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/docs/05. Building Block View.html b/docs/docs/05. Building Block View.html index cba4ac5..d8cb9ec 100644 --- a/docs/docs/05. Building Block View.html +++ b/docs/docs/05. Building Block View.html @@ -427,7 +427,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Building Block View","level":"1.6","depth":1,"next":{"title":"Runtime View","level":"1.7","depth":1,"path":"06. Runtime View.md","ref":"06. Runtime View.md","articles":[]},"previous":{"title":"Solution Strategy","level":"1.5","depth":1,"path":"04. Solution Strategy.md","ref":"04. Solution Strategy.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"05. Building Block View.md","mtime":"2019-04-10T18:58:31.416Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-21T23:33:37.598Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Building Block View","level":"1.6","depth":1,"next":{"title":"Runtime View","level":"1.7","depth":1,"path":"06. Runtime View.md","ref":"06. Runtime View.md","articles":[]},"previous":{"title":"Solution Strategy","level":"1.5","depth":1,"path":"04. Solution Strategy.md","ref":"04. Solution Strategy.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"05. Building Block View.md","mtime":"2019-04-01T15:28:05.724Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-22T13:31:45.254Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/docs/06. Runtime View.html b/docs/docs/06. Runtime View.html index 8383628..ccd0219 100644 --- a/docs/docs/06. Runtime View.html +++ b/docs/docs/06. Runtime View.html @@ -439,7 +439,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Runtime View","level":"1.7","depth":1,"next":{"title":"Deployment View","level":"1.8","depth":1,"path":"07. Deployment View.md","ref":"07. Deployment View.md","articles":[]},"previous":{"title":"Building Block View","level":"1.6","depth":1,"path":"05. Building Block View.md","ref":"05. Building Block View.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"06. Runtime View.md","mtime":"2019-04-10T18:58:31.417Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-21T23:33:37.598Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Runtime View","level":"1.7","depth":1,"next":{"title":"Deployment View","level":"1.8","depth":1,"path":"07. Deployment View.md","ref":"07. Deployment View.md","articles":[]},"previous":{"title":"Building Block View","level":"1.6","depth":1,"path":"05. Building Block View.md","ref":"05. Building Block View.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"06. Runtime View.md","mtime":"2019-04-01T18:37:56.980Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-22T13:31:45.254Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/docs/07. Deployment View.html b/docs/docs/07. Deployment View.html index 7d24e06..b9c67d8 100644 --- a/docs/docs/07. Deployment View.html +++ b/docs/docs/07. Deployment View.html @@ -398,7 +398,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Deployment View","level":"1.8","depth":1,"next":{"title":"Crosscutting Concepts","level":"1.9","depth":1,"path":"08. Crosscutting Concepts.md","ref":"08. Crosscutting Concepts.md","articles":[]},"previous":{"title":"Runtime View","level":"1.7","depth":1,"path":"06. Runtime View.md","ref":"06. Runtime View.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"07. Deployment View.md","mtime":"2019-04-10T18:58:31.419Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-21T23:33:37.598Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Deployment View","level":"1.8","depth":1,"next":{"title":"Crosscutting Concepts","level":"1.9","depth":1,"path":"08. Crosscutting Concepts.md","ref":"08. Crosscutting Concepts.md","articles":[]},"previous":{"title":"Runtime View","level":"1.7","depth":1,"path":"06. Runtime View.md","ref":"06. Runtime View.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"07. Deployment View.md","mtime":"2019-04-01T15:28:05.732Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-22T13:31:45.254Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/docs/08. Crosscutting Concepts.html b/docs/docs/08. Crosscutting Concepts.html index 5f094be..0eddbbc 100644 --- a/docs/docs/08. Crosscutting Concepts.html +++ b/docs/docs/08. Crosscutting Concepts.html @@ -403,7 +403,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Crosscutting Concepts","level":"1.9","depth":1,"next":{"title":"Architecture Decisions","level":"1.10","depth":1,"path":"09. Architecture Decisions.md","ref":"09. Architecture Decisions.md","articles":[]},"previous":{"title":"Deployment View","level":"1.8","depth":1,"path":"07. Deployment View.md","ref":"07. Deployment View.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"08. Crosscutting Concepts.md","mtime":"2019-04-10T18:58:31.420Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-21T23:33:37.598Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Crosscutting Concepts","level":"1.9","depth":1,"next":{"title":"Architecture Decisions","level":"1.10","depth":1,"path":"09. Architecture Decisions.md","ref":"09. Architecture Decisions.md","articles":[]},"previous":{"title":"Deployment View","level":"1.8","depth":1,"path":"07. Deployment View.md","ref":"07. Deployment View.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"08. Crosscutting Concepts.md","mtime":"2019-04-01T15:28:05.736Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-22T13:31:45.254Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/docs/09. Architecture Decisions.html b/docs/docs/09. Architecture Decisions.html index d6c7bea..f356e17 100644 --- a/docs/docs/09. Architecture Decisions.html +++ b/docs/docs/09. Architecture Decisions.html @@ -417,7 +417,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Architecture Decisions","level":"1.10","depth":1,"next":{"title":"Quality Requirements","level":"1.11","depth":1,"path":"10. Quality Requirements.md","ref":"10. Quality Requirements.md","articles":[]},"previous":{"title":"Crosscutting Concepts","level":"1.9","depth":1,"path":"08. Crosscutting Concepts.md","ref":"08. Crosscutting Concepts.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"09. Architecture Decisions.md","mtime":"2019-04-10T18:58:31.422Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-21T23:33:37.598Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Architecture Decisions","level":"1.10","depth":1,"next":{"title":"Quality Requirements","level":"1.11","depth":1,"path":"10. Quality Requirements.md","ref":"10. Quality Requirements.md","articles":[]},"previous":{"title":"Crosscutting Concepts","level":"1.9","depth":1,"path":"08. Crosscutting Concepts.md","ref":"08. Crosscutting Concepts.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"09. Architecture Decisions.md","mtime":"2019-04-01T15:28:05.733Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-22T13:31:45.254Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/docs/10. Quality Requirements.html b/docs/docs/10. Quality Requirements.html index 51442c9..54c5778 100644 --- a/docs/docs/10. Quality Requirements.html +++ b/docs/docs/10. Quality Requirements.html @@ -397,7 +397,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Quality Requirements","level":"1.11","depth":1,"next":{"title":"Risks and Technical Debt","level":"1.12","depth":1,"path":"11. Risks and Technical Debt.md","ref":"11. Risks and Technical Debt.md","articles":[]},"previous":{"title":"Architecture Decisions","level":"1.10","depth":1,"path":"09. Architecture Decisions.md","ref":"09. Architecture Decisions.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"10. Quality Requirements.md","mtime":"2019-04-10T18:58:31.424Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-21T23:33:37.598Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Quality Requirements","level":"1.11","depth":1,"next":{"title":"Risks and Technical Debt","level":"1.12","depth":1,"path":"11. Risks and Technical Debt.md","ref":"11. Risks and Technical Debt.md","articles":[]},"previous":{"title":"Architecture Decisions","level":"1.10","depth":1,"path":"09. Architecture Decisions.md","ref":"09. Architecture Decisions.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"10. Quality Requirements.md","mtime":"2019-04-01T15:28:05.733Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-22T13:31:45.254Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/docs/11. Risks and Technical Debt.html b/docs/docs/11. Risks and Technical Debt.html index e990295..43d50b8 100644 --- a/docs/docs/11. Risks and Technical Debt.html +++ b/docs/docs/11. Risks and Technical Debt.html @@ -418,7 +418,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Risks and Technical Debt","level":"1.12","depth":1,"next":{"title":"Glossary","level":"1.13","depth":1,"path":"12. Glossary.md","ref":"12. Glossary.md","articles":[]},"previous":{"title":"Quality Requirements","level":"1.11","depth":1,"path":"10. Quality Requirements.md","ref":"10. Quality Requirements.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"11. Risks and Technical Debt.md","mtime":"2019-04-10T18:58:31.425Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-21T23:33:37.598Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Risks and Technical Debt","level":"1.12","depth":1,"next":{"title":"Glossary","level":"1.13","depth":1,"path":"12. Glossary.md","ref":"12. Glossary.md","articles":[]},"previous":{"title":"Quality Requirements","level":"1.11","depth":1,"path":"10. Quality Requirements.md","ref":"10. Quality Requirements.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"11. Risks and Technical Debt.md","mtime":"2019-04-01T15:28:05.742Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-22T13:31:45.254Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/docs/12. Glossary.html b/docs/docs/12. Glossary.html index e353cf5..251eec1 100644 --- a/docs/docs/12. Glossary.html +++ b/docs/docs/12. Glossary.html @@ -449,7 +449,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Glossary","level":"1.13","depth":1,"next":{"title":"Experimentation","level":"1.14","depth":1,"path":"13. Experimentation.md","ref":"13. Experimentation.md","articles":[]},"previous":{"title":"Risks and Technical Debt","level":"1.12","depth":1,"path":"11. Risks and Technical Debt.md","ref":"11. Risks and Technical Debt.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"12. Glossary.md","mtime":"2019-04-10T18:58:31.427Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-21T23:33:37.598Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Glossary","level":"1.13","depth":1,"next":{"title":"Experimentation","level":"1.14","depth":1,"path":"13. Experimentation.md","ref":"13. Experimentation.md","articles":[]},"previous":{"title":"Risks and Technical Debt","level":"1.12","depth":1,"path":"11. Risks and Technical Debt.md","ref":"11. Risks and Technical Debt.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"12. Glossary.md","mtime":"2019-02-27T18:31:40.023Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-22T13:31:45.254Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/docs/13. Experimentation.html b/docs/docs/13. Experimentation.html index 539a1b6..0a4a55d 100644 --- a/docs/docs/13. Experimentation.html +++ b/docs/docs/13. Experimentation.html @@ -443,7 +443,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Experimentation","level":"1.14","depth":1,"next":{"title":"Project Structure","level":"1.15","depth":1,"path":"14. Project Structure.md","ref":"14. Project Structure.md","articles":[]},"previous":{"title":"Glossary","level":"1.13","depth":1,"path":"12. Glossary.md","ref":"12. Glossary.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"13. Experimentation.md","mtime":"2019-04-10T18:58:31.429Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-21T23:33:37.598Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Experimentation","level":"1.14","depth":1,"next":{"title":"Project Structure","level":"1.15","depth":1,"path":"14. Project Structure.md","ref":"14. Project Structure.md","articles":[]},"previous":{"title":"Glossary","level":"1.13","depth":1,"path":"12. Glossary.md","ref":"12. Glossary.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"13. Experimentation.md","mtime":"2019-04-01T15:28:05.743Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-22T13:31:45.254Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/docs/14. Project Structure.html b/docs/docs/14. Project Structure.html index 9f5a81b..c857a1d 100644 --- a/docs/docs/14. Project Structure.html +++ b/docs/docs/14. Project Structure.html @@ -467,7 +467,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Project Structure","level":"1.15","depth":1,"next":{"title":"About arc42","level":"1.16","depth":1,"path":"About arc42.md","ref":"About arc42.md","articles":[]},"previous":{"title":"Experimentation","level":"1.14","depth":1,"path":"13. Experimentation.md","ref":"13. Experimentation.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"14. Project Structure.md","mtime":"2019-04-21T20:28:08.312Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-21T23:33:37.598Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Project Structure","level":"1.15","depth":1,"next":{"title":"About arc42","level":"1.16","depth":1,"path":"About arc42.md","ref":"About arc42.md","articles":[]},"previous":{"title":"Experimentation","level":"1.14","depth":1,"path":"13. Experimentation.md","ref":"13. Experimentation.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"14. Project Structure.md","mtime":"2019-04-18T16:03:41.032Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-22T13:31:45.254Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/docs/About arc42.html b/docs/docs/About arc42.html index 880c578..dc8f194 100644 --- a/docs/docs/About arc42.html +++ b/docs/docs/About arc42.html @@ -418,7 +418,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"About arc42","level":"1.16","depth":1,"previous":{"title":"Project Structure","level":"1.15","depth":1,"path":"14. Project Structure.md","ref":"14. Project Structure.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"About arc42.md","mtime":"2019-04-10T18:58:31.431Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-21T23:33:37.598Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"About arc42","level":"1.16","depth":1,"previous":{"title":"Project Structure","level":"1.15","depth":1,"path":"14. Project Structure.md","ref":"14. Project Structure.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"About arc42.md","mtime":"2019-02-27T18:31:40.023Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-22T13:31:45.254Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/docs/index.html b/docs/docs/index.html index 2ab5bcf..f4ef7d6 100644 --- a/docs/docs/index.html +++ b/docs/docs/index.html @@ -341,7 +341,7 @@

From here you should be able to access the application

-

Go to the chat

+

Go to the chat

Summary

Summary

@@ -383,7 +383,7 @@

No results matching " var gitbook = gitbook || []; gitbook.push(function() { - gitbook.page.hasChanged({"page":{"title":"Introduction","level":"1.1","depth":1,"next":{"title":"Introduction and Goals","level":"1.2","depth":1,"path":"01. Introduction and Goals.md","ref":"01. Introduction and Goals.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"README.md","mtime":"2019-04-21T20:28:08.290Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-21T23:33:37.598Z"},"basePath":".","book":{"language":""}}); + gitbook.page.hasChanged({"page":{"title":"Introduction","level":"1.1","depth":1,"next":{"title":"Introduction and Goals","level":"1.2","depth":1,"path":"01. Introduction and Goals.md","ref":"01. Introduction and Goals.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"README.md","mtime":"2019-04-22T13:29:52.851Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-04-22T13:31:45.254Z"},"basePath":".","book":{"language":""}}); }); diff --git a/docs/main.62ed5a9371a08cd55585.js b/docs/main.d7bce48b3192426deb5e.js similarity index 92% rename from docs/main.62ed5a9371a08cd55585.js rename to docs/main.d7bce48b3192426deb5e.js index d5da481..4b9933e 100644 --- a/docs/main.62ed5a9371a08cd55585.js +++ b/docs/main.d7bce48b3192426deb5e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{0:function(e,t,n){e.exports=n("zUnb")},Q45J:function(e,t,n){window,e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,(function(t){return e[t]}).bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=91)}([function(e,t,n){e.exports=n(63)},function(e,t){function n(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}e.exports=function(e){return function(){var t=this,r=arguments;return new Promise(function(i,o){var a=e.apply(t,r);function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)})}}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n=0&&n"}},{key:"uri",get:function(){return this.value},set:function(e){this.value=e}}])&&i(n.prototype,r),u&&i(n,u),t}();c.termType="NamedNode",c.prototype.classOrder=u.NamedNode,c.prototype.isVar=0,e.exports=c},function(e,t,n){"use strict";var r=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t;return(t=[{key:"substitute",value:function(e){return console.log("@@@ node substitute"+this),this}},{key:"compareTerm",value:function(e){return this.classOrdere.classOrder?1:this.valuee.value?1:0}},{key:"equals",value:function(e){return!!e&&this.termType===e.termType&&this.value===e.value}},{key:"hashString",value:function(){return this.toCanonical()}},{key:"sameTerm",value:function(e){return this.equals(e)}},{key:"toCanonical",value:function(){return this.toNT()}},{key:"toNT",value:function(){return this.toString()}},{key:"toString",value:function(){throw new Error("Node.toString() is abstract - see the subclasses instead")}}])&&function(e,t){for(var n=0;n0&&(t=t.slice(0,u)),0===e.length)return t;if(0===e.indexOf("#"))return t+e;if(e.indexOf(":")>=0)return e;if(n=t.indexOf(":"),0===t.length)return e;if(n<0)return r("Invalid base: "+t+" in join with given: "+e),e;if(i=t.slice(0,+n+1||9e9),0===e.indexOf("//"))return i+e;if(t.indexOf("//",n)===n+1){if((o=t.indexOf("/",n+3))<0)return t.length-n-3>0?t+"/"+e:i+e}else if((o=t.indexOf("/",n+1))<0)return t.length-n-1>0?t+"/"+e:i+e;if(0===e.indexOf("/"))return t.slice(0,o)+e;if((a=(s=t.slice(o)).lastIndexOf("/"))<0)return i+e;for(a>=0&&a0&&"/"!==t[n-1];)n--;if(n<3)return t;if(e.indexOf("//",n-2)>0||t.indexOf("//",n-2)>0)return t;if(e.indexOf(":",n)>0)return t;for(s=0,l=0,a=(f=e.slice(n)).length;l0)for(c=1,h=s;h>=1?c<=h:c>=h;h>=1?++c:--c)p+="../";return p+t.slice(n)};var i=n(2);function o(e){var t;return(t=e.indexOf("#"))<0?e:e.slice(0,t)}},function(e,t,n){"use strict";var r={BlankNode:n(9),Collection:n(20),convert:n(42),DataFactory:n(23),Empty:n(86),Fetcher:n(36),Formula:n(59),Store:n(18),jsonParser:n(87),Literal:n(15),log:n(13),N3Parser:n(27),NamedNode:n(2),Namespace:n(19),Node:n(3),parse:n(60),Query:n(26).Query,queryToSPARQL:n(88),RDFaProcessor:n(39),RDFParser:n(40),serialize:n(37),Serializer:n(38),SPARQLToQuery:n(89),sparqlUpdateParser:n(61),Statement:n(24),term:n(3).fromValue,UpdateManager:n(90),UpdatesSocket:n(62).UpdatesSocket,UpdatesVia:n(62).UpdatesVia,uri:n(4),Util:n(7),Variable:n(25)};r.IndexedFormula=r.Store,r.NextId=r.BlankNode.nextId,r.fromNT=r.Formula.prototype.fromNT,r.fetcher=r.DataFactory.fetcher,r.graph=r.DataFactory.graph,r.lit=r.DataFactory.lit,r.st=r.DataFactory.st,r.sym=r.DataFactory.namedNode,r.variable=r.DataFactory.variable,r.blankNode=r.DataFactory.blankNode,r.defaultGraph=r.DataFactory.defaultGraph,r.literal=r.DataFactory.literal,r.namedNode=r.DataFactory.namedNode,r.quad=r.DataFactory.quad,r.triple=r.DataFactory.triple,e.exports=r},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";(function(e){var t=n(4).docpart,r=n(13),i=n(2);function o(e,t,n,r){var i,a="",s=[!1];if(void 0===e.nodeType)return a;if(1===e.nodeType){if(e.hasAttribute("class")&&"classWithChildText"in t&&e.matches(t.classWithChildText.class))a+=e.querySelector(t.classWithChildText.element).textContent;else if(!("skipNodeWithClass"in t&&e.matches("."+t.skipNodeWithClass))){var u=e.nodeName.toLowerCase();a+="<"+u;var l=[];for(i=e.attributes.length-1;i>=0;i--){var c=e.attributes[i];if(!(r.length>0&&r[c.name]||/^\d+$/.test(c.name))){if("class"===c.name&&"replaceClassItemWith"in t&&c.value.split(" ").indexOf(t.replaceClassItemWith.source)>-1){var f=new RegExp(t.replaceClassItemWith.source,"g");c.value=c.value.replace(f,t.replaceClassItemWith.target).trim()}"class"===c.name&&"skipClassWithValue"in t&&t.skipClassWithValue===c.value||l.push(c.name+"='"+c.value.replace(/&/g,"&").replace(//g,">").replace(/'/g,""")+"'")}}if(l.length>0&&("sortAttributes"in t&&t.sortAttributes&&l.sort(function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}),a+=" "+l.join(" ")),n[u])a+=" />";else{for(a+=">",a+="html"===u?"\n ":"",s.push("style"===u||"script"===u),i=0;i\n":""}}}else if(8===e.nodeType)a+="\x3c!--"+e.nodeValue+"--\x3e";else if(3===e.nodeType||4===e.nodeType){var h=e.nodeValue.replace(/\n+$/,"");a+=s[s.length-1]?h:h.replace(/&/g,"&").replace(//g,">")}else console.log("Warning; Cannot handle serialising nodes of type: "+e.nodeType),console.log(e);return a}function a(e,t,n,r){var i=function(e){return"BlankNode"===e.termType?null:e},o=function(e){var t=n.statementsMatching(e).map(function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)}).concat(n.statementsMatching(void 0,void 0,e).map(function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)}));return t.sort(),t.join("\n")};return"BlankNode"===e.termType&&"BlankNode"===t.termType?0===e.compareTerm(t)?0:o(e)>o(t)?1:o(e) to <"+u+">"),o.fetch(u,{referringTerm:i})}},e.exports.ArrayIndexOf=function(e,t,n){n||(n=0);var r=e.length;for(n<0&&(n=r+n);n=0;n--)e.callbacks[t[n]]=[];e.addHook=function(t){e.callbacks[t]||(e.callbacks[t]=[])},e.addCallback=function(t,n){e.callbacks[t].push(n)},e.removeCallback=function(t,n){for(var r=0;r=0;r--)(i=e.callbacks[t][r])&&i.apply(e,n)&&o.push(i);for(r=o.length-1;r>=0;r--)a.push(o[r]);for(r=s;r-1)break;"("==o.charAt(0)&&(o="function"+o);var a=o.split("@");r.push(a)}for(i=0;i1)for(var n=1;ne.classOrder?1:this.ide.id?1:0}},{key:"copy",value:function(e){var n=new t;return e.copyTo(this,n),n}},{key:"toCanonical",value:function(){return"_:"+this.value}},{key:"toString",value:function(){return t.NTAnonymousNodePrefix+this.id}}])&&function(e,t){for(var n=0;n=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(66),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(6))},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(52).Buffer)},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n1?r("Patch ambiguous. No patch done."):(s=c[0],void u(r))})}else u(r)}},{key:"declareExistential",value:function(e){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(e),e}},{key:"initPropertyActions",value:function(e){this.propertyActions[""]=[m],u(e,"sameAs")>=0&&(this.propertyActions[""]=[function(e,t,n,r,i){return e.equate(t,r),!0}]),u(e,"InverseFunctionalProperty")>=0&&(this.classActions[""]=[function(e,t,n,r,i){return e.newPropertyAction(t,g)}]),u(e,"FunctionalProperty")>=0&&(this.classActions[""]=[function(e,t,n,r,i){return e.newPropertyAction(t,d)}])}},{key:"add",value:function(e,n,r,i){var o,a,s;if(1===arguments.length){if(e instanceof Array)for(o=0;o";return!!this.subjectIndex[t]||!!this.objectIndex[t]||!!this.predicateIndex[t]}},{key:"newExistential",value:function(e){if(!e)return this.bnode();var t=this.sym(e);return this.declareExistential(t)}},{key:"newPropertyAction",value:function(e,t){var n=e.hashString();this.propertyActions[n]||(this.propertyActions[n]=[]),this.propertyActions[n].push(t);for(var r=this.statementsMatching(void 0,e,void 0),i=!1,o=0;o1&&(a=a.slice(0,1)),a||[];var p,d,g=1e10;for(d=0;d0&&e.forEach(function(e){n.elements.push(l.fromValue(e))}),n}var n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(t,l),(n=[{key:"append",value:function(e){return this.elements.push(e)}},{key:"close",value:function(){return this.closed=!0,this.closed}},{key:"shift",value:function(){return this.elements.shift()}},{key:"substitute",value:function(e){return new t(this.elements.map(function(t){t.substitute(e)}))}},{key:"toNT",value:function(){return s.NTAnonymousNodePrefix+this.id}},{key:"toString",value:function(){return"("+this.elements.join(" ")+")"}},{key:"unshift",value:function(e){return this.elements.unshift(e)}}])&&function(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"";return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=i(this,o(t).call(this))).termType=t.termType,e.value=n,e.base="varid:",e.uri=l.join(n,e.base),e}var n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(t,u),(n=[{key:"equals",value:function(e){return!!e&&this.termType===e.termType&&this.value===e.value}},{key:"hashString",value:function(){return this.toString()}},{key:"substitute",value:function(e){var t;return null!=(t=e[this.toNT()])?t:this}},{key:"toString",value:function(){return this.uri.slice(0,this.base.length)===this.base?"?"+this.uri.slice(this.base.length):"?"+this.uri}}])&&function(e,t){for(var n=0;n "+e[t]);return n},u=function(e){var t,n="Bindings: ",r=e.length;for(t=0;ti.length)&&(t.index=i)}}return null===t.index&&(t.index=e.statements),!0};function m(e,t){return e.nvars!==t.nvars?e.nvars-t.nvars:e.index.length-t.index.length}var y=function e(n,r,a,u,l,c,f){i.debug("Match begins, Branch count now: "+f.count+" for "+f.pattern_debug);var p,g,m=n.fetcher?n.fetcher:null,y=r.statements;if(0===y.length){if(i.debug("FOUND MATCH WITH BINDINGS:"+s(a)),0===r.optional.length)f.reportMatch(a);else{i.debug("OPTIONAL: "+r.optional);var v,w=new h(t,a),_=[];for(v=0;v in query: "+o),e(n,r,a,u,l,c,f)})};for(g=0;g0)throw"missing.js: oops nnonempty dict not imp";return[]},s=function(e){return e.length},u=function(e,t,n){if(void 0===e.slice)throw"@@ mising.js: No .slice function for "+e+" of type "+r(e);return void 0===n||null==n?e.slice(t):e.slice(t,n)},l=Error("dummy error stop iteration"),c=function(e){return this.last=0,this.li=e,this.next=function(){if(this.last==this.li.length)throw l;return this.li[this.last++]},this},f=function(e,t){return e.indexOf(t)},h=function(e,t){if(!e){if(t)throw"python Assertion failed: "+t;throw"(python) Assertion failed."}};String.prototype.encode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return function(e){e=e.replace(/\r\n/g,"\n");for(var t="",n=0;n127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(63&r|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(63&r|128))}return t}(this)},String.prototype.decode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return this};var p=function(e,t){return i.join(t,e)},d=0,g="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~:",m=(new RegExp("^[ \\t]*(#[^\\n]*)?\\r?\\n","g"),new RegExp("^[ \\t]*(#[^\\n]*)?$","g"),new RegExp("^[ \\t]*","g"),new RegExp("^[-+]?[0-9]+","g"),new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?(e[-+]?[0-9]+)?","g")),y=new RegExp("^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9](T[0-9][0-9]:[0-9][0-9](:[0-9][0-9](\\.[0-9]*)?)?)?Z?"),v=(new RegExp("^[0-9]+","g"),new RegExp('[\\\\\\r\\n\\"]',"g")),b=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g");function w(e,t,r,i,o,s,u,l){void 0===t&&(t=null),void 0===r&&(r=""),void 0===i&&(i=null),void 0===o&&(o=""),void 0===s&&(s=null),void 0===u&&(u=""),void 0===l&&(l=null),this._bindings=new a([]),this._flags=u,""!=r&&(h(r.indexOf(":")>=0,"Document URI not absolute: "+r),this._bindings[""]=r+"#"),this._store=e,o&&e.setGenPrefix(o),this._thisDoc=r,this.source=e.sym(r),this.lines=0,this.statementCount=0,this.startOfLine=0,this.previousLine=0,this._genPrefix=o,this.keywords=new n(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new a([]),this._variables=new a([]),this._parentVariables=new a([]),this._reason=l,this._reason2=null,d&&(this._reason2=why_BecauseOfData(e.sym(r),this._reason)),this._baseURI=i||r||null,h(!this._baseURI||this._baseURI.indexOf(":")>=0),this._genPrefix||(this._genPrefix=this._thisDoc?this._thisDoc+"#_g":RDFSink_uniqueURI()),this._formula=null==t?this._thisDoc?e.formula(r+"#_formula"):e.formula():t,this._context=this._formula,this._parentContext=null}function _(e,t,n,r,i){var o="Line "+(t+1)+" of <"+e+">: Bad syntax: "+i+'\nat: "'+n.slice(r,r+30)+'"',a=new Error(o);return a.lineNumber=t+1,a.characterInFile=r,a.syntaxProblem=i,a}return w.prototype.here=function(e){return this._genPrefix+"_L"+this.lines+"C"+(e-this.startOfLine+1)},w.prototype.formula=function(){return this._formula},w.prototype.loadStream=function(e){return this.loadBuf(e.read())},w.prototype.loadBuf=function(e){return this.startDoc(),this.feed(e),this.endDoc()},w.prototype.feed=function(e){for(var t=e.decode("utf-8"),n=0;n>=0;){var r=this.skipSpace(t,n);if(r<0)return;if((n=this.directiveOrStatement(t,r))<0)throw _(this._thisDoc,this.lines,t,r,"expected directive or statement")}},w.prototype.directiveOrStatement=function(e,t){var n,r=this.skipSpace(e,t);return r<0?r:(n=this.directive(e,r))>=0?this.checkDot(e,n):(n=this.statement(e,r))>=0?this.checkDot(e,n):n},w.prototype.tok=function(e,t,n){if("@"==t.slice(n,n+1))n+=1;else if(o(this.keywords,e)<0)return-1;var r=n+s(e);return t.slice(n,r)==e&&"\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~".indexOf(t.charAt(r))>=0?r:-1},w.prototype.directive=function(e,t){if((s=this.skipSpace(e,t))<0)return s;var r=new n([]);if((s=this.tok("bind",e,t))>0)throw _(this._thisDoc,this.lines,e,t,"keyword bind is obsolete: use @prefix");if((s=this.tok("keywords",e,t))>0){if((t=this.commaSeparatedList(e,s,r,!1))<0)throw _(this._thisDoc,this.lines,e,t,"'@keywords' needs comma separated list of words");return this.setKeywords(u(r,null,null)),t}if((s=this.tok("forAll",e,t))>0){if((t=this.commaSeparatedList(e,s,r,!0))<0)throw _(this._thisDoc,this.lines,e,t,"Bad variable list after @forAll");var i=new c(r);try{for(;;){var a=i.next();(o(this._variables,a)<0||o(this._parentVariables,a)>=0)&&(this._variables[a]=this._context.newUniversal(a))}}catch(e){if(e!=l)throw e}return t}if((s=this.tok("forSome",e,t))>0){if((t=this.commaSeparatedList(e,s,r,this.uri_ref2))<0)throw _(this._thisDoc,this.lines,e,t,"Bad variable list after @forSome");i=new c(r);try{for(;;)a=i.next(),this._context.declareExistential(a)}catch(e){if(e!=l)throw e}return t}if((s=this.tok("prefix",e,t))>=0){var s,f=new n([]);if((t=this.qname(e,s,f))<0)throw _(this._thisDoc,this.lines,e,s,"expected qname after @prefix");if((s=this.uri_ref2(e,t,f))<0)throw _(this._thisDoc,this.lines,e,t,"expected after @prefix _qname_");var d=f[1].uri;return this._baseURI?d=p(this._baseURI,d):h(d.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS"),h(d.indexOf(":")>=0),this._bindings[f[0][0]]=d,this.bind(f[0][0],encodeURI(d)),s}if((s=this.tok("base",e,t))>=0){if(f=new n([]),(t=this.uri_ref2(e,s,f))<0)throw _(this._thisDoc,this.lines,e,s,"expected after @base ");if(d=f[0].uri,!this._baseURI)throw _(this._thisDoc,this.lines,e,s,"With no previous base URI, cannot use relative URI in @base <"+d+">");return d=p(this._baseURI,d),h(d.indexOf(":")>=0),this._baseURI=d,t}return-1},w.prototype.bind=function(e,t){""==e||this._store.setPrefixForURI(e,t)},w.prototype.setKeywords=function(e){null==e?this.keywordsSet=0:(this.keywords=e,this.keywordsSet=1)},w.prototype.startDoc=function(){},w.prototype.endDoc=function(){return this._formula},w.prototype.makeStatement=function(e){e[0].add(e[2],e[1],e[3],this.source),this.statementCount+=1},w.prototype.statement=function(e,t){var r=new n([]);if((t=this.object(e,t,r))<0)return t;var i=this.property_list(e,t,r[0]);if(i<0)throw _(this._thisDoc,this.lines,e,t,"expected propertylist");return i},w.prototype.subject=function(e,t,n){return this.item(e,t,n)},w.prototype.verb=function(r,i,o){if((s=this.skipSpace(r,i))<0)return s;var a=new n([]);if((s=this.tok("has",r,i))>=0){if((i=this.prop(r,s,a))<0)throw _(this._thisDoc,this.lines,r,s,"expected property after 'has'");return o.push(new t(["->",a[0]])),i}if((s=this.tok("is",r,i))>=0){if((i=this.prop(r,s,a))<0)throw _(this._thisDoc,this.lines,r,s,"expected after 'is'");if((s=this.skipSpace(r,i))<0)throw _(this._thisDoc,this.lines,r,i,"End of file found, expected property after 'is'");var s;if((s=this.tok("of",r,i=s))<0)throw _(this._thisDoc,this.lines,r,i,"expected 'of' after 'is' ");return o.push(new t(["<-",a[0]])),s}if((s=this.tok("a",r,i))>=0)return o.push(new t(["->",this._store.sym("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")])),s;if("<="==r.slice(i,i+2))return o.push(new t(["<-",this._store.sym(e+"implies")])),i+2;if("="==r.slice(i,i+1))return">"==r.slice(i+1,i+2)?(o.push(new t(["->",this._store.sym(e+"implies")])),i+2):(o.push(new t(["->",this._store.sym("http://www.w3.org/2002/07/owl#sameAs")])),i+1);if(":="==r.slice(i,i+2))return o.push(new t(["->",e+"becomes"])),i+2;if((s=this.prop(r,i,a))>=0)return o.push(new t(["->",a[0]])),s;if(">-"==r.slice(i,i+2)||"<-"==r.slice(i,i+2))throw _(this._thisDoc,this.lines,r,s,">- ... -> syntax is obsolete.");return-1},w.prototype.prop=function(e,t,n){return this.item(e,t,n)},w.prototype.item=function(e,t,n){return this.path(e,t,n)},w.prototype.blankNode=function(e){return this._context.bnode(e,this._reason2)},w.prototype.path=function(e,n,r){if((a=this.nodeOrLiteral(e,n,r))<0)return a;for(;"!^.".indexOf(e.slice(a,a+1))>=0;){var i=e.slice(a,a+1);if("."==i){var o=e.slice(a+1,a+2);if(!o||g.indexOf(o)>=0&&":?<[{(".indexOf(o)<0)break}var a,s=r.pop(),u=this.blankNode(this.here(a));if((a=this.node(e,a+1,r))<0)throw _(this._thisDoc,this.lines,e,a,"EOF found in middle of path syntax");var l=r.pop();this.makeStatement(new t("^"==i?[this._context,l,u,s]:[this._context,l,s,u])),r.push(u)}return a},w.prototype.anonymousNode=function(e){if(t=this._anonymousNodes[e])return t;var t=this._store.bnode(e);return this._anonymousNodes[e]=t,t},w.prototype.node=function(e,r,i,o){void 0===o&&(o=null);var u=o;if((m=this.skipSpace(e,r))<0)return m;var f=e.slice(r=m,r+1);if("["==f){var h=this.here(r);if((m=this.skipSpace(e,r+1))<0)throw _(this._thisDoc,this.lines,e,r,"EOF after '['");if("="==e.slice(m,m+1)){r=m+1;var p=new n([]);if(!((m=this.objectList(e,r,p))>=0))throw _(this._thisDoc,this.lines,e,r,"objectList expected after [= ");if(u=p[0],s(p)>1){var d=new c(p);try{for(;;){var g=d.next();this.makeStatement(new t([this._context,this._store.sym("http://www.w3.org/2002/07/owl#sameAs"),u,g]))}}catch(e){if(e!=l)throw e}}if((m=this.skipSpace(e,m))<0)throw _(this._thisDoc,this.lines,e,r,"EOF when objectList expected after [ = ");if(";"==e.slice(m,m+1))var m=m+1}if(null==u&&(u=this.blankNode(h)),(r=this.property_list(e,m,u))<0)throw _(this._thisDoc,this.lines,e,m,"property_list expected");if((m=this.skipSpace(e,r))<0)throw _(this._thisDoc,this.lines,e,r,"EOF when ']' expected after [ ");if("]"!=e.slice(m,m+1))throw _(this._thisDoc,this.lines,e,m,"']' expected");return i.push(u),m+1}if("{"==f){if("$"==e.slice(r+1,r+2)){m=(r+=1)+1;for(var y=new n([]),v=!0;;){if((r=this.skipSpace(e,m))<0)throw _(this._thisDoc,this.lines,e,r,"needed '$}', found end.");if("$}"==e.slice(r,r+2)){m=r+2;break}if(v)v=!1;else{if(","!=e.slice(r,r+1))throw _(this._thisDoc,this.lines,e,r,"expected: ','");r+=1}var b=new n([]);if((m=this.item(e,r,b))<0)throw _(this._thisDoc,this.lines,e,r,"expected item in set or '$}'");y.push(b[0])}return i.push(this._store.newSet(y,this._context)),m}m=r+1;var w=this._parentContext;this._parentContext=this._context;var x=this._anonymousNodes,S=this._parentVariables;this._parentVariables=this._variables,this._anonymousNodes=new a([]),this._variables=this._variables.slice();var E=this._reason2;for(this._reason2=null,null==u&&(u=this._store.formula()),this._context=u;;){if((r=this.skipSpace(e,m))<0)throw _(this._thisDoc,this.lines,e,r,"needed '}', found end.");if("}"==e.slice(r,r+1)){m=r+1;break}if((m=this.directiveOrStatement(e,r))<0)throw _(this._thisDoc,this.lines,e,r,"expected statement or '}'")}return this._anonymousNodes=x,this._variables=this._parentVariables,this._parentVariables=S,this._context=this._parentContext,this._reason2=E,this._parentContext=w,i.push(u.close()),m}if("("==f){var k=this._store.list;for("$"==e.slice(r+1,r+2)&&(k=this._store.newSet,r+=1),m=r+1,y=new n([]);;){if((r=this.skipSpace(e,m))<0)throw _(this._thisDoc,this.lines,e,r,"needed ')', found end.");if(")"==e.slice(r,r+1)){m=r+1;break}if(b=new n([]),(m=this.item(e,r,b))<0)throw _(this._thisDoc,this.lines,e,r,"expected item in list or ')'");y.push(b[0])}return i.push(k(y,this._context)),m}if((m=this.tok("this",e,r))>=0)throw _(this._thisDoc,this.lines,e,r,"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.");return(m=this.tok("true",e,r))>=0?(i.push(!0),m):(m=this.tok("false",e,r))>=0?(i.push(!1),m):null==u&&(m=this.uri_ref2(e,r,i))>=0?m:-1},w.prototype.property_list=function(e,r,i){for(;;){if((p=this.skipSpace(e,r))<0)throw _(this._thisDoc,this.lines,e,r,"EOF found when expected verb in property list");if(":-"!=e.slice(p,p+2)){r=p;var o=new n([]);if((p=this.verb(e,r,o))<=0)return r;var a=new n([]);if((r=this.objectList(e,p,a))<0)throw _(this._thisDoc,this.lines,e,p,"objectList expected");var s=new c(a);try{for(;;){var u=s.next(),f=o[0],h=f[1];this.makeStatement(new t("->"==f[0]?[this._context,h,i,u]:[this._context,h,u,i]))}}catch(e){if(e!=l)throw e}if((p=this.skipSpace(e,r))<0)throw _(this._thisDoc,this.lines,e,p,"EOF found in list of objects");if(";"!=e.slice(r,r+1))return r;r+=1}else{r=p+2;var p,d=new n([]);if((p=this.node(e,r,d,i))<0)throw _(this._thisDoc,this.lines,e,r,"bad {} or () or [] node after :- ");r=p}}},w.prototype.commaSeparatedList=function(e,t,n,r){if((i=this.skipSpace(e,t))<0)throw _(this._thisDoc,this.lines,e,i,"EOF found expecting comma sep list");if("."==e.charAt(i))return t;if(r)var i=this.uri_ref2(e,i,n);else i=this.bareWord(e,i,n);if(i<0)return-1;for(;;){if((t=this.skipSpace(e,i))<0)return t;var o=e.slice(t,t+1);if(","!=o)return"."!=o?-1:t;if((i=r?this.uri_ref2(e,t+1,n):this.bareWord(e,t+1,n))<0)throw _(this._thisDoc,this.lines,e,i,"bad list content")}},w.prototype.objectList=function(e,t,n){if((t=this.object(e,t,n))<0)return-1;for(;;){var r=this.skipSpace(e,t);if(r<0)throw _(this._thisDoc,this.lines,e,r,"EOF found after object");if(","!=e.slice(r,r+1))return r;if((t=this.object(e,r+1,n))<0)return t}},w.prototype.checkDot=function(e,t){var n=this.skipSpace(e,t);if(n<0)return n;if("."==e.slice(n,n+1))return n+1;if("}"==e.slice(n,n+1))return n;if("]"==e.slice(n,n+1))return n;throw _(this._thisDoc,this.lines,e,n,"expected '.' or '}' or ']' at end of statement")},w.prototype.uri_ref2=function(e,t,r){var i=new n([]);if((v=this.qname(e,t,i))>=0){var a=i[0],l=a[0],c=a[1];if(null==l){h(0,"not used?");var f=this._baseURI+"#"}else if(!(f=this._bindings[l])){if("_"==l)return r.push(this.anonymousNode(c)),v;throw _(this._thisDoc,this.lines,e,t,"Prefix "+l+" not bound.")}var d=this._store.sym(f+c);return o(this._variables,d)>=0?r.push(this._variables[d]):r.push(d),v}if((t=this.skipSpace(e,t))<0)return-1;if("?"==e.charAt(t)){var g=new n([]);return(v=this.variable(e,t,g))>0?(r.push(g[0]),v):-1}if("<"==e.charAt(t)){for(var m=t+=1;t"==e.charAt(t)){var y=e.slice(m,t);return this._baseURI?y=p(this._baseURI,y):h(y.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs"),"#"==e.slice(t-1,t)&&"#"!=u(y,-1,null)&&(y+="#"),d=this._store.sym(y),o(this._variables,d)>=0?r.push(this._variables[d]):r.push(d),t+1}t+=1}throw _(this._thisDoc,this.lines,e,v,"unterminated URI reference")}if(this.keywordsSet){var v;if(g=new n([]),(v=this.bareWord(e,t,g))<0)return-1;if(o(this.keywords,g[0])>=0)throw _(this._thisDoc,this.lines,e,t,'Keyword "'+g[0]+'" not allowed here.');return r.push(this._store.sym(this._bindings[""]+g[0])),v}return-1},w.prototype.skipSpace=function(e,t){for(var n=t||0;n=0)throw _(this._thisDoc,this.lines,e,r,"Varible name can't start with '"+e.charAt(r)+"s'");for(;t=0)return-1;if(g.indexOf(i)>=0)return-1;for(t=r;t=0)return-1;if(g.indexOf(i)<0){var a=i;for(n+=1;n=0)return a;if((a=this.skipSpace(e,t))<0)return-1;var r=null,i=e.charAt(t=a);if('"'==i||"'"==i){r=e.slice(t,t+3==i+i)?i+i+i:i,t+=s(r);var o=this.strconst(e,t,r),a=o[0];return n.push(this._store.literal(o[1])),a}return-1},w.prototype.nodeOrLiteral=function(e,t,r){if((c=this.node(e,t,r))>=0)return c;if((c=this.skipSpace(e,t))<0)return-1;var i=e.charAt(t=c);if("-+0987654321".indexOf(i)>=0){if(y.lastIndex=0,null!=(p=y.exec(e.slice(t))))c=t+(o=p[0]).length,o.indexOf("T")>=0?r.push(this._store.literal(o,void 0,this._store.sym("http://www.w3.org/2001/XMLSchema#dateTime"))):r.push(this._store.literal(o,void 0,this._store.sym("http://www.w3.org/2001/XMLSchema#date")));else{var o;if(m.lastIndex=0,null==(p=m.exec(e.slice(t))))throw _(this._thisDoc,this.lines,e,t,"Bad number or date syntax");(o=e.slice(t,c=t+m.lastIndex)).indexOf("e")>=0?r.push(this._store.literal(parseFloat(o),void 0,this._store.sym("http://www.w3.org/2001/XMLSchema#double"))):e.slice(t,c).indexOf(".")>=0?r.push(this._store.literal(parseFloat(o),void 0,this._store.sym("http://www.w3.org/2001/XMLSchema#decimal"))):r.push(this._store.literal(parseInt(o),void 0,this._store.sym("http://www.w3.org/2001/XMLSchema#integer")))}return c}if('"'==e.charAt(t)){if('"""'==e.slice(t,t+3))var a='"""';else a='"';t+=s(a);var u=null,l=this.strconst(e,t,a),c=l[0],f=l[1],h=null;if("@"==e.slice(c,c+1)){var p;if(b.lastIndex=0,null==(p=b.exec(e.slice(c+1))))throw _(this._thisDoc,startline,e,t,"Bad language code syntax on string literal, after @");h=e.slice(c+1,t=b.lastIndex+c+1),c=t}if("^^"==e.slice(c,c+2)){var d=new n([]);c=this.uri_ref2(e,c+2,d),u=d[0]}return r.push(this._store.literal(f,h,u)),c}return-1},w.prototype.strconst=function(e,n,r){for(var i=n,o="",a=this.lines;i=0)o+='a\b\f\r\t\v\n\\"'.charAt(u),i+=1;else if("u"==c)i=(l=this.uEscape(e,i+1,a))[0],o+=c=l[1];else{if("U"!=c)throw _(this._thisDoc,this.lines,e,n,"bad escape");var l,c;i=(l=this.UEscape(e,i+1,a))[0],o+=c=l[1]}}}else i=n+1;else i=n}else o+='"',i+=1}throw _(this._thisDoc,this.lines,e,n,"unterminated string literal")},w.prototype.uEscape=function(e,n,r){for(var i=n,o=0,a=0;o<4;){var s=e.slice(i,i+1).toLowerCase();if(i+=1,""==s)throw _(this._thisDoc,r,e,n,"unterminated string literal(3)");var u=f("0123456789abcdef",s);if(u<0)throw _(this._thisDoc,r,e,n,"bad string literal hex escape");a=16*a+u,o+=1}var l=String.fromCharCode(a);return new t([i,l])},w.prototype.UEscape=function(e,n,r){for(var i=n,o=0,a="\\U";o<8;){var s=e.slice(i,i+1).toLowerCase();if(i+=1,""==s)throw _(this._thisDoc,r,e,n,"unterminated string literal(3)");if(f("0123456789abcdef",s)<0)throw _(this._thisDoc,r,e,n,"bad string literal hex escape");a+=s,o+=1}var l,c=(l="0x"+u(a,2,10)-0,String.fromCharCode(l));return new t([i,c])},function(e,t,n,r,i,o,a,s){return new w(e,t,n,r,i,o,a,s)}}();e.exports=a},function(e,t){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,(function(t){return e[t]}).bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);var r=n(1);const i=new r.default;if(t.default=i,Object.getOwnPropertyNames(r.default.prototype).forEach(e=>{const t=i[e];"function"==typeof t&&(i[e]=t.bind(i))}),"undefined"!=typeof window)if("SolidAuthClient"in window)console.warn("Caution: multiple versions of solid-auth-client active.");else{let e=!1;Object.defineProperty(window,"SolidAuthClient",{enumerable:!0,get:()=>(e||(e=!0,console.warn("window.SolidAuthClient has been deprecated."),console.warn("Please use window.solid.auth instead.")),i)})}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return m});var r=n(2),i=n.n(r),o=n(3),a=n.n(o),s=n(4),u=n.n(s),l=n(5),c=n(81),f=n(9),h=n(10),p=n(7),d=n(12);const g=fetch;class m extends u.a{constructor(...e){super(...e),a()(this,"_pendingSession",void 0)}fetch(e,t){return Object(l.authnFetch)(Object(h.defaultStorage)(),g,e,t)}login(e,t){return t=i()({},y(Object(p.currentUrlNoParams)()),t),d.login(e,t)}async popupLogin(e){e=i()({},y(),e),/https?:/.test(e.popupUri)||(e.popupUri=new URL(e.popupUri||"/.well-known/solid/login",window.location).toString()),e.callbackUri||(e.callbackUri=e.popupUri);const t=Object(c.openIdpPopup)(e.popupUri),n=await Object(c.obtainSession)(e.storage,t,e);return this.emit("login",n),this.emit("session",n),n}async currentSession(e=Object(h.defaultStorage)()){let t=await Object(f.getSession)(e);if(!t){if(this._pendingSession)return this._pendingSession;try{this._pendingSession=d.currentSession(e),t=await this._pendingSession}catch(e){console.error(e)}delete this._pendingSession,t&&(await Object(f.saveSession)(e)(t),this.emit("login",t),this.emit("session",t))}return t}async trackSession(e){e(await this.currentSession()),this.on("session",e)}async logout(e=Object(h.defaultStorage)()){if(await Object(f.getSession)(e)){try{await d.logout(e,g),this.emit("logout"),this.emit("session",null)}catch(e){console.warn("Error logging out:"),console.error(e)}await Object(f.clearSession)(e)}}}function y(e){return{callbackUri:e?e.split("#")[0]:"",popupUri:"",storage:Object(h.defaultStorage)()}}},function(e,t,n){var r=n(3);e.exports=function(e){for(var t=1;t0&&this._events[e].length>a&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.once=function(e,t){if(!r(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},n.prototype.removeListener=function(e,t){var n,o,a,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(a=(n=this._events[e]).length,o=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){o=s;break}if(o<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){"use strict";n.r(t),n.d(t,"authnFetch",function(){return s}),n(6);var r=n(7),i=n(8),o=n(9),a=n(12);async function s(e,t,n,r){const s=await Object(o.getSession)(e);if(!s)return t(n,r);if(await u(e,n))return Object(a.fetchWithCredentials)(s,t,n,r);let l=await t(n,r);return 401===l.status&&(await Object(i.updateHostFromResponse)(e)(l),await u(e,n)&&(l=Object(a.fetchWithCredentials)(s,t,n,r))),l}async function u(e,t){const n=await Object(i.getHost)(e)(Object(r.toUrlString)(t));return null!=n&&n.requiresAuth}},function(e,t){e.exports=window.fetch},function(e,t,n){"use strict";n.r(t),n.d(t,"currentUrl",function(){return r}),n.d(t,"currentUrlNoParams",function(){return i}),n.d(t,"navigateTo",function(){return o}),n.d(t,"originOf",function(){return a}),n.d(t,"toUrlString",function(){return s});const r=()=>window.location.href,i=()=>window.location.origin+window.location.pathname,o=e=>{window.location.href=e},a=e=>new URL(e).origin,s=e=>("string"!=typeof e&&(e="url"in e?e.url:e.toString()),new URL(e,r()).toString())},function(e,t,n){"use strict";n.r(t),n.d(t,"getHost",function(){return u}),n.d(t,"saveHost",function(){return l}),n.d(t,"updateHostFromResponse",function(){return c});var r=n(2),i=n.n(r),o=n(9),a=n(10),s=n(12);function u(e){return async t=>{const n=new URL(t).host,r=await Object(o.getSession)(e);if(r&&n===new URL(r.idp).host)return{url:n,requiresAuth:!0};const i=(await Object(a.getData)(e)).hosts;return i&&i[n]}}function l(e){return async({url:t,requiresAuth:n})=>{await Object(a.updateStorage)(e,e=>i()({},e,{hosts:i()({},e.hosts,{[t]:{requiresAuth:n}})}))}}function c(e){return async t=>{if(s.requiresAuth(t)){const n=new URL(t.url).host;await l(e)({url:n,requiresAuth:!0})}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"getSession",function(){return a}),n.d(t,"saveSession",function(){return s}),n.d(t,"clearSession",function(){return u});var r=n(2),i=n.n(r),o=n(10);async function a(e){return(await Object(o.getData)(e)).session||null}function s(e){return async t=>(await Object(o.updateStorage)(e,e=>i()({},e,{session:t}))).session}async function u(e){await Object(o.updateStorage)(e,e=>i()({},e,{session:null}))}},function(e,t,n){"use strict";n.r(t),n.d(t,"NAMESPACE",function(){return r}),n.d(t,"defaultStorage",function(){return i}),n.d(t,"getData",function(){return o}),n.d(t,"updateStorage",function(){return a}),n.d(t,"asyncStorage",function(){return s}),n.d(t,"memStorage",function(){return u}),n.d(t,"ipcStorage",function(){return l}),n(11);const r="solid-auth-client",i=()=>{try{if(window&&window.localStorage)return s(window.localStorage)}catch(e){if(!(e instanceof ReferenceError))throw e}return console.warn("'window.localStorage' unavailable. Creating a (not very useful) in-memory storage object as the default storage interface."),s(u())};async function o(e){let t,n;try{t=await e.getItem(r),n=JSON.parse(t||"{}")}catch(e){console.warn("Could not deserialize data:",t),console.error(e),n={}}return n}async function a(e,t){const n=t(await o(e));return await e.setItem(r,JSON.stringify(n)),n}function s(e){return{getItem:t=>Promise.resolve(e.getItem(t)),setItem:(t,n)=>Promise.resolve(e.setItem(t,n)),removeItem:t=>Promise.resolve(e.removeItem(t))}}const u=()=>{const e={};return{getItem:t=>void 0===e[t]?null:e[t],setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}};function l(e){return{getItem:t=>e.request("storage/getItem",t),setItem:(t,n)=>e.request("storage/setItem",t,n),removeItem:t=>e.request("storage/removeItem",t)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"Server",function(){return a}),n.d(t,"Client",function(){return s});var r=n(3),i=n.n(r);const o="solid-auth-client";class a{constructor(e,t,n){i()(this,"_clientWindow",void 0),i()(this,"_clientOrigin",void 0),i()(this,"_handler",void 0),i()(this,"_messageListener",void 0),this._clientWindow=e,this._clientOrigin=t,this._handler=n,this._messageListener=(e=>this._handleMessage(e))}async _handleMessage({data:e,origin:t}){if(t!==this._clientOrigin)return void console.warn(`solid-auth-client is listening to ${this._clientOrigin} `+`so ignored a message received from ${t}.`);const n=e&&e[o];if(n&&n.method){const e=n.id,t=n.method,r=n.args,i=await this._handler(t,...r);this._clientWindow.postMessage({[o]:{id:e,ret:i}},this._clientOrigin)}}start(){window.addEventListener("message",this._messageListener)}stop(){window.removeEventListener("message",this._messageListener)}}class s{constructor(e,t){i()(this,"_serverWindow",void 0),i()(this,"_serverOrigin",void 0),this._serverWindow=e,this._serverOrigin=t}request(e,...t){const n=Math.random();return this._serverWindow.postMessage({[o]:{id:n,method:e,args:t}},this._serverOrigin),new Promise((e,t)=>{window.addEventListener("message",i);const r=setTimeout(()=>{t(new Error("Could not connect to main window.")),window.removeEventListener("message",i)},2e3);function i({data:t}){const a=t&&t[o];a&&a.id===n&&a.hasOwnProperty("ret")&&(e(a.ret),clearTimeout(r),window.removeEventListener("message",i))}})}}},function(e,t,n){"use strict";n.r(t),n.d(t,"login",function(){return d}),n.d(t,"currentSession",function(){return g}),n.d(t,"logout",function(){return m}),n.d(t,"getRegisteredRp",function(){return y}),n.d(t,"requiresAuth",function(){return b}),n.d(t,"fetchWithCredentials",function(){return w});var r=n(13),i=n.n(r),o=n(2),a=n.n(o),s=n(15),u=n(19),l=n.n(u),c=n(80),f=n.n(c),h=n(7),p=n(10);async function d(e,t){try{const n=await y(e,t);return await async function(e){await Object(p.updateStorage)(e,e=>a()({},e,{appHashFragment:window.location.hash}))}(t.storage),async function(e,{callbackUri:t,storage:n}){const r=await Object(p.getData)(n),i=await e.createRequest({redirect_uri:t},r);return await Object(p.updateStorage)(n,()=>r),Object(h.navigateTo)(i)}(n,t)}catch(e){return console.warn("Error logging in with WebID-OIDC"),console.error(e),null}}async function g(e=Object(p.defaultStorage)()){try{const t=await v(e);if(!t)return null;const n=Object(h.currentUrl)();if(!/#(.*&)?access_token=/.test(n))return null;window.location.hash="",await async function(e){await Object(p.updateStorage)(e,e=>{let t=e.appHashFragment,n=void 0===t?"":t,r=i()(e,["appHashFragment"]);return window.location.hash=n,r})}(e);const r=await Object(p.getData)(e),o=await t.validateResponse(n,r);return o?a()({},o,{webId:o.idClaims.sub,idp:o.issuer}):null}catch(e){return console.warn("Error finding a WebID-OIDC session"),console.error(e),null}}async function m(e,t){const n=await v(e);if(n)try{await n.logout();try{await t("/.well-known/solid/logout",{credentials:"include"})}catch(e){}}catch(e){console.warn("Error logging out of the WebID-OIDC session"),console.error(e)}}async function y(e,t){let n=await v(t.storage);return n&&n.provider.url===e&&n.registration.redirect_uris.includes(t.callbackUri)||(n=await function(e,{storage:t,callbackUri:n}){return l.a.register(e,{issuer:e,grant_types:["implicit"],redirect_uris:[n],response_types:["id_token token"],scope:"openid profile"},{defaults:{authenticate:{redirect_uri:n,response_type:"id_token token"}},store:t})}(e,t),await async function(e,t,n){return await Object(p.updateStorage)(e,e=>a()({},e,{rpConfig:n})),n}(t.storage,0,n)),n}async function v(e){const t=(await Object(p.getData)(e)).rpConfig;return t?(t.store=e,l.a.from(t)):null}function b(e){if(401!==e.status)return!1;const t=e.headers.get("www-authenticate");if(!t)return!1;const n=s.parse(t);return"Bearer"===n.scheme&&n.params&&"openid webid"===n.params.scope}async function w(e,t,n,r){const i=await f.a.issueFor(Object(h.toUrlString)(n),e);return t(n,a()({},r,{credentials:"include",headers:a()({},r&&r.headers?r.headers:{},{authorization:`Bearer ${i}`})}))}},function(e,t,n){var r=n(14);e.exports=function(e,t){if(null==e)return{};var n,i,o=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"format",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return i.default}});var r=o(n(16)),i=o(n(18));function o(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(17);function i(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t@,;:\\"\/?={}\[\]\u0020\u0009]+$/,i=function(e){return"string"==typeof e&&r.test(e)};t.isToken=i,t.isScheme=i,t.quote=function(e){return`"${e.replace(/"/g,'\\"')}"`},t.unquote=function(e){return e.substr(1,e.length-2).replace(/\\"/g,'"')}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(17),i=/((?:[a-zA-Z0-9._~+\/-]+=*(?:\s+|$))|[^\u0000-\u001F\u007F()<>@,;:\\"\/?={}\[\]\u0020\u0009]+)(?:=([^\\"=\s,]+|"(?:[^"\\]|\\.)*"))?/g,o=function(e,t){var n='"'===t.charAt(0)?(0,r.unquote)(t):t.trim();return Array.isArray(e)?e.concat(n):"string"==typeof e?[e,n]:n};t.default=function(e){if("string"!=typeof e)throw new TypeError("Header value must be a string.");var t=e.indexOf(" "),n=e.substr(0,t);if(!(0,r.isScheme)(n))throw new TypeError(`Invalid scheme ${n}`);return function(e,t){for(var n=null,r={};;){var a=i.exec(t);if(null===a)break;a[2]?r[a[1]]=o(r[a[1]],a[2]):n=o(n,a[1])}return{scheme:e,params:r,token:n}}(n,e.substr(t))}},function(e,t,n){"use strict";e.exports=n(20)},function(e,t,n){(function(t){const r=n(22),i=n(6),{URL:o}=n(27),a=i.Headers?i.Headers:t.Headers,{JSONDocument:s}=n(28),{JWKSet:u}=n(37),l=n(68),c=n(70),f=n(79),h=n(74),p=n(69);class d extends s{static get schema(){return f}static from(e){let t=new d(e),n=t.validate();if(!n.valid)return Promise.reject(new Error(JSON.stringify(n)));let r=t.provider.jwks;return r?u.importKeys(r).then(e=>(t.provider.jwks=e,t)):t.jwks().then(()=>t)}static register(e,t,n){let r=new d({provider:{url:e},defaults:Object.assign({},n.defaults),store:n.store});return Promise.resolve().then(()=>r.discover()).then(()=>r.jwks()).then(()=>r.register(t)).then(()=>r)}discover(){try{let t=this.provider.url;r(t,'RelyingParty provider must define "url"');let n=new o(t);return n.pathname=".well-known/openid-configuration",i(n.toString()).then(h("Error fetching openid configuration")).then(e=>e.json().then(e=>this.provider.configuration=e))}catch(e){return Promise.reject(e)}}register(e){try{let t=this.provider.configuration;r(t,"OpenID Configuration is not initialized."),r(t.registration_endpoint,"OpenID Configuration is missing registration_endpoint.");let n=t.registration_endpoint,o="post",s=new a({"Content-Type":"application/json"}),u=JSON.stringify(Object.assign({},this.defaults.register,e));return i(n,{method:o,headers:s,body:u}).then(h("Error registering client")).then(e=>e.json().then(e=>this.registration=e))}catch(e){return Promise.reject(e)}}serialize(){return JSON.stringify(this)}jwks(){try{let t=this.provider.configuration;return r(t,"OpenID Configuration is not initialized."),r(t.jwks_uri,"OpenID Configuration is missing jwks_uri."),i(t.jwks_uri).then(h("Error resolving provider keys")).then(e=>e.json().then(e=>u.importKeys(e)).then(e=>this.provider.jwks=e))}catch(e){return Promise.reject(e)}}createRequest(e,t){return l.create(this,e,t||this.store)}validateResponse(e,t=this.store){let n;n=e.match(/^http(s?):\/\//)?{rp:this,redirect:e,session:t}:{rp:this,body:e,session:t};const r=new c(n);return c.validateResponse(r)}userinfo(){try{let t=this.provider.configuration;r(t,"OpenID Configuration is not initialized."),r(t.userinfo_endpoint,"OpenID Configuration is missing userinfo_endpoint.");let n=t.userinfo_endpoint,o=this.store.access_token;r(o,"Missing access token.");let s=new a({"Content-Type":"application/json",Authorization:`Bearer ${o}`});return i(n,{headers:s}).then(h("Error fetching userinfo")).then(e=>e.json())}catch(e){return Promise.reject(e)}}logoutRequest(e={}){const{id_token_hint:t,post_logout_redirect_uri:n,state:i}=e;let a;if(r(this.provider,"OpenID Configuration is not initialized"),r(a=this.provider.configuration,"OpenID Configuration is not initialized"),!a.end_session_endpoint)return console.log("OpenId Configuration for "+`${a.issuer} is missing end_session_endpoint`),null;if(n&&!t)throw new Error("id_token_hint is required when using post_logout_redirect_uri");const s={};t&&(s.id_token_hint=t),n&&(s.post_logout_redirect_uri=n),i&&(s.state=i);const u=new o(a.end_session_endpoint);return u.search=p.encode(s),u.href}logout(){let e;try{r(this.provider,"OpenID Configuration is not initialized."),r(e=this.provider.configuration,"OpenID Configuration is not initialized."),r(e.end_session_endpoint,"OpenID Configuration is missing end_session_endpoint.")}catch(e){return Promise.reject(e)}return e.end_session_endpoint?i(e.end_session_endpoint,{method:"get",credentials:"include"}).then(h("Error logging out")).then(()=>this.clearSession()):(this.clearSession(),Promise.resolve(void 0))}clearSession(){let e=this.store;e&&delete e[g]}popTokenFor(e,t){return PoPToken.issueFor(e,t)}}const g="oidc.session.privateKey";d.SESSION_PRIVATE_KEY=g,e.exports=d}).call(this,n(21))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";(function(t){function r(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i=0;l--)if(c[l]!==f[l])return!1;for(l=c.length-1;l>=0;l--)if(!v(e[u=c[l]],t[u],n,r))return!1;return!0}(e,t,n,a))}return n?e===t:e==t}function b(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _(e,t,n,r){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!i&&m(i,n,"Missing expected exception"+r);var a="string"==typeof r,s=!e&&i&&!n;if((!e&&o.isError(i)&&a&&w(i,n)||s)&&m(i,n,"Got unwanted exception"+r),e&&i&&n&&!w(i,n)||!e&&i)throw i}f.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=d(g(this.actual),128)+" "+this.operator+" "+d(g(this.expected),128),this.generatedMessage=!0);var t=e.stackStartFunction||m;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,i=p(t),o=r.indexOf("\n"+i);if(o>=0){var a=r.indexOf("\n",o+1);r=r.substring(a+1)}this.stack=r}}},o.inherits(f.AssertionError,Error),f.fail=m,f.ok=y,f.equal=function(e,t,n){e!=t&&m(e,t,n,"==",f.equal)},f.notEqual=function(e,t,n){e==t&&m(e,t,n,"!=",f.notEqual)},f.deepEqual=function(e,t,n){v(e,t,!1)||m(e,t,n,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(e,t,n){v(e,t,!0)||m(e,t,n,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(e,t,n){v(e,t,!1)&&m(e,t,n,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function e(t,n,r){v(t,n,!0)&&m(t,n,r,"notDeepStrictEqual",e)},f.strictEqual=function(e,t,n){e!==t&&m(e,t,n,"===",f.strictEqual)},f.notStrictEqual=function(e,t,n){e===t&&m(e,t,n,"!==",f.notStrictEqual)},f.throws=function(e,t,n){_(!0,e,t,n)},f.doesNotThrow=function(e,t,n){_(!1,e,t,n)},f.ifError=function(e){if(e)throw e};var x=Object.keys||function(e){var t=[];for(var n in e)a.call(e,n)&&t.push(n);return t}}).call(this,n(21))},function(e,t,n){(function(e,r){var i=/%[sdj%]/g;t.format=function(e){if(!y(e)){for(var t=[],n=0;n=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),u=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(n)?r.showHidden=n:n&&t._extend(r,n),v(r.showHidden)&&(r.showHidden=!1),v(r.depth)&&(r.depth=2),v(r.colors)&&(r.colors=!1),v(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),c(r,e,r.depth)}function u(e,t){var n=s.styles[t];return n?"\x1b["+s.colors[n][0]+"m"+e+"\x1b["+s.colors[n][1]+"m":e}function l(e,t){return e}function c(e,n,r){if(e.customInspect&&n&&S(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return y(i)||(i=c(e,i,r)),i}var o=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(y(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return m(t)?e.stylize(""+t,"number"):d(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}(e,n);if(o)return o;var a=Object.keys(n),s=function(e){var t={};return a.forEach(function(e,n){t[e]=!0}),t}();if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),x(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(n);if(0===a.length){if(S(n))return e.stylize("[Function"+(n.name?": "+n.name:"")+"]","special");if(b(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(_(n))return e.stylize(Date.prototype.toString.call(n),"date");if(x(n))return f(n)}var u,l="",w=!1,E=["{","}"];return p(n)&&(w=!0,E=["[","]"]),S(n)&&(l=" [Function"+(n.name?": "+n.name:"")+"]"),b(n)&&(l=" "+RegExp.prototype.toString.call(n)),_(n)&&(l=" "+Date.prototype.toUTCString.call(n)),x(n)&&(l=" "+f(n)),0!==a.length||w&&0!=n.length?r<0?b(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),u=w?function(e,t,n,r,i){for(var o=[],a=0,s=t.length;a60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}(u,l,E)):E[0]+l+E[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,n,r,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=e.stylize(u.set?"[Getter/Setter]":"[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),T(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=g(n)?c(e,u.value,null):c(e,u.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),v(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function p(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function g(e){return null===e}function m(e){return"number"==typeof e}function y(e){return"string"==typeof e}function v(e){return void 0===e}function b(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function _(e){return w(e)&&"[object Date]"===E(e)}function x(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function S(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function k(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(v(o)&&(o=r.env.NODE_DEBUG||""),e=e.toUpperCase(),!a[e])if(new RegExp("\\b"+e+"\\b","i").test(o)){var n=r.pid;a[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else a[e]=function(){};return a[e]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=p,t.isBoolean=d,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=m,t.isString=y,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=v,t.isRegExp=b,t.isObject=w,t.isDate=_,t.isError=x,t.isFunction=S,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(25);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;console.log("%s - %s",(n=[k((e=new Date).getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),C[e.getMonth()],n].join(" ")),t.format.apply(t,arguments))},t.inherits=n(26),t._extend=function(e,t){if(!t||!w(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,n(21),n(24))},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,l=[],c=!1,f=-1;function h(){c&&u&&(c=!1,u.length?l=u.concat(l):f=-1,l.length&&p())}function p(){if(!c){var e=s(h);c=!0;for(var t=l.length;t;){for(u=l,l=[];++f1)for(var n=1;nthis.root.depth&&(this.root.depth=this.level),this.level=this.level||0,this.schema=t}return i(e,[{key:"compile",value:function(){var e=this.root,t="",n="";if(n+=this.default(),n+=this.properties(),n+=this.items(),n+=this.member(),n+=this.item(),e===this){for(var r=1;r<=this.root.depth;r++)t+=this.declaration(r);return"\n options = options || {}\n\n if (options.filter === false) {\n Object.assign(target, JSON.parse(JSON.stringify(source)))\n }\n\n "+t+"\n "+n+"\n "}return n}},{key:"declaration",value:function(e){return"\n var target"+e+"\n var source"+e+"\n var count"+e+"\n "}},{key:"default",value:function(){var e=this.schema,t=this.level,n=this.key,r=this.index,i=e.default,o="";return e.hasOwnProperty("default")&&(n&&(o+="\n target"+t+"['"+n+"'] = "+JSON.stringify(i)+"\n "),r&&(o+="\n target"+t+"["+r+"] = "+JSON.stringify(i)+"\n "),t>1&&(o+="\n count"+t+"++\n "),o="\n if (options.defaults !== false) {\n "+o+"\n }\n "),o}},{key:"member",value:function(){var e=this.schema,t=this.level,n=this.key,r="";return!n||e.properties||e.additionalProperties||e.items||e.additionalItems||(r+="\n target"+t+"['"+n+"'] = source"+t+"['"+n+"']\n ",t>1&&(r+="\n count"+t+"++\n "),r="\n if (source"+t+".hasOwnProperty('"+n+"')) {\n "+r+"\n }\n "),r}},{key:"item",value:function(){var e=this.schema,t=this.level,n=this.index,r="";return!n||e.properties||e.additionalProperties||e.items||e.additionalItems||(r+="\n target"+t+"["+n+"] = source"+t+"["+n+"]\n ",t>1&&(r+="\n count"+t+"++\n "),r="\n if ("+n+" < len) {\n "+r+"\n }\n "),r}},{key:"properties",value:function(){var t=this.root,n=this.level,r=this.key,i=this.index,o=this.schema.properties,a="";return o&&(Object.keys(o).forEach(function(r){var i=new e(o[r],{key:r,root:t,level:n+1});a+=i.compile()}),t===this?a="\n if (typeof source === 'object' && source !== null && !Array.isArray(source)) {\n if (typeof target !== 'object') {\n throw new Error('?')\n }\n\n source1 = source\n target1 = target\n count1 = 0\n\n "+a+"\n }\n ":(i&&(a="\n if ("+i+" < source"+n+".length || typeof source"+n+"["+i+"] === 'object') {\n\n source"+(n+1)+" = source"+n+"["+i+"] || {}\n count"+(n+1)+" = 0\n\n if ("+i+" < target"+n+".length || typeof target"+n+"["+i+"] !== 'object') {\n target"+(n+1)+" = {}\n if ("+i+" < source"+n+".length) {\n count"+(n+1)+"++\n }\n } else {\n target"+(n+1)+" = target"+n+"["+i+"]\n }\n\n "+a+"\n\n if (count"+(n+1)+" > 0) {\n target"+n+"["+i+"] = target"+(n+1)+"\n count"+n+"++\n }\n\n } else {\n target"+n+"["+i+"] = source"+n+"["+i+"]\n count"+n+"++\n }\n "),r&&(a="\n if ((typeof source"+n+"['"+r+"'] === 'object'\n && source"+n+"['"+r+"'] !== null\n && !Array.isArray(source"+n+"['"+r+"']))\n || !source"+n+".hasOwnProperty('"+r+"')) {\n\n source"+(n+1)+" = source"+n+"['"+r+"'] || {}\n count"+(n+1)+" = 0\n\n if (!target"+n+".hasOwnProperty('"+r+"')\n || typeof target"+n+"['"+r+"'] !== 'object'\n || target"+n+"['"+r+"'] === null\n || Array.isArray(target"+n+"['"+r+"'])) {\n target"+(n+1)+" = {}\n if (source"+n+".hasOwnProperty('"+r+"')) {\n count"+(n+1)+"++\n }\n } else {\n target"+(n+1)+" = target"+n+"['"+r+"']\n count"+(n+1)+"++\n }\n\n "+a+"\n\n if (count"+(n+1)+" > 0) {\n target"+n+"['"+r+"'] = target"+(n+1)+"\n count"+n+"++\n }\n\n } else {\n target"+n+"['"+r+"'] = source"+n+"['"+r+"']\n count"+n+"++\n }\n "))),a}},{key:"additionalProperties",value:function(){}},{key:"items",value:function(){var t=this.root,n=this.level,i=this.key,o=this.schema.items,a="";if(o){if(Array.isArray(o));else if("object"===(void 0===o?"undefined":r(o))&&null!==o){var s="i"+(n+1);a+="\n var sLen = source"+(n+1)+".length || 0\n var tLen = target"+(n+1)+".length || 0\n var len = 0\n\n if (sLen > len) { len = sLen }\n // THIS IS WRONG, CAUSED SIMPLE ARRAY INIT TO FAIL (OVERWRITE\n // EXISTING TARGET VALUES WITH UNDEFINED WHEN SOURCE IS SHORTER THAN\n // TARGET). LEAVING HERE UNTIL WE FINISH TESTING AND SEE WHY IT MIGHT\n // HAVE BEEN HERE IN THE FIRST PLACE.\n //\n // if (tLen > len) { len = tLen }\n\n for (var "+s+" = 0; "+s+" < len; "+s+"++) {\n "+new e(o,{index:s,root:t,level:n+1}).compile()+"\n }\n "}a=t===this?"\n if (Array.isArray(source)) {\n if (!Array.isArray(target)) {\n throw new Error('?')\n }\n\n source1 = source\n target1 = target\n\n "+a+"\n }\n ":"\n if (Array.isArray(source"+n+"['"+i+"']) || !source"+n+".hasOwnProperty('"+i+"')) {\n\n source"+(n+1)+" = source"+n+"['"+i+"'] || []\n count"+(n+1)+" = 0\n\n if (!target"+n+".hasOwnProperty('"+i+"') || !Array.isArray(target"+n+"['"+i+"'])) {\n target"+(n+1)+" = []\n if (source"+n+".hasOwnProperty('"+i+"')) {\n count"+(n+1)+"++\n }\n\n } else {\n target"+(n+1)+" = target"+n+"['"+i+"']\n count"+(n+1)+"++\n }\n\n "+a+"\n\n if (count"+(n+1)+" > 0) {\n target"+n+"['"+i+"'] = target"+(n+1)+"\n count"+n+"++\n }\n\n } else {\n target"+n+"['"+i+"'] = source"+n+"['"+i+"']\n count"+n+"++\n }\n "}return a}},{key:"additionalItems",value:function(){}}],[{key:"compile",value:function(t){var n=new e(t).compile();try{return new Function("target","source","options",n)}catch(e){console.log(e,e.stack)}}}]),e}();e.exports=o},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initialize(t,n)}return r(e,null,[{key:"schema",get:function(){throw new Error("Schema must be defined by classes extending JSONDocument")}}]),r(e,[{key:"initialize",value:function(){this.constructor.schema.initialize(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}},{key:"validate",value:function(e){return(e||this.constructor.schema).validate(this)}},{key:"patch",value:function(e){new i(e).apply(this)}},{key:"select",value:function(){}},{key:"project",value:function(e){return e.project(this)}}],[{key:"serialize",value:function(e){return JSON.stringify(e)}},{key:"deserialize",value:function(e){try{return JSON.parse(e)}catch(e){throw new Error("Failed to parse JSON")}}}]),e}();e.exports=o},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schema=t,Object.assign(this,n),this.address||(this.address=""),!0!==this.require&&(this.require=!1)}return i(e,null,[{key:"compile",value:function(t){var n='\n // "cursor"\n let value = data\n let container\n let stack = []\n let top = -1\n\n // error state\n let valid = true\n let errors = []\n\n // complex schema state\n let initialValidity\n let anyValid\n let notValid\n let countOfValid\n let initialErrorCount\n let accumulatedErrorCount\n\n // validation code\n '+new e(t).compile()+"\n\n // validation result\n return {\n valid,\n errors\n }\n ";return new Function("data",n)}},{key:"counter",get:function(){return a++}}]),i(e,[{key:"compile",value:function(){var e="";return this.require&&(e+=this.required()),e+=this.type(),e+=this.array(),e+=this.number(),e+=this.object(),e+=this.string(),e+=this.enum(),e+=this.anyOf(),e+=this.allOf(),(e+=this.not())+this.oneOf()}},{key:"push",value:function(){return"\n stack.push(value)\n container = value\n top++\n "}},{key:"pop",value:function(){return"\n if (stack.length > 1) {\n top--\n stack.pop()\n }\n\n value = container = stack[top]\n "}},{key:"type",value:function(){var e=this.schema.type,t="";return e&&(t+="\n // "+this.address+" type checking\n if (value !== undefined && "+(Array.isArray(e)?e:[e]).map(function(e){return"array"===e?"!Array.isArray(value)":"boolean"===e?"typeof value !== 'boolean'":"integer"===e?"!Number.isInteger(value)":"null"===e?"value !== null":"number"===e?"typeof value !== 'number'":"object"===e?"(typeof value !== 'object' || Array.isArray(value) || value === null)":"string"===e?"typeof value !== 'string'":void 0}).join(" && ")+") {\n valid = false\n errors.push({\n keyword: 'type',\n message: 'invalid type'\n })\n }\n "),t}},{key:"array",value:function(){var e=this.validations(["additionalItems","items","minItems","maxItems","uniqueItems"]),t="";return e.length>0&&(t+="\n /**\n * Array validations\n */\n if (Array.isArray(value)) {\n "+e+"\n }\n "),t}},{key:"number",value:function(){var e=this.validations(["minimum","maximum","multipleOf"]),t="";return e.length>0&&(t+="\n /**\n * Number validations\n */\n if (typeof value === 'number') {\n "+e+"\n }\n "),t}},{key:"object",value:function(){var e=this.validations(["maxProperties","minProperties","additionalProperties","properties","patternProperties","dependencies","schemaDependencies","propertyDependencies"]),t="";return e.length>0&&(t+="\n /**\n * Object validations\n */\n if (typeof value === 'object' && value !== null && !Array.isArray(value)) {\n "+e+"\n }\n "),t}},{key:"string",value:function(){var e=this.validations(["maxLength","minLength","pattern","format"]),t="";return e.length>0&&(t+="\n /**\n * String validations\n */\n if (typeof value === 'string') {\n "+e+"\n }\n "),t}},{key:"validations",value:function(e){var t=this,n="";return Object.keys(this.schema).filter(function(t){return-1!==e.indexOf(t)}).forEach(function(e){n+=t[e]()}),n}},{key:"enum",value:function(){var e=this.schema.enum,t=this.address,n=["value !== undefined"],i="";return e&&(e.forEach(function(e){switch(void 0===e?"undefined":r(e)){case"boolean":case"number":n.push("value !== "+e);break;case"string":n.push('value !== "'+e+'"');break;case"object":n.push(null===e?"value !== null":"'"+JSON.stringify(e)+"' !== JSON.stringify(value)");break;default:throw new Error("Things are not well in the land of enum")}}),i+='\n /**\n * Validate "'+t+'" enum\n */\n if ('+n.join(" && ")+") {\n valid = false\n errors.push({\n keyword: 'enum',\n message: JSON.stringify(value) + ' is not an enumerated value'\n })\n }\n "),i}},{key:"anyOf",value:function(){var t=this.schema.anyOf,n=this.address,r="";return Array.isArray(t)&&(r+="\n initialValidity = valid\n initialErrorCount = errors.length\n anyValid = false\n ",t.forEach(function(t){var i=new e(t,{address:n});r+="\n accumulatedErrorCount = errors.length\n "+i.compile()+"\n if (accumulatedErrorCount === errors.length) {\n anyValid = true\n }\n "}),r+="\n if (anyValid === true) {\n valid = initialValidity\n errors = errors.slice(0, initialErrorCount)\n }\n "),r}},{key:"allOf",value:function(){var t=this.schema.allOf,n=this.address,r="";return Array.isArray(t)&&t.forEach(function(t){var i=new e(t,{address:n});r+="\n "+i.compile()+"\n "}),r}},{key:"oneOf",value:function(){var t=this.schema.oneOf,n=this.address,r="";return Array.isArray(t)&&(r+="\n /**\n * Validate "+n+" oneOf\n */\n initialValidity = valid\n initialErrorCount = errors.length\n countOfValid = 0\n ",t.forEach(function(t){var i=new e(t,{address:n});r+="\n accumulatedErrorCount = errors.length\n "+i.compile()+"\n if (accumulatedErrorCount === errors.length) {\n countOfValid += 1\n }\n "}),r+="\n if (countOfValid === 1) {\n valid = initialValidity\n errors = errors.slice(0, initialErrorCount)\n } else {\n valid = false\n errors.push({\n keyword: 'oneOf',\n message: 'what is a reasonable error message for this case?'\n })\n }\n "),r}},{key:"not",value:function(){var t=this.schema.not,n=this.address,i="";return"object"!==(void 0===t?"undefined":r(t))||null===t||Array.isArray(t)||(i+="\n /**\n * NOT\n */\n if (value !== undefined) {\n initialValidity = valid\n initialErrorCount = errors.length\n notValid = true\n\n accumulatedErrorCount = errors.length\n\n "+new e(t,{address:n}).compile()+"\n\n if (accumulatedErrorCount === errors.length) {\n notValid = false\n }\n\n if (notValid === true) {\n valid = initialValidity\n errors = errors.slice(0, initialErrorCount)\n } else {\n valid = false\n errors = errors.slice(0, initialErrorCount)\n errors.push({\n keyword: 'not',\n message: 'hmm...'\n })\n }\n }\n "),i}},{key:"properties",value:function(){var t=this.schema,n=this.address,i=t.properties,o=t.required,a=this.push();return o=Array.isArray(o)?o:[],"object"===(void 0===i?"undefined":r(i))&&Object.keys(i).forEach(function(t){var r=i[t],s=-1!==o.indexOf(t),u=new e(r,{address:[n,t].filter(function(e){return!!e}).join("."),require:s});a+="\n value = container['"+t+"']\n ",a+=u.compile()}),a+=this.pop()}},{key:"otherProperties",value:function(){return"\n /**\n * Validate Other Properties\n */\n "+this.push()+"\n\n for (let key in container) {\n value = container[key]\n matched = false\n\n "+this.patternValidations()+"\n "+this.additionalValidations()+"\n }\n\n "+this.pop()+"\n "}},{key:"patternValidations",value:function(){var t=this.schema.patternProperties,n="";return"object"===(void 0===t?"undefined":r(t))&&Object.keys(t).forEach(function(r){var i=new e(t[r]);n+="\n if (key.match('"+r+"')) {\n matched = true\n "+i.compile()+"\n }\n "}),n}},{key:"additionalValidations",value:function(){var t=this.schema,n=t.additionalProperties,i=this.address,o="",a=["matched !== true"];if(Object.keys(t.properties||{}).forEach(function(e){a.push("key !== '"+e+"'")}),"object"===(void 0===n?"undefined":r(n))){var s=new e(n,{address:i+"[APKey]"});o+="\n // validate additional properties\n if ("+a.join(" && ")+") {\n "+s.compile()+"\n }\n "}return!1===n&&(o+="\n // validate non-presence of additional properties\n if ("+a.join(" && ")+") {\n valid = false\n errors.push({\n keyword: 'additionalProperties',\n message: key + ' is not a defined property'\n })\n }\n "),o}},{key:"patternProperties",value:function(){var e="";return this.otherPropertiesCalled||(this.otherPropertiesCalled=!0,e+=this.otherProperties()),e}},{key:"additionalProperties",value:function(){var e="";return this.otherPropertiesCalled||(this.otherPropertiesCalled=!0,e+=this.otherProperties()),e}},{key:"minProperties",value:function(){return"\n // "+this.address+" min properties\n if (Object.keys(value).length < "+this.schema.minProperties+") {\n valid = false\n errors.push({\n keyword: 'minProperties',\n message: 'too few properties'\n })\n }\n "}},{key:"maxProperties",value:function(){return"\n // "+this.address+" max properties\n if (Object.keys(value).length > "+this.schema.maxProperties+") {\n valid = false\n errors.push({\n keyword: 'maxProperties',\n message: 'too many properties'\n })\n }\n "}},{key:"dependencies",value:function(){var t=this.schema.dependencies,n=this.address,i=this.push();return"object"===(void 0===t?"undefined":r(t))&&Object.keys(t).forEach(function(o){var a=t[o],s=[];if(Array.isArray(a))a.forEach(function(e){s.push("container['"+e+"'] === undefined")}),i+="\n if (container['"+o+"'] !== undefined && ("+s.join(" || ")+")) {\n valid = false\n errors.push({\n keyword: 'dependencies',\n message: 'unmet dependencies'\n })\n }\n ";else if("object"===(void 0===a?"undefined":r(a))){var u=new e(a,{address:n});i+="\n if (container['"+o+"'] !== undefined) {\n "+u.compile()+"\n }\n "}}),i+=this.pop()}},{key:"required",value:function(){return"\n // validate "+this.address+" presence\n if (value === undefined) {\n valid = false\n errors.push({\n keyword: 'required',\n message: 'is required'\n })\n }\n "}},{key:"additionalItems",value:function(){var t=this.schema,n=t.items,i=t.additionalItems,o="";if(!1===i&&Array.isArray(n)&&(o+="\n // don't allow additional items\n if (value.length > "+n.length+") {\n valid = false\n errors.push({\n keyword: 'additionalItems',\n message: 'additional items not allowed'\n })\n }\n "),"object"===(void 0===i?"undefined":r(i))&&null!==i&&Array.isArray(n)){var a=new e(i),s=e.counter;o+="\n // additional items\n "+this.push()+"\n\n for (var i"+s+" = "+n.length+"; i"+s+" <= container.length; i"+s+"++) {\n value = container[i"+s+"]\n "+a.compile()+"\n }\n\n "+this.pop()+"\n "}return o}},{key:"items",value:function(){var t=this.schema.items,n=this.address,i="";if(Array.isArray(t))i+=this.push(),t.forEach(function(t,r){var o=new e(t,{address:n+"["+r+"]"});i+="\n // item #"+r+"\n value = container["+r+"]\n "+o.compile()+"\n "}),i+=this.pop();else if("object"===(void 0===t?"undefined":r(t))&&null!==t){var o=new e(t),a=e.counter;i+="\n // items\n "+this.push()+"\n\n for (var i"+a+" = 0; i"+a+" < container.length; i"+a+"++) {\n // read array element\n value = container[i"+a+"]\n "+o.compile()+"\n }\n\n "+this.pop()+"\n "}return i}},{key:"minItems",value:function(){return"\n // "+this.address+" min items\n if (value.length < "+this.schema.minItems+") {\n valid = false\n errors.push({\n keyword: 'minItems',\n message: 'too few properties'\n })\n }\n "}},{key:"maxItems",value:function(){return"\n // "+this.address+" max items\n if (value.length > "+this.schema.maxItems+") {\n valid = false\n errors.push({\n keyword: 'maxItems',\n message: 'too many properties'\n })\n }\n "}},{key:"uniqueItems",value:function(){var e="";return!0===this.schema.uniqueItems&&(e+="\n // validate "+this.address+" unique items\n let values = value.map(v => JSON.stringify(v)) // TODO: optimize\n let set = new Set(values)\n if (values.length !== set.size) {\n valid = false\n errors.push({\n keyword: 'uniqueItems',\n message: 'items must be unique'\n })\n }\n "),e}},{key:"minLength",value:function(){return"\n // "+this.address+" validate minLength\n if (Array.from(value).length < "+this.schema.minLength+") {\n valid = false\n errors.push({\n keyword: 'minLength',\n message: 'too short'\n })\n }\n "}},{key:"maxLength",value:function(){return"\n // "+this.address+" validate maxLength\n if (Array.from(value).length > "+this.schema.maxLength+") {\n valid = false\n errors.push({\n keyword: 'maxLength',\n message: 'too long'\n })\n }\n "}},{key:"pattern",value:function(){var e=this.schema.pattern;if(e)return"\n // "+this.address+" validate pattern\n if (!value.match(new RegExp('"+e+"'))) {\n valid = false\n errors.push({\n keyword: 'pattern',\n message: 'does not match the required pattern'\n })\n }\n "}},{key:"format",value:function(){var e=this.schema.format,t=this.address,n=o.resolve(e);if(n)return"\n // "+t+" validate format\n if (!value.match("+n+")) {\n valid = false\n errors.push({\n keyword: 'format',\n message: 'is not \""+e+"\" format'\n })\n }\n "}},{key:"minimum",value:function(){var e=this.schema;return"\n // "+this.address+" validate minimum\n if (value "+(!0===e.exclusiveMinimum?"<=":"<")+" "+e.minimum+") {\n valid = false\n errors.push({\n keyword: 'minimum',\n message: 'too small'\n })\n }\n "}},{key:"maximum",value:function(){var e=this.schema;return"\n // "+this.address+" validate maximum\n if (value "+(!0===e.exclusiveMaximum?">=":">")+" "+e.maximum+") {\n valid = false\n errors.push({\n keyword: 'maximum',\n message: 'too large'\n })\n }\n "}},{key:"multipleOf",value:function(){var e=this.schema.multipleOf,t="";if("number"==typeof e){var n=e.toString().length-e.toFixed(0).length-1,r=n>0?Math.pow(10,n):1;t+="\n if ("+(n>0?"(value * "+r+") % "+e*r+" !== 0":"value % "+e+" !== 0")+") {\n valid = false\n errors.push({\n keyword: 'multipleOf',\n message: 'must be a multiple of "+e+"'\n })\n }\n "}return t}}]),e}();e.exports=s},function(e,t,n){"use strict";var r=n(38),i=n(57),o=n(60),a=n(62),s=n(67),u=n(64),l=n(66),c=n(58),f=n(61),h=n(65),p=n(63);e.exports={JWA:r,JWK:i,JWKSet:o,JWT:a,JWS:s,Base64URLSchema:u,JOSEHeaderSchema:l,JWKSchema:c,JWKSetSchema:f,JWTClaimsSetSchema:h,JWTSchema:p}},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function d(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return B(e).length;default:if(r)return V(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,i){if(0===e.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:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var f=!0,h=0;hi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i.push(n%256),i.push(r);return i}(t,e.length-n),e,n,r)}function E(e,t,n){return r.fromByteArray(0===t&&n===e.length?e:e.slice(t,n))}function k(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+f<=n)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:a=e[i+2],128==(192&(o=e[i+1]))&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:a=e[i+2],s=e[i+3],128==(192&(o=e[i+1]))&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(r.push((c-=65536)>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=f}return function(e){var t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);for(var n="",r=0;rthis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return O(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}).apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(r,i),c=e.slice(t,n),f=0;fi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return v(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return x(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function T(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function R(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function j(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function D(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(e,t,n,r,o){return o||D(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,o){return o||D(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||A(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||A(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||A(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||A(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||A(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||A(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||A(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||A(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||A(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||N(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):j(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):j(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return M(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return M(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=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),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function B(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(21))},function(e,t,n){"use strict";t.byteLength=function(e){var t=l(e),n=t[1];return 3*(t[0]+n)/4-n},t.toByteArray=function(e){for(var t,n=l(e),r=n[0],a=n[1],s=new o(NaN),u=0,c=a>0?r-4:r,f=0;f>16&255,s[u++]=t>>8&255,s[u++]=255&t;return 2===a&&(t=i[e.charCodeAt(f)]<<2|i[e.charCodeAt(f+1)]>>4,s[u++]=255&t),1===a&&(t=i[e.charCodeAt(f)]<<10|i[e.charCodeAt(f+1)]<<4|i[e.charCodeAt(f+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t),s},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=0,s=n-i;as?s:a+16383));return 1===i?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,n){for(var i,o=[],a=t;a>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,c=-7,f=n?i-1:0,h=n?-1:1,p=e[t+f];for(f+=h,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+e[t+f],f+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+f],f+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=l}return(p?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=d,s/=256,i-=8);for(a=a<0;e[n+p]=255&a,p+=d,a/=256,l-=8);e[n+p-d]|=128*g}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){let n=t.length,r=n%4;if(!r)return t;let i=n,o=4-r,a=e.alloc(n+o);for(a.write(t);o--;)a.write("=",i++);return a.toString()}}).call(this,n(41).Buffer)},function(e,t,n){"use strict";var r=n(47),i=n(48),o=n(52),a=new(n(53));a.define("HS256","sign",new i({name:"HMAC",hash:{name:"SHA-256"}})),a.define("HS384","sign",new i({name:"HMAC",hash:{name:"SHA-384"}})),a.define("HS512","sign",new i({name:"HMAC",hash:{name:"SHA-512"}})),a.define("RS256","sign",new o({name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}})),a.define("RS384","sign",new o({name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}})),a.define("RS512","sign",new o({name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}})),a.define("none","sign",new r({})),a.define("HS256","verify",new i({name:"HMAC",hash:{name:"SHA-256"}})),a.define("HS384","verify",new i({name:"HMAC",hash:{name:"SHA-384"}})),a.define("HS512","verify",new i({name:"HMAC",hash:{name:"SHA-512"}})),a.define("RS256","verify",new o({name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}})),a.define("RS384","verify",new o({name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}})),a.define("RS512","verify",new o({name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}})),a.define("none","verify",new r({})),a.define("RS256","importKey",new o({name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}})),a.define("RS384","importKey",new o({name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}})),a.define("RS512","importKey",new o({name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}})),e.exports=a},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n(r(c.configuration,"RelyingParty provider OpenID Configuration is missing"),r(f.authenticate,"RelyingParty default authentication parameters are missing"),r(h,"RelyingParty client registration is missing"),p=c.configuration.issuer,d=c.configuration.authorization_endpoint,g={client_id:h.client_id},m=Object.assign(f.authenticate,g,n),r(p,"Missing issuer in provider OpenID Configuration"),r(d,"Missing authorization_endpoint in provider OpenID Configuration"),r(m.scope,"Missing scope parameter in authentication request"),r(m.response_type,"Missing response_type parameter in authentication request"),r(m.client_id,"Missing client_id parameter in authentication request"),r(m.redirect_uri,"Missing redirect_uri parameter in authentication request"),m.state=Array.from(o.getRandomValues(new Uint8Array(16))),m.nonce=Array.from(o.getRandomValues(new Uint8Array(16))),Promise.all([o.subtle.digest({name:"SHA-256"},new Uint8Array(m.state)),o.subtle.digest({name:"SHA-256"},new Uint8Array(m.nonce))]))).then(e=>{let n=i(t.from(e[0])),r=i(t.from(e[1]));a[`${p}/requestHistory/${n}`]=JSON.stringify(m),m.state=n,m.nonce=r}).then(()=>l.generateSessionKeys()).then(e=>{l.storeSessionKeys(e,m,a)}).then(()=>{if(c.configuration.request_parameter_supported)return l.encodeRequestParams(m).then(e=>{m=e})}).then(()=>{let e=new u(d);return e.search=s.encode(m),e.href})}static generateSessionKeys(){return o.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(e=>Promise.all([o.subtle.exportKey("jwk",e.publicKey),o.subtle.exportKey("jwk",e.privateKey)])).then(e=>{let[t,n]=e;return{public:t,private:n}})}static storeSessionKeys(e,t,n){n["oidc.session.privateKey"]=JSON.stringify(e.private),t.key=e.public}static encodeRequestParams(e){const t=["scope","client_id","response_type","state"],n=Object.keys(e).filter(e=>!t.includes(e));let r={};return n.forEach(t=>{r[t]=e[t]}),new a({header:{alg:"none"},payload:r},{filter:!1}).encode().then(t=>({scope:e.scope,client_id:e.client_id,response_type:e.response_type,request:t,state:e.state}))}}e.exports=l}).call(this,n(41).Buffer)},function(e,t){e.exports=class{static encode(e){let t=[];return Object.keys(e).forEach(function(n){t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]))}),t.join("&")}static decode(e){let t={};return e.split("&").forEach(function(e){let n=e.split("="),r=decodeURIComponent(n[0]),i=decodeURIComponent(n[1]);t[r]=i}),t}}},function(e,t,n){(function(t,r){const{URL:i}=n(27),o=n(22),a=n(49),s=n(39),u=n(6),l=u.Headers?u.Headers:t.Headers,c=n(69),f=n(71),h=n(73),p=n(74),d=n(76);class g{constructor({rp:e,redirect:t,body:n,session:r,mode:i,params:o={}}){this.rp=e,this.redirect=t,this.body=n,this.session=r,this.mode=i,this.params=o}static validateResponse(e){return Promise.resolve(e).then(this.parseResponse).then(this.errorResponse).then(this.matchRequest).then(this.validateStateParam).then(this.validateResponseMode).then(this.validateResponseParams).then(this.exchangeAuthorizationCode).then(this.validateIDToken).then(h.fromAuthResponse)}static parseResponse(e){let{redirect:t,body:n}=e;if(t&&n||!t&&!n)throw new d(400,"Invalid response mode");if(t){let n=new i(t),{search:r,hash:o}=n;if(r&&o||!r&&!o)throw new d(400,"Invalid response mode");r&&(e.params=c.decode(r.substring(1)),e.mode="query"),o&&(e.params=c.decode(o.substring(1)),e.mode="fragment")}return n&&(e.params=c.decode(n),e.mode="form_post"),e}static errorResponse(e){const t=e.params.error;if(t){const n={};n.error=t,n.error_description=e.params.error_description,n.error_uri=e.params.error_uri,n.state=e.params.state;const r=new Error(`AuthenticationResponse error: ${t}`);throw r.info=n,r}return e}static matchRequest(e){let{rp:t,params:n,session:r}=e,i=n.state,o=t.provider.configuration.issuer;if(!i)throw new Error("Missing state parameter in authentication response");let a=r[`${o}/requestHistory/${i}`];if(!a)throw new Error("Mismatching state parameter in authentication response");return e.request=JSON.parse(a),e}static validateStateParam(e){let t=new Uint8Array(e.request.state),n=e.params.state;return a.subtle.digest({name:"SHA-256"},t).then(t=>{if(n!==s(r.from(t)))throw new Error("Mismatching state parameter in authentication response");return e})}static validateResponseMode(e){if("code"!==e.request.response_type&&"query"===e.mode)throw new Error("Invalid response mode");return e}static validateResponseParams(e){let{request:t,params:n}=e,r=t.response_type.split(" ");return r.includes("code")&&o(n.code,"Missing authorization code in authentication response"),r.includes("id_token")&&o(n.id_token,"Missing id_token in authentication response"),r.includes("token")&&(o(n.access_token,"Missing access_token in authentication response"),o(n.token_type,"Missing token_type in authentication response")),e}static exchangeAuthorizationCode(e){let{rp:t,params:n,request:i}=e,a=n.code;if(!a||"code"!==i.response_type)return Promise.resolve(e);let{provider:s,registration:f}=t,h=f.client_id,d=f.client_secret;if(!d)return Promise.reject(new Error("Client cannot exchange authorization code because it is not a confidential client"));let g=s.configuration.token_endpoint,m=new l({"Content-Type":"application/x-www-form-urlencoded"}),y={grant_type:"authorization_code",code:a,redirect_uri:i.redirect_uri},v=f.token_endpoint_auth_method||"client_secret_basic";if("client_secret_basic"===v){let e=new r(`${h}:${d}`).toString("base64");m.set("Authorization",`Basic ${e}`)}"client_secret_post"===v&&(y.client_id=h,y.client_secret=d);let b=c.encode(y);return u(g,{method:"POST",headers:m,body:b}).then(p("Error exchanging authorization code")).then(e=>e.json()).then(t=>(o(t.access_token,"Missing access_token in token response"),o(t.token_type,"Missing token_type in token response"),o(t.id_token,"Missing id_token in token response"),e.params=Object.assign(e.params,t),e))}static validateIDToken(e){return e.params.id_token?Promise.resolve(e).then(g.decryptIDToken).then(g.decodeIDToken).then(g.validateIssuer).then(g.validateAudience).then(g.resolveKeys).then(g.verifySignature).then(g.validateExpires).then(g.verifyNonce).then(g.validateAcr).then(g.validateAuthTime).then(g.validateAccessTokenHash).then(g.validateAuthorizationCodeHash):Promise.resolve(e)}static decryptIDToken(e){return Promise.resolve(e)}static decodeIDToken(e){let t=e.params.id_token;try{e.decoded=f.decode(t)}catch(e){const n=new d(400,"Error decoding ID Token");throw n.cause=e,n.info={id_token:t},n}return e}static validateIssuer(e){if(e.decoded.payload.iss!==e.rp.provider.configuration.issuer)throw new Error("Mismatching issuer in ID Token");return e}static validateAudience(e){let t=e.rp.registration,{aud:n,azp:r}=e.decoded.payload;if("string"==typeof n&&n!==t.client_id)throw new Error("Mismatching audience in id_token");if(Array.isArray(n)&&!n.includes(t.client_id))throw new Error("Mismatching audience in id_token");if(Array.isArray(n)&&!r)throw new Error("Missing azp claim in id_token");if(r&&r!==t.client_id)throw new Error("Mismatching azp claim in id_token");return e}static resolveKeys(e){let t=e.rp,n=e.decoded;return Promise.resolve(t.provider.jwks).then(e=>e||t.jwks()).then(t=>{if(n.resolveKeys(t))return Promise.resolve(e);throw new Error("Cannot resolve signing key for ID Token")})}static verifySignature(e){let t=e.rp.registration.id_token_signed_response_alg||"RS256";if(e.decoded.header.alg!==t)throw new Error(`Expected ID Token to be signed with ${t}`);return e.decoded.verify().then(t=>{if(!t)throw new Error("Invalid ID Token signature");return e})}static validateExpires(e){if(e.decoded.payload.exp<=Math.floor(Date.now()/1e3))throw new Error("Expired ID Token");return e}static verifyNonce(e){let t=new Uint8Array(e.request.nonce),n=e.decoded.payload.nonce;if(!n)throw new Error("Missing nonce in ID Token");return a.subtle.digest({name:"SHA-256"},t).then(t=>{if(n!==s(r.from(t)))throw new Error("Mismatching nonce in ID Token");return e})}static validateAcr(e){return e}static validateAuthTime(e){return e}static validateAccessTokenHash(e){return e}static validateAuthorizationCodeHash(e){return e}}e.exports=g}).call(this,n(21),n(41).Buffer)},function(e,t,n){const{JWT:r}=n(37),i=n(72);e.exports=class extends r{static get schema(){return i}}},function(e,t,n){const{JWTSchema:r}=n(37),i=r.extend({properties:{header:{},payload:{properties:{iss:{type:"string",format:"url"},sub:{type:"string",maxLength:255},auth_time:{type:"integer",format:"NumericDate"},nonce:{type:"string"},acr:{type:"string"},amr:{type:"array",items:{type:"string"}},azp:{type:"string",format:"StringOrURI"}},required:["iss","sub","aud","exp","iat"]}}});e.exports=i},function(e,t,n){"use strict";const r=n(6),i=n(74),o=n(75);class a{constructor(e){this.credentialType=e.credentialType||"access_token",this.issuer=e.issuer,this.authorization=e.authorization||{},this.sessionKey=e.sessionKey,this.idClaims=e.idClaims,this.accessClaims=e.accessClaims}static from(e){return new a(e)}static fromAuthResponse(e){const t=n(20);let r=e.decoded&&e.decoded.payload||{},{rp:i}=e;return a.from({credentialType:(i.defaults.authenticate||{}).credential_type||i.defaults.popToken?"pop_token":"access_token",sessionKey:e.session[t.SESSION_PRIVATE_KEY],issuer:r.iss,idClaims:r,authorization:{client_id:i.registration.client_id,access_token:e.params.access_token,id_token:e.params.id_token,refresh_token:e.params.refresh_token}})}get fetch(){return(e,t)=>Promise.resolve().then(()=>this.hasCredentials()?this.fetchWithCredentials(e,t):r(e,t)).then(i("Error while fetching resource"))}bearerTokenFor(e){switch(this.credentialType){case"pop_token":return o.issueFor(e,this);default:return Promise.resolve(this.authorization[this.credentialType])}}hasCredentials(){switch(this.credentialType){case"pop_token":return!!this.authorization.id_token;default:return!!this.authorization[this.credentialType]}}fetchWithCredentials(e,t={}){return t.headers=t.headers||{},this.bearerTokenFor(e).then(n=>(t.headers.authorization=`Bearer ${n}`,r(e,t)))}}e.exports=a},function(e,t,n){"use strict";e.exports=function(e="fetch error"){return t=>{if(t.status>=200&&t.status<300)return t;let n=new Error(`${e}: ${t.status} ${t.statusText}`);throw n.response=t,n.statusCode=t.status,n}}},function(e,t,n){"use strict";const{URL:r}=n(27),{JWT:i,JWK:o}=n(37),a=3600;class s extends i{static issueFor(e,t){if(!e)throw new Error("Cannot issue PoPToken - missing resource server URI");if(!t.sessionKey)throw new Error("Cannot issue PoPToken - missing session key");if(!t.authorization.id_token)throw new Error("Cannot issue PoPToken - missing id token");let n=JSON.parse(t.sessionKey);return o.importKey(n).then(n=>{let i={aud:new r(e).origin,key:n,iss:t.authorization.client_id,id_token:t.authorization.id_token};return s.issue(i)}).then(e=>e.encode())}static issue(e){let{aud:t,iss:n,key:r}=e,i=r.alg,o=e.iat||Math.floor(Date.now()/1e3);return new s({header:{alg:i},payload:{iss:n,aud:t,exp:o+(e.max||a),iat:o,id_token:e.id_token,token_type:"pop"},key:r.cryptoKey},{filter:!1})}}e.exports=s},function(e,t,n){t=e.exports=a;var r=n(77),i=n(78),o=t;function a(e,t,n){if("string"==typeof e&&(e=o[e]),"number"!=typeof e)throw new TypeError("Non-numeric HTTP code");"object"==typeof t&&null!=t&&(n=t,t=null),r.call(this,t||i[e],n),this.code=e}for(var s in(a.prototype=Object.create(r.prototype,{constructor:{value:a,configurable:!0,writable:!0}})).name="HttpError",Object.defineProperties(a.prototype,{statusCode:u("code"),statusMessage:u("message"),status:{configurable:!0,get:function(){return this.code},set:function(e){Object.defineProperty(this,"status",{value:e,configurable:!0,enumerable:!0,writable:!0})}}}),a.prototype.toString=function(){return this.name+": "+this.code+" "+this.message},i)t[i[s].replace("'","").replace(/[- ]/g,"_").toUpperCase()]=+s;function u(e){return{configurable:!0,get:function(){return this[e]},set:function(t){return this[e]=t}}}},function(e,t){var n=Object.hasOwnProperty,r=Object.getPrototypeOf,i=Error.captureStackTrace;function o(e,t){if(e&&"object"==typeof e?(t=e,e=void 0):this.message=e,t)for(var o in t)this[o]=t[o];n.call(this,"name")||(this.name=n.call(r(this),"name")?this.name:this.constructor.name),!i||"stack"in this||i(this,this.constructor)}e.exports=o,(o.prototype=Object.create(Error.prototype,{constructor:{value:o,configurable:!0,writable:!0}})).name="StandardError"},function(e){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},function(e,t,n){const{JSONSchema:r}=n(28),i=new r({type:"object",properties:{provider:{type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri"},configuration:{},jwks:{}},required:["url"]},defaults:{type:"object",properties:{popToken:{type:"boolean",default:!1},authenticate:{type:"object",properties:{redirect_uri:{type:"string",format:"uri"},response_type:{type:"string",default:"id_token token",enum:["code","token","id_token token","id_token token code"]},display:{type:"string",default:"page",enum:["page","popup"]},scope:{type:["string","array"],default:["openid"]}}},register:{}}},registration:{},store:{type:"object",default:{}}}});e.exports=i},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n{const u=new r.Server(t,Object(i.originOf)(n.popupUri||""),s(e,n,e=>{u.stop(),o(e)}));u.start()})}function s(e,{popupUri:t,callbackUri:n},r){return async(i,...o)=>{switch(i){case"getAppOrigin":return window.location.origin;case"storage/getItem":return e.getItem(...o);case"storage/setItem":return e.setItem(...o);case"storage/removeItem":return e.removeItem(...o);case"getLoginOptions":return{popupUri:t,callbackUri:n};case"foundSession":r(...o)}}}}]).default},function(e,t,n){(function(t){var n=String.fromCharCode,r="function"==typeof t?t:function(e){setTimeout(e,0)},i=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\[uU]|\\(.)/g,o={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},a=/[\x00-\x20<>\\"\{\}\|\^\`]/;function s(e){if(!(this instanceof s))return new s(e);if(e&&e.lineMode){this._tripleQuotedString=this._number=this._boolean=/$0^/;var t=this;this._tokenize=this.tokenize,this.tokenize=function(e,n){this._tokenize(e,function(e,r){!e&&/^(?:IRI|prefixed|literal|langcode|type|\.|eof)$/.test(r.type)?n&&n(e,r):n&&n(e||t._syntaxError(r.type,n=null))})}}}s.prototype={_iri:/^<((?:[^>\\]|\\[uU])+)>/,_unescapedIri:/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>/,_unescapedString:/^"[^"\\]+"(?=[^"\\])/,_singleQuotedString:/^"[^"\\]*(?:\\.[^"\\]*)*"(?=[^"\\])|^'[^'\\]*(?:\\.[^'\\]*)*'(?=[^'\\])/,_tripleQuotedString:/^""("[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*")""|^''('[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*')''/,_langcode:/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,_prefix:/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,_prefixed:/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?=\.?[,;\s#()\[\]\{\}"'<])/,_blank:/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=\.?[,;:\s#()\[\]\{\}"'<])/,_number:/^[\-+]?(?:\d+\.?\d*([eE](?:[\-\+])?\d+)|\d*\.?\d+)(?=[.,;:\s#()\[\]\{\}"'<])/,_boolean:/^(?:true|false)(?=[.,;:\s#()\[\]\{\}"'<])/,_keyword:/^@[a-z]+(?=[\s#<:])/,_sparqlKeyword:/^(?:PREFIX|BASE|GRAPH)(?=[\s#<:])/i,_shortPredicates:/^a(?=\s+|<)/,_newline:/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,_whitespace:/^[ \t]+/,_endOfFile:/^(?:#[^\n\r]*)?$/,_tokenizeToEnd:function(e,t){for(var n=this._input;;){for(var r;r=this._newline.exec(n);)n=n.substr(r[0].length,n.length),this._line++;if((r=this._whitespace.exec(n))&&(n=n.substr(r[0].length,n.length)),this._endOfFile.test(n))return t&&e(n=null,{line:this._line,type:"eof",value:"",prefix:""}),this._input=n;var i,o=this._line,s="",u="",l="",c=n[0],f=null,h=0,p=!1;switch(c){case"^":if(1===n.length)break;if("^"!==n[1])return d(this);if(this._prevTokenType="^","<"!==(n=n.substr(2))[0]){p=!0;break}case"<":if(f=this._unescapedIri.exec(n))s="IRI",u=f[1];else if(f=this._iri.exec(n)){if(null===(i=this._unescape(f[1]))||a.test(i))return d(this);s="IRI",u=i}break;case"_":((f=this._blank.exec(n))||t&&(f=this._blank.exec(n+" ")))&&(s="prefixed",l="_",u=f[1]);break;case'"':case"'":if(f=this._unescapedString.exec(n))s="literal",u=f[0];else if(f=this._singleQuotedString.exec(n)){if(null===(i=this._unescape(f[0])))return d(this);s="literal",u=i.replace(/^'|'$/g,'"')}else if(f=this._tripleQuotedString.exec(n)){if(this._line+=(i=f[1]||f[2]).split(/\r\n|\r|\n/).length-1,null===(i=this._unescape(i)))return d(this);s="literal",u=i.replace(/^'|'$/g,'"')}break;case"@":"literal"===this._prevTokenType&&(f=this._langcode.exec(n))?(s="langcode",u=f[1]):(f=this._keyword.exec(n))&&(s=f[0]);break;case".":if(1===n.length?t:n[1]<"0"||n[1]>"9"){s=".",h=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(f=this._number.exec(n))&&(s="literal",u='"'+f[0]+'"^^http://www.w3.org/2001/XMLSchema#'+(f[1]?"double":/^[+\-]?\d+$/.test(f[0])?"integer":"decimal"));break;case"B":case"b":case"p":case"P":case"G":case"g":(f=this._sparqlKeyword.exec(n))?s=f[0].toUpperCase():p=!0;break;case"f":case"t":(f=this._boolean.exec(n))?(s="literal",u='"'+f[0]+'"^^http://www.w3.org/2001/XMLSchema#boolean'):p=!0;break;case"a":(f=this._shortPredicates.exec(n))?(s="abbreviation",u="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"):p=!0;break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":h=1,s=c;break;default:p=!0}if(p&&("@prefix"!==this._prevTokenType&&"PREFIX"!==this._prevTokenType||!(f=this._prefix.exec(n))?((f=this._prefixed.exec(n))||t&&(f=this._prefixed.exec(n+" ")))&&(s="prefixed",l=f[1]||"",u=this._unescape(f[2])):(s="prefix",u=f[1]||"")),"^"===this._prevTokenType&&(s="IRI"===s||"prefixed"===s?"type":""),!s)return t||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?d(this):this._input=n;e(null,{line:o,type:s,value:u,prefix:l}),this._prevTokenType=s,n=n.substr(h||f[0].length,n.length)}function d(t){e(t._syntaxError(/^\S*/.exec(n)[0]))}},_unescape:function(e){try{return e.replace(i,function(e,t,r,i){var a;if(t){if(a=parseInt(t,16),isNaN(a))throw new Error;return n(a)}if(r){if(a=parseInt(r,16),isNaN(a))throw new Error;return a<=65535?n(a):n(55296+(a-=65536)/1024,56320+(1023&a))}var s=o[i];if(!s)throw new Error;return s})}catch(e){return null}},_syntaxError:function(e){return this._input=null,new Error('Syntax error: unexpected "'+e+'" on line '+this._line+".")},tokenize:function(e,t){var n=this;function i(e){null!==n._input&&(n._input+=e,n._tokenizeToEnd(t,!1))}function o(){null!==n._input&&n._tokenizeToEnd(t,!0)}this._line=1,"string"==typeof e?(this._input=e,r(function(){n._tokenizeToEnd(t,!0)})):(this._input="",e&&"function"!=typeof e?("function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",i),e.on("end",o)):(this.addChunk=i,this.end=o,t||(t=e)))}},e.exports=s}).call(this,n(16).setImmediate)},function(e,t,n){var r=n(29),i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",o=i+"nil",a=i+"first",s=/^[a-z][a-z0-9+.-]*:/i,u=/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i,l=/(?:^|\/)\.\.?(?:$|[\/#?])/,c=0,f=0;function h(e){if(!(this instanceof h))return new h(e);this._tripleStack=[],this._graph=null,this._setBase((e=e||{}).documentIRI);var t="string"==typeof e.format&&e.format.match(/\w*$/)[0].toLowerCase(),n="turtle"===t,i="trig"===t,o=/triple/.test(t),a=/quad/.test(t),s=o||a;(this._supportsNamedGraphs=!n)||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||i||o),s&&(this._base="",this._resolveIRI=function(e){return this._error("Disallowed relative IRI",e),this._callback=p,this._subject=null}),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":"_:"+e.blankNodePrefix.replace(/^_:/,""),this._lexer=e.lexer||new r({lineMode:s})}function p(){}h._resetBlankNodeIds=function(){c=f=0},h.prototype={_setBase:function(e){if(e){if(e.indexOf("#")>=0)throw new Error("Invalid base IRI "+e)}else e=null;(this._base=e)&&(this._basePath=e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(u),this._baseRoot=e[0],this._baseScheme=e[1])},_readInTopContext:function(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"@prefix":return this._sparqlStyle=!1,this._readPrefix;case"PREFIX":return this._sparqlStyle=!0,this._readPrefix;case"@base":return this._sparqlStyle=!1,this._readBaseIRI;case"BASE":return this._sparqlStyle=!0,this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}},_readSubject:function(e){switch(this._predicate=null,e.type){case"IRI":this._subject=null===this._base||s.test(e.value)?e.value:this._resolveIRI(e);break;case"prefixed":var t=this._prefixes[e.prefix];if(void 0===t)return this._error('Undefined prefix "'+e.prefix+':"',e);this._subject=t+e.value;break;case"[":return this._subject="_:b"+f++,this._tripleStack.push({subject:this._subject,predicate:null,object:null,type:"blank"}),this._readBlankNodeHead;case"(":return this._tripleStack.push({subject:o,predicate:null,object:null,type:"list"}),this._subject=null,this._readListItem;case"}":return this._readPunctuation(e);default:return this._error("Expected subject but got "+e.type,e)}return this._readPredicateOrNamedGraph},_readPredicate:function(e){var t=e.type;switch(t){case"IRI":case"abbreviation":this._predicate=null===this._base||s.test(e.value)?e.value:this._resolveIRI(e);break;case"prefixed":if("_"===e.prefix)return this._error("Disallowed blank node as predicate",e);var n=this._prefixes[e.prefix];if(void 0===n)return this._error('Undefined prefix "'+e.prefix+':"',e);this._predicate=n+e.value;break;case".":case"]":case"}":return null===this._predicate?this._error("Unexpected "+t,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._readPredicate;default:return this._error('Expected predicate to follow "'+this._subject+'"',e)}return this._readObject},_readObject:function(e){switch(e.type){case"IRI":this._object=null===this._base||s.test(e.value)?e.value:this._resolveIRI(e);break;case"prefixed":var t=this._prefixes[e.prefix];if(void 0===t)return this._error('Undefined prefix "'+e.prefix+':"',e);this._object=t+e.value;break;case"literal":return this._object=e.value,this._readDataTypeOrLang;case"[":var n="_:b"+f++;return this._tripleStack.push({subject:this._subject,predicate:this._predicate,object:n,type:"blank"}),this._subject=n,this._readBlankNodeHead;case"(":return this._tripleStack.push({subject:this._subject,predicate:this._predicate,object:o,type:"list"}),this._subject=null,this._readListItem;default:return this._error('Expected object to follow "'+this._predicate+'"',e)}return this._getTripleEndReader()},_readPredicateOrNamedGraph:function(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)},_readGraph:function(e){return"{"!==e.type?this._error("Expected graph but got "+e.type,e):(this._graph=this._subject,this._subject=null,this._readSubject)},_readBlankNodeHead:function(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))},_readBlankNodeTail:function(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._callback(null,{subject:this._subject,predicate:this._predicate,object:this._object,graph:this._graph||""});var t=this._tripleStack.pop();return this._subject=t.subject,null!==t.object?(this._predicate=t.predicate,this._object=t.object,this._getTripleEndReader()):null!==this._predicate?this._readPredicate:this._readPredicateOrNamedGraph},_readDataTypeOrLang:function(e){switch(e.type){case"type":var t;if(""===e.prefix)t=null===this._base||s.test(e.value)?e.value:this._resolveIRI(e);else{var n=this._prefixes[e.prefix];if(void 0===n)return this._error('Undefined prefix "'+e.prefix+':"',e);t=n+e.value}return this._object+="^^"+t,this._getTripleEndReader();case"langcode":return this._object+="@"+e.value.toLowerCase(),this._getTripleEndReader();default:return this._getTripleEndReader().call(this,e)}},_readListItem:function(e){var t=null,n=null,r=this._subject,i=this._tripleStack,u=i[i.length-1],l=this._readListItem;switch(e.type){case"IRI":t=null===this._base||s.test(e.value)?e.value:this._resolveIRI(e);break;case"prefixed":var c=this._prefixes[e.prefix];if(void 0===c)return this._error('Undefined prefix "'+e.prefix+':"',e);t=c+e.value;break;case"literal":t=e.value,l=this._readDataTypeOrLang;break;case"[":n="_:b"+f++,t="_:b"+f++,i.push({subject:n,predicate:a,object:t,type:"blank"}),this._subject=t,l=this._readBlankNodeHead;break;case"(":n="_:b"+f++,i.push({subject:n,predicate:a,object:o,type:"list"}),this._subject=null,l=this._readListItem;break;case")":if(i.pop(),0!==i.length&&"list"===i[i.length-1].type&&this._callback(null,{subject:u.subject,predicate:u.predicate,object:u.object,graph:this._graph||""}),this._subject=u.subject,null===u.predicate){if(l=this._readPredicate,u.subject===o)return l}else if(this._predicate=u.predicate,this._object=u.object,l=this._getTripleEndReader(),u.object===o)return l;n=o;break;default:return this._error('Expected list item instead of "'+e.type+'"',e)}return null===n&&(this._subject=n="_:b"+f++),null===r?u.object===o?u.object=n:u.subject=n:this._callback(null,{subject:r,predicate:"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",object:n,graph:this._graph||""}),null!==t&&this._callback(null,{subject:n,predicate:a,object:t,graph:this._graph||""}),l},_readPunctuation:function(e){var t,n=this._subject,r=this._graph;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);this._graph=null;case".":this._subject=null,t=this._readInTopContext;break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;case"IRI":if(this._supportsQuads&&null===this._graph){r=null===this._base||s.test(e.value)?e.value:this._resolveIRI(e),n=this._subject,t=this._readQuadPunctuation;break}case"prefixed":if(this._supportsQuads&&null===this._graph){var i=this._prefixes[e.prefix];if(void 0===i)return this._error('Undefined prefix "'+e.prefix+':"',e);r=i+e.value,t=this._readQuadPunctuation;break}default:return this._error('Expected punctuation to follow "'+this._object+'"',e)}return null!==n&&this._callback(null,{subject:n,predicate:this._predicate,object:this._object,graph:r||""}),t},_readBlankNodePunctuation:function(e){var t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error('Expected punctuation to follow "'+this._object+'"',e)}return this._callback(null,{subject:this._subject,predicate:this._predicate,object:this._object,graph:this._graph||""}),t},_readQuadPunctuation:function(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext},_readPrefix:function(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)},_readPrefixIRI:function(e){return"IRI"!==e.type?this._error('Expected IRI to follow prefix "'+this._prefix+':"',e):(t=null===this._base||s.test(e.value)?e.value:this._resolveIRI(e),this._prefixes[this._prefix]=t,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation);var t},_readBaseIRI:function(e){if("IRI"!==e.type)return this._error("Expected IRI to follow base declaration",e);try{this._setBase(null===this._base||s.test(e.value)?e.value:this._resolveIRI(e))}catch(t){this._error(t.message,e)}return this._readDeclarationPunctuation},_readNamedGraphLabel:function(e){switch(e.type){case"IRI":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}},_readNamedGraphBlankLabel:function(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject="_:b"+f++,this._readGraph)},_readDeclarationPunctuation:function(e){return this._sparqlStyle?this._readInTopContext(e):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext},_getTripleEndReader:function(){var e=this._tripleStack;if(0===e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem}},_error:function(e,t){this._callback(new Error(e+" at line "+t.line+"."))},_resolveIRI:function(e){var t=e.value;switch(t[0]){case void 0:return this._base;case"#":return this._base+t;case"?":return this._base.replace(/(?:\?.*)?$/,t);case"/":return("/"===t[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(t);default:return this._removeDotSegments(this._basePath+t)}},_removeDotSegments:function(e){if(!l.test(e))return e;for(var t="",n=e.length,r=-1,i=-1,o=0,a="/";r=i&&(t=t.substr(0,o)),"/"!==a)return t+"/"+e.substr(r+1);o=r+1}}}a=e[++r]}return t+e.substring(o)},parse:function(e,t,n){this._readCallback=this._readInTopContext,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix||"_:b"+c+++"_","function"==typeof e&&(n=t,t=e,e=null),this._callback=t||p,this._prefixCallback=n||p;var r=this;this._lexer.tokenize(e,function(e,t){null!==e?(r._callback(e),r._callback=p):void 0!==r._readCallback&&(r._readCallback=r._readCallback(t))}),e||(this.addChunk=this._lexer.addChunk,this.end=this._lexer.end)}},e.exports=h},function(e,t){var n={isIRI:function(e){if(!e)return e;var t=e[0];return'"'!==t&&"_"!==t},isLiteral:function(e){return e&&'"'===e[0]},isBlank:function(e){return e&&"_:"===e.substr(0,2)},getLiteralValue:function(e){var t=/^"([^]*)"/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]},getLiteralType:function(e){var t=/^"[^]*"(?:\^\^([^"]+)|(@)[^@"]+)?$/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]||(t[2]?"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString":"http://www.w3.org/2001/XMLSchema#string")},getLiteralLanguage:function(e){var t=/^"[^]*"(?:@([^@"]+)|\^\^[^"]+)?$/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]?t[1].toLowerCase():""},isPrefixedName:function(e){return e&&/^[^:\/"']*:[^:\/"']+$/.test(e)},expandPrefixedName:function(e,t){var n,r,i,o=/(?:^|"\^\^)([^:\/#"'\^_]*):[^\/]*$/.exec(e);return o&&(r=t[n=o[1]],i=o.index),void 0===r?e:0===i?r+e.substr(n.length+1):e.substr(0,i+3)+r+e.substr(i+n.length+4)},createIRI:function(e){return e&&'"'===e[0]?n.getLiteralValue(e):e},createLiteral:function(e,t){if(!t)switch(typeof e){case"boolean":t="http://www.w3.org/2001/XMLSchema#boolean";break;case"number":if(isFinite(e)){t=e%1==0?"http://www.w3.org/2001/XMLSchema#integer":"http://www.w3.org/2001/XMLSchema#decimal";break}default:return'"'+e+'"'}return'"'+e+(/^[a-z]+(-[a-z0-9]+)*$/i.test(t)?'"@'+t.toLowerCase():'"^^'+t)}};function r(e,t){for(var r in n)t?e.prototype[r]=i(n[r]):e[r]=n[r];return e}function i(e){return function(t){return e(this,t)}}e.exports=r(r)},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function i(e){return"object"==typeof e&&null!==e}function o(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,a,s,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(o(n=this._events[e]))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(i(n))for(s=Array.prototype.slice.call(arguments,1),a=(l=n.slice()).length,u=0;u0&&this._events[e].length>a&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.once=function(e,t){if(!r(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},n.prototype.removeListener=function(e,t){var n,o,a,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(a=(n=this._events[e]).length,o=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){o=s;break}if(o<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){(t=e.exports=n(49)).Stream=t,t.Readable=t,t.Writable=n(34),t.Duplex=n(12),t.Transform=n(55),t.PassThrough=n(76)},function(e,t,n){"use strict";(function(t,r,i){var o=n(21);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(void 0),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=v;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:o.nextTick;v.WritableState=y;var l=n(17);l.inherits=n(11);var c,f={deprecate:n(75)},h=n(51),p=n(22).Buffer,d=i.Uint8Array||function(){},g=n(53);function m(){}function y(e,t){s=s||n(12);var r=t instanceof s;this.objectMode=!!(e=e||{}).objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,l=e.writableHighWaterMark;this.highWaterMark=i||0===i?i:r&&(l||0===l)?l:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===e.decodeStrings),this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(o.nextTick(i,r),o.nextTick(E,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),E(e,t))}(e,n,r,t,i);else{var a=x(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||_(e,n),r?u(w,e,n,a,i):w(e,n,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function v(e){if(s=s||n(12),!(c.call(v,this)||this instanceof s))return new v(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),h.call(this)}function b(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function w(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),E(e,t)}function _(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=new Array(t.bufferedRequestCount),i=t.corkedRequestsFree;i.entry=n;for(var o=0,s=!0;n;)r[o]=n,n.isBuf||(s=!1),n=n.next,o+=1;r.allBuffers=s,b(e,t,!0,t.length,r,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk;if(b(e,t,!1,t.objectMode?1:u.length,u,n.encoding,n.callback),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function S(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),E(e,t)})}function E(e,t){var n=x(t);return n&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(S,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}l.inherits(v,h),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===v&&e&&e._writableState instanceof y}})):c=function(e){return e instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(e,t,n){var r,i=this._writableState,a=!1,s=!i.objectMode&&(p.isBuffer(r=e)||r instanceof d);return s&&!p.isBuffer(e)&&(e=function(e){return p.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=m),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),o.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var i=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(r,a),i=!1),i}(this,i,e,n))&&(i.pendingcb++,a=function(e,t,n,r,i,o){if(!n){var a=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=p.from(t,i)),t}(t,r);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,E(e,t),n&&(t.finished?o.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),v.prototype.destroy=g.destroy,v.prototype._undestroy=g.undestroy,v.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(8),n(16).setImmediate,n(6))},function(e,t){var n=/^"([^]*)"(?:\^\^(.+)|@([\-a-z]+))?$/i,r=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,i=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,o={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};function a(e,t){if(!(this instanceof a))return new a(e,t);if(e&&"function"!=typeof e.write&&(t=e,e=null),t=t||{},e)this._outputStream=e,this._endStream=void 0===t.end||!!t.end;else{var n="";this._outputStream={write:function(e,t,r){n+=e,r&&r()},end:function(e){e&&e(null,n)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?this._writeTriple=this._writeTripleLine:(this._graph="",this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes))}function s(e){var t=o[e];return void 0===t&&(1===e.length?(t=e.charCodeAt(0).toString(16),t="\\u0000".substr(0,6-t.length)+t):(t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16),t="\\U00000000".substr(0,10-t.length)+t)),t}a.prototype={_write:function(e,t){this._outputStream.write(e,"utf8",t)},_writeTriple:function(e,t,n,r,i){try{this._graph!==r&&(this._write((null===this._subject?"":this._graph?"\n}\n":".\n")+(r?this._encodeIriOrBlankNode(r)+" {\n":"")),this._subject=null,this._graph="["!==r[0]?r:"]"),this._write(this._subject===e?this._predicate===t?", "+this._encodeObject(n):";\n "+this._encodePredicate(this._predicate=t)+" "+this._encodeObject(n):(null===this._subject?"":".\n")+this._encodeSubject(this._subject=e)+" "+this._encodePredicate(this._predicate=t)+" "+this._encodeObject(n),i)}catch(e){i&&i(e)}},_writeTripleLine:function(e,t,n,r,i){delete this._prefixMatch;try{this._write(this._encodeIriOrBlankNode(e)+" "+this._encodeIriOrBlankNode(t)+" "+this._encodeObject(n)+(r?" "+this._encodeIriOrBlankNode(r)+".\n":".\n"),i)}catch(e){i&&i(e)}},_encodeIriOrBlankNode:function(e){var t=e[0];if("["===t||"("===t||"_"===t&&":"===e[1])return e;r.test(e)&&(e=e.replace(i,s));var n=this._prefixRegex.exec(e);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:e:"<"+e+">"},_encodeLiteral:function(e,t,n){return r.test(e)&&(e=e.replace(i,s)),n?'"'+e+'"@'+n:t?'"'+e+'"^^'+this._encodeIriOrBlankNode(t):'"'+e+'"'},_encodeSubject:function(e){if('"'===e[0])throw new Error("A literal as subject is not allowed: "+e);return"["===e[0]&&(this._subject="]"),this._encodeIriOrBlankNode(e)},_encodePredicate:function(e){if('"'===e[0])throw new Error("A literal as predicate is not allowed: "+e);return"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===e?"a":this._encodeIriOrBlankNode(e)},_encodeObject:function(e){if('"'!==e[0])return this._encodeIriOrBlankNode(e);var t=n.exec(e);if(!t)throw new Error("Invalid literal: "+e);return this._encodeLiteral(t[1],t[2],t[3])},_blockedWrite:function(){throw new Error("Cannot write because the writer has been closed.")},addTriple:function(e,t,n,r,i){void 0===n?this._writeTriple(e.subject,e.predicate,e.object,e.graph||"",t):"string"!=typeof r?this._writeTriple(e,t,n,"",r):this._writeTriple(e,t,n,r,i)},addTriples:function(e){for(var t=0;t.\n"))}if(r){var a="",s="";for(var u in n)a+=a?"|"+u:u,s+=(s?"|":"")+n[u];a=a.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp("^(?:"+s+")[^/]*$|^("+a+")([a-zA-Z][\\-_a-zA-Z0-9]*)$")}this._write(r?"\n":"",t)},blank:function(e,t){var n,r,i=e;switch(void 0===e?i=[]:"string"==typeof e?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),r=i.length){case 0:return"[]";case 1:if("["!==(n=i[0]).object[0])return"[ "+this._encodePredicate(n.predicate)+" "+this._encodeObject(n.object)+" ]";default:for(var o="[",a=0;a0&&a.add(n.resource,k.dc("title"),a.literal(s[0].textContent),n.resource);for(var u=this.dom.getElementsByTagName("link"),l=u.length-1;l>=0;l--)o=!1,(i=u[l].getAttribute("rel"))||(i=u[l].getAttribute("rev"),o=!0),i&&e.linkData(n.original,i,u[l].getAttribute("href"),n.resource,o);for(var c=this.dom.getElementsByTagName("script"),f=0;f]+\?>/))return e.addStatus(n.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new O(this.response).parse(e,t,n,r);if(t.match(/.*/))return e.addStatus(n.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new O(this.response).parse(e,t,n,r);if(t.match(/[^(/))return e.addStatus(n.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new O(this.response).parse(e,t,n,r);var o=new RegExp("([\\s\\S]+?)","im").exec(t);return o&&i.add(n.resource,k.dc("title"),i.literal(o[1]),n.resource),i.add(n.resource,k.rdf("type"),k.link("WebPage"),e.appNode),e.addStatus(n.req,"non-XML HTML document, not parsed for data."),e.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"HTMLHandler"}},{key:"register",value:function(e){e.mediatypes["text/html"]={q:.9}}}]),t}();P.pattern=new RegExp("text/html");var A=function(e){function t(){return l(this,t),a(this,s(t).apply(this,arguments))}return u(t,C),o(t,[{key:"parse",value:function(e,t,n,r){return t.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)?(e.addStatus(n.req,"Warning: "+n.resource+" has an XML declaration. We'll assume it's XML but its content-type wasn't XML.\n"),new I(this.response).parse(e,t,n,r)):t.slice(0,500).match(/xmlns:/)?(e.addStatus(n.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new I(this.response).parse(e,t,n,r)):(e.addStatus(n.req,"Plain text document, no known RDF semantics."),e.doneFetch(n,this.response))}}],[{key:"toString",value:function(){return"TextHandler"}},{key:"register",value:function(e){e.mediatypes["text/plain"]={q:.5}}}]),t}();A.pattern=new RegExp("text/plain");var N=function(e){function t(){return l(this,t),a(this,s(t).apply(this,arguments))}return u(t,C),o(t,[{key:"parse",value:function(e,t,n,r){var i=e.store,o=h(i,i,n.original.uri,n.original.uri,null,null,"",null);try{o.loadBuf(t)}catch(t){return e.failFetch(n,"Error trying to parse "+n.resource+" as Notation3:\n"+t,"parse_error",r)}return e.addStatus(n.req,"N3 parsed: "+o.statementCount+" triples in "+o.lines+" lines."),e.store.add(n.original,k.rdf("type"),k.link("RDFDocument"),e.appNode),e.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"N3Handler"}},{key:"register",value:function(e){e.mediatypes["text/n3"]={q:"1.0"},e.mediatypes["text/turtle"]={q:1}}}]),t}();N.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");var R={RDFXMLHandler:T,XHTMLHandler:O,XMLHandler:I,HTMLHandler:P,TextHandler:A,N3Handler:N},j=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(l(this,e),this.store=t||new c,this.timeout=r.timeout||3e4,this._fetch=r.fetch||x,!this._fetch)throw new Error("No _fetch function availble for Fetcher");this.appNode=this.store.bnode(),this.store.fetcher=this,this.requested={},this.timeouts={},this.redirectedTo={},this.fetchQueue={},this.fetchCallbacks={},this.nonexistent={},this.lookedUp={},this.handlers=[],this.mediatypes={"image/*":{q:.9},"*/*":{q:.1}},b.callbackify(this,["request","fail","refresh","retract","done"]),Object.keys(R).map(function(e){return n.addHandler(R[e])})}return o(e,[{key:"load",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e instanceof Array)return Promise.all(e.map(function(e){return t.load(e,Object.assign({},n))}));var r=e.uri||e;return r=r.split("#")[0],n=this.initFetchOptions(r,n),this.pendingFetchPromise(r,n.baseURI,n)}},{key:"pendingFetchPromise",value:function(e,t,n){var r,i=this;return!n.force&&this.fetchQueue[t]?r=this.fetchQueue[t]:(r=Promise.race([this.setRequestTimeout(e,n),this.fetchUri(e,n)]),this.fetchQueue[t]=r,this.cleanupFetchRequest(t,n,this.timeout)),r.then(function(t){return e in i.timeouts&&(i.timeouts[e].forEach(clearTimeout),delete i.timeouts[e]),t})}},{key:"cleanupFetchRequest",value:function(e,t,n){var r=this;this.timeouts[e]=(this.timeouts[e]||[]).concat(setTimeout(function(){r.isPending(e)||delete r.fetchQueue[e]},n))}},{key:"initFetchOptions",value:function(t,n){var r=this.store;!n.method||"GET"===n.method.toUpperCase()||(n.force=!0),n.resource=r.sym(t),n.baseURI=n.baseURI||t,n.original=r.sym(n.baseURI),n.req=r.bnode(),n.headers=n.headers||{},n.contentType&&(n.headers["content-type"]=n.contentType),n.force&&(n.cache="no-cache");var i=this.acceptString();n.headers.accept=i;var o=e.offlineOverride(t);n.requestedURI=o,e.withCredentials(o,n)&&(n.credentials="include");var a=e.proxyIfNecessary(o);return o!==a&&(n.proxyUsed=!0),n.actualProxyURI=a,n}},{key:"fetchUri",value:function(t,n){var r=this;if(!t)return Promise.reject(new Error("Cannot fetch an empty uri"));if(e.unsupportedProtocol(t))return this.failFetch(n,"fetcher: Unsupported protocol","unsupported_protocol");var i=this.getState(t);if(n.force)delete this.nonexistent[t];else{if("fetched"===i)return Promise.resolve(this.doneFetch(n,{status:200,ok:!0,statusText:"Already loaded into quadstore."}));if("failed"===i&&404===this.requested[t]){var o="Previously failed: "+this.requested[t];return this.failFetch(n,o,this.requested[t],{url:t,status:this.requested[t],statusText:o,responseText:o,headers:{},ok:!1,body:null,bodyUsed:!1,size:0,timeout:0})}}this.fireCallbacks("request",[t]),this.requested[t]=!0,n.noMeta||this.saveRequestMetadata(t,n);var a=n.actualProxyURI;return this._fetch(a,n).then(function(e){return r.handleResponse(e,t,n)},function(e){var t={url:a,status:999,statusText:(e.name||"network failure")+": "+(e.errno||e.code||e.type),responseText:e.message,headers:{},ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return console.log("Fetcher: <"+a+"> Non-HTTP fetch error: "+e),r.failFetch(n,"fetch failed: "+e,999,t)})}},{key:"nowOrWhenFetched",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e=e.uri||e,"function"==typeof t?n=t:void 0===t||(t instanceof p?r.referringTerm=t:r=t),this.load(e,r).then(function(t){if(n)if(t)if(t.ok)n(!0,"OK",t);else{console.log("@@@ fetcher.js Should not take this path !!!!!!!!!!!!");var r="HTTP error: Status "+t.status+" ("+t.statusText+")";t.responseText&&(r+=" "+t.responseText),console.log(r+" fetching "+e),n(!1,r,t)}else{var i="@@ nowOrWhenFetched: no response object!";console.log(i),n(!1,i)}},function(t){var r=t.message||t.statusText;r="Failed to load <"+e+"> "+r,console.log(r),t.response&&t.response.status&&(r+=" status: "+t.response.status),n(!1,r,t.response)})}},{key:"addStatus",value:function(e,t){var n=new Date;t="["+n.getHours()+":"+n.getMinutes()+":"+n.getSeconds()+"."+n.getMilliseconds()+"] "+t;var r=this.store,i=r.the(e,k.link("status"));i&&i.append?i.append(r.literal(t)):f.warn("web.js: No list to add to: "+i+","+t)}},{key:"failFetch",value:function(e,t,n,r){this.addStatus(e.req,t),e.noMeta||this.store.add(e.original,k.link("error"),t);var i=(e.method||"GET").toUpperCase();("GET"===i||"HEAD"===i)&&(e.resource.sameTerm(e.original)?console.log("@@ Recording "+i+" failure for "+e.original+": "+n):console.log("@@ Recording failure "+i+" original "+e.original+"( as "+e.resource+") : "+n),this.requested[v.docpart(e.original.uri)]=n,this.fireCallbacks("fail",[e.original.uri,t]));var o=new Error("Fetcher: "+t);return o.status=n,o.statusText=t,o.response=r,Promise.reject(o)}},{key:"linkData",value:function(e,t,n,r,i){if(n){var o,a=this.store,s=a.sym(v.join(n,e.uri));if("alternate"===t||"seeAlso"===t||"meta"===t||"describedby"===t){if(s.uri===e.uri)return;o=k.rdfs("seeAlso")}else o=a.sym("type"===t?"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":v.join(encodeURIComponent(t),"http://www.iana.org/assignments/link-relations/"));i?a.add(s,o,e,r):a.add(e,o,s,r)}}},{key:"parseLinkHeader",value:function(e,t,n){if(e)for(var r=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,i=e.match(/<[^>]*>\s*(\s*;\s*[^()<>@,;:"\/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g),o=0;o"),s=a[0].substring(1),u=a[1].match(r),l=0;l1&&void 0!==arguments[1]?arguments[1]:{},n=new p(e=e.uri||e).doc();return t.contentType=t.contentType||"text/turtle",t.data=w(n,this.store,n.uri,t.contentType),this.webOperation("PUT",e,t)}},{key:"webCopy",value:function(e,t,n){var r=this;return this.webOperation("GET",e).then(function(e){return r.webOperation("PUT",t,{data:e.responseText,contentType:n})})}},{key:"delete",value:function(e,t){var n=this;return this.webOperation("DELETE",e,t).then(function(t){return n.requested[e]=404,n.nonexistent[e]=!0,n.unload(n.store.sym(e)),t})}},{key:"createContainer",value:function(e,t,n){var r={"content-type":"text/turtle",link:k.ldp("BasicContainer")+'; rel="type"'};t&&(r.slug=t);var i={headers:r};return n&&(i.body=n),this.webOperation("POST",e,i)}},{key:"webOperation",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n=n.uri||n,r.method=t,r.body=r.data||r.body,r.force=!0;var i=this;if(r.body&&!r.contentType)throw new Error("Web operation sending data must have a defined contentType.");return r.contentType&&(r.headers=r.headers||{},r.headers["content-type"]=r.contentType),e.withCredentials(n,r)&&(r.credentials="include"),new Promise(function(e,o){i._fetch(n,r).then(function(r){if(r.ok)r.body?r.text().then(function(t){r.responseText=t,e(r)}):e(r);else{var i="Web error: "+r.status;r.statusText&&(i+=" ("+r.statusText+")"),i+=" on "+t+" of <"+n+">",r.responseText&&(i+=": "+r.responseText);var a=new Error(i);a.response=r,o(a)}},function(e){o(new Error("Fetch error for "+t+" of <"+n+">:"+e))})})}},{key:"lookUpThing",value:function(e,t){var n=this,r=this.store.uris(e);return(r=r.map(function(e){return v.docpart(e)})).forEach(function(e){n.lookedUp[e]=!0}),this.load(r,{referringTerm:t})}},{key:"getHeader",value:function(e,t){for(var n=this.store,r=n.each(void 0,k.link("requestedURI"),e.uri),i=0;i=400)return 404===e.status&&(this.nonexistent[n.original.uri]=!0,this.nonexistent[t]=!0),this.saveErrorResponse(e,s).then(function(){return r.failFetch(n,n.resource+" "+e.statusText,e.status,e)});var c=null,f=null;if(l&&(f=v.join(l,t))!==t&&(c=f),200===e.status){this.addType(k.link("Document"),a,i,t),c&&this.addType(k.link("Document"),a,i,c),n.clearPreviousData&&i.removeDocument(n.resource);var h=u.includes("image/")||u.includes("application/pdf");u&&h&&(this.addType(i.sym("http://purl.org/dc/terms/Image"),a,i,t),c&&this.addType(i.sym("http://purl.org/dc/terms/Image"),a,i,c))}if(l){if(!n.force&&c&&"done"===this.requested[f])return this.doneFetch(n,e);this.requested[f]=!0}this.parseLinkHeader(o.get("link"),n.original,a);var p=this.handlerForContentType(u,e);return p?e.text().then(function(t){return e.responseText=t,p.parse(r,t,n,e)}):(this.addStatus(a,"Fetch over. No data handled."),this.doneFetch(n,e))}},{key:"saveErrorResponse",value:function(e,t){var n=this.store;return e.text().then(function(e){e.length>10&&n.add(t,k.http("content"),n.literal(e),t)})}},{key:"handlerForContentType",value:function(e,t){if(!e)return null;var n=this.handlers.find(function(t){return e.match(t.pattern)});return n?new n(t):null}},{key:"guessContentType",value:function(e){return E[e.split(".").pop()]}},{key:"normalizedContentType",value:function(e,t){if(e.forceContentType)return e.forceContentType;var n=t.get("content-type");if(!n||n.includes("application/octet-stream")){var r=this.guessContentType(e.resource.uri);if(r)return r}var i=v.protocol(e.resource.uri);return!n&&["file","chrome"].includes(i)?"text/xml":n}},{key:"redirectToProxy",value:function(e,t){var n=this;this.addStatus(t.req,"BLOCKED -> Cross-site Proxy to <"+e+">"),t.proxyUsed=!0;var r=this.store,i=t.req;t.noMeta||(r.add(i,k.link("redirectedTo"),r.sym(e),i),this.addStatus(i,"redirected to new request")),this.requested[t.resource.uri]="redirected",this.redirectedTo[t.resource.uri]=e;var o=Object.assign({},t);return o.baseURI=t.resource.uri,this.fetchUri(e,o).then(function(e){return o.noMeta||r.add(i,k.link("redirectedRequest"),o.req,n.appNode),e})}},{key:"setRequestTimeout",value:function(e,t){var n=this;return new Promise(function(r){n.timeouts[e]=(n.timeouts[e]||[]).concat(setTimeout(function(){!n.isPending(e)||t.retriedWithNoCredentials||t.proxyUsed||r(n.failFetch(t,"Request to ".concat(e," timed out"),"timeout"))},n.timeout))})}},{key:"addFetchCallback",value:function(e,t){this.fetchCallbacks[e]?this.fetchCallbacks[e].push(t):this.fetchCallbacks[e]=[t]}},{key:"acceptString",value:function(){var e="";for(var t in this.mediatypes)for(var n in""!==e&&(e+=", "),e+=t,this.mediatypes[t])e+=";"+n+"="+this.mediatypes[t][n];return e}}],[{key:"crossSiteProxy",value:function(t){return e.crossSiteProxyTemplate?e.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):void 0}},{key:"offlineOverride",value:function(e){var t,n=e;return"undefined"!=typeof window&&window.panes&&(t=window.panes.UI)&&t.preferences&&t.preferences.get("offlineModeUsingLocalhost")&&"http://"===n.slice(0,7)&&"localhost/"!==n.slice(7,17)&&(n="http://localhost/"+n.slice(7),f.warn("Localhost kludge for offline use: actually getting <"+n+">")),n}},{key:"proxyIfNecessary",value:function(t){var n;if("undefined"!=typeof window&&window.panes&&(n=window.panes.UI)&&n.isExtension)return t;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){var r=function e(t,n){var r=n[t.shift()];return r?"string"==typeof r?r+t.join("/"):t?e(t,r):null:null}(t.split("/").slice(2),$SolidTestEnvironment.localSiteMap);if(r)return r}return e.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===t.slice(0,5)?e.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):t}},{key:"unsupportedProtocol",value:function(e){var t=v.protocol(e);return"tel"===t||"mailto"===t||"urn"===t}},{key:"withCredentials",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.startsWith("https:");return void 0!==t.withCredentials&&(n=t.withCredentials),n}}]),e}();e.exports=j,e.exports.HANDLERS=R,e.exports.CONTENT_TYPE_BY_EXT=E},function(e,t,n){"use strict";e.exports=function(e,t,n,o,a,s){n=n||e.uri,s=s||{},o=o||"text/turtle";try{var u=i(t);s.flags&&u.setFlags(s.flags);var l,c=t.statementsMatching(void 0,void 0,void 0,e);switch(u.suggestNamespaces(t.namespaces),u.setBase(n),o){case"application/rdf+xml":return f(null,u.statementsToXML(c));case"text/n3":case"application/n3":return f(null,u.statementsToN3(c));case"text/turtle":case"application/x-turtle":return u.setFlags("si"),f(null,u.statementsToN3(c));case"application/n-triples":return u.setFlags("deinprstux"),f(null,u.statementsToNTriples(c));case"application/ld+json":u.setFlags("deinprstux"),l=u.statementsToNTriples(c),r.convertToJson(l,a);break;case"application/n-quads":case"application/nquads":return u.setFlags("deinprstux q"),f(null,u.statementsToNTriples(c));default:throw new Error("Serialize: Content-type "+o+" not supported for data write.")}}catch(e){if(a)return a(e);throw e}function f(e,t){return a?void a(e,t):t}};var r=n(42),i=n(38)},function(e,t,n){"use strict";var r=n(2),i=n(9),o=n(4),a=n(7),s=n(41),u=function(){var e=function(e){this.flags="",this.base=null,this.prefixes=[],this.namespaces=[],this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.suggestPrefix("xml","reserved:reservedForFutureUse"),this.namespacesUsed=[],this.keywords=["a"],this.prefixchars="abcdefghijklmnopqustuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",this.incoming=null,this.formulas=[],this.store=e};return e.prototype.setBase=function(e){return this.base=e,this},e.prototype.setFlags=function(e){return this.flags=e||"",this},e.prototype.toStr=function(e){var t=e.toNT();return"Graph"===e.termType&&(this.formulas[t]=e),t},e.prototype.fromStr=function(e){if("{"===e[0]){var t=this.formulas[e];return t||console.log("No formula object for "+e),t}return this.store.fromNT(e)},e.prototype.suggestPrefix=function(e,t){"default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t&&(e in this.namespaces||t in this.prefixes||(this.prefixes[t]=e,this.namespaces[e]=t))},e.prototype.suggestNamespaces=function(e){for(var t in e)return this.suggestPrefix(t,e[t]),this},e.prototype.checkIntegrity=function(){var e,t;for(e in this.namespaces)if(this.prefixes[this.namespaces[e]]!==e)throw new Error("Serializer integity error 1: "+e+", "+this.namespaces[e]+", "+this.prefixes[this.namespaces[e]]+"!");for(t in this.prefixes)if(this.namespaces[this.prefixes[t]]!==t)throw new Error("Serializer integity error 2: "+t+", "+this.prefixs[t]+", "+this.namespaces[this.prefixes[t]]+"!")},e.prototype.makeUpPrefix=function(t){var n=t,r=(function(n){return!!e.prototype.validPrefix.test(n)&&"ns"!==n&&!(n in this.namespaces)&&(this.prefixes[t]=n,this.namespaces[n]=t,n)}).bind(this);"#/".indexOf(n[n.length-1])>=0&&(n=n.slice(0,-1));var i=n.lastIndexOf("/");i>=0&&(n=n.slice(i+1));for(var o=0;o?@[\\]^`{|}~")+":",e.prototype.explicitURI=function(e){return"<"+(e=this.flags.indexOf("r")<0&&this.base?o.refTo(this.base,e):this.flags.indexOf("u")>=0?function(e){for(var t,n="",r=0;r65535?"\\U"+("00000000"+t.toString(16)).slice(-8):t>126?"\\u"+("0000"+t.toString(16)).slice(-4):e[r];return n}(e):encodeURI(e))+">"},e.prototype.statementsToNTriples=function(e){var t=e.slice();t.sort();for(var n="",r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",o=this,a=this.store,s=function e(t){if("Collection"!==t.termType)return o.atomicTermToN3(t);for(var s=t.elements,u=a.sym(r+"nill"),l=s.length-1;l>=0;l--){var c=new i;n+=e(c)+" "+e(a.sym(r+"first"))+" "+e(s[l])+".\n",n+=e(c)+" "+e(a.sym(r+"rest"))+" "+e(u)+".\n",u=c}return o.atomicTermToN3(u)},u=0;u=0&&(c+=s(l.why)+" "),n+=c+=".\n"}return n},e.prototype.statementsToN3=function(t){var n=this.store,r={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};t.sort(function(e,t){return a.heavyCompareSPO(e,t,n,r)}),this.base&&!this.defaultNamespace&&(this.defaultNamespace=this.base+"#");var i={};this.flags.indexOf("s")<0&&(i["http://www.w3.org/2002/07/owl#sameAs"]="="),this.flags.indexOf("t")<0&&(i["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]="a"),this.flags.indexOf("i")<0&&(i["http://www.w3.org/2000/10/swap/log#implies"]="=>");var o=function(e){for(var t="",n=0;n=0){r=r.slice(0,-1)+u+"\n",i+=1;continue}if(i<4*n+4||i+u.length+1<80&&";.".indexOf(r[r.length-2])<0)r=r.slice(0,-1)+" "+u+"\n",i+=u.length+1;else{var f=o(4*n)+u;r+=f+"\n",i=f.length,n<0&&(r+="\n",i=1e5)}}}return r}(d)},e.prototype.atomicTermToN3=function(e,t){switch(e.termType){case"BlankNode":case"Variable":return e.toNT();case"Literal":var n=e.value;if("string"!=typeof n)throw new TypeError("Value of RDF literal node must be a string");if(e.datatype&&this.flags.indexOf("x")<0)switch(e.datatype.uri){case"http://www.w3.org/2001/XMLSchema#integer":return n;case"http://www.w3.org/2001/XMLSchema#decimal":return n.indexOf(".")<0&&(n+=".0"),n;case"http://www.w3.org/2001/XMLSchema#double":return n.indexOf(".")<0&&(n+=".0"),n.indexOf("e")<0&&(n+="e0"),n;case"http://www.w3.org/2001/XMLSchema#boolean":return"1"===e.value?"true":"false"}var r=this.stringToN3(e.value);return e.language?r+="@"+e.language:e.datatype.equals(s.string)||(r+="^^"+this.atomicTermToN3(e.datatype,t)),r;case"NamedNode":return this.symbolToN3(e);default:throw new Error("Internal: atomicTermToN3 cannot handle "+e+" of termType: "+e.termType)}},e.prototype.validPrefix=new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/),e.prototype.forbidden1=new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm),e.prototype.forbidden3=new RegExp(/[\\"\b\f\r\v\u0080-\uffff]/gm),e.prototype.stringToN3=function(t,n){n||(n="e");var r,i,o,a,s,u="";for(t.length>20&&'"'!==t.slice(-1)&&n.indexOf("n")<0&&(t.indexOf("\n")>0||t.indexOf('"')>0)?(a='"""',s=e.prototype.forbidden3):(a='"',s=e.prototype.forbidden1),r=0;r=0?u+="\\"+'bfrtvn\\"'[o]:n.indexOf("e")>=0?u+="\\u"+("000"+l.charCodeAt(0).toString(16).toLowerCase()).slice(-4):u+=l,r=i+1}return a+u+t.slice(r)+a},e.prototype.symbolToN3=function(t){var n=t.uri,r=n.indexOf("#");if(r<0&&this.flags.indexOf("/")<0&&(r=n.lastIndexOf("/")),r>=0&&this.flags.indexOf("p")<0&&(0===n.indexOf("http")||0===n.indexOf("ws")||0===n.indexOf("file"))){for(var i=!0,o=r+1;o=0){i=!1;break}if(i){var a=n.slice(r+1),s=n.slice(0,r+1);if(this.defaultNamespace&&this.defaultNamespace===s&&this.flags.indexOf("d")<0)return this.flags.indexOf("k")>=0&&this.keyords.indexOf(a)<0?a:":"+a;var u=this.prefixes[s];if(u||(u=this.makeUpPrefix(s)),u)return this.namespacesUsed[s]=!0,u+":"+a}}return this.explicitURI(n)},e.prototype.writeStore=function(e){var t=this.store,n=t.fetcher,r=n&&n.appNode,i=this.store.index[3];for(var o in i){var a=t.fromNT(o);r&&a.sameTerm(r)||e("\n"+this.atomicTermToN3(a)+" "+this.atomicTermToN3(t.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(t.statementsMatching(void 0,void 0,void 0,a))+" }.\n")}t.statementsMatching(void 0,t.sym("http://www.w3.org/2007/ont/link#requestedURI")).map(function(n){e("\n<"+n.object.value+"> log:metadata {\n");var r=t.statementsMatching(void 0,void 0,void 0,n.subject);e(this.statementsToN3(this.statementsToN3(r))),e("}.\n")});var s=[];r&&s.push(r);var u=[];s.map(function(e){u=u.concat(t.statementsMatching(void 0,void 0,void 0,e))}),e(this.statementsToN3(u))},e.prototype.statementsToXML=function(t){var n=[];n["http://www.w3.org/1999/02/22-rdf-syntax-ns#"]=!0;var i="http://www.w3.org/1999/02/22-rdf-syntax-ns#_",o=function(e){for(var t="",n=0;n',h(a.object,t),""]:["<"+o+' rdf:nodeID="'+a.object.toNT().slice(2)+'"/>']);break;case"NamedNode":l=l.concat(["<"+o+' rdf:resource="'+f(a.object)+'"/>']);break;case"Literal":l=l.concat(["<"+o+(a.object.datatype.equals(s.string)?"":' rdf:datatype="'+c(a.object.datatype.uri)+'"')+(a.object.language?' xml:lang="'+a.object.language+'"':"")+">"+c(a.object.value)+""]);break;case"Collection":l=l.concat(["<"+o+' rdf:parseType="Collection">',p(a.object,t),""]);break;default:throw new Error("Can't serialize object of type "+a.object.termType+" into XML")}}else n=a.object;var b=n?g(n):"rdf:Description",w="";return"BlankNode"===e.termType?t.incoming[e]&&1===t.incoming[e].length||(w=' rdf:nodeID="'+e.toNT().slice(2)+'"'):w=' rdf:about="'+f(e)+'"',["<"+b+w+">"].concat([l]).concat([""])}).bind(this);function p(e,t){for(var n=[],r=0;r',""]):n.concat(["<"+g(o.predicate)+' rdf:parseType="Resource">',d(o.object,t),""]);break;case"NamedNode":n=n.concat(["<"+g(o.predicate)+' rdf:resource="'+f(o.object)+'"/>']);break;case"Literal":n=n.concat(["<"+g(o.predicate)+(o.object.datatype.equals(s.string)?"":' rdf:datatype="'+c(o.object.datatype.value)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+c(o.object.value)+""]);break;case"Collection":n=n.concat(["<"+g(o.predicate)+' rdf:parseType="Collection">',p(o.object,t),""]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}return n}).bind(this),g=(function(t){var r=t.uri,i=r.indexOf("#");if(i<0&&this.flags.indexOf("/")<0&&(i=r.lastIndexOf("/")),i<0)throw new Error("Cannot make qname out of <"+r+">");for(var o=i+1;o=0)throw new Error('Invalid character "'+r[o]+'" cannot be in XML qname for URI: '+r);var a=r.slice(i+1),s=r.slice(0,i+1);if(this.defaultNamespace&&this.defaultNamespace===s&&this.flags.indexOf("d")<0)return a;var u=this.prefixes[s];return u||(u=this.makeUpPrefix(s)),n[s]=!0,u+":"+a}).bind(this),m=l(t),y=""],-1)},function(t){return new e(t)}}();e.exports=u},function(e,t,n){"use strict";function r(e,t){for(var n=0;n=0){var a=t.substring(0,o);if(""===a)return(i=n[""])?i+t.substring(o+1):null;if("_"===a)return"_:"+t.substring(o+1);if(e.NCNAME.test(a)&&(i=n[a]))return i+t.substring(o+1)}return null}},{key:"parseCURIEOrURI",value:function(e,t,n){return this.parseCURIE(e,t,n)||this.resolveAndNormalize(n,e)}},{key:"parsePredicate",value:function(e,t,n,r,i,o){if(""===e)return null;var a=this.parseTermOrCURIEOrAbsURI(e,t,o?null:n,r,i);return a&&0===a.indexOf("_:")?null:a}},{key:"parsePrefixMappings",value:function(e,t){for(var n=this.tokenize(e),r=null,i=0;i=0&&(e=e.substring(0,t)),n&&n.baseURIMap&&(e=n.baseURIMap(e)),e};for(i.push({current:t,context:this.push(null,o(t.baseURI))});i.length>0;){var a=i.shift();if(a.parent){if(a.context.parent&&a.context.parent.listMapping===a.listMapping)continue;for(var s in a.listMapping){var l=a.listMapping[s];if(0!==l.length){for(var f=[],h=0;h0?this.addTriple(d,r.spec,"http://www.w3.org/ns/rdfa#usesVocabulary",{type:e.objectURI,value:C=O}):C=this.vocabulary}for(var I=0;I0?M:null}var L,U,F=d.getAttributeNode("rel"),V=d.getAttributeNode("rev"),B=d.getAttributeNode("typeof"),z=d.getAttributeNode("property"),q=d.getAttributeNode("datatype"),H=this.inHTMLMode?d.getAttributeNode("datetime"):null,W=d.getAttributeNode("content"),$=d.getAttributeNode("about"),G=d.getAttributeNode("src"),J=d.getAttributeNode("resource"),K=d.getAttributeNode("href"),Q=d.getAttributeNode("inlist"),Y=[];if(F){U=this.tokenize(F.value);for(var Z=0;Z=0?t+=e.nodeName.split(":")[1]:t+=e.nodeName),t}).bind(this),u=!0;e.parent;){var l=e.element,c=l.attributes;if(l.nodeType===i||l.nodeType===o)e.parent.nodeType===e.NODE&&(e.addArc(t+"value"),e=this.buildFrame(e)),e.addLiteral(l.nodeValue);else if(s(l)!==t+"RDF")if(e.parent&&e.parent.collection&&(e.addCollectionArc(),(e=this.buildFrame(e,e.element)).parent.element=null),e.parent&&e.parent.nodeType&&e.parent.nodeType!==e.ARC){e.addArc(s(l)),this.reify&&(a=this.getAttributeNodeNS(l,t,"ID"))&&(e.rdfid=a.nodeValue,l.removeAttributeNode(a));var f=this.getAttributeNodeNS(l,t,"parseType"),h=this.getAttributeNodeNS(l,t,"datatype");if(h&&(e.datatype=h.nodeValue,l.removeAttributeNode(h)),f){var p=f.nodeValue;"Literal"===p?(e.datatype=t+"XMLLiteral",(e=this.buildFrame(e)).addLiteral(l.childNodes),u=!1):"Resource"===p?((e=this.buildFrame(e,e.element)).parent.element=null,e.addBNode()):"Collection"===p&&((e=this.buildFrame(e,e.element)).parent.element=null,e.addCollection()),l.removeAttributeNode(f)}if(0!==c.length){var d=this.getAttributeNodeNS(l,t,"resource"),g=this.getAttributeNodeNS(l,t,"nodeID");e=this.buildFrame(e),d?(e.addNode(d.nodeValue),l.removeAttributeNode(d)):g?(e.addBNode(g.nodeValue),l.removeAttributeNode(g)):e.addBNode();for(var m=c.length-1;m>=0;m--){var y=this.buildFrame(e);y.addArc(s(c[m])),s(c[m])===t+"type"?this.buildFrame(y).addNode(c[m].nodeValue):this.buildFrame(y).addLiteral(c[m].nodeValue)}}else 0===l.childNodes.length&&this.buildFrame(e).addLiteral("")}else{var v=this.getAttributeNodeNS(l,t,"about");if(a=this.getAttributeNodeNS(l,t,"ID"),v&&a)throw new Error("RDFParser: "+l.nodeName+" has both rdf:id and rdf:about. Halting. Only one of these properties may be specified on a node.");if(!v&&a)e.addNode("#"+a.nodeValue),l.removeAttributeNode(a);else if(null==v&&null==a){var b=this.getAttributeNodeNS(l,t,"nodeID");b?(e.addBNode(b.nodeValue),l.removeAttributeNode(b)):e.addBNode()}else e.addNode(v.nodeValue),l.removeAttributeNode(v);var w=this.getAttributeNodeNS(l,t,"type");t+"Description"!==s(l)&&(w={nodeValue:s(l)}),null!=w&&(this.store.add(e.node,this.store.sym(t+"type"),this.store.sym(r.join(w.nodeValue,e.base)),this.why),w.nodeName&&l.removeAttributeNode(w));for(var _=c.length-1;_>=0;_--)this.store.add(e.node,this.store.sym(s(c[_])),this.store.literal(c[_].nodeValue,e.lang),this.why)}for(l=e.element;e.parent;){for(var x=e;null==l;)l=(e=e.parent).element;var S=l.childNodes&&l.childNodes[e.lastChild];if(S&&u){if((S.nodeType===n||S.nodeType===i||S.nodeType===o)&&(S.nodeType!==i&&S.nodeType!==o||1===l.childNodes.length)){e.lastChild++,e=this.buildFrame(x,l.childNodes[e.lastChild-1]);break}e.lastChild++}else{if(e.terminateFrame(),!(e=e.parent))break;l=e.element,u=!0}}}},this.cleanParser=function(){this.bnodes={},this.why=null},this.buildFrame=function(e,t){var n=this.frameFactory(this,e,t);if(e&&(n.base=e.base,n.lang=e.lang),!t||t.nodeType===i||t.nodeType===o)return n;var a=t.attributes,s=t.getAttributeNode("xml:base");null!=s&&(n.base=s.nodeValue,t.removeAttribute("xml:base"));var u=t.getAttributeNode("xml:lang");null!=u&&(n.lang=u.nodeValue,t.removeAttribute("xml:lang"));for(var l=a.length-1;l>=0;l--)if("xml"===a[l].nodeName.substr(0,3)){if("xmlns:"===a[l].name.slice(0,6)){var c=a[l].nodeValue;this.base&&(c=r.join(c,this.base)),this.store.setPrefixForURI(a[l].name.slice(6),c)}t.removeAttributeNode(a[l])}return n}}},function(e,t,n){"use strict";var r=n(2),i=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)};i.boolean=new r("http://www.w3.org/2001/XMLSchema#boolean"),i.dateTime=new r("http://www.w3.org/2001/XMLSchema#dateTime"),i.decimal=new r("http://www.w3.org/2001/XMLSchema#decimal"),i.double=new r("http://www.w3.org/2001/XMLSchema#double"),i.integer=new r("http://www.w3.org/2001/XMLSchema#integer"),i.langString=new r("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),i.string=new r("http://www.w3.org/2001/XMLSchema#string"),e.exports=i},function(e,t,n){"use strict";e.exports.convertToJson=function(e,t){var n,a=o.Parser(),s=o.Writer({format:"N-Quads"});r.waterfall([function(t){a.parse(e,t)},function(e,t,n){null!==e&&s.addTriple(e),"function"==typeof n&&s.end(n)},function(e,t){try{i.fromRDF(e,{format:"application/nquads"},t)}catch(e){t(e)}},function(e,r){n=JSON.stringify(e),t(null,n)}],function(e,r){t(e,n)})},e.exports.convertToNQuads=function(e,t){var n,i=o.Parser(),a=o.Writer({format:"N-Quads"});r.waterfall([function(t){i.parse(e,t)},function(e,t,n){null!==e&&a.addTriple(e),"function"==typeof n&&a.end(n)},function(e,r){t(null,n=e)}],function(e,r){t(e,n)})};var r=n(65),i=n(43),o=n(45)},function(e,t,n){(function(r,i,o,a){var s;!function(){var u=void 0!==r&&r.versions&&r.versions.node,l=!u&&("undefined"!=typeof window||"undefined"!=typeof self);l&&void 0===i&&("undefined"!=typeof window?i=window:"undefined"!=typeof self?i=self:"undefined"!=typeof $&&(i=$));var c=function(e){function t(){}e.compact=function(t,n,r,i){return arguments.length<2?e.nextTick(function(){i(new TypeError("Could not compact, too few arguments."))}):("function"==typeof r&&(i=r,r={}),r=r||{},null===n?e.nextTick(function(){i(new T("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"}))}):null===t?e.nextTick(function(){i(null,null)}):("base"in r||(r.base="string"==typeof t?t:""),"compactArrays"in r||(r.compactArrays=!0),"graph"in r||(r.graph=!1),"skipExpansion"in r||(r.skipExpansion=!1),"documentLoader"in r||(r.documentLoader=e.loadDocument),"link"in r||(r.link=!1),r.link&&(r.skipExpansion=!0),void function(t,n,r){if(n.skipExpansion)return e.nextTick(function(){r(null,t)});e.expand(t,n,r)}(t,r,function(t,o){if(t)return i(new T("Could not expand input before compaction.","jsonld.CompactError",{cause:t}));var a=Y(r);e.processContext(a,n,r,function(e,t){if(e)return i(new T("Could not process context before compaction.","jsonld.CompactError",{cause:e}));var a;try{a=(new O).compact(t,null,o,r)}catch(e){return i(e)}!function(e,t,r,o){o.compactArrays&&!o.graph&&ee(t)?1===t.length?t=t[0]:0===t.length&&(t={}):o.graph&&X(t)&&(t=[t]),X(n)&&"@context"in n&&(n=n["@context"]),ee(n=he(n))||(n=[n]);var a=n;n=[];for(var s=0;s0)&&n.push(a[s]);var u=n.length>0;if(1===n.length&&(n=n[0]),ee(t)){var l=J(r,"@graph"),c=t;t={},u&&(t["@context"]=n),t[l]=c}else if(X(t)&&u)for(var f in c=t,t={"@context":n},c)t[f]=c[f];i(null,t,r)}(0,a,t,r)})})))},e.expand=function(t,n,r){if(arguments.length<1)return e.nextTick(function(){r(new TypeError("Could not expand, too few arguments."))});function i(e){"base"in n||(n.base=e.documentUrl||"");var t={document:he(e.document),remoteContext:{"@context":e.contextUrl}};if("expandContext"in n){var i=he(n.expandContext);t.expandContext="object"==typeof i&&"@context"in i?i:{"@context":i}}de(t,n,function(e,t){if(e)return r(e);var i;try{var o=new O,a=Y(n),s=t.document,u=t.remoteContext["@context"];t.expandContext&&(a=o.processContext(a,t.expandContext["@context"],n)),u&&(a=o.processContext(a,u,n)),X(i=o.expand(a,null,s,n,!1))&&"@graph"in i&&1===Object.keys(i).length?i=i["@graph"]:null===i&&(i=[]),ee(i)||(i=[i])}catch(e){return r(e)}r(null,i)})}"function"==typeof n&&(r=n,n={}),"documentLoader"in(n=n||{})||(n.documentLoader=e.loadDocument),"keepFreeFloatingNodes"in n||(n.keepFreeFloatingNodes=!1),e.nextTick(function(){if("string"!=typeof t)i({contextUrl:null,documentUrl:null,document:t});else{var e=function(e,t){if(e)return r(e);try{if(!t.document)throw new T("No remote document found at the given URL.","jsonld.NullRemoteDocument");"string"==typeof t.document&&(t.document=JSON.parse(t.document))}catch(e){return r(new T("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:t}))}i(t)},o=n.documentLoader(t,e);o&&"then"in o&&o.then(e.bind(null,null),e)}})},e.flatten=function(t,n,r,i){if(arguments.length<1)return e.nextTick(function(){i(new TypeError("Could not flatten, too few arguments."))});"function"==typeof r?(i=r,r={}):"function"==typeof n&&(i=n,n=null,r={}),"base"in(r=r||{})||(r.base="string"==typeof t?t:""),"documentLoader"in r||(r.documentLoader=e.loadDocument),e.expand(t,r,function(t,o){if(t)return i(new T("Could not expand input before flattening.","jsonld.FlattenError",{cause:t}));var a;try{a=(new O).flatten(o)}catch(e){return i(e)}if(null===n)return i(null,a);r.graph=!0,r.skipExpansion=!0,e.compact(a,n,r,function(e,t){if(e)return i(new T("Could not compact flattened output.","jsonld.FlattenError",{cause:e}));i(null,t)})})},e.frame=function(t,n,r,i){if(arguments.length<2)return e.nextTick(function(){i(new TypeError("Could not frame, too few arguments."))});function o(n){var o,a=n.document;a?(o=a["@context"],n.contextUrl?(o?ee(o)?o.push(n.contextUrl):o=[o,n.contextUrl]:o=n.contextUrl,a["@context"]=o):o=o||{}):o={},e.expand(t,r,function(t,n){if(t)return i(new T("Could not expand input before framing.","jsonld.FrameError",{cause:t}));var s=he(r);s.isFrame=!0,s.keepFreeFloatingNodes=!0,e.expand(a,s,function(t,r){if(t)return i(new T("Could not expand frame before framing.","jsonld.FrameError",{cause:t}));var a;try{a=(new O).frame(n,r,s)}catch(e){return i(e)}s.graph=!0,s.skipExpansion=!0,s.link={},e.compact(a,o,s,function(t,n,r){if(t)return i(new T("Could not compact framed output.","jsonld.FrameError",{cause:t}));var o=J(r,"@graph");s.link={},n[o]=function t(n,r,i){if(ee(r)){for(var o=[],a=0;a0&&"/"!==o.substr(-1)&&(o+="/"),o+=r.path),i.path=o}i.query=r.query}i.path=_e(i.path,!!i.authority);var a=i.protocol;return null!==i.authority&&(a+="//"+i.authority),a+=i.path,null!==i.query&&(a+="?"+i.query),null!==r.fragment&&(a+="#"+r.fragment),""===a&&(a="./"),a}(t,n)},e.documentLoader=function(t,n){var r=new T("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed"});return u?n(r,{contextUrl:null,documentUrl:t,document:null}):e.promisify(function(e){e(r)})},e.loadDocument=function(t,n){var r=e.documentLoader(t,n);r&&"then"in r&&r.then(n.bind(null,null),n)},e.promises=function(t){t=t||{};var r=Array.prototype.slice,o=e.promisify,a=t.api||{},s=t.version||"jsonld.js";"string"==typeof t.api&&(t.version||(s=t.api),a={}),a.expand=function(t){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");return o.apply(null,[e.expand].concat(r.call(arguments)))},a.compact=function(t,n){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");return o.apply(null,[function(t,n,r,i){"function"==typeof r&&(i=r,r={}),e.compact(t,n,r=r||{},function(e,t){i(e,t)})}].concat(r.call(arguments)))},a.flatten=function(t){if(arguments.length<1)throw new TypeError("Could not flatten, too few arguments.");return o.apply(null,[e.flatten].concat(r.call(arguments)))},a.frame=function(t,n){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");return o.apply(null,[e.frame].concat(r.call(arguments)))},a.fromRDF=function(t){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");return o.apply(null,[e.fromRDF].concat(r.call(arguments)))},a.toRDF=function(t){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");return o.apply(null,[e.toRDF].concat(r.call(arguments)))},a.normalize=function(t){if(arguments.length<1)throw new TypeError("Could not normalize, too few arguments.");return o.apply(null,[e.normalize].concat(r.call(arguments)))},"jsonld.js"===s&&(a.link=function(t,n){if(arguments.length<2)throw new TypeError("Could not link, too few arguments.");return o.apply(null,[e.link].concat(r.call(arguments)))},a.objectify=function(t){return o.apply(null,[e.objectify].concat(r.call(arguments)))},a.createNodeMap=function(t){return o.apply(null,[e.createNodeMap].concat(r.call(arguments)))},a.merge=function(t){return o.apply(null,[e.merge].concat(r.call(arguments)))});try{e.Promise=i.Promise||n(44).Promise}catch(e){var u=function(){throw new Error("Unable to find a Promise implementation.")};for(var l in a)a[l]=u}return a},e.promisify=function(t){if(!e.Promise)try{e.Promise=i.Promise||n(44).Promise}catch(e){throw new Error("Unable to find a Promise implementation.")}var r=Array.prototype.slice.call(arguments,1);return new e.Promise(function(e,n){t.apply(null,r.concat(function(t,r){t?n(t):e(r)}))})},e.promises({api:e.promises}),(t.prototype=e.promises({version:"json-ld-1.0"})).toString=function(){return this instanceof t?"[object JsonLdProcessor]":"[object JsonLdProcessorPrototype]"},e.JsonLdProcessor=t;var s=!!Object.defineProperty;if(s)try{Object.defineProperty({},"x",{})}catch(e){s=!1}s&&(Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t})),l&&void 0===i.JsonLdProcessor&&(s?Object.defineProperty(i,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:t}):i.JsonLdProcessor=t);var c="function"==typeof o&&o,f=c?function(e){c(e)}:function(e){setTimeout(e,0)};e.nextTick="object"==typeof r&&"function"==typeof r.nextTick?r.nextTick:f,e.setImmediate=c?f:e.nextTick,e.parseLinkHeader=function(e){for(var t={},n=e.match(/(?:<[^>]*?>|"[^"]*?"|[^,])+/g),r=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,i=0;i=+new Date)return t.ctx;delete this.cache[e],this.order.splice(this.order.indexOf(e),1)}return null},e.DocumentCache.prototype.set=function(e,t){this.order.length===this.size&&delete this.cache[this.order.shift()],this.order.push(e),this.cache[e]={ctx:t,expires:+new Date+this.expires}},e.ActiveContextCache=function(e){this.order=[],this.cache={},this.size=e||100},e.ActiveContextCache.prototype.get=function(e,t){var n=JSON.stringify(e),r=JSON.stringify(t),i=this.cache[n];return i&&r in i?i[r]:null},e.ActiveContextCache.prototype.set=function(e,t,n){if(this.order.length===this.size){var r=this.order.shift();delete this.cache[r.activeCtx][r.localCtx]}var i=JSON.stringify(e),o=JSON.stringify(t);this.order.push({activeCtx:i,localCtx:o}),i in this.cache||(this.cache[i]={}),this.cache[i][o]=he(n)},e.cache={activeCtx:new e.ActiveContextCache},e.documentLoaders={},e.documentLoaders.jquery=function(t,n){n=n||{};var r=new e.RequestQueue;return("usePromise"in n?n.usePromise:"undefined"!=typeof Promise)?r.wrapLoader(function(t){return e.promisify(i,t)}):r.wrapLoader(i);function i(r,i){return 0!==r.indexOf("http:")&&0!==r.indexOf("https:")?i(new T('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:r}),{contextUrl:null,documentUrl:r,document:null}):n.secure&&0!==r.indexOf("https")?i(new T('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:r}),{contextUrl:null,documentUrl:r,document:null}):void t.ajax({url:r,accepts:{json:"application/ld+json, application/json"},headers:{Accept:"application/ld+json, application/json"},dataType:"json",crossDomain:!0,success:function(t,n,o){var a={contextUrl:null,documentUrl:r,document:t},s=o.getResponseHeader("Content-Type"),u=o.getResponseHeader("Link");if(u&&"application/ld+json"!==s){if(ee(u=e.parseLinkHeader(u)[k]))return i(new T("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:r}),a);u&&(a.contextUrl=u.target)}i(null,a)},error:function(e,t,n){i(new T("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:r,cause:n}),{contextUrl:null,documentUrl:r,document:null})}})}},e.documentLoaders.node=function(t){var r=!("strictSSL"in(t=t||{}))||t.strictSSL,i="maxRedirects"in t?t.maxRedirects:-1,o="request"in t?t.request:n(10),a="application/ld+json, application/json",s=n(10),u=new e.RequestQueue;if(t.usePromise)return u.wrapLoader(function(t){return e.promisify(c,t,[])});var l=t.headers||{};if("Accept"in l||"accept"in l)throw new RangeError('Accept header may not be specified as an option; only "'+a+'" is supported.');return u.wrapLoader(function(e,t){c(e,[],t)});function c(n,u,l){if(0!==n.indexOf("http:")&&0!==n.indexOf("https:"))return l(new T('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:n}),{contextUrl:null,documentUrl:n,document:null});if(t.secure&&0!==n.indexOf("https"))return l(new T('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:n}),{contextUrl:null,documentUrl:n,document:null});var f=null;if(null!==f)return l(null,f);var h={Accept:a};for(var p in t.headers)h[p]=t.headers[p];o({url:n,headers:h,strictSSL:r,followRedirect:!1},function(t,r,o){if(f={contextUrl:null,documentUrl:n,document:o||null},t)return l(new T("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:n,cause:t}),f);if(r.statusCode>=400)return l(new T("URL could not be dereferenced: "+s.STATUS_CODES[r.statusCode],"jsonld.InvalidUrl",{code:"loading document failed",url:n,httpStatusCode:r.statusCode}),f);if(r.headers.link&&"application/ld+json"!==r.headers["content-type"]){var a=e.parseLinkHeader(r.headers.link)[k];if(ee(a))return l(new T("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:n}),f);a&&(f.contextUrl=a.target)}if(r.statusCode>=300&&r.statusCode<400&&r.headers.location)return u.length===i?l(new T("URL could not be dereferenced; there were too many redirects.","jsonld.TooManyRedirects",{code:"loading document failed",url:n,httpStatusCode:r.statusCode,redirects:u}),f):-1!==u.indexOf(n)?l(new T("URL could not be dereferenced; infinite redirection was detected.","jsonld.InfiniteRedirectDetected",{code:"recursive context inclusion",url:n,httpStatusCode:r.statusCode,redirects:u}),f):(u.push(n),c(r.headers.location,u,l));u.push(n),l(t,f)})}},e.documentLoaders.xhr=function(t){t=t||{};var n=/(^|(\r\n))link:/i,r=new e.RequestQueue;return("usePromise"in t?t.usePromise:"undefined"!=typeof Promise)?r.wrapLoader(function(t){return e.promisify(i,t)}):r.wrapLoader(i);function i(r,i){if(0!==r.indexOf("http:")&&0!==r.indexOf("https:"))return i(new T('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:r}),{contextUrl:null,documentUrl:r,document:null});if(t.secure&&0!==r.indexOf("https"))return i(new T('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:r}),{contextUrl:null,documentUrl:r,document:null});var o=new(t.xhr||XMLHttpRequest);o.onload=function(){if(o.status>=400)return i(new T("URL could not be dereferenced: "+o.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:r,httpStatusCode:o.status}),{contextUrl:null,documentUrl:r,document:null});var t,a={contextUrl:null,documentUrl:r,document:o.response},s=o.getResponseHeader("Content-Type");if(n.test(o.getAllResponseHeaders())&&(t=o.getResponseHeader("Link")),t&&"application/ld+json"!==s){if(ee(t=e.parseLinkHeader(t)[k]))return i(new T("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:r}),a);t&&(a.contextUrl=t.target)}i(null,a)},o.onerror=function(){i(new T("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:r}),{contextUrl:null,documentUrl:r,document:null})},o.open("GET",r,!0),o.setRequestHeader("Accept","application/ld+json, application/json"),o.send()}},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new T('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.processContext=function(t,n){var r={},i=2;arguments.length>3&&(r=arguments[2]||{},i+=1);var o=arguments[i];if("base"in r||(r.base=""),"documentLoader"in r||(r.documentLoader=e.loadDocument),null===n)return o(null,Y(r));X(n=he(n))&&"@context"in n||(n={"@context":n}),de(n,r,function(e,n){if(e)return o(e);try{n=(new O).processContext(t,n,r)}catch(e){return o(e)}o(null,n)})},e.hasProperty=function(e,t){var n=!1;if(t in e){var r=e[t];n=!ee(r)||r.length>0}return n},e.hasValue=function(t,n,r){var i=!1;if(e.hasProperty(t,n)){var o=t[n],a=le(o);if(ee(o)||a){a&&(o=o["@list"]);for(var s=0;s0){var k=J(t,h);e.addValue(o,k,C)}}else{var C;if(ne(p))C=J(t,p,null,{vocab:"@type"===h});else{C=[];for(var O=0;O1&&!(2===C&&"@index"in s))throw new T('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:s});"@set"in s&&(s=s["@set"],C=(h=Object.keys(s)).length)}else 1===C&&"@language"in s&&(s=null);return!X(s)||i.keepFreeFloatingNodes||o||null!==n&&"@graph"!==f||(0===C||"@value"in s||"@list"in s||1===C&&"@id"in s)&&(s=null),s},O.prototype.createNodeMap=function(e,t){var n={"@default":{}};return F(e,n,"@default",(t=t||{}).namer||t.issuer||new ye("_:b")),V(n)},O.prototype.flatten=function(e){for(var t=this.createNodeMap(e),n=[],r=Object.keys(t).sort(),i=0;i=r.MAX_TOTAL_DEPTH)return n(new Error("Maximum total call stack depth exceeded; normalization aborting."));!function i(){if(r.depth===r.MAX_DEPTH)return r.depth=0,r.running=!1,e.nextTick(i);var o=(new Date).getTime();if(r.running||(r.start=(new Date).getTime(),r.deadline=r.start+r.timeSlice),o1)return o();var s=a[0];r.canonicalIssuer.getId(s),delete i[s],delete r.hashToBlankNodes[e],t=!0,o()},e)}],e)},e)},function(e){var t=Object.keys(r.hashToBlankNodes).sort();r.forEach(t,function(e,t,n){var i=[],o=r.hashToBlankNodes[e];r.waterfall([function(e){r.forEach(o,function(e,t,n){if(r.canonicalIssuer.hasId(e))return n();var o=new ye("_:b");o.getId(e),r.hashNDegreeQuads(e,o,function(e,t){if(e)return n(e);i.push(t),n()})},e)},function(e){i.sort(function(e,t){return e.hasht.hash?1:0}),r.forEach(i,function(e,t,n){for(var i in e.issuer.existing)r.canonicalIssuer.getId(i);n()},e)}],n)},e)},function(e){var t=[];r.waterfall([function(e){r.forEach(r.quads,function(e,n,i){r.forEachComponent(e,function(e){"blank node"===e.type&&0!==e.value.indexOf(r.canonicalIssuer.prefix)&&(e.value=r.canonicalIssuer.getId(e.value))}),t.push(me(e)),i()},e)},function(e){if(t.sort(),"application/nquads"===r.options.format)return n=t.join(""),e();n=ge(t.join("")),e()}],e)}],function(e){t(e,n)})},M.prototype.hashFirstDegreeQuads=function(e,t){var n=this,r=n.blankNodeInfo[e];if("hash"in r)return t(null,r.hash);var i=[];n.forEach(r.quads,function(t,r,o){var a={predicate:t.predicate};n.forEachComponent(t,function(t,r){a[r]=n.modifyFirstDegreeComponent(e,t,r)}),i.push(me(a)),o()},function(e){if(e)return t(e);i.sort(),r.hash=be.hashNQuads(n.name,i),t(null,r.hash)})},M.prototype.modifyFirstDegreeComponent=function(e,t){return"blank node"!==t.type?t:((t=he(t)).value=t.value===e?"_:a":"_:z",t)},M.prototype.hashRelatedBlankNode=function(e,t,n,r,i){var o,a=this;a.waterfall([function(t){return a.canonicalIssuer.hasId(e)?(o=a.canonicalIssuer.getId(e),t()):n.hasId(e)?(o=n.getId(e),t()):void a.hashFirstDegreeQuads(e,function(e,n){if(e)return t(e);o=n,t()})}],function(e){if(e)return i(e);var n=new be(a.name);return n.update(r),"g"!==r&&n.update(a.getRelatedPredicate(t)),n.update(o),i(null,n.digest())})},M.prototype.getRelatedPredicate=function(e){return"<"+e.predicate.value+">"},M.prototype.hashNDegreeQuads=function(e,t,n){var r,i=this,o=new be(i.name);i.waterfall([function(n){i.createHashToRelated(e,t,function(e,t){if(e)return n(e);r=t,n()})},function(e){var n=Object.keys(r).sort();i.forEach(n,function(e,n,a){o.update(e);var s,u="",l=new ve(r[e]);i.whilst(function(){return l.hasNext()},function(e){var n=l.next(),r=t.clone(),o="",a=[];i.waterfall([function(t){i.forEach(n,function(t,n,s){if(i.canonicalIssuer.hasId(t)?o+=i.canonicalIssuer.getId(t):(r.hasId(t)||a.push(t),o+=r.getId(t)),0!==u.length&&o.length>=u.length&&o>u)return e();s()},t)},function(t){i.forEach(a,function(t,n,a){i.hashNDegreeQuads(t,r,function(n,i){return n?a(n):(o+=r.getId(t),o+="<"+i.hash+">",r=i.issuer,0!==u.length&&o.length>=u.length&&o>u?e():void a())})},t)},function(e){(0===u.length||o=0;--n)if(t[n]["@id"]===e["@id"])return!0;return!1}function q(e,t,n){var r="@"+n,i=r in e?e[r][0]:t[n];return"embed"===n&&(!0===i?i="@last":!1===i?i="@never":"@always"!==i&&"@never"!==i&&"@link"!==i&&(i="@last")),i}function H(t,n,r){if("@type"in n&&(1!==n["@type"].length||!X(n["@type"][0]))){for(var i=n["@type"],o=0;o=0;--d)for(var C=S[d],T=C.terms,O=0;O0&&a.length>s&&o[0]===a[0];)o.shift(),a.shift();var u="";if(o.length>0){o.pop();for(var l=0;l=(i=a[u].iri).length?"":i[r])in s?s[o].push(a[u]):s[o]=[a[u]];for(var t in s)""!==t&&n(s,t,r+1)}function r(e,t,n,r){r in n||(n[r]=t)}}function Z(e){if(!ne(e))return!1;switch(e){case"@base":case"@context":case"@container":case"@default":case"@embed":case"@explicit":case"@graph":case"@id":case"@index":case"@language":case"@list":case"@omitDefault":case"@preserve":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@vocab":return!0}return!1}function X(e){return"[object Object]"===Object.prototype.toString.call(e)}function ee(e){return Array.isArray(e)}function te(e){if(!ne(e)&&!function(e){return X(e)&&0===Object.keys(e).length}(e)){var t=!1;if(ee(e)){t=!0;for(var n=0;n1||!("@id"in e)),t}function se(e){return X(e)&&1===Object.keys(e).length&&"@id"in e}function ue(e){return X(e)&&"@value"in e}function le(e){return X(e)&&"@list"in e}function ce(e){var t=!1;return X(e)&&(t="@id"in e?0===e["@id"].indexOf("_:"):0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e)),t}function fe(e){return ne(e)&&-1!==e.indexOf(":")}function he(e){if(e&&"object"==typeof e){var t;if(ee(e)){t=[];for(var n=0;nC)return r=new T("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"loading remote context failed",max:C}),a(r);var s={},u=function(){pe(e,s,!0,o),a(null,e)};if(!pe(e,s,!1,o))return u();var l=[];for(var c in s)!1===s[c]&&l.push(c);for(var f=l.length,h=0;h]*)>)|(_:(?:[A-Za-z0-9]+)))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-z0-9]+))|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-z]+(?:-[a-z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-z0-9]+)))[ \\t]*\\.))[ \\t]*(?:#.*)?$'),r={},i=e.split(/(?:\r\n)|(?:\n)|(?:\r)/g),o=0,a=0;a":n.value,a+=" ",a+="IRI"===r.type?"<"+r.value+">":r.value,a+=" ","IRI"===i.type?a+="<"+i.value+">":"blank node"===i.type?a+=i.value:(a+='"'+i.value.replace(/\\/g,"\\\\").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\"/g,'\\"')+'"',i.datatype===E?i.language&&(a+="@"+i.language):i.datatype!==v&&(a+="^^<"+i.datatype+">")),null!=o&&(0!==o.indexOf("_:")?a+=" <"+o+">":a+=" "+o),a+" .\n"}function ye(e){this.prefix=e,this.counter=0,this.existing={}}Object.keys||(Object.keys=function(e){if(e!==Object(e))throw new TypeError("Object.keys called on non-object");var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}),e.registerRDFParser("application/nquads",ge),e.registerRDFParser("rdfa-api",function(e){for(var t={"@default":[]},n=e.getSubjects(),r=0;rt)&&(a&&i>0&&o>this.list[i-1]||!a&&ithis.list[i+1])&&(t=o,n=i)}if(null===t)this.done=!0;else{var s=this.left[t]?n-1:n+1;for(this.list[n]=this.list[s],this.list[s]=t,i=0;it&&(this.left[this.list[i]]=!this.left[this.list[i]])}return e};var be=function(e){if(!(this instanceof be))return new be(e);if(-1===["URDNA2015","URGNA2012"].indexOf(e))throw new Error("Invalid RDF Dataset Normalization algorithm: "+e);be._init.call(this,e)};if(be.hashNQuads=function(e,t){for(var n=new be(e),r=0;r0;)1&r&&(t._padding+=n),(r>>>=1)>0&&(n+=n)}this.start()};t.prototype.start=function(){this.messageLength=0,this.fullMessageLength=[];for(var e=this._algorithm.messageLengthSize/4,n=0;n>>0,n>>>0];for(var r=this.fullMessageLength.length-1;r>=0;--r)this.fullMessageLength[r]+=n[1],n[1]=n[0]+(this.fullMessageLength[r]/4294967296>>>0),this.fullMessageLength[r]=this.fullMessageLength[r]>>>0,n[0]=n[1]/4294967296>>>0;for(this._input.putBytes(e.bytes());this._input.length()>=this._algorithm.blockSize;)this.state=this._algorithm.digest(this.state,this._input);return(this._input.read>2048||0===this._input.length())&&this._input.compact(),this},t.prototype.digest=function(){var e=new t.ByteBuffer;e.putBytes(this._input.bytes()),e.putBytes(t._padding.substr(0,this._algorithm.blockSize-(this.fullMessageLength[this.fullMessageLength.length-1]+this._algorithm.messageLengthSize&this._algorithm.blockSize-1)));for(var n=new t.ByteBuffer,r=0;r>>28);this._algorithm.writeMessageLength(e,n);var i=this._algorithm.digest(this.state.copy(),e),o=new t.ByteBuffer;return i.write(o),o},t.ByteBuffer=function(e){this.data="string"==typeof e?e:"",this.read=0},t.ByteBuffer.prototype.putInt32=function(e){this.data+=String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)},t.ByteBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},t.ByteBuffer.prototype.putBytes=function(e){this.data+=e},t.ByteBuffer.prototype.bytes=function(){return this.data.slice(this.read)},t.ByteBuffer.prototype.length=function(){return this.data.length-this.read},t.ByteBuffer.prototype.compact=function(){this.data=this.data.slice(this.read),this.read=0},t.ByteBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=64;){for(i=e.h0,o=e.h1,a=e.h2,s=e.h3,u=e.h4,l=0;l<16;++l)r=t.getInt32(),f[l]=r,r=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+r,u=s,s=a,a=o<<30|o>>>2,o=i,i=r;for(;l<20;++l)r=(r=f[l-3]^f[l-8]^f[l-14]^f[l-16])<<1|r>>>31,f[l]=r,r=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+r,u=s,s=a,a=o<<30|o>>>2,o=i,i=r;for(;l<32;++l)r=(r=f[l-3]^f[l-8]^f[l-14]^f[l-16])<<1|r>>>31,f[l]=r,r=(i<<5|i>>>27)+(o^a^s)+u+1859775393+r,u=s,s=a,a=o<<30|o>>>2,o=i,i=r;for(;l<40;++l)r=(r=f[l-6]^f[l-16]^f[l-28]^f[l-32])<<2|r>>>30,f[l]=r,r=(i<<5|i>>>27)+(o^a^s)+u+1859775393+r,u=s,s=a,a=o<<30|o>>>2,o=i,i=r;for(;l<60;++l)r=(r=f[l-6]^f[l-16]^f[l-28]^f[l-32])<<2|r>>>30,f[l]=r,r=(i<<5|i>>>27)+(o&a|s&(o^a))+u+2400959708+r,u=s,s=a,a=o<<30|o>>>2,o=i,i=r;for(;l<80;++l)r=(r=f[l-6]^f[l-16]^f[l-28]^f[l-32])<<2|r>>>30,f[l]=r,r=(i<<5|i>>>27)+(o^a^s)+u+3395469782+r,u=s,s=a,a=o<<30|o>>>2,o=i,i=r;e.h0=e.h0+i|0,e.h1=e.h1+o|0,e.h2=e.h2+a|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,c-=64}return e},n._createState=function(){var e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520,copy:function(){var t=n._createState();return t.h0=e.h0,t.h1=e.h1,t.h2=e.h2,t.h3=e.h3,t.h4=e.h4,t},write:function(t){t.putInt32(e.h0),t.putInt32(e.h1),t.putInt32(e.h2),t.putInt32(e.h3),t.putInt32(e.h4)}};return e};var r={_k:null,_w:null,Algorithm:function(){this.name="sha256",this.blockSize=64,this.digestLength=32,this.messageLengthSize=8}};r.Algorithm.prototype.start=function(){return r._k||r._init(),r._createState()},r.Algorithm.prototype.writeMessageLength=function(e,t){e.putBytes(t.bytes())},r.Algorithm.prototype.digest=function(e,t){for(var n,i,o,a,s,u,l,c,f,h,p,d,g=t.length(),m=r._k,y=r._w;g>=64;){for(a=0;a<16;++a)y[a]=t.getInt32();for(;a<64;++a)n=((n=y[a-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=y[a-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,y[a]=n+y[a-7]+i+y[a-16]|0;for(s=e.h0,u=e.h1,l=e.h2,c=e.h3,f=e.h4,h=e.h5,p=e.h6,d=e.h7,a=0;a<64;++a)o=s&u|l&(s^u),n=d+((f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(p^f&(h^p))+m[a]+y[a],d=p,p=h,h=f,f=c+n|0,c=l,l=u,u=s,s=n+(i=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+o)|0;e.h0=e.h0+s|0,e.h1=e.h1+u|0,e.h2=e.h2+l|0,e.h3=e.h3+c|0,e.h4=e.h4+f|0,e.h5=e.h5+h|0,e.h6=e.h6+p|0,e.h7=e.h7+d|0,g-=64}return e},r._createState=function(){var e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225,copy:function(){var t=r._createState();return t.h0=e.h0,t.h1=e.h1,t.h2=e.h2,t.h3=e.h3,t.h4=e.h4,t.h5=e.h5,t.h6=e.h6,t.h7=e.h7,t},write:function(t){t.putInt32(e.h0),t.putInt32(e.h1),t.putInt32(e.h2),t.putInt32(e.h3),t.putInt32(e.h4),t.putInt32(e.h5),t.putInt32(e.h6),t.putInt32(e.h7)}};return e},r._init=function(){r._k=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],r._w=new Array(64)}}(),!p)var we=function(){p=n(10).XMLSerializer};function _e(e,t){var n="";0===e.indexOf("/")&&(n="/");for(var r=e.split("/"),i=[];r.length>0;)"."===r[0]||""===r[0]&&r.length>1?r.shift():".."!==r[0]?i.push(r.shift()):(r.shift(),t||i.length>0&&".."!==i[i.length-1]?i.pop():i.push(".."));return n+i.join("/")}if(e.url={},e.url.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},e.url.parse=function(t,n){for(var r={},i=e.url.parsers[n||"full"],o=i.regex.exec(t),a=i.keys.length;a--;)r[i.keys[a]]=void 0===o[a]?null:o[a];return r.normalizedPath=_e(r.path,!!r.authority),r},u?e.useDocumentLoader("node"):"undefined"!=typeof XMLHttpRequest&&e.useDocumentLoader("xhr"),u){e.use=function(t){switch(t){case"request":e.request=n(10);break;default:throw new T("Unknown extension.","jsonld.UnknownExtension",{extension:t})}};var xe={exports:{},filename:a};n(10)(xe,"version"),e.version=xe.exports.version}return e},f=function(){return c(function(){return f()})};!u&&n(68)?void 0===(s=(function(){return c(f),f}).apply(t,[]))||(e.exports=s):(c(f),e.exports&&(e.exports=f),l&&("undefined"==typeof jsonld?jsonld=jsonldjs=f:jsonldjs=f))}()}).call(this,n(8),n(6),n(16).setImmediate,"/")},function(e,t,n){(function(r,i,o){var a;(function(){"use strict";function s(e){return"function"==typeof e}var u,l,c=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},f=0,h=function(e,t){C[f]=e,C[f+1]=t,2===(f+=2)&&(l?l(T):b())},p="undefined"!=typeof window?window:void 0,d=p||{},g=d.MutationObserver||d.WebKitMutationObserver,m=void 0!==r&&"[object process]"==={}.toString.call(r),y="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function v(){return function(){setTimeout(T,1)}}var b,w,_,x,S,E,k,C=new Array(1e3);function T(){for(var e=0;e<"]=0,this._entityCount=0,this._blankNodeIndex=0,t||!e||e[0]||(t=e,e=null),this._prefixes=Object.create(null),t&&t.prefixes&&this.addPrefixes(t.prefixes),e&&this.addTriples(e)}i.prototype={get size(){var e=this._size;if(null!==e)return e;var t,n,r=this._graphs;for(var i in r)for(var o in t=r[i].subjects)for(var a in n=t[o])e+=Object.keys(n[a]).length;return this._size=e},_addToIndex:function(e,t,n,r){var i=e[t]||(e[t]={});(i[n]||(i[n]={}))[r]=null},_removeFromIndex:function(e,t,n,r){var i,o=e[t],a=o[n];for(i in delete a[r],a)return;for(i in delete o[n],o)return;delete e[t]},_findInIndex:function(e,t,n,r,i,o,a,s){var u,l,c,f=[],h=Object.keys(this._entities);for(var p in t&&((u=e,e={})[t]=u[t]),e){var d=h[p];if(l=e[p])for(var g in n&&((u=l,l={})[n]=u[n]),l){var m=h[g];if(c=l[g])for(var y=(r?r in c?[r]:[]:Object.keys(c)),v=y.length-1;v>=0;v--){var b={subject:"",predicate:"",object:"",graph:s};b[i]=d,b[o]=m,b[a]=h[y[v]],f.push(b)}}}return f},_countInIndex:function(e,t,n,r){var i,o,a,s=0;for(var u in t&&((i=e,e={})[t]=i[t]),e)if(o=e[u])for(var l in n&&((i=o,o={})[n]=i[n]),o)(a=o[l])&&(r?r in a&&s++:s+=Object.keys(a).length);return s},addTriple:function(e,t,n,r){t||(r=e.graph,n=e.object,t=e.predicate,e=e.subject);var i=this._graphs[r=r||""];i||(i=this._graphs[r]={subjects:{},predicates:{},objects:{}},Object.freeze(i));var o=this._entities;e=o[e]||(o[e]=++this._entityCount),t=o[t]||(o[t]=++this._entityCount),n=o[n]||(o[n]=++this._entityCount),this._addToIndex(i.subjects,e,t,n),this._addToIndex(i.predicates,t,n,e),this._addToIndex(i.objects,n,e,t),this._size=null},addTriples:function(e){for(var t=e.length-1;t>=0;t--)this.addTriple(e[t])},addPrefix:function(e,t){this._prefixes[e]=t},addPrefixes:function(e){for(var t in e)this.addPrefix(t,e[t])},removeTriple:function(e,t,n,r){t||(r=e.graph,n=e.object,t=e.predicate,e=e.subject),r=r||"";var i,o,a,s=this._entities,u=this._graphs;if((e=s[e])&&(t=s[t])&&(n=s[n])&&(i=u[r])&&(o=i.subjects[e])&&(a=o[t])&&n in a){for(e in this._removeFromIndex(i.subjects,e,t,n),this._removeFromIndex(i.predicates,t,n,e),this._removeFromIndex(i.objects,n,e,t),null!==this._size&&this._size--,i.subjects)return;delete u[r]}},removeTriples:function(e){for(var t=e.length-1;t>=0;t--)this.removeTriple(e[t])},find:function(e,t,n,i){var o=this._prefixes;return this.findByIRI(r(e,o),r(t,o),r(n,o),r(i,o))},findByIRI:function(e,t,n,r){var i=this._graphs[r=r||""],o=this._entities;return i?e&&!(e=o[e])?[]:t&&!(t=o[t])?[]:n&&!(n=o[n])?[]:e?n?this._findInIndex(i.objects,n,e,t,"object","subject","predicate",r):this._findInIndex(i.subjects,e,t,null,"subject","predicate","object",r):t?this._findInIndex(i.predicates,t,n,null,"predicate","object","subject",r):n?this._findInIndex(i.objects,n,null,null,"object","subject","predicate",r):this._findInIndex(i.subjects,null,null,null,"subject","predicate","object",r):[]},count:function(e,t,n,i){var o=this._prefixes;return this.countByIRI(r(e,o),r(t,o),r(n,o),r(i,o))},countByIRI:function(e,t,n,r){var i=this._graphs[r=r||""],o=this._entities;return i?e&&!(e=o[e])?0:t&&!(t=o[t])?0:n&&!(n=o[n])?0:e?n?this._countInIndex(i.objects,n,e,t):this._countInIndex(i.subjects,e,t,n):t?this._countInIndex(i.predicates,t,n,e):this._countInIndex(i.objects,n,e,t):0},createBlankNode:function(e){var t,n;if(e)for(t=e="_:"+e,n=1;this._entities[t];)t=e+n++;else do{t="_:b"+this._blankNodeIndex++}while(this._entities[t]);return this._entities[t]=++this._entityCount,t}},e.exports=i},function(e,t,n){var r=n(48).Transform,i=n(56),o=n(30);function a(e){if(!(this instanceof a))return new a(e);r.call(this,{decodeStrings:!0}),this._readableState.objectMode=!0;var t=this,n=new o(e);n.parse(function(e,n){n&&t.push(n)||e&&t.emit("error",e)},this.emit.bind(this,"prefix")),this._transform=function(e,t,r){n.addChunk(e),r()},this._flush=function(e){n.end(),e()}}i.inherits(a,r),e.exports=a},function(e,t,n){e.exports=i;var r=n(32).EventEmitter;function i(){r.call(this)}n(11)(i,r),i.Readable=n(33),i.Writable=n(77),i.Duplex=n(78),i.Transform=n(79),i.PassThrough=n(80),i.Stream=i,i.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===r.listenerCount(this,"error"))throw e}function c(){n.removeListener("data",i),e.removeListener("drain",o),n.removeListener("end",s),n.removeListener("close",u),n.removeListener("error",l),e.removeListener("error",l),n.removeListener("end",c),n.removeListener("close",c),e.removeListener("close",c)}return n.on("error",l),e.on("error",l),n.on("end",c),n.on("close",c),e.on("close",c),e.emit("pipe",n),e}},function(e,t,n){"use strict";(function(t,r){var i=n(21);e.exports=b;var o,a=n(50);b.ReadableState=v,n(32);var s=function(e,t){return e.listeners(t).length},u=n(51),l=n(22).Buffer,c=t.Uint8Array||function(){},f=n(17);f.inherits=n(11);var h=n(72),p=void 0;p=h&&h.debuglog?h.debuglog("stream"):function(){};var d,g=n(73),m=n(53);f.inherits(b,u);var y=["error","close","destroy","pause","resume"];function v(e,t){e=e||{};var r=t instanceof(o=o||n(12));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark;this.highWaterMark=i||0===i?i:r&&(a||0===a)?a:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(d||(d=n(54).StringDecoder),this.decoder=new d(e.encoding),this.encoding=e.encoding)}function b(e){if(o=o||n(12),!(this instanceof b))return new b(e);this._readableState=new v(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,n,r,i){var o,a=e._readableState;return null===t?(a.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,E(e)}}(e,a)):(i||(o=function(e,t){var n,r;return l.isBuffer(r=t)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=l.from(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?_(e,a,t,!1):C(e,a)):_(e,a,t,!1))):r||(a.reading=!1)),!a.ended&&(a.needReadable||a.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=x?e=x:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(p("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(k,e):k(e))}function k(e){p("emit readable"),e.emit("readable"),P(e)}function C(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(T,e,t))}function T(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;return eo.length?o.length:e;if(i+=a===o.length?o:o.slice(0,e),0==(e-=a)){a===o.length?(++r,t.head=n.next?n.next:t.tail=null):(t.head=n,n.data=o.slice(a));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=l.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),0==(e-=a)){a===o.length?(++i,t.head=r.next?r.next:t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}(e,t),r}(e,t.buffer,t.decoder),n);var n}function N(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function j(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return p("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?N(this):E(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&N(this),null;var r,i=t.needReadable;return p("need readable",i),(0===t.length||t.length-e0?A(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&N(this)),null!==r&&this.emit("data",r),r},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,p("pipe count=%d opts=%j",o.pipesCount,t);var u=t&&!1===t.end||e===r.stdout||e===r.stderr?v:l;function l(){p("onend"),e.end()}o.endEmitted?i.nextTick(u):n.once("end",u),e.on("unpipe",function t(r,i){p("onunpipe"),r===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,p("cleanup"),e.removeListener("close",m),e.removeListener("finish",y),e.removeListener("drain",c),e.removeListener("error",g),e.removeListener("unpipe",t),n.removeListener("end",l),n.removeListener("end",v),n.removeListener("data",d),f=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||c())});var c=function(e){return function(){var t=e._readableState;p("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,P(e))}}(n);e.on("drain",c);var f=!1,h=!1;function d(t){p("ondata"),h=!1,!1!==e.write(t)||h||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==j(o.pipes,e))&&!f&&(p("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,h=!0),n.pause())}function g(t){p("onerror",t),v(),e.removeListener("error",g),0===s(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",y),v()}function y(){p("onfinish"),e.removeListener("close",m),v()}function v(){p("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",g),e.once("close",m),e.once("finish",y),e.emit("pipe",n),o.flowing||(p("pipe resume"),n.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function d(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return B(e).length;default:if(r)return V(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,i){if(0===e.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:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var f=!0,h=0;hi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i.push(n%256),i.push(r);return i}(t,e.length-n),e,n,r)}function E(e,t,n){return r.fromByteArray(0===t&&n===e.length?e:e.slice(t,n))}function k(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+f<=n)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:a=e[i+2],128==(192&(o=e[i+1]))&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:a=e[i+2],s=e[i+3],128==(192&(o=e[i+1]))&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(r.push((c-=65536)>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=f}return function(e){var t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);for(var n="",r=0;rthis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return O(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}).apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(r,i),c=e.slice(t,n),f=0;fi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return v(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return x(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function T(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function R(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function j(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function D(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(e,t,n,r,o){return o||D(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,o){return o||D(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||A(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||A(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||A(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||A(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||A(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||A(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||A(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||A(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||A(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||N(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):j(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):j(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return M(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return M(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=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),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function B(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(6))},function(e,t,n){"use strict";var r=n(21);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(r.nextTick(i,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){"use strict";var r=n(22).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):t}function c(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=a;var r=n(12),i=n(17);function o(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),u=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(n)?r.showHidden=n:n&&t._extend(r,n),v(r.showHidden)&&(r.showHidden=!1),v(r.depth)&&(r.depth=2),v(r.colors)&&(r.colors=!1),v(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),c(r,e,r.depth)}function u(e,t){var n=s.styles[t];return n?"\x1b["+s.colors[n][0]+"m"+e+"\x1b["+s.colors[n][1]+"m":e}function l(e,t){return e}function c(e,n,r){if(e.customInspect&&n&&S(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return y(i)||(i=c(e,i,r)),i}var o=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(y(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return m(t)?e.stylize(""+t,"number"):d(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}(e,n);if(o)return o;var a=Object.keys(n),s=function(e){var t={};return a.forEach(function(e,n){t[e]=!0}),t}();if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),x(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(n);if(0===a.length){if(S(n))return e.stylize("[Function"+(n.name?": "+n.name:"")+"]","special");if(b(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(_(n))return e.stylize(Date.prototype.toString.call(n),"date");if(x(n))return f(n)}var u,l="",w=!1,E=["{","}"];return p(n)&&(w=!0,E=["[","]"]),S(n)&&(l=" [Function"+(n.name?": "+n.name:"")+"]"),b(n)&&(l=" "+RegExp.prototype.toString.call(n)),_(n)&&(l=" "+Date.prototype.toUTCString.call(n)),x(n)&&(l=" "+f(n)),0!==a.length||w&&0!=n.length?r<0?b(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),u=w?function(e,t,n,r,i){for(var o=[],a=0,s=t.length;a60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}(u,l,E)):E[0]+l+E[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,n,r,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=e.stylize(u.set?"[Getter/Setter]":"[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),T(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=g(n)?c(e,u.value,null):c(e,u.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),v(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function p(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function g(e){return null===e}function m(e){return"number"==typeof e}function y(e){return"string"==typeof e}function v(e){return void 0===e}function b(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function _(e){return w(e)&&"[object Date]"===E(e)}function x(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function S(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function k(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(v(o)&&(o=r.env.NODE_DEBUG||""),e=e.toUpperCase(),!a[e])if(new RegExp("\\b"+e+"\\b","i").test(o)){var n=r.pid;a[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else a[e]=function(){};return a[e]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=p,t.isBoolean=d,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=m,t.isString=y,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=v,t.isRegExp=b,t.isObject=w,t.isDate=_,t.isError=x,t.isFunction=S,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(81);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;console.log("%s - %s",(n=[k((e=new Date).getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),C[e.getMonth()],n].join(" ")),t.format.apply(t,arguments))},t.inherits=n(11),t._extend=function(e,t){if(!t||!w(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,n(6),n(8))},function(e,t,n){var r=n(48).Transform,i=n(56),o=n(35);function a(e){if(!(this instanceof a))return new a(e);r.call(this,{encoding:"utf8"}),this._writableState.objectMode=!0;var t=this,n=new o({write:function(e,n,r){t.push(e),r&&r()},end:function(e){t.push(null),e&&e()}},e);this._transform=function(e,t,r){n.addTriple(e,r)},this._flush=function(e){n.end(e)}}i.inherits(a,r),e.exports=a},function(e,t){function n(e,t){for(var n in e)t[n]=e[n]}function r(e,t){var r=e.prototype;if(Object.create){var i=Object.create(t.prototype);r.__proto__=i}if(!(r instanceof t)){function o(){}o.prototype=t.prototype,n(r,o=new o),e.prototype=r=o}r.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),r.constructor=e)}var i="http://www.w3.org/1999/xhtml",o={},a=o.ELEMENT_NODE=1,s=o.ATTRIBUTE_NODE=2,u=o.TEXT_NODE=3,l=o.CDATA_SECTION_NODE=4,c=o.ENTITY_REFERENCE_NODE=5,f=o.ENTITY_NODE=6,h=o.PROCESSING_INSTRUCTION_NODE=7,p=o.COMMENT_NODE=8,d=o.DOCUMENT_NODE=9,g=o.DOCUMENT_TYPE_NODE=10,m=o.DOCUMENT_FRAGMENT_NODE=11,y=o.NOTATION_NODE=12,v={},b={},w=(v.INDEX_SIZE_ERR=(b[1]="Index size error",1),v.DOMSTRING_SIZE_ERR=(b[2]="DOMString size error",2),v.HIERARCHY_REQUEST_ERR=(b[3]="Hierarchy request error",3)),_=(v.WRONG_DOCUMENT_ERR=(b[4]="Wrong document",4),v.INVALID_CHARACTER_ERR=(b[5]="Invalid character",5),v.NO_DATA_ALLOWED_ERR=(b[6]="No data allowed",6),v.NO_MODIFICATION_ALLOWED_ERR=(b[7]="No modification allowed",7),v.NOT_FOUND_ERR=(b[8]="Not found",8)),x=(v.NOT_SUPPORTED_ERR=(b[9]="Not supported",9),v.INUSE_ATTRIBUTE_ERR=(b[10]="Attribute in use",10));function S(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,b[e]),this.message=b[e],Error.captureStackTrace&&Error.captureStackTrace(this,S);return n.code=e,t&&(this.message=this.message+": "+t),n}function E(){}function k(e,t){this._node=e,this._refresh=t,C(this)}function C(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var r=e._refresh(e._node);ne(e,"length",r.length),n(r,e),e._inc=t}}function T(){}function O(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function I(e,t,n,r){if(r?t[O(t,r)]=n:t[t.length++]=n,e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&M(i,e,r),function(e,t,n){i&&i._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&(t._nsMap[n.prefix?n.localName:""]=n.value)}(0,e,n))}}function P(e,t,n){var r=O(t,n);if(!(r>=0))throw S(_,new Error(e.tagName+"@"+n));for(var i=t.length-1;r"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function j(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(j(e,t))return!0}while(e=e.nextSibling)}function D(){}function M(e,t,n,r){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&delete t._nsMap[n.prefix?n.localName:""]}function L(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var i=t.firstChild,o=0;i;)r[o++]=i,i=i.nextSibling;r.length=o}}}function U(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,L(e.ownerDocument,e),t}function F(e,t,n){var r=t.parentNode;if(r&&r.removeChild(t),t.nodeType===m){var i=t.firstChild;if(null==i)return t;var o=t.lastChild}else i=o=t;var a=n?n.previousSibling:e.lastChild;i.previousSibling=a,o.nextSibling=n,a?a.nextSibling=i:e.firstChild=i,null==n?e.lastChild=o:n.previousSibling=o;do{i.parentNode=e}while(i!==o&&(i=i.nextSibling));return L(e.ownerDocument||e,e),t.nodeType==m&&(t.firstChild=t.lastChild=null),t}function V(){this._nsMap={}}function B(){}function z(){}function q(){}function H(){}function W(){}function $(){}function G(){}function J(){}function K(){}function Q(){}function Y(){}function Z(){}function X(e,t){var n=[],r=9==this.nodeType?this.documentElement:this,i=r.prefix,o=r.namespaceURI;if(o&&null==i&&null==(i=r.lookupPrefix(o)))var a=[{namespace:o,prefix:null}];return te(this,n,e,t,a),n.join("")}function ee(e,t,n){var r=e.prefix||"",i=e.namespaceURI;if(!r&&!i)return!1;if("xml"===r&&"http://www.w3.org/XML/1998/namespace"===i||"http://www.w3.org/2000/xmlns/"==i)return!1;for(var o=n.length;o--;){var a=n[o];if(a.prefix==r)return a.namespace!=i}return!0}function te(e,t,n,r,o){if(r){if(!(e=r(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case a:o||(o=[]);var f=e.attributes,y=f.length,v=e.firstChild,b=e.tagName;n=i===e.namespaceURI||n,t.push("<",b);for(var w=0;w"),n&&/^script$/i.test(b))for(;v;)v.data?t.push(v.data):te(v,t,n,r,o),v=v.nextSibling;else for(;v;)te(v,t,n,r,o),v=v.nextSibling;t.push("")}else t.push("/>");return;case d:case m:for(v=e.firstChild;v;)te(v,t,n,r,o),v=v.nextSibling;return;case s:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,R),'"');case u:return t.push(e.data.replace(/[<&]/g,R));case l:return t.push("");case p:return t.push("\x3c!--",e.data,"--\x3e");case g:var k=e.publicId,C=e.systemId;if(t.push("');else if(C&&"."!=C)t.push(' SYSTEM "',C,'">');else{var T=e.internalSubset;T&&t.push(" [",T,"]"),t.push(">")}return;case h:return t.push("");case c:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function ne(e,t,n){e[t]=n}v.INVALID_STATE_ERR=(b[11]="Invalid state",11),v.SYNTAX_ERR=(b[12]="Syntax error",12),v.INVALID_MODIFICATION_ERR=(b[13]="Invalid modification",13),v.NAMESPACE_ERR=(b[14]="Invalid namespace",14),v.INVALID_ACCESS_ERR=(b[15]="Invalid access",15),S.prototype=Error.prototype,n(v,S),E.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var n=[],r=0;r0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var r in n)if(n[r]==e)return r;t=t.nodeType==s?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==s?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},n(o,N),n(o,N.prototype),D.prototype={nodeName:"#document",nodeType:d,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==m){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return null==this.documentElement&&e.nodeType==a&&(this.documentElement=e),F(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),U(this,e)},importNode:function(e,t){return function e(t,n,r){var i;switch(n.nodeType){case a:(i=n.cloneNode(!1)).ownerDocument=t;case m:break;case s:r=!0}if(i||(i=n.cloneNode(!1)),i.ownerDocument=t,i.parentNode=null,r)for(var o=n.firstChild;o;)i.appendChild(e(t,o,r)),o=o.nextSibling;return i}(this,e,t)},getElementById:function(e){var t=null;return j(this.documentElement,function(n){if(n.nodeType==a&&n.getAttribute("id")==e)return t=n,!0}),t},createElement:function(e){var t=new V;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new E,(t.attributes=new T)._ownerElement=t,t},createDocumentFragment:function(){var e=new Q;return e.ownerDocument=this,e.childNodes=new E,e},createTextNode:function(e){var t=new q;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new H;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new W;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new Y;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new B;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new K;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new V,r=t.split(":"),i=n.attributes=new T;return n.childNodes=new E,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new B,r=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},r(D,N),D.prototype.getElementsByTagName=(V.prototype={nodeType:a,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===m?this.insertBefore(e,null):function(e,t){var n=t.parentNode;if(n){var r=e.lastChild;n.removeChild(t),r=e.lastChild}return r=e.lastChild,t.parentNode=e,t.previousSibling=r,t.nextSibling=null,r?r.nextSibling=t:e.firstChild=t,e.lastChild=t,L(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new k(this,function(t){var n=[];return j(t,function(r){r===t||r.nodeType!=a||"*"!==e&&r.tagName!=e||n.push(r)}),n})},getElementsByTagNameNS:function(e,t){return new k(this,function(n){var r=[];return j(n,function(i){i===n||i.nodeType!==a||"*"!==e&&i.namespaceURI!==e||"*"!==t&&i.localName!=t||r.push(i)}),r})}}).getElementsByTagName,D.prototype.getElementsByTagNameNS=V.prototype.getElementsByTagNameNS,r(V,N),B.prototype.nodeType=s,r(B,N),z.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){this.nodeValue=this.data=e=this.data+e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(b[w])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},r(z,N),q.prototype={nodeName:"#text",nodeType:u,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},r(q,z),H.prototype={nodeName:"#comment",nodeType:p},r(H,z),W.prototype={nodeName:"#cdata-section",nodeType:l},r(W,z),$.prototype.nodeType=g,r($,N),G.prototype.nodeType=y,r(G,N),J.prototype.nodeType=f,r(J,N),K.prototype.nodeType=c,r(K,N),Q.prototype.nodeName="#document-fragment",Q.prototype.nodeType=m,r(Q,N),Y.prototype.nodeType=h,r(Y,N),Z.prototype.serializeToString=function(e,t,n){return X.call(e,t,n)},N.prototype.toString=X;try{Object.defineProperty&&(Object.defineProperty(k.prototype,"length",{get:function(){return C(this),this.$$length}}),Object.defineProperty(N.prototype,"textContent",{get:function(){return function e(t){switch(t.nodeType){case a:case m:var n=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&n.push(e(t)),t=t.nextSibling;return n.join("");default:return t.nodeValue}}(this)},set:function(e){switch(this.nodeType){case a:case m:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),ne=function(e,t,n){e["$$"+t]=n})}catch(e){}t.DOMImplementation=A,t.XMLSerializer=Z},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var s=n(9),u=n(14),l=n(20),c=n(15),f=n(13),h=n(2),p=n(3),d=n(37),g=n(24),m=n(25),y=function(e){function t(e,n,r,a){var s;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(s=i(this,o(t).call(this))).termType=t.termType,s.statements=e||[],s.constraints=n||[],s.initBindings=r||[],s.optional=a||[],s}var n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(t,p),(n=[{key:"add",value:function(e,t,n,r){return this.statements.push(new g(e,t,n,r))}},{key:"addStatement",value:function(e){return this.statements.push(e)}},{key:"bnode",value:function(e){return new s(e)}},{key:"addAll",value:function(e){var t=this;e.forEach(function(e){t.add(e.subject,e.predicate,e.object,e.graph)})}},{key:"any",value:function(e,t,n,r){var i=this.anyStatementMatching(e,t,n,r);if(null!=i)return null==e?i.subject:null==t?i.predicate:null==n?i.object:void 0}},{key:"anyValue",value:function(e,t,n,r){var i=this.any(e,t,n,r);return i?i.value:void 0}},{key:"anyStatementMatching",value:function(e,t,n,r){var i=this.statementsMatching(e,t,n,r,!0);if(i&&0!==i.length)return i[0]}},{key:"statementsMatching",value:function(e,t,n,r,i){return this.statements.filter(function(i){return(!e||e.sameTerm(i.subject))&&(!t||t.sameTerm(i.predicate))&&(!n||e.sameTerm(i.object))&&(!r||r.sameTerm(i.subject))})}},{key:"bottomTypeURIs",value:function(e){var t,n,r,i,o,a,s;for(i in t=[],e)if(e.hasOwnProperty(i)){for(s=e[i],n=!0,r=0,o=(a=this.each(void 0,this.sym("http://www.w3.org/2000/01/rdf-schema#subClassOf"),this.sym(i))).length;r as "+d+":\n"+e+":\n"+e.stack);g(e,n)}}(e)}function b(){g&&g(null,n)}function w(e,t){e&&g(e,n);try{m.parse(t,_)}catch(e){g(e,n)}}function _(e,t,r){if(e&&g(e,n),t)y.push(t);else{for(var i=0;i: Bad syntax:\n "+i+'\n at: "'+n.slice(r,r+30)+'"'};o=0;var p=t.sym(n+"#query");for(f.query=p;;){if((a=c.skipSpace(e,o))<0)return f;if(";"===e[a]){if((o=c.skipSpace(e,a+1))<0)return f;a=o}var d=!1;for(s=0;s=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,e.exports=n(64),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(e){r.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var n,r=Object.prototype,i=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag",l="object"==typeof e,c=t.regeneratorRuntime;if(c)l&&(e.exports=c);else{(c=t.regeneratorRuntime=l?e.exports:{}).wrap=w;var f="suspendedStart",h="suspendedYield",p="executing",d="completed",g={},m={};m[a]=function(){return this};var y=Object.getPrototypeOf,v=y&&y(y(A([])));v&&v!==r&&i.call(v,a)&&(m=v);var b=E.prototype=x.prototype=Object.create(m);S.prototype=b.constructor=E,E.constructor=S,E[u]=S.displayName="GeneratorFunction",c.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===S||"GeneratorFunction"===(t.displayName||t.name))},c.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(b),e},c.awrap=function(e){return{__await:e}},k(C.prototype),C.prototype[s]=function(){return this},c.AsyncIterator=C,c.async=function(e,t,n,r){var i=new C(w(e,t,n,r));return c.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},k(b),b[u]="Generator",b[a]=function(){return this},b.toString=function(){return"[object Generator]"},c.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},c.values=A,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(I),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,i){return s.type="throw",s.arg=e,t.next=r,i&&(t.method="next",t.arg=n),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),I(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;I(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=n),g}}}function w(e,t,n,r){var i=Object.create((t&&t.prototype instanceof x?t:x).prototype),o=new P(r||[]);return i._invoke=function(e,t,n){var r=f;return function(i,o){if(r===p)throw new Error("Generator is already running");if(r===d){if("throw"===i)throw o;return N()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=T(a,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=_(e,t,n);if("normal"===u.type){if(r=n.done?d:h,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=d,n.method="throw",n.arg=u.arg)}}}(e,n,o),i}function _(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function x(){}function S(){}function E(){}function k(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function C(e){var t;this._invoke=function(n,r){function o(){return new Promise(function(t,o){!function t(n,r,o,a){var s=_(e[n],e,r);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&i.call(l,"__await")?Promise.resolve(l.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):Promise.resolve(l).then(function(e){u.value=e,o(u)},function(e){return t("throw",e,o,a)})}a(s.arg)}(n,r,t,o)})}return t=t?t.then(o,o):o()}}function T(e,t){var r=e.iterator[t.method];if(r===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,T(e,t),"throw"===t.method))return g;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var i=_(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,g;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,g):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function A(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r=e.length&&n()}f(e,function(e){t(e,u(i))})},s.forEach=s.each,s.eachSeries=function(e,t,n){if(n=n||function(){},!e.length)return n();var r=0,i=function(){t(e[r],function(t){t?(n(t),n=function(){}):(r+=1)>=e.length?n():i()})};i()},s.forEachSeries=s.eachSeries,s.eachLimit=function(e,t,n,r){d(t).apply(null,[e,n,r])},s.forEachLimit=s.eachLimit;var d=function(e){return function(t,n,r){if(r=r||function(){},!t.length||e<=0)return r();var i=0,o=0,a=0;!function s(){if(i>=t.length)return r();for(;a=t.length?r():s())})}()}},g=function(e){return function(){var t=Array.prototype.slice.call(arguments);return e.apply(null,[s.each].concat(t))}},m=function(e){return function(){var t=Array.prototype.slice.call(arguments);return e.apply(null,[s.eachSeries].concat(t))}},y=function(e,t,n,r){if(t=h(t,function(e,t){return{index:t,value:e}}),r){var i=[];e(t,function(e,t){n(e.value,function(n,r){i[e.index]=r,t(n)})},function(e){r(e,i)})}else e(t,function(e,t){n(e.value,function(e){t(e)})})};s.map=g(y),s.mapSeries=m(y),s.mapLimit=function(e,t,n,r){return v(t)(e,n,r)};var v=function(e){return function(e,t){return function(){var n=Array.prototype.slice.call(arguments);return t.apply(null,[d(e)].concat(n))}}(e,y)};s.reduce=function(e,t,n,r){s.eachSeries(e,function(e,r){n(t,e,function(e,n){t=n,r(e)})},function(e){r(e,t)})},s.inject=s.reduce,s.foldl=s.reduce,s.reduceRight=function(e,t,n,r){var i=h(e,function(e){return e}).reverse();s.reduce(i,t,n,r)},s.foldr=s.reduceRight;var b=function(e,t,n,r){var i=[];e(t=h(t,function(e,t){return{index:t,value:e}}),function(e,t){n(e.value,function(n){n&&i.push(e),t()})},function(e){r(h(i.sort(function(e,t){return e.index-t.index}),function(e){return e.value}))})};s.filter=g(b),s.filterSeries=m(b),s.select=s.filter,s.selectSeries=s.filterSeries;var w=function(e,t,n,r){var i=[];e(t=h(t,function(e,t){return{index:t,value:e}}),function(e,t){n(e.value,function(n){n||i.push(e),t()})},function(e){r(h(i.sort(function(e,t){return e.index-t.index}),function(e){return e.value}))})};s.reject=g(w),s.rejectSeries=m(w);var _=function(e,t,n,r){e(t,function(e,t){n(e,function(n){n?(r(e),r=function(){}):t()})},function(e){r()})};s.detect=g(_),s.detectSeries=m(_),s.some=function(e,t,n){s.each(e,function(e,r){t(e,function(e){e&&(n(!0),n=function(){}),r()})},function(e){n(!1)})},s.any=s.some,s.every=function(e,t,n){s.each(e,function(e,r){t(e,function(e){e||(n(!1),n=function(){}),r()})},function(e){n(!0)})},s.all=s.every,s.sortBy=function(e,t,n){s.map(e,function(e,n){t(e,function(t,r){t?n(t):n(null,{value:e,criteria:r})})},function(e,t){if(e)return n(e);n(null,h(t.sort(function(e,t){var n=e.criteria,r=t.criteria;return nr?1:0}),function(e){return e.value}))})},s.auto=function(e,t){t=t||function(){};var n=p(e),r=n.length;if(!r)return t();var i={},o=[],a=function(e){o.unshift(e)},u=function(){r--,f(o.slice(0),function(e){e()})};a(function(){if(!r){var e=t;t=function(){},e(null,i)}}),f(n,function(n){var r=c(e[n])?e[n]:[e[n]],l=function(e){var r=Array.prototype.slice.call(arguments,1);if(r.length<=1&&(r=r[0]),e){var o={};f(p(i),function(e){o[e]=i[e]}),o[n]=r,t(e,o),t=function(){}}else i[n]=r,s.setImmediate(u)},h=r.slice(0,Math.abs(r.length-1))||[],d=function(){return t=function(e,t){return e&&i.hasOwnProperty(t)},r=!0,((e=h).reduce?e.reduce(t,r):(f(e,function(e,n,i){r=t(r,e)}),r))&&!i.hasOwnProperty(n);var e,t,r};if(d())r[r.length-1](l,i);else{var g=function(){d()&&(function(e){for(var t=0;t>>1);n(t,e[o])>=0?r=o:i=o-1}return r}(e.tasks,o,n)+1,0,o),e.saturated&&e.tasks.length===e.concurrency&&e.saturated(),s.setImmediate(e.process)})}(r,e,t,i)},delete r.unshift,r},s.cargo=function(e,t){var n=!1,r=[],i={tasks:r,payload:t,saturated:null,empty:null,drain:null,drained:!0,push:function(e,n){c(e)||(e=[e]),f(e,function(e){r.push({data:e,callback:"function"==typeof n?n:null}),i.drained=!1,i.saturated&&r.length===t&&i.saturated()}),s.setImmediate(i.process)},process:function o(){if(!n){if(0===r.length)return i.drain&&!i.drained&&i.drain(),void(i.drained=!0);var a=r.splice(0,"number"==typeof t?t:r.length),s=h(a,function(e){return e.data});i.empty&&i.empty(),n=!0,e(s,function(){n=!1;var e=arguments;f(a,function(t){t.callback&&t.callback.apply(null,e)}),o()})}},length:function(){return r.length},running:function(){return n}};return i};var E=function(e){return function(t){var n=Array.prototype.slice.call(arguments,1);t.apply(null,n.concat([function(t){var n=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(t?console.error&&console.error(t):console[e]&&f(n,function(t){console[e](t)}))}]))}};s.log=E("log"),s.dir=E("dir"),s.memoize=function(e,t){var n={},r={};t=t||function(e){return e};var i=function(){var i=Array.prototype.slice.call(arguments),o=i.pop(),a=t.apply(null,i);a in n?s.nextTick(function(){o.apply(null,n[a])}):a in r?r[a].push(o):(r[a]=[o],e.apply(null,i.concat([function(){n[a]=arguments;var e=r[a];delete r[a];for(var t=0,i=e.length;t2){var r=Array.prototype.slice.call(arguments,2);return n.apply(this,r)}return n};s.applyEach=g(k),s.applyEachSeries=m(k),s.forever=function(e,t){!function n(r){if(r){if(t)return t(r);throw r}e(n)}()},e.exports?e.exports=s:void 0===(i=(function(){return s}).apply(t,[]))||(e.exports=i)}()}).call(this,n(8),n(16).setImmediate)},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,o,a,s,u=1,l={},c=!1,f=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){d(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&d(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){o.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(d,0,e)},h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n0?r-4:r,f=0;f>16&255,s[u++]=t>>8&255,s[u++]=255&t;return 2===a&&(t=i[e.charCodeAt(f)]<<2|i[e.charCodeAt(f+1)]>>4,s[u++]=255&t),1===a&&(t=i[e.charCodeAt(f)]<<10|i[e.charCodeAt(f+1)]<<4|i[e.charCodeAt(f+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t),s},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=0,s=n-i;as?s:a+16383));return 1===i?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,n){for(var i,o=[],a=t;a>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,c=-7,f=n?i-1:0,h=n?-1:1,p=e[t+f];for(f+=h,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+e[t+f],f+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+f],f+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=l}return(p?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=d,s/=256,i-=8);for(a=a<0;e[n+p]=255&a,p+=d,a/=256,l-=8);e[n+p-d]|=128*g}},function(e,t){},function(e,t,n){"use strict";var r=n(22).Buffer,i=n(74);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t=r.allocUnsafe(e>>>0),n=this.head,i=0;n;)n.data.copy(t,i),i+=n.data.length,n=n.next;return t},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n(6))},function(e,t,n){"use strict";e.exports=o;var r=n(55),i=n(17);function o(e){if(!(this instanceof o))return new o(e);r.call(this,e)}i.inherits=n(11),i.inherits(o,r),o.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){e.exports=n(34)},function(e,t,n){e.exports=n(12)},function(e,t,n){e.exports=n(33).Transform},function(e,t,n){e.exports=n(33).PassThrough},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var s=n(3),u=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=i(this,o(t).call(this))).termType="DefaultGraph",e.value="",e}var n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(t,s),(n=[{key:"toCanonical",value:function(){return this.value}}])&&function(e,t){for(var n=0;n=t+n||t?new java.lang.String(e,t,n)+"":e}function u(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}r.prototype.parseFromString=function(e,t){var n=this.options,r=new l,o=n.domBuilder||new i,s=n.errorHandler,u=n.locator,c=n.xmlns||{},f={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return u&&o.setDocumentLocator(u),r.errorHandler=function(e,t,n){if(!e){if(t instanceof i)return t;e=t}var r={},o=e instanceof Function;function s(t){var i=e[t];!i&&o&&(i=2==e.length?function(n){e(t,n)}:e),r[t]=i&&function(e){i("[xmldom "+t+"]\t"+e+a(n))}||function(){}}return n=n||{},s("warning"),s("error"),s("fatalError"),r}(s,o,u),r.domBuilder=n.domBuilder||o,/\/x?html?$/.test(t)&&(f.nbsp="\xa0",f.copy="\xa9",c[""]="http://www.w3.org/1999/xhtml"),c.xml=c.xml||"http://www.w3.org/XML/1998/namespace",e?r.parse(e,c,f):r.errorHandler.error("invalid doc source"),o.doc},i.prototype={startDocument:function(){this.doc=(new c).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var i=this.doc,a=i.createElementNS(e,n||t),s=r.length;u(this,a),this.currentElement=a,this.locator&&o(this.locator,a);for(var l=0;l":switch(m){case o:n.setTagName(e.slice(t,g));case c:case f:case h:break;case l:case a:"/"===(v=e.slice(t,g)).slice(-1)&&(n.closed=!0,v=v.slice(0,-1));case s:m===s&&(v=d),m==l?(p.warning('attribute "'+v+'" missed quot(")!!'),n.add(d,v.replace(/&#?\w+;/g,i),t)):("http://www.w3.org/1999/xhtml"===r[""]&&v.match(/^(?:disabled|checked|selected)$/i)||p.warning('attribute "'+v+'" missed value!! "'+v+'" instead!!'),n.add(v,v,t));break;case u:throw new Error("attribute value missed!!")}return g;case"\x80":y=" ";default:if(y<=" ")switch(m){case o:n.setTagName(e.slice(t,g)),m=f;break;case a:d=e.slice(t,g),m=s;break;case l:var v=e.slice(t,g).replace(/&#?\w+;/g,i);p.warning('attribute "'+v+'" missed quot(")!!'),n.add(d,v,t);case c:m=f}else switch(m){case s:"http://www.w3.org/1999/xhtml"===r[""]&&d.match(/^(?:disabled|checked|selected)$/i)||p.warning('attribute "'+d+'" missed value!! "'+d+'" instead2!!'),n.add(d,d,t),t=g,m=a;break;case c:p.warning('attribute space is required"'+d+'"!!');case f:m=a,t=g;break;case u:m=l,t=g;break;case h:throw new Error("elements closed character '/' and '>' must be connected to")}}g++}}function m(e,t,n){for(var r=e.tagName,i=null,o=e.length;o--;){var a=e[o],s=a.qName,u=a.value;if((h=s.indexOf(":"))>0)var l=a.prefix=s.slice(0,h),c=s.slice(h+1),f="xmlns"===l&&c;else c=s,l=null,f="xmlns"===s&&"";a.localName=c,!1!==f&&(null==i&&(i={},b(n,n={})),n[f]=i[f]=u,a.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(f,u))}for(o=e.length;o--;)(l=(a=e[o]).prefix)&&("xml"===l&&(a.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==l&&(a.uri=n[l||""]));var h;(h=r.indexOf(":"))>0?(l=e.prefix=r.slice(0,h),c=e.localName=r.slice(h+1)):(l=null,c=e.localName=r);var p=e.uri=n[l||""];if(t.startElement(p,c,r,e),!e.closed)return e.currentNSMap=n,e.localNSMap=i,!0;if(t.endElement(p,c,r),i)for(l in i)t.endPrefixMapping(l)}function y(e,t,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var o=e.indexOf("",t),a=e.substring(t+1,o);if(/[&<]/.test(a))return/^script$/i.test(n)?(i.characters(a,0,a.length),o):(a=a.replace(/&#?\w+;/g,r),i.characters(a,0,a.length),o)}return t+1}function v(e,t,n,r){var i=r[n];return null==i&&((i=e.lastIndexOf(""))t?(n.comment(e,t+4,i-t-4),i+3):(r.error("Unclosed comment"),-1):-1;default:if("CDATA["==e.substr(t+3,6)){var i=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,i-t-9),n.endCDATA(),i+3}var o=function(e,t){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(e);n=i.exec(e);)if(r.push(n),n[1])return r}(e,t),a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var s=o[1][0],u=a>3&&/^public$/i.test(o[2][0])&&o[3][0],l=a>4&&o[4][0],c=o[a-1];return n.startDTD(s,u&&u.replace(/^(['"])(.*?)\1$/,"$2"),l&&l.replace(/^(['"])(.*?)\1$/,"$2")),n.endDTD(),c.index+c[0].length}}return-1}function _(e,t,n){var r=e.indexOf("?>",t);if(r){var i=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return i?(n.processingInstruction(i[1],i[2]),r+2):-1}return-1}function x(e){}function S(e,t){return e.__proto__=t,e}p.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),b(t,t={}),function(e,t,n,r,i){function o(e){var t=e.slice(1,-1);return t in n?n[t]:"#"===t.charAt(0)?function(e){if(e>65535){var t=55296+((e-=65536)>>10);return String.fromCharCode(t,56320+(1023&e))}return String.fromCharCode(e)}(parseInt(t.substr(1).replace("x","0x"))):(i.error("entity not found:"+e),e)}function a(t){if(t>b){var n=e.substring(b,t).replace(/&#?\w+;/g,o);f&&s(b),r.characters(n,0,t-b),b=t}}function s(t,n){for(;t>=l&&(n=c.exec(e));)l=(u=n.index)+n[0].length,f.lineNumber++;f.columnNumber=t-u+1}for(var u=0,l=0,c=/.*(?:\r\n?|\n)|.*$/g,f=r.locator,h=[{currentNSMap:t}],p={},b=0;;){try{var S=e.indexOf("<",b);if(S<0){if(!e.substr(b).match(/^\s*$/)){var E=r.doc,k=E.createTextNode(e.substr(b));E.appendChild(k),r.currentElement=k}return}switch(S>b&&a(S),e.charAt(S+1)){case"/":var C=e.indexOf(">",S+3),T=e.substring(S+2,C),O=h.pop();C<0?(T=e.substring(S+2).replace(/[\s<].*/,""),i.error("end tag name: "+T+" is not complete:"+O.tagName),C=S+1+T.length):T.match(/\sb?b=C:a(Math.max(S,b)+1)}}(e,t,n,r,this.errorHandler),r.endDocument()}},x.prototype={setTagName:function(e){if(!i.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},add:function(e,t,n){if(!i.test(e))throw new Error("invalid attribute:"+e);this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},S({},S.prototype)instanceof S||(S=function(e,t){function n(){}for(t in n.prototype=t,n=new n,e)n[t]=e[t];return n}),t.XMLReader=p},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var s=n(3),u=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=i(this,o(t).call(this))).termType=t.termType,e}var n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(t,s),(n=[{key:"toString",value:function(){return"()"}}])&&function(e,t){for(var n=0;n]*>$/)}function l(e){return"string"==typeof e&&(e.match(/^_:/)||e.match(/^$/))}function c(e){return"string"==typeof e&&e.match(/^:|^[^_][^:]*:/)}function f(e){return e.split(":")[0]}function h(e){return e.split(":")[1]}function p(e){return u(e)?e.slice(1,e.length-1):e}function d(e){e=e.replace(/\(/g," ( ").replace(/\)/g," ) ").replace(//g,"> ").replace(/{/g," { ").replace(/}/g," } ").replace(/[\t\n\r]/g," ").replace(/; /g," ; ").replace(/\. /g," . ").replace(/, /g," , "),r.info("New str into spaceDelimit: \n"+e);var t,n=[],i=e.split(" ");for(var o in i)"string"==typeof(t=i[o])&&t.match(/[^ \n\t]/)&&(n=n.concat(i[o]));return n}function g(e,t){for(var n=0;n"===e[1]?(r.debug("Constraint added: "+e),t.constraints[e[0]]=new v(e[2])):"<"===e[1]?(r.debug("Constraint added: "+e),t.constraints[e[0]]=new v(e[2])):r.warn("I don't know how to handle the constraint: "+e)}function _(e,t){r.debug("Optional query: "+e+" not yet implemented.");var i=n.formula();x(e,i),t.optional.push(i)}function x(e,t){var i,o,d=function(e){for(var t,i=[],o=0;o"):t,s(e[o])?i[o]=a(e[o].slice(1)):l(e[o])?(r.info(e[o]+" was identified as a bnode."),i[o]=n.bnode()):u(e[o])?(r.info(e[o]+" was identified as a symbol."),i[o]=n.sym(p(e[o]))):c(e[o])?(r.info(e[o]+" was identified as a prefixed symbol"),k[f(e[o])]?i[o]=n.sym(e[o]=k[f(e[o])]+h(e[o])):(r.error("SPARQL error: "+e[o]+" with prefix "+f(e[o])+" does not have a correct prefix entry."),i[o]=e[o])):i[o]=e[o]):i[o]=e[o];return i}(e);for(r.debug("WHERE: "+d);g("OPTIONAL",d);)o=g("OPTIONAL",d),r.debug("OPT: "+o+" "+d[o]+" in "+d),"{"!==d[o+1]&&r.warn("Bad optional opening bracket in word "+o),-1===(i=y(d.slice(o+2),"{","}"))?r.error("No matching bracket in word "+o):(_(d.slice(o+2,o+2+i),t),o=g("OPTIONAL",d),i=y(d.slice(o+2),"{","}"),d.splice(o,i+3));for(r.debug("WHERE after optionals: "+d);g("FILTER",d);){var v=g("FILTER",d);"("!==d[v+1]&&r.warn("Bad filter opening bracket in word "+v),-1===(i=y(d.slice(v+2),"(",")"))?r.error("No matching bracket in word "+v):(w(d.slice(v+2,v+2+i),t),v=g("FILTER",d),i=y(d.slice(v+2),"(",")"),d.splice(v,i+3))}r.debug("WHERE after filters and optionals: "+d),function(e,t){var n=new Array(1);n[0]=-1;for(var i=n.concat(m(".",e)),o=[],a=0;a"),"is"===t[n]&&"of"===t[n+2]){t.splice(n,1),t.splice(n+1,1);var r=t[n-1];t[n-1]=t[n+1],t[n+1]=r}return t}(),r.info("SPARQL Tokens: "+i),i}(e),k=function(e){var t,n=m("PREFIX",e),i=[];for(var o in n){var a=e[n[o]+1],s=e[n[o]+2];if("string"==typeof(t=a)&&t.match(/:$/))if(u(s)){r.info("Prefix found: "+a+" -> "+s);var l=f(a),c=p(s);i[l]=c}else r.error("Invalid SPARQL symbol: "+s);else r.error("Invalid SPARQL prefix: "+a)}return i}(E);k.rdf||(k.rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"),k.rdfs||(k.rdfs="http://www.w3.org/2000/01/rdf-schema#");var C=g("SELECT",E),T=g("WHERE",E);if(C<0||T<0||C>T)return r.error("Invalid or nonexistent SELECT and WHERE tags in SPARQL query"),!1;if(function(e,t){for(var n in r.info("SPARQL vars: "+e),e)if(s(e[n])){r.info("Added "+e[n]+" to query variables from SPARQL");var i=a(e[n].slice(1));t.vars.push(i),i.label=e[n].slice(1)}else r.warn("Incorrect SPARQL variable in SELECT: "+e[n])}(E.slice(C+1,T),S),x(E.slice(T+2,E.length-1),S.pat),t)return S;for(var O in S.pat.statements){var I=S.pat.statements[O];"NamedNode"===I.subject.termType&&n.fetcher&&n.fetcher.lookUpThing(I.subject,"sparql:"+I.subject),"NamedNode"===I.object.termType&&n.fetcher&&n.fetcher.lookUpThing(I.object,"sparql:"+I.object)}return S}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=n(18),o=n(4).docpart,a=n(36),s=n(23).namedNode,u=n(19),l=n(38),c=n(4).join,f=n(7),h=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=t||new i,this.store=t,t.updater)throw new Error("You can't have two UpdateManagers for the same store");t.fetcher||(t.fetcher=new a(t)),t.updater=this,this.ifps={},this.fps={},this.ns={},this.ns.link=u("http://www.w3.org/2007/ont/link#"),this.ns.http=u("http://www.w3.org/2007/ont/http#"),this.ns.httph=u("http://www.w3.org/2007/ont/httph#"),this.ns.ldp=u("http://www.w3.org/ns/ldp#"),this.ns.rdf=u("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.rdfs=u("http://www.w3.org/2000/01/rdf-schema#"),this.ns.rdf=u("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.owl=u("http://www.w3.org/2002/07/owl#"),this.patchControl=[]}var t;return(t=[{key:"patchControlFor",value:function(e){return this.patchControl[e.uri]||(this.patchControl[e.uri]=[]),this.patchControl[e.uri]}},{key:"editable",value:function(e,t){if(!e)return!1;if(t||(t=this.store),"file:///"===e.slice(0,8)){if(t.holds(t.sym(e),s("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),s("http://www.w3.org/2007/ont/link#MachineEditableDocument")))return"LOCALFILE";var n=t.statementsMatching(t.sym(e));return console.log("UpdateManager.editable: Not MachineEditableDocument file "+e+"\n"),console.log(n.map(function(e){return e.toNT()}).join("\n")),!1}var r,i,a=!1,u=t.each(void 0,this.ns.link("requestedURI"),o(e));if(t.holds(s(e),this.ns.rdf("type"),this.ns.ldp("Resource")))return"SPARQL";for(var l=0;l=0)return"SPARQL";var p=t.each(c,this.ns.httph("ms-author-via"));if(p.length)for(var d=0;d=0)return"SPARQL";if(i.indexOf("DAV")>=0)return"DAV"}var g=t.each(c,this.ns.http("status"));if(g.length)for(var m=0;m"),r.store.fetcher.webOperation("PATCH",e,{noMeta:!0,contentType:"application/sparql-update",body:t})}).then(function(r){if(!r.ok){var i="UpdateManager: update failed for <"+e+"> status="+r.status+", "+r.statusText+"\n for query: "+t;throw console.log(i),new Error(i)}console.log("UpdateManager: update Ok for <"+e+">"),n(e,r.ok,r.responseText,r)}).catch(function(t){n(e,!1,t.message,t)})}},{key:"update_statement",value:function(e){if(!e||e.why){var t=this,n=this.statementContext(e);return{statement:e?[e.subject,e.predicate,e.object,e.why]:void 0,statementNT:e?this.anonymizeNT(e):void 0,where:t.contextWhere(n),set_object:function(e,n){var r=this.where;r+="DELETE DATA { "+this.statementNT+" } ;\n",r+="INSERT DATA { "+this.anonymize(this.statement[0])+" "+this.anonymize(this.statement[1])+" "+this.anonymize(e)+" . }\n",t.fire(this.statement[3].uri,r,n)}}}}},{key:"insert_statement",value:function(e,t){var n=e instanceof Array?e[0]:e,r=this.contextWhere(this.statementContext(n));if(e instanceof Array){for(var i="",o=0;o 1 different downstream actions")}else n.downstreamAction=t;else t(e)}},{key:"clearUpstreamCount",value:function(e){this.patchControlFor(e).upstreamCount=0}},{key:"getUpdatesVia",value:function(e){var t=this.store.fetcher.getHeader(e,"updates-via");return t&&t.length?t[0].trim():null}},{key:"addDownstreamChangeListener",value:function(e,t){var n=this,r=this.patchControlFor(e);r.downstreamChangeListeners||(r.downstreamChangeListeners=[]),r.downstreamChangeListeners.push(t),this.setRefreshHandler(e,function(e){n.reloadAndSync(e)})}},{key:"reloadAndSync",value:function(e){var t=this.patchControlFor(e),n=this;if(t.reloading)console.log(" Already reloading - stop");else{t.reloading=!0;var r=1e3;!function i(){console.log("try reload - timeout = "+r),n.reload(n.store,e,function(n,o,a){if(t.reloading=!1,n){if(t.downstreamChangeListeners)for(var s=0;s=0))return void console.log("just an echo: "+l.upstreamCount);console.log("Assume a real downstream change: "+l.upstreamCount+" -> 0"),l.upstreamCount=0,i.requestDownstreamAction(e,r)}}}(),!0):(console.log("Server doies not support live updates thoughUpdates-Via :-("),!1)}},{key:"update",value:function(e,t,n,o){var a=this;try{var s=this.store,u=e?e instanceof i?e.statements:e instanceof Array?e:[e]:[],l=t?t instanceof i?t.statements:t instanceof Array?t:[t]:[];if(!(u instanceof Array))throw new Error("Type Error "+r(u)+": "+u);if(!(l instanceof Array))throw new Error("Type Error "+r(l)+": "+l);if(0===u.length&&0===l.length)return n(null,!0);var c=u.length?u[0].why:l[0].why;if(!c){var h="Error patching: statement does not specify which document to patch:"+u[0]+", "+l[0];throw console.log(h),new Error(h)}var p=this.patchControlFor(c),d=Date.now(),g=["subject","predicate","object","why"],m={delete:u,insert:l};["insert","delete"].map(function(e){m[e].map(function(e){if(!c.sameTerm(e.why))throw new Error("update: destination "+c+" inconsistent with delete quad "+e.why);g.map(function(t){if(void 0===e[t])throw new Error("update: undefined "+t+" of statement.")})})});var y=this.editable(c.uri,s);if(!1===y)throw new Error("Update: Can't make changes in uneditable "+c);if(void 0===y){if(o)throw new Error("Update: Loaded "+c+"but stil can't figure out what editing protcol it supports.");return console.log("Update: have not loaded ".concat(c," before: loading now...")),void this.store.fetcher.load(c).then(function(r){a.update(e,t,n,!0)},function(e){throw new Error("Update: Can't read ".concat(c," before patching: ").concat(e))})}if(y.indexOf("SPARQL")>=0){var v=[];u.length&&(v=this.statementArrayBnodes(u)),l.length&&(v=v.concat(this.statementArrayBnodes(l)));var b=this.bnodeContext(v,c),w=this.contextWhere(b),_="";if(w.length){if(u.length){_+="DELETE { ";for(var x=0;x=0)this.updateDav(c,u,l,n);else{if(!(y.indexOf("LOCALFILE")>=0))throw new Error("Unhandled edit method: '"+y+"' for "+c);try{this.updateLocalFile(c,u,l,n)}catch(e){n(c.uri,!1,"Exception trying to write back file <"+c.uri+">\n")}}}catch(e){n(void 0,!1,"Exception in update: "+e+"\n"+f.stackString(e))}}},{key:"updateDav",value:function(e,t,n,r){var i=this.store,o=i.any(e,this.ns.link("request"));if(!o)throw new Error("No record of our HTTP GET request for document: "+e);var a=i.any(o,this.ns.link("response"));if(!a)return null;for(var s=i.the(a,this.ns.httph("content-type")).value,u=i.statementsMatching(void 0,void 0,void 0,e).slice(),l=0;l>>");var d=e.uri.slice(7),g=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);if(g.initWithPath(d),!g.exists())throw new Error("Rewriting file <"+e.uri+"> but it does not exist!");var m=Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);m.init(g,42,parseInt("0666",8),0),m.write(p,p.length),m.close();for(var y=0;y3&&void 0!==arguments[3]?arguments[3]:"";return n=n||{},console.log("deepCopying "+e+"\n"+r+"-> "+t),e.match(/\/$/)||(e+="/"),t.match(/\/$/)||(t+="/"),new Promise(function(i,o){M(e).then(function(a){for(var s=[],u=a.folders.concat(a.files),l=function(){var i=u[c],o=function(e,t,n){if(!n.startsWith(e))throw new Error("source {".concat(n,"} is not in tree {").concat(e,"}"));return t+n.slice(e.length)}(e,t,i.url);"folder"===i.type?O(o).then(function(){s.push(y(i.url,o,n,r+" "))}):(console.log("copying "+o),s.push(_(i.url,o)))},c=0;c; rel="type"',a="text/turtle");var u={method:"POST",headers:{slug:n,link:s},body:i};void 0===a&&"undefined"==typeof window||(u.headers["Content-Type"]=a),r.auth.fetch(t,u).then(function(n){var r=n.headers.get("location"),i=r.substr(r.lastIndexOf("/")+1);e(t+i)},function(e){o(e)})}));case 1:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function O(e){return(function(){return s()(o.a.mark(function e(t){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){D(t).then(function(t){e()},function(r){I(t,void 0,"folder").then(function(t){e(t)},function(e){n(e)})})}));case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function I(e,t,n){return(function(){return s()(o.a.mark(function e(t,n,r){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,i){var o=t.replace(/\/$/,"").replace(/.*\//,"");C(t.substring(0,t.lastIndexOf(o)),o,n,r).then(function(t){e(t)},function(e){i(e)})}));case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function P(){return(function(){return s()(o.a.mark(function e(){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r.auth.logout());case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function A(e){return(function(){return s()(o.a.mark(function e(t){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",R(t));case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function N(e){return(function(){return s()(o.a.mark(function e(t){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",R(t));case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function R(e){return(function(){return s()(o.a.mark(function e(t){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){L(t,{method:"DELETE"}).then(function(t){e(t)},function(t){e(t)})}));case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function j(e,t,n){return(function(){return s()(o.a.mark(function e(t,n,r){var i;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R(t);case 2:if(!(i=e.sent).match||!i.match(/409/)){e.next=5;break}throw new Error("Coulnd't delete, conflict!");case 5:return e.next=7,I(t,n,r);case 7:return e.abrupt("return",i=e.sent);case 9:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function D(e){return(function(){return s()(o.a.mark(function e(t){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){L(t).then(function(t){e(t)},function(e){return n("fetch error "+e)})}));case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function M(e){return(function(){return s()(o.a.mark(function e(t){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return"/"!=t.substr(-1)&&(t+="/"),e.abrupt("return",new Promise(function(e,n){L(t).then(function(r){m(r,t,"text/turtle").then(function(n){e(d(n,t,r))},function(e){return n(e)})},function(e){return n(e)})}));case 2:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function L(e,t){return(function(){return s()(o.a.mark(function e(t,n){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,i){r.auth.fetch(t,n).then(function(n){n.ok||i(n.status+" ("+n.statusText+") "+t);var r=n.headers._headers?n.headers._headers["content-type"]:"";(r=r.toString()).match(/(image|audio|video)/)?n.buffer().then(function(t){e(t)},function(e){return i("buffer error "+e)}):n.text?n.text().then(function(t){e(t)},function(e){return i("buffer error "+e)}):e(n)},function(e){i("fetch errror "+e+t)})}));case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function U(e){return(function(){return s()(o.a.mark(function e(t){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r.auth.getCredentials(t));case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function F(e){return(function(){return s()(o.a.mark(function e(t){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",!0);case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function V(e,t){return(function(){return s()(o.a.mark(function e(t,n){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"==typeof window){e.next=2;break}return e.abrupt("return",F(t));case 2:return e.abrupt("return",new Promise(function(e,r){L(t,{encoding:null}).then(function(i){n.match(/\/$/)||(n+="/");var o=n+t.replace(/.*\//,"");try{fs.writeFileSync(o,i),e(o)}catch(e){r("write error "+o+" "+e)}},function(e){r("fetch error "+e)})}));case 3:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function B(e,t){return(function(){return s()(o.a.mark(function e(t,n){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"==typeof window){e.next=2;break}return e.abrupt("return",F(n));case 2:return e.abrupt("return",new Promise(function(e,r){var i=fs.readFileSync(t,"utf-8");n.match(/\/$/)||(n+="/"),A(n+=t.replace(/.*\//,"")).then(function(){I(n,i).then(function(){e(t)},function(e){r("create "+e)})},function(e){r("delete error "+e)})}));case 3:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}n.d(t,"copyFolder",function(){return y}),n.d(t,"guessFileType",function(){return v}),n.d(t,"processFolder",function(){return b}),n.d(t,"text2graph",function(){return w}),n.d(t,"copyFile",function(){return _}),n.d(t,"fetchAndParse",function(){return x}),n.d(t,"popupLogin",function(){return S}),n.d(t,"checkSession",function(){return E}),n.d(t,"login",function(){return k}),n.d(t,"add",function(){return C}),n.d(t,"createFolder",function(){return O}),n.d(t,"createFile",function(){return I}),n.d(t,"logout",function(){return P}),n.d(t,"deleteFile",function(){return A}),n.d(t,"deleteFolder",function(){return N}),n.d(t,"remove",function(){return R}),n.d(t,"updateFile",function(){return j}),n.d(t,"readFile",function(){return D}),n.d(t,"readFolder",function(){return M}),n.d(t,"fetch",function(){return L}),n.d(t,"getCredentials",function(){return U}),n.d(t,"doWin",function(){return F}),n.d(t,"downloadFile",function(){return V}),n.d(t,"uploadFile",function(){return B}),void 0!==l.a&&(r={auth:l.a})}])},crnd:function(e,t){function n(e){return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}n.keys=function(){return[]},n.resolve=n,e.exports=n,n.id="crnd"},zUnb:function(e,t,n){"use strict";n.r(t);var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function s(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function l(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function c(){for(var e=[],t=0;t0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(K);function ie(e){return e}function oe(e){return void 0===e&&(e=Number.POSITIVE_INFINITY),te(ie,e)}function ae(){for(var e=[],t=0;t1&&"number"==typeof e[e.length-1]&&(n=e.pop())):"number"==typeof i&&(n=e.pop()),null===r&&1===e.length&&e[0]instanceof I?e[0]:oe(n)(X(e,r))}function se(){return function(e){return e.lift(new ue(e))}}var ue=function(){function e(e){this.connectable=e}return e.prototype.call=function(e,t){var n=this.connectable;n._refCount++;var r=new le(e,n),i=t.subscribe(r);return r.closed||(r.connection=n.connect()),i},e}(),le=function(e){function t(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return i(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._refCount;if(t<=0)this.connection=null;else if(e._refCount=t-1,t>1)this.connection=null;else{var n=this.connection,r=e._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},t}(S),ce=function(e){function t(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return i(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype.connect=function(){var e=this._connection;return e||(this._isComplete=!1,(e=this._connection=new m).add(this.source.subscribe(new he(this.getSubject(),this))),e.closed?(this._connection=null,e=m.EMPTY):this._connection=e),e},t.prototype.refCount=function(){return se()(this)},t}(I).prototype,fe={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:ce._subscribe},_isComplete:{value:ce._isComplete,writable:!0},getSubject:{value:ce.getSubject},connect:{value:ce.connect},refCount:{value:ce.refCount}},he=function(e){function t(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return i(t,e),t.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},t.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}},t}(j);function pe(){return new D}function de(e){return{providedIn:e.providedIn||null,factory:e.factory,value:void 0}}var ge=function(){function e(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.ngInjectableDef=void 0!==t?de({providedIn:t.providedIn||"root",factory:t.factory}):void 0}return e.prototype.toString=function(){return"InjectionToken "+this._desc},e}(),me="__parameters__",ye="__prop__metadata__";function ve(e){return function(){for(var t=[],n=0;n ");else if("object"==typeof t){var i=[];for(var o in t)if(t.hasOwnProperty(o)){var a=t[o];i.push(o+":"+("string"==typeof a?JSON.stringify(a):Ne(a)))}r="{"+i.join(", ")+"}"}return"StaticInjectorError"+(n?"("+n+")":"")+"["+r+"]: "+e.replace(Ye,"\n ")}function nt(e,t){return new Error(tt(e,t))}function rt(e){for(var t in e)if(e[t]===Je)return t;throw Error("!prop")}var it=void 0;function ot(e){var t=it;return it=e,t}function at(e,t){if(void 0===t&&(t=0),void 0===it)throw new Error("inject() must be called from an injection context");if(null===it){var n=e.ngInjectableDef;if(n&&"root"==n.providedIn)return void 0===n.value?n.value=n.factory():n.value;if(8&t)return null;throw new Error("Injector: NOT_FOUND ["+Ne(e)+"]")}return it.get(e,8&t?null:void 0,t)}var st=function(e){return e[e.Emulated=0]="Emulated",e[e.Native=1]="Native",e[e.None=2]="None",e[e.ShadowDom=3]="ShadowDom",e}({}),ut=new(function(){return function(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}())("6.1.10"),lt="ngDebugContext",ct="ngOriginalError",ft="ngErrorLogger";function ht(e){return e[lt]}function pt(e){return e[ct]}function dt(e){for(var t=[],n=1;n0&&(i=setTimeout(function(){r._callbacks=r._callbacks.filter(function(e){return e.timeoutId!==i}),e(r._didWork,r.getPendingTasks())},t)),this._callbacks.push({doneCb:e,timeoutId:i,updateCb:n})},e.prototype.whenStable=function(e,t,n){if(n&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/dist/task-tracking.js" loaded?');this.addCallback(e,t,n),this._runCallbacksIfReady()},e.prototype.getPendingRequestCount=function(){return this._pendingCount},e.prototype.findProviders=function(e,t,n){return[]},e}(),on=function(){function e(){this._applications=new Map,an.addToWindow(this)}return e.prototype.registerApplication=function(e,t){this._applications.set(e,t)},e.prototype.unregisterApplication=function(e){this._applications.delete(e)},e.prototype.unregisterAllApplications=function(){this._applications.clear()},e.prototype.getTestability=function(e){return this._applications.get(e)||null},e.prototype.getAllTestabilities=function(){return Array.from(this._applications.values())},e.prototype.getAllRootElements=function(){return Array.from(this._applications.keys())},e.prototype.findTestabilityInTree=function(e,t){return void 0===t&&(t=!0),an.findTestabilityInTree(this,e,t)},a([s("design:paramtypes",[])],e)}(),an=new(function(){function e(){}return e.prototype.addToWindow=function(e){},e.prototype.findTestabilityInTree=function(e,t,n){return null},e}()),sn=!0,un=!1,ln=new ge("AllowMultipleToken");function cn(){return un=!0,sn}var fn=function(){return function(e,t){this.name=e,this.token=t}}();function hn(e,t,n){void 0===n&&(n=[]);var r="Platform: "+t,i=new ge(r);return function(t){void 0===t&&(t=[]);var o=pn();if(!o||o.injector.get(ln,!1))if(e)e(n.concat(t).concat({provide:i,useValue:!0}));else{var a=n.concat(t).concat({provide:i,useValue:!0});!function(e){if(tn&&!tn.destroyed&&!tn.injector.get(ln,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");tn=e.get(dn);var t=e.get(Et,null);t&&t.forEach(function(e){return e()})}(qe.create({providers:a,name:r}))}return function(e){var t=pn();if(!t)throw new Error("No platform exists!");if(!t.injector.get(e,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return t}(i)}}function pn(){return tn&&!tn.destroyed?tn:null}var dn=function(){function e(e){this._injector=e,this._modules=[],this._destroyListeners=[],this._destroyed=!1}return e.prototype.bootstrapModuleFactory=function(e,t){var n,r=this,i="noop"===(n=t?t.ngZone:void 0)?new nn:("zone.js"===n?void 0:n)||new Kt({enableLongStackTrace:cn()}),o=[{provide:Kt,useValue:i}];return i.run(function(){var t=qe.create({providers:o,parent:r.injector,name:e.moduleType.name}),n=e.create(t),a=n.injector.get(gt,null);if(!a)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return n.onDestroy(function(){return yn(r._modules,n)}),i.runOutsideAngular(function(){return i.onError.subscribe({next:function(e){a.handleError(e)}})}),function(e,t,i){try{var o=((a=n.injector.get(wt)).runInitializers(),a.donePromise.then(function(){return r._moduleDoBootstrap(n),n}));return yt(o)?o.catch(function(n){throw t.runOutsideAngular(function(){return e.handleError(n)}),n}):o}catch(s){throw t.runOutsideAngular(function(){return e.handleError(s)}),s}var a}(a,i)})},e.prototype.bootstrapModule=function(e,t){var n=this;void 0===t&&(t=[]);var r=this.injector.get(Pt),i=gn({},t);return r.createCompiler([i]).compileModuleAsync(e).then(function(e){return n.bootstrapModuleFactory(e,i)})},e.prototype._moduleDoBootstrap=function(e){var t=e.injector.get(mn);if(e._bootstrapComponents.length>0)e._bootstrapComponents.forEach(function(e){return t.bootstrap(e)});else{if(!e.instance.ngDoBootstrap)throw new Error("The module "+Ne(e.instance.constructor)+' was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.');e.instance.ngDoBootstrap(t)}this._modules.push(e)},e.prototype.onDestroy=function(e){this._destroyListeners.push(e)},Object.defineProperty(e.prototype,"injector",{get:function(){return this._injector},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(function(e){return e.destroy()}),this._destroyListeners.forEach(function(e){return e()}),this._destroyed=!0},Object.defineProperty(e.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!0,configurable:!0}),e}();function gn(e,t){return Array.isArray(t)?t.reduce(gn,e):o({},e,t)}var mn=function(){function e(e,t,n,r,i,o){var a=this;this._zone=e,this._console=t,this._injector=n,this._exceptionHandler=r,this._componentFactoryResolver=i,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._enforceNoNewChanges=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._enforceNoNewChanges=cn(),this._zone.onMicrotaskEmpty.subscribe({next:function(){a._zone.run(function(){a.tick()})}});var s=new I(function(e){a._stable=a._zone.isStable&&!a._zone.hasPendingMacrotasks&&!a._zone.hasPendingMicrotasks,a._zone.runOutsideAngular(function(){e.next(a._stable),e.complete()})}),u=new I(function(e){var t;a._zone.runOutsideAngular(function(){t=a._zone.onStable.subscribe(function(){Kt.assertNotInAngularZone(),Pe(function(){a._stable||a._zone.hasPendingMacrotasks||a._zone.hasPendingMicrotasks||(a._stable=!0,e.next(!0))})})});var n=a._zone.onUnstable.subscribe(function(){Kt.assertInAngularZone(),a._stable&&(a._stable=!1,a._zone.runOutsideAngular(function(){e.next(!1)}))});return function(){t.unsubscribe(),n.unsubscribe()}});this.isStable=ae(s,u.pipe(function(e){return se()((t=pe,function(e){var n;n="function"==typeof t?t:function(){return t};var r=Object.create(e,fe);return r.source=e,r.subjectFactory=n,r})(e));var t}))}var t;return t=e,e.prototype.bootstrap=function(e,t){var n,r=this;if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");n=e instanceof Nt?e:this._componentFactoryResolver.resolveComponentFactory(e),this.componentTypes.push(n.componentType);var i=n instanceof Vt?null:this._injector.get(Bt),o=n.create(qe.NULL,[],t||n.selector,i);o.onDestroy(function(){r._unloadComponent(o)});var a=o.injector.get(rn,null);return a&&o.injector.get(on).registerApplication(o.location.nativeElement,a),this._loadComponent(o),cn()&&this._console.log("Angular is running in the development mode. Call enableProdMode() to enable the production mode."),o},e.prototype.tick=function(){var e=this;if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");var n=t._tickScope();try{this._runningTick=!0,this._views.forEach(function(e){return e.detectChanges()}),this._enforceNoNewChanges&&this._views.forEach(function(e){return e.checkNoChanges()})}catch(r){this._zone.runOutsideAngular(function(){return e._exceptionHandler.handleError(r)})}finally{this._runningTick=!1,Gt(n)}},e.prototype.attachView=function(e){var t=e;this._views.push(t),t.attachToAppRef(this)},e.prototype.detachView=function(e){var t=e;yn(this._views,t),t.detachFromAppRef()},e.prototype._loadComponent=function(e){this.attachView(e.hostView),this.tick(),this.components.push(e),this._injector.get(Ct,[]).concat(this._bootstrapListeners).forEach(function(t){return t(e)})},e.prototype._unloadComponent=function(e){this.detachView(e.hostView),yn(this.components,e)},e.prototype.ngOnDestroy=function(){this._views.slice().forEach(function(e){return e.destroy()})},Object.defineProperty(e.prototype,"viewCount",{get:function(){return this._views.length},enumerable:!0,configurable:!0}),e._tickScope=$t("ApplicationRef#tick()"),e}();function yn(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var vn=function(){return function(){}}(),bn=function(){return function(){}}(),wn=function(e){return e[e.Important=1]="Important",e[e.DashCase=2]="DashCase",e}({}),_n=function(){return function(){}}(),xn=function(){return function(e){this.nativeElement=e}}(),Sn=function(){return function(){}}(),En=function(){function e(){this.dirty=!0,this._results=[],this.changes=new Jt,this.length=0}return e.prototype.map=function(e){return this._results.map(e)},e.prototype.filter=function(e){return this._results.filter(e)},e.prototype.find=function(e){return this._results.find(e)},e.prototype.reduce=function(e,t){return this._results.reduce(e,t)},e.prototype.forEach=function(e){this._results.forEach(e)},e.prototype.some=function(e){return this._results.some(e)},e.prototype.toArray=function(){return this._results.slice()},e.prototype[Ie()]=function(){return this._results[Ie()]()},e.prototype.toString=function(){return this._results.toString()},e.prototype.reset=function(e){this._results=function e(t){return t.reduce(function(t,n){var r=Array.isArray(n)?e(n):n;return t.concat(r)},[])}(e),this.dirty=!1,this.length=this._results.length,this.last=this._results[this.length-1],this.first=this._results[0]},e.prototype.notifyOnChanges=function(){this.changes.emit(this)},e.prototype.setDirty=function(){this.dirty=!0},e.prototype.destroy=function(){this.changes.complete(),this.changes.unsubscribe()},e}(),kn=function(){return function(){}}(),Cn={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"},Tn=function(){function e(e,t){this._compiler=e,this._config=t||Cn}return e.prototype.load=function(e){return this._compiler instanceof It?this.loadFactory(e):this.loadAndCompile(e)},e.prototype.loadAndCompile=function(e){var t=this,r=l(e.split("#"),2),i=r[0],o=r[1];return void 0===o&&(o="default"),n("crnd")(i).then(function(e){return e[o]}).then(function(e){return On(e,i,o)}).then(function(e){return t._compiler.compileModuleAsync(e)})},e.prototype.loadFactory=function(e){var t=l(e.split("#"),2),r=t[0],i=t[1],o="NgFactory";return void 0===i&&(i="default",o=""),n("crnd")(this._config.factoryPathPrefix+r+this._config.factoryPathSuffix).then(function(e){return e[i+o]}).then(function(e){return On(e,r,i)})},e}();function On(e,t,n){if(!e)throw new Error("Cannot find '"+n+"' in '"+t+"'");return e}var In=function(){return function(){}}(),Pn=function(){return function(){}}(),An=function(){return function(){}}(),Nn=function(){return function(e,t){this.name=e,this.callback=t}}(),Rn=function(){function e(e,t,n){this._debugContext=n,this.nativeNode=e,t&&t instanceof jn?t.addChild(this):this.parent=null,this.listeners=[]}return Object.defineProperty(e.prototype,"injector",{get:function(){return this._debugContext.injector},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"componentInstance",{get:function(){return this._debugContext.component},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"context",{get:function(){return this._debugContext.context},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"references",{get:function(){return this._debugContext.references},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"providerTokens",{get:function(){return this._debugContext.providerTokens},enumerable:!0,configurable:!0}),e}(),jn=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.properties={},i.attributes={},i.classes={},i.styles={},i.childNodes=[],i.nativeElement=t,i}return i(t,e),t.prototype.addChild=function(e){e&&(this.childNodes.push(e),e.parent=this)},t.prototype.removeChild=function(e){var t=this.childNodes.indexOf(e);-1!==t&&(e.parent=null,this.childNodes.splice(t,1))},t.prototype.insertChildrenAfter=function(e,t){var n,r=this,i=this.childNodes.indexOf(e);-1!==i&&((n=this.childNodes).splice.apply(n,c([i+1,0],t)),t.forEach(function(e){e.parent&&e.parent.removeChild(e),e.parent=r}))},t.prototype.insertBefore=function(e,t){var n=this.childNodes.indexOf(e);-1===n?this.addChild(t):(t.parent&&t.parent.removeChild(t),t.parent=this,this.childNodes.splice(n,0,t))},t.prototype.query=function(e){return this.queryAll(e)[0]||null},t.prototype.queryAll=function(e){var t=[];return function e(t,n,r){t.childNodes.forEach(function(t){t instanceof jn&&(n(t)&&r.push(t),e(t,n,r))})}(this,e,t),t},t.prototype.queryAllNodes=function(e){var t=[];return function e(t,n,r){t instanceof jn&&t.childNodes.forEach(function(t){n(t)&&r.push(t),t instanceof jn&&e(t,n,r)})}(this,e,t),t},Object.defineProperty(t.prototype,"children",{get:function(){return this.childNodes.filter(function(e){return e instanceof t})},enumerable:!0,configurable:!0}),t.prototype.triggerEventHandler=function(e,t){this.listeners.forEach(function(n){n.name==e&&n.callback(t)})},t}(Rn),Dn=new Map;function Mn(e){return Dn.get(e)||null}function Ln(e){Dn.set(e.nativeNode,e)}function Un(e,t){var n=Bn(e),r=Bn(t);return n&&r?function(e,t,n){for(var r=e[Ie()](),i=t[Ie()]();;){var o=r.next(),a=i.next();if(o.done&&a.done)return!0;if(o.done||a.done)return!1;if(!n(o.value,a.value))return!1}}(e,t,Un):!(n||!e||"object"!=typeof e&&"function"!=typeof e||r||!t||"object"!=typeof t&&"function"!=typeof t)||Ae(e,t)}var Fn=function(){function e(e){this.wrapped=e}return e.wrap=function(t){return new e(t)},e.unwrap=function(t){return e.isWrapped(t)?t.wrapped:t},e.isWrapped=function(t){return t instanceof e},e}(),Vn=function(){function e(e,t,n){this.previousValue=e,this.currentValue=t,this.firstChange=n}return e.prototype.isFirstChange=function(){return this.firstChange},e}();function Bn(e){return!!zn(e)&&(Array.isArray(e)||!(e instanceof Map)&&Ie()in e)}function zn(e){return null!==e&&("function"==typeof e||"object"==typeof e)}var qn=function(){function e(){}return e.prototype.supports=function(e){return Bn(e)},e.prototype.create=function(e){return new Wn(e)},e}(),Hn=function(e,t){return t},Wn=function(){function e(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||Hn}return e.prototype.forEachItem=function(e){var t;for(t=this._itHead;null!==t;t=t._next)e(t)},e.prototype.forEachOperation=function(e){for(var t=this._itHead,n=this._removalsHead,r=0,i=null;t||n;){var o=!n||t&&t.currentIndex',!this.inertBodyElement.querySelector||this.inertBodyElement.querySelector("svg")?(this.inertBodyElement.innerHTML='

',this.getInertBodyElement=this.inertBodyElement.querySelector&&this.inertBodyElement.querySelector("svg img")&&function(){try{return!!window.DOMParser}catch(e){return!1}}()?this.getInertBodyElement_DOMParser:this.getInertBodyElement_InertDocument):this.getInertBodyElement=this.getInertBodyElement_XHR}return e.prototype.getInertBodyElement_XHR=function(e){e=""+e+"";try{e=encodeURI(e)}catch(r){return null}var t=new XMLHttpRequest;t.responseType="document",t.open("GET","data:text/html;charset=utf-8,"+e,!1),t.send(null);var n=t.response.body;return n.removeChild(n.firstChild),n},e.prototype.getInertBodyElement_DOMParser=function(e){e=""+e+"";try{var t=(new window.DOMParser).parseFromString(e,"text/html").body;return t.removeChild(t.firstChild),t}catch(n){return null}},e.prototype.getInertBodyElement_InertDocument=function(e){var t=this.inertDocument.createElement("template");return"content"in t?(t.innerHTML=e,t):(this.inertBodyElement.innerHTML=e,this.defaultDoc.documentMode&&this.stripCustomNsAttrs(this.inertBodyElement),this.inertBodyElement)},e.prototype.stripCustomNsAttrs=function(e){for(var t=e.attributes,n=t.length-1;0")}else this.sanitizedSomething=!0},e.prototype.endElement=function(e){var t=e.nodeName.toLowerCase();_r.hasOwnProperty(t)&&!yr.hasOwnProperty(t)&&(this.buf.push(""))},e.prototype.chars=function(e){this.buf.push(Or(e))},e.prototype.checkClobberedElement=function(e,t){if(t&&(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error("Failed to sanitize html because the element is clobbered: "+e.outerHTML);return t},e}(),Cr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Tr=/([^\#-~ |!])/g;function Or(e){return e.replace(/&/g,"&").replace(Cr,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(Tr,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}function Ir(e){return"content"in e&&function(e){return e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.nodeName}(e)?e.content:null}var Pr=new RegExp("^([-,.\"'%_!# a-zA-Z0-9]+|(?:(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|3d)?|(?:rgb|hsl)a?|(?:repeating-)?(?:linear|radial)-gradient|(?:calc|attr))\\([-0-9.%, #a-zA-Z]+\\))$","g"),Ar=/^url\(([^)]+)\)$/,Nr=function(e){return e[e.NONE=0]="NONE",e[e.HTML=1]="HTML",e[e.STYLE=2]="STYLE",e[e.SCRIPT=3]="SCRIPT",e[e.URL=4]="URL",e[e.RESOURCE_URL=5]="RESOURCE_URL",e}({}),Rr=function(){return function(){}}();function jr(e,t,n){var r=e.state,i=1792&r;return i===t?(e.state=-1793&r|n,e.initIndex=-1,!0):i===n}function Dr(e,t,n){return(1792&e.state)===t&&e.initIndex<=n&&(e.initIndex=n+1,!0)}function Mr(e,t){return e.nodes[t]}function Lr(e,t){return e.nodes[t]}function Ur(e,t){return e.nodes[t]}function Fr(e,t){return e.nodes[t]}function Vr(e,t){return e.nodes[t]}var Br={setCurrentNode:void 0,createRootView:void 0,createEmbeddedView:void 0,createComponentView:void 0,createNgModuleRef:void 0,overrideProvider:void 0,overrideComponentView:void 0,clearOverrides:void 0,checkAndUpdateView:void 0,checkNoChangesView:void 0,destroyView:void 0,resolveDep:void 0,createDebugContext:void 0,handleEvent:void 0,updateDirectives:void 0,updateRenderer:void 0,dirtyParentQueries:void 0};function zr(e,t,n,r){var i="ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '"+t+"'. Current value: '"+n+"'.";return r&&(i+=" It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook ?"),function(e,t){var n=new Error(e);return qr(n,t),n}(i,e)}function qr(e,t){e[lt]=t,e[ft]=t.logError.bind(t)}function Hr(e){return new Error("ViewDestroyedError: Attempt to use a destroyed view: "+e)}var Wr=function(){},$r=new Map;function Gr(e){var t=$r.get(e);return t||(t=Ne(e)+"_"+$r.size,$r.set(e,t)),t}function Jr(e,t,n,r){if(Fn.isWrapped(r)){r=Fn.unwrap(r);var i=e.def.nodes[t].bindingIndex+n,o=Fn.unwrap(e.oldValues[i]);e.oldValues[i]=new Fn(o)}return r}var Kr="$$undefined",Qr="$$empty";function Yr(e){return{id:Kr,styles:e.styles,encapsulation:e.encapsulation,data:e.data}}var Zr=0;function Xr(e,t,n,r){return!(!(2&e.state)&&Ae(e.oldValues[t.bindingIndex+n],r))}function ei(e,t,n,r){return!!Xr(e,t,n,r)&&(e.oldValues[t.bindingIndex+n]=r,!0)}function ti(e,t,n,r){var i=e.oldValues[t.bindingIndex+n];if(1&e.state||!Un(i,r)){var o=t.bindings[n].name;throw zr(Br.createDebugContext(e,t.nodeIndex),o+": "+i,o+": "+r,0!=(1&e.state))}}function ni(e){for(var t=e;t;)2&t.def.flags&&(t.state|=8),t=t.viewContainerParent||t.parent}function ri(e,t){for(var n=e;n&&n!==t;)n.state|=64,n=n.viewContainerParent||n.parent}function ii(e,t,n,r){try{return ni(33554432&e.def.nodes[t].flags?Lr(e,t).componentView:e),Br.handleEvent(e,t,n,r)}catch(i){e.root.errorHandler.handleError(i)}}function oi(e){return e.parent?Lr(e.parent,e.parentNodeDef.nodeIndex):null}function ai(e){return e.parent?e.parentNodeDef.parent:null}function si(e,t){switch(201347067&t.flags){case 1:return Lr(e,t.nodeIndex).renderElement;case 2:return Mr(e,t.nodeIndex).renderText}}function ui(e){return!!e.parent&&!!(32768&e.parentNodeDef.flags)}function li(e){return!(!e.parent||32768&e.parentNodeDef.flags)}function ci(e){return 1<-1}(r)||"root"===i.providedIn&&r._def.isRoot))){var l=e._providers.length;return e._def.providersByKey[t.tokenKey]={flags:5120,value:t.token.ngInjectableDef.factory,deps:[],index:l,token:t.token},e._providers[l]=Pi,e._providers[l]=Mi(e,e._def.providersByKey[t.tokenKey])}return 4&t.flags?n:e._parent.get(t.token,n)}finally{ot(o)}}function Mi(e,t){var n;switch(201347067&t.flags){case 512:n=function(e,t,n){var r=n.length;switch(r){case 0:return new t;case 1:return new t(Di(e,n[0]));case 2:return new t(Di(e,n[0]),Di(e,n[1]));case 3:return new t(Di(e,n[0]),Di(e,n[1]),Di(e,n[2]));default:for(var i=new Array(r),o=0;o=n.length)&&(t=n.length-1),t<0)return null;var r=n[t];return r.viewContainerParent=null,Bi(n,t),Br.dirtyParentQueries(r),Fi(r),r}function Ui(e,t,n){var r=t?si(t,t.def.lastRenderRootNode):e.renderElement,i=n.renderer.parentNode(r),o=n.renderer.nextSibling(r);mi(n,2,i,o,void 0)}function Fi(e){mi(e,3,null,null,void 0)}function Vi(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function Bi(e,t){t>=e.length-1?e.pop():e.splice(t,1)}var zi=new Object;function qi(e,t,n,r,i,o){return new Hi(e,t,n,r,i,o)}var Hi=function(e){function t(t,n,r,i,o,a){var s=e.call(this)||this;return s.selector=t,s.componentType=n,s._inputs=i,s._outputs=o,s.ngContentSelectors=a,s.viewDefFactory=r,s}return i(t,e),Object.defineProperty(t.prototype,"inputs",{get:function(){var e=[],t=this._inputs;for(var n in t)e.push({propName:n,templateName:t[n]});return e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"outputs",{get:function(){var e=[];for(var t in this._outputs)e.push({propName:t,templateName:this._outputs[t]});return e},enumerable:!0,configurable:!0}),t.prototype.create=function(e,t,n,r){if(!r)throw new Error("ngModule should be provided");var i=gi(this.viewDefFactory),o=i.nodes[0].element.componentProvider.nodeIndex,a=Br.createRootView(e,t||[],n,i,r,zi),s=Ur(a,o).instance;return n&&a.renderer.setAttribute(Lr(a,0).renderElement,"ng-version",ut.full),new Wi(a,new Ki(a),s)},t}(Nt),Wi=function(e){function t(t,n,r){var i=e.call(this)||this;return i._view=t,i._viewRef=n,i._component=r,i._elDef=i._view.def.nodes[0],i.hostView=n,i.changeDetectorRef=n,i.instance=r,i}return i(t,e),Object.defineProperty(t.prototype,"location",{get:function(){return new xn(Lr(this._view,this._elDef.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"injector",{get:function(){return new Xi(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentType",{get:function(){return this._component.constructor},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){this._viewRef.destroy()},t.prototype.onDestroy=function(e){this._viewRef.onDestroy(e)},t}(At);function $i(e,t,n){return new Gi(e,t,n)}var Gi=function(){function e(e,t,n){this._view=e,this._elDef=t,this._data=n,this._embeddedViews=[]}return Object.defineProperty(e.prototype,"element",{get:function(){return new xn(this._data.renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"injector",{get:function(){return new Xi(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentInjector",{get:function(){for(var e=this._view,t=this._elDef.parent;!t&&e;)t=ai(e),e=e.parent;return e?new Xi(e,t):new Xi(this._view,null)},enumerable:!0,configurable:!0}),e.prototype.clear=function(){for(var e=this._embeddedViews.length-1;e>=0;e--){var t=Li(this._data,e);Br.destroyView(t)}},e.prototype.get=function(e){var t=this._embeddedViews[e];if(t){var n=new Ki(t);return n.attachToViewContainerRef(this),n}return null},Object.defineProperty(e.prototype,"length",{get:function(){return this._embeddedViews.length},enumerable:!0,configurable:!0}),e.prototype.createEmbeddedView=function(e,t,n){var r=e.createEmbeddedView(t||{});return this.insert(r,n),r},e.prototype.createComponent=function(e,t,n,r,i){var o=n||this.parentInjector;i||e instanceof Vt||(i=o.get(Bt));var a=e.create(o,r,void 0,i);return this.insert(a.hostView,t),a},e.prototype.insert=function(e,t){if(e.destroyed)throw new Error("Cannot insert a destroyed View in a ViewContainer!");var n,r,i,o,a=e;return o=(n=this._data).viewContainer._embeddedViews,null==(r=t)&&(r=o.length),(i=a._view).viewContainerParent=this._view,Vi(o,r,i),function(e,t){var n=oi(t);if(n&&n!==e&&!(16&t.state)){t.state|=16;var r=n.template._projectedViews;r||(r=n.template._projectedViews=[]),r.push(t),function(e,n){if(!(4&n.flags)){t.parent.def.nodeFlags|=4,n.flags|=4;for(var r=n.parent;r;)r.childFlags|=4,r=r.parent}}(0,t.parentNodeDef)}}(n,i),Br.dirtyParentQueries(i),Ui(n,r>0?o[r-1]:null,i),a.attachToViewContainerRef(this),e},e.prototype.move=function(e,t){if(e.destroyed)throw new Error("Cannot move a destroyed View in a ViewContainer!");var n,r,i,o,a,s=this._embeddedViews.indexOf(e._view);return i=t,a=(o=(n=this._data).viewContainer._embeddedViews)[r=s],Bi(o,r),null==i&&(i=o.length),Vi(o,i,a),Br.dirtyParentQueries(a),Fi(a),Ui(n,i>0?o[i-1]:null,a),e},e.prototype.indexOf=function(e){return this._embeddedViews.indexOf(e._view)},e.prototype.remove=function(e){var t=Li(this._data,e);t&&Br.destroyView(t)},e.prototype.detach=function(e){var t=Li(this._data,e);return t?new Ki(t):null},e}();function Ji(e){return new Ki(e)}var Ki=function(){function e(e){this._view=e,this._viewContainerRef=null,this._appRef=null}return Object.defineProperty(e.prototype,"rootNodes",{get:function(){return mi(this._view,0,void 0,void 0,e=[]),e;var e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"context",{get:function(){return this._view.context},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"destroyed",{get:function(){return 0!=(128&this._view.state)},enumerable:!0,configurable:!0}),e.prototype.markForCheck=function(){ni(this._view)},e.prototype.detach=function(){this._view.state&=-5},e.prototype.detectChanges=function(){var e=this._view.root.rendererFactory;e.begin&&e.begin();try{Br.checkAndUpdateView(this._view)}finally{e.end&&e.end()}},e.prototype.checkNoChanges=function(){Br.checkNoChangesView(this._view)},e.prototype.reattach=function(){this._view.state|=4},e.prototype.onDestroy=function(e){this._view.disposables||(this._view.disposables=[]),this._view.disposables.push(e)},e.prototype.destroy=function(){this._appRef?this._appRef.detachView(this):this._viewContainerRef&&this._viewContainerRef.detach(this._viewContainerRef.indexOf(this)),Br.destroyView(this._view)},e.prototype.detachFromAppRef=function(){this._appRef=null,Fi(this._view),Br.dirtyParentQueries(this._view)},e.prototype.attachToAppRef=function(e){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e},e.prototype.attachToViewContainerRef=function(e){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=e},e}();function Qi(e,t){return new Yi(e,t)}var Yi=function(e){function t(t,n){var r=e.call(this)||this;return r._parentView=t,r._def=n,r}return i(t,e),t.prototype.createEmbeddedView=function(e){return new Ki(Br.createEmbeddedView(this._parentView,this._def,this._def.element.template,e))},Object.defineProperty(t.prototype,"elementRef",{get:function(){return new xn(Lr(this._parentView,this._def.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),t}(In);function Zi(e,t){return new Xi(e,t)}var Xi=function(){function e(e,t){this.view=e,this.elDef=t}return e.prototype.get=function(e,t){return void 0===t&&(t=qe.THROW_IF_NOT_FOUND),Br.resolveDep(this.view,this.elDef,!!this.elDef&&0!=(33554432&this.elDef.flags),{flags:0,token:e,tokenKey:Gr(e)},t)},e}();function eo(e,t){var n=e.def.nodes[t];if(1&n.flags){var r=Lr(e,n.nodeIndex);return n.element.template?r.template:r.renderElement}if(2&n.flags)return Mr(e,n.nodeIndex).renderText;if(20240&n.flags)return Ur(e,n.nodeIndex).instance;throw new Error("Illegal state: read nodeValue for node index "+t)}function to(e){return new no(e.renderer)}var no=function(){function e(e){this.delegate=e}return e.prototype.selectRootElement=function(e){return this.delegate.selectRootElement(e)},e.prototype.createElement=function(e,t){var n=l(xi(t),2),r=this.delegate.createElement(n[1],n[0]);return e&&this.delegate.appendChild(e,r),r},e.prototype.createViewRoot=function(e){return e},e.prototype.createTemplateAnchor=function(e){var t=this.delegate.createComment("");return e&&this.delegate.appendChild(e,t),t},e.prototype.createText=function(e,t){var n=this.delegate.createText(t);return e&&this.delegate.appendChild(e,n),n},e.prototype.projectNodes=function(e,t){for(var n=0;n0,t.provider.value,t.provider.deps);if(t.outputs.length)for(var r=0;r0,r=t.provider;switch(201347067&t.flags){case 512:return So(e,t.parent,n,r.value,r.deps);case 1024:return function(e,t,n,r,i){var o=i.length;switch(o){case 0:return r();case 1:return r(ko(e,t,n,i[0]));case 2:return r(ko(e,t,n,i[0]),ko(e,t,n,i[1]));case 3:return r(ko(e,t,n,i[0]),ko(e,t,n,i[1]),ko(e,t,n,i[2]));default:for(var a=Array(o),s=0;s0)l=g,Ho(g)||(c=g);else for(;l&&d===l.nodeIndex+l.childCount;){var v=l.parent;v&&(v.childFlags|=l.childFlags,v.childMatchedQueries|=l.childMatchedQueries),c=(l=v)&&Ho(l)?l.renderParent:l}}return{factory:null,nodeFlags:a,rootNodeFlags:s,nodeMatchedQueries:u,flags:e,nodes:t,updateDirectives:n||Wr,updateRenderer:r||Wr,handleEvent:function(e,n,r,i){return t[n].element.handleEvent(e,r,i)},bindingCount:i,outputCount:o,lastRenderRootNode:p}}function Ho(e){return 0!=(1&e.flags)&&null===e.element.name}function Wo(e,t,n){var r=t.element&&t.element.template;if(r){if(!r.lastRenderRootNode)throw new Error("Illegal State: Embedded templates without nodes are not allowed!");if(r.lastRenderRootNode&&16777216&r.lastRenderRootNode.flags)throw new Error("Illegal State: Last root node of a template can't have embedded views, at index "+t.nodeIndex+"!")}if(20224&t.flags&&0==(1&(e?e.flags:0)))throw new Error("Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index "+t.nodeIndex+"!");if(t.query){if(67108864&t.flags&&(!e||0==(16384&e.flags)))throw new Error("Illegal State: Content Query nodes need to be children of directives, at index "+t.nodeIndex+"!");if(134217728&t.flags&&e)throw new Error("Illegal State: View Query nodes have to be top level nodes, at index "+t.nodeIndex+"!")}if(t.childCount){var i=e?e.nodeIndex+e.childCount:n-1;if(t.nodeIndex<=i&&t.nodeIndex+t.childCount>i)throw new Error("Illegal State: childCount of node leads outside of parent, at index "+t.nodeIndex+"!")}}function $o(e,t,n,r){var i=Ko(e.root,e.renderer,e,t,n);return Qo(i,e.component,r),Yo(i),i}function Go(e,t,n){var r=Ko(e,e.renderer,null,null,t);return Qo(r,n,n),Yo(r),r}function Jo(e,t,n,r){var i,o=t.element.componentRendererType;return i=o?e.root.rendererFactory.createRenderer(r,o):e.root.renderer,Ko(e.root,i,e,t.element.componentProvider,n)}function Ko(e,t,n,r,i){var o=new Array(i.nodes.length),a=i.outputCount?new Array(i.outputCount):null;return{def:i,parent:n,viewContainerParent:null,parentNodeDef:r,context:null,component:null,nodes:o,state:13,root:e,renderer:t,oldValues:new Array(i.bindingCount),disposables:a,initIndex:-1}}function Qo(e,t,n){e.component=t,e.context=n}function Yo(e){var t;ui(e)&&(t=Lr(e.parent,e.parentNodeDef.parent.nodeIndex).renderElement);for(var n=e.def,r=e.nodes,i=0;i0&&Ii(e,t,0,n)&&(p=!0),h>1&&Ii(e,t,1,r)&&(p=!0),h>2&&Ii(e,t,2,i)&&(p=!0),h>3&&Ii(e,t,3,o)&&(p=!0),h>4&&Ii(e,t,4,a)&&(p=!0),h>5&&Ii(e,t,5,s)&&(p=!0),h>6&&Ii(e,t,6,u)&&(p=!0),h>7&&Ii(e,t,7,l)&&(p=!0),h>8&&Ii(e,t,8,c)&&(p=!0),h>9&&Ii(e,t,9,f)&&(p=!0),p}(e,t,n,r,i,o,a,s,u,l,c,f);case 2:return function(e,t,n,r,i,o,a,s,u,l,c,f){var h=!1,p=t.bindings,d=p.length;if(d>0&&ei(e,t,0,n)&&(h=!0),d>1&&ei(e,t,1,r)&&(h=!0),d>2&&ei(e,t,2,i)&&(h=!0),d>3&&ei(e,t,3,o)&&(h=!0),d>4&&ei(e,t,4,a)&&(h=!0),d>5&&ei(e,t,5,s)&&(h=!0),d>6&&ei(e,t,6,u)&&(h=!0),d>7&&ei(e,t,7,l)&&(h=!0),d>8&&ei(e,t,8,c)&&(h=!0),d>9&&ei(e,t,9,f)&&(h=!0),h){var g=t.text.prefix;d>0&&(g+=zo(n,p[0])),d>1&&(g+=zo(r,p[1])),d>2&&(g+=zo(i,p[2])),d>3&&(g+=zo(o,p[3])),d>4&&(g+=zo(a,p[4])),d>5&&(g+=zo(s,p[5])),d>6&&(g+=zo(u,p[6])),d>7&&(g+=zo(l,p[7])),d>8&&(g+=zo(c,p[8])),d>9&&(g+=zo(f,p[9]));var m=Mr(e,t.nodeIndex).renderText;e.renderer.setValue(m,g)}return h}(e,t,n,r,i,o,a,s,u,l,c,f);case 16384:return function(e,t,n,r,i,o,a,s,u,l,c,f){var h=Ur(e,t.nodeIndex),p=h.instance,d=!1,g=void 0,m=t.bindings.length;return m>0&&Xr(e,t,0,n)&&(d=!0,g=To(e,h,t,0,n,g)),m>1&&Xr(e,t,1,r)&&(d=!0,g=To(e,h,t,1,r,g)),m>2&&Xr(e,t,2,i)&&(d=!0,g=To(e,h,t,2,i,g)),m>3&&Xr(e,t,3,o)&&(d=!0,g=To(e,h,t,3,o,g)),m>4&&Xr(e,t,4,a)&&(d=!0,g=To(e,h,t,4,a,g)),m>5&&Xr(e,t,5,s)&&(d=!0,g=To(e,h,t,5,s,g)),m>6&&Xr(e,t,6,u)&&(d=!0,g=To(e,h,t,6,u,g)),m>7&&Xr(e,t,7,l)&&(d=!0,g=To(e,h,t,7,l,g)),m>8&&Xr(e,t,8,c)&&(d=!0,g=To(e,h,t,8,c,g)),m>9&&Xr(e,t,9,f)&&(d=!0,g=To(e,h,t,9,f,g)),g&&p.ngOnChanges(g),65536&t.flags&&Dr(e,256,t.nodeIndex)&&p.ngOnInit(),262144&t.flags&&p.ngDoCheck(),d}(e,t,n,r,i,o,a,s,u,l,c,f);case 32:case 64:case 128:return function(e,t,n,r,i,o,a,s,u,l,c,f){var h=t.bindings,p=!1,d=h.length;if(d>0&&ei(e,t,0,n)&&(p=!0),d>1&&ei(e,t,1,r)&&(p=!0),d>2&&ei(e,t,2,i)&&(p=!0),d>3&&ei(e,t,3,o)&&(p=!0),d>4&&ei(e,t,4,a)&&(p=!0),d>5&&ei(e,t,5,s)&&(p=!0),d>6&&ei(e,t,6,u)&&(p=!0),d>7&&ei(e,t,7,l)&&(p=!0),d>8&&ei(e,t,8,c)&&(p=!0),d>9&&ei(e,t,9,f)&&(p=!0),p){var g=Fr(e,t.nodeIndex),m=void 0;switch(201347067&t.flags){case 32:m=new Array(h.length),d>0&&(m[0]=n),d>1&&(m[1]=r),d>2&&(m[2]=i),d>3&&(m[3]=o),d>4&&(m[4]=a),d>5&&(m[5]=s),d>6&&(m[6]=u),d>7&&(m[7]=l),d>8&&(m[8]=c),d>9&&(m[9]=f);break;case 64:m={},d>0&&(m[h[0].name]=n),d>1&&(m[h[1].name]=r),d>2&&(m[h[2].name]=i),d>3&&(m[h[3].name]=o),d>4&&(m[h[4].name]=a),d>5&&(m[h[5].name]=s),d>6&&(m[h[6].name]=u),d>7&&(m[h[7].name]=l),d>8&&(m[h[8].name]=c),d>9&&(m[h[9].name]=f);break;case 128:var y=n;switch(d){case 1:m=y.transform(n);break;case 2:m=y.transform(r);break;case 3:m=y.transform(r,i);break;case 4:m=y.transform(r,i,o);break;case 5:m=y.transform(r,i,o,a);break;case 6:m=y.transform(r,i,o,a,s);break;case 7:m=y.transform(r,i,o,a,s,u);break;case 8:m=y.transform(r,i,o,a,s,u,l);break;case 9:m=y.transform(r,i,o,a,s,u,l,c);break;case 10:m=y.transform(r,i,o,a,s,u,l,c,f)}}g.value=m}return p}(e,t,n,r,i,o,a,s,u,l,c,f);default:throw"unreachable"}}(e,t,r,i,o,a,s,u,l,f,h,p):function(e,t,n){switch(201347067&t.flags){case 1:return function(e,t,n){for(var r=!1,i=0;i0&&ti(e,t,0,n),h>1&&ti(e,t,1,r),h>2&&ti(e,t,2,i),h>3&&ti(e,t,3,o),h>4&&ti(e,t,4,a),h>5&&ti(e,t,5,s),h>6&&ti(e,t,6,u),h>7&&ti(e,t,7,l),h>8&&ti(e,t,8,c),h>9&&ti(e,t,9,f)}(e,t,r,i,o,a,s,u,l,c,f,h):function(e,t,n){for(var r=0;r0){var o=new Set(e.modules);ba.forEach(function(t,r){if(o.has(r.ngInjectableDef.providedIn)){var i={token:r,flags:t.flags|(n?4096:0),deps:hi(t.deps),value:t.value,index:e.providers.length};e.providers.push(i),e.providersByKey[Gr(r)]=i}})}}(e=e.factory(function(){return Wr})),e):e}(r))}var va=new Map,ba=new Map,wa=new Map;function _a(e){va.set(e.token,e),"function"==typeof e.token&&e.token.ngInjectableDef&&"function"==typeof e.token.ngInjectableDef.providedIn&&ba.set(e.token,e)}function xa(e,t){var n=gi(t.viewDefFactory),r=gi(n.nodes[0].element.componentView);wa.set(e,r)}function Sa(){va.clear(),ba.clear(),wa.clear()}function Ea(e){if(0===va.size)return e;var t=function(e){for(var t=[],n=null,r=0;r0?t.substring(1):t},t.prototype.prepareExternalUrl=function(e){var t=rs.joinWithSlash(this._baseHref,e);return t.length>0?"#"+t:t},t.prototype.pushState=function(e,t,n,r){var i=this.prepareExternalUrl(n+rs.normalizeQueryParams(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.pushState(e,t,i)},t.prototype.replaceState=function(e,t,n,r){var i=this.prepareExternalUrl(n+rs.normalizeQueryParams(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.replaceState(e,t,i)},t.prototype.forward=function(){this._platformLocation.forward()},t.prototype.back=function(){this._platformLocation.back()},t}(ts),as=function(e){function t(t,n){var r=e.call(this)||this;if(r._platformLocation=t,null==n&&(n=r._platformLocation.getBaseHrefFromDOM()),null==n)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");return r._baseHref=n,r}return i(t,e),t.prototype.onPopState=function(e){this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e)},t.prototype.getBaseHref=function(){return this._baseHref},t.prototype.prepareExternalUrl=function(e){return rs.joinWithSlash(this._baseHref,e)},t.prototype.path=function(e){void 0===e&&(e=!1);var t=this._platformLocation.pathname+rs.normalizeQueryParams(this._platformLocation.search),n=this._platformLocation.hash;return n&&e?""+t+n:t},t.prototype.pushState=function(e,t,n,r){var i=this.prepareExternalUrl(n+rs.normalizeQueryParams(r));this._platformLocation.pushState(e,t,i)},t.prototype.replaceState=function(e,t,n,r){var i=this.prepareExternalUrl(n+rs.normalizeQueryParams(r));this._platformLocation.replaceState(e,t,i)},t.prototype.forward=function(){this._platformLocation.forward()},t.prototype.back=function(){this._platformLocation.back()},t}(ts),ss=void 0,us=["en",[["a","p"],["AM","PM"],ss],[["AM","PM"],ss,ss],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],ss,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],ss,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",ss,"{1} 'at' {0}",ss],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"$","US Dollar",{},function(e){var t=Math.floor(Math.abs(e)),n=e.toString().replace(/^[^.]*\.?/,"").length;return 1===t&&0===n?1:5}],ls={},cs=function(e){return e[e.Zero=0]="Zero",e[e.One=1]="One",e[e.Two=2]="Two",e[e.Few=3]="Few",e[e.Many=4]="Many",e[e.Other=5]="Other",e}({}),fs=function(e){return e[e.Format=0]="Format",e[e.Standalone=1]="Standalone",e}({}),hs=function(e){return e[e.Narrow=0]="Narrow",e[e.Abbreviated=1]="Abbreviated",e[e.Wide=2]="Wide",e[e.Short=3]="Short",e}({}),ps=function(e){return e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e[e.Full=3]="Full",e}({}),ds=function(e){return e[e.Decimal=0]="Decimal",e[e.Group=1]="Group",e[e.List=2]="List",e[e.PercentSign=3]="PercentSign",e[e.PlusSign=4]="PlusSign",e[e.MinusSign=5]="MinusSign",e[e.Exponential=6]="Exponential",e[e.SuperscriptingExponent=7]="SuperscriptingExponent",e[e.PerMille=8]="PerMille",e[e[1/0]=9]="Infinity",e[e.NaN=10]="NaN",e[e.TimeSeparator=11]="TimeSeparator",e[e.CurrencyDecimal=12]="CurrencyDecimal",e[e.CurrencyGroup=13]="CurrencyGroup",e}({});function gs(e,t){return ws(xs(e)[10],t)}function ms(e,t){return ws(xs(e)[11],t)}function ys(e,t){return ws(xs(e)[12],t)}function vs(e,t){var n=xs(e),r=n[13][t];if(void 0===r){if(t===ds.CurrencyDecimal)return n[13][ds.Decimal];if(t===ds.CurrencyGroup)return n[13][ds.Group]}return r}function bs(e){if(!e[19])throw new Error('Missing extra locale data for the locale "'+e[0]+'". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.')}function ws(e,t){for(var n=t;n>-1;n--)if(void 0!==e[n])return e[n];throw new Error("Locale data API: locale data undefined")}function _s(e){var t=l(e.split(":"),2);return{hours:+t[0],minutes:+t[1]}}function xs(e){var t=e.toLowerCase().replace(/_/g,"-"),n=ls[t];if(n)return n;var r=t.split("-")[0];if(n=ls[r])return n;if("en"===r)return us;throw new Error('Missing locale data for the locale "'+e+'".')}var Ss=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,Es={},ks=/((?:[^GyMLwWdEabBhHmsSzZO']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/,Cs=function(e){return e[e.Short=0]="Short",e[e.ShortGMT=1]="ShortGMT",e[e.Long=2]="Long",e[e.Extended=3]="Extended",e}({}),Ts=function(e){return e[e.FullYear=0]="FullYear",e[e.Month=1]="Month",e[e.Date=2]="Date",e[e.Hours=3]="Hours",e[e.Minutes=4]="Minutes",e[e.Seconds=5]="Seconds",e[e.FractionalSeconds=6]="FractionalSeconds",e[e.Day=7]="Day",e}({}),Os=function(e){return e[e.DayPeriods=0]="DayPeriods",e[e.Days=1]="Days",e[e.Months=2]="Months",e[e.Eras=3]="Eras",e}({});function Is(e,t){return t&&(e=e.replace(/\{([^}]+)}/g,function(e,n){return null!=t&&n in t?t[n]:e})),e}function Ps(e,t,n,r,i){void 0===n&&(n="-");var o="";(e<0||i&&e<=0)&&(i?e=1-e:(e=-e,o=n));for(var a=String(e);a.length0||u>-n)&&(u+=n),e===Ts.Hours)0===u&&-12===n&&(u=12);else if(e===Ts.FractionalSeconds)return s=t,Ps(u,3).substr(0,s);var l=vs(a,ds.MinusSign);return Ps(u,t,l,r,i)}}function Ns(e,t,n,r){return void 0===n&&(n=fs.Format),void 0===r&&(r=!1),function(i,o){return function(e,t,n,r,i,o){switch(n){case Os.Months:return function(e,t,n){var r=xs(e),i=ws([r[5],r[6]],t);return ws(i,n)}(t,i,r)[e.getMonth()];case Os.Days:return function(e,t,n){var r=xs(e),i=ws([r[3],r[4]],t);return ws(i,n)}(t,i,r)[e.getDay()];case Os.DayPeriods:var a=e.getHours(),s=e.getMinutes();if(o){var u,l=function(e){var t=xs(e);return bs(t),(t[19][2]||[]).map(function(e){return"string"==typeof e?_s(e):[_s(e[0]),_s(e[1])]})}(t),c=function(e,t,n){var r=xs(e);bs(r);var i=ws([r[19][0],r[19][1]],t)||[];return ws(i,n)||[]}(t,i,r);if(l.forEach(function(e,t){if(Array.isArray(e)){var n=e[0],r=e[1],i=r.hours;a>=n.hours&&s>=n.minutes&&(a0?Math.floor(i/60):Math.ceil(i/60);switch(e){case Cs.Short:return(i>=0?"+":"")+Ps(a,2,o)+Ps(Math.abs(i%60),2,o);case Cs.ShortGMT:return"GMT"+(i>=0?"+":"")+Ps(a,1,o);case Cs.Long:return"GMT"+(i>=0?"+":"")+Ps(a,2,o)+":"+Ps(Math.abs(i%60),2,o);case Cs.Extended:return 0===r?"Z":(i>=0?"+":"")+Ps(a,2,o)+":"+Ps(Math.abs(i%60),2,o);default:throw new Error('Unknown zone width "'+e+'"')}}}var js=0,Ds=4;function Ms(e,t){return void 0===t&&(t=!1),function(n,r){var i,o,a,s;if(t){var u=new Date(n.getFullYear(),n.getMonth(),1).getDay()-1,l=n.getDate();i=1+Math.floor((l+u)/7)}else{var c=(a=n.getFullYear(),s=new Date(a,js,1).getDay(),new Date(a,0,1+(s<=Ds?Ds:Ds+7)-s)),f=(o=n,new Date(o.getFullYear(),o.getMonth(),o.getDate()+(Ds-o.getDay()))).getTime()-c.getTime();i=1+Math.round(f/6048e5)}return Ps(i,e,vs(r,ds.MinusSign))}}var Ls={};function Us(e,t){e=e.replace(/:/g,"");var n=Date.parse("Jan 01, 1970 00:00:00 "+e)/6e4;return isNaN(n)?t:n}function Fs(e){return e instanceof Date&&!isNaN(e.valueOf())}var Vs=new ge("UseV4Plurals"),Bs=function(){return function(){}}(),zs=function(e){function t(t,n){var r=e.call(this)||this;return r.locale=t,r.deprecatedPluralFn=n,r}return i(t,e),t.prototype.getPluralCategory=function(e,t){switch(this.deprecatedPluralFn?this.deprecatedPluralFn(t||this.locale,e):function(e){return xs(e)[18]}(t||this.locale)(e)){case cs.Zero:return"zero";case cs.One:return"one";case cs.Two:return"two";case cs.Few:return"few";case cs.Many:return"many";default:return"other"}},t}(Bs),qs=function(){function e(e,t,n,r){this._iterableDiffers=e,this._keyValueDiffers=t,this._ngEl=n,this._renderer=r,this._initialClasses=[]}return Object.defineProperty(e.prototype,"klass",{set:function(e){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof e?e.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngClass",{set:function(e){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof e?e.split(/\s+/):e,this._rawClass&&(Bn(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())},enumerable:!0,configurable:!0}),e.prototype.ngDoCheck=function(){if(this._iterableDiffer){var e=this._iterableDiffer.diff(this._rawClass);e&&this._applyIterableChanges(e)}else if(this._keyValueDiffer){var t=this._keyValueDiffer.diff(this._rawClass);t&&this._applyKeyValueChanges(t)}},e.prototype._applyKeyValueChanges=function(e){var t=this;e.forEachAddedItem(function(e){return t._toggleClass(e.key,e.currentValue)}),e.forEachChangedItem(function(e){return t._toggleClass(e.key,e.currentValue)}),e.forEachRemovedItem(function(e){e.previousValue&&t._toggleClass(e.key,!1)})},e.prototype._applyIterableChanges=function(e){var t=this;e.forEachAddedItem(function(e){if("string"!=typeof e.item)throw new Error("NgClass can only toggle CSS classes expressed as strings, got "+Ne(e.item));t._toggleClass(e.item,!0)}),e.forEachRemovedItem(function(e){return t._toggleClass(e.item,!1)})},e.prototype._applyClasses=function(e){var t=this;e&&(Array.isArray(e)||e instanceof Set?e.forEach(function(e){return t._toggleClass(e,!0)}):Object.keys(e).forEach(function(n){return t._toggleClass(n,!!e[n])}))},e.prototype._removeClasses=function(e){var t=this;e&&(Array.isArray(e)||e instanceof Set?e.forEach(function(e){return t._toggleClass(e,!1)}):Object.keys(e).forEach(function(e){return t._toggleClass(e,!1)}))},e.prototype._toggleClass=function(e,t){var n=this;(e=e.trim())&&e.split(/\s+/g).forEach(function(e){t?n._renderer.addClass(n._ngEl.nativeElement,e):n._renderer.removeClass(n._ngEl.nativeElement,e)})},e}(),Hs=function(){function e(e,t,n,r){this.$implicit=e,this.ngForOf=t,this.index=n,this.count=r}return Object.defineProperty(e.prototype,"first",{get:function(){return 0===this.index},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"last",{get:function(){return this.index===this.count-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"even",{get:function(){return this.index%2==0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"odd",{get:function(){return!this.even},enumerable:!0,configurable:!0}),e}(),Ws=function(){function e(e,t,n){this._viewContainer=e,this._template=t,this._differs=n,this._ngForOfDirty=!0,this._differ=null}return Object.defineProperty(e.prototype,"ngForOf",{set:function(e){this._ngForOf=e,this._ngForOfDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngForTrackBy",{get:function(){return this._trackByFn},set:function(e){cn()&&null!=e&&"function"!=typeof e&&console&&console.warn&&console.warn("trackBy must be a function, but received "+JSON.stringify(e)+". See https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html#!#change-propagation for more information."),this._trackByFn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngForTemplate",{set:function(e){e&&(this._template=e)},enumerable:!0,configurable:!0}),e.prototype.ngDoCheck=function(){if(this._ngForOfDirty){this._ngForOfDirty=!1;var e=this._ngForOf;if(!this._differ&&e)try{this._differ=this._differs.find(e).create(this.ngForTrackBy)}catch(r){throw new Error("Cannot find a differ supporting object '"+e+"' of type '"+((t=e).name||typeof t)+"'. NgFor only supports binding to Iterables such as Arrays.")}}var t;if(this._differ){var n=this._differ.diff(this._ngForOf);n&&this._applyChanges(n)}},e.prototype._applyChanges=function(e){var t=this,n=[];e.forEachOperation(function(e,r,i){if(null==e.previousIndex){var o=t._viewContainer.createEmbeddedView(t._template,new Hs(null,t._ngForOf,-1,-1),i),a=new $s(e,o);n.push(a)}else null==i?t._viewContainer.remove(r):(o=t._viewContainer.get(r),t._viewContainer.move(o,i),a=new $s(e,o),n.push(a))});for(var r=0;r0},t.prototype.tagName=function(e){return e.tagName},t.prototype.attributeMap=function(e){for(var t=new Map,n=e.attributes,r=0;r0;a||(a=e[o]=[]);var u=Ku(t)?Zone.root:Zone.current;if(0===a.length)a.push({zone:u,handler:i});else{for(var l=!1,c=0;c-1},t}(Ou),rl=["alt","control","meta","shift"],il={alt:function(e){return e.altKey},control:function(e){return e.ctrlKey},meta:function(e){return e.metaKey},shift:function(e){return e.shiftKey}},ol=function(e){function t(t){return e.call(this,t)||this}var n;return i(t,e),n=t,t.prototype.supports=function(e){return null!=n.parseEventName(e)},t.prototype.addEventListener=function(e,t,r){var i=n.parseEventName(t),o=n.eventCallback(i.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(function(){return lu().onAndCancel(e,i.domEventName,o)})},t.parseEventName=function(e){var t=e.toLowerCase().split("."),r=t.shift();if(0===t.length||"keydown"!==r&&"keyup"!==r)return null;var i=n._normalizeKey(t.pop()),o="";if(rl.forEach(function(e){var n=t.indexOf(e);n>-1&&(t.splice(n,1),o+=e+".")}),o+=i,0!=t.length||0===i.length)return null;var a={};return a.domEventName=r,a.fullKey=o,a},t.getEventFullKey=function(e){var t="",n=lu().getEventKey(e);return" "===(n=n.toLowerCase())?n="space":"."===n&&(n="dot"),rl.forEach(function(r){r!=n&&(0,il[r])(e)&&(t+=r+".")}),t+=n},t.eventCallback=function(e,t,r){return function(i){n.getEventFullKey(i)===e&&r.runGuarded(function(){return t(i)})}},t._normalizeKey=function(e){switch(e){case"esc":return"escape";default:return e}},t}(Ou),al=function(){return function(){}}(),sl=function(e){function t(t){var n=e.call(this)||this;return n._doc=t,n}return i(t,e),t.prototype.sanitize=function(e,t){if(null==t)return null;switch(e){case Nr.NONE:return t;case Nr.HTML:return t instanceof ll?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"HTML"),function(e,t){var n=null;try{mr=mr||new cr(e);var r=t?String(t):"";n=mr.getInertBodyElement(r);var i=5,o=r;do{if(0===i)throw new Error("Failed to sanitize html because the input is unstable");i--,r=o,o=n.innerHTML,n=mr.getInertBodyElement(r)}while(r!==o);var a=new kr,s=a.sanitizeChildren(Ir(n)||n);return cn()&&a.sanitizedSomething&&console.warn("WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss)."),s}finally{if(n)for(var u=Ir(n)||n;u.firstChild;)u.removeChild(u.firstChild)}}(this._doc,String(t)));case Nr.STYLE:return t instanceof cl?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"Style"),function(e){if(!(e=String(e).trim()))return"";var t=e.match(Ar);return t&&pr(t[1])===t[1]||e.match(Pr)&&function(e){for(var t=!0,n=!0,r=0;r=this.toastrConfig.maxOpened&&(a=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));var s=this.overlay.create(r.positionClass,this.overlayContainer);this.index=this.index+1;var u=t;t&&r.enableHtml&&(u=this.sanitizer.sanitize(Nr.HTML,t));var l=new kl(s),c=new yl(this.index,r,u,n,e,l),f=new Cl(c,this._injector),h=new wl(r.toastComponent,f),p=s.attach(h,this.toastrConfig.newestOnTop);l.componentInstance=p._component;var d={toastId:this.index,message:t||"",toastRef:l,onShown:l.afterActivate(),onHidden:l.afterClosed(),onTap:c.onTap(),onAction:c.onAction(),portal:p};return a||setTimeout(function(){d.toastRef.activate(),i.currentlyActive=i.currentlyActive+1}),this.toasts.push(d),d},e.ngInjectableDef=de({factory:function(){return new e(at(bl),at(El),at(Be),at(al),at(Kt))},token:e,providedIn:"root"}),e}(),Ol=function(){function e(e,t,n){var r=this;this.toastrService=e,this.toastPackage=t,this.ngZone=n,this.width=-1,this.toastClasses="",this.state={value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}},this.message=t.message,this.title=t.title,this.options=t.config,this.originalTimeout=t.config.timeOut,this.toastClasses=t.toastType+" "+t.config.toastClass,this.sub=t.toastRef.afterActivate().subscribe(function(){r.activateToast()}),this.sub1=t.toastRef.manualClosed().subscribe(function(){r.remove()}),this.sub2=t.toastRef.timeoutReset().subscribe(function(){r.resetTimeout()})}return Object.defineProperty(e.prototype,"displayStyle",{get:function(){return"inactive"===this.state.value?"none":"inherit"},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)},e.prototype.activateToast=function(){var e=this;this.state=o({},this.state,{value:"active"}),!this.options.disableTimeOut&&this.options.timeOut&&(this.outsideTimeout(function(){return e.remove()},this.options.timeOut),this.hideTime=(new Date).getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(function(){return e.updateProgress()},10))},e.prototype.updateProgress=function(){if(0!==this.width&&100!==this.width&&this.options.timeOut){var e=(new Date).getTime();this.width=(this.hideTime-e)/this.options.timeOut*100,"increasing"===this.options.progressAnimation&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}},e.prototype.resetTimeout=function(){var e=this;clearTimeout(this.timeout),clearInterval(this.intervalId),this.state=o({},this.state,{value:"active"}),this.outsideTimeout(function(){return e.remove()},this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(function(){return e.updateProgress()},10)},e.prototype.remove=function(){var e=this;"removed"!==this.state.value&&(clearTimeout(this.timeout),this.state=o({},this.state,{value:"removed"}),this.outsideTimeout(function(){return e.toastrService.remove(e.toastPackage.toastId)},+this.toastPackage.config.easeTime))},e.prototype.tapToast=function(){"removed"!==this.state.value&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())},e.prototype.stickAround=function(){"removed"!==this.state.value&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)},e.prototype.delayedHideToast=function(){var e=this;this.options.disableTimeOut||0===this.options.extendedTimeOut||"removed"===this.state.value||(this.outsideTimeout(function(){return e.remove()},this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(function(){return e.updateProgress()},10))},e.prototype.outsideTimeout=function(e,t){var n=this;this.ngZone?this.ngZone.runOutsideAngular(function(){return n.timeout=setTimeout(function(){return n.runInsideAngular(e)},t)}):this.timeout=setTimeout(function(){return e()},t)},e.prototype.outsideInterval=function(e,t){var n=this;this.ngZone?this.ngZone.runOutsideAngular(function(){return n.intervalId=setInterval(function(){return n.runInsideAngular(e)},t)}):this.intervalId=setInterval(function(){return e()},t)},e.prototype.runInsideAngular=function(e){this.ngZone?this.ngZone.run(function(){return e()}):e()},e}(),Il=o({},vl,{toastComponent:Ol}),Pl=function(){function e(){}return e.forRoot=function(t){return void 0===t&&(t={}),{ngModule:e,providers:[{provide:bl,useValue:{default:Il,config:t}}]}},e}(),Al=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})},Nl=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0||r.deletions.length>0)&&this.updateManager.update(r.deletions,r.insertions,function(t,n,r){n?(i.toastr.success("Your Solid profile has been successfully updated","Success!"),e.form.markAsPristine(),e.form.markAsTouched()):i.toastr.error("Message: "+r,"An error has occurred")}),[2]})})},this.getAddress=function(){var e=t.getValueFromVcard("hasAddress");return e?{locality:t.getValueFromVcard("locality",e),country_name:t.getValueFromVcard("country-name",e),region:t.getValueFromVcard("region",e),street:t.getValueFromVcard("street-address",e)}:{}},this.getEmail=function(){var e=t.getValueFromVcard("hasEmail");return e?t.getValueFromVcard("value",e).split("mailto:")[1]:""},this.getPhone=function(){var e=t.getValueFromVcard("hasTelephone");if(e)return t.getValueFromVcard("value",e).split("tel:+")[1]},this.getProfile=function(){return Al(t,void 0,void 0,function(){var e;return Nl(this,function(t){switch(t.label){case 0:return this.session?[3,2]:[4,this.getSession()];case 1:t.sent(),t.label=2;case 2:return t.trys.push([2,4,,5]),[4,this.fetcher.load(this.session.webId)];case 3:return t.sent(),[2,{fn:this.getValueFromVcard("fn"),company:this.getValueFromVcard("organization-name"),phone:this.getPhone(),role:this.getValueFromVcard("role"),image:this.getValueFromVcard("hasPhoto"),address:this.getAddress(),email:this.getEmail()}];case 4:return e=t.sent(),console.log("Error fetching data: "+e),[3,5];case 5:return[2]}})})},this.postMessage=function(e,n){return Al(t,void 0,void 0,function(){var e;return Nl(this,function(t){return(e=$rdf.graph()).add(),$rdf.serialize(null,e,n,function(e,t){}),[2]})})},this.fetcher=new $rdf.Fetcher(this.store,{}),this.updateManager=new $rdf.UpdateManager(this.store),this.getSession()}return e.prototype.addNewLinkedField=function(e,t,n,r,i,o){var a=e+":"+Date.now(),s=$rdf.sym(this.session.webId.split("#")[0]+"#"+a),u="phone"===e?$rdf.sym(Rl("hasTelephone")):$rdf.sym(Rl("hasEmail"));t.push($rdf.st(s,n,r,i));var l="phone"===e?$rdf.literal("Home"):$rdf.literal("Personal");t.push($rdf.st(s,Rl("type"),l,i)),t.push($rdf.st(o,u,s,i))},e.prototype.getUriForField=function(e,t){var n,r;switch(e){case"phone":(n=this.getValueFromVcard("hasTelephone"))&&(r=$rdf.sym(n));break;case"email":(n=this.getValueFromVcard("hasEmail"))&&(r=$rdf.sym(n));break;default:r=t}return r},e.prototype.getFieldValue=function(e,t){var n;if(e.value[t]){switch(t){case"phone":n=$rdf.sym("tel:+"+e.value[t]);break;case"email":n=$rdf.sym("mailto:"+e.value[t]);break;default:n=e.value[t]}return n}},e.prototype.getOldFieldValue=function(e,t){var n;if(t&&t[e]){switch(e){case"phone":n=$rdf.sym("tel:+"+t[e]);break;case"email":n=$rdf.sym("mailto:"+t[e]);break;default:n=t[e]}return n}},e.prototype.getFieldName=function(e){switch(e){case"company":return"organization-name";case"phone":case"email":return"value";default:return e}},e.prototype.getValueFromNamespace=function(e,t,n){var r=this.store.any($rdf.sym(n||this.session.webId),t(e));return r?r.value:""},e.prototype.getFieldAsStringFromProfile=function(e){return Al(this,void 0,void 0,function(){return Nl(this,function(t){return[2,this.getFieldAsString(this.session.webId,e,Rl)]})})},e.prototype.getFieldAsString=function(e,t,n){return Al(this,void 0,void 0,function(){var r;return Nl(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.fetcher.load(this.store.sym(e).doc(),{force:!0,clearPreviousData:!0})];case 1:return i.sent(),[2,this.store.any(this.store.sym(e),n(t))];case 2:return r=i.sent(),console.log("Error fetching data: "+r),[3,3];case 3:return[2]}})})},e.prototype.getDataAsArray=function(e,t,n){return Al(this,void 0,void 0,function(){var r;return Nl(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.fetcher.load(this.store.sym(e).doc(),{force:!0,clearPreviousData:!0})];case 1:return i.sent(),[2,this.store.each(this.store.sym(e),n(t))];case 2:return r=i.sent(),console.log("Error fetching data: "+r),[3,3];case 3:return[2]}})})},e.prototype.getFriends=function(){return Al(this,void 0,void 0,function(){return Nl(this,function(e){return[2,this.getDataAsArray(this.session.webId,"knows",jl)]})})},e.prototype.getFriendData=function(e,t){return Al(this,void 0,void 0,function(){return Nl(this,function(n){return[2,this.getFieldAsString(e,t,Rl)]})})},e.prototype.getElementsFromContainer=function(e){return Al(this,void 0,void 0,function(){return Nl(this,function(t){return[2,this.getDataAsArray(e,"contains",Dl)]})})},e.prototype.addFriend=function(e){var t=this,n=$rdf.sym(this.session.webId),r=$rdf.sym(e),i=$rdf.st(n,jl("knows"),r,n.doc());this.updateManager.update([],i,function(e,n,r){n?t.toastr.success("Friend added","Success!"):t.toastr.error("Message: "+r,"An error has occurred")})},e.prototype.removeFriend=function(e){var t=this,n=$rdf.sym(this.session.webId),r=$rdf.sym(e),i=$rdf.st(n,jl("knows"),r,n.doc());this.updateManager.update(i,[],function(e,n,r){n?t.toastr.success("Friend removed","Success!"):t.toastr.error("Message: "+r,"An error has occurred")})},e.ngInjectableDef=de({factory:function(){return new e(at(Tl))},token:e,providedIn:"root"}),e}(),Ul=new I(function(e){return e.complete()});function Fl(e){return e?function(e){return new I(function(t){return e.schedule(function(){return t.complete()})})}(e):Ul}function Vl(e){var t=new I(function(t){t.next(e),t.complete()});return t._isScalar=!0,t.value=e,t}function Bl(){for(var e=[],t=0;t0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,i=0;i=2;return function(r){return r.pipe(e?$l(function(t,n){return e(t,n,r)}):ie,Yl(1),n?oc(t):rc(function(){return new ql}))}}function lc(e,t){return function(n){return n.lift(new cc(e,t,n))}}var cc=function(){function e(e,t,n){this.predicate=e,this.thisArg=t,this.source=n}return e.prototype.call=function(e,t){return t.subscribe(new fc(e,this.predicate,this.thisArg,this.source))},e}(),fc=function(e){function t(t,n,r,i){var o=e.call(this,t)||this;return o.predicate=n,o.thisArg=r,o.source=i,o.index=0,o.thisArg=r||o,o}return i(t,e),t.prototype.notifyComplete=function(e){this.destination.next(e),this.destination.complete()},t.prototype._next=function(e){var t=!1;try{t=this.predicate.call(this.thisArg,e,this.index++,this.source)}catch(n){return void this.destination.error(n)}t||this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(S);function hc(e){return function(t){var n=new pc(e),r=t.lift(n);return n.caught=r}}var pc=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new dc(e,this.selector,this.caught))},e}(),dc=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.selector=n,i.caught=r,i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=void 0;try{n=this.selector(t,this.caught)}catch(i){return void e.prototype.error.call(this,i)}this._unsubscribeAndRecycle();var r=new U(this,void 0,void 0);this.add(r),J(this,n,void 0,void 0,r)}},t}(K),gc=function(){function e(e){if(this.total=e,this.total<0)throw new Ql}return e.prototype.call=function(e,t){return t.subscribe(new mc(e,this.total))},e}(),mc=function(e){function t(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return i(t,e),t.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},t}(S);function yc(e,t){var n=arguments.length>=2;return function(r){return r.pipe(e?$l(function(t,n){return e(t,n,r)}):ie,function(e){return e.lift(new gc(1))},n?oc(t):rc(function(){return new ql}))}}function vc(e,t){return te(e,t,1)}function bc(e,t){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new wc(e,t,n))}}var wc=function(){function e(e,t,n){void 0===n&&(n=!1),this.accumulator=e,this.seed=t,this.hasSeed=n}return e.prototype.call=function(e,t){return t.subscribe(new _c(e,this.accumulator,this.seed,this.hasSeed))},e}(),_c=function(e){function t(t,n,r,i){var o=e.call(this,t)||this;return o.accumulator=n,o._seed=r,o.hasSeed=i,o.index=0,o}return i(t,e),Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e},enumerable:!0,configurable:!0}),t.prototype._next=function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)},t.prototype._tryNext=function(e){var t,n=this.index++;try{t=this.accumulator(this.seed,e,n)}catch(r){this.destination.error(r)}this.seed=t,this.destination.next(t)},t}(S),xc=function(){return function(e,t){this.id=e,this.url=t}}(),Sc=function(e){function t(t,n,r,i){void 0===r&&(r="imperative"),void 0===i&&(i=null);var o=e.call(this,t,n)||this;return o.navigationTrigger=r,o.restoredState=i,o}return i(t,e),t.prototype.toString=function(){return"NavigationStart(id: "+this.id+", url: '"+this.url+"')"},t}(xc),Ec=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.urlAfterRedirects=r,i}return i(t,e),t.prototype.toString=function(){return"NavigationEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"')"},t}(xc),kc=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.reason=r,i}return i(t,e),t.prototype.toString=function(){return"NavigationCancel(id: "+this.id+", url: '"+this.url+"')"},t}(xc),Cc=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.error=r,i}return i(t,e),t.prototype.toString=function(){return"NavigationError(id: "+this.id+", url: '"+this.url+"', error: "+this.error+")"},t}(xc),Tc=function(e){function t(t,n,r,i){var o=e.call(this,t,n)||this;return o.urlAfterRedirects=r,o.state=i,o}return i(t,e),t.prototype.toString=function(){return"RoutesRecognized(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},t}(xc),Oc=function(e){function t(t,n,r,i){var o=e.call(this,t,n)||this;return o.urlAfterRedirects=r,o.state=i,o}return i(t,e),t.prototype.toString=function(){return"GuardsCheckStart(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},t}(xc),Ic=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n)||this;return a.urlAfterRedirects=r,a.state=i,a.shouldActivate=o,a}return i(t,e),t.prototype.toString=function(){return"GuardsCheckEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+", shouldActivate: "+this.shouldActivate+")"},t}(xc),Pc=function(e){function t(t,n,r,i){var o=e.call(this,t,n)||this;return o.urlAfterRedirects=r,o.state=i,o}return i(t,e),t.prototype.toString=function(){return"ResolveStart(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},t}(xc),Ac=function(e){function t(t,n,r,i){var o=e.call(this,t,n)||this;return o.urlAfterRedirects=r,o.state=i,o}return i(t,e),t.prototype.toString=function(){return"ResolveEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},t}(xc),Nc=function(){function e(e){this.route=e}return e.prototype.toString=function(){return"RouteConfigLoadStart(path: "+this.route.path+")"},e}(),Rc=function(){function e(e){this.route=e}return e.prototype.toString=function(){return"RouteConfigLoadEnd(path: "+this.route.path+")"},e}(),jc=function(){function e(e){this.snapshot=e}return e.prototype.toString=function(){return"ChildActivationStart(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},e}(),Dc=function(){function e(e){this.snapshot=e}return e.prototype.toString=function(){return"ChildActivationEnd(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},e}(),Mc=function(){function e(e){this.snapshot=e}return e.prototype.toString=function(){return"ActivationStart(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},e}(),Lc=function(){function e(e){this.snapshot=e}return e.prototype.toString=function(){return"ActivationEnd(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},e}(),Uc=function(){function e(e,t,n){this.routerEvent=e,this.position=t,this.anchor=n}return e.prototype.toString=function(){return"Scroll(anchor: '"+this.anchor+"', position: '"+(this.position?this.position[0]+", "+this.position[1]:null)+"')"},e}(),Fc=function(){return function(){}}(),Vc="primary",Bc=function(){function e(e){this.params=e||{}}return e.prototype.has=function(e){return this.params.hasOwnProperty(e)},e.prototype.get=function(e){if(this.has(e)){var t=this.params[e];return Array.isArray(t)?t[0]:t}return null},e.prototype.getAll=function(e){if(this.has(e)){var t=this.params[e];return Array.isArray(t)?t:[t]}return[]},Object.defineProperty(e.prototype,"keys",{get:function(){return Object.keys(this.params)},enumerable:!0,configurable:!0}),e}();function zc(e){return new Bc(e)}function qc(e,t,n){var r=n.path.split("/");if(r.length>e.length)return null;if("full"===n.pathMatch&&(t.hasChildren()||r.length0?e[e.length-1]:null}function Zc(e,t){for(var n in e)e.hasOwnProperty(n)&&t(e[n],n)}function Xc(e){return e.pipe(oe(),lc(function(e){return!0===e}))}function ef(e){return vt(e)?e:yt(e)?ee(Promise.resolve(e)):Bl(e)}function tf(e,t,n){return n?function(e,t){return Kc(e,t)}(e.queryParams,t.queryParams)&&function e(t,n){if(!af(t.segments,n.segments))return!1;if(t.numberOfChildren!==n.numberOfChildren)return!1;for(var r in n.children){if(!t.children[r])return!1;if(!e(t.children[r],n.children[r]))return!1}return!0}(e.root,t.root):function(e,t){return Object.keys(t).length<=Object.keys(e).length&&Object.keys(t).every(function(n){return t[n]===e[n]})}(e.queryParams,t.queryParams)&&function e(t,n){return function t(n,r,i){if(n.segments.length>i.length)return!!af(a=n.segments.slice(0,i.length),i)&&!r.hasChildren();if(n.segments.length===i.length){if(!af(n.segments,i))return!1;for(var o in r.children){if(!n.children[o])return!1;if(!e(n.children[o],r.children[o]))return!1}return!0}var a=i.slice(0,n.segments.length),s=i.slice(n.segments.length);return!!af(n.segments,a)&&!!n.children[Vc]&&t(n.children[Vc],r,s)}(t,n,n.segments)}(e.root,t.root)}var nf=function(){function e(e,t,n){this.root=e,this.queryParams=t,this.fragment=n}return Object.defineProperty(e.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=zc(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return cf.serialize(this)},e}(),rf=function(){function e(e,t){var n=this;this.segments=e,this.children=t,this.parent=null,Zc(t,function(e,t){return e.parent=n})}return e.prototype.hasChildren=function(){return this.numberOfChildren>0},Object.defineProperty(e.prototype,"numberOfChildren",{get:function(){return Object.keys(this.children).length},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return ff(this)},e}(),of=function(){function e(e,t){this.path=e,this.parameters=t}return Object.defineProperty(e.prototype,"parameterMap",{get:function(){return this._parameterMap||(this._parameterMap=zc(this.parameters)),this._parameterMap},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return yf(this)},e}();function af(e,t){return e.length===t.length&&e.every(function(e,n){return e.path===t[n].path})}function sf(e,t){var n=[];return Zc(e.children,function(e,r){r===Vc&&(n=n.concat(t(e,r)))}),Zc(e.children,function(e,r){r!==Vc&&(n=n.concat(t(e,r)))}),n}var uf=function(){return function(){}}(),lf=function(){function e(){}return e.prototype.parse=function(e){var t=new xf(e);return new nf(t.parseRootSegment(),t.parseQueryParams(),t.parseFragment())},e.prototype.serialize=function(e){var t,n;return"/"+function e(t,n){if(!t.hasChildren())return ff(t);if(n){var r=t.children[Vc]?e(t.children[Vc],!1):"",i=[];return Zc(t.children,function(t,n){n!==Vc&&i.push(n+":"+e(t,!1))}),i.length>0?r+"("+i.join("//")+")":r}var o=sf(t,function(n,r){return r===Vc?[e(t.children[Vc],!1)]:[r+":"+e(n,!1)]});return ff(t)+"/("+o.join("//")+")"}(e.root,!0)+(t=e.queryParams,(n=Object.keys(t).map(function(e){var n=t[e];return Array.isArray(n)?n.map(function(t){return pf(e)+"="+pf(t)}).join("&"):pf(e)+"="+pf(n)})).length?"?"+n.join("&"):"")+("string"==typeof e.fragment?"#"+encodeURI(e.fragment):"")},e}(),cf=new lf;function ff(e){return e.segments.map(function(e){return yf(e)}).join("/")}function hf(e){return encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function pf(e){return hf(e).replace(/%3B/gi,";")}function df(e){return hf(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function gf(e){return decodeURIComponent(e)}function mf(e){return gf(e.replace(/\+/g,"%20"))}function yf(e){return""+df(e.path)+(t=e.parameters,Object.keys(t).map(function(e){return";"+df(e)+"="+df(t[e])}).join(""));var t}var vf=/^[^\/()?;=#]+/;function bf(e){var t=e.match(vf);return t?t[0]:""}var wf=/^[^=?&#]+/,_f=/^[^?&#]+/,xf=function(){function e(e){this.url=e,this.remaining=e}return e.prototype.parseRootSegment=function(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new rf([],{}):new rf([],this.parseChildren())},e.prototype.parseQueryParams=function(){var e={};if(this.consumeOptional("?"))do{this.parseQueryParam(e)}while(this.consumeOptional("&"));return e},e.prototype.parseFragment=function(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null},e.prototype.parseChildren=function(){if(""===this.remaining)return{};this.consumeOptional("/");var e=[];for(this.peekStartsWith("(")||e.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),e.push(this.parseSegment());var t={};this.peekStartsWith("/(")&&(this.capture("/"),t=this.parseParens(!0));var n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(e.length>0||Object.keys(t).length>0)&&(n[Vc]=new rf(e,t)),n},e.prototype.parseSegment=function(){var e=bf(this.remaining);if(""===e&&this.peekStartsWith(";"))throw new Error("Empty path url segment cannot have parameters: '"+this.remaining+"'.");return this.capture(e),new of(gf(e),this.parseMatrixParams())},e.prototype.parseMatrixParams=function(){for(var e={};this.consumeOptional(";");)this.parseParam(e);return e},e.prototype.parseParam=function(e){var t=bf(this.remaining);if(t){this.capture(t);var n="";if(this.consumeOptional("=")){var r=bf(this.remaining);r&&this.capture(n=r)}e[gf(t)]=gf(n)}},e.prototype.parseQueryParam=function(e){var t,n=(t=this.remaining.match(wf))?t[0]:"";if(n){this.capture(n);var r="";if(this.consumeOptional("=")){var i=function(e){var t=e.match(_f);return t?t[0]:""}(this.remaining);i&&this.capture(r=i)}var o=mf(n),a=mf(r);if(e.hasOwnProperty(o)){var s=e[o];Array.isArray(s)||(e[o]=s=[s]),s.push(a)}else e[o]=a}},e.prototype.parseParens=function(e){var t={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){var n=bf(this.remaining),r=this.remaining[n.length];if("/"!==r&&")"!==r&&";"!==r)throw new Error("Cannot parse url '"+this.url+"'");var i=void 0;n.indexOf(":")>-1?(i=n.substr(0,n.indexOf(":")),this.capture(i),this.capture(":")):e&&(i=Vc);var o=this.parseChildren();t[i]=1===Object.keys(o).length?o[Vc]:new rf([],o),this.consumeOptional("//")}return t},e.prototype.peekStartsWith=function(e){return this.remaining.startsWith(e)},e.prototype.consumeOptional=function(e){return!!this.peekStartsWith(e)&&(this.remaining=this.remaining.substring(e.length),!0)},e.prototype.capture=function(e){if(!this.consumeOptional(e))throw new Error('Expected "'+e+'".')},e}(),Sf=function(){return function(e){this.segmentGroup=e||null}}(),Ef=function(){return function(e){this.urlTree=e}}();function kf(e){return new I(function(t){return t.error(new Sf(e))})}function Cf(e){return new I(function(t){return t.error(new Ef(e))})}function Tf(e){return new I(function(t){return t.error(new Error("Only absolute redirects can have named outlets. redirectTo: '"+e+"'"))})}var Of=function(){function e(e,t,n,r,i){this.configLoader=t,this.urlSerializer=n,this.urlTree=r,this.config=i,this.allowRedirects=!0,this.ngModule=e.get(Bt)}return e.prototype.apply=function(){var e=this;return this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,Vc).pipe(Q(function(t){return e.createUrlTree(t,e.urlTree.queryParams,e.urlTree.fragment)})).pipe(hc(function(t){if(t instanceof Ef)return e.allowRedirects=!1,e.match(t.urlTree);if(t instanceof Sf)throw e.noMatchError(t);throw t}))},e.prototype.match=function(e){var t=this;return this.expandSegmentGroup(this.ngModule,this.config,e.root,Vc).pipe(Q(function(n){return t.createUrlTree(n,e.queryParams,e.fragment)})).pipe(hc(function(e){if(e instanceof Sf)throw t.noMatchError(e);throw e}))},e.prototype.noMatchError=function(e){return new Error("Cannot match any routes. URL Segment: '"+e.segmentGroup+"'")},e.prototype.createUrlTree=function(e,t,n){var r,i=e.segments.length>0?new rf([],((r={})[Vc]=e,r)):e;return new nf(i,t,n)},e.prototype.expandSegmentGroup=function(e,t,n,r){return 0===n.segments.length&&n.hasChildren()?this.expandChildren(e,t,n).pipe(Q(function(e){return new rf([],e)})):this.expandSegment(e,n,t,n.segments,r,!0)},e.prototype.expandChildren=function(e,t,n){var r=this;return function(n,i){if(0===Object.keys(n).length)return Bl({});var o=[],a=[],s={};return Zc(n,function(n,i){var u,l,c=(u=i,l=n,r.expandSegmentGroup(e,t,l,u)).pipe(Q(function(e){return s[i]=e}));i===Vc?o.push(c):a.push(c)}),Bl.apply(null,o.concat(a)).pipe(Wl(),uc(),Q(function(){return s}))}(n.children)},e.prototype.expandSegment=function(e,t,n,r,i,o){var a=this;return Bl.apply(void 0,c(n)).pipe(Q(function(s){return a.expandSegmentAgainstRoute(e,t,n,s,r,i,o).pipe(hc(function(e){if(e instanceof Sf)return Bl(null);throw e}))}),Wl(),yc(function(e){return!!e}),hc(function(e,n){if(e instanceof ql||"EmptyError"===e.name){if(a.noLeftoversInUrl(t,r,i))return Bl(new rf([],{}));throw new Sf(t)}throw e}))},e.prototype.noLeftoversInUrl=function(e,t,n){return 0===t.length&&!e.children[n]},e.prototype.expandSegmentAgainstRoute=function(e,t,n,r,i,o,a){return Nf(r)!==o?kf(t):void 0===r.redirectTo?this.matchSegmentAgainstRoute(e,t,r,i):a&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(e,t,n,r,i,o):kf(t)},e.prototype.expandSegmentAgainstRouteUsingRedirect=function(e,t,n,r,i,o){return"**"===r.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(e,n,r,o):this.expandRegularSegmentAgainstRouteUsingRedirect(e,t,n,r,i,o)},e.prototype.expandWildCardWithParamsAgainstRouteUsingRedirect=function(e,t,n,r){var i=this,o=this.applyRedirectCommands([],n.redirectTo,{});return n.redirectTo.startsWith("/")?Cf(o):this.lineralizeSegments(n,o).pipe(te(function(n){var o=new rf(n,{});return i.expandSegment(e,o,t,n,r,!1)}))},e.prototype.expandRegularSegmentAgainstRouteUsingRedirect=function(e,t,n,r,i,o){var a=this,s=If(t,r,i),u=s.consumedSegments,l=s.lastChild,c=s.positionalParamSegments;if(!s.matched)return kf(t);var f=this.applyRedirectCommands(u,r.redirectTo,c);return r.redirectTo.startsWith("/")?Cf(f):this.lineralizeSegments(r,f).pipe(te(function(r){return a.expandSegment(e,t,n,r.concat(i.slice(l)),o,!1)}))},e.prototype.matchSegmentAgainstRoute=function(e,t,n,r){var i=this;if("**"===n.path)return n.loadChildren?this.configLoader.load(e.injector,n).pipe(Q(function(e){return n._loadedConfig=e,new rf(r,{})})):Bl(new rf(r,{}));var a=If(t,n,r),s=a.consumedSegments,l=a.lastChild;if(!a.matched)return kf(t);var c=r.slice(l);return this.getChildConfig(e,n).pipe(te(function(e){var n=e.module,r=e.routes,a=function(e,t,n,r){return n.length>0&&function(e,t,n){return r.some(function(n){return Af(e,t,n)&&Nf(n)!==Vc})}(e,n)?{segmentGroup:Pf(new rf(t,function(e,t){var n,r,i={};i[Vc]=t;try{for(var o=u(e),a=o.next();!a.done;a=o.next()){var s=a.value;""===s.path&&Nf(s)!==Vc&&(i[Nf(s)]=new rf([],{}))}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}(r,new rf(n,e.children)))),slicedSegments:[]}:0===n.length&&function(e,t,n){return r.some(function(n){return Af(e,t,n)})}(e,n)?{segmentGroup:Pf(new rf(e.segments,function(e,t,n,r){var i,a,s={};try{for(var l=u(n),c=l.next();!c.done;c=l.next()){var f=c.value;Af(e,t,f)&&!r[Nf(f)]&&(s[Nf(f)]=new rf([],{}))}}catch(h){i={error:h}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}return o({},r,s)}(e,n,r,e.children))),slicedSegments:n}:{segmentGroup:e,slicedSegments:n}}(t,s,c,r),l=a.segmentGroup,f=a.slicedSegments;return 0===f.length&&l.hasChildren()?i.expandChildren(n,r,l).pipe(Q(function(e){return new rf(s,e)})):0===r.length&&0===f.length?Bl(new rf(s,{})):i.expandSegment(n,l,r,f,Vc,!0).pipe(Q(function(e){return new rf(s.concat(e.segments),e.children)}))}))},e.prototype.getChildConfig=function(e,t){var n=this;return t.children?Bl(new Hc(t.children,e)):t.loadChildren?void 0!==t._loadedConfig?Bl(t._loadedConfig):function(e,t){var n=t.canLoad;return n&&0!==n.length?Xc(ee(n).pipe(Q(function(n){var r=e.get(n);return ef(r.canLoad?r.canLoad(t):r(t))}))):Bl(!0)}(e.injector,t).pipe(te(function(r){return r?n.configLoader.load(e.injector,t).pipe(Q(function(e){return t._loadedConfig=e,e})):function(e){return new I(function(t){return t.error(((n=Error("NavigationCancelingError: Cannot load children because the guard of the route \"path: '"+e.path+"'\" returned false")).ngNavigationCancelingError=!0,n));var n})}(t)})):Bl(new Hc([],e))},e.prototype.lineralizeSegments=function(e,t){for(var n=[],r=t.root;;){if(n=n.concat(r.segments),0===r.numberOfChildren)return Bl(n);if(r.numberOfChildren>1||!r.children[Vc])return Tf(e.redirectTo);r=r.children[Vc]}},e.prototype.applyRedirectCommands=function(e,t,n){return this.applyRedirectCreatreUrlTree(t,this.urlSerializer.parse(t),e,n)},e.prototype.applyRedirectCreatreUrlTree=function(e,t,n,r){var i=this.createSegmentGroup(e,t.root,n,r);return new nf(i,this.createQueryParams(t.queryParams,this.urlTree.queryParams),t.fragment)},e.prototype.createQueryParams=function(e,t){var n={};return Zc(e,function(e,r){if("string"==typeof e&&e.startsWith(":")){var i=e.substring(1);n[r]=t[i]}else n[r]=e}),n},e.prototype.createSegmentGroup=function(e,t,n,r){var i=this,o=this.createSegments(e,t.segments,n,r),a={};return Zc(t.children,function(t,o){a[o]=i.createSegmentGroup(e,t,n,r)}),new rf(o,a)},e.prototype.createSegments=function(e,t,n,r){var i=this;return t.map(function(t){return t.path.startsWith(":")?i.findPosParam(e,t,r):i.findOrReturn(t,n)})},e.prototype.findPosParam=function(e,t,n){var r=n[t.path.substring(1)];if(!r)throw new Error("Cannot redirect to '"+e+"'. Cannot find '"+t.path+"'.");return r},e.prototype.findOrReturn=function(e,t){var n,r,i=0;try{for(var o=u(t),a=o.next();!a.done;a=o.next()){var s=a.value;if(s.path===e.path)return t.splice(i),s;i++}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return e},e}();function If(e,t,n){if(""===t.path)return"full"===t.pathMatch&&(e.hasChildren()||n.length>0)?{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}:{matched:!0,consumedSegments:[],lastChild:0,positionalParamSegments:{}};var r=(t.matcher||qc)(n,e,t);return r?{matched:!0,consumedSegments:r.consumed,lastChild:r.consumed.length,positionalParamSegments:r.posParams}:{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}}function Pf(e){if(1===e.numberOfChildren&&e.children[Vc]){var t=e.children[Vc];return new rf(e.segments.concat(t.segments),t.children)}return e}function Af(e,t,n){return(!(e.hasChildren()||t.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0!==n.redirectTo}function Nf(e){return e.outlet||Vc}var Rf=function(){function e(e){this._root=e}return Object.defineProperty(e.prototype,"root",{get:function(){return this._root.value},enumerable:!0,configurable:!0}),e.prototype.parent=function(e){var t=this.pathFromRoot(e);return t.length>1?t[t.length-2]:null},e.prototype.children=function(e){var t=jf(e,this._root);return t?t.children.map(function(e){return e.value}):[]},e.prototype.firstChild=function(e){var t=jf(e,this._root);return t&&t.children.length>0?t.children[0].value:null},e.prototype.siblings=function(e){var t=Df(e,this._root);return t.length<2?[]:t[t.length-2].children.map(function(e){return e.value}).filter(function(t){return t!==e})},e.prototype.pathFromRoot=function(e){return Df(e,this._root).map(function(e){return e.value})},e}();function jf(e,t){var n,r;if(e===t.value)return t;try{for(var i=u(t.children),o=i.next();!o.done;o=i.next()){var a=jf(e,o.value);if(a)return a}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return null}function Df(e,t){var n,r;if(e===t.value)return[t];try{for(var i=u(t.children),o=i.next();!o.done;o=i.next()){var a=Df(e,o.value);if(a.length)return a.unshift(t),a}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return[]}var Mf=function(){function e(e,t){this.value=e,this.children=t}return e.prototype.toString=function(){return"TreeNode("+this.value+")"},e}();function Lf(e){var t={};return e&&e.children.forEach(function(e){return t[e.value.outlet]=e}),t}var Uf=function(e){function t(t,n){var r=e.call(this,t)||this;return r.snapshot=n,Hf(r,t),r}return i(t,e),t.prototype.toString=function(){return this.snapshot.toString()},t}(Rf);function Ff(e,t){var n=function(e,t){var n=new zf([],{},{},"",{},Vc,t,null,e.root,-1,{});return new qf("",new Mf(n,[]))}(e,t),r=new Hl([new of("",{})]),i=new Hl({}),o=new Hl({}),a=new Hl({}),s=new Hl(""),u=new Vf(r,i,a,s,o,Vc,t,n.root);return u.snapshot=n.root,new Uf(new Mf(u,[]),n)}var Vf=function(){function e(e,t,n,r,i,o,a,s){this.url=e,this.params=t,this.queryParams=n,this.fragment=r,this.data=i,this.outlet=o,this.component=a,this._futureSnapshot=s}return Object.defineProperty(e.prototype,"routeConfig",{get:function(){return this._futureSnapshot.routeConfig},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=this.params.pipe(Q(function(e){return zc(e)}))),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(Q(function(e){return zc(e)}))),this._queryParamMap},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return this.snapshot?this.snapshot.toString():"Future("+this._futureSnapshot+")"},e}();function Bf(e,t){void 0===t&&(t="emptyOnly");var n=e.pathFromRoot,r=0;if("always"!==t)for(r=n.length-1;r>=1;){var i=n[r],a=n[r-1];if(i.routeConfig&&""===i.routeConfig.path)r--;else{if(a.component)break;r--}}return function(e){return e.reduce(function(e,t){return{params:o({},e.params,t.params),data:o({},e.data,t.data),resolve:o({},e.resolve,t._resolvedData)}},{params:{},data:{},resolve:{}})}(n.slice(r))}var zf=function(){function e(e,t,n,r,i,o,a,s,u,l,c){this.url=e,this.params=t,this.queryParams=n,this.fragment=r,this.data=i,this.outlet=o,this.component=a,this.routeConfig=s,this._urlSegment=u,this._lastPathIndex=l,this._resolve=c}return Object.defineProperty(e.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=zc(this.params)),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=zc(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return"Route(url:'"+this.url.map(function(e){return e.toString()}).join("/")+"', path:'"+(this.routeConfig?this.routeConfig.path:"")+"')"},e}(),qf=function(e){function t(t,n){var r=e.call(this,n)||this;return r.url=t,Hf(r,n),r}return i(t,e),t.prototype.toString=function(){return Wf(this._root)},t}(Rf);function Hf(e,t){t.value._routerState=e,t.children.forEach(function(t){return Hf(e,t)})}function Wf(e){var t=e.children.length>0?" { "+e.children.map(Wf).join(", ")+" } ":"";return""+e.value+t}function $f(e){if(e.snapshot){var t=e.snapshot,n=e._futureSnapshot;e.snapshot=n,Kc(t.queryParams,n.queryParams)||e.queryParams.next(n.queryParams),t.fragment!==n.fragment&&e.fragment.next(n.fragment),Kc(t.params,n.params)||e.params.next(n.params),function(e,t){if(e.length!==t.length)return!1;for(var n=0;n0&&Kf(n[0]))throw new Error("Root segment cannot have matrix parameters");var r=n.find(function(e){return"object"==typeof e&&null!=e&&e.outlets});if(r&&r!==Yc(n))throw new Error("{outlets:{}} has to be the last command")}return e.prototype.toRoot=function(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]},e}(),Zf=function(){return function(e,t,n){this.segmentGroup=e,this.processChildren=t,this.index=n}}();function Xf(e){return"object"==typeof e&&null!=e&&e.outlets?e.outlets[Vc]:""+e}function eh(e,t,n){if(e||(e=new rf([],{})),0===e.segments.length&&e.hasChildren())return th(e,t,n);var r=function(e,t,n){for(var r=0,i=t,o={match:!1,pathIndex:0,commandIndex:0};i=n.length)return o;var a=e.segments[i],s=Xf(n[r]),u=r0&&void 0===s)break;if(s&&u&&"object"==typeof u&&void 0===u.outlets){if(!oh(s,u,a))return o;r+=2}else{if(!oh(s,{},a))return o;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}(e,t,n),i=n.slice(r.commandIndex);if(r.match&&r.pathIndex=2?function(t){return T(bc(e,void 0),Yl(1),oc(void 0))(t)}:function(t){return T(bc(function(t,n,r){return e(t)}),Yl(1))(t)}}(function(e,t){return e})):Bl(null)},e.prototype.isDeactivating=function(){return 0!==this.canDeactivateChecks.length},e.prototype.isActivating=function(){return 0!==this.canActivateChecks.length},e.prototype.setupChildRouteGuards=function(e,t,n,r){var i=this,o=Lf(t);e.children.forEach(function(e){i.setupRouteGuards(e,o[e.value.outlet],n,r.concat([e.value])),delete o[e.value.outlet]}),Zc(o,function(e,t){return i.deactivateRouteAndItsChildren(e,n.getContext(t))})},e.prototype.setupRouteGuards=function(e,t,n,r){var i=e.value,o=t?t.value:null,a=n?n.getContext(e.value.outlet):null;if(o&&i.routeConfig===o.routeConfig){var s=this.shouldRunGuardsAndResolvers(o,i,i.routeConfig.runGuardsAndResolvers);s?this.canActivateChecks.push(new ah(r)):(i.data=o.data,i._resolvedData=o._resolvedData),this.setupChildRouteGuards(e,t,i.component?a?a.children:null:n,r),s&&this.canDeactivateChecks.push(new sh(a.outlet.component,o))}else o&&this.deactivateRouteAndItsChildren(t,a),this.canActivateChecks.push(new ah(r)),this.setupChildRouteGuards(e,null,i.component?a?a.children:null:n,r)},e.prototype.shouldRunGuardsAndResolvers=function(e,t,n){switch(n){case"always":return!0;case"paramsOrQueryParamsChange":return!Gf(e,t)||!Kc(e.queryParams,t.queryParams);case"paramsChange":default:return!Gf(e,t)}},e.prototype.deactivateRouteAndItsChildren=function(e,t){var n=this,r=Lf(e),i=e.value;Zc(r,function(e,r){n.deactivateRouteAndItsChildren(e,i.component?t?t.children.getContext(r):null:t)}),this.canDeactivateChecks.push(new sh(i.component&&t&&t.outlet&&t.outlet.isActivated?t.outlet.component:null,i))},e.prototype.runCanDeactivateChecks=function(){var e=this;return ee(this.canDeactivateChecks).pipe(te(function(t){return e.runCanDeactivate(t.component,t.route)}),lc(function(e){return!0===e}))},e.prototype.runCanActivateChecks=function(){var e=this;return ee(this.canActivateChecks).pipe(vc(function(t){return Xc(ee([e.fireChildActivationStart(t.route.parent),e.fireActivationStart(t.route),e.runCanActivateChild(t.path),e.runCanActivate(t.route)]))}),lc(function(e){return!0===e}))},e.prototype.fireActivationStart=function(e){return null!==e&&this.forwardEvent&&this.forwardEvent(new Mc(e)),Bl(!0)},e.prototype.fireChildActivationStart=function(e){return null!==e&&this.forwardEvent&&this.forwardEvent(new jc(e)),Bl(!0)},e.prototype.runCanActivate=function(e){var t=this,n=e.routeConfig?e.routeConfig.canActivate:null;return n&&0!==n.length?Xc(ee(n).pipe(Q(function(n){var r=t.getToken(n,e);return ef(r.canActivate?r.canActivate(e,t.future):r(e,t.future)).pipe(yc())}))):Bl(!0)},e.prototype.runCanActivateChild=function(e){var t=this,n=e[e.length-1];return Xc(ee(e.slice(0,e.length-1).reverse().map(function(e){return t.extractCanActivateChild(e)}).filter(function(e){return null!==e})).pipe(Q(function(e){return Xc(ee(e.guards).pipe(Q(function(r){var i=t.getToken(r,e.node);return ef(i.canActivateChild?i.canActivateChild(n,t.future):i(n,t.future)).pipe(yc())})))})))},e.prototype.extractCanActivateChild=function(e){var t=e.routeConfig?e.routeConfig.canActivateChild:null;return t&&0!==t.length?{node:e,guards:t}:null},e.prototype.runCanDeactivate=function(e,t){var n=this,r=t&&t.routeConfig?t.routeConfig.canDeactivate:null;return r&&0!==r.length?ee(r).pipe(te(function(r){var i=n.getToken(r,t);return ef(i.canDeactivate?i.canDeactivate(e,t,n.curr,n.future):i(e,t,n.curr,n.future)).pipe(yc())})).pipe(lc(function(e){return!0===e})):Bl(!0)},e.prototype.runResolve=function(e,t){return this.resolveNode(e._resolve,e).pipe(Q(function(n){return e._resolvedData=n,e.data=o({},e.data,Bf(e,t).resolve),null}))},e.prototype.resolveNode=function(e,t){var n=this,r=Object.keys(e);if(0===r.length)return Bl({});if(1===r.length){var i=r[0];return this.getResolver(e[i],t).pipe(Q(function(e){var t;return(t={})[i]=e,t}))}var o={};return ee(r).pipe(te(function(r){return n.getResolver(e[r],t).pipe(Q(function(e){return o[r]=e,e}))})).pipe(uc(),Q(function(){return o}))},e.prototype.getResolver=function(e,t){var n=this.getToken(e,t);return ef(n.resolve?n.resolve(t,this.future):n(t,this.future))},e.prototype.getToken=function(e,t){var n=function(e){if(!e)return null;for(var t=e.parent;t;t=t.parent){var n=t.routeConfig;if(n&&n._loadedConfig)return n._loadedConfig}return null}(t);return(n?n.module.injector:this.moduleInjector).get(e)},e}(),lh=function(){return function(){}}(),ch=function(){function e(e,t,n,r,i,o){this.rootComponentType=e,this.config=t,this.urlTree=n,this.url=r,this.paramsInheritanceStrategy=i,this.relativeLinkResolution=o}return e.prototype.recognize=function(){try{var e=ph(this.urlTree.root,[],[],this.config,this.relativeLinkResolution).segmentGroup,t=this.processSegmentGroup(this.config,e,Vc),n=new zf([],Object.freeze({}),Object.freeze(o({},this.urlTree.queryParams)),this.urlTree.fragment,{},Vc,this.rootComponentType,null,this.urlTree.root,-1,{}),r=new Mf(n,t),i=new qf(this.url,r);return this.inheritParamsAndData(i._root),Bl(i)}catch(a){return new I(function(e){return e.error(a)})}},e.prototype.inheritParamsAndData=function(e){var t=this,n=e.value,r=Bf(n,this.paramsInheritanceStrategy);n.params=Object.freeze(r.params),n.data=Object.freeze(r.data),e.children.forEach(function(e){return t.inheritParamsAndData(e)})},e.prototype.processSegmentGroup=function(e,t,n){return 0===t.segments.length&&t.hasChildren()?this.processChildren(e,t):this.processSegment(e,t,t.segments,n)},e.prototype.processChildren=function(e,t){var n,r=this,i=sf(t,function(t,n){return r.processSegmentGroup(e,t,n)});return n={},i.forEach(function(e){var t=n[e.value.outlet];if(t){var r=t.url.map(function(e){return e.toString()}).join("/"),i=e.value.url.map(function(e){return e.toString()}).join("/");throw new Error("Two segments cannot have the same outlet name: '"+r+"' and '"+i+"'.")}n[e.value.outlet]=e.value}),i.sort(function(e,t){return e.value.outlet===Vc?-1:t.value.outlet===Vc?1:e.value.outlet.localeCompare(t.value.outlet)}),i},e.prototype.processSegment=function(e,t,n,r){var i,o;try{for(var a=u(e),s=a.next();!s.done;s=a.next()){var l=s.value;try{return this.processSegmentAgainstRoute(l,t,n,r)}catch(c){if(!(c instanceof lh))throw c}}}catch(f){i={error:f}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}if(this.noLeftoversInUrl(t,n,r))return[];throw new lh},e.prototype.noLeftoversInUrl=function(e,t,n){return 0===t.length&&!e.children[n]},e.prototype.processSegmentAgainstRoute=function(e,t,n,r){if(e.redirectTo)throw new lh;if((e.outlet||Vc)!==r)throw new lh;var i,a=[],s=[];if("**"===e.path){var u=n.length>0?Yc(n).parameters:{};i=new zf(n,u,Object.freeze(o({},this.urlTree.queryParams)),this.urlTree.fragment,mh(e),r,e.component,e,fh(t),hh(t)+n.length,yh(e))}else{var l=function(e,t,n){if(""===t.path){if("full"===t.pathMatch&&(e.hasChildren()||n.length>0))throw new lh;return{consumedSegments:[],lastChild:0,parameters:{}}}var r=(t.matcher||qc)(n,e,t);if(!r)throw new lh;var i={};Zc(r.posParams,function(e,t){i[t]=e.path});var a=r.consumed.length>0?o({},i,r.consumed[r.consumed.length-1].parameters):i;return{consumedSegments:r.consumed,lastChild:r.consumed.length,parameters:a}}(t,e,n);a=l.consumedSegments,s=n.slice(l.lastChild),i=new zf(a,l.parameters,Object.freeze(o({},this.urlTree.queryParams)),this.urlTree.fragment,mh(e),r,e.component,e,fh(t),hh(t)+a.length,yh(e))}var c=function(e){return e.children?e.children:e.loadChildren?e._loadedConfig.routes:[]}(e),f=ph(t,a,s,c,this.relativeLinkResolution),h=f.segmentGroup,p=f.slicedSegments;if(0===p.length&&h.hasChildren()){var d=this.processChildren(c,h);return[new Mf(i,d)]}if(0===c.length&&0===p.length)return[new Mf(i,[])];var g=this.processSegment(c,h,p,Vc);return[new Mf(i,g)]},e}();function fh(e){for(var t=e;t._sourceSegment;)t=t._sourceSegment;return t}function hh(e){for(var t=e,n=t._segmentIndexShift?t._segmentIndexShift:0;t._sourceSegment;)n+=(t=t._sourceSegment)._segmentIndexShift?t._segmentIndexShift:0;return n-1}function ph(e,t,n,r,i){if(n.length>0&&function(e,t,n){return r.some(function(n){return dh(e,t,n)&&gh(n)!==Vc})}(e,n)){var a=new rf(t,function(e,t,n,r){var i,o,a={};a[Vc]=r,r._sourceSegment=e,r._segmentIndexShift=t.length;try{for(var s=u(n),l=s.next();!l.done;l=s.next()){var c=l.value;if(""===c.path&&gh(c)!==Vc){var f=new rf([],{});f._sourceSegment=e,f._segmentIndexShift=t.length,a[gh(c)]=f}}}catch(h){i={error:h}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return a}(e,t,r,new rf(n,e.children)));return a._sourceSegment=e,a._segmentIndexShift=t.length,{segmentGroup:a,slicedSegments:[]}}if(0===n.length&&function(e,t,n){return r.some(function(n){return dh(e,t,n)})}(e,n)){var s=new rf(e.segments,function(e,t,n,r,i,a){var s,l,c={};try{for(var f=u(r),h=f.next();!h.done;h=f.next()){var p=h.value;if(dh(e,n,p)&&!i[gh(p)]){var d=new rf([],{});d._sourceSegment=e,d._segmentIndexShift="legacy"===a?e.segments.length:t.length,c[gh(p)]=d}}}catch(g){s={error:g}}finally{try{h&&!h.done&&(l=f.return)&&l.call(f)}finally{if(s)throw s.error}}return o({},i,c)}(e,t,n,r,e.children,i));return s._sourceSegment=e,s._segmentIndexShift=t.length,{segmentGroup:s,slicedSegments:n}}var l=new rf(e.segments,e.children);return l._sourceSegment=e,l._segmentIndexShift=t.length,{segmentGroup:l,slicedSegments:n}}function dh(e,t,n){return(!(e.hasChildren()||t.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0===n.redirectTo}function gh(e){return e.outlet||Vc}function mh(e){return e.data||{}}function yh(e){return e.resolve||{}}var vh=function(){return function(){}}(),bh=function(){function e(){}return e.prototype.shouldDetach=function(e){return!1},e.prototype.store=function(e,t){},e.prototype.shouldAttach=function(e){return!1},e.prototype.retrieve=function(e){return null},e.prototype.shouldReuseRoute=function(e,t){return e.routeConfig===t.routeConfig},e}(),wh=new ge("ROUTES"),_h=function(){function e(e,t,n,r){this.loader=e,this.compiler=t,this.onLoadStartListener=n,this.onLoadEndListener=r}return e.prototype.load=function(e,t){var n=this;return this.onLoadStartListener&&this.onLoadStartListener(t),this.loadModuleFactory(t.loadChildren).pipe(Q(function(r){n.onLoadEndListener&&n.onLoadEndListener(t);var i=r.create(e);return new Hc(Qc(i.injector.get(wh)).map(Jc),i)}))},e.prototype.loadModuleFactory=function(e){var t=this;return"string"==typeof e?ee(this.loader.load(e)):ef(e()).pipe(te(function(e){return e instanceof zt?Bl(e):ee(t.compiler.compileModuleAsync(e))}))},e}(),xh=function(){return function(){}}(),Sh=function(){function e(){}return e.prototype.shouldProcessUrl=function(e){return!0},e.prototype.extract=function(e){return e},e.prototype.merge=function(e,t){return e},e}();function Eh(e){throw e}function kh(e,t,n){return t.parse("/")}function Ch(e,t){return Bl(null)}var Th=function(){function e(e,t,n,r,i,o,a,s){var u=this;this.rootComponentType=e,this.urlSerializer=t,this.rootContexts=n,this.location=r,this.config=s,this.navigations=new Hl(null),this.navigationId=0,this.isNgZoneEnabled=!1,this.events=new D,this.errorHandler=Eh,this.malformedUriErrorHandler=kh,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:Ch,afterPreactivation:Ch},this.urlHandlingStrategy=new Sh,this.routeReuseStrategy=new bh,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="legacy",this.ngModule=i.get(Bt),this.console=i.get(Tt);var l=i.get(Kt);this.isNgZoneEnabled=l instanceof Kt,this.resetConfig(s),this.currentUrlTree=new nf(new rf([],{}),{},null),this.rawUrlTree=this.currentUrlTree,this.configLoader=new _h(o,a,function(e){return u.triggerEvent(new Nc(e))},function(e){return u.triggerEvent(new Rc(e))}),this.routerState=Ff(this.currentUrlTree,this.rootComponentType),this.processNavigations()}return e.prototype.resetRootComponentType=function(e){this.rootComponentType=e,this.routerState.root.component=this.rootComponentType},e.prototype.initialNavigation=function(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})},e.prototype.setUpLocationChangeListener=function(){var e=this;this.locationSubscription||(this.locationSubscription=this.location.subscribe(function(t){var n=e.parseUrl(t.url),r="popstate"===t.type?"popstate":"hashchange",i=t.state&&t.state.navigationId?{navigationId:t.state.navigationId}:null;setTimeout(function(){e.scheduleNavigation(n,r,i,{replaceUrl:!0})},0)}))},Object.defineProperty(e.prototype,"url",{get:function(){return this.serializeUrl(this.currentUrlTree)},enumerable:!0,configurable:!0}),e.prototype.triggerEvent=function(e){this.events.next(e)},e.prototype.resetConfig=function(e){Wc(e),this.config=e.map(Jc),this.navigated=!1,this.lastSuccessfulId=-1},e.prototype.ngOnDestroy=function(){this.dispose()},e.prototype.dispose=function(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=null)},e.prototype.createUrlTree=function(e,t){void 0===t&&(t={});var n=t.relativeTo,r=t.queryParams,i=t.fragment,a=t.preserveQueryParams,s=t.queryParamsHandling,u=t.preserveFragment;cn()&&a&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead.");var l=n||this.routerState.root,f=u?this.currentUrlTree.fragment:i,h=null;if(s)switch(s){case"merge":h=o({},this.currentUrlTree.queryParams,r);break;case"preserve":h=this.currentUrlTree.queryParams;break;default:h=r||null}else h=a?this.currentUrlTree.queryParams:r||null;return null!==h&&(h=this.removeEmptyProps(h)),function(e,t,n,r,i){if(0===n.length)return Qf(t.root,t.root,t,r,i);var o=function(e){if("string"==typeof e[0]&&1===e.length&&"/"===e[0])return new Yf(!0,0,e);var t=0,n=!1,r=e.reduce(function(e,r,i){if("object"==typeof r&&null!=r){if(r.outlets){var o={};return Zc(r.outlets,function(e,t){o[t]="string"==typeof e?e.split("/"):e}),c(e,[{outlets:o}])}if(r.segmentPath)return c(e,[r.segmentPath])}return"string"!=typeof r?c(e,[r]):0===i?(r.split("/").forEach(function(r,i){0==i&&"."===r||(0==i&&""===r?n=!0:".."===r?t++:""!=r&&e.push(r))}),e):c(e,[r])},[]);return new Yf(n,t,r)}(n);if(o.toRoot())return Qf(t.root,new rf([],{}),t,r,i);var a=function(e,n,r){if(e.isAbsolute)return new Zf(t.root,!0,0);if(-1===r.snapshot._lastPathIndex)return new Zf(r.snapshot._urlSegment,!0,0);var i=Kf(e.commands[0])?0:1;return function(t,n,o){for(var a=r.snapshot._urlSegment,s=r.snapshot._lastPathIndex+i,u=e.numberOfDoubleDots;u>s;){if(u-=s,!(a=a.parent))throw new Error("Invalid number of '../'");s=a.segments.length}return new Zf(a,!1,s-u)}()}(o,0,e),s=a.processChildren?th(a.segmentGroup,a.index,o.commands):eh(a.segmentGroup,a.index,o.commands);return Qf(a.segmentGroup,s,t,r,i)}(l,this.currentUrlTree,e,h,f)},e.prototype.navigateByUrl=function(e,t){void 0===t&&(t={skipLocationChange:!1}),cn()&&this.isNgZoneEnabled&&!Kt.isInAngularZone()&&this.console.warn("Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?");var n=e instanceof nf?e:this.parseUrl(e),r=this.urlHandlingStrategy.merge(n,this.rawUrlTree);return this.scheduleNavigation(r,"imperative",null,t)},e.prototype.navigate=function(e,t){return void 0===t&&(t={skipLocationChange:!1}),function(e){for(var t=0;t0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]t.timeSent?1:e.timeSent.\n\n :message\n a schem:Message;\n schem:sender s:me;\n schem:text "'+e.message+'";\n schem:dateSent "'+e.timeSent.toISOString()+'".\n ',[4,this.getChatUrl(this.thisUser.value,this.otherUser)];case 1:return n=r.sent()+"message.ttl",gp.createFile(n).then(function(e){gp.updateFile(e,t).then(function(){console.log("Message has been sent successfully")},function(e){return console.log(e)})}),[2]}})})},e.prototype.changeChat=function(e){return mp(this,void 0,void 0,function(){var t=this;return yp(this,function(n){return this.isActive.next(!0),null===e?console.log("Trying to change to chat with a null user!"):(this.otherUser=e,this.checkFolderStructure().then(function(){t.loadMessages()})),[2]})})},e.prototype.addFriend=function(e){this.thisUser.value.webId!==e&&this.rdf.addFriend(e)},e.prototype.removeFriend=function(e){var t=this;this.thisUser.value.webId!==e&&(this.rdf.removeFriend(e),this.getChatUrl(this.thisUser.value,new dp(e,"","")).then(function(e){t.removeFolderStructure(e.toString())}))},e.prototype.removeFolderStructure=function(e){return mp(this,void 0,void 0,function(){return yp(this,function(t){return gp.deleteFolder(e).then(function(){console.log("Removed folder "+e+".")},function(e){return console.log(e)}),[2]})})},e.prototype.checkFolderStructure=function(){return mp(this,void 0,void 0,function(){var e=this;return yp(this,function(t){switch(t.label){case 0:return[4,this.rdf.getSession()];case 1:t.sent();try{this.getChatUrl(this.thisUser.value,this.otherUser).then(function(t){gp.readFolder(t).then(function(){console.log("Folder structure correct")},function(){console.log("Attempting to create: "+t),e.createFolderStructure(t).then(function(){console.log("Creating ACL file..."),e.grantAccessToFolder(t,e.otherUser)})})})}catch(n){console.log("Error creating folder structure/with permissions: "+n)}return[2]}})})},e.prototype.createFolderStructure=function(e){return mp(this,void 0,void 0,function(){var t;return yp(this,function(n){switch(n.label){case 0:return t=this.thisUser.value.webId.replace("/profile/card#me","/"),[4,gp.createFolder(t+"private/").then(function(){gp.createFolder(t+"private/dechat/").then(function(){gp.createFolder(e).then(function(){console.log("Folder structure created")},function(e){return console.log("Could not create folder structure: "+e)})},function(e){return console.log("Could not create folder structure: "+e)})},function(e){return console.log("Could not create folder structure: "+e)})];case 1:return n.sent(),[2]}})})},e.prototype.grantAccessToFolder=function(e,t){return mp(this,void 0,void 0,function(){var n,r;return yp(this,function(i){switch(i.label){case 0:return n=t.webId.replace("#me","#"),r="@prefix : <#>.\n @prefix n0: .\n @prefix ch: <./>.\n @prefix c: .\n @prefix c0: <"+n+">.\n\n :ControlReadWrite\n a n0:Authorization;\n n0:accessTo ch:;\n n0:agent c:me;\n n0:defaultForNew ch:;\n n0:mode n0:Control, n0:Read, n0:Write.\n :Read\n a n0:Authorization;\n n0:accessTo ch:;\n n0:agent c0:me;\n n0:defaultForNew ch:;\n n0:mode n0:Read.",e+=".acl",console.log(e),console.log(r),[4,gp.updateFile(e,r).then(function(){console.log("Folder permisions added")},function(e){return console.log("Could not set folder permisions"+e)})];case 1:return i.sent(),[2]}})})},e}(),bp=function(){function e(e){var t=this;this.chat=e,this.active=!1,this.chat.isChatActive().subscribe(function(e){t.active=e})}return e.prototype.ngOnInit=function(){},e.prototype.scrollToBottom=function(){this.feedContainer.nativeElement.scrollTop=this.feedContainer.nativeElement.scrollHeight},e.prototype.ngAfterViewChecked=function(){this.scrollToBottom()},e}(),wp=function(){function e(e,t,n,r){this.chat=e,this.toastr=t,this.auth=n,this.sdv=r}return e.prototype.ngOnInit=function(){this.identityProviders=this.auth.getIdentityProviders()},e.prototype.addFriend=function(){if(this.webIdAddFriend)if(""===this.webIdAddFriend.trim())this.toastr.error("Please add a webId","Wrong input");else{var e=this.createWebId(this.selectedAddProviderUrl,this.webIdAddFriend,this.customAddProviderUrl);this.chat.addFriend(e.trim()),this.webIdAddFriend=""}else this.toastr.error("Please add a webId","Wrong input")},e.prototype.removeFriend=function(){if(this.webIdRemoveFriend)if(""===this.webIdRemoveFriend.trim())this.toastr.error("Please add a webId","Wrong input");else{var e=this.createWebId(this.selectedRemoveProviderUrl,this.webIdRemoveFriend,this.customRemoveProviderUrl);this.chat.removeFriend(e.trim()),this.webIdRemoveFriend=""}else this.toastr.error("Please add a webId","Wrong input")},e.prototype.handleSubmit=function(e){13===e.keyCode&&this.addFriend()},e.prototype.createWebId=function(e,t,n){return"https://solid.community"===e?"https://"+t+".solid.community/profile/card#me":"https://inrupt.net/auth"===e?"https://"+t+".inrupt.net/profile/card#me":"https://"+t+"."+n+"/profile/card#me"},e}(),_p=function(){function e(){}return e.prototype.ngOnInit=function(){},e}(),xp=function(){return function(){}}(),Sp=function(){return function(){this.title="SolidDechat"}}(),Ep=Yr({encapsulation:2,styles:[],data:{}});function kp(e){return qo(0,[(e()(),ki(0,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),po(1,212992,null,0,jh,[Rh,Pn,Ut,[8,null],An],null,null)],function(e,t){e(t,1,0)},null)}function Cp(e){return qo(0,[(e()(),ki(0,0,null,null,1,"ng-component",[],null,null,null,kp,Ep)),po(1,49152,null,0,Fc,[],null,null)],null,null)}var Tp=qi("ng-component",Fc,Cp,{},{},[]),Op=Yr({encapsulation:2,styles:[],data:{animation:[{type:7,name:"flyInOut",definitions:[{type:0,name:"inactive",styles:{type:6,styles:{opacity:0},offset:null},options:void 0},{type:0,name:"active",styles:{type:6,styles:{opacity:1},offset:null},options:void 0},{type:0,name:"removed",styles:{type:6,styles:{opacity:0},offset:null},options:void 0},{type:1,expr:"inactive => active",animation:{type:4,styles:null,timings:"{{ easeTime }}ms {{ easing }}"},options:null},{type:1,expr:"active => removed",animation:{type:4,styles:null,timings:"{{ easeTime }}ms {{ easing }}"},options:null}],options:{}}]}});function Ip(e){return qo(0,[(e()(),ki(0,0,null,null,2,"button",[["aria-label","Close"],["class","toast-close-button"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.remove()&&r),r},null,null)),(e()(),ki(1,0,null,null,1,"span",[["aria-hidden","true"]],null,null,null,null,null)),(e()(),Vo(-1,null,["\xd7"]))],null,null)}function Pp(e){return qo(0,[(e()(),ki(0,0,null,null,1,"div",[],[[8,"className",0],[1,"aria-label",0]],null,null,null,null)),(e()(),Vo(1,null,[" "," "]))],null,function(e,t){var n=t.component;e(t,0,0,n.options.titleClass,n.title),e(t,1,0,n.title)})}function Ap(e){return qo(0,[(e()(),ki(0,0,null,null,0,"div",[["aria-live","polite"],["role","alertdialog"]],[[8,"className",0],[8,"innerHTML",1]],null,null,null,null))],null,function(e,t){var n=t.component;e(t,0,0,n.options.messageClass,n.message)})}function Np(e){return qo(0,[(e()(),ki(0,0,null,null,1,"div",[["aria-live","polite"],["role","alertdialog"]],[[8,"className",0],[1,"aria-label",0]],null,null,null,null)),(e()(),Vo(1,null,[" "," "]))],null,function(e,t){var n=t.component;e(t,0,0,n.options.messageClass,n.message),e(t,1,0,n.message)})}function Rp(e){return qo(0,[(e()(),ki(0,0,null,null,1,"div",[],null,null,null,null,null)),(e()(),ki(1,0,null,null,0,"div",[["class","toast-progress"]],[[4,"width",null]],null,null,null,null))],null,function(e,t){e(t,1,0,t.component.width+"%")})}function jp(e){return qo(0,[(e()(),Ei(16777216,null,null,1,null,Ip)),po(1,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,null,1,null,Pp)),po(3,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,null,1,null,Ap)),po(5,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,null,1,null,Np)),po(7,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,null,1,null,Rp)),po(9,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,1,0,n.options.closeButton),e(t,3,0,n.title),e(t,5,0,n.message&&n.options.enableHtml),e(t,7,0,n.message&&!n.options.enableHtml),e(t,9,0,n.options.progressBar)},null)}function Dp(e){return qo(0,[(e()(),ki(0,0,null,null,1,"div",[["toast-component",""]],[[8,"className",0],[40,"@flyInOut",0],[4,"display",null]],[[null,"click"],[null,"mouseenter"],[null,"mouseleave"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==eo(e,1).tapToast()&&r),"mouseenter"===t&&(r=!1!==eo(e,1).stickAround()&&r),"mouseleave"===t&&(r=!1!==eo(e,1).delayedHideToast()&&r),r},jp,Op)),po(1,180224,null,0,Ol,[Tl,yl,Kt],null,null)],null,function(e,t){e(t,0,0,eo(t,1).toastClasses,eo(t,1).state,eo(t,1).displayStyle)})}var Mp=qi("[toast-component]",Ol,Dp,{},{},[]),Lp=function(e){function t(t,n){var r=e.call(this,t)||this;r.sources=n,r.completed=0,r.haveValues=0;var i=n.length;r.values=new Array(i);for(var o=0;oe?{max:{max:e,actual:t.value}}:null}},e.required=function(e){return Vp(e.value)?{required:!0}:null},e.requiredTrue=function(e){return!0===e.value?null:{required:!0}},e.email=function(e){return Vp(e.value)?null:Bp.test(e.value)?null:{email:!0}},e.minLength=function(e){return function(t){if(Vp(t.value))return null;var n=t.value?t.value.length:0;return ne?{maxlength:{requiredLength:e,actualLength:n}}:null}},e.pattern=function(t){return t?("string"==typeof t?(r="","^"!==t.charAt(0)&&(r+="^"),r+=t,"$"!==t.charAt(t.length-1)&&(r+="$"),n=new RegExp(r)):(r=t.toString(),n=t),function(e){if(Vp(e.value))return null;var t=e.value;return n.test(t)?null:{pattern:{requiredPattern:r,actualValue:t}}}):e.nullValidator;var n,r},e.nullValidator=function(e){return null},e.compose=function(e){if(!e)return null;var t=e.filter(qp);return 0==t.length?null:function(e){return Wp(function(e,n){return t.map(function(t){return t(e)})}(e))}},e.composeAsync=function(e){if(!e)return null;var t=e.filter(qp);return 0==t.length?null:function(e){return function e(){for(var t,n=[],r=0;r=0;--t)if(this._accessors[t][1]===e)return void this._accessors.splice(t,1)},e.prototype.select=function(e){var t=this;this._accessors.forEach(function(n){t._isSameGroup(n,e)&&n[1]!==e&&n[1].fireUncheck(e.value)})},e.prototype._isSameGroup=function(e,t){return!!e[0].control&&e[0]._parent===t._control._parent&&e[1].name===t.name},e}(),nd=function(){function e(e,t,n,r){this._renderer=e,this._elementRef=t,this._registry=n,this._injector=r,this.onChange=function(){},this.onTouched=function(){}}return e.prototype.ngOnInit=function(){this._control=this._injector.get(ed),this._checkName(),this._registry.add(this._control,this)},e.prototype.ngOnDestroy=function(){this._registry.remove(this)},e.prototype.writeValue=function(e){this._state=e===this.value,this._renderer.setProperty(this._elementRef.nativeElement,"checked",this._state)},e.prototype.registerOnChange=function(e){var t=this;this._fn=e,this.onChange=function(){e(t.value),t._registry.select(t)}},e.prototype.fireUncheck=function(e){this.writeValue(e)},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)},e.prototype._checkName=function(){this.name&&this.formControlName&&this.name!==this.formControlName&&this._throwNameError(),!this.name&&this.formControlName&&(this.name=this.formControlName)},e.prototype._throwNameError=function(){throw new Error('\n If you define both a name and a formControlName attribute on your radio button, their values\n must match. Ex: \n ')},e}(),rd='\n

\n
\n \n
\n
\n\n In your class:\n\n this.myGroup = new FormGroup({\n person: new FormGroup({ firstName: new FormControl() })\n });',id='\n
\n
\n \n
\n
';function od(e,t){return c(t.path,[e])}function ad(e,t){e||ud(t,"Cannot find control with"),t.valueAccessor||ud(t,"No value accessor for form control with"),e.validator=zp.compose([e.validator,t.validator]),e.asyncValidator=zp.composeAsync([e.asyncValidator,t.asyncValidator]),t.valueAccessor.writeValue(e.value),function(e,t){t.valueAccessor.registerOnChange(function(n){e._pendingValue=n,e._pendingChange=!0,e._pendingDirty=!0,"change"===e.updateOn&&sd(e,t)})}(e,t),function(e,t){e.registerOnChange(function(e,n){t.valueAccessor.writeValue(e),n&&t.viewToModelUpdate(e)})}(e,t),function(e,t){t.valueAccessor.registerOnTouched(function(){e._pendingTouched=!0,"blur"===e.updateOn&&e._pendingChange&&sd(e,t),"submit"!==e.updateOn&&e.markAsTouched()})}(e,t),t.valueAccessor.setDisabledState&&e.registerOnDisabledChange(function(e){t.valueAccessor.setDisabledState(e)}),t._rawValidators.forEach(function(t){t.registerOnValidatorChange&&t.registerOnValidatorChange(function(){return e.updateValueAndValidity()})}),t._rawAsyncValidators.forEach(function(t){t.registerOnValidatorChange&&t.registerOnValidatorChange(function(){return e.updateValueAndValidity()})})}function sd(e,t){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}function ud(e,t){var n;throw n=e.path.length>1?"path: '"+e.path.join(" -> ")+"'":e.path[0]?"name: '"+e.path+"'":"unspecified name attribute",new Error(t+" "+n)}function ld(e){return null!=e?zp.compose(e.map(Qp)):null}function cd(e){return null!=e?zp.composeAsync(e.map(Yp)):null}var fd=[Gp,function(){function e(e,t){this._renderer=e,this._elementRef=t,this.onChange=function(e){},this.onTouched=function(){}}return e.prototype.writeValue=function(e){this._renderer.setProperty(this._elementRef.nativeElement,"value",parseFloat(e))},e.prototype.registerOnChange=function(e){this.onChange=function(t){e(""==t?null:parseFloat(t))}},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)},e}(),Zp,function(){function e(e,t){this._renderer=e,this._elementRef=t,this._optionMap=new Map,this._idCounter=0,this.onChange=function(e){},this.onTouched=function(){},this._compareWith=Ae}return Object.defineProperty(e.prototype,"compareWith",{set:function(e){if("function"!=typeof e)throw new Error("compareWith must be a function, but received "+JSON.stringify(e));this._compareWith=e},enumerable:!0,configurable:!0}),e.prototype.writeValue=function(e){this.value=e;var t=this._getOptionId(e);null==t&&this._renderer.setProperty(this._elementRef.nativeElement,"selectedIndex",-1);var n=function(e,t){return null==e?""+t:(t&&"object"==typeof t&&(t="Object"),(e+": "+t).slice(0,50))}(t,e);this._renderer.setProperty(this._elementRef.nativeElement,"value",n)},e.prototype.registerOnChange=function(e){var t=this;this.onChange=function(n){t.value=t._getOptionValue(n),e(t.value)}},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)},e.prototype._registerOption=function(){return(this._idCounter++).toString()},e.prototype._getOptionId=function(e){var t,n;try{for(var r=u(Array.from(this._optionMap.keys())),i=r.next();!i.done;i=r.next()){var o=i.value;if(this._compareWith(this._optionMap.get(o),e))return o}}catch(a){t={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return null},e.prototype._getOptionValue=function(e){var t=function(e){return e.split(":")[0]}(e);return this._optionMap.has(t)?this._optionMap.get(t):e},e}(),function(){function e(e,t){this._renderer=e,this._elementRef=t,this._optionMap=new Map,this._idCounter=0,this.onChange=function(e){},this.onTouched=function(){},this._compareWith=Ae}return Object.defineProperty(e.prototype,"compareWith",{set:function(e){if("function"!=typeof e)throw new Error("compareWith must be a function, but received "+JSON.stringify(e));this._compareWith=e},enumerable:!0,configurable:!0}),e.prototype.writeValue=function(e){var t,n=this;if(this.value=e,Array.isArray(e)){var r=e.map(function(e){return n._getOptionId(e)});t=function(e,t){e._setSelected(r.indexOf(t.toString())>-1)}}else t=function(e,t){e._setSelected(!1)};this._optionMap.forEach(t)},e.prototype.registerOnChange=function(e){var t=this;this.onChange=function(n){var r=[];if(n.hasOwnProperty("selectedOptions"))for(var i=n.selectedOptions,o=0;o0||this.disabled},t.prototype._checkAllValuesPresent=function(e){this._forEachChild(function(t,n){if(void 0===e[n])throw new Error("Must supply a value for form control with name: '"+n+"'.")})},t}(bd),xd=function(e){function t(t,n,r){var i=e.call(this,md(n),yd(r,n))||this;return i.controls=t,i._initObservables(),i._setUpdateStrategy(n),i._setUpControls(),i.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),i}return i(t,e),t.prototype.at=function(e){return this.controls[e]},t.prototype.push=function(e){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity(),this._onCollectionChange()},t.prototype.insert=function(e,t){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity()},t.prototype.removeAt=function(e){this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),this.controls.splice(e,1),this.updateValueAndValidity()},t.prototype.setControl=function(e,t){this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity(),this._onCollectionChange()},Object.defineProperty(t.prototype,"length",{get:function(){return this.controls.length},enumerable:!0,configurable:!0}),t.prototype.setValue=function(e,t){var n=this;void 0===t&&(t={}),this._checkAllValuesPresent(e),e.forEach(function(e,r){n._throwIfControlMissing(r),n.at(r).setValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)},t.prototype.patchValue=function(e,t){var n=this;void 0===t&&(t={}),e.forEach(function(e,r){n.at(r)&&n.at(r).patchValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)},t.prototype.reset=function(e,t){void 0===e&&(e=[]),void 0===t&&(t={}),this._forEachChild(function(n,r){n.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t),this._updatePristine(t),this._updateTouched(t)},t.prototype.getRawValue=function(){return this.controls.map(function(e){return e instanceof wd?e.value:e.getRawValue()})},t.prototype._syncPendingControls=function(){var e=this.controls.reduce(function(e,t){return!!t._syncPendingControls()||e},!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e},t.prototype._throwIfControlMissing=function(e){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(e))throw new Error("Cannot find form control at index "+e)},t.prototype._forEachChild=function(e){this.controls.forEach(function(t,n){e(t,n)})},t.prototype._updateValue=function(){var e=this;this.value=this.controls.filter(function(t){return t.enabled||e.disabled}).map(function(e){return e.value})},t.prototype._anyControls=function(e){return this.controls.some(function(t){return t.enabled&&e(t)})},t.prototype._setUpControls=function(){var e=this;this._forEachChild(function(t){return e._registerControl(t)})},t.prototype._checkAllValuesPresent=function(e){this._forEachChild(function(t,n){if(void 0===e[n])throw new Error("Must supply a value for form control at index: "+n+".")})},t.prototype._allControlsDisabled=function(){var e,t;try{for(var n=u(this.controls),r=n.next();!r.done;r=n.next())if(r.value.enabled)return!1}catch(i){e={error:i}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return this.controls.length>0||this.disabled},t.prototype._registerControl=function(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)},t}(bd),Sd=Promise.resolve(null),Ed=function(e){function t(t,n){var r=e.call(this)||this;return r.submitted=!1,r._directives=[],r.ngSubmit=new Jt,r.form=new _d({},ld(t),cd(n)),r}return i(t,e),t.prototype.ngAfterViewInit=function(){this._setUpdateStrategy()},Object.defineProperty(t.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"controls",{get:function(){return this.form.controls},enumerable:!0,configurable:!0}),t.prototype.addControl=function(e){var t=this;Sd.then(function(){var n=t._findContainer(e.path);e.control=n.registerControl(e.name,e.control),ad(e.control,e),e.control.updateValueAndValidity({emitEvent:!1}),t._directives.push(e)})},t.prototype.getControl=function(e){return this.form.get(e.path)},t.prototype.removeControl=function(e){var t=this;Sd.then(function(){var n,r,i=t._findContainer(e.path);i&&i.removeControl(e.name),(r=(n=t._directives).indexOf(e))>-1&&n.splice(r,1)})},t.prototype.addFormGroup=function(e){var t=this;Sd.then(function(){var n=t._findContainer(e.path),r=new _d({});(function(e,t){null==e&&ud(t,"Cannot find control with"),e.validator=zp.compose([e.validator,t.validator]),e.asyncValidator=zp.composeAsync([e.asyncValidator,t.asyncValidator])})(r,e),n.registerControl(e.name,r),r.updateValueAndValidity({emitEvent:!1})})},t.prototype.removeFormGroup=function(e){var t=this;Sd.then(function(){var n=t._findContainer(e.path);n&&n.removeControl(e.name)})},t.prototype.getFormGroup=function(e){return this.form.get(e.path)},t.prototype.updateModel=function(e,t){var n=this;Sd.then(function(){n.form.get(e.path).setValue(t)})},t.prototype.setValue=function(e){this.control.setValue(e)},t.prototype.onSubmit=function(e){return this.submitted=!0,t=this._directives,this.form._syncPendingControls(),t.forEach(function(e){var t=e.control;"submit"===t.updateOn&&t._pendingChange&&(e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1)}),this.ngSubmit.emit(e),!1;var t},t.prototype.onReset=function(){this.resetForm()},t.prototype.resetForm=function(e){void 0===e&&(e=void 0),this.form.reset(e),this.submitted=!1},t.prototype._setUpdateStrategy=function(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)},t.prototype._findContainer=function(e){return e.pop(),e.length?this.form.get(e):this.form},t}(Fp),kd=function(){function e(){}return e.modelParentException=function(){throw new Error('\n ngModel cannot be used to register form controls with a parent formGroup directive. Try using\n formGroup\'s partner directive "formControlName" instead. Example:\n\n \n
\n \n
\n\n In your class:\n\n this.myGroup = new FormGroup({\n firstName: new FormControl()\n });\n\n Or, if you\'d like to avoid registering this form control, indicate that it\'s standalone in ngModelOptions:\n\n Example:\n\n \n
\n \n \n
\n ')},e.formGroupNameException=function(){throw new Error("\n ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive.\n\n Option 1: Use formControlName instead of ngModel (reactive strategy):\n\n "+rd+"\n\n Option 2: Update ngModel's parent be ngModelGroup (template-driven strategy):\n\n "+id)},e.missingNameException=function(){throw new Error('If ngModel is used within a form tag, either the name attribute must be set or the form\n control must be defined as \'standalone\' in ngModelOptions.\n\n Example 1: \n Example 2: ')},e.modelGroupParentException=function(){throw new Error("\n ngModelGroup cannot be used with a parent formGroup directive.\n\n Option 1: Use formGroupName instead of ngModelGroup (reactive strategy):\n\n "+rd+"\n\n Option 2: Use a regular form tag instead of the formGroup directive (template-driven strategy):\n\n "+id)},e}(),Cd=function(e){function t(t,n,r){var i=e.call(this)||this;return i._parent=t,i._validators=n,i._asyncValidators=r,i}var n;return i(t,e),n=t,t.prototype._checkParentType=function(){this._parent instanceof n||this._parent instanceof Ed||kd.modelGroupParentException()},t}(hd),Td=Promise.resolve(null),Od=function(e){function t(t,n,r,i){var o=e.call(this)||this;return o.control=new wd,o._registered=!1,o.update=new Jt,o._parent=t,o._rawValidators=n||[],o._rawAsyncValidators=r||[],o.valueAccessor=function(e,t){if(!t)return null;Array.isArray(t)||ud(e,"Value accessor was not provided as an array for form control with");var n=void 0,r=void 0,i=void 0;return t.forEach(function(t){var o;t.constructor===Kp?n=t:(o=t,fd.some(function(e){return o.constructor===e})?(r&&ud(e,"More than one built-in value accessor matches form control with"),r=t):(i&&ud(e,"More than one custom value accessor matches form control with"),i=t))}),i||r||n||(ud(e,"No valid value accessor for form control with"),null)}(o,i),o}return i(t,e),t.prototype.ngOnChanges=function(e){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in e&&this._updateDisabled(e),function(e,t){if(!e.hasOwnProperty("model"))return!1;var n=e.model;return!!n.isFirstChange()||!Ae(t,n.currentValue)}(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)},t.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeControl(this)},Object.defineProperty(t.prototype,"path",{get:function(){return this._parent?od(this.name,this._parent):[this.name]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"validator",{get:function(){return ld(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"asyncValidator",{get:function(){return cd(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),t.prototype.viewToModelUpdate=function(e){this.viewModel=e,this.update.emit(e)},t.prototype._setUpControl=function(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0},t.prototype._setUpdateStrategy=function(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)},t.prototype._isStandalone=function(){return!this._parent||!(!this.options||!this.options.standalone)},t.prototype._setUpStandalone=function(){ad(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})},t.prototype._checkForErrors=function(){this._isStandalone()||this._checkParentType(),this._checkName()},t.prototype._checkParentType=function(){!(this._parent instanceof Cd)&&this._parent instanceof hd?kd.formGroupNameException():this._parent instanceof Cd||this._parent instanceof Ed||kd.modelParentException()},t.prototype._checkName=function(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()||this.name||kd.missingNameException()},t.prototype._updateValue=function(e){var t=this;Td.then(function(){t.control.setValue(e,{emitViewToModelChange:!1})})},t.prototype._updateDisabled=function(e){var t=this,n=e.isDisabled.currentValue,r=""===n||n&&"false"!==n;Td.then(function(){r&&!t.control.disabled?t.control.disable():!r&&t.control.disabled&&t.control.enable()})},t}(ed),Id=function(){return function(){}}(),Pd=function(){return function(){}}(),Ad=function(){return function(){}}();function Nd(e){return function(t){return t.lift(new Rd(e))}}var Rd=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var n=new jd(e),r=J(n,this.notifier);return r&&!n.seenValue?(n.add(r),t.subscribe(n)):n},e}(),jd=function(e){function t(t){var n=e.call(this,t)||this;return n.seenValue=!1,n}return i(t,e),t.prototype.notifyNext=function(e,t,n,r,i){this.seenValue=!0,this.complete()},t.prototype.notifyComplete=function(){},t}(K),Dd=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return i(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return t;clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r=void 0;try{this.work(e)}catch(i){n=!0,r=!!i&&i||new Error(i)}if(n)return this.unsubscribe(),r},t.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,n=t.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},t}(function(e){function t(t,n){return e.call(this)||this}return i(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(m)),Md=function(){function e(t,n){void 0===n&&(n=e.now),this.SchedulerAction=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(n,t)},e.now=function(){return Date.now()},e}(),Ld=new(function(e){function t(n,r){void 0===r&&(r=Md.now);var i=e.call(this,n,function(){return t.delegate&&t.delegate!==i?t.delegate.now():r()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return i(t,e),t.prototype.schedule=function(n,r,i){return void 0===r&&(r=0),t.delegate&&t.delegate!==this?t.delegate.schedule(n,r,i):e.prototype.schedule.call(this,n,r,i)},t.prototype.flush=function(e){var t=this.actions;if(this.active)t.push(e);else{var n;this.active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(Md))(Dd),Ud=function(){function e(e,t){this.dueTime=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new Fd(e,this.dueTime,this.scheduler))},e}(),Fd=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.dueTime=n,i.scheduler=r,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return i(t,e),t.prototype._next=function(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Vd,this.dueTime,this))},t.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},t.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var e=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}},t.prototype.clearDebounce=function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)},t}(S);function Vd(e){e.debouncedNext()}function Bd(e,t,n,r){return p(n)&&(r=n,n=void 0),r?Bd(e,t,n).pipe(Q(function(e){return f(e)?r.apply(void 0,e):r(e)})):new I(function(r){!function e(t,n,r,i,o){var a;if(function(e){return e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}(t)){var s=t;t.addEventListener(n,r,o),a=function(){return s.removeEventListener(n,r,o)}}else if(function(e){return e&&"function"==typeof e.on&&"function"==typeof e.off}(t)){var u=t;t.on(n,r),a=function(){return u.off(n,r)}}else if(function(e){return e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}(t)){var l=t;t.addListener(n,r),a=function(){return l.removeListener(n,r)}}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(var c=0,f=t.length;c1?Array.prototype.slice.call(arguments):e)},r,n)})}var zd=function(){return function(e){this.template=e}}(),qd=function(){function e(){}return e.prototype.warn=function(e){console.warn(e)},e.ngInjectableDef=de({factory:function(){return new e},token:e,providedIn:"root"}),e}();function Hd(e){return null!=e}function Wd(e){return"object"==typeof e&&Hd(e)}function $d(e){return e instanceof Function}var Gd={"\u24b6":"A","\uff21":"A","\xc0":"A","\xc1":"A","\xc2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\xc3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A","\xc4":"A","\u01de":"A","\u1ea2":"A","\xc5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A","\ua732":"AA","\xc6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\xc7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D","\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\xc8":"E","\xc9":"E","\xca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\xcb":"E","\u1eba":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F","\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H","\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\xcc":"I","\xcd":"I","\xce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\xcf":"I","\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K","\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L","\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\xd1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N","\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\xd2":"O","\xd3":"O","\xd4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O","\xd5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\xd6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O","\u1ed8":"O","\u01ea":"O","\u01ec":"O","\xd8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P","\u1e54":"P","\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R","\ua75a":"R","\ua7a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S","\u0218":"S","\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\xd9":"U","\xda":"U","\xdb":"U","\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\xdc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U","\u0214":"U","\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W","\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\xdd":"Y","\u0176":"Y","\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a","\u1e9a":"a","\xe0":"a","\xe1":"a","\xe2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\xe3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a","\u1eb3":"a","\u0227":"a","\u01e1":"a","\xe4":"a","\u01df":"a","\u1ea3":"a","\xe5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\xe6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av","\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\xe7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e","\xe8":"e","\xe9":"e","\xea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e","\xeb":"e","\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g","\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h","\u021f":"h","\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\xec":"i","\xed":"i","\xee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\xef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i","\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k","\u0137":"k","\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l","\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\xf1":"n","\u1e45":"n","\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\xf2":"o","\xf3":"o","\xf4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\xf5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o","\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\xf6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o","\u1edd":"o","\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\xf8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p","\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u0157":"r","\u1e5f":"r","\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\xdf":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s","\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t","\u0288":"t","\u2c66":"t","\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\xf9":"u","\xfa":"u","\xfb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\xfc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u","\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v","\u1e7d":"v","\u1e7f":"v","\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\xfd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y","\u1e8f":"y","\xff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f":"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z","\u017c":"z","\u017e":"z","\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038a":"\u0399","\u03aa":"\u0399","\u038c":"\u039f","\u038e":"\u03a5","\u03ab":"\u03a5","\u038f":"\u03a9","\u03ac":"\u03b1","\u03ad":"\u03b5","\u03ae":"\u03b7","\u03af":"\u03b9","\u03ca":"\u03b9","\u0390":"\u03b9","\u03cc":"\u03bf","\u03cd":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u03c9":"\u03c9","\u03c2":"\u03c3"};function Jd(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return Gd[e]||e})}function Kd(){return"axxxxxxxxxxx".replace(/[x]/g,function(e){return(16*Math.random()|0).toString(16)})}var Qd=function(){function e(e,t){this._ngSelect=e,this._selectionModel=t,this._items=[],this._filteredItems=[],this._markedIndex=-1}return Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filteredItems",{get:function(){return this._filteredItems},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"markedIndex",{get:function(){return this._markedIndex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedItems",{get:function(){return this._selectionModel.value},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"markedItem",{get:function(){return this._filteredItems[this._markedIndex]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"noItemsToSelect",{get:function(){return this._ngSelect.hideSelected&&this._items.length===this.selectedItems.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxItemsSelected",{get:function(){return this._ngSelect.multiple&&this._ngSelect.maxSelectedItems<=this.selectedItems.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastSelectedItem",{get:function(){for(var e=this.selectedItems.length-1;e>=0;e--){var t=this.selectedItems[e];if(!t.disabled)return t}return null},enumerable:!0,configurable:!0}),e.prototype.setItems=function(e){var t=this;this._items=e.map(function(e,n){return t.mapItem(e,n)}),this._ngSelect.groupBy?(this._groups=this._groupBy(this._items,this._ngSelect.groupBy),this._items=this._flatten(this._groups)):(this._groups=new Map,this._groups.set(void 0,this._items)),this._filteredItems=c(this._items)},e.prototype.select=function(e){if(!e.selected&&!this.maxItemsSelected){var t=this._ngSelect.multiple;t||this.clearSelected(),this._selectionModel.select(e,t,this._ngSelect.selectableGroupAsModel),this._ngSelect.hideSelected&&this._hideSelected(e)}},e.prototype.unselect=function(e){e.selected&&(this._selectionModel.unselect(e,this._ngSelect.multiple),this._ngSelect.hideSelected&&Hd(e.index)&&this._ngSelect.multiple&&this._showSelected(e))},e.prototype.findItem=function(e){var t,n=this;return t=this._ngSelect.compareWith?function(t){return n._ngSelect.compareWith(t.value,e)}:this._ngSelect.bindValue?function(t){return!t.children&&n.resolveNested(t.value,n._ngSelect.bindValue)===e}:function(t){return t.value===e||!t.children&&t.label&&t.label===n.resolveNested(e,n._ngSelect.bindLabel)},this._items.find(function(e){return t(e)})},e.prototype.addItem=function(e){var t=this.mapItem(e,this._items.length);return this._items.push(t),this._filteredItems.push(t),t},e.prototype.clearSelected=function(e){void 0===e&&(e=!1),this._selectionModel.clear(e),this._items.forEach(function(t){t.selected=e&&t.selected&&t.disabled,t.marked=!1}),this._ngSelect.hideSelected&&this.resetFilteredItems()},e.prototype.findByLabel=function(e){return e=Jd(e).toLocaleLowerCase(),this.filteredItems.find(function(t){return Jd(t.label).toLocaleLowerCase().substr(0,e.length)===e})},e.prototype.filter=function(e){var t,n;if(e){this._filteredItems=[],e=this._ngSelect.searchFn?e:Jd(e).toLocaleLowerCase();var r=this._ngSelect.searchFn||this._defaultSearchFn,i=this._ngSelect.hideSelected,o=function(t){var n,o,s,f=[];try{for(var h=u(a._groups.get(t)),p=h.next();!p.done;p=h.next()){var d=p.value;i&&(d.parent&&d.parent.selected||d.selected)||r(e,a._ngSelect.searchFn?d.value:d)&&f.push(d)}}catch(y){n={error:y}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}if(f.length>0){var g=l(f.slice(-1),1)[0];if(g.parent){var m=a._items.find(function(e){return e===g.parent});a._filteredItems.push(m)}(s=a._filteredItems).push.apply(s,c(f))}},a=this;try{for(var s=u(Array.from(this._groups.keys())),f=s.next();!f.done;f=s.next())o(f.value)}catch(h){t={error:h}}finally{try{f&&!f.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}else this.resetFilteredItems()},e.prototype.resetFilteredItems=function(){this._filteredItems.length!==this._items.length&&(this._filteredItems=this._ngSelect.hideSelected&&this.selectedItems.length>0?this._items.filter(function(e){return!e.selected}):this._items)},e.prototype.unmarkItem=function(){this._markedIndex=-1},e.prototype.markNextItem=function(){this._stepToItem(1)},e.prototype.markPreviousItem=function(){this._stepToItem(-1)},e.prototype.markItem=function(e){this._markedIndex=this._filteredItems.indexOf(e)},e.prototype.markSelectedOrDefault=function(e){if(0!==this._filteredItems.length){var t=this._ngSelect.hideSelected?-1:this._filteredItems.indexOf(this.lastSelectedItem);this._markedIndex=this.lastSelectedItem&&t>-1?t:this._ngSelect.excludeGroupsFromDefaultSelection?e?this.filteredItems.findIndex(function(e){return!e.disabled&&!e.children}):-1:e?this.filteredItems.findIndex(function(e){return!e.disabled}):-1}},e.prototype.resolveNested=function(e,t){if(!Wd(e))return e;if(-1===t.indexOf("."))return e[t];for(var n=t.split("."),r=e,i=0,o=n.length;i-1},e.prototype._getNextItemIndex=function(e){return e>0?this._markedIndex===this._filteredItems.length-1?0:this._markedIndex+1:this._markedIndex<=0?this._filteredItems.length-1:this._markedIndex-1},e.prototype._stepToItem=function(e){0===this._filteredItems.length||this._filteredItems.every(function(e){return e.disabled})||(this._markedIndex=this._getNextItemIndex(e),this.markedItem.disabled&&this._stepToItem(e))},e.prototype._groupBy=function(e,t){var n,r,i,o,a=this,s=new Map;if(0===e.length)return s;if(Array.isArray(e[0].value[t])){try{for(var l=u(e),c=l.next();!c.done;c=l.next()){var f=((m=c.value).value[t]||[]).map(function(e,t){return a.mapItem(e,t)});s.set(m,f)}}catch(b){n={error:b}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return s}var h=$d(this._ngSelect.groupBy),p=function(e){var n=h?t(e.value):e.value[t];return Hd(n)?n:void 0};try{for(var d=u(e),g=d.next();!g.done;g=d.next()){var m,y=p(m=g.value),v=s.get(y);v?v.push(m):s.set(y,[m])}}catch(w){i={error:w}}finally{try{g&&!g.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}return s},e.prototype._flatten=function(e){var t,n,r=$d(this._ngSelect.groupBy),i=[],o=e.get(void 0)||[];i.push.apply(i,c(o));var a=o.length,s=function(t){if(!Hd(t))return"continue";var n=Wd(t),o={label:n?"":t,children:void 0,parent:null,index:a++,disabled:!l._ngSelect.selectableGroup,htmlId:Kd()},s=r?l._ngSelect.bindLabel:l._ngSelect.groupBy,u=l._ngSelect.groupValue||function(){var e;return n?t.value:((e={})[s]=t,e)},f=e.get(t).map(function(e){return e.parent=o,e.children=void 0,e.index=a++,e});o.children=f,o.value=u(t,f.map(function(e){return e.value})),i.push(o),i.push.apply(i,c(f))},l=this;try{for(var f=u(Array.from(e.keys())),h=f.next();!h.done;h=f.next())s(h.value)}catch(p){t={error:p}}finally{try{h&&!h.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}return i},e}(),Yd=function(){var e={Tab:9,Enter:13,Esc:27,Space:32,ArrowUp:38,ArrowDown:40,Backspace:8};return e[e.Tab]="Tab",e[e.Enter]="Enter",e[e.Esc]="Esc",e[e.Space]="Space",e[e.ArrowUp]="ArrowUp",e[e.ArrowDown]="ArrowDown",e[e.Backspace]="Backspace",e}(),Zd=function(){function e(){}return e.prototype.requestAnimationFrame=function(e){return window.requestAnimationFrame(e)},e.prototype.setTimeout=function(e,t){return window.setTimeout(e,t)},e.ngInjectableDef=de({factory:function(){return new e},token:e,providedIn:"root"}),e}(),Xd=function(){function e(){}return e.prototype.calculateItems=function(e,t,n){var r=e.childHeight*e.itemsLength;t.scrollTop>r&&(t.scrollTop=r);var i=Math.max(0,t.scrollTop)/r*e.itemsLength,o=Math.min(e.itemsLength,Math.ceil(i)+(e.itemsPerCol+1)),a=Math.max(0,o-e.itemsPerCol-1),s=Math.min(a,Math.floor(i)),u=e.childHeight*Math.ceil(s)-e.childHeight*Math.min(s,n);return u=isNaN(u)?0:u,s=isNaN(s)?-1:s,o=isNaN(o)?-1:o,s-=n,o+=n,{topPadding:u,scrollHeight:r,start:s=Math.max(0,s),end:o=Math.min(e.itemsLength,o)}},e.prototype.calculateDimensions=function(e,t,n,r){var i=n.getBoundingClientRect(),o=r.children[t]?r.children[t].getBoundingClientRect():{width:i.width,height:i.height,top:0},a=Math.max(1,Math.floor(i.height/o.height));return{itemsLength:e,viewWidth:i.width,viewHeight:i.height,childWidth:o.width,childHeight:o.height,itemsPerCol:a}},e.ngInjectableDef=de({factory:function(){return new e},token:e,providedIn:"root"}),e}(),eg=function(){function e(e,t,n,r,i,o){this._renderer=e,this._zone=t,this._virtualScrollService=n,this._window=r,this._document=o,this.items=[],this.position="auto",this.bufferAmount=4,this.virtualScroll=!1,this.filterValue=null,this.update=new Jt,this.scroll=new Jt,this.scrollToEnd=new Jt,this.outsideClick=new Jt,this._destroy$=new D,this._startupLoop=!0,this._isScrolledToMarked=!1,this._scrollToEndFired=!1,this._disposeScrollListener=function(){},this._disposeDocumentResizeListener=function(){},this._dropdown=i.nativeElement}return e.prototype.handleMousedown=function(e){"INPUT"!==e.target.tagName&&(e.preventDefault(),e.stopPropagation())},e.prototype.ngOnInit=function(){var e=this;this._select=this._dropdown.parentElement,this._handleScroll(),this._document&&ae(Bd(this._document,"touchstart",{capture:!0}),Bd(this._document,"mousedown",{capture:!0})).pipe(Nd(this._destroy$)).subscribe(function(t){return e._handleOutsideClick(t)})},e.prototype.ngOnChanges=function(e){e.items&&(this._isScrolledToMarked=!1,this._handleItemsChange(e.items))},e.prototype.ngOnDestroy=function(){this._disposeDocumentResizeListener(),this._disposeScrollListener(),this._destroy$.next(),this._destroy$.complete(),this._destroy$.unsubscribe(),this.appendTo&&this._renderer.removeChild(this._dropdown.parentNode,this._dropdown)},e.prototype.ngAfterContentInit=function(){var e=this;this._whenContentReady().then(function(){e._destroy$.closed||(e.appendTo&&(e._appendDropdown(),e._handleDocumentResize()),e.updateDropdownPosition())})},e.prototype.refresh=function(){var e=this;return new Promise(function(t){e._zone.runOutsideAngular(function(){e._window.requestAnimationFrame(function(){e._updateItems().then(t)})})})},e.prototype.scrollInto=function(e){if(e){var t=this.items.indexOf(e);if(!(t<0||t>=this.items.length)){var n=this._calculateDimensions(this.virtualScroll?0:t),r=this.scrollElementRef.nativeElement,i=Math.floor(n.viewHeight/n.childHeight)-1;if(this.virtualScroll)r.scrollTop=t*n.childHeight-n.childHeight*Math.min(t,i);else{var o=Array.from(this.contentElementRef.nativeElement.children).slice(0,t).reduce(function(e,t){return e+t.clientHeight},0);r.scrollTop=o-n.childHeight*Math.min(t,i)}}}},e.prototype.scrollIntoTag=function(){var e=this.scrollElementRef.nativeElement,t=this._calculateDimensions();e.scrollTop=t.childHeight*(t.itemsLength+1)},e.prototype.updateDropdownPosition=function(){var e=this;this._window.setTimeout(function(){e._currentPosition=e._calculateCurrentPosition(e._dropdown),"top"===e._currentPosition?(e._renderer.addClass(e._dropdown,"ng-select-top"),e._renderer.removeClass(e._dropdown,"ng-select-bottom"),e._renderer.addClass(e._select,"ng-select-top"),e._renderer.removeClass(e._select,"ng-select-bottom")):(e._renderer.addClass(e._dropdown,"ng-select-bottom"),e._renderer.removeClass(e._dropdown,"ng-select-top"),e._renderer.addClass(e._select,"ng-select-bottom"),e._renderer.removeClass(e._select,"ng-select-top")),e.appendTo&&e._updateAppendedDropdownPosition(),e._dropdown.style.opacity="1"},0)},e.prototype._handleOutsideClick=function(e){if(!this._select.contains(e.target)&&!this._dropdown.contains(e.target)){var t=e.path||e.composedPath&&e.composedPath();e.target&&e.target.shadowRoot&&t&&t[0]&&this._select.contains(t[0])||this.outsideClick.emit()}},e.prototype._handleScroll=function(){var e=this;this._disposeScrollListener=this._renderer.listen(this.scrollElementRef.nativeElement,"scroll",function(){e.refresh(),e._fireScrollToEnd()})},e.prototype._handleItemsChange=function(e){var t=this;this._scrollToEndFired=!1,this._previousStart=void 0,this._previousEnd=void 0,(void 0!==e&&void 0===e.previousValue||void 0!==e.previousValue&&0===e.previousValue.length)&&(this._startupLoop=!0),this.items=e.currentValue||[],this.refresh().then(function(){t.appendTo&&"top"===t._currentPosition&&t._updateAppendedDropdownPosition()})},e.prototype._updateItems=function(){var e=this;if(Kt.assertNotInAngularZone(),!this.virtualScroll)return this._zone.run(function(){e.update.emit(e.items.slice()),e._scrollToMarked()}),Promise.resolve();var t=function(n){var r=e._calculateDimensions(),i=e._virtualScrollService.calculateItems(r,e.scrollElementRef.nativeElement,e.bufferAmount||0);e.paddingElementRef.nativeElement.style.height=i.scrollHeight+"px",e.contentElementRef.nativeElement.style.transform="translateY("+i.topPadding+"px)",i.start!==e._previousStart||i.end!==e._previousEnd?(e._zone.run(function(){e.update.emit(e.items.slice(i.start,i.end)),e.scroll.emit({start:i.start,end:i.end})}),e._previousStart=i.start,e._previousEnd=i.end,!0===e._startupLoop&&t(n)):!0===e._startupLoop&&(e._startupLoop=!1,e._scrollToMarked(),n())};return new Promise(function(e){return t(e)})},e.prototype._fireScrollToEnd=function(){this._scrollToEndFired||this.scrollElementRef.nativeElement.scrollTop+this._dropdown.clientHeight>=(this.virtualScroll?this.paddingElementRef.nativeElement:this.contentElementRef.nativeElement).clientHeight&&(this.scrollToEnd.emit(),this._scrollToEndFired=!0)},e.prototype._calculateDimensions=function(e){return void 0===e&&(e=0),this._virtualScrollService.calculateDimensions(this.items.length,e,this.scrollElementRef.nativeElement,this.contentElementRef.nativeElement)},e.prototype._handleDocumentResize=function(){var e=this;this.appendTo&&(this._disposeDocumentResizeListener=this._renderer.listen("window","resize",function(){e._updateAppendedDropdownPosition()}))},e.prototype._scrollToMarked=function(){!this._isScrolledToMarked&&this.markedItem&&(this._isScrolledToMarked=!0,this.scrollInto(this.markedItem))},e.prototype._calculateCurrentPosition=function(e){if("auto"!==this.position)return this.position;var t=this._select.getBoundingClientRect(),n=document.documentElement.scrollTop||document.body.scrollTop;return t.top+window.pageYOffset+t.height+e.getBoundingClientRect().height>n+document.documentElement.clientHeight?"top":"bottom"},e.prototype._appendDropdown=function(){var e=document.querySelector(this.appendTo);if(!e)throw new Error("appendTo selector "+this.appendTo+" did not found any parent element");e.appendChild(this._dropdown)},e.prototype._updateAppendedDropdownPosition=function(){var e=document.querySelector(this.appendTo)||document.body;this._dropdown.style.display="none";var t=this._select.getBoundingClientRect(),n=e.getBoundingClientRect();this._dropdown.style.display="";var r=t.left-n.left;this._dropdown.style.top=t.top-n.top+("bottom"===this._currentPosition?t.height:-this._dropdown.clientHeight)+"px",this._dropdown.style.bottom="auto",this._dropdown.style.left=r+"px",this._dropdown.style.width=t.width+"px",this._dropdown.style.minWidth=t.width+"px"},e.prototype._whenContentReady=function(){var e=this;if(0===this.items.length)return Promise.resolve();var t=function(n){e._dropdown.querySelector(".ng-option")?n():e._zone.runOutsideAngular(function(){setTimeout(function(){return t(n)},5)})};return new Promise(function(e){return t(e)})},e}(),tg=function(){function e(){this.notFoundText="No items found",this.typeToSearchText="Type to search",this.addTagText="Add item",this.loadingText="Loading...",this.clearAllText="Clear all",this.disableVirtualScroll=!0,this.openOnEnter=!0}return e.ngInjectableDef=de({factory:function(){return new e},token:e,providedIn:"root"}),e}(),ng=new ge("ng-select-selection-model"),rg=function(){function e(e,t,n,r,i,o,a,s){var u=this;this.classes=e,this.tabIndex=t,this.autoFocus=n,this._cd=a,this._console=s,this.clearable=!0,this.markFirst=!0,this.dropdownPosition="auto",this.loading=!1,this.closeOnSelect=!0,this.hideSelected=!1,this.selectOnTab=!1,this.bufferAmount=4,this.selectableGroup=!1,this.selectableGroupAsModel=!0,this.searchFn=null,this.excludeGroupsFromDefaultSelection=!1,this.clearOnBackspace=!0,this.labelForId=null,this.autoCorrect="off",this.autoCapitalize="off",this.multiple=!1,this.addTag=!1,this.searchable=!0,this.isOpen=!1,this.blurEvent=new Jt,this.focusEvent=new Jt,this.changeEvent=new Jt,this.openEvent=new Jt,this.closeEvent=new Jt,this.searchEvent=new Jt,this.clearEvent=new Jt,this.addEvent=new Jt,this.removeEvent=new Jt,this.scroll=new Jt,this.scrollToEnd=new Jt,this.disabled=!1,this.viewPortItems=[],this.filterValue=null,this.dropdownId=Kd(),this._items=[],this._defaultLabel="label",this._primitive=!0,this._pressedKeys=[],this._destroy$=new D,this._keyPress$=new D,this._onChange=function(e){},this._onTouched=function(){},this.clearItem=function(e){var t=u.selectedItems.find(function(t){return t.value===e});u.unselect(t)},this._mergeGlobalConfig(r),this.itemsList=new Qd(this,i()),this.element=o.nativeElement}return Object.defineProperty(e.prototype,"items",{get:function(){return this._items},set:function(e){this._itemsAreUsed=!0,this._items=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"compareWith",{get:function(){return this._compareWith},set:function(e){if(!$d(e))throw Error("`compareWith` must be a function.");this._compareWith=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clearSearchOnAdd",{get:function(){return Hd(this._clearSearchOnAdd)?this._clearSearchOnAdd:this.closeOnSelect},set:function(e){this._clearSearchOnAdd=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filtered",{get:function(){return!!this.filterValue&&this.searchable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedItems",{get:function(){return this.itemsList.selectedItems},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedValues",{get:function(){return this.selectedItems.map(function(e){return e.value})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasValue",{get:function(){return this.selectedItems.length>0},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this._handleKeyPresses()},e.prototype.ngOnChanges=function(e){e.multiple&&this.itemsList.clearSelected(),e.items&&this._setItems(e.items.currentValue||[]),e.isOpen&&(this._manualOpen=Hd(e.isOpen.currentValue))},e.prototype.ngAfterViewInit=function(){this._itemsAreUsed||this._setItemsFromNgOptions(),Hd(this.autoFocus)&&this.focus()},e.prototype.ngOnDestroy=function(){this._destroy$.next(),this._destroy$.complete()},e.prototype.handleKeyDown=function(e){if(Yd[e.which])switch(e.which){case Yd.ArrowDown:this._handleArrowDown(e);break;case Yd.ArrowUp:this._handleArrowUp(e);break;case Yd.Space:this._handleSpace(e);break;case Yd.Enter:this._handleEnter(e);break;case Yd.Tab:this._handleTab(e);break;case Yd.Esc:this.close(),e.preventDefault(),e.stopPropagation();break;case Yd.Backspace:this._handleBackspace()}else e.key&&1===e.key.length&&this._keyPress$.next(e.key.toLocaleLowerCase())},e.prototype.handleMousedown=function(e){var t=e.target;"INPUT"!==t.tagName&&e.preventDefault(),e.stopPropagation(),t.classList.contains("ng-clear-wrapper")?this.handleClearClick():t.classList.contains("ng-arrow-wrapper")?this.handleArrowClick():t.classList.contains("ng-value-icon")||(this.focused||this.focus(),this.searchable?this.open():this.toggle())},e.prototype.handleArrowClick=function(){this.isOpen?this.close():this.open()},e.prototype.handleClearClick=function(){this.hasValue&&(this.itemsList.clearSelected(!0),this._updateNgModel()),this._clearSearch(),this.focus(),this._isTypeahead&&this.typeahead.next(null),this.clearEvent.emit()},e.prototype.clearModel=function(){this.clearable&&(this.itemsList.clearSelected(),this._updateNgModel())},e.prototype.writeValue=function(e){this.itemsList.clearSelected(),this._handleWriteValue(e),this._cd.markForCheck()},e.prototype.registerOnChange=function(e){this._onChange=e},e.prototype.registerOnTouched=function(e){this._onTouched=e},e.prototype.setDisabledState=function(e){this.disabled=e,this._cd.markForCheck()},e.prototype.toggle=function(){this.isOpen?this.close():this.open()},e.prototype.open=function(){this.disabled||this.isOpen||this.itemsList.maxItemsSelected||this._manualOpen||(this._isTypeahead||this.addTag||!this.itemsList.noItemsToSelect)&&(this.isOpen=!0,this.itemsList.markSelectedOrDefault(this.markFirst),this.openEvent.emit(),this.filterValue||this.focus(),this.detectChanges())},e.prototype.close=function(){this.isOpen&&!this._manualOpen&&(this.isOpen=!1,this._clearSearch(),this._onTouched(),this.closeEvent.emit(),this._cd.markForCheck())},e.prototype.toggleItem=function(e){!e||e.disabled||this.disabled||(this.multiple&&e.selected?this.unselect(e):this.select(e))},e.prototype.select=function(e){e.selected||(this.itemsList.select(e),this.clearSearchOnAdd&&this._clearSearch(),this.multiple&&this.addEvent.emit(e.value),this._updateNgModel()),(this.closeOnSelect||this.itemsList.noItemsToSelect)&&this.close()},e.prototype.focus=function(){this.filterInput.nativeElement.focus()},e.prototype.unselect=function(e){e&&(this.itemsList.unselect(e),this.focus(),this._updateNgModel(),this.removeEvent.emit(e))},e.prototype.selectTag=function(){var e,t,n=this;t=$d(this.addTag)?this.addTag(this.filterValue):this._primitive?this.filterValue:((e={})[this.bindLabel]=this.filterValue,e);var r=function(e){return n._isTypeahead||!n.isOpen?n.itemsList.mapItem(e,null):n.itemsList.addItem(e)};t instanceof Promise?t.then(function(e){return n.select(r(e))}).catch(function(){}):t&&this.select(r(t))},e.prototype.showClear=function(){return this.clearable&&(this.hasValue||this.filterValue)&&!this.disabled},Object.defineProperty(e.prototype,"showAddTag",{get:function(){if(!this.filterValue)return!1;var e=this.filterValue.toLowerCase();return this.addTag&&!this.itemsList.filteredItems.some(function(t){return t.label.toLowerCase()===e})&&(!this.hideSelected&&this.isOpen||!this.selectedItems.some(function(t){return t.label.toLowerCase()===e}))&&!this.loading},enumerable:!0,configurable:!0}),e.prototype.showNoItemsFound=function(){var e=0===this.itemsList.filteredItems.length;return(e&&!this._isTypeahead&&!this.loading||e&&this._isTypeahead&&this.filterValue&&!this.loading)&&!this.showAddTag},e.prototype.showTypeToSearch=function(){return 0===this.itemsList.filteredItems.length&&this._isTypeahead&&!this.filterValue&&!this.loading},e.prototype.filter=function(e){this.filterValue=e,this._isTypeahead?this.typeahead.next(this.filterValue):(this.itemsList.filter(this.filterValue),this.isOpen&&this.itemsList.markSelectedOrDefault(this.markFirst)),this.searchEvent.emit({term:e,items:this.itemsList.filteredItems.map(function(e){return e.value})}),this.open()},e.prototype.onInputFocus=function(e){this.focused||(this.element.classList.add("ng-select-focused"),this.focusEvent.emit(e),this.focused=!0)},e.prototype.onInputBlur=function(e){this.element.classList.remove("ng-select-focused"),this.blurEvent.emit(e),this.isOpen||this.disabled||this._onTouched(),this.focused=!1},e.prototype.onItemHover=function(e){e.disabled||this.itemsList.markItem(e)},e.prototype.detectChanges=function(){this._cd.destroyed||this._cd.detectChanges()},e.prototype.updateDropdownPosition=function(){this.dropdownPanel&&this.dropdownPanel.updateDropdownPosition()},e.prototype._setItems=function(e){var t=e[0];this.bindLabel=this.bindLabel||this._defaultLabel,this._primitive=Hd(t)?!Wd(t):this._primitive,this.itemsList.setItems(e),e.length>0&&this.hasValue&&this.itemsList.mapSelectedItems(),this.isOpen&&Hd(this.filterValue)&&!this._isTypeahead&&this.itemsList.filter(this.filterValue),(this._isTypeahead||this.isOpen)&&this.itemsList.markSelectedOrDefault(this.markFirst)},e.prototype._setItemsFromNgOptions=function(){var e=this;this.ngOptions.changes.pipe(function(){for(var e=[],t=0;t0?X(e,n):Fl(n):Vl(e[0]),t)}}(this.ngOptions),Nd(this._destroy$)).subscribe(function(t){var n;e.bindLabel=e._defaultLabel,function(t){e.items=t.map(function(e){return{$ngOptionValue:e.value,$ngOptionLabel:e.elementRef.nativeElement.innerHTML,disabled:e.disabled}}),e.itemsList.setItems(e.items),e.hasValue&&e.itemsList.mapSelectedItems(),e.detectChanges()}(t),n=ae(e.ngOptions.changes,e._destroy$),ae.apply(void 0,c(e.ngOptions.map(function(e){return e.stateChange$}))).pipe(Nd(n)).subscribe(function(t){e.itemsList.findItem(t.value).disabled=t.disabled,e._cd.markForCheck()})})},e.prototype._isValidWriteValue=function(e){var t=this;if(!Hd(e)||this.multiple&&""===e||Array.isArray(e)&&0===e.length)return!1;var n=function(e){return!(!Hd(t.compareWith)&&Wd(e)&&t.bindValue&&(t._console.warn("Binding object("+JSON.stringify(e)+") with bindValue is not allowed."),1))};return this.multiple?Array.isArray(e)?e.every(function(e){return n(e)}):(this._console.warn("Multiple select ngModel should be array."),!1):n(e)},e.prototype._handleWriteValue=function(e){var t=this;if(this._isValidWriteValue(e)){var n=function(e){var n,r=t.itemsList.findItem(e);if(r)t.itemsList.select(r);else{var i=Wd(e);i||!i&&!t.bindValue?t.itemsList.select(t.itemsList.mapItem(e,null)):t.bindValue&&((n={})[t.bindLabel]=null,n[t.bindValue]=e,t.itemsList.select(t.itemsList.mapItem(r=n,null)))}};this.multiple?e.forEach(function(e){return n(e)}):n(e)}},e.prototype._handleKeyPresses=function(){var e,t=this;this.searchable||this._keyPress$.pipe(Nd(this._destroy$),ec(function(e){return t._pressedKeys.push(e)}),(void 0===e&&(e=Ld),function(t){return t.lift(new Ud(200,e))}),$l(function(){return t._pressedKeys.length>0}),Q(function(){return t._pressedKeys.join("")})).subscribe(function(e){var n=t.itemsList.findByLabel(e);n&&(t.isOpen?(t.itemsList.markItem(n),t._cd.markForCheck()):t.select(n)),t._pressedKeys=[]})},e.prototype._updateNgModel=function(){var e,t,n=[];try{for(var r=u(this.selectedItems),i=r.next();!i.done;i=r.next()){var o,a=i.value;if(this.bindValue)o=a.children?a.value[this.groupBy]:this.itemsList.resolveNested(a.value,this.bindValue),n.push(o);else n.push(a.value)}}catch(l){e={error:l}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}var s=this.selectedItems.map(function(e){return e.value});this.multiple?(this._onChange(n),this.changeEvent.emit(s)):(this._onChange(Hd(n[0])?n[0]:null),this.changeEvent.emit(s[0])),this._cd.markForCheck()},e.prototype._clearSearch=function(){this.filterValue&&(this.filterValue=null,this.itemsList.resetFilteredItems())},e.prototype._scrollToMarked=function(){this.isOpen&&this.dropdownPanel&&this.dropdownPanel.scrollInto(this.itemsList.markedItem)},e.prototype._scrollToTag=function(){this.isOpen&&this.dropdownPanel&&this.dropdownPanel.scrollIntoTag()},e.prototype._handleTab=function(e){this.isOpen&&(this.selectOnTab?this.itemsList.markedItem?(this.toggleItem(this.itemsList.markedItem),e.preventDefault()):this.showAddTag?(this.selectTag(),e.preventDefault()):this.close():this.close())},e.prototype._handleEnter=function(e){if(this.isOpen||this._manualOpen)this.itemsList.markedItem?this.toggleItem(this.itemsList.markedItem):this.showAddTag&&this.selectTag();else{if(!this.openOnEnter)return;this.open()}e.preventDefault(),e.stopPropagation()},e.prototype._handleSpace=function(e){this.isOpen||this._manualOpen||(this.open(),e.preventDefault())},e.prototype._handleArrowDown=function(e){this._nextItemIsTag(1)?(this.itemsList.unmarkItem(),this._scrollToTag()):(this.itemsList.markNextItem(),this._scrollToMarked()),this.open(),e.preventDefault()},e.prototype._handleArrowUp=function(e){this.isOpen&&(this._nextItemIsTag(-1)?(this.itemsList.unmarkItem(),this._scrollToTag()):(this.itemsList.markPreviousItem(),this._scrollToMarked()),e.preventDefault())},e.prototype._nextItemIsTag=function(e){var t=this.itemsList.markedIndex+e;return this.addTag&&this.filterValue&&this.itemsList.markedItem&&(t<0||t===this.itemsList.filteredItems.length)},e.prototype._handleBackspace=function(){!this.filterValue&&this.clearable&&this.clearOnBackspace&&this.hasValue&&(this.multiple?this.unselect(this.itemsList.lastSelectedItem):this.clearModel())},Object.defineProperty(e.prototype,"_isTypeahead",{get:function(){return this.typeahead&&this.typeahead.observers.length>0},enumerable:!0,configurable:!0}),e.prototype._mergeGlobalConfig=function(e){this.placeholder=this.placeholder||e.placeholder,this.notFoundText=this.notFoundText||e.notFoundText,this.typeToSearchText=this.typeToSearchText||e.typeToSearchText,this.addTagText=this.addTagText||e.addTagText,this.loadingText=this.loadingText||e.loadingText,this.clearAllText=this.clearAllText||e.clearAllText,this.virtualScroll=Hd(this.virtualScroll)?this.virtualScroll:!!Hd(e.disableVirtualScroll)&&!e.disableVirtualScroll,this.openOnEnter=Hd(this.openOnEnter)?this.openOnEnter:e.openOnEnter},e}();function ig(){return new og}var og=function(){function e(){this._selected=[]}return Object.defineProperty(e.prototype,"value",{get:function(){return this._selected},enumerable:!0,configurable:!0}),e.prototype.select=function(e,t,n){if(e.selected=!0,!n&&e.children||this._selected.push(e),t)if(e.parent){var r=e.parent.children.length,i=e.parent.children.filter(function(e){return e.selected}).length;e.parent.selected=r===i}else e.children&&(this._setChildrenSelectedState(e.children,!0),this._removeChildren(e),n||(this._selected=c(this._selected,e.children)))},e.prototype.unselect=function(e,t){var n;if(this._selected=this._selected.filter(function(t){return t!==e}),e.selected=!1,t)if(e.parent&&e.parent.selected){var r=e.parent.children;this._removeParent(e.parent),this._removeChildren(e.parent),(n=this._selected).push.apply(n,c(r.filter(function(t){return t!==e}))),e.parent.selected=!1}else e.children&&(this._setChildrenSelectedState(e.children,!1),this._removeChildren(e))},e.prototype.clear=function(e){this._selected=e?this._selected.filter(function(e){return e.disabled}):[]},e.prototype._setChildrenSelectedState=function(e,t){e.forEach(function(e){return e.selected=t})},e.prototype._removeChildren=function(e){this._selected=this._selected.filter(function(t){return t.parent!==e})},e.prototype._removeParent=function(e){this._selected=this._selected.filter(function(t){return t!==e})},e}(),ag=function(){return function(){}}(),sg=Yr({encapsulation:2,styles:[".ng-select{position:relative;display:block;box-sizing:border-box}.ng-select div,.ng-select input,.ng-select span{box-sizing:border-box}.ng-select [hidden]{display:none}.ng-select.ng-select-searchable .ng-select-container .ng-value-container .ng-input{opacity:1}.ng-select.ng-select-opened .ng-select-container{z-index:1001}.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-placeholder,.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-value{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.ng-select.ng-select-disabled .ng-arrow-wrapper{cursor:default}.ng-select.ng-select-filtered .ng-placeholder{display:none}.ng-select .ng-select-container{color:#333;cursor:default;display:flex;outline:0;overflow:hidden;position:relative;width:100%}.ng-select .ng-select-container .ng-value-container{display:flex;flex:1}.ng-select .ng-select-container .ng-value-container .ng-input{opacity:0}.ng-select .ng-select-container .ng-value-container .ng-input>input{box-sizing:content-box;background:none;border:0;box-shadow:none;outline:0;cursor:default;width:100%}.ng-select .ng-select-container .ng-value-container .ng-input>input::-ms-clear{display:none}.ng-select .ng-select-container .ng-value-container .ng-input>input[readonly]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:0;padding:0}.ng-select.ng-select-single.ng-select-filtered .ng-select-container .ng-value-container .ng-value{visibility:hidden}.ng-select.ng-select-single .ng-select-container .ng-value-container,.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{position:absolute;left:0;width:100%}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container{flex-wrap:wrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{white-space:nowrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{cursor:pointer}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input{flex:1;z-index:2}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{position:absolute;z-index:1}.ng-select .ng-clear-wrapper{cursor:pointer;position:relative;width:17px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ng-select .ng-clear-wrapper .ng-clear{display:inline-block;font-size:18px;line-height:1;pointer-events:none}.ng-select .ng-spinner-loader{border-radius:50%;width:17px;height:17px;margin-right:5px;font-size:10px;position:relative;text-indent:-9999em;border-top:2px solid rgba(66,66,66,.2);border-right:2px solid rgba(66,66,66,.2);border-bottom:2px solid rgba(66,66,66,.2);border-left:2px solid #424242;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation:.8s linear infinite load8;animation:.8s linear infinite load8}.ng-select .ng-spinner-loader:after{border-radius:50%;width:17px;height:17px}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ng-select .ng-arrow-wrapper{cursor:pointer;position:relative;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ng-select .ng-arrow-wrapper .ng-arrow{pointer-events:none;display:inline-block;height:0;width:0;position:relative}.ng-dropdown-panel{box-sizing:border-box;position:absolute;opacity:0;width:100%;z-index:1050;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .ng-dropdown-panel-items{display:block;height:auto;box-sizing:border-box;max-height:240px;overflow-y:auto}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option{box-sizing:border-box;cursor:pointer;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .highlighted{font-weight:700;text-decoration:underline}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.disabled{cursor:default}.ng-dropdown-panel .scroll-host{overflow:hidden;overflow-y:auto;position:relative;display:block;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .scrollable-content{top:0;left:0;width:100%;height:100%;position:absolute}.ng-dropdown-panel .total-padding{width:1px;opacity:0}"],data:{}});function ug(e){return qo(0,[(e()(),ki(0,0,null,null,1,"span",[["aria-hidden","true"],["class","ng-value-icon left"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.unselect(e.parent.context.$implicit)&&r),r},null,null)),(e()(),Vo(-1,null,["\xd7"])),(e()(),ki(2,0,null,null,1,"span",[["class","ng-value-label"]],null,null,null,null,null)),(e()(),Vo(3,null,["",""]))],null,function(e,t){e(t,3,0,t.parent.context.$implicit.label)})}function lg(e){return qo(0,[(e()(),Ei(0,null,null,0))],null,null)}function cg(e){return qo(0,[(e()(),ki(0,0,null,null,4,"div",[["class","ng-value"]],[[2,"ng-value-disabled",null]],null,null,null,null)),(e()(),Ei(0,[["defaultLabelTemplate",2]],null,0,null,ug)),(e()(),Ei(16777216,null,null,2,null,lg)),po(3,540672,null,0,Qs,[Pn],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null),Uo(4,{item:0,clear:1,label:2})],function(e,t){var n=t.component,r=e(t,4,0,t.context.$implicit.value,n.clearItem,t.context.$implicit.label);e(t,3,0,r,n.labelTemplate||eo(t,1))},function(e,t){e(t,0,0,t.context.$implicit.disabled)})}function fg(e){return qo(0,[(e()(),ki(0,0,null,null,2,null,null,null,null,null,null,null)),(e()(),Ei(16777216,null,null,1,null,cg)),po(2,278528,null,0,Ws,[Pn,In,Xn],{ngForOf:[0,"ngForOf"]},null),(e()(),Ei(0,null,null,0))],function(e,t){e(t,2,0,t.component.selectedItems)},null)}function hg(e){return qo(0,[(e()(),Ei(0,null,null,0))],null,null)}function pg(e){return qo(0,[(e()(),Ei(16777216,null,null,2,null,hg)),po(1,540672,null,0,Qs,[Pn],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null),Uo(2,{items:0,clear:1}),(e()(),Ei(0,null,null,0))],function(e,t){var n=t.component,r=e(t,2,0,n.selectedValues,n.clearItem);e(t,1,0,r,n.multiLabelTemplate)},null)}function dg(e){return qo(0,[(e()(),ki(0,0,null,null,0,"div",[["class","ng-spinner-loader"]],null,null,null,null,null))],null,null)}function gg(e){return qo(0,[(e()(),Ei(0,null,null,0))],null,null)}function mg(e){return qo(0,[(e()(),ki(0,0,null,null,3,null,null,null,null,null,null,null)),(e()(),Ei(0,[["defautlLoadingSpinnerTemplate",2]],null,0,null,dg)),(e()(),Ei(16777216,null,null,1,null,gg)),po(3,540672,null,0,Qs,[Pn],{ngTemplateOutlet:[0,"ngTemplateOutlet"]},null),(e()(),Ei(0,null,null,0))],function(e,t){e(t,3,0,t.component.loadingSpinnerTemplate||eo(t,1))},null)}function yg(e){return qo(0,[(e()(),ki(0,0,null,null,2,"span",[["class","ng-clear-wrapper"]],[[8,"title",0]],null,null,null,null)),(e()(),ki(1,0,null,null,1,"span",[["aria-hidden","true"],["class","ng-clear"]],null,null,null,null,null)),(e()(),Vo(-1,null,["\xd7"]))],null,function(e,t){var n;e(t,0,0,""+(null!=(n=t.component.clearAllText)?n.toString():""))})}function vg(e){return qo(0,[(e()(),ki(0,0,null,null,1,"span",[["class","ng-option-label"]],null,null,null,null,null)),(e()(),Vo(1,null,["",""]))],null,function(e,t){e(t,1,0,t.parent.context.$implicit.label)})}function bg(e){return qo(0,[(e()(),Ei(0,null,null,0))],null,null)}function wg(e){return qo(0,[(e()(),ki(0,0,null,null,4,"div",[["class","ng-option"]],[[1,"role",0],[2,"ng-option-disabled",null],[2,"ng-option-selected",null],[2,"ng-optgroup",null],[2,"ng-option",null],[2,"ng-option-child",null],[2,"ng-option-marked",null],[1,"aria-selected",0],[1,"id",0]],[[null,"click"],[null,"mouseover"]],function(e,t,n){var r=!0,i=e.component;return"click"===t&&(r=!1!==i.toggleItem(e.context.$implicit)&&r),"mouseover"===t&&(r=!1!==i.onItemHover(e.context.$implicit)&&r),r},null,null)),(e()(),Ei(0,[["defaultOptionTemplate",2]],null,0,null,vg)),(e()(),Ei(16777216,null,null,2,null,bg)),po(3,540672,null,0,Qs,[Pn],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null),Uo(4,{item:0,item$:1,index:2,searchTerm:3})],function(e,t){var n=t.component,r=e(t,4,0,t.context.$implicit.value,t.context.$implicit,t.context.$implicit.index,n.filterValue);e(t,3,0,r,t.context.$implicit.children?n.optgroupTemplate||eo(t,1):n.optionTemplate||eo(t,1))},function(e,t){e(t,0,0,t.context.$implicit.children?"group":"option",t.context.$implicit.disabled,t.context.$implicit.selected,t.context.$implicit.children,!t.context.$implicit.children,!!t.context.$implicit.parent,t.context.$implicit===t.component.itemsList.markedItem,t.context.$implicit.selected,null==t.context.$implicit?null:t.context.$implicit.htmlId)})}function _g(e){return qo(0,[(e()(),ki(0,0,null,null,3,"span",[],null,null,null,null,null)),(e()(),ki(1,0,null,null,1,"span",[["class","ng-tag-label"]],null,null,null,null,null)),(e()(),Vo(2,null,["",""])),(e()(),Vo(3,null,['"','"']))],null,function(e,t){var n=t.component;e(t,2,0,n.addTagText),e(t,3,0,n.filterValue)})}function xg(e){return qo(0,[(e()(),Ei(0,null,null,0))],null,null)}function Sg(e){return qo(0,[(e()(),ki(0,0,null,null,4,"div",[["class","ng-option"],["role","option"]],[[2,"ng-option-marked",null]],[[null,"mouseover"],[null,"click"]],function(e,t,n){var r=!0,i=e.component;return"mouseover"===t&&(r=!1!==i.itemsList.unmarkItem()&&r),"click"===t&&(r=!1!==i.selectTag()&&r),r},null,null)),(e()(),Ei(0,[["defaultTagTemplate",2]],null,0,null,_g)),(e()(),Ei(16777216,null,null,2,null,xg)),po(3,540672,null,0,Qs,[Pn],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null),Uo(4,{searchTerm:0})],function(e,t){var n=t.component,r=e(t,4,0,n.filterValue);e(t,3,0,r,n.tagTemplate||eo(t,1))},function(e,t){e(t,0,0,!t.component.itemsList.markedItem)})}function Eg(e){return qo(0,[(e()(),ki(0,0,null,null,1,"div",[["class","ng-option ng-option-disabled"]],null,null,null,null,null)),(e()(),Vo(1,null,["",""]))],null,function(e,t){e(t,1,0,t.component.notFoundText)})}function kg(e){return qo(0,[(e()(),Ei(0,null,null,0))],null,null)}function Cg(e){return qo(0,[(e()(),ki(0,0,null,null,4,null,null,null,null,null,null,null)),(e()(),Ei(0,[["defaultNotFoundTemplate",2]],null,0,null,Eg)),(e()(),Ei(16777216,null,null,2,null,kg)),po(3,540672,null,0,Qs,[Pn],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null),Uo(4,{searchTerm:0}),(e()(),Ei(0,null,null,0))],function(e,t){var n=t.component,r=e(t,4,0,n.filterValue);e(t,3,0,r,n.notFoundTemplate||eo(t,1))},null)}function Tg(e){return qo(0,[(e()(),ki(0,0,null,null,1,"div",[["class","ng-option ng-option-disabled"]],null,null,null,null,null)),(e()(),Vo(1,null,["",""]))],null,function(e,t){e(t,1,0,t.component.typeToSearchText)})}function Og(e){return qo(0,[(e()(),Ei(0,null,null,0))],null,null)}function Ig(e){return qo(0,[(e()(),ki(0,0,null,null,3,null,null,null,null,null,null,null)),(e()(),Ei(0,[["defaultTypeToSearchTemplate",2]],null,0,null,Tg)),(e()(),Ei(16777216,null,null,1,null,Og)),po(3,540672,null,0,Qs,[Pn],{ngTemplateOutlet:[0,"ngTemplateOutlet"]},null),(e()(),Ei(0,null,null,0))],function(e,t){e(t,3,0,t.component.typeToSearchTemplate||eo(t,1))},null)}function Pg(e){return qo(0,[(e()(),ki(0,0,null,null,1,"div",[["class","ng-option ng-option-disabled"]],null,null,null,null,null)),(e()(),Vo(1,null,["",""]))],null,function(e,t){e(t,1,0,t.component.loadingText)})}function Ag(e){return qo(0,[(e()(),Ei(0,null,null,0))],null,null)}function Ng(e){return qo(0,[(e()(),ki(0,0,null,null,4,null,null,null,null,null,null,null)),(e()(),Ei(0,[["defaultLoadingTextTemplate",2]],null,0,null,Pg)),(e()(),Ei(16777216,null,null,2,null,Ag)),po(3,540672,null,0,Qs,[Pn],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null),Uo(4,{searchTerm:0}),(e()(),Ei(0,null,null,0))],function(e,t){var n=t.component,r=e(t,4,0,n.filterValue);e(t,3,0,r,n.loadingTextTemplate||eo(t,1))},null)}function Rg(e){return qo(0,[(e()(),ki(0,0,null,null,13,"ng-dropdown-panel",[["class","ng-dropdown-panel"]],[[2,"ng-select-multiple",null],[8,"id",0]],[[null,"update"],[null,"scroll"],[null,"scrollToEnd"],[null,"outsideClick"],[null,"mousedown"]],function(e,t,n){var r=!0,i=e.component;return"mousedown"===t&&(r=!1!==eo(e,2).handleMousedown(n)&&r),"update"===t&&(r=!1!==(i.viewPortItems=n)&&r),"scroll"===t&&(r=!1!==i.scroll.emit(n)&&r),"scrollToEnd"===t&&(r=!1!==i.scrollToEnd.emit(n)&&r),"outsideClick"===t&&(r=!1!==i.close()&&r),r},Ug,Dg)),po(1,278528,null,0,qs,[Xn,er,xn,_n],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),po(2,1818624,[[1,4]],0,eg,[_n,Kt,Xd,Zd,xn,[2,iu]],{items:[0,"items"],markedItem:[1,"markedItem"],position:[2,"position"],appendTo:[3,"appendTo"],bufferAmount:[4,"bufferAmount"],virtualScroll:[5,"virtualScroll"],headerTemplate:[6,"headerTemplate"],footerTemplate:[7,"footerTemplate"],filterValue:[8,"filterValue"]},{update:"update",scroll:"scroll",scrollToEnd:"scrollToEnd",outsideClick:"outsideClick"}),(e()(),ki(3,0,null,0,4,null,null,null,null,null,null,null)),(e()(),Ei(16777216,null,null,1,null,wg)),po(5,278528,null,0,Ws,[Pn,In,Xn],{ngForOf:[0,"ngForOf"]},null),(e()(),Ei(16777216,null,null,1,null,Sg)),po(7,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,0,1,null,Cg)),po(9,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,0,1,null,Ig)),po(11,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,0,1,null,Ng)),po(13,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,1,0,"ng-dropdown-panel",n.appendTo?n.classes:null),e(t,2,0,n.itemsList.filteredItems,n.itemsList.markedItem,n.dropdownPosition,n.appendTo,n.bufferAmount,n.virtualScroll,n.headerTemplate,n.footerTemplate,n.filterValue),e(t,5,0,n.viewPortItems),e(t,7,0,n.showAddTag),e(t,9,0,n.showNoItemsFound()),e(t,11,0,n.showTypeToSearch()),e(t,13,0,n.loading&&0===n.itemsList.filteredItems.length)},function(e,t){var n=t.component;e(t,0,0,n.multiple,n.dropdownId)})}function jg(e){return qo(2,[Ao(671088640,1,{dropdownPanel:0}),Ao(402653184,2,{filterInput:0}),(e()(),ki(2,0,null,null,15,"div",[["class","ng-select-container"]],[[2,"ng-has-value",null]],[[null,"mousedown"]],function(e,t,n){var r=!0;return"mousedown"===t&&(r=!1!==e.component.handleMousedown(n)&&r),r},null,null)),(e()(),ki(3,0,null,null,8,"div",[["class","ng-value-container"]],null,null,null,null,null)),(e()(),ki(4,0,null,null,1,"div",[["class","ng-placeholder"]],null,null,null,null,null)),(e()(),Vo(5,null,["",""])),(e()(),Ei(16777216,null,null,1,null,fg)),po(7,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,null,1,null,pg)),po(9,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),ki(10,0,null,null,1,"div",[["class","ng-input"]],null,null,null,null,null)),(e()(),ki(11,0,[[2,0],["filterInput",1]],null,0,"input",[["role","combobox"],["type","text"]],[[1,"autocomplete",0],[1,"id",0],[1,"tabindex",0],[1,"autocorrect",0],[1,"autocapitalize",0],[8,"readOnly",0],[8,"disabled",0],[8,"value",0],[1,"aria-expanded",0],[1,"aria-owns",0],[1,"aria-activedescendant",0]],[[null,"input"],[null,"focus"],[null,"blur"],[null,"change"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==i.filter(eo(e,11).value)&&r),"focus"===t&&(r=!1!==i.onInputFocus(n)&&r),"blur"===t&&(r=!1!==i.onInputBlur(n)&&r),"change"===t&&(r=!1!==n.stopPropagation()&&r),r},null,null)),(e()(),Ei(16777216,null,null,1,null,mg)),po(13,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,null,1,null,yg)),po(15,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),ki(16,0,null,null,1,"span",[["class","ng-arrow-wrapper"]],null,null,null,null,null)),(e()(),ki(17,0,null,null,0,"span",[["class","ng-arrow"]],null,null,null,null,null)),(e()(),Ei(16777216,null,null,1,null,Rg)),po(19,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,7,0,!n.multiLabelTemplate&&n.selectedItems.length>0),e(t,9,0,n.multiLabelTemplate&&n.selectedValues.length>0),e(t,13,0,n.loading),e(t,15,0,n.showClear()),e(t,19,0,n.isOpen)},function(e,t){var n=t.component;e(t,2,0,n.hasValue),e(t,5,0,n.placeholder),e(t,11,1,[n.labelForId?"off":n.dropdownId,n.labelForId,n.tabIndex,n.autoCorrect,n.autoCapitalize,!n.searchable,n.disabled,n.filterValue?n.filterValue:"",n.isOpen,n.isOpen?n.dropdownId:null,n.isOpen?null==n.itemsList?null:null==n.itemsList.markedItem?null:n.itemsList.markedItem.htmlId:null])})}var Dg=Yr({encapsulation:2,styles:[],data:{}});function Mg(e){return qo(0,[(e()(),ki(0,0,null,null,3,"div",[["class","ng-dropdown-header"]],null,null,null,null,null)),(e()(),ki(1,16777216,null,null,2,null,null,null,null,null,null,null)),po(2,540672,null,0,Qs,[Pn],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null),Uo(3,{searchTerm:0})],function(e,t){var n=t.component,r=e(t,3,0,n.filterValue);e(t,2,0,r,n.headerTemplate)},null)}function Lg(e){return qo(0,[(e()(),ki(0,0,null,null,3,"div",[["class","ng-dropdown-footer"]],null,null,null,null,null)),(e()(),ki(1,16777216,null,null,2,null,null,null,null,null,null,null)),po(2,540672,null,0,Qs,[Pn],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null),Uo(3,{searchTerm:0})],function(e,t){var n=t.component,r=e(t,3,0,n.filterValue);e(t,2,0,r,n.footerTemplate)},null)}function Ug(e){return qo(2,[Ao(402653184,1,{contentElementRef:0}),Ao(402653184,2,{scrollElementRef:0}),Ao(402653184,3,{paddingElementRef:0}),(e()(),Ei(16777216,null,null,1,null,Mg)),po(4,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),ki(5,0,[[2,0],["scroll",1]],null,3,"div",[["class","ng-dropdown-panel-items scroll-host"]],null,null,null,null,null)),(e()(),ki(6,0,[[3,0],["padding",1]],null,0,"div",[],[[2,"total-padding",null]],null,null,null,null)),(e()(),ki(7,0,[[1,0],["content",1]],null,1,"div",[],[[2,"scrollable-content",null]],null,null,null,null)),(null,0,{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:-1,flags:8,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:{},matchedQueryIds:0,references:{},ngContentIndex:null,childCount:0,bindings:[],bindingFlags:0,outputs:[],element:null,provider:null,text:null,query:null,ngContent:{index:0}}),(e()(),Ei(16777216,null,null,1,null,Lg)),po(10,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,4,0,n.headerTemplate),e(t,10,0,n.footerTemplate)},function(e,t){var n=t.component;e(t,6,0,n.virtualScroll),e(t,7,0,n.virtualScroll&&n.items.length>0)})}var Fg=Yr({encapsulation:0,styles:[[".login-page[_ngcontent-%COMP%]{text-align:center;font-family:Roboto,sans-serif;color:#666}.login-page[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:38px;text-transform:uppercase;font-weight:700;line-height:50px;letter-spacing:1.9px;padding-top:12px;margin-top:0}.login-page[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{color:#666;font-size:16px;font-weight:500;letter-spacing:1px;line-height:21px;margin-top:48px}.login-page[_ngcontent-%COMP%] .small-link[_ngcontent-%COMP%]{font-size:12px;color:#666;letter-spacing:.75px;line-height:16px}.login-page[_ngcontent-%COMP%] .registration-link[_ngcontent-%COMP%]{margin-top:38px}.login-page[_ngcontent-%COMP%] .registration-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:16px;color:#666;letter-spacing:1px}.login-page[_ngcontent-%COMP%] .item-divider[_ngcontent-%COMP%]{box-sizing:border-box;height:1px;width:354px;border-bottom:1px solid #e0e0e0;position:absolute;bottom:-8px;left:-9px}"]],data:{}});function Vg(e){return qo(0,[(e()(),ki(0,0,null,null,5,"div",[["style","height:40px; padding-top:10px; position: relative;"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,0,"img",[["style","float: left; height: 32px; width: 32px; margin-top:-5px;"]],[[8,"src",4]],null,null,null,null)),(e()(),ki(2,0,null,null,1,"span",[["style","float: left; margin-left: 10px;"]],null,null,null,null,null)),(e()(),Vo(3,null,["",""])),(e()(),ki(4,0,null,null,0,"div",[["style","clear: both;"]],null,null,null,null,null)),(e()(),ki(5,0,null,null,0,"div",[["class","item-divider"]],null,null,null,null,null))],null,function(e,t){e(t,1,0,t.context.item.image),e(t,3,0,t.context.item.name)})}function Bg(e){return qo(0,[(e()(),ki(0,0,null,null,5,"input",[["class","wide-text"],["placeholder","Enter WebID"],["style","margin-top:10px; padding: 12px 10px; width: 340px; height: 16px; display: block; margin-left: auto; margin-right: auto;"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,1)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,1).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,1)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,1)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.customProviderUrl=n)&&r),r},null,null)),po(1,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(3,671744,null,0,Od,[[8,null],[8,null],[8,null],[6,$p]],{model:[0,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(5,16384,null,0,dd,[[4,ed]],null,null)],function(e,t){e(t,3,0,t.component.customProviderUrl)},function(e,t){e(t,0,0,eo(t,5).ngClassUntouched,eo(t,5).ngClassTouched,eo(t,5).ngClassPristine,eo(t,5).ngClassDirty,eo(t,5).ngClassValid,eo(t,5).ngClassInvalid,eo(t,5).ngClassPending)})}function zg(e){return qo(0,[(e()(),ki(0,0,null,null,1,"button",[["class","wide-button"],["id","btn-go"],["style","margin-top:10px;"]],[[8,"disabled",0]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.onLogin()&&r),r},null,null)),(e()(),Vo(-1,null,["Go"]))],null,function(e,t){var n=t.component;e(t,0,0,null===n.selectedProviderUrl&&!n.customProviderUrl)})}function qg(e){return qo(0,[(e()(),ki(0,0,null,null,40,"div",[["class","login-page"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,1,"div",[["style","margin-top:60px;"]],null,null,null,null,null)),(e()(),ki(2,0,null,null,0,"i",[["class","fas fa-user-circle"],["style","font-size: 64px;"]],null,null,null,null,null)),(e()(),ki(3,0,null,null,1,"h1",[],null,null,null,null,null)),(e()(),Vo(-1,null,[" DE-CHAT "])),(e()(),ki(5,0,null,null,1,"h2",[],null,null,null,null,null)),(e()(),Vo(-1,null,[" Login with Solid Identity "])),(e()(),ki(7,0,null,null,24,"div",[["style","margin-top: 10px;"]],null,null,null,null,null)),(e()(),ki(8,0,null,null,19,"ng-select",[["bindLabel","name"],["bindValue","loginUrl"],["class","login-select ng-select"],["dropdownPosition","bottom"],["placeholder","Select ID Provider"],["role","listbox"],["style","width: 360px; height: 48px; margin-left: auto; margin-right: auto;"]],[[2,"ng-select-single",null],[2,"ng-select-typeahead",null],[2,"ng-select-multiple",null],[2,"ng-select-taggable",null],[2,"ng-select-searchable",null],[2,"ng-select-opened",null],[2,"ng-select-disabled",null],[2,"ng-select-filtered",null],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"keydown"]],function(e,t,n){var r=!0,i=e.component;return"keydown"===t&&(r=!1!==eo(e,9).handleKeyDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedProviderUrl=n)&&r),r},jg,sg)),po(9,4964352,null,12,rg,[[8,"login-select"],[8,null],[8,null],tg,ng,xn,An,qd],{bindLabel:[0,"bindLabel"],bindValue:[1,"bindValue"],placeholder:[2,"placeholder"],dropdownPosition:[3,"dropdownPosition"],items:[4,"items"]},null),Ao(335544320,1,{optionTemplate:0}),Ao(335544320,2,{optgroupTemplate:0}),Ao(335544320,3,{labelTemplate:0}),Ao(335544320,4,{multiLabelTemplate:0}),Ao(335544320,5,{headerTemplate:0}),Ao(335544320,6,{footerTemplate:0}),Ao(335544320,7,{notFoundTemplate:0}),Ao(335544320,8,{typeToSearchTemplate:0}),Ao(335544320,9,{loadingTextTemplate:0}),Ao(335544320,10,{tagTemplate:0}),Ao(335544320,11,{loadingSpinnerTemplate:0}),Ao(603979776,12,{ngOptions:1}),mo(1024,null,$p,function(e){return[e]},[rg]),po(23,671744,null,0,Od,[[8,null],[8,null],[8,null],[6,$p]],{model:[0,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(25,16384,null,0,dd,[[4,ed]],null,null),(e()(),Ei(0,[[1,2]],null,1,null,Vg)),po(27,16384,null,0,zd,[In],null,null),(e()(),Ei(16777216,null,null,1,null,Bg)),po(29,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,null,1,null,zg)),po(31,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),ki(32,0,null,null,4,"div",[["class","registration-link"]],null,null,null,null,null)),(e()(),ki(33,0,null,null,1,"p",[["style","margin: 12px;"]],null,null,null,null,null)),(e()(),Vo(-1,null,["Don't have a Solid Identity?"])),(e()(),ki(35,0,null,null,1,"button",[["class","wide-button"],["id","btn-register"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.goToRegistration()&&r),r},null,null)),(e()(),Vo(-1,null,["Register"])),(e()(),ki(37,0,null,null,3,"div",[["style","margin-top: 48px;"]],null,null,null,null,null)),(e()(),ki(38,0,null,null,2,"a",[["class","small-link"],["href","https://solid.mit.edu"],["target","_blank"]],null,null,null,null,null)),(e()(),ki(39,0,null,null,0,"i",[["class","fas fa-info-circle"]],null,null,null,null,null)),(e()(),Vo(-1,null,[" What is a Solid Identity? "]))],function(e,t){var n=t.component;e(t,9,0,"name","loginUrl","Select ID Provider","bottom",n.identityProviders),e(t,23,0,n.selectedProviderUrl),e(t,29,0,null===n.selectedProviderUrl),e(t,31,0,void 0!==n.selectedProviderUrl||void 0!==n.customProviderUrl)},function(e,t){e(t,8,1,[!eo(t,9).multiple,eo(t,9).typeahead,eo(t,9).multiple,eo(t,9).addTag,eo(t,9).searchable,eo(t,9).isOpen,eo(t,9).disabled,eo(t,9).filtered,eo(t,25).ngClassUntouched,eo(t,25).ngClassTouched,eo(t,25).ngClassPristine,eo(t,25).ngClassDirty,eo(t,25).ngClassValid,eo(t,25).ngClassInvalid,eo(t,25).ngClassPending])})}function Hg(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-login",[],null,null,null,qg,Fg)),po(1,114688,null,0,sp,[ip,Th],null,null)],function(e,t){e(t,1,0)},null)}var Wg=qi("app-login",sp,Hg,{},{},[]),$g=Yr({encapsulation:0,styles:[[""]],data:{}});function Gg(e){return qo(0,[(e()(),ki(0,0,null,null,1,"div",[["id","app-container"]],null,null,null,null,null)),(e()(),Vo(-1,null,["Loading..."]))],null,null)}function Jg(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-login-popup",[],null,null,null,Gg,$g)),po(1,114688,null,0,Za,[xn],null,null)],function(e,t){e(t,1,0)},null)}var Kg=qi("app-login-popup",Za,Jg,{},{},[]),Qg=Yr({encapsulation:0,styles:[[".profile-container[_ngcontent-%COMP%]{font-family:Roboto,sans-serif;height:calc(100vh - 50px)}.profile-container[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:24px;color:#7c55fb;font-weight:700;line-height:32px;letter-spacing:1.2px;text-align:center;padding-top:70px;text-transform:uppercase}.profile-fields-container[_ngcontent-%COMP%]{max-width:740px;min-height:500px;margin:0 auto;border:1px solid #ccc;box-shadow:rgba(0,0,0,.226) 1px 1px 4px;position:relative}.profile-fields-container[_ngcontent-%COMP%] .profile-image-container[_ngcontent-%COMP%]{height:200px;width:100%;background:url(/assets/images/Solid_Pattern.png)}.profile-fields-container[_ngcontent-%COMP%] .profile-image-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:128px;border-radius:50%;margin-left:auto;margin-right:auto;position:relative;top:40px;display:block}.profile-fields-container[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:14px;color:#89969f;padding-left:26px;padding-right:10px;margin-top:24px}.profile-fields-container[_ngcontent-%COMP%] input[type=text].field-text[_ngcontent-%COMP%]{height:12px;width:280px;border:1px solid #89969f;border-radius:4px;padding:10px}.profile-fields-container[_ngcontent-%COMP%] input[type=text].field-text[_ngcontent-%COMP%]::-webkit-input-placeholder{color:rgba(102,102,102,.2)}.profile-fields-container[_ngcontent-%COMP%] input[type=text].field-text[_ngcontent-%COMP%]:-ms-input-placeholder{color:rgba(102,102,102,.2)}.profile-fields-container[_ngcontent-%COMP%] input[type=text].field-text[_ngcontent-%COMP%]::-ms-input-placeholder{color:rgba(102,102,102,.2)}.profile-fields-container[_ngcontent-%COMP%] input[type=text].field-text[_ngcontent-%COMP%]::placeholder{color:rgba(102,102,102,.2)}.profile-save-button-container[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:auto;height:100px;flex-direction:column;justify-content:flex-end}.profile-save-button[_ngcontent-%COMP%]{background-color:#7c55fb;margin-left:auto;margin-right:auto;width:280px}.profile-save-button[_ngcontent-%COMP%]:disabled{background-color:#f0eeeb;border-color:#f0eeeb;cursor:not-allowed}.loading-image[_ngcontent-%COMP%]{text-align:center;margin-top:50px}"]],data:{}});function Yg(e){return qo(0,[(e()(),ki(0,0,null,null,1,"div",[["class","loading-image"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,0,"i",[["class","fas fa-circle-notch fa-4x fa-spin"]],null,null,null,null,null))],null,null)}function Zg(e){return qo(0,[(e()(),ki(0,0,null,null,61,"div",[["class","profile-fields-container"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,1,"div",[["class","profile-image-container"]],null,null,null,null,null)),(e()(),ki(2,0,null,null,0,"img",[],[[8,"src",4]],null,null,null,null)),(e()(),ki(3,0,null,null,58,"form",[["novalidate",""],["style","padding-top: 26px;"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"submit"],[null,"reset"]],function(e,t,n){var r=!0,i=e.component;return"submit"===t&&(r=!1!==eo(e,5).onSubmit(n)&&r),"reset"===t&&(r=!1!==eo(e,5).onReset()&&r),"submit"===t&&(r=!1!==i.onSubmit()&&r),r},null,null)),po(4,16384,null,0,Id,[],null,null),po(5,4210688,[[1,4],["f",4]],0,Ed,[[8,null],[8,null]],null,null),mo(2048,null,Fp,null,[Ed]),po(7,16384,null,0,gd,[[4,Fp]],null,null),(e()(),ki(8,0,null,null,16,"div",[["class","fields pure-g"]],null,null,null,null,null)),(e()(),ki(9,0,null,null,7,"div",[["class","pure-u-1-1 pure-u-md-1-2 form-group"]],null,null,null,null,null)),(e()(),ki(10,0,null,null,0,"i",[["class","fas fa-user"]],null,null,null,null,null)),(e()(),ki(11,0,null,null,5,"input",[["class","field-text form-control"],["name","fn"],["placeholder","NAME"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,12)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,12).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,12)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,12)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.profile.fn=n)&&r),r},null,null)),po(12,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(14,671744,null,0,Od,[[2,Fp],[8,null],[8,null],[6,$p]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(16,16384,null,0,dd,[[4,ed]],null,null),(e()(),ki(17,0,null,null,7,"div",[["class","pure-u-1-1 pure-u-md-1-2 form-group"]],null,null,null,null,null)),(e()(),ki(18,0,null,null,0,"i",[["class","fas fa-phone"]],null,null,null,null,null)),(e()(),ki(19,0,null,null,5,"input",[["class","field-text form-control"],["name","phone"],["placeholder","PHONE"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,20)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,20).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,20)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,20)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.profile.phone=n)&&r),r},null,null)),po(20,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(22,671744,null,0,Od,[[2,Fp],[8,null],[8,null],[6,$p]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(24,16384,null,0,dd,[[4,ed]],null,null),(e()(),ki(25,0,null,null,16,"div",[["class","fields pure-g"]],null,null,null,null,null)),(e()(),ki(26,0,null,null,7,"div",[["class","pure-u-1-1 pure-u-md-1-2 form-group"]],null,null,null,null,null)),(e()(),ki(27,0,null,null,0,"i",[["class","fas fa-user-astronaut"]],null,null,null,null,null)),(e()(),ki(28,0,null,null,5,"input",[["class","field-text form-control"],["name","role"],["placeholder","ROLE"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,29)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,29).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,29)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,29)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.profile.role=n)&&r),r},null,null)),po(29,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(31,671744,null,0,Od,[[2,Fp],[8,null],[8,null],[6,$p]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(33,16384,null,0,dd,[[4,ed]],null,null),(e()(),ki(34,0,null,null,7,"div",[["class","pure-u-1-1 pure-u-md-1-2 form-group"]],null,null,null,null,null)),(e()(),ki(35,0,null,null,0,"i",[["class","fas fa-envelope"]],null,null,null,null,null)),(e()(),ki(36,0,null,null,5,"input",[["class","field-text form-control"],["name","email"],["placeholder","EMAIL"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,37)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,37).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,37)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,37)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.profile.email=n)&&r),r},null,null)),po(37,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(39,671744,null,0,Od,[[2,Fp],[8,null],[8,null],[6,$p]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(41,16384,null,0,dd,[[4,ed]],null,null),(e()(),ki(42,0,null,null,16,"div",[["class","fields pure-g"]],null,null,null,null,null)),(e()(),ki(43,0,null,null,7,"div",[["class","pure-u-1-1 pure-u-md-1-2 form-group"]],null,null,null,null,null)),(e()(),ki(44,0,null,null,0,"i",[["class","fas fa-building"]],null,null,null,null,null)),(e()(),ki(45,0,null,null,5,"input",[["class","field-text form-control"],["name","company"],["placeholder","ORGANIZATION"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,46)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,46).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,46)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,46)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.profile.company=n)&&r),r},null,null)),po(46,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(48,671744,null,0,Od,[[2,Fp],[8,null],[8,null],[6,$p]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(50,16384,null,0,dd,[[4,ed]],null,null),(e()(),ki(51,0,null,null,7,"div",[["class","pure-u-1-1 pure-u-md-1-2 form-group"]],null,null,null,null,null)),(e()(),ki(52,0,null,null,0,"i",[["class","fas fa-map-marker-alt"],["style","width: 12px; margin-left: 2px;"]],null,null,null,null,null)),(e()(),ki(53,0,null,null,5,"input",[["class","field-text form-control"],["name","address"],["placeholder","ADDRESS"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,54)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,54).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,54)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,54)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.profile.address.street=n)&&r),r},null,null)),po(54,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(56,671744,null,0,Od,[[2,Fp],[8,null],[8,null],[6,$p]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(58,16384,null,0,dd,[[4,ed]],null,null),(e()(),ki(59,0,null,null,2,"div",[["class","profile-save-button-container"]],null,null,null,null,null)),(e()(),ki(60,0,null,null,1,"button",[["class","wide-button profile-save-button"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(e()(),Vo(-1,null,["Save"]))],function(e,t){var n=t.component;e(t,14,0,"fn",n.profile.fn),e(t,22,0,"phone",n.profile.phone),e(t,31,0,"role",n.profile.role),e(t,39,0,"email",n.profile.email),e(t,48,0,"company",n.profile.company),e(t,56,0,"address",n.profile.address.street)},function(e,t){var n=t.component;e(t,2,0,n.profileImage),e(t,3,0,eo(t,7).ngClassUntouched,eo(t,7).ngClassTouched,eo(t,7).ngClassPristine,eo(t,7).ngClassDirty,eo(t,7).ngClassValid,eo(t,7).ngClassInvalid,eo(t,7).ngClassPending),e(t,11,0,eo(t,16).ngClassUntouched,eo(t,16).ngClassTouched,eo(t,16).ngClassPristine,eo(t,16).ngClassDirty,eo(t,16).ngClassValid,eo(t,16).ngClassInvalid,eo(t,16).ngClassPending),e(t,19,0,eo(t,24).ngClassUntouched,eo(t,24).ngClassTouched,eo(t,24).ngClassPristine,eo(t,24).ngClassDirty,eo(t,24).ngClassValid,eo(t,24).ngClassInvalid,eo(t,24).ngClassPending),e(t,28,0,eo(t,33).ngClassUntouched,eo(t,33).ngClassTouched,eo(t,33).ngClassPristine,eo(t,33).ngClassDirty,eo(t,33).ngClassValid,eo(t,33).ngClassInvalid,eo(t,33).ngClassPending),e(t,36,0,eo(t,41).ngClassUntouched,eo(t,41).ngClassTouched,eo(t,41).ngClassPristine,eo(t,41).ngClassDirty,eo(t,41).ngClassValid,eo(t,41).ngClassInvalid,eo(t,41).ngClassPending),e(t,45,0,eo(t,50).ngClassUntouched,eo(t,50).ngClassTouched,eo(t,50).ngClassPristine,eo(t,50).ngClassDirty,eo(t,50).ngClassValid,eo(t,50).ngClassInvalid,eo(t,50).ngClassPending),e(t,53,0,eo(t,58).ngClassUntouched,eo(t,58).ngClassTouched,eo(t,58).ngClassPristine,eo(t,58).ngClassDirty,eo(t,58).ngClassValid,eo(t,58).ngClassInvalid,eo(t,58).ngClassPending),e(t,60,0,!n.cardForm||n.cardForm.pristine)})}function Xg(e){return qo(0,[Ao(671088640,1,{cardForm:0}),(e()(),ki(1,0,null,null,6,"div",[["class","profile-container"]],null,null,null,null,null)),(e()(),ki(2,0,null,null,1,"h1",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Profile"])),(e()(),Ei(16777216,null,null,1,null,Yg)),po(5,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,null,1,null,Zg)),po(7,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,5,0,n.loadingProfile),e(t,7,0,!n.loadingProfile)},null)}function em(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-card",[],null,null,null,Xg,Qg)),po(1,114688,null,0,cp,[Ll,Vf,ip],null,null)],function(e,t){e(t,1,0)},null)}var tm=qi("app-card",cp,em,{},{},[]),nm=function(){function e(e){this.chatService=e,this.user=new dp("","Test","")}return e.prototype.ngOnInit=function(){},e.prototype.changeChat=function(){this.chatService.changeChat(this.user)},e}(),rm=Yr({encapsulation:0,styles:[[".userItem[_ngcontent-%COMP%]{height:auto;padding:10px;align-items:flex-start;background-color:#201835;color:#a098a5;align-items:center;display:flex;transition:ease-in .2s}.userItem[_ngcontent-%COMP%]:hover{background-color:#453968;color:#ddd;transition:ease-in .1s}.profilePic[_ngcontent-%COMP%]{border-radius:100%;border-width:1em;width:2em;height:2em;margin-right:1em}.online[_ngcontent-%COMP%]{border-color:#0fa}.busy[_ngcontent-%COMP%]{border-color:#fb0}.offline[_ngcontent-%COMP%]{border-color:#888}.status[_ngcontent-%COMP%]{border:1px solid #000;display:inline-block;min-width:10px;min-height:10px;border-radius:50%;margin:10px 12px 0 10px}.userName[_ngcontent-%COMP%]{display:inline-block}"]],data:{}});function im(e){return qo(0,[(e()(),ki(0,0,null,null,3,"div",[["class","userItem"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.changeChat()&&r),r},null,null)),(e()(),ki(1,0,null,null,0,"img",[["class","profilePic"]],[[8,"src",4]],null,null,null,null)),(e()(),ki(2,0,null,null,1,"span",[["class","userName"]],null,null,null,null,null)),(e()(),Vo(3,null,[" "," "]))],null,function(e,t){var n=t.component;e(t,1,0,n.user.profilePicture),e(t,3,0,n.user.username)})}var om=function(){return function(e){var t=this;e.getUsers().subscribe(function(e){t.users=e})}}(),am=Yr({encapsulation:0,styles:[[""]],data:{}});function sm(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-user-item",[],null,null,null,im,rm)),po(1,114688,null,0,nm,[vp],{user:[0,"user"]},null)],function(e,t){e(t,1,0,t.context.$implicit)},null)}function um(e){return qo(0,[(e()(),ki(0,0,null,null,2,"div",[["class","userList"]],null,null,null,null,null)),(e()(),Ei(16777216,null,null,1,null,sm)),po(2,278528,null,0,Ws,[Pn,In,Xn],{ngForOf:[0,"ngForOf"]},null)],function(e,t){e(t,2,0,t.component.users)},null)}var lm=function(){function e(e,t){this.chatService=e,this.toastr=t,this.timeStamp=new Date}return e.prototype.ngOnInit=function(e){var t=this;void 0===e&&(e=this.chatMessage),e||(e=new pp("","Failed to load")),this.messageContent=e.message,this.timeStamp=e.timeSent,this.userName=e.userName,this.chatService.getUser().subscribe(function(e){e&&(t.isOwnMessage=0===e.username.toString().localeCompare(t.userName.toString()))})},e.prototype.removeMessage=function(){this.messageContent?!0===this.isOwnMessage&&(this.toastr.error("Are you sure?"),this.messageContent=""):this.toastr.error("Cannot remove this message")},e}(),cm=Yr({encapsulation:0,styles:[[".msg[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;height:auto;width:auto;max-width:70%;border-radius:5px;box-shadow:0 3px 6px rgba(0,0,0,.26),0 3px 6px rgba(0,0,0,.23)}.ownMsg[_ngcontent-%COMP%]{float:right;background-color:#01579b}.ownMsg[_ngcontent-%COMP%]:after{content:'';position:absolute;border-style:solid;border-width:12px 0 12px 15px;border-color:transparent #01579b;display:block;width:0;z-index:1;right:-15px;top:10px}.otherMsg[_ngcontent-%COMP%]{float:inline-start;background-color:#eee}.otherMsg[_ngcontent-%COMP%]:after{content:'';position:absolute;border-style:solid;border-width:12px 15px 12px 0;border-color:transparent #eee;display:block;width:0;z-index:1;left:-15px;top:10px}.messageData[_ngcontent-%COMP%]{padding:10px;font-size:.7em}.sender[_ngcontent-%COMP%]{display:block;color:#222;font-weight:700}.isOwnSender[_ngcontent-%COMP%]{color:#e1f5fe}.timestamp[_ngcontent-%COMP%]{color:#555;font-style:italic}.isOwnTimestamp[_ngcontent-%COMP%]{color:#4fc3f7}.messageContent[_ngcontent-%COMP%]{background-color:#fff;padding:10px;border-bottom-left-radius:5px;border-bottom-right-radius:5px;overflow-wrap:break-word}.isOwnMessageContent[_ngcontent-%COMP%]{background-color:#e3f2fd}"]],data:{}});function fm(e){return qo(0,[go(0,nu,[or]),(e()(),ki(1,0,null,null,18,"div",[["class","msg"]],null,null,null,null,null)),po(2,278528,null,0,qs,[Xn,er,xn,_n],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),Uo(3,{ownMsg:0,otherMsg:1}),(e()(),ki(4,0,null,null,11,"div",[["class","messageData"]],null,null,null,null,null)),po(5,278528,null,0,qs,[Xn,er,xn,_n],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),Uo(6,{isOwnMessageData:0}),(e()(),ki(7,0,null,null,3,"span",[["class","sender"]],null,null,null,null,null)),po(8,278528,null,0,qs,[Xn,er,xn,_n],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),Uo(9,{isOwnSender:0}),(e()(),Vo(10,null,[" "," "])),(e()(),ki(11,0,null,null,4,"span",[["class","timestamp"]],null,null,null,null,null)),po(12,278528,null,0,qs,[Xn,er,xn,_n],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),Uo(13,{isOwnTimestamp:0}),(e()(),Vo(14,null,[" "," "])),Fo(128,15,new Array(3)),(e()(),ki(16,0,null,null,3,"div",[["class","messageContent"]],null,null,null,null,null)),po(17,278528,null,0,qs,[Xn,er,xn,_n],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),Uo(18,{isOwnMessageContent:0}),(e()(),Vo(19,null,[" "," "]))],function(e,t){var n=t.component,r=e(t,3,0,n.isOwnMessage,!n.isOwnMessage);e(t,2,0,"msg",r);var i=e(t,6,0,n.isOwnMessage);e(t,5,0,"messageData",i);var o=e(t,9,0,n.isOwnMessage);e(t,8,0,"sender",o);var a=e(t,13,0,n.isOwnMessage);e(t,12,0,"timestamp",a);var s=e(t,18,0,n.isOwnMessage);e(t,17,0,"messageContent",s)},function(e,t){var n=t.component;e(t,10,0,n.userName);var r=Jr(t,14,0,e(t,15,0,eo(t,0),n.timeStamp,"medium"));e(t,14,0,r),e(t,19,0,n.messageContent)})}var hm=function(){function e(e){this.chat=e}return e.prototype.ngOnInit=function(){this.feed=this.chat.getMessages()},e.prototype.ngOnChanges=function(){this.feed=this.chat.getMessages()},e}(),pm=Yr({encapsulation:0,styles:[["[_nghost-%COMP%]{flex-grow:1}.feed[_ngcontent-%COMP%]{display:flex;flex-direction:column;overflow-x:hidden;overflow-y:auto}.message[_ngcontent-%COMP%]{flex-direction:column;margin:.6em 1em}.feed[_ngcontent-%COMP%]:first-child{margin-top:auto}"]],data:{}});function dm(e){return qo(0,[(e()(),ki(0,0,null,null,2,"div",[["class","message"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,1,"app-message",[],null,null,null,fm,cm)),po(2,114688,null,0,lm,[vp,Tl],{chatMessage:[0,"chatMessage"]},null)],function(e,t){e(t,2,0,t.context.$implicit)},null)}function gm(e){return qo(0,[(e()(),ki(0,0,null,null,3,"div",[["class","feed"]],null,null,null,null,null)),(e()(),Ei(16777216,null,null,2,null,dm)),po(2,278528,null,0,Ws,[Pn,In,Xn],{ngForOf:[0,"ngForOf"]},null),go(131072,tu,[An])],function(e,t){var n=t.component;e(t,2,0,Jr(t,2,0,eo(t,3).transform(n.feed)))},null)}var mm=function(){function e(e){this.chat=e,this.message="",this.active=!0}return e.prototype.ngOnInit=function(){var e=this;this.chat.isChatActive().subscribe(function(t){e.active=t})},e.prototype.send=function(){this.chat.sendMessage(this.message),this.message=""},e.prototype.handleSubmit=function(e){13===e.keyCode&&this.send()},e}(),ym=Yr({encapsulation:0,styles:[[".chatFormWrapper[_ngcontent-%COMP%]{display:flex;background-color:#7c4dff}.chatInput[_ngcontent-%COMP%]{border-radius:5px;margin:5px;padding:5px;font-size:1.3em;font-family:'Open Sans',sans-serif;background-color:#eee;color:#000;transition:.1s ease-out;flex-grow:1}.chatInput[_ngcontent-%COMP%]:focus{background-color:#e4f1fe;color:#222;transition:.2s ease-in}.chatButton[_ngcontent-%COMP%]{width:150px;border-radius:5px;margin:0;padding:8px 24px;font-size:1.3em;font-family:'Droid Sans',sans-serif;background-color:#2a2845;color:#fff;transition:.2s ease-out;min-width:50px}.chatButton[_ngcontent-%COMP%]:hover{background-color:#444}"]],data:{}});function vm(e){return qo(0,[(e()(),ki(0,0,null,null,8,"div",[["class","chatFormWrapper"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,5,"input",[["class","chatInput"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"keydown"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,2)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,2).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,2)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,2)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.message=n)&&r),"keydown"===t&&(r=!1!==i.handleSubmit(n)&&r),r},null,null)),po(2,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(4,671744,null,0,Od,[[8,null],[8,null],[8,null],[6,$p]],{isDisabled:[0,"isDisabled"],model:[1,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(6,16384,null,0,dd,[[4,ed]],null,null),(e()(),ki(7,0,null,null,1,"button",[["class","chatButton"]],[[8,"disabled",0]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.send()&&r),r},null,null)),(e()(),Vo(-1,null,["Send"]))],function(e,t){var n=t.component;e(t,4,0,!n.active,n.message)},function(e,t){var n=t.component;e(t,1,0,eo(t,6).ngClassUntouched,eo(t,6).ngClassTouched,eo(t,6).ngClassPristine,eo(t,6).ngClassDirty,eo(t,6).ngClassValid,eo(t,6).ngClassInvalid,eo(t,6).ngClassPending),e(t,7,0,!n.active)})}var bm=Yr({encapsulation:0,styles:[['.mainContent[_ngcontent-%COMP%]{display:flex;height:calc(100vh - 50px);background-color:#7c4dff}.chat[_ngcontent-%COMP%]{display:flex;flex:5;order:2;flex-direction:column;transition:.3s}.blurred[_ngcontent-%COMP%]{color:rgba(0,0,0,.25);-webkit-filter:blur(4px) brightness(50%);filter:blur(4px) brightness(50%);transition:.3s}.userListWrapper[_ngcontent-%COMP%]{background-color:#2a2845;color:#fff;display:flex;font-family:"Open Sans",sans-serif;font-size:1.2em;flex:1;order:1;border-right:1px solid #222;overflow-x:hidden;overflow-y:auto}.feedWrapper[_ngcontent-%COMP%]{background:linear-gradient(181deg,rgba(100,200,255,.6),rgba(0,0,0,.9)),url(Solid_Pattern.9051b19429853f670436.png) center center no-repeat;font-family:"Open Sans",sans-serif;font-size:1.2em;display:flex;overflow-x:hidden;overflow-y:auto;flex-grow:1}.chatFormWrapper[_ngcontent-%COMP%]{height:50px;background-color:#7c4dff;padding:.1em}#scroll-style[_ngcontent-%COMP%]::-webkit-scrollbar-track{border-radius:10px;background-color:#f5f5f5}app-user-list[_ngcontent-%COMP%]{width:100%}']],data:{}});function wm(e){return qo(0,[Ao(402653184,1,{feedContainer:0}),(e()(),ki(1,0,null,null,12,"div",[["class","mainContent"]],null,null,null,null,null)),(e()(),ki(2,0,null,null,2,"div",[["class","userListWrapper"]],null,null,null,null,null)),(e()(),ki(3,0,null,null,1,"app-user-list",[],null,null,null,um,am)),po(4,49152,null,0,om,[vp],null,null),(e()(),ki(5,0,null,null,8,"div",[["class","chat"]],null,null,null,null,null)),po(6,278528,null,0,qs,[Xn,er,xn,_n],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),Uo(7,{blurred:0}),(e()(),ki(8,0,[[1,0],["scroller",1]],null,2,"div",[["class","feedWrapper"]],null,null,null,null,null)),(e()(),ki(9,0,null,null,1,"app-feed",[],null,null,null,gm,pm)),po(10,638976,null,0,hm,[vp],null,null),(e()(),ki(11,0,null,null,2,"div",[["class","chatFormWrapper"]],null,null,null,null,null)),(e()(),ki(12,0,null,null,1,"app-chat-form",[],null,null,null,vm,ym)),po(13,114688,null,0,mm,[vp],null,null)],function(e,t){var n=e(t,7,0,!t.component.active);e(t,6,0,"chat",n),e(t,10,0),e(t,13,0)},null)}function _m(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-chatroom",[],null,null,null,wm,bm)),po(1,8503296,null,0,bp,[vp],null,null)],function(e,t){e(t,1,0)},null)}var xm=qi("app-chatroom",bp,_m,{},{},[]),Sm=function(){function e(e,t){this.chatService=e,this.toastr=t,this.user=new dp("","Test","")}return e.prototype.ngOnInit=function(){},e.prototype.deleteUser=function(){this.removeFriend(this.user.webId)},e.prototype.removeFriend=function(e){""===e.trim()?this.toastr.error("Please add a webId","Wrong input"):this.chatService.removeFriend(e)},e}(),Em=Yr({encapsulation:0,styles:[[".userItem[_ngcontent-%COMP%]{height:auto;width:130%;padding:10px;align-items:flex-start;background-color:#201835;color:#a098a5;align-items:center;display:flex;transition:ease-in .2s}.userItem[_ngcontent-%COMP%]:hover{background-color:#453968;color:#ddd;transition:ease-in .1s}.profilePic[_ngcontent-%COMP%]{border-radius:100%;border-width:1em;width:2em;height:2em;margin-right:1em}.online[_ngcontent-%COMP%]{border-color:#0fa}.busy[_ngcontent-%COMP%]{border-color:#fb0}.offline[_ngcontent-%COMP%]{border-color:#888}.status[_ngcontent-%COMP%]{border:1px solid #000;display:inline-block;min-width:10px;min-height:10px;border-radius:50%;margin:10px 12px 0 10px}.userName[_ngcontent-%COMP%]{display:inline-block}button[_ngcontent-%COMP%]{position:relative;left:15px;width:30px;height:30px;border-radius:5px;margin:0;padding:.3em .4em;font-size:.7em;font-family:'Droid Sans',sans-serif;background-color:#2a2845;color:#fff;transition:.2s ease-out;min-width:50px}"]],data:{}});function km(e){return qo(0,[(e()(),ki(0,0,null,null,5,"div",[["class","userItem"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,0,"img",[["class","profilePic"]],[[8,"src",4]],null,null,null,null)),(e()(),ki(2,0,null,null,1,"span",[["class","userName"]],null,null,null,null,null)),(e()(),Vo(3,null,[" "," "])),(e()(),ki(4,0,null,null,1,"button",[],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.deleteUser()&&r),r},null,null)),(e()(),Vo(-1,null,["Delete"]))],null,function(e,t){var n=t.component;e(t,1,0,n.user.profilePicture),e(t,3,0,n.user.username)})}var Cm=function(){return function(e){var t=this;e.getUsers().subscribe(function(e){t.users=e})}}(),Tm=Yr({encapsulation:0,styles:[[".button[_ngcontent-%COMP%]{width:50px;border-radius:5px;margin:0;padding:.3em .4em;font-size:1.3em;font-family:'Droid Sans',sans-serif;background-color:#2a2845;color:#fff;transition:.2s ease-out;min-width:50px}"]],data:{}});function Om(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-user-settings-item",[],null,null,null,km,Em)),po(1,114688,null,0,Sm,[vp,Tl],{user:[0,"user"]},null)],function(e,t){e(t,1,0,t.context.$implicit)},null)}function Im(e){return qo(0,[(e()(),ki(0,0,null,null,2,"div",[["class","userSettingsList"]],null,null,null,null,null)),(e()(),Ei(16777216,null,null,1,null,Om)),po(2,278528,null,0,Ws,[Pn,In,Xn],{ngForOf:[0,"ngForOf"]},null)],function(e,t){e(t,2,0,t.component.users)},null)}var Pm=Yr({encapsulation:0,styles:[[".settingsFormWrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;font-family:\"Open Sans\",sans-serif;width:100%;height:calc(100vh - 50px);background:linear-gradient(181deg,rgba(100,200,255,.6),rgba(0,0,0,.9)),url(Solid_Pattern.9051b19429853f670436.png) center center no-repeat}h2[_ngcontent-%COMP%]{margin-top:.2em;margin-bottom:.4em}.setting[_ngcontent-%COMP%]{margin:5em;padding:1em;border-radius:1em;background-color:#7c4dff;box-shadow:4px 4px 5px 0 rgba(0,0,0,.67)}.setting[_ngcontent-%COMP%] > p[_ngcontent-%COMP%]{margin:.25em;color:#171d1d}#listOfUsers[_ngcontent-%COMP%]{width:40%;height:160px}.group[_ngcontent-%COMP%]{display:flex;margin:.6em}.textInput[_ngcontent-%COMP%]{border-radius:5px;margin:.3em;padding:.2em;font-size:1.3em;font-family:'Open Sans',sans-serif;background-color:#eee;color:#000;flex-grow:1}.button[_ngcontent-%COMP%]{width:150px;border-radius:5px;margin:0;padding:.3em .4em;font-size:1.3em;font-family:'Droid Sans',sans-serif;background-color:#2a2845;color:#fff;transition:.2s ease-out;min-width:50px}.userListWrapper[_ngcontent-%COMP%]{background-color:#2a2845;color:#fff;display:flex;font-family:\"Open Sans\",sans-serif;font-size:1.2em;flex:1;order:1;border-right:1px solid #222;overflow-x:hidden;overflow-y:auto}"]],data:{}});function Am(e){return qo(0,[(e()(),ki(0,0,null,null,5,"div",[["style","height:40px; padding-top:10px; position: relative;"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,0,"img",[["style","float: left; height: 32px; width: 32px; margin-top:-5px;"]],[[8,"src",4]],null,null,null,null)),(e()(),ki(2,0,null,null,1,"span",[["style","float: left; margin-left: 10px;"]],null,null,null,null,null)),(e()(),Vo(3,null,["",""])),(e()(),ki(4,0,null,null,0,"div",[["style","clear: both;"]],null,null,null,null,null)),(e()(),ki(5,0,null,null,0,"div",[["class","item-divider"]],null,null,null,null,null))],null,function(e,t){e(t,1,0,t.context.item.image),e(t,3,0,t.context.item.name)})}function Nm(e){return qo(0,[(e()(),ki(0,0,null,null,5,"input",[["class","wide-text"],["placeholder","Enter a provider"],["style","margin-top:10px; padding: 12px 10px; width: 340px; height: 16px; display: block; margin-left: auto; margin-right: auto;"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,1)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,1).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,1)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,1)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.customAddProviderUrl=n)&&r),r},null,null)),po(1,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(3,671744,null,0,Od,[[8,null],[8,null],[8,null],[6,$p]],{model:[0,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(5,16384,null,0,dd,[[4,ed]],null,null)],function(e,t){e(t,3,0,t.component.customAddProviderUrl)},function(e,t){e(t,0,0,eo(t,5).ngClassUntouched,eo(t,5).ngClassTouched,eo(t,5).ngClassPristine,eo(t,5).ngClassDirty,eo(t,5).ngClassValid,eo(t,5).ngClassInvalid,eo(t,5).ngClassPending)})}function Rm(e){return qo(0,[(e()(),ki(0,0,null,null,49,"div",[["class","settingsFormWrapper"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,48,"div",[["class","setting"]],null,null,null,null,null)),(e()(),ki(2,0,null,null,1,"h2",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Add a friend"])),(e()(),ki(4,0,null,null,3,"p",[],null,null,null,null,null)),(e()(),Vo(-1,null,[" Note: although this adds this user to your friends list, this does not mean that we you can chat with him/her. "])),(e()(),ki(6,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),Vo(-1,null,[" The other user should add you to their list and then click on your profile in order to set everything up. "])),(e()(),ki(8,0,null,null,31,"div",[["class","group"]],null,null,null,null,null)),(e()(),ki(9,0,null,null,5,"input",[["class","textInput"],["placeholder","Enter your friend's username"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"keydown"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,10)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,10).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,10)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,10)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.webIdAddFriend=n)&&r),"keydown"===t&&(r=!1!==i.handleSubmit(n)&&r),r},null,null)),po(10,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(12,671744,null,0,Od,[[8,null],[8,null],[8,null],[6,$p]],{model:[0,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(14,16384,null,0,dd,[[4,ed]],null,null),(e()(),ki(15,0,null,null,22,"div",[],null,null,null,null,null)),(e()(),ki(16,0,null,null,19,"ng-select",[["bindLabel","name"],["bindValue","loginUrl"],["class","login-select ng-select"],["dropdownPosition","bottom"],["placeholder","Select ID Provider"],["role","listbox"],["style","width: 360px; height: 45px; margin-left: auto; margin-right: auto;"]],[[2,"ng-select-single",null],[2,"ng-select-typeahead",null],[2,"ng-select-multiple",null],[2,"ng-select-taggable",null],[2,"ng-select-searchable",null],[2,"ng-select-opened",null],[2,"ng-select-disabled",null],[2,"ng-select-filtered",null],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"keydown"]],function(e,t,n){var r=!0,i=e.component;return"keydown"===t&&(r=!1!==eo(e,17).handleKeyDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedAddProviderUrl=n)&&r),r},jg,sg)),po(17,4964352,null,12,rg,[[8,"login-select"],[8,null],[8,null],tg,ng,xn,An,qd],{bindLabel:[0,"bindLabel"],bindValue:[1,"bindValue"],placeholder:[2,"placeholder"],dropdownPosition:[3,"dropdownPosition"],items:[4,"items"]},null),Ao(335544320,1,{optionTemplate:0}),Ao(335544320,2,{optgroupTemplate:0}),Ao(335544320,3,{labelTemplate:0}),Ao(335544320,4,{multiLabelTemplate:0}),Ao(335544320,5,{headerTemplate:0}),Ao(335544320,6,{footerTemplate:0}),Ao(335544320,7,{notFoundTemplate:0}),Ao(335544320,8,{typeToSearchTemplate:0}),Ao(335544320,9,{loadingTextTemplate:0}),Ao(335544320,10,{tagTemplate:0}),Ao(335544320,11,{loadingSpinnerTemplate:0}),Ao(603979776,12,{ngOptions:1}),mo(1024,null,$p,function(e){return[e]},[rg]),po(31,671744,null,0,Od,[[8,null],[8,null],[8,null],[6,$p]],{model:[0,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(33,16384,null,0,dd,[[4,ed]],null,null),(e()(),Ei(0,[[1,2]],null,1,null,Am)),po(35,16384,null,0,zd,[In],null,null),(e()(),Ei(16777216,null,null,1,null,Nm)),po(37,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),ki(38,0,null,null,1,"button",[["class","button"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.addFriend()&&r),r},null,null)),(e()(),Vo(-1,null,["Add friend"])),(e()(),ki(40,0,null,null,1,"h2",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Remove a friend"])),(e()(),ki(42,0,null,null,1,"p",[],null,null,null,null,null)),(e()(),Vo(-1,null,[" Note: this will delete a friend from your POD and (IMPORTANT!) all the messages that you have sent. "])),(e()(),ki(44,0,null,null,3,"div",[["class","group"],["id","listOfUsers"]],null,null,null,null,null)),(e()(),ki(45,0,null,null,2,"div",[["class","userListWrapper"]],null,null,null,null,null)),(e()(),ki(46,0,null,null,1,"app-user-settings-list",[],null,null,null,Im,Tm)),po(47,49152,null,0,Cm,[vp],null,null),(e()(),ki(48,0,null,null,1,"button",[["class","button"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.removeFriend()&&r),r},null,null)),(e()(),Vo(-1,null,["Remove friend"]))],function(e,t){var n=t.component;e(t,12,0,n.webIdAddFriend),e(t,17,0,"name","loginUrl","Select ID Provider","bottom",n.identityProviders),e(t,31,0,n.selectedAddProviderUrl),e(t,37,0,null===n.selectedAddProviderUrl)},function(e,t){e(t,9,0,eo(t,14).ngClassUntouched,eo(t,14).ngClassTouched,eo(t,14).ngClassPristine,eo(t,14).ngClassDirty,eo(t,14).ngClassValid,eo(t,14).ngClassInvalid,eo(t,14).ngClassPending),e(t,16,1,[!eo(t,17).multiple,eo(t,17).typeahead,eo(t,17).multiple,eo(t,17).addTag,eo(t,17).searchable,eo(t,17).isOpen,eo(t,17).disabled,eo(t,17).filtered,eo(t,33).ngClassUntouched,eo(t,33).ngClassTouched,eo(t,33).ngClassPristine,eo(t,33).ngClassDirty,eo(t,33).ngClassValid,eo(t,33).ngClassInvalid,eo(t,33).ngClassPending])})}function jm(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-settings",[],null,null,null,Rm,Pm)),po(1,114688,null,0,wp,[vp,Tl,ip,Th],null,null)],function(e,t){e(t,1,0)},null)}var Dm=qi("app-settings",wp,jm,{},{},[]),Mm=Yr({encapsulation:0,styles:[['.main[_ngcontent-%COMP%]{display:flex;flex-direction:column;font-family:"Open Sans",sans-serif;width:100%;height:calc(100vh - 50px);color:#000;background:linear-gradient(181deg,rgba(100,200,255,.6),rgba(0,0,0,.9)),url(Solid_Pattern.9051b19429853f670436.png) center center no-repeat}.question[_ngcontent-%COMP%]{margin:1.5em;padding:1em;border-radius:1em;background-color:#7c4dff;box-shadow:4px 4px 5px 0 rgba(0,0,0,.67)}.description[_ngcontent-%COMP%]{color:#fff}']],data:{}});function Lm(e){return qo(0,[(e()(),ki(0,0,null,null,22,"div",[["class","main"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,1,"h1",[["class","description"]],null,null,null,null,null)),(e()(),Vo(-1,null,["Here there is a recopilation of questions frequently asqued of how to use DeChat:"])),(e()(),ki(3,0,null,null,4,"section",[["class","question"]],null,null,null,null,null)),(e()(),ki(4,0,null,null,1,"h2",[["class","query"]],null,null,null,null,null)),(e()(),Vo(-1,null,["How can I add friends?"])),(e()(),ki(6,0,null,null,1,"p",[["class","answer"]],null,null,null,null,null)),(e()(),Vo(-1,null,[' You simply have to go to the "Settings" section in the navigation bar. Then you select the username of your friend, as well as one provider, and you click on the "Add Friend" button. '])),(e()(),ki(8,0,null,null,4,"section",[["class","question"]],null,null,null,null,null)),(e()(),ki(9,0,null,null,1,"h2",[["class","query"]],null,null,null,null,null)),(e()(),Vo(-1,null,["How can I start a chat with a friend?"])),(e()(),ki(11,0,null,null,1,"p",[["class","answer"]],null,null,null,null,null)),(e()(),Vo(-1,null,[" Go to the right section on the chat, where your friends are listed, and click on his name. Now you must click on the chat form, and your friend too. Then you should be able to talk with him. "])),(e()(),ki(13,0,null,null,4,"section",[["class","question"]],null,null,null,null,null)),(e()(),ki(14,0,null,null,1,"h2",[["class","query"]],null,null,null,null,null)),(e()(),Vo(-1,null,["With which providers can I log in?"])),(e()(),ki(16,0,null,null,1,"p",[["class","answer"]],null,null,null,null,null)),(e()(),Vo(-1,null,[" There exist three ways to log in the application.You can use a Solid account, using Inrupt, or with an specific web id. "])),(e()(),ki(18,0,null,null,4,"section",[["class","question"]],null,null,null,null,null)),(e()(),ki(19,0,null,null,1,"h2",[["class","query"]],null,null,null,null,null)),(e()(),Vo(-1,null,["Can I cange my personal data in the application?"])),(e()(),ki(21,0,null,null,1,"p",[["class","answer"]],null,null,null,null,null)),(e()(),Vo(-1,null,[' Yes, you can go to the "Profile" section and add or modify the information as you want. ']))],null,null)}function Um(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-help-component",[],null,null,null,Lm,Mm)),po(1,114688,null,0,_p,[],null,null)],function(e,t){e(t,1,0)},null)}var Fm=qi("app-help-component",_p,Um,{},{},[]),Vm=Yr({encapsulation:0,styles:[[".registration[_ngcontent-%COMP%]{text-align:center;font-family:Roboto,sans-serif}.registration[_ngcontent-%COMP%] .header-bar[_ngcontent-%COMP%]{margin:0;height:44px;width:calc(100% + 16px);background-color:#3d6deb;color:#fff;position:absolute;top:0;left:0}.registration[_ngcontent-%COMP%] .header-bar[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-align:center;font-family:Roboto,sans-serif;font-weight:700;font-size:14px;letter-spacing:1px;line-height:15px}.registration[_ngcontent-%COMP%] .header-text[_ngcontent-%COMP%]{margin-top:92px;width:360px;margin-left:auto;margin-right:auto;font-size:14px;color:#666}.registration[_ngcontent-%COMP%] .header-text[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#666;font-size:12px}.registration[_ngcontent-%COMP%] .provider-card-container[_ngcontent-%COMP%]{margin-top:28px}.registration[_ngcontent-%COMP%] .provider-card[_ngcontent-%COMP%]{height:140px;width:320px;border:1px solid #dae0e6;border-radius:2px;background-color:#fff;margin:10px;display:inline-block;box-shadow:#dae0e6 1px 1px 6px}.registration[_ngcontent-%COMP%] .provider-card[_ngcontent-%COMP%] .provider-logo[_ngcontent-%COMP%]{height:44px;width:44px;margin-left:auto;margin-right:auto;margin-top:16px}.registration[_ngcontent-%COMP%] .provider-card[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{color:#656e75;font-size:18px;margin-top:-2px;letter-spacing:.9px;line-height:24px}.registration[_ngcontent-%COMP%] .provider-card[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#656e75;font-size:12px;line-height:16px}"]],data:{}});function Bm(e){return qo(0,[(e()(),ki(0,0,null,null,5,"div",[["class","provider-card"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,0,"img",[["class","provider-logo"]],[[8,"src",4]],null,null,null,null)),(e()(),ki(2,0,null,null,1,"h2",[],null,null,null,null,null)),(e()(),Vo(3,null,["",""])),(e()(),ki(4,0,null,null,1,"p",[],null,null,null,null,null)),(e()(),Vo(5,null,["",""]))],null,function(e,t){e(t,1,0,t.context.$implicit.image),e(t,3,0,t.context.$implicit.name),e(t,5,0,t.context.$implicit.desc)})}function zm(e){return qo(0,[(e()(),ki(0,0,null,null,11,"div",[["class","registration"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,2,"div",[["class","header-bar"]],null,null,null,null,null)),(e()(),ki(2,0,null,null,1,"p",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Select Solid Identity Provider"])),(e()(),ki(4,0,null,null,4,"div",[["class","header-text"]],null,null,null,null,null)),(e()(),ki(5,0,null,null,1,"p",[],null,null,null,null,null)),(e()(),Vo(-1,null,[" With a Solid Identity your personal data is stored securely in a POD. You control who has access to it. "])),(e()(),ki(7,0,null,null,1,"a",[["href","https://solid.mit.edu"],["target","_blank"]],null,null,null,null,null)),(e()(),Vo(-1,null,[" Learn more about Solid IDs and PODs "])),(e()(),ki(9,0,null,null,2,"div",[["class","provider-card-container"]],null,null,null,null,null)),(e()(),Ei(16777216,null,null,1,null,Bm)),po(11,278528,null,0,Ws,[Pn,In,Xn],{ngForOf:[0,"ngForOf"]},null)],function(e,t){e(t,11,0,t.component.availableProviders)},null)}function qm(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-register",[],null,null,null,zm,Vm)),po(1,114688,null,0,hp,[ip],null,null)],function(e,t){e(t,1,0)},null)}var Hm=qi("app-register",hp,qm,{},{},[]),Wm=function(){function e(e){this.authService=e}return e.prototype.ngOnInit=function(){},e.prototype.logout=function(){this.authService.solidSignOut()},e}(),$m=Yr({encapsulation:0,styles:[[".topnav[_ngcontent-%COMP%]{width:100%;background-color:#7c4dff;height:50px;color:#fff}.topnav[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{height:80%;margin-left:10px;padding-top:5px}.topnav[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none;color:inherit}.topnav[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{background-color:rgba(0,0,0,.25)}.topnav[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:active{background-color:rgba(0,0,0,.5);box-shadow:inset 0 0 15px 6px rgba(0,0,0,.25)}.topnav[_ngcontent-%COMP%] .logoText[_ngcontent-%COMP%]{display:inline-block;font-family:'Roboto Slab',serif;font-size:24px;font-weight:700;text-transform:uppercase;line-height:32px;padding-right:80px;position:relative;top:-8px;left:28px}.topnav[_ngcontent-%COMP%] .menu-item[_ngcontent-%COMP%]{display:inline-block;background-color:#7c4dff;color:#fff;font-size:15px;line-height:13px;width:150px;height:100%;text-align:center}.topnav[_ngcontent-%COMP%] .menu-item[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:24px;margin-top:8px;margin-bottom:2px}.topnav[_ngcontent-%COMP%] .profile-menu[_ngcontent-%COMP%]{float:right}.topnav[_ngcontent-%COMP%] .profile-menu[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{display:block;height:30px;width:30px;border-radius:50%;margin:10px auto 0;cursor:pointer}.loading-image[_ngcontent-%COMP%]{text-align:center;margin-top:50px}"]],data:{}});function Gm(e){return qo(0,[(e()(),ki(0,0,null,null,42,"div",[["class","topnav"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,41,"div",[["class","topnav"]],null,null,null,null,null)),(e()(),ki(2,0,null,null,0,"img",[["class","logo"],["src","../assets/images/Solid.png"]],null,null,null,null,null)),(e()(),ki(3,0,null,null,1,"span",[["class","logoText"]],null,null,null,null,null)),(e()(),Vo(-1,null,["Solid DeChat"])),(e()(),ki(5,0,null,null,6,"a",[["class","menu-item"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==eo(e,6).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),po(6,671744,null,0,Ph,[Th,Vf,ts],{routerLink:[0,"routerLink"]},null),Lo(7,1),(e()(),ki(8,0,null,null,1,"div",[],null,null,null,null,null)),(e()(),ki(9,0,null,null,0,"i",[["class","far fa-comments"]],null,null,null,null,null)),(e()(),ki(10,0,null,null,1,"span",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Chat"])),(e()(),ki(12,0,null,null,6,"a",[["class","menu-item"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==eo(e,13).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),po(13,671744,null,0,Ph,[Th,Vf,ts],{routerLink:[0,"routerLink"]},null),Lo(14,1),(e()(),ki(15,0,null,null,1,"div",[],null,null,null,null,null)),(e()(),ki(16,0,null,null,0,"i",[["class","fas fa-sliders-h"]],null,null,null,null,null)),(e()(),ki(17,0,null,null,1,"span",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Settings"])),(e()(),ki(19,0,null,null,6,"a",[["class","menu-item"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==eo(e,20).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),po(20,671744,null,0,Ph,[Th,Vf,ts],{routerLink:[0,"routerLink"]},null),Lo(21,1),(e()(),ki(22,0,null,null,1,"div",[],null,null,null,null,null)),(e()(),ki(23,0,null,null,0,"i",[["class","fas fa-question"]],null,null,null,null,null)),(e()(),ki(24,0,null,null,1,"span",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Help"])),(e()(),ki(26,0,null,null,6,"a",[["class","menu-item"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==eo(e,27).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),po(27,671744,null,0,Ph,[Th,Vf,ts],{routerLink:[0,"routerLink"]},null),Lo(28,1),(e()(),ki(29,0,null,null,1,"div",[],null,null,null,null,null)),(e()(),ki(30,0,null,null,0,"i",[["class","fas fa-user"]],null,null,null,null,null)),(e()(),ki(31,0,null,null,1,"span",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Solid Profile"])),(e()(),ki(33,0,null,null,4,"a",[["class","menu-item profile-menu"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.logout()&&r),r},null,null)),(e()(),ki(34,0,null,null,1,"div",[],null,null,null,null,null)),(e()(),ki(35,0,null,null,0,"i",[["class","fas fa-sign-out-alt"]],null,null,null,null,null)),(e()(),ki(36,0,null,null,1,"span",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Sign out"])),(e()(),ki(38,0,null,null,4,"a",[["class","menu-item profile-menu"],["href","/docs"]],null,null,null,null,null)),(e()(),ki(39,0,null,null,1,"div",[],null,null,null,null,null)),(e()(),ki(40,0,null,null,0,"i",[["class","fas fa-file-alt"]],null,null,null,null,null)),(e()(),ki(41,0,null,null,1,"span",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Documentation"]))],function(e,t){var n=e(t,7,0,"/chat");e(t,6,0,n);var r=e(t,14,0,"/settings");e(t,13,0,r);var i=e(t,21,0,"/help");e(t,20,0,i);var o=e(t,28,0,"/card");e(t,27,0,o)},function(e,t){e(t,5,0,eo(t,6).target,eo(t,6).href),e(t,12,0,eo(t,13).target,eo(t,13).href),e(t,19,0,eo(t,20).target,eo(t,20).href),e(t,26,0,eo(t,27).target,eo(t,27).href)})}var Jm=Yr({encapsulation:0,styles:[[""]],data:{}});function Km(e){return qo(0,[(e()(),ki(0,0,null,null,5,"div",[["class","chatRoom"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,2,"div",[["class","chatHeaderWrapper"]],null,null,null,null,null)),(e()(),ki(2,0,null,null,1,"app-navbar",[],null,null,null,Gm,$m)),po(3,114688,null,0,Wm,[ip],null,null),(e()(),ki(4,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),po(5,212992,null,0,jh,[Rh,Pn,Ut,[8,null],An],null,null)],function(e,t){e(t,3,0),e(t,5,0)},null)}function Qm(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-root",[],null,null,null,Km,Jm)),po(1,49152,null,0,Sp,[],null,null)],null,null)}var Ym=qi("app-root",Sp,Qm,{},{},[]),Zm=function(){return function(){}}(),Xm=function(){return function(){}}(),ey="*";function ty(e,t){return void 0===t&&(t=null),{type:2,steps:e,options:t}}function ny(e){return{type:6,styles:e,offset:null}}function ry(e){Promise.resolve(null).then(e)}var iy=function(){function e(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this.parentPlayer=null,this.totalTime=e+t}return e.prototype._onFinish=function(){this._finished||(this._finished=!0,this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[])},e.prototype.onStart=function(e){this._onStartFns.push(e)},e.prototype.onDone=function(e){this._onDoneFns.push(e)},e.prototype.onDestroy=function(e){this._onDestroyFns.push(e)},e.prototype.hasStarted=function(){return this._started},e.prototype.init=function(){},e.prototype.play=function(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0},e.prototype.triggerMicrotask=function(){var e=this;ry(function(){return e._onFinish()})},e.prototype._onStart=function(){this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[]},e.prototype.pause=function(){},e.prototype.restart=function(){},e.prototype.finish=function(){this._onFinish()},e.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(function(e){return e()}),this._onDestroyFns=[])},e.prototype.reset=function(){},e.prototype.setPosition=function(e){},e.prototype.getPosition=function(){return 0},e.prototype.triggerCallback=function(e){var t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(function(e){return e()}),t.length=0},e}(),oy=function(){function e(e){var t=this;this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;var n=0,r=0,i=0,o=this.players.length;0==o?ry(function(){return t._onFinish()}):this.players.forEach(function(e){e.onDone(function(){++n==o&&t._onFinish()}),e.onDestroy(function(){++r==o&&t._onDestroy()}),e.onStart(function(){++i==o&&t._onStart()})}),this.totalTime=this.players.reduce(function(e,t){return Math.max(e,t.totalTime)},0)}return e.prototype._onFinish=function(){this._finished||(this._finished=!0,this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[])},e.prototype.init=function(){this.players.forEach(function(e){return e.init()})},e.prototype.onStart=function(e){this._onStartFns.push(e)},e.prototype._onStart=function(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[])},e.prototype.onDone=function(e){this._onDoneFns.push(e)},e.prototype.onDestroy=function(e){this._onDestroyFns.push(e)},e.prototype.hasStarted=function(){return this._started},e.prototype.play=function(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(function(e){return e.play()})},e.prototype.pause=function(){this.players.forEach(function(e){return e.pause()})},e.prototype.restart=function(){this.players.forEach(function(e){return e.restart()})},e.prototype.finish=function(){this._onFinish(),this.players.forEach(function(e){return e.finish()})},e.prototype.destroy=function(){this._onDestroy()},e.prototype._onDestroy=function(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(function(e){return e.destroy()}),this._onDestroyFns.forEach(function(e){return e()}),this._onDestroyFns=[])},e.prototype.reset=function(){this.players.forEach(function(e){return e.reset()}),this._destroyed=!1,this._finished=!1,this._started=!1},e.prototype.setPosition=function(e){var t=e*this.totalTime;this.players.forEach(function(e){var n=e.totalTime?Math.min(1,t/e.totalTime):1;e.setPosition(n)})},e.prototype.getPosition=function(){var e=0;return this.players.forEach(function(t){var n=t.getPosition();e=Math.min(n,e)}),e},e.prototype.beforeDestroy=function(){this.players.forEach(function(e){e.beforeDestroy&&e.beforeDestroy()})},e.prototype.triggerCallback=function(e){var t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(function(e){return e()}),t.length=0},e}(),ay="!";function sy(){return"undefined"!=typeof process}function uy(e){switch(e.length){case 0:return new iy;case 1:return e[0];default:return new oy(e)}}function ly(e,t,n,r,i,o){void 0===i&&(i={}),void 0===o&&(o={});var a=[],s=[],u=-1,l=null;if(r.forEach(function(e){var n=e.offset,r=n==u,c=r&&l||{};Object.keys(e).forEach(function(n){var r=n,s=e[n];if("offset"!==n)switch(r=t.normalizePropertyName(r,a),s){case ay:s=i[n];break;case ey:s=o[n];break;default:s=t.normalizeStyleValue(n,r,s,a)}c[r]=s}),r||s.push(c),l=c,u=n}),a.length)throw new Error("Unable to animate due to the following errors:\n - "+a.join("\n - "));return s}function cy(e,t,n,r){switch(t){case"start":e.onStart(function(){return r(n&&fy(n,"start",e))});break;case"done":e.onDone(function(){return r(n&&fy(n,"done",e))});break;case"destroy":e.onDestroy(function(){return r(n&&fy(n,"destroy",e))})}}function fy(e,t,n){var r=n.totalTime,i=hy(e.element,e.triggerName,e.fromState,e.toState,t||e.phaseName,null==r?e.totalTime:r,!!n.disabled),o=e._data;return null!=o&&(i._data=o),i}function hy(e,t,n,r,i,o,a){return void 0===i&&(i=""),void 0===o&&(o=0),{element:e,triggerName:t,fromState:n,toState:r,phaseName:i,totalTime:o,disabled:!!a}}function py(e,t,n){var r;return e instanceof Map?(r=e.get(t))||e.set(t,r=n):(r=e[t])||(r=e[t]=n),r}function dy(e){var t=e.indexOf(":");return[e.substring(1,t),e.substr(t+1)]}var gy=function(e,t){return!1},my=function(e,t){return!1},yy=function(e,t,n){return[]},vy=sy();if(vy||"undefined"!=typeof Element){if(gy=function(e,t){return e.contains(t)},vy||Element.prototype.matches)my=function(e,t){return e.matches(t)};else{var by=Element.prototype,wy=by.matchesSelector||by.mozMatchesSelector||by.msMatchesSelector||by.oMatchesSelector||by.webkitMatchesSelector;wy&&(my=function(e,t){return wy.apply(e,[t])})}yy=function(e,t,n){var r=[];if(n)r.push.apply(r,c(e.querySelectorAll(t)));else{var i=e.querySelector(t);i&&r.push(i)}return r}}var _y=null,xy=!1;function Sy(e){_y||(_y=("undefined"!=typeof document?document.body:null)||{},xy=!!_y.style&&"WebkitAppearance"in _y.style);var t=!0;return _y.style&&!function(e){return"ebkit"==e.substring(1,6)}(e)&&!(t=e in _y.style)&&xy&&(t="Webkit"+e.charAt(0).toUpperCase()+e.substr(1)in _y.style),t}var Ey=my,ky=gy,Cy=yy;function Ty(e){var t={};return Object.keys(e).forEach(function(n){var r=n.replace(/([a-z])([A-Z])/g,"$1-$2");t[r]=e[n]}),t}var Oy=function(){function e(){}return e.prototype.validateStyleProperty=function(e){return Sy(e)},e.prototype.matchesElement=function(e,t){return Ey(e,t)},e.prototype.containsElement=function(e,t){return ky(e,t)},e.prototype.query=function(e,t,n){return Cy(e,t,n)},e.prototype.computeStyle=function(e,t,n){return n||""},e.prototype.animate=function(e,t,n,r,i,o,a){return void 0===o&&(o=[]),new iy(n,r)},e}(),Iy=function(){function e(){}return e.NOOP=new Oy,e}(),Py=1e3;function Ay(e){if("number"==typeof e)return e;var t=e.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:Ny(parseFloat(t[1]),t[2])}function Ny(e,t){switch(t){case"s":return e*Py;default:return e}}function Ry(e,t,n){return e.hasOwnProperty("duration")?e:function(e,t,n){var r,i=0,o="";if("string"==typeof e){var a=e.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===a)return t.push('The provided timing value "'+e+'" is invalid.'),{duration:0,delay:0,easing:""};r=Ny(parseFloat(a[1]),a[2]);var s=a[3];null!=s&&(i=Ny(Math.floor(parseFloat(s)),a[4]));var u=a[5];u&&(o=u)}else r=e;if(!n){var l=!1,c=t.length;r<0&&(t.push("Duration values below 0 are not allowed for this animation step."),l=!0),i<0&&(t.push("Delay values below 0 are not allowed for this animation step."),l=!0),l&&t.splice(c,0,'The provided timing value "'+e+'" is invalid.')}return{duration:r,delay:i,easing:o}}(e,t,n)}function jy(e,t){return void 0===t&&(t={}),Object.keys(e).forEach(function(n){t[n]=e[n]}),t}function Dy(e,t,n){if(void 0===n&&(n={}),t)for(var r in e)n[r]=e[r];else jy(e,n);return n}function My(e,t,n){return n?t+":"+n+";":""}function Ly(e){for(var t="",n=0;n *";case":leave":return"* => void";case":increment":return function(e,t){return parseFloat(t)>parseFloat(e)};case":decrement":return function(e,t){return parseFloat(t) *"}}(e,n);if("function"==typeof r)return void t.push(r);e=r}var i=e.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return n.push('The provided transition expression "'+e+'" is not supported'),t;var o=i[1],a=i[2],s=i[3];t.push(ev(o,s)),"<"!=a[0]||o==Yy&&s==Yy||t.push(ev(s,o))}(e,i,r)}):i.push(n),i),animation:o,queryCount:t.queryCount,depCount:t.depCount,options:av(e.options)}},e.prototype.visitSequence=function(e,t){var n=this;return{type:2,steps:e.steps.map(function(e){return Ky(n,e,t)}),options:av(e.options)}},e.prototype.visitGroup=function(e,t){var n=this,r=t.currentTime,i=0,o=e.steps.map(function(e){t.currentTime=r;var o=Ky(n,e,t);return i=Math.max(i,t.currentTime),o});return t.currentTime=i,{type:3,steps:o,options:av(e.options)}},e.prototype.visitAnimate=function(e,t){var n,r=function(e,t){var n=null;if(e.hasOwnProperty("duration"))n=e;else if("number"==typeof e)return sv(Ry(e,t).duration,0,"");var r=e;if(r.split(/\s+/).some(function(e){return"{"==e.charAt(0)&&"{"==e.charAt(1)})){var i=sv(0,0,"");return i.dynamic=!0,i.strValue=r,i}return sv((n=n||Ry(r,t)).duration,n.delay,n.easing)}(e.timings,t.errors);t.currentAnimateTimings=r;var i=e.styles?e.styles:ny({});if(5==i.type)n=this.visitKeyframes(i,t);else{var o=e.styles,a=!1;if(!o){a=!0;var s={};r.easing&&(s.easing=r.easing),o=ny(s)}t.currentTime+=r.duration+r.delay;var u=this.visitStyle(o,t);u.isEmptyStep=a,n=u}return t.currentAnimateTimings=null,{type:4,timings:r,style:n,options:null}},e.prototype.visitStyle=function(e,t){var n=this._makeStyleAst(e,t);return this._validateStyleAst(n,t),n},e.prototype._makeStyleAst=function(e,t){var n=[];Array.isArray(e.styles)?e.styles.forEach(function(e){"string"==typeof e?e==ey?n.push(e):t.errors.push("The provided style string value "+e+" is not allowed."):n.push(e)}):n.push(e.styles);var r=!1,i=null;return n.forEach(function(e){if(ov(e)){var t=e,n=t.easing;if(n&&(i=n,delete t.easing),!r)for(var o in t)if(t[o].toString().indexOf("{{")>=0){r=!0;break}}}),{type:6,styles:n,easing:i,offset:e.offset,containsDynamicStyles:r,options:null}},e.prototype._validateStyleAst=function(e,t){var n=this,r=t.currentAnimateTimings,i=t.currentTime,o=t.currentTime;r&&o>0&&(o-=r.duration+r.delay),e.styles.forEach(function(e){"string"!=typeof e&&Object.keys(e).forEach(function(r){if(n._driver.validateStyleProperty(r)){var a,s,u,l=t.collectedStyles[t.currentQuerySelector],c=l[r],f=!0;c&&(o!=i&&o>=c.startTime&&i<=c.endTime&&(t.errors.push('The CSS property "'+r+'" that exists between the times of "'+c.startTime+'ms" and "'+c.endTime+'ms" is also being animated in a parallel animation between the times of "'+o+'ms" and "'+i+'ms"'),f=!1),o=c.startTime),f&&(l[r]={startTime:o,endTime:i}),t.options&&(a=t.errors,s=t.options.params||{},(u=zy(e[r])).length&&u.forEach(function(e){s.hasOwnProperty(e)||a.push("Unable to resolve the local animation param "+e+" in the given list of values")}))}else t.errors.push('The provided animation property "'+r+'" is not a supported CSS property for animations')})})},e.prototype.visitKeyframes=function(e,t){var n=this,r={type:5,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push("keyframes() must be placed inside of a call to animate()"),r;var i=0,o=[],a=!1,s=!1,u=0,l=e.steps.map(function(e){var r=n._makeStyleAst(e,t),l=null!=r.offset?r.offset:function(e){if("string"==typeof e)return null;var t=null;if(Array.isArray(e))e.forEach(function(e){if(ov(e)&&e.hasOwnProperty("offset")){var n=e;t=parseFloat(n.offset),delete n.offset}});else if(ov(e)&&e.hasOwnProperty("offset")){var n=e;t=parseFloat(n.offset),delete n.offset}return t}(r.styles),c=0;return null!=l&&(i++,c=r.offset=l),s=s||c<0||c>1,a=a||c0&&i0?i==h?1:f*i:o[i],s=a*g;t.currentTime=p+d.delay+s,d.duration=s,n._validateStyleAst(e,t),e.offset=a,r.styles.push(e)}),r},e.prototype.visitReference=function(e,t){return{type:8,animation:Ky(this,Vy(e.animation),t),options:av(e.options)}},e.prototype.visitAnimateChild=function(e,t){return t.depCount++,{type:9,options:av(e.options)}},e.prototype.visitAnimateRef=function(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:av(e.options)}},e.prototype.visitQuery=function(e,t){var n=t.currentQuerySelector,r=e.options||{};t.queryCount++,t.currentQuery=e;var i=l(function(e){var t=!!e.split(/\s*,\s*/).find(function(e){return":self"==e});return t&&(e=e.replace(tv,"")),[e=e.replace(/@\*/g,".ng-trigger").replace(/@\w+/g,function(e){return".ng-trigger-"+e.substr(1)}).replace(/:animating/g,".ng-animating"),t]}(e.selector),2),o=i[0],a=i[1];t.currentQuerySelector=n.length?n+" "+o:o,py(t.collectedStyles,t.currentQuerySelector,{});var s=Ky(this,Vy(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=n,{type:11,selector:o,limit:r.limit||0,optional:!!r.optional,includeSelf:a,animation:s,originalSelector:e.selector,options:av(e.options)}},e.prototype.visitStagger=function(e,t){t.currentQuery||t.errors.push("stagger() can only be used inside of query()");var n="full"===e.timings?{duration:0,delay:0,easing:"full"}:Ry(e.timings,t.errors,!0);return{type:12,animation:Ky(this,Vy(e.animation),t),timings:n,options:null}},e}(),iv=function(){return function(e){this.errors=e,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null}}();function ov(e){return!Array.isArray(e)&&"object"==typeof e}function av(e){var t;return e?(e=jy(e)).params&&(e.params=(t=e.params)?jy(t):null):e={},e}function sv(e,t,n){return{duration:e,delay:t,easing:n}}function uv(e,t,n,r,i,o,a,s){return void 0===a&&(a=null),void 0===s&&(s=!1),{type:1,element:e,keyframes:t,preStyleProps:n,postStyleProps:r,duration:i,delay:o,totalTime:i+o,easing:a,subTimeline:s}}var lv=function(){function e(){this._map=new Map}return e.prototype.consume=function(e){var t=this._map.get(e);return t?this._map.delete(e):t=[],t},e.prototype.append=function(e,t){var n=this._map.get(e);n||this._map.set(e,n=[]),n.push.apply(n,c(t))},e.prototype.has=function(e){return this._map.has(e)},e.prototype.clear=function(){this._map.clear()},e}(),cv=new RegExp(":enter","g"),fv=new RegExp(":leave","g");function hv(e,t,n,r,i,o,a,s,u,l){return void 0===o&&(o={}),void 0===a&&(a={}),void 0===l&&(l=[]),(new pv).buildKeyframes(e,t,n,r,i,o,a,s,u,l)}var pv=function(){function e(){}return e.prototype.buildKeyframes=function(e,t,n,r,i,o,a,s,u,l){void 0===l&&(l=[]),u=u||new lv;var c=new gv(e,t,u,r,i,l,[]);c.options=s,c.currentTimeline.setStyles([o],null,c.errors,s),Ky(this,n,c);var f=c.timelines.filter(function(e){return e.containsAnimation()});if(f.length&&Object.keys(a).length){var h=f[f.length-1];h.allowOnlyTimelineStyles()||h.setStyles([a],null,c.errors,s)}return f.length?f.map(function(e){return e.buildKeyframes()}):[uv(t,[],[],[],0,0,"",!1)]},e.prototype.visitTrigger=function(e,t){},e.prototype.visitState=function(e,t){},e.prototype.visitTransition=function(e,t){},e.prototype.visitAnimateChild=function(e,t){var n=t.subInstructions.consume(t.element);if(n){var r=t.createSubContext(e.options),i=t.currentTimeline.currentTime,o=this._visitSubInstructions(n,r,r.options);i!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e},e.prototype.visitAnimateRef=function(e,t){var n=t.createSubContext(e.options);n.transformIntoNewTimeline(),this.visitReference(e.animation,n),t.transformIntoNewTimeline(n.currentTimeline.currentTime),t.previousNode=e},e.prototype._visitSubInstructions=function(e,t,n){var r=t.currentTimeline.currentTime,i=null!=n.duration?Ay(n.duration):null,o=null!=n.delay?Ay(n.delay):null;return 0!==i&&e.forEach(function(e){var n=t.appendInstructionToTimeline(e,i,o);r=Math.max(r,n.duration+n.delay)}),r},e.prototype.visitReference=function(e,t){t.updateOptions(e.options,!0),Ky(this,e.animation,t),t.previousNode=e},e.prototype.visitSequence=function(e,t){var n=this,r=t.subContextCount,i=t,o=e.options;if(o&&(o.params||o.delay)&&((i=t.createSubContext(o)).transformIntoNewTimeline(),null!=o.delay)){6==i.previousNode.type&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=dv);var a=Ay(o.delay);i.delayNextStep(a)}e.steps.length&&(e.steps.forEach(function(e){return Ky(n,e,i)}),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>r&&i.transformIntoNewTimeline()),t.previousNode=e},e.prototype.visitGroup=function(e,t){var n=this,r=[],i=t.currentTimeline.currentTime,o=e.options&&e.options.delay?Ay(e.options.delay):0;e.steps.forEach(function(a){var s=t.createSubContext(e.options);o&&s.delayNextStep(o),Ky(n,a,s),i=Math.max(i,s.currentTimeline.currentTime),r.push(s.currentTimeline)}),r.forEach(function(e){return t.currentTimeline.mergeTimelineCollectedStyles(e)}),t.transformIntoNewTimeline(i),t.previousNode=e},e.prototype._visitTiming=function(e,t){if(e.dynamic){var n=e.strValue;return Ry(t.params?qy(n,t.params,t.errors):n,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}},e.prototype.visitAnimate=function(e,t){var n=t.currentAnimateTimings=this._visitTiming(e.timings,t),r=t.currentTimeline;n.delay&&(t.incrementTime(n.delay),r.snapshotCurrentStyles());var i=e.style;5==i.type?this.visitKeyframes(i,t):(t.incrementTime(n.duration),this.visitStyle(i,t),r.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e},e.prototype.visitStyle=function(e,t){var n=t.currentTimeline,r=t.currentAnimateTimings;!r&&n.getCurrentStyleProperties().length&&n.forwardFrame();var i=r&&r.easing||e.easing;e.isEmptyStep?n.applyEmptyStep(i):n.setStyles(e.styles,i,t.errors,t.options),t.previousNode=e},e.prototype.visitKeyframes=function(e,t){var n=t.currentAnimateTimings,r=t.currentTimeline.duration,i=n.duration,o=t.createSubContext().currentTimeline;o.easing=n.easing,e.styles.forEach(function(e){o.forwardTime((e.offset||0)*i),o.setStyles(e.styles,e.easing,t.errors,t.options),o.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(o),t.transformIntoNewTimeline(r+i),t.previousNode=e},e.prototype.visitQuery=function(e,t){var n=this,r=t.currentTimeline.currentTime,i=e.options||{},o=i.delay?Ay(i.delay):0;o&&(6===t.previousNode.type||0==r&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=dv);var a=r,s=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!i.optional,t.errors);t.currentQueryTotal=s.length;var u=null;s.forEach(function(r,i){t.currentQueryIndex=i;var s=t.createSubContext(e.options,r);o&&s.delayNextStep(o),r===t.element&&(u=s.currentTimeline),Ky(n,e.animation,s),s.currentTimeline.applyStylesToKeyframe(),a=Math.max(a,s.currentTimeline.currentTime)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(a),u&&(t.currentTimeline.mergeTimelineCollectedStyles(u),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e},e.prototype.visitStagger=function(e,t){var n=t.parentContext,r=t.currentTimeline,i=e.timings,o=Math.abs(i.duration),a=o*(t.currentQueryTotal-1),s=o*t.currentQueryIndex;switch(i.duration<0?"reverse":i.easing){case"reverse":s=a-s;break;case"full":s=n.currentStaggerTime}var u=t.currentTimeline;s&&u.delayNextStep(s);var l=u.currentTime;Ky(this,e.animation,t),t.previousNode=e,n.currentStaggerTime=r.currentTime-l+(r.startTime-n.currentTimeline.startTime)},e}(),dv={},gv=function(){function e(e,t,n,r,i,o,a,s){this._driver=e,this.element=t,this.subInstructions=n,this._enterClassName=r,this._leaveClassName=i,this.errors=o,this.timelines=a,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=dv,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=s||new mv(this._driver,t,0),a.push(this.currentTimeline)}return Object.defineProperty(e.prototype,"params",{get:function(){return this.options.params},enumerable:!0,configurable:!0}),e.prototype.updateOptions=function(e,t){var n=this;if(e){var r=e,i=this.options;null!=r.duration&&(i.duration=Ay(r.duration)),null!=r.delay&&(i.delay=Ay(r.delay));var o=r.params;if(o){var a=i.params;a||(a=this.options.params={}),Object.keys(o).forEach(function(e){t&&a.hasOwnProperty(e)||(a[e]=qy(o[e],a,n.errors))})}}},e.prototype._copyOptions=function(){var e={};if(this.options){var t=this.options.params;if(t){var n=e.params={};Object.keys(t).forEach(function(e){n[e]=t[e]})}}return e},e.prototype.createSubContext=function(t,n,r){void 0===t&&(t=null);var i=n||this.element,o=new e(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,r||0));return o.previousNode=this.previousNode,o.currentAnimateTimings=this.currentAnimateTimings,o.options=this._copyOptions(),o.updateOptions(t),o.currentQueryIndex=this.currentQueryIndex,o.currentQueryTotal=this.currentQueryTotal,o.parentContext=this,this.subContextCount++,o},e.prototype.transformIntoNewTimeline=function(e){return this.previousNode=dv,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline},e.prototype.appendInstructionToTimeline=function(e,t,n){var r={duration:null!=t?t:e.duration,delay:this.currentTimeline.currentTime+(null!=n?n:0)+e.delay,easing:""},i=new yv(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,r,e.stretchStartingKeyframe);return this.timelines.push(i),r},e.prototype.incrementTime=function(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)},e.prototype.delayNextStep=function(e){e>0&&this.currentTimeline.delayNextStep(e)},e.prototype.invokeQuery=function(e,t,n,r,i,o){var a=[];if(r&&a.push(this.element),e.length>0){e=(e=e.replace(cv,"."+this._enterClassName)).replace(fv,"."+this._leaveClassName);var s=this._driver.query(this.element,e,1!=n);0!==n&&(s=n<0?s.slice(s.length+n,s.length):s.slice(0,n)),a.push.apply(a,c(s))}return i||0!=a.length||o.push('`query("'+t+'")` returned zero elements. (Use `query("'+t+'", { optional: true })` if you wish to allow this.)'),a},e}(),mv=function(){function e(e,t,n,r){this._driver=e,this.element=t,this.startTime=n,this._elementTimelineStylesLookup=r,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}return e.prototype.containsAnimation=function(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}},e.prototype.getCurrentStyleProperties=function(){return Object.keys(this._currentKeyframe)},Object.defineProperty(e.prototype,"currentTime",{get:function(){return this.startTime+this.duration},enumerable:!0,configurable:!0}),e.prototype.delayNextStep=function(e){var t=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e},e.prototype.fork=function(t,n){return this.applyStylesToKeyframe(),new e(this._driver,t,n||this.currentTime,this._elementTimelineStylesLookup)},e.prototype._loadKeyframe=function(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))},e.prototype.forwardFrame=function(){this.duration+=1,this._loadKeyframe()},e.prototype.forwardTime=function(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()},e.prototype._updateStyle=function(e,t){this._localTimelineStyles[e]=t,this._globalTimelineStyles[e]=t,this._styleSummary[e]={time:this.currentTime,value:t}},e.prototype.allowOnlyTimelineStyles=function(){return this._currentEmptyStepKeyframe!==this._currentKeyframe},e.prototype.applyEmptyStep=function(e){var t=this;e&&(this._previousKeyframe.easing=e),Object.keys(this._globalTimelineStyles).forEach(function(e){t._backFill[e]=t._globalTimelineStyles[e]||ey,t._currentKeyframe[e]=ey}),this._currentEmptyStepKeyframe=this._currentKeyframe},e.prototype.setStyles=function(e,t,n,r){var i=this;t&&(this._previousKeyframe.easing=t);var o=r&&r.params||{},a=function(e,t){var n,r={};return e.forEach(function(e){"*"===e?(n=n||Object.keys(t)).forEach(function(e){r[e]=ey}):Dy(e,!1,r)}),r}(e,this._globalTimelineStyles);Object.keys(a).forEach(function(e){var t=qy(a[e],o,n);i._pendingStyles[e]=t,i._localTimelineStyles.hasOwnProperty(e)||(i._backFill[e]=i._globalTimelineStyles.hasOwnProperty(e)?i._globalTimelineStyles[e]:ey),i._updateStyle(e,t)})},e.prototype.applyStylesToKeyframe=function(){var e=this,t=this._pendingStyles,n=Object.keys(t);0!=n.length&&(this._pendingStyles={},n.forEach(function(n){e._currentKeyframe[n]=t[n]}),Object.keys(this._localTimelineStyles).forEach(function(t){e._currentKeyframe.hasOwnProperty(t)||(e._currentKeyframe[t]=e._localTimelineStyles[t])}))},e.prototype.snapshotCurrentStyles=function(){var e=this;Object.keys(this._localTimelineStyles).forEach(function(t){var n=e._localTimelineStyles[t];e._pendingStyles[t]=n,e._updateStyle(t,n)})},e.prototype.getFinalKeyframe=function(){return this._keyframes.get(this.duration)},Object.defineProperty(e.prototype,"properties",{get:function(){var e=[];for(var t in this._currentKeyframe)e.push(t);return e},enumerable:!0,configurable:!0}),e.prototype.mergeTimelineCollectedStyles=function(e){var t=this;Object.keys(e._styleSummary).forEach(function(n){var r=t._styleSummary[n],i=e._styleSummary[n];(!r||i.time>r.time)&&t._updateStyle(n,i.value)})},e.prototype.buildKeyframes=function(){var e=this;this.applyStylesToKeyframe();var t=new Set,n=new Set,r=1===this._keyframes.size&&0===this.duration,i=[];this._keyframes.forEach(function(o,a){var s=Dy(o,!0);Object.keys(s).forEach(function(e){var r=s[e];r==ay?t.add(e):r==ey&&n.add(e)}),r||(s.offset=a/e.duration),i.push(s)});var o=t.size?Hy(t.values()):[],a=n.size?Hy(n.values()):[];if(r){var s=i[0],u=jy(s);s.offset=0,u.offset=1,i=[s,u]}return uv(this.element,i,o,a,this.duration,this.startTime,this.easing,!1)},e}(),yv=function(e){function t(t,n,r,i,o,a,s){void 0===s&&(s=!1);var u=e.call(this,t,n,a.delay)||this;return u.element=n,u.keyframes=r,u.preStyleProps=i,u.postStyleProps=o,u._stretchStartingKeyframe=s,u.timings={duration:a.duration,delay:a.delay,easing:a.easing},u}return i(t,e),t.prototype.containsAnimation=function(){return this.keyframes.length>1},t.prototype.buildKeyframes=function(){var e=this.keyframes,t=this.timings,n=t.delay,r=t.duration,i=t.easing;if(this._stretchStartingKeyframe&&n){var o=[],a=r+n,s=n/a,u=Dy(e[0],!1);u.offset=0,o.push(u);var l=Dy(e[0],!1);l.offset=vv(s),o.push(l);for(var c=e.length-1,f=1;f<=c;f++){var h=Dy(e[f],!1);h.offset=vv((n+h.offset*r)/a),o.push(h)}r=a,n=0,i="",e=o}return uv(this.element,e,this.preStyleProps,this.postStyleProps,r,n,i,!0)},t}(mv);function vv(e,t){void 0===t&&(t=3);var n=Math.pow(10,t-1);return Math.round(e*n)/n}var bv=function(){return function(){}}(),wv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.normalizePropertyName=function(e,t){return $y(e)},t.prototype.normalizeStyleValue=function(e,t,n,r){var i="",o=n.toString().trim();if(_v[t]&&0!==n&&"0"!==n)if("number"==typeof n)i="px";else{var a=n.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&0==a[1].length&&r.push("Please provide a CSS unit value for "+e+":"+n)}return o+i},t}(bv),_v=xv("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(","));function xv(e){var t={};return e.forEach(function(e){return t[e]=!0}),t}function Sv(e,t,n,r,i,o,a,s,u,l,c,f,h){return{type:0,element:e,triggerName:t,isRemovalTransition:i,fromState:n,fromStyles:o,toState:r,toStyles:a,timelines:s,queriedElements:u,preStyleProps:l,postStyleProps:c,totalTime:f,errors:h}}var Ev={},kv=function(){function e(e,t,n){this._triggerName=e,this.ast=t,this._stateStyles=n}return e.prototype.match=function(e,t,n,r){return function(e,t,n,r,i){return e.some(function(e){return e(t,n,r,i)})}(this.ast.matchers,e,t,n,r)},e.prototype.buildStyles=function(e,t,n){var r=this._stateStyles["*"],i=this._stateStyles[e],o=r?r.buildStyles(t,n):{};return i?i.buildStyles(t,n):o},e.prototype.build=function(e,t,n,r,i,a,s,u,l,c){var f=[],h=this.ast.options&&this.ast.options.params||Ev,p=this.buildStyles(n,s&&s.params||Ev,f),d=u&&u.params||Ev,g=this.buildStyles(r,d,f),m=new Set,y=new Map,v=new Map,b="void"===r,w={params:o({},h,d)},_=c?[]:hv(e,t,this.ast.animation,i,a,p,g,w,l,f),x=0;if(_.forEach(function(e){x=Math.max(e.duration+e.delay,x)}),f.length)return Sv(t,this._triggerName,n,r,b,p,g,[],[],y,v,x,f);_.forEach(function(e){var n=e.element,r=py(y,n,{});e.preStyleProps.forEach(function(e){return r[e]=!0});var i=py(v,n,{});e.postStyleProps.forEach(function(e){return i[e]=!0}),n!==t&&m.add(n)});var S=Hy(m.values());return Sv(t,this._triggerName,n,r,b,p,g,_,S,y,v,x)},e}(),Cv=function(){function e(e,t){this.styles=e,this.defaultParams=t}return e.prototype.buildStyles=function(e,t){var n={},r=jy(this.defaultParams);return Object.keys(e).forEach(function(t){var n=e[t];null!=n&&(r[t]=n)}),this.styles.styles.forEach(function(e){if("string"!=typeof e){var i=e;Object.keys(i).forEach(function(e){var o=i[e];o.length>1&&(o=qy(o,r,t)),n[e]=o})}}),n},e}(),Tv=function(){function e(e,t){var n=this;this.name=e,this.ast=t,this.transitionFactories=[],this.states={},t.states.forEach(function(e){n.states[e.name]=new Cv(e.style,e.options&&e.options.params||{})}),Ov(this.states,"true","1"),Ov(this.states,"false","0"),t.transitions.forEach(function(t){n.transitionFactories.push(new kv(e,t,n.states))}),this.fallbackTransition=new kv(e,{type:1,animation:{type:2,steps:[],options:null},matchers:[function(e,t){return!0}],options:null,queryCount:0,depCount:0},this.states)}return Object.defineProperty(e.prototype,"containsQueries",{get:function(){return this.ast.queryCount>0},enumerable:!0,configurable:!0}),e.prototype.matchTransition=function(e,t,n,r){return this.transitionFactories.find(function(i){return i.match(e,t,n,r)})||null},e.prototype.matchStyles=function(e,t,n){return this.fallbackTransition.buildStyles(e,t,n)},e}();function Ov(e,t,n){e.hasOwnProperty(t)?e.hasOwnProperty(n)||(e[n]=e[t]):e.hasOwnProperty(n)&&(e[t]=e[n])}var Iv=new lv,Pv=function(){function e(e,t,n){this.bodyNode=e,this._driver=t,this._normalizer=n,this._animations={},this._playersById={},this.players=[]}return e.prototype.register=function(e,t){var n=[],r=nv(this._driver,t,n);if(n.length)throw new Error("Unable to build the animation due to the following errors: "+n.join("\n"));this._animations[e]=r},e.prototype._buildPlayer=function(e,t,n){var r=e.element,i=ly(0,this._normalizer,0,e.keyframes,t,n);return this._driver.animate(r,i,e.duration,e.delay,e.easing,[],!0)},e.prototype.create=function(e,t,n){var r=this;void 0===n&&(n={});var i,o=[],a=this._animations[e],s=new Map;if(a?(i=hv(this._driver,t,a,"ng-enter","ng-leave",{},{},n,Iv,o)).forEach(function(e){var t=py(s,e.element,{});e.postStyleProps.forEach(function(e){return t[e]=null})}):(o.push("The requested animation doesn't exist or has already been destroyed"),i=[]),o.length)throw new Error("Unable to create the animation due to the following errors: "+o.join("\n"));s.forEach(function(e,t){Object.keys(e).forEach(function(n){e[n]=r._driver.computeStyle(t,n,ey)})});var u=uy(i.map(function(e){var t=s.get(e.element);return r._buildPlayer(e,{},t)}));return this._playersById[e]=u,u.onDestroy(function(){return r.destroy(e)}),this.players.push(u),u},e.prototype.destroy=function(e){var t=this._getPlayer(e);t.destroy(),delete this._playersById[e];var n=this.players.indexOf(t);n>=0&&this.players.splice(n,1)},e.prototype._getPlayer=function(e){var t=this._playersById[e];if(!t)throw new Error("Unable to find the timeline player referenced by "+e);return t},e.prototype.listen=function(e,t,n,r){var i=hy(t,"","","");return cy(this._getPlayer(e),n,i,r),function(){}},e.prototype.command=function(e,t,n,r){if("register"!=n)if("create"!=n){var i=this._getPlayer(e);switch(n){case"play":i.play();break;case"pause":i.pause();break;case"reset":i.reset();break;case"restart":i.restart();break;case"finish":i.finish();break;case"init":i.init();break;case"setPosition":i.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(e)}}else this.create(e,t,r[0]||{});else this.register(e,r[0])},e}(),Av=[],Nv={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Rv={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},jv="__ng_removed",Dv=function(){function e(e,t){void 0===t&&(t=""),this.namespaceId=t;var n=e&&e.hasOwnProperty("value");if(this.value=function(e){return null!=e?e:null}(n?e.value:e),n){var r=jy(e);delete r.value,this.options=r}else this.options={};this.options.params||(this.options.params={})}return Object.defineProperty(e.prototype,"params",{get:function(){return this.options.params},enumerable:!0,configurable:!0}),e.prototype.absorbOptions=function(e){var t=e.params;if(t){var n=this.options.params;Object.keys(t).forEach(function(e){null==n[e]&&(n[e]=t[e])})}},e}(),Mv=new Dv("void"),Lv=function(){function e(e,t,n){this.id=e,this.hostElement=t,this._engine=n,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,Wv(t,this._hostClassName)}return e.prototype.listen=function(e,t,n,r){var i,o=this;if(!this._triggers.hasOwnProperty(t))throw new Error('Unable to listen on the animation trigger event "'+n+'" because the animation trigger "'+t+"\" doesn't exist!");if(null==n||0==n.length)throw new Error('Unable to listen on the animation trigger "'+t+'" because the provided event is undefined!');if("start"!=(i=n)&&"done"!=i)throw new Error('The provided animation trigger event "'+n+'" for the animation trigger "'+t+'" is not supported!');var a=py(this._elementListeners,e,[]),s={name:t,phase:n,callback:r};a.push(s);var u=py(this._engine.statesByElement,e,{});return u.hasOwnProperty(t)||(Wv(e,"ng-trigger"),Wv(e,"ng-trigger-"+t),u[t]=Mv),function(){o._engine.afterFlush(function(){var e=a.indexOf(s);e>=0&&a.splice(e,1),o._triggers[t]||delete u[t]})}},e.prototype.register=function(e,t){return!this._triggers[e]&&(this._triggers[e]=t,!0)},e.prototype._getTrigger=function(e){var t=this._triggers[e];if(!t)throw new Error('The provided animation trigger "'+e+'" has not been registered!');return t},e.prototype.trigger=function(e,t,n,r){var i=this;void 0===r&&(r=!0);var o=this._getTrigger(t),a=new Fv(this.id,t,e),s=this._engine.statesByElement.get(e);s||(Wv(e,"ng-trigger"),Wv(e,"ng-trigger-"+t),this._engine.statesByElement.set(e,s={}));var u=s[t],l=new Dv(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&u&&l.absorbOptions(u.options),s[t]=l,u||(u=Mv),"void"===l.value||u.value!==l.value){var c=py(this._engine.playersByElement,e,[]);c.forEach(function(e){e.namespaceId==i.id&&e.triggerName==t&&e.queued&&e.destroy()});var f=o.matchTransition(u.value,l.value,e,l.params),h=!1;if(!f){if(!r)return;f=o.fallbackTransition,h=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:f,fromState:u,toState:l,player:a,isFallbackTransition:h}),h||(Wv(e,"ng-animate-queued"),a.onStart(function(){$v(e,"ng-animate-queued")})),a.onDone(function(){var t=i.players.indexOf(a);t>=0&&i.players.splice(t,1);var n=i._engine.playersByElement.get(e);if(n){var r=n.indexOf(a);r>=0&&n.splice(r,1)}}),this.players.push(a),c.push(a),a}if(!function(e,t){var n=Object.keys(e),r=Object.keys(t);if(n.length!=r.length)return!1;for(var i=0;i=0){for(var r=!1,i=n;i>=0;i--)if(this.driver.containsElement(this._namespaceList[i].hostElement,t)){this._namespaceList.splice(i+1,0,e),r=!0;break}r||this._namespaceList.splice(0,0,e)}else this._namespaceList.push(e);return this.namespacesByHostElement.set(t,e),e},e.prototype.register=function(e,t){var n=this._namespaceLookup[e];return n||(n=this.createNamespace(e,t)),n},e.prototype.registerTrigger=function(e,t,n){var r=this._namespaceLookup[e];r&&r.register(t,n)&&this.totalAnimations++},e.prototype.destroy=function(e,t){var n=this;if(e){var r=this._fetchNamespace(e);this.afterFlush(function(){n.namespacesByHostElement.delete(r.hostElement),delete n._namespaceLookup[e];var t=n._namespaceList.indexOf(r);t>=0&&n._namespaceList.splice(t,1)}),this.afterFlushAnimationsDone(function(){return r.destroy(t)})}},e.prototype._fetchNamespace=function(e){return this._namespaceLookup[e]},e.prototype.fetchNamespacesByElement=function(e){var t=new Set,n=this.statesByElement.get(e);if(n)for(var r=Object.keys(n),i=0;i=0&&this.collectedLeaveElements.splice(o,1)}if(e){var a=this._fetchNamespace(e);a&&a.insertNode(t,n)}r&&this.collectEnterElement(t)}},e.prototype.collectEnterElement=function(e){this.collectedEnterElements.push(e)},e.prototype.markElementAsDisabled=function(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),Wv(e,"ng-animate-disabled")):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),$v(e,"ng-animate-disabled"))},e.prototype.removeNode=function(e,t,n){if(Vv(t)){var r=e?this._fetchNamespace(e):null;r?r.removeNode(t,n):this.markElementAsRemoved(e,t,!1,n)}else this._onRemovalComplete(t,n)},e.prototype.markElementAsRemoved=function(e,t,n,r){this.collectedLeaveElements.push(t),t[jv]={namespaceId:e,setForRemoval:r,hasAnimation:n,removedBeforeQueried:!1}},e.prototype.listen=function(e,t,n,r,i){return Vv(t)?this._fetchNamespace(e).listen(t,n,r,i):function(){}},e.prototype._buildInstruction=function(e,t,n,r,i){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,n,r,e.fromState.options,e.toState.options,t,i)},e.prototype.destroyInnerAnimations=function(e){var t=this,n=this.driver.query(e,".ng-trigger",!0);n.forEach(function(e){return t.destroyActiveAnimationsForElement(e)}),0!=this.playersByQueriedElement.size&&(n=this.driver.query(e,".ng-animating",!0)).forEach(function(e){return t.finishActiveQueriedAnimationOnElement(e)})},e.prototype.destroyActiveAnimationsForElement=function(e){var t=this.playersByElement.get(e);t&&t.forEach(function(e){e.queued?e.markedForDestroy=!0:e.destroy()})},e.prototype.finishActiveQueriedAnimationOnElement=function(e){var t=this.playersByQueriedElement.get(e);t&&t.forEach(function(e){return e.finish()})},e.prototype.whenRenderingDone=function(){var e=this;return new Promise(function(t){if(e.players.length)return uy(e.players).onDone(function(){return t()});t()})},e.prototype.processLeaveNode=function(e){var t=this,n=e[jv];if(n&&n.setForRemoval){if(e[jv]=Nv,n.namespaceId){this.destroyInnerAnimations(e);var r=this._fetchNamespace(n.namespaceId);r&&r.clearElementCache(e)}this._onRemovalComplete(e,n.setForRemoval)}this.driver.matchesElement(e,".ng-animate-disabled")&&this.markElementAsDisabled(e,!1),this.driver.query(e,".ng-animate-disabled",!0).forEach(function(n){t.markElementAsDisabled(e,!1)})},e.prototype.flush=function(e){var t=this;void 0===e&&(e=-1);var n=[];if(this.newHostElements.size&&(this.newHostElements.forEach(function(e,n){return t._balanceNamespaceList(e,n)}),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(var r=0;r=0;C--)this._namespaceList[C].drainQueuedTransitions(t).forEach(function(e){var t=e.player,o=e.element;if(E.push(t),n.collectedEnterElements.length){var a=o[jv];if(a&&a.setForMove)return void t.destroy()}var c=!p||!n.driver.containsElement(p,o),h=x.get(o),d=m.get(o),g=n._buildInstruction(e,r,d,h,c);if(g.errors&&g.errors.length)k.push(g);else{if(c)return t.onStart(function(){return Fy(o,g.fromStyles)}),t.onDestroy(function(){return Uy(o,g.toStyles)}),void i.push(t);if(e.isFallbackTransition)return t.onStart(function(){return Fy(o,g.fromStyles)}),t.onDestroy(function(){return Uy(o,g.toStyles)}),void i.push(t);g.timelines.forEach(function(e){return e.stretchStartingKeyframe=!0}),r.append(o,g.timelines),s.push({instruction:g,player:t,element:o}),g.queriedElements.forEach(function(e){return py(u,e,[]).push(t)}),g.preStyleProps.forEach(function(e,t){var n=Object.keys(e);if(n.length){var r=l.get(t);r||l.set(t,r=new Set),n.forEach(function(e){return r.add(e)})}}),g.postStyleProps.forEach(function(e,t){var n=Object.keys(e),r=f.get(t);r||f.set(t,r=new Set),n.forEach(function(e){return r.add(e)})})}});if(k.length){var T=[];k.forEach(function(e){T.push("@"+e.triggerName+" has failed due to:\n"),e.errors.forEach(function(e){return T.push("- "+e+"\n")})}),E.forEach(function(e){return e.destroy()}),this.reportError(T)}var O=new Map,I=new Map;s.forEach(function(e){var t=e.element;r.has(t)&&(I.set(t,t),n._beforeAnimationBuild(e.player.namespaceId,e.instruction,O))}),i.forEach(function(e){var t=e.element;n._getPreviousPlayers(t,!1,e.namespaceId,e.triggerName,null).forEach(function(e){py(O,t,[]).push(e),e.destroy()})});var P=v.filter(function(e){return Jv(e,l,f)}),A=new Map;zv(A,this.driver,w,f,ey).forEach(function(e){Jv(e,l,f)&&P.push(e)});var N=new Map;g.forEach(function(e,t){zv(N,n.driver,new Set(e),l,ay)}),P.forEach(function(e){var t=A.get(e),n=N.get(e);A.set(e,o({},t,n))});var R=[],j=[],D={};s.forEach(function(e){var t=e.element,o=e.player,s=e.instruction;if(r.has(t)){if(h.has(t))return o.onDestroy(function(){return Uy(t,s.toStyles)}),o.disabled=!0,o.overrideTotalTime(s.totalTime),void i.push(o);var u=D;if(I.size>1){for(var l=t,c=[];l=l.parentNode;){var f=I.get(l);if(f){u=f;break}c.push(l)}c.forEach(function(e){return I.set(e,u)})}var p=n._buildAnimation(o.namespaceId,s,O,a,N,A);if(o.setRealPlayer(p),u===D)R.push(o);else{var d=n.playersByElement.get(u);d&&d.length&&(o.parentPlayer=uy(d)),i.push(o)}}else Fy(t,s.fromStyles),o.onDestroy(function(){return Uy(t,s.toStyles)}),j.push(o),h.has(t)&&i.push(o)}),j.forEach(function(e){var t=a.get(e.element);if(t&&t.length){var n=uy(t);e.setRealPlayer(n)}}),i.forEach(function(e){e.parentPlayer?e.syncPlayerEvents(e.parentPlayer):e.destroy()});for(var M=0;M0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,n):new iy(e.duration,e.delay)},e}(),Fv=function(){function e(e,t,n){this.namespaceId=e,this.triggerName=t,this.element=n,this._player=new iy,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}return e.prototype.setRealPlayer=function(e){var t=this;this._containsRealPlayer||(this._player=e,Object.keys(this._queuedCallbacks).forEach(function(n){t._queuedCallbacks[n].forEach(function(t){return cy(e,n,void 0,t)})}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)},e.prototype.getRealPlayer=function(){return this._player},e.prototype.overrideTotalTime=function(e){this.totalTime=e},e.prototype.syncPlayerEvents=function(e){var t=this,n=this._player;n.triggerCallback&&e.onStart(function(){return n.triggerCallback("start")}),e.onDone(function(){return t.finish()}),e.onDestroy(function(){return t.destroy()})},e.prototype._queueEvent=function(e,t){py(this._queuedCallbacks,e,[]).push(t)},e.prototype.onDone=function(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)},e.prototype.onStart=function(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)},e.prototype.onDestroy=function(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)},e.prototype.init=function(){this._player.init()},e.prototype.hasStarted=function(){return!this.queued&&this._player.hasStarted()},e.prototype.play=function(){!this.queued&&this._player.play()},e.prototype.pause=function(){!this.queued&&this._player.pause()},e.prototype.restart=function(){!this.queued&&this._player.restart()},e.prototype.finish=function(){this._player.finish()},e.prototype.destroy=function(){this.destroyed=!0,this._player.destroy()},e.prototype.reset=function(){!this.queued&&this._player.reset()},e.prototype.setPosition=function(e){this.queued||this._player.setPosition(e)},e.prototype.getPosition=function(){return this.queued?0:this._player.getPosition()},e.prototype.triggerCallback=function(e){var t=this._player;t.triggerCallback&&t.triggerCallback(e)},e}();function Vv(e){return e&&1===e.nodeType}function Bv(e,t){var n=e.style.display;return e.style.display=null!=t?t:"none",n}function zv(e,t,n,r,i){var o=[];n.forEach(function(e){return o.push(Bv(e))});var a=[];r.forEach(function(n,r){var o={};n.forEach(function(e){var n=o[e]=t.computeStyle(r,e,i);n&&0!=n.length||(r[jv]=Rv,a.push(r))}),e.set(r,o)});var s=0;return n.forEach(function(e){return Bv(e,o[s++])}),a}function qv(e,t){var n=new Map;if(e.forEach(function(e){return n.set(e,[])}),0==t.length)return n;var r=new Set(t),i=new Map;return t.forEach(function(e){var t=function e(t){if(!t)return 1;var o=i.get(t);if(o)return o;var a=t.parentNode;return o=n.has(a)?a:r.has(a)?1:e(a),i.set(t,o),o}(e);1!==t&&n.get(t).push(e)}),n}var Hv="$$classes";function Wv(e,t){if(e.classList)e.classList.add(t);else{var n=e[Hv];n||(n=e[Hv]={}),n[t]=!0}}function $v(e,t){if(e.classList)e.classList.remove(t);else{var n=e[Hv];n&&delete n[t]}}function Gv(e,t,n){uy(n).onDone(function(){return e.processLeaveNode(t)})}function Jv(e,t,n){var r=n.get(e);if(!r)return!1;var i=t.get(e);return i?r.forEach(function(e){return i.add(e)}):t.set(e,r),n.delete(e),!0}var Kv=function(){function e(e,t,n){var r=this;this.bodyNode=e,this._driver=t,this._triggerCache={},this.onRemovalComplete=function(e,t){},this._transitionEngine=new Uv(e,t,n),this._timelineEngine=new Pv(e,t,n),this._transitionEngine.onRemovalComplete=function(e,t){return r.onRemovalComplete(e,t)}}return e.prototype.registerTrigger=function(e,t,n,r,i){var o=e+"-"+r,a=this._triggerCache[o];if(!a){var s=[],u=nv(this._driver,i,s);if(s.length)throw new Error('The animation trigger "'+r+'" has failed to build due to the following errors:\n - '+s.join("\n - "));a=function(e,t){return new Tv(e,t)}(r,u),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,r,a)},e.prototype.register=function(e,t){this._transitionEngine.register(e,t)},e.prototype.destroy=function(e,t){this._transitionEngine.destroy(e,t)},e.prototype.onInsert=function(e,t,n,r){this._transitionEngine.insertNode(e,t,n,r)},e.prototype.onRemove=function(e,t,n){this._transitionEngine.removeNode(e,t,n)},e.prototype.disableAnimations=function(e,t){this._transitionEngine.markElementAsDisabled(e,t)},e.prototype.process=function(e,t,n,r){if("@"==n.charAt(0)){var i=l(dy(n),2);this._timelineEngine.command(i[0],t,i[1],r)}else this._transitionEngine.trigger(e,t,n,r)},e.prototype.listen=function(e,t,n,r,i){if("@"==n.charAt(0)){var o=l(dy(n),2);return this._timelineEngine.listen(o[0],t,o[1],i)}return this._transitionEngine.listen(e,t,n,r,i)},e.prototype.flush=function(e){void 0===e&&(e=-1),this._transitionEngine.flush(e)},Object.defineProperty(e.prototype,"players",{get:function(){return this._transitionEngine.players.concat(this._timelineEngine.players)},enumerable:!0,configurable:!0}),e.prototype.whenRenderingDone=function(){return this._transitionEngine.whenRenderingDone()},e}(),Qv="animation",Yv="animationend",Zv=function(){function e(e,t,n,r,i,o,a){var s=this;this._element=e,this._name=t,this._duration=n,this._delay=r,this._easing=i,this._fillMode=o,this._onDoneFn=a,this._finished=!1,this._destroyed=!1,this._startTime=0,this._position=0,this._eventFn=function(e){return s._handleCallback(e)}}return e.prototype.apply=function(){var e,t,n;t=this._duration+"ms "+this._easing+" "+this._delay+"ms 1 normal "+this._fillMode+" "+this._name,(n=ib(e=this._element,"").trim()).length&&(function(e,t){for(var n=0;n=this._delay&&n>=this._duration&&this.finish()},e.prototype.finish=function(){this._finished||(this._finished=!0,this._onDoneFn(),nb(this._element,this._eventFn,!0))},e.prototype.destroy=function(){var e,t,n,r;this._destroyed||(this._destroyed=!0,this.finish(),t=this._name,(r=tb(n=ib(e=this._element,"").split(","),t))>=0&&(n.splice(r,1),rb(e,"",n.join(","))))},e}();function Xv(e,t,n){rb(e,"PlayState",n,eb(e,t))}function eb(e,t){var n=ib(e,"");return n.indexOf(",")>0?tb(n.split(","),t):tb([n],t)}function tb(e,t){for(var n=0;n=0)return n;return-1}function nb(e,t,n){n?e.removeEventListener(Yv,t):e.addEventListener(Yv,t)}function rb(e,t,n,r){var i=Qv+t;if(null!=r){var o=e.style[i];if(o.length){var a=o.split(",");a[r]=n,n=a.join(",")}}e.style[i]=n}function ib(e,t){return e.style[Qv+t]}var ob="linear",ab=function(){function e(e,t,n,r,i,o,a){this.element=e,this.keyframes=t,this.animationName=n,this._duration=r,this._delay=i,this._finalStyles=a,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this.currentSnapshot={},this._state=0,this.easing=o||ob,this.totalTime=r+i,this._buildStyler()}return e.prototype.onStart=function(e){this._onStartFns.push(e)},e.prototype.onDone=function(e){this._onDoneFns.push(e)},e.prototype.onDestroy=function(e){this._onDestroyFns.push(e)},e.prototype.destroy=function(){this.init(),this._state>=4||(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._onDestroyFns.forEach(function(e){return e()}),this._onDestroyFns=[])},e.prototype._flushDoneFns=function(){this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[]},e.prototype._flushStartFns=function(){this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[]},e.prototype.finish=function(){this.init(),this._state>=3||(this._state=3,this._styler.finish(),this._flushStartFns(),this._flushDoneFns())},e.prototype.setPosition=function(e){this._styler.setPosition(e)},e.prototype.getPosition=function(){return this._styler.getPosition()},e.prototype.hasStarted=function(){return this._state>=2},e.prototype.init=function(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())},e.prototype.play=function(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2),this._styler.resume()},e.prototype.pause=function(){this.init(),this._styler.pause()},e.prototype.restart=function(){this.reset(),this.play()},e.prototype.reset=function(){this._styler.destroy(),this._buildStyler(),this._styler.apply()},e.prototype._buildStyler=function(){var e=this;this._styler=new Zv(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",function(){return e.finish()})},e.prototype.triggerCallback=function(e){var t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(function(e){return e()}),t.length=0},e.prototype.beforeDestroy=function(){var e=this;this.init();var t={};if(this.hasStarted()){var n=this._state>=3;Object.keys(this._finalStyles).forEach(function(r){"offset"!=r&&(t[r]=n?e._finalStyles[r]:Qy(e.element,r))})}this.currentSnapshot=t},e}(),sb=function(e){function t(t,n){var r=e.call(this)||this;return r.element=t,r._startingStyles={},r.__initialized=!1,r._styles=Ty(n),r}return i(t,e),t.prototype.init=function(){var t=this;!this.__initialized&&this._startingStyles&&(this.__initialized=!0,Object.keys(this._styles).forEach(function(e){t._startingStyles[e]=t.element.style[e]}),e.prototype.init.call(this))},t.prototype.play=function(){var t=this;this._startingStyles&&(this.init(),Object.keys(this._styles).forEach(function(e){return t.element.style.setProperty(e,t._styles[e])}),e.prototype.play.call(this))},t.prototype.destroy=function(){var t=this;this._startingStyles&&(Object.keys(this._startingStyles).forEach(function(e){var n=t._startingStyles[e];n?t.element.style.setProperty(e,n):t.element.style.removeProperty(e)}),this._startingStyles=null,e.prototype.destroy.call(this))},t}(iy),ub=function(){function e(){this._count=0,this._head=document.querySelector("head"),this._warningIssued=!1}return e.prototype.validateStyleProperty=function(e){return Sy(e)},e.prototype.matchesElement=function(e,t){return Ey(e,t)},e.prototype.containsElement=function(e,t){return ky(e,t)},e.prototype.query=function(e,t,n){return Cy(e,t,n)},e.prototype.computeStyle=function(e,t,n){return window.getComputedStyle(e)[t]},e.prototype.buildKeyframeElement=function(e,t,n){n=n.map(function(e){return Ty(e)});var r="@keyframes "+t+" {\n",i="";n.forEach(function(e){i=" ";var t=parseFloat(e.offset);r+=""+i+100*t+"% {\n",i+=" ",Object.keys(e).forEach(function(t){var n=e[t];switch(t){case"offset":return;case"easing":return void(n&&(r+=i+"animation-timing-function: "+n+";\n"));default:return void(r+=""+i+t+": "+n+";\n")}}),r+=i+"}\n"}),r+="}\n";var o=document.createElement("style");return o.innerHTML=r,o},e.prototype.animate=function(e,t,n,r,i,o,a){void 0===o&&(o=[]),a&&this._notifyFaultyScrubber();var s=o.filter(function(e){return e instanceof ab}),u={};Gy(n,r)&&s.forEach(function(e){var t=e.currentSnapshot;Object.keys(t).forEach(function(e){return u[e]=t[e]})});var l=function(e){var t={};return e&&(Array.isArray(e)?e:[e]).forEach(function(e){Object.keys(e).forEach(function(n){"offset"!=n&&"easing"!=n&&(t[n]=e[n])})}),t}(t=Jy(e,t,u));if(0==n)return new sb(e,l);var c="gen_css_kf_"+this._count++,f=this.buildKeyframeElement(e,c,t);document.querySelector("head").appendChild(f);var h=new ab(e,t,c,n,r,i,l);return h.onDestroy(function(){var e;(e=f).parentNode.removeChild(e)}),h},e.prototype._notifyFaultyScrubber=function(){this._warningIssued||(console.warn("@angular/animations: please load the web-animations.js polyfill to allow programmatic access...\n"," visit http://bit.ly/IWukam to learn more about using the web-animation-js polyfill."),this._warningIssued=!0)},e}(),lb=function(){function e(e,t,n){this.element=e,this.keyframes=t,this.options=n,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}return e.prototype._onFinish=function(){this._finished||(this._finished=!0,this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[])},e.prototype.init=function(){this._buildPlayer(),this._preparePlayerBeforeStart()},e.prototype._buildPlayer=function(){var e=this;if(!this._initialized){this._initialized=!0;var t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:{},this.domPlayer.addEventListener("finish",function(){return e._onFinish()})}},e.prototype._preparePlayerBeforeStart=function(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()},e.prototype._triggerWebAnimation=function(e,t,n){return e.animate(t,n)},e.prototype.onStart=function(e){this._onStartFns.push(e)},e.prototype.onDone=function(e){this._onDoneFns.push(e)},e.prototype.onDestroy=function(e){this._onDestroyFns.push(e)},e.prototype.play=function(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[],this._started=!0),this.domPlayer.play()},e.prototype.pause=function(){this.init(),this.domPlayer.pause()},e.prototype.finish=function(){this.init(),this._onFinish(),this.domPlayer.finish()},e.prototype.reset=function(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1},e.prototype._resetDomPlayerState=function(){this.domPlayer&&this.domPlayer.cancel()},e.prototype.restart=function(){this.reset(),this.play()},e.prototype.hasStarted=function(){return this._started},e.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._onDestroyFns.forEach(function(e){return e()}),this._onDestroyFns=[])},e.prototype.setPosition=function(e){this.domPlayer.currentTime=e*this.time},e.prototype.getPosition=function(){return this.domPlayer.currentTime/this.time},Object.defineProperty(e.prototype,"totalTime",{get:function(){return this._delay+this._duration},enumerable:!0,configurable:!0}),e.prototype.beforeDestroy=function(){var e=this,t={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(function(n){"offset"!=n&&(t[n]=e._finished?e._finalKeyframe[n]:Qy(e.element,n))}),this.currentSnapshot=t},e.prototype.triggerCallback=function(e){var t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(function(e){return e()}),t.length=0},e}(),cb=function(){function e(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(fb().toString()),this._cssKeyframesDriver=new ub}return e.prototype.validateStyleProperty=function(e){return Sy(e)},e.prototype.matchesElement=function(e,t){return Ey(e,t)},e.prototype.containsElement=function(e,t){return ky(e,t)},e.prototype.query=function(e,t,n){return Cy(e,t,n)},e.prototype.computeStyle=function(e,t,n){return window.getComputedStyle(e)[t]},e.prototype.overrideWebAnimationsSupport=function(e){this._isNativeImpl=e},e.prototype.animate=function(e,t,n,r,i,o,a){if(void 0===o&&(o=[]),!a&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(e,t,n,r,i,o);var s={duration:n,delay:r,fill:0==r?"both":"forwards"};i&&(s.easing=i);var u={},l=o.filter(function(e){return e instanceof lb});return Gy(n,r)&&l.forEach(function(e){var t=e.currentSnapshot;Object.keys(t).forEach(function(e){return u[e]=t[e]})}),t=Jy(e,t=t.map(function(e){return Dy(e,!1)}),u),new lb(e,t,s)},e}();function fb(){return"undefined"!=typeof window&&void 0!==window.document&&Element.prototype.animate||{}}var hb=function(e){function t(t,n){var r=e.call(this)||this;return r._nextAnimationId=0,r._renderer=t.createRenderer(n.body,{id:"0",encapsulation:st.None,styles:[],data:{animation:[]}}),r}return i(t,e),t.prototype.build=function(e){var t=this._nextAnimationId.toString();this._nextAnimationId++;var n=Array.isArray(e)?ty(e):e;return gb(this._renderer,null,t,"register",[n]),new pb(t,this._renderer)},t}(Zm),pb=function(e){function t(t,n){var r=e.call(this)||this;return r._id=t,r._renderer=n,r}return i(t,e),t.prototype.create=function(e,t){return new db(this._id,e,t||{},this._renderer)},t}(Xm),db=function(){function e(e,t,n,r){this.id=e,this.element=t,this._renderer=r,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",n)}return e.prototype._listen=function(e,t){return this._renderer.listen(this.element,"@@"+this.id+":"+e,t)},e.prototype._command=function(e){for(var t=[],n=1;n=0&&e=0&&n"}},{key:"uri",get:function(){return this.value},set:function(e){this.value=e}}])&&i(n.prototype,r),u&&i(n,u),t}();c.termType="NamedNode",c.prototype.classOrder=u.NamedNode,c.prototype.isVar=0,e.exports=c},function(e,t,n){"use strict";var r=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t;return(t=[{key:"substitute",value:function(e){return console.log("@@@ node substitute"+this),this}},{key:"compareTerm",value:function(e){return this.classOrdere.classOrder?1:this.valuee.value?1:0}},{key:"equals",value:function(e){return!!e&&this.termType===e.termType&&this.value===e.value}},{key:"hashString",value:function(){return this.toCanonical()}},{key:"sameTerm",value:function(e){return this.equals(e)}},{key:"toCanonical",value:function(){return this.toNT()}},{key:"toNT",value:function(){return this.toString()}},{key:"toString",value:function(){throw new Error("Node.toString() is abstract - see the subclasses instead")}}])&&function(e,t){for(var n=0;n0&&(t=t.slice(0,u)),0===e.length)return t;if(0===e.indexOf("#"))return t+e;if(e.indexOf(":")>=0)return e;if(n=t.indexOf(":"),0===t.length)return e;if(n<0)return r("Invalid base: "+t+" in join with given: "+e),e;if(i=t.slice(0,+n+1||9e9),0===e.indexOf("//"))return i+e;if(t.indexOf("//",n)===n+1){if((o=t.indexOf("/",n+3))<0)return t.length-n-3>0?t+"/"+e:i+e}else if((o=t.indexOf("/",n+1))<0)return t.length-n-1>0?t+"/"+e:i+e;if(0===e.indexOf("/"))return t.slice(0,o)+e;if((a=(s=t.slice(o)).lastIndexOf("/"))<0)return i+e;for(a>=0&&a0&&"/"!==t[n-1];)n--;if(n<3)return t;if(e.indexOf("//",n-2)>0||t.indexOf("//",n-2)>0)return t;if(e.indexOf(":",n)>0)return t;for(s=0,l=0,a=(f=e.slice(n)).length;l0)for(c=1,h=s;h>=1?c<=h:c>=h;h>=1?++c:--c)p+="../";return p+t.slice(n)};var i=n(2);function o(e){var t;return(t=e.indexOf("#"))<0?e:e.slice(0,t)}},function(e,t,n){"use strict";var r={BlankNode:n(9),Collection:n(20),convert:n(42),DataFactory:n(23),Empty:n(86),Fetcher:n(36),Formula:n(59),Store:n(18),jsonParser:n(87),Literal:n(15),log:n(13),N3Parser:n(27),NamedNode:n(2),Namespace:n(19),Node:n(3),parse:n(60),Query:n(26).Query,queryToSPARQL:n(88),RDFaProcessor:n(39),RDFParser:n(40),serialize:n(37),Serializer:n(38),SPARQLToQuery:n(89),sparqlUpdateParser:n(61),Statement:n(24),term:n(3).fromValue,UpdateManager:n(90),UpdatesSocket:n(62).UpdatesSocket,UpdatesVia:n(62).UpdatesVia,uri:n(4),Util:n(7),Variable:n(25)};r.IndexedFormula=r.Store,r.NextId=r.BlankNode.nextId,r.fromNT=r.Formula.prototype.fromNT,r.fetcher=r.DataFactory.fetcher,r.graph=r.DataFactory.graph,r.lit=r.DataFactory.lit,r.st=r.DataFactory.st,r.sym=r.DataFactory.namedNode,r.variable=r.DataFactory.variable,r.blankNode=r.DataFactory.blankNode,r.defaultGraph=r.DataFactory.defaultGraph,r.literal=r.DataFactory.literal,r.namedNode=r.DataFactory.namedNode,r.quad=r.DataFactory.quad,r.triple=r.DataFactory.triple,e.exports=r},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";(function(e){var t=n(4).docpart,r=n(13),i=n(2);function o(e,t,n,r){var i,a="",s=[!1];if(void 0===e.nodeType)return a;if(1===e.nodeType){if(e.hasAttribute("class")&&"classWithChildText"in t&&e.matches(t.classWithChildText.class))a+=e.querySelector(t.classWithChildText.element).textContent;else if(!("skipNodeWithClass"in t&&e.matches("."+t.skipNodeWithClass))){var u=e.nodeName.toLowerCase();a+="<"+u;var l=[];for(i=e.attributes.length-1;i>=0;i--){var c=e.attributes[i];if(!(r.length>0&&r[c.name]||/^\d+$/.test(c.name))){if("class"===c.name&&"replaceClassItemWith"in t&&c.value.split(" ").indexOf(t.replaceClassItemWith.source)>-1){var f=new RegExp(t.replaceClassItemWith.source,"g");c.value=c.value.replace(f,t.replaceClassItemWith.target).trim()}"class"===c.name&&"skipClassWithValue"in t&&t.skipClassWithValue===c.value||l.push(c.name+"='"+c.value.replace(/&/g,"&").replace(//g,">").replace(/'/g,""")+"'")}}if(l.length>0&&("sortAttributes"in t&&t.sortAttributes&&l.sort(function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())}),a+=" "+l.join(" ")),n[u])a+=" />";else{for(a+=">",a+="html"===u?"\n ":"",s.push("style"===u||"script"===u),i=0;i\n":""}}}else if(8===e.nodeType)a+="\x3c!--"+e.nodeValue+"--\x3e";else if(3===e.nodeType||4===e.nodeType){var h=e.nodeValue.replace(/\n+$/,"");a+=s[s.length-1]?h:h.replace(/&/g,"&").replace(//g,">")}else console.log("Warning; Cannot handle serialising nodes of type: "+e.nodeType),console.log(e);return a}function a(e,t,n,r){var i=function(e){return"BlankNode"===e.termType?null:e},o=function(e){var t=n.statementsMatching(e).map(function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)}).concat(n.statementsMatching(void 0,void 0,e).map(function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)}));return t.sort(),t.join("\n")};return"BlankNode"===e.termType&&"BlankNode"===t.termType?0===e.compareTerm(t)?0:o(e)>o(t)?1:o(e) to <"+u+">"),o.fetch(u,{referringTerm:i})}},e.exports.ArrayIndexOf=function(e,t,n){n||(n=0);var r=e.length;for(n<0&&(n=r+n);n=0;n--)e.callbacks[t[n]]=[];e.addHook=function(t){e.callbacks[t]||(e.callbacks[t]=[])},e.addCallback=function(t,n){e.callbacks[t].push(n)},e.removeCallback=function(t,n){for(var r=0;r=0;r--)(i=e.callbacks[t][r])&&i.apply(e,n)&&o.push(i);for(r=o.length-1;r>=0;r--)a.push(o[r]);for(r=s;r-1)break;"("==o.charAt(0)&&(o="function"+o);var a=o.split("@");r.push(a)}for(i=0;i1)for(var n=1;ne.classOrder?1:this.ide.id?1:0}},{key:"copy",value:function(e){var n=new t;return e.copyTo(this,n),n}},{key:"toCanonical",value:function(){return"_:"+this.value}},{key:"toString",value:function(){return t.NTAnonymousNodePrefix+this.id}}])&&function(e,t){for(var n=0;n=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(66),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(6))},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(52).Buffer)},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n1?r("Patch ambiguous. No patch done."):(s=c[0],void u(r))})}else u(r)}},{key:"declareExistential",value:function(e){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(e),e}},{key:"initPropertyActions",value:function(e){this.propertyActions[""]=[m],u(e,"sameAs")>=0&&(this.propertyActions[""]=[function(e,t,n,r,i){return e.equate(t,r),!0}]),u(e,"InverseFunctionalProperty")>=0&&(this.classActions[""]=[function(e,t,n,r,i){return e.newPropertyAction(t,g)}]),u(e,"FunctionalProperty")>=0&&(this.classActions[""]=[function(e,t,n,r,i){return e.newPropertyAction(t,d)}])}},{key:"add",value:function(e,n,r,i){var o,a,s;if(1===arguments.length){if(e instanceof Array)for(o=0;o";return!!this.subjectIndex[t]||!!this.objectIndex[t]||!!this.predicateIndex[t]}},{key:"newExistential",value:function(e){if(!e)return this.bnode();var t=this.sym(e);return this.declareExistential(t)}},{key:"newPropertyAction",value:function(e,t){var n=e.hashString();this.propertyActions[n]||(this.propertyActions[n]=[]),this.propertyActions[n].push(t);for(var r=this.statementsMatching(void 0,e,void 0),i=!1,o=0;o1&&(a=a.slice(0,1)),a||[];var p,d,g=1e10;for(d=0;d0&&e.forEach(function(e){n.elements.push(l.fromValue(e))}),n}var n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(t,l),(n=[{key:"append",value:function(e){return this.elements.push(e)}},{key:"close",value:function(){return this.closed=!0,this.closed}},{key:"shift",value:function(){return this.elements.shift()}},{key:"substitute",value:function(e){return new t(this.elements.map(function(t){t.substitute(e)}))}},{key:"toNT",value:function(){return s.NTAnonymousNodePrefix+this.id}},{key:"toString",value:function(){return"("+this.elements.join(" ")+")"}},{key:"unshift",value:function(e){return this.elements.unshift(e)}}])&&function(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"";return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=i(this,o(t).call(this))).termType=t.termType,e.value=n,e.base="varid:",e.uri=l.join(n,e.base),e}var n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(t,u),(n=[{key:"equals",value:function(e){return!!e&&this.termType===e.termType&&this.value===e.value}},{key:"hashString",value:function(){return this.toString()}},{key:"substitute",value:function(e){var t;return null!=(t=e[this.toNT()])?t:this}},{key:"toString",value:function(){return this.uri.slice(0,this.base.length)===this.base?"?"+this.uri.slice(this.base.length):"?"+this.uri}}])&&function(e,t){for(var n=0;n "+e[t]);return n},u=function(e){var t,n="Bindings: ",r=e.length;for(t=0;ti.length)&&(t.index=i)}}return null===t.index&&(t.index=e.statements),!0};function m(e,t){return e.nvars!==t.nvars?e.nvars-t.nvars:e.index.length-t.index.length}var y=function e(n,r,a,u,l,c,f){i.debug("Match begins, Branch count now: "+f.count+" for "+f.pattern_debug);var p,g,m=n.fetcher?n.fetcher:null,y=r.statements;if(0===y.length){if(i.debug("FOUND MATCH WITH BINDINGS:"+s(a)),0===r.optional.length)f.reportMatch(a);else{i.debug("OPTIONAL: "+r.optional);var v,w=new h(t,a),_=[];for(v=0;v in query: "+o),e(n,r,a,u,l,c,f)})};for(g=0;g0)throw"missing.js: oops nnonempty dict not imp";return[]},s=function(e){return e.length},u=function(e,t,n){if(void 0===e.slice)throw"@@ mising.js: No .slice function for "+e+" of type "+r(e);return void 0===n||null==n?e.slice(t):e.slice(t,n)},l=Error("dummy error stop iteration"),c=function(e){return this.last=0,this.li=e,this.next=function(){if(this.last==this.li.length)throw l;return this.li[this.last++]},this},f=function(e,t){return e.indexOf(t)},h=function(e,t){if(!e){if(t)throw"python Assertion failed: "+t;throw"(python) Assertion failed."}};String.prototype.encode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return function(e){e=e.replace(/\r\n/g,"\n");for(var t="",n=0;n127&&r<2048?(t+=String.fromCharCode(r>>6|192),t+=String.fromCharCode(63&r|128)):(t+=String.fromCharCode(r>>12|224),t+=String.fromCharCode(r>>6&63|128),t+=String.fromCharCode(63&r|128))}return t}(this)},String.prototype.decode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return this};var p=function(e,t){return i.join(t,e)},d=0,g="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~:",m=(new RegExp("^[ \\t]*(#[^\\n]*)?\\r?\\n","g"),new RegExp("^[ \\t]*(#[^\\n]*)?$","g"),new RegExp("^[ \\t]*","g"),new RegExp("^[-+]?[0-9]+","g"),new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?(e[-+]?[0-9]+)?","g")),y=new RegExp("^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9](T[0-9][0-9]:[0-9][0-9](:[0-9][0-9](\\.[0-9]*)?)?)?Z?"),v=(new RegExp("^[0-9]+","g"),new RegExp('[\\\\\\r\\n\\"]',"g")),b=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g");function w(e,t,r,i,o,s,u,l){void 0===t&&(t=null),void 0===r&&(r=""),void 0===i&&(i=null),void 0===o&&(o=""),void 0===s&&(s=null),void 0===u&&(u=""),void 0===l&&(l=null),this._bindings=new a([]),this._flags=u,""!=r&&(h(r.indexOf(":")>=0,"Document URI not absolute: "+r),this._bindings[""]=r+"#"),this._store=e,o&&e.setGenPrefix(o),this._thisDoc=r,this.source=e.sym(r),this.lines=0,this.statementCount=0,this.startOfLine=0,this.previousLine=0,this._genPrefix=o,this.keywords=new n(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new a([]),this._variables=new a([]),this._parentVariables=new a([]),this._reason=l,this._reason2=null,d&&(this._reason2=why_BecauseOfData(e.sym(r),this._reason)),this._baseURI=i||r||null,h(!this._baseURI||this._baseURI.indexOf(":")>=0),this._genPrefix||(this._genPrefix=this._thisDoc?this._thisDoc+"#_g":RDFSink_uniqueURI()),this._formula=null==t?this._thisDoc?e.formula(r+"#_formula"):e.formula():t,this._context=this._formula,this._parentContext=null}function _(e,t,n,r,i){var o="Line "+(t+1)+" of <"+e+">: Bad syntax: "+i+'\nat: "'+n.slice(r,r+30)+'"',a=new Error(o);return a.lineNumber=t+1,a.characterInFile=r,a.syntaxProblem=i,a}return w.prototype.here=function(e){return this._genPrefix+"_L"+this.lines+"C"+(e-this.startOfLine+1)},w.prototype.formula=function(){return this._formula},w.prototype.loadStream=function(e){return this.loadBuf(e.read())},w.prototype.loadBuf=function(e){return this.startDoc(),this.feed(e),this.endDoc()},w.prototype.feed=function(e){for(var t=e.decode("utf-8"),n=0;n>=0;){var r=this.skipSpace(t,n);if(r<0)return;if((n=this.directiveOrStatement(t,r))<0)throw _(this._thisDoc,this.lines,t,r,"expected directive or statement")}},w.prototype.directiveOrStatement=function(e,t){var n,r=this.skipSpace(e,t);return r<0?r:(n=this.directive(e,r))>=0?this.checkDot(e,n):(n=this.statement(e,r))>=0?this.checkDot(e,n):n},w.prototype.tok=function(e,t,n){if("@"==t.slice(n,n+1))n+=1;else if(o(this.keywords,e)<0)return-1;var r=n+s(e);return t.slice(n,r)==e&&"\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~".indexOf(t.charAt(r))>=0?r:-1},w.prototype.directive=function(e,t){if((s=this.skipSpace(e,t))<0)return s;var r=new n([]);if((s=this.tok("bind",e,t))>0)throw _(this._thisDoc,this.lines,e,t,"keyword bind is obsolete: use @prefix");if((s=this.tok("keywords",e,t))>0){if((t=this.commaSeparatedList(e,s,r,!1))<0)throw _(this._thisDoc,this.lines,e,t,"'@keywords' needs comma separated list of words");return this.setKeywords(u(r,null,null)),t}if((s=this.tok("forAll",e,t))>0){if((t=this.commaSeparatedList(e,s,r,!0))<0)throw _(this._thisDoc,this.lines,e,t,"Bad variable list after @forAll");var i=new c(r);try{for(;;){var a=i.next();(o(this._variables,a)<0||o(this._parentVariables,a)>=0)&&(this._variables[a]=this._context.newUniversal(a))}}catch(e){if(e!=l)throw e}return t}if((s=this.tok("forSome",e,t))>0){if((t=this.commaSeparatedList(e,s,r,this.uri_ref2))<0)throw _(this._thisDoc,this.lines,e,t,"Bad variable list after @forSome");i=new c(r);try{for(;;)a=i.next(),this._context.declareExistential(a)}catch(e){if(e!=l)throw e}return t}if((s=this.tok("prefix",e,t))>=0){var s,f=new n([]);if((t=this.qname(e,s,f))<0)throw _(this._thisDoc,this.lines,e,s,"expected qname after @prefix");if((s=this.uri_ref2(e,t,f))<0)throw _(this._thisDoc,this.lines,e,t,"expected after @prefix _qname_");var d=f[1].uri;return this._baseURI?d=p(this._baseURI,d):h(d.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS"),h(d.indexOf(":")>=0),this._bindings[f[0][0]]=d,this.bind(f[0][0],encodeURI(d)),s}if((s=this.tok("base",e,t))>=0){if(f=new n([]),(t=this.uri_ref2(e,s,f))<0)throw _(this._thisDoc,this.lines,e,s,"expected after @base ");if(d=f[0].uri,!this._baseURI)throw _(this._thisDoc,this.lines,e,s,"With no previous base URI, cannot use relative URI in @base <"+d+">");return d=p(this._baseURI,d),h(d.indexOf(":")>=0),this._baseURI=d,t}return-1},w.prototype.bind=function(e,t){""==e||this._store.setPrefixForURI(e,t)},w.prototype.setKeywords=function(e){null==e?this.keywordsSet=0:(this.keywords=e,this.keywordsSet=1)},w.prototype.startDoc=function(){},w.prototype.endDoc=function(){return this._formula},w.prototype.makeStatement=function(e){e[0].add(e[2],e[1],e[3],this.source),this.statementCount+=1},w.prototype.statement=function(e,t){var r=new n([]);if((t=this.object(e,t,r))<0)return t;var i=this.property_list(e,t,r[0]);if(i<0)throw _(this._thisDoc,this.lines,e,t,"expected propertylist");return i},w.prototype.subject=function(e,t,n){return this.item(e,t,n)},w.prototype.verb=function(r,i,o){if((s=this.skipSpace(r,i))<0)return s;var a=new n([]);if((s=this.tok("has",r,i))>=0){if((i=this.prop(r,s,a))<0)throw _(this._thisDoc,this.lines,r,s,"expected property after 'has'");return o.push(new t(["->",a[0]])),i}if((s=this.tok("is",r,i))>=0){if((i=this.prop(r,s,a))<0)throw _(this._thisDoc,this.lines,r,s,"expected after 'is'");if((s=this.skipSpace(r,i))<0)throw _(this._thisDoc,this.lines,r,i,"End of file found, expected property after 'is'");var s;if((s=this.tok("of",r,i=s))<0)throw _(this._thisDoc,this.lines,r,i,"expected 'of' after 'is' ");return o.push(new t(["<-",a[0]])),s}if((s=this.tok("a",r,i))>=0)return o.push(new t(["->",this._store.sym("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")])),s;if("<="==r.slice(i,i+2))return o.push(new t(["<-",this._store.sym(e+"implies")])),i+2;if("="==r.slice(i,i+1))return">"==r.slice(i+1,i+2)?(o.push(new t(["->",this._store.sym(e+"implies")])),i+2):(o.push(new t(["->",this._store.sym("http://www.w3.org/2002/07/owl#sameAs")])),i+1);if(":="==r.slice(i,i+2))return o.push(new t(["->",e+"becomes"])),i+2;if((s=this.prop(r,i,a))>=0)return o.push(new t(["->",a[0]])),s;if(">-"==r.slice(i,i+2)||"<-"==r.slice(i,i+2))throw _(this._thisDoc,this.lines,r,s,">- ... -> syntax is obsolete.");return-1},w.prototype.prop=function(e,t,n){return this.item(e,t,n)},w.prototype.item=function(e,t,n){return this.path(e,t,n)},w.prototype.blankNode=function(e){return this._context.bnode(e,this._reason2)},w.prototype.path=function(e,n,r){if((a=this.nodeOrLiteral(e,n,r))<0)return a;for(;"!^.".indexOf(e.slice(a,a+1))>=0;){var i=e.slice(a,a+1);if("."==i){var o=e.slice(a+1,a+2);if(!o||g.indexOf(o)>=0&&":?<[{(".indexOf(o)<0)break}var a,s=r.pop(),u=this.blankNode(this.here(a));if((a=this.node(e,a+1,r))<0)throw _(this._thisDoc,this.lines,e,a,"EOF found in middle of path syntax");var l=r.pop();this.makeStatement(new t("^"==i?[this._context,l,u,s]:[this._context,l,s,u])),r.push(u)}return a},w.prototype.anonymousNode=function(e){if(t=this._anonymousNodes[e])return t;var t=this._store.bnode(e);return this._anonymousNodes[e]=t,t},w.prototype.node=function(e,r,i,o){void 0===o&&(o=null);var u=o;if((m=this.skipSpace(e,r))<0)return m;var f=e.slice(r=m,r+1);if("["==f){var h=this.here(r);if((m=this.skipSpace(e,r+1))<0)throw _(this._thisDoc,this.lines,e,r,"EOF after '['");if("="==e.slice(m,m+1)){r=m+1;var p=new n([]);if(!((m=this.objectList(e,r,p))>=0))throw _(this._thisDoc,this.lines,e,r,"objectList expected after [= ");if(u=p[0],s(p)>1){var d=new c(p);try{for(;;){var g=d.next();this.makeStatement(new t([this._context,this._store.sym("http://www.w3.org/2002/07/owl#sameAs"),u,g]))}}catch(e){if(e!=l)throw e}}if((m=this.skipSpace(e,m))<0)throw _(this._thisDoc,this.lines,e,r,"EOF when objectList expected after [ = ");if(";"==e.slice(m,m+1))var m=m+1}if(null==u&&(u=this.blankNode(h)),(r=this.property_list(e,m,u))<0)throw _(this._thisDoc,this.lines,e,m,"property_list expected");if((m=this.skipSpace(e,r))<0)throw _(this._thisDoc,this.lines,e,r,"EOF when ']' expected after [ ");if("]"!=e.slice(m,m+1))throw _(this._thisDoc,this.lines,e,m,"']' expected");return i.push(u),m+1}if("{"==f){if("$"==e.slice(r+1,r+2)){m=(r+=1)+1;for(var y=new n([]),v=!0;;){if((r=this.skipSpace(e,m))<0)throw _(this._thisDoc,this.lines,e,r,"needed '$}', found end.");if("$}"==e.slice(r,r+2)){m=r+2;break}if(v)v=!1;else{if(","!=e.slice(r,r+1))throw _(this._thisDoc,this.lines,e,r,"expected: ','");r+=1}var b=new n([]);if((m=this.item(e,r,b))<0)throw _(this._thisDoc,this.lines,e,r,"expected item in set or '$}'");y.push(b[0])}return i.push(this._store.newSet(y,this._context)),m}m=r+1;var w=this._parentContext;this._parentContext=this._context;var x=this._anonymousNodes,S=this._parentVariables;this._parentVariables=this._variables,this._anonymousNodes=new a([]),this._variables=this._variables.slice();var E=this._reason2;for(this._reason2=null,null==u&&(u=this._store.formula()),this._context=u;;){if((r=this.skipSpace(e,m))<0)throw _(this._thisDoc,this.lines,e,r,"needed '}', found end.");if("}"==e.slice(r,r+1)){m=r+1;break}if((m=this.directiveOrStatement(e,r))<0)throw _(this._thisDoc,this.lines,e,r,"expected statement or '}'")}return this._anonymousNodes=x,this._variables=this._parentVariables,this._parentVariables=S,this._context=this._parentContext,this._reason2=E,this._parentContext=w,i.push(u.close()),m}if("("==f){var k=this._store.list;for("$"==e.slice(r+1,r+2)&&(k=this._store.newSet,r+=1),m=r+1,y=new n([]);;){if((r=this.skipSpace(e,m))<0)throw _(this._thisDoc,this.lines,e,r,"needed ')', found end.");if(")"==e.slice(r,r+1)){m=r+1;break}if(b=new n([]),(m=this.item(e,r,b))<0)throw _(this._thisDoc,this.lines,e,r,"expected item in list or ')'");y.push(b[0])}return i.push(k(y,this._context)),m}if((m=this.tok("this",e,r))>=0)throw _(this._thisDoc,this.lines,e,r,"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.");return(m=this.tok("true",e,r))>=0?(i.push(!0),m):(m=this.tok("false",e,r))>=0?(i.push(!1),m):null==u&&(m=this.uri_ref2(e,r,i))>=0?m:-1},w.prototype.property_list=function(e,r,i){for(;;){if((p=this.skipSpace(e,r))<0)throw _(this._thisDoc,this.lines,e,r,"EOF found when expected verb in property list");if(":-"!=e.slice(p,p+2)){r=p;var o=new n([]);if((p=this.verb(e,r,o))<=0)return r;var a=new n([]);if((r=this.objectList(e,p,a))<0)throw _(this._thisDoc,this.lines,e,p,"objectList expected");var s=new c(a);try{for(;;){var u=s.next(),f=o[0],h=f[1];this.makeStatement(new t("->"==f[0]?[this._context,h,i,u]:[this._context,h,u,i]))}}catch(e){if(e!=l)throw e}if((p=this.skipSpace(e,r))<0)throw _(this._thisDoc,this.lines,e,p,"EOF found in list of objects");if(";"!=e.slice(r,r+1))return r;r+=1}else{r=p+2;var p,d=new n([]);if((p=this.node(e,r,d,i))<0)throw _(this._thisDoc,this.lines,e,r,"bad {} or () or [] node after :- ");r=p}}},w.prototype.commaSeparatedList=function(e,t,n,r){if((i=this.skipSpace(e,t))<0)throw _(this._thisDoc,this.lines,e,i,"EOF found expecting comma sep list");if("."==e.charAt(i))return t;if(r)var i=this.uri_ref2(e,i,n);else i=this.bareWord(e,i,n);if(i<0)return-1;for(;;){if((t=this.skipSpace(e,i))<0)return t;var o=e.slice(t,t+1);if(","!=o)return"."!=o?-1:t;if((i=r?this.uri_ref2(e,t+1,n):this.bareWord(e,t+1,n))<0)throw _(this._thisDoc,this.lines,e,i,"bad list content")}},w.prototype.objectList=function(e,t,n){if((t=this.object(e,t,n))<0)return-1;for(;;){var r=this.skipSpace(e,t);if(r<0)throw _(this._thisDoc,this.lines,e,r,"EOF found after object");if(","!=e.slice(r,r+1))return r;if((t=this.object(e,r+1,n))<0)return t}},w.prototype.checkDot=function(e,t){var n=this.skipSpace(e,t);if(n<0)return n;if("."==e.slice(n,n+1))return n+1;if("}"==e.slice(n,n+1))return n;if("]"==e.slice(n,n+1))return n;throw _(this._thisDoc,this.lines,e,n,"expected '.' or '}' or ']' at end of statement")},w.prototype.uri_ref2=function(e,t,r){var i=new n([]);if((v=this.qname(e,t,i))>=0){var a=i[0],l=a[0],c=a[1];if(null==l){h(0,"not used?");var f=this._baseURI+"#"}else if(!(f=this._bindings[l])){if("_"==l)return r.push(this.anonymousNode(c)),v;throw _(this._thisDoc,this.lines,e,t,"Prefix "+l+" not bound.")}var d=this._store.sym(f+c);return o(this._variables,d)>=0?r.push(this._variables[d]):r.push(d),v}if((t=this.skipSpace(e,t))<0)return-1;if("?"==e.charAt(t)){var g=new n([]);return(v=this.variable(e,t,g))>0?(r.push(g[0]),v):-1}if("<"==e.charAt(t)){for(var m=t+=1;t"==e.charAt(t)){var y=e.slice(m,t);return this._baseURI?y=p(this._baseURI,y):h(y.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs"),"#"==e.slice(t-1,t)&&"#"!=u(y,-1,null)&&(y+="#"),d=this._store.sym(y),o(this._variables,d)>=0?r.push(this._variables[d]):r.push(d),t+1}t+=1}throw _(this._thisDoc,this.lines,e,v,"unterminated URI reference")}if(this.keywordsSet){var v;if(g=new n([]),(v=this.bareWord(e,t,g))<0)return-1;if(o(this.keywords,g[0])>=0)throw _(this._thisDoc,this.lines,e,t,'Keyword "'+g[0]+'" not allowed here.');return r.push(this._store.sym(this._bindings[""]+g[0])),v}return-1},w.prototype.skipSpace=function(e,t){for(var n=t||0;n=0)throw _(this._thisDoc,this.lines,e,r,"Varible name can't start with '"+e.charAt(r)+"s'");for(;t=0)return-1;if(g.indexOf(i)>=0)return-1;for(t=r;t=0)return-1;if(g.indexOf(i)<0){var a=i;for(n+=1;n=0)return a;if((a=this.skipSpace(e,t))<0)return-1;var r=null,i=e.charAt(t=a);if('"'==i||"'"==i){r=e.slice(t,t+3==i+i)?i+i+i:i,t+=s(r);var o=this.strconst(e,t,r),a=o[0];return n.push(this._store.literal(o[1])),a}return-1},w.prototype.nodeOrLiteral=function(e,t,r){if((c=this.node(e,t,r))>=0)return c;if((c=this.skipSpace(e,t))<0)return-1;var i=e.charAt(t=c);if("-+0987654321".indexOf(i)>=0){if(y.lastIndex=0,null!=(p=y.exec(e.slice(t))))c=t+(o=p[0]).length,o.indexOf("T")>=0?r.push(this._store.literal(o,void 0,this._store.sym("http://www.w3.org/2001/XMLSchema#dateTime"))):r.push(this._store.literal(o,void 0,this._store.sym("http://www.w3.org/2001/XMLSchema#date")));else{var o;if(m.lastIndex=0,null==(p=m.exec(e.slice(t))))throw _(this._thisDoc,this.lines,e,t,"Bad number or date syntax");(o=e.slice(t,c=t+m.lastIndex)).indexOf("e")>=0?r.push(this._store.literal(parseFloat(o),void 0,this._store.sym("http://www.w3.org/2001/XMLSchema#double"))):e.slice(t,c).indexOf(".")>=0?r.push(this._store.literal(parseFloat(o),void 0,this._store.sym("http://www.w3.org/2001/XMLSchema#decimal"))):r.push(this._store.literal(parseInt(o),void 0,this._store.sym("http://www.w3.org/2001/XMLSchema#integer")))}return c}if('"'==e.charAt(t)){if('"""'==e.slice(t,t+3))var a='"""';else a='"';t+=s(a);var u=null,l=this.strconst(e,t,a),c=l[0],f=l[1],h=null;if("@"==e.slice(c,c+1)){var p;if(b.lastIndex=0,null==(p=b.exec(e.slice(c+1))))throw _(this._thisDoc,startline,e,t,"Bad language code syntax on string literal, after @");h=e.slice(c+1,t=b.lastIndex+c+1),c=t}if("^^"==e.slice(c,c+2)){var d=new n([]);c=this.uri_ref2(e,c+2,d),u=d[0]}return r.push(this._store.literal(f,h,u)),c}return-1},w.prototype.strconst=function(e,n,r){for(var i=n,o="",a=this.lines;i=0)o+='a\b\f\r\t\v\n\\"'.charAt(u),i+=1;else if("u"==c)i=(l=this.uEscape(e,i+1,a))[0],o+=c=l[1];else{if("U"!=c)throw _(this._thisDoc,this.lines,e,n,"bad escape");var l,c;i=(l=this.UEscape(e,i+1,a))[0],o+=c=l[1]}}}else i=n+1;else i=n}else o+='"',i+=1}throw _(this._thisDoc,this.lines,e,n,"unterminated string literal")},w.prototype.uEscape=function(e,n,r){for(var i=n,o=0,a=0;o<4;){var s=e.slice(i,i+1).toLowerCase();if(i+=1,""==s)throw _(this._thisDoc,r,e,n,"unterminated string literal(3)");var u=f("0123456789abcdef",s);if(u<0)throw _(this._thisDoc,r,e,n,"bad string literal hex escape");a=16*a+u,o+=1}var l=String.fromCharCode(a);return new t([i,l])},w.prototype.UEscape=function(e,n,r){for(var i=n,o=0,a="\\U";o<8;){var s=e.slice(i,i+1).toLowerCase();if(i+=1,""==s)throw _(this._thisDoc,r,e,n,"unterminated string literal(3)");if(f("0123456789abcdef",s)<0)throw _(this._thisDoc,r,e,n,"bad string literal hex escape");a+=s,o+=1}var l,c=(l="0x"+u(a,2,10)-0,String.fromCharCode(l));return new t([i,c])},function(e,t,n,r,i,o,a,s){return new w(e,t,n,r,i,o,a,s)}}();e.exports=a},function(e,t){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,(function(t){return e[t]}).bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";n.r(t);var r=n(1);const i=new r.default;if(t.default=i,Object.getOwnPropertyNames(r.default.prototype).forEach(e=>{const t=i[e];"function"==typeof t&&(i[e]=t.bind(i))}),"undefined"!=typeof window)if("SolidAuthClient"in window)console.warn("Caution: multiple versions of solid-auth-client active.");else{let e=!1;Object.defineProperty(window,"SolidAuthClient",{enumerable:!0,get:()=>(e||(e=!0,console.warn("window.SolidAuthClient has been deprecated."),console.warn("Please use window.solid.auth instead.")),i)})}},function(e,t,n){"use strict";n.r(t),n.d(t,"default",function(){return m});var r=n(2),i=n.n(r),o=n(3),a=n.n(o),s=n(4),u=n.n(s),l=n(5),c=n(81),f=n(9),h=n(10),p=n(7),d=n(12);const g=fetch;class m extends u.a{constructor(...e){super(...e),a()(this,"_pendingSession",void 0)}fetch(e,t){return Object(l.authnFetch)(Object(h.defaultStorage)(),g,e,t)}login(e,t){return t=i()({},y(Object(p.currentUrlNoParams)()),t),d.login(e,t)}async popupLogin(e){e=i()({},y(),e),/https?:/.test(e.popupUri)||(e.popupUri=new URL(e.popupUri||"/.well-known/solid/login",window.location).toString()),e.callbackUri||(e.callbackUri=e.popupUri);const t=Object(c.openIdpPopup)(e.popupUri),n=await Object(c.obtainSession)(e.storage,t,e);return this.emit("login",n),this.emit("session",n),n}async currentSession(e=Object(h.defaultStorage)()){let t=await Object(f.getSession)(e);if(!t){if(this._pendingSession)return this._pendingSession;try{this._pendingSession=d.currentSession(e),t=await this._pendingSession}catch(e){console.error(e)}delete this._pendingSession,t&&(await Object(f.saveSession)(e)(t),this.emit("login",t),this.emit("session",t))}return t}async trackSession(e){e(await this.currentSession()),this.on("session",e)}async logout(e=Object(h.defaultStorage)()){if(await Object(f.getSession)(e)){try{await d.logout(e,g),this.emit("logout"),this.emit("session",null)}catch(e){console.warn("Error logging out:"),console.error(e)}await Object(f.clearSession)(e)}}}function y(e){return{callbackUri:e?e.split("#")[0]:"",popupUri:"",storage:Object(h.defaultStorage)()}}},function(e,t,n){var r=n(3);e.exports=function(e){for(var t=1;t0&&this._events[e].length>a&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.once=function(e,t){if(!r(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},n.prototype.removeListener=function(e,t){var n,o,a,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(a=(n=this._events[e]).length,o=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){o=s;break}if(o<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){"use strict";n.r(t),n.d(t,"authnFetch",function(){return s}),n(6);var r=n(7),i=n(8),o=n(9),a=n(12);async function s(e,t,n,r){const s=await Object(o.getSession)(e);if(!s)return t(n,r);if(await u(e,n))return Object(a.fetchWithCredentials)(s,t,n,r);let l=await t(n,r);return 401===l.status&&(await Object(i.updateHostFromResponse)(e)(l),await u(e,n)&&(l=Object(a.fetchWithCredentials)(s,t,n,r))),l}async function u(e,t){const n=await Object(i.getHost)(e)(Object(r.toUrlString)(t));return null!=n&&n.requiresAuth}},function(e,t){e.exports=window.fetch},function(e,t,n){"use strict";n.r(t),n.d(t,"currentUrl",function(){return r}),n.d(t,"currentUrlNoParams",function(){return i}),n.d(t,"navigateTo",function(){return o}),n.d(t,"originOf",function(){return a}),n.d(t,"toUrlString",function(){return s});const r=()=>window.location.href,i=()=>window.location.origin+window.location.pathname,o=e=>{window.location.href=e},a=e=>new URL(e).origin,s=e=>("string"!=typeof e&&(e="url"in e?e.url:e.toString()),new URL(e,r()).toString())},function(e,t,n){"use strict";n.r(t),n.d(t,"getHost",function(){return u}),n.d(t,"saveHost",function(){return l}),n.d(t,"updateHostFromResponse",function(){return c});var r=n(2),i=n.n(r),o=n(9),a=n(10),s=n(12);function u(e){return async t=>{const n=new URL(t).host,r=await Object(o.getSession)(e);if(r&&n===new URL(r.idp).host)return{url:n,requiresAuth:!0};const i=(await Object(a.getData)(e)).hosts;return i&&i[n]}}function l(e){return async({url:t,requiresAuth:n})=>{await Object(a.updateStorage)(e,e=>i()({},e,{hosts:i()({},e.hosts,{[t]:{requiresAuth:n}})}))}}function c(e){return async t=>{if(s.requiresAuth(t)){const n=new URL(t.url).host;await l(e)({url:n,requiresAuth:!0})}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"getSession",function(){return a}),n.d(t,"saveSession",function(){return s}),n.d(t,"clearSession",function(){return u});var r=n(2),i=n.n(r),o=n(10);async function a(e){return(await Object(o.getData)(e)).session||null}function s(e){return async t=>(await Object(o.updateStorage)(e,e=>i()({},e,{session:t}))).session}async function u(e){await Object(o.updateStorage)(e,e=>i()({},e,{session:null}))}},function(e,t,n){"use strict";n.r(t),n.d(t,"NAMESPACE",function(){return r}),n.d(t,"defaultStorage",function(){return i}),n.d(t,"getData",function(){return o}),n.d(t,"updateStorage",function(){return a}),n.d(t,"asyncStorage",function(){return s}),n.d(t,"memStorage",function(){return u}),n.d(t,"ipcStorage",function(){return l}),n(11);const r="solid-auth-client",i=()=>{try{if(window&&window.localStorage)return s(window.localStorage)}catch(e){if(!(e instanceof ReferenceError))throw e}return console.warn("'window.localStorage' unavailable. Creating a (not very useful) in-memory storage object as the default storage interface."),s(u())};async function o(e){let t,n;try{t=await e.getItem(r),n=JSON.parse(t||"{}")}catch(e){console.warn("Could not deserialize data:",t),console.error(e),n={}}return n}async function a(e,t){const n=t(await o(e));return await e.setItem(r,JSON.stringify(n)),n}function s(e){return{getItem:t=>Promise.resolve(e.getItem(t)),setItem:(t,n)=>Promise.resolve(e.setItem(t,n)),removeItem:t=>Promise.resolve(e.removeItem(t))}}const u=()=>{const e={};return{getItem:t=>void 0===e[t]?null:e[t],setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}};function l(e){return{getItem:t=>e.request("storage/getItem",t),setItem:(t,n)=>e.request("storage/setItem",t,n),removeItem:t=>e.request("storage/removeItem",t)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"Server",function(){return a}),n.d(t,"Client",function(){return s});var r=n(3),i=n.n(r);const o="solid-auth-client";class a{constructor(e,t,n){i()(this,"_clientWindow",void 0),i()(this,"_clientOrigin",void 0),i()(this,"_handler",void 0),i()(this,"_messageListener",void 0),this._clientWindow=e,this._clientOrigin=t,this._handler=n,this._messageListener=(e=>this._handleMessage(e))}async _handleMessage({data:e,origin:t}){if(t!==this._clientOrigin)return void console.warn(`solid-auth-client is listening to ${this._clientOrigin} `+`so ignored a message received from ${t}.`);const n=e&&e[o];if(n&&n.method){const e=n.id,t=n.method,r=n.args,i=await this._handler(t,...r);this._clientWindow.postMessage({[o]:{id:e,ret:i}},this._clientOrigin)}}start(){window.addEventListener("message",this._messageListener)}stop(){window.removeEventListener("message",this._messageListener)}}class s{constructor(e,t){i()(this,"_serverWindow",void 0),i()(this,"_serverOrigin",void 0),this._serverWindow=e,this._serverOrigin=t}request(e,...t){const n=Math.random();return this._serverWindow.postMessage({[o]:{id:n,method:e,args:t}},this._serverOrigin),new Promise((e,t)=>{window.addEventListener("message",i);const r=setTimeout(()=>{t(new Error("Could not connect to main window.")),window.removeEventListener("message",i)},2e3);function i({data:t}){const a=t&&t[o];a&&a.id===n&&a.hasOwnProperty("ret")&&(e(a.ret),clearTimeout(r),window.removeEventListener("message",i))}})}}},function(e,t,n){"use strict";n.r(t),n.d(t,"login",function(){return d}),n.d(t,"currentSession",function(){return g}),n.d(t,"logout",function(){return m}),n.d(t,"getRegisteredRp",function(){return y}),n.d(t,"requiresAuth",function(){return b}),n.d(t,"fetchWithCredentials",function(){return w});var r=n(13),i=n.n(r),o=n(2),a=n.n(o),s=n(15),u=n(19),l=n.n(u),c=n(80),f=n.n(c),h=n(7),p=n(10);async function d(e,t){try{const n=await y(e,t);return await async function(e){await Object(p.updateStorage)(e,e=>a()({},e,{appHashFragment:window.location.hash}))}(t.storage),async function(e,{callbackUri:t,storage:n}){const r=await Object(p.getData)(n),i=await e.createRequest({redirect_uri:t},r);return await Object(p.updateStorage)(n,()=>r),Object(h.navigateTo)(i)}(n,t)}catch(e){return console.warn("Error logging in with WebID-OIDC"),console.error(e),null}}async function g(e=Object(p.defaultStorage)()){try{const t=await v(e);if(!t)return null;const n=Object(h.currentUrl)();if(!/#(.*&)?access_token=/.test(n))return null;window.location.hash="",await async function(e){await Object(p.updateStorage)(e,e=>{let t=e.appHashFragment,n=void 0===t?"":t,r=i()(e,["appHashFragment"]);return window.location.hash=n,r})}(e);const r=await Object(p.getData)(e),o=await t.validateResponse(n,r);return o?a()({},o,{webId:o.idClaims.sub,idp:o.issuer}):null}catch(e){return console.warn("Error finding a WebID-OIDC session"),console.error(e),null}}async function m(e,t){const n=await v(e);if(n)try{await n.logout();try{await t("/.well-known/solid/logout",{credentials:"include"})}catch(e){}}catch(e){console.warn("Error logging out of the WebID-OIDC session"),console.error(e)}}async function y(e,t){let n=await v(t.storage);return n&&n.provider.url===e&&n.registration.redirect_uris.includes(t.callbackUri)||(n=await function(e,{storage:t,callbackUri:n}){return l.a.register(e,{issuer:e,grant_types:["implicit"],redirect_uris:[n],response_types:["id_token token"],scope:"openid profile"},{defaults:{authenticate:{redirect_uri:n,response_type:"id_token token"}},store:t})}(e,t),await async function(e,t,n){return await Object(p.updateStorage)(e,e=>a()({},e,{rpConfig:n})),n}(t.storage,0,n)),n}async function v(e){const t=(await Object(p.getData)(e)).rpConfig;return t?(t.store=e,l.a.from(t)):null}function b(e){if(401!==e.status)return!1;const t=e.headers.get("www-authenticate");if(!t)return!1;const n=s.parse(t);return"Bearer"===n.scheme&&n.params&&"openid webid"===n.params.scope}async function w(e,t,n,r){const i=await f.a.issueFor(Object(h.toUrlString)(n),e);return t(n,a()({},r,{credentials:"include",headers:a()({},r&&r.headers?r.headers:{},{authorization:`Bearer ${i}`})}))}},function(e,t,n){var r=n(14);e.exports=function(e,t){if(null==e)return{};var n,i,o=r(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"format",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return i.default}});var r=o(n(16)),i=o(n(18));function o(e){return e&&e.__esModule?e:{default:e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(17);function i(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t@,;:\\"\/?={}\[\]\u0020\u0009]+$/,i=function(e){return"string"==typeof e&&r.test(e)};t.isToken=i,t.isScheme=i,t.quote=function(e){return`"${e.replace(/"/g,'\\"')}"`},t.unquote=function(e){return e.substr(1,e.length-2).replace(/\\"/g,'"')}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=n(17),i=/((?:[a-zA-Z0-9._~+\/-]+=*(?:\s+|$))|[^\u0000-\u001F\u007F()<>@,;:\\"\/?={}\[\]\u0020\u0009]+)(?:=([^\\"=\s,]+|"(?:[^"\\]|\\.)*"))?/g,o=function(e,t){var n='"'===t.charAt(0)?(0,r.unquote)(t):t.trim();return Array.isArray(e)?e.concat(n):"string"==typeof e?[e,n]:n};t.default=function(e){if("string"!=typeof e)throw new TypeError("Header value must be a string.");var t=e.indexOf(" "),n=e.substr(0,t);if(!(0,r.isScheme)(n))throw new TypeError(`Invalid scheme ${n}`);return function(e,t){for(var n=null,r={};;){var a=i.exec(t);if(null===a)break;a[2]?r[a[1]]=o(r[a[1]],a[2]):n=o(n,a[1])}return{scheme:e,params:r,token:n}}(n,e.substr(t))}},function(e,t,n){"use strict";e.exports=n(20)},function(e,t,n){(function(t){const r=n(22),i=n(6),{URL:o}=n(27),a=i.Headers?i.Headers:t.Headers,{JSONDocument:s}=n(28),{JWKSet:u}=n(37),l=n(68),c=n(70),f=n(79),h=n(74),p=n(69);class d extends s{static get schema(){return f}static from(e){let t=new d(e),n=t.validate();if(!n.valid)return Promise.reject(new Error(JSON.stringify(n)));let r=t.provider.jwks;return r?u.importKeys(r).then(e=>(t.provider.jwks=e,t)):t.jwks().then(()=>t)}static register(e,t,n){let r=new d({provider:{url:e},defaults:Object.assign({},n.defaults),store:n.store});return Promise.resolve().then(()=>r.discover()).then(()=>r.jwks()).then(()=>r.register(t)).then(()=>r)}discover(){try{let t=this.provider.url;r(t,'RelyingParty provider must define "url"');let n=new o(t);return n.pathname=".well-known/openid-configuration",i(n.toString()).then(h("Error fetching openid configuration")).then(e=>e.json().then(e=>this.provider.configuration=e))}catch(e){return Promise.reject(e)}}register(e){try{let t=this.provider.configuration;r(t,"OpenID Configuration is not initialized."),r(t.registration_endpoint,"OpenID Configuration is missing registration_endpoint.");let n=t.registration_endpoint,o="post",s=new a({"Content-Type":"application/json"}),u=JSON.stringify(Object.assign({},this.defaults.register,e));return i(n,{method:o,headers:s,body:u}).then(h("Error registering client")).then(e=>e.json().then(e=>this.registration=e))}catch(e){return Promise.reject(e)}}serialize(){return JSON.stringify(this)}jwks(){try{let t=this.provider.configuration;return r(t,"OpenID Configuration is not initialized."),r(t.jwks_uri,"OpenID Configuration is missing jwks_uri."),i(t.jwks_uri).then(h("Error resolving provider keys")).then(e=>e.json().then(e=>u.importKeys(e)).then(e=>this.provider.jwks=e))}catch(e){return Promise.reject(e)}}createRequest(e,t){return l.create(this,e,t||this.store)}validateResponse(e,t=this.store){let n;n=e.match(/^http(s?):\/\//)?{rp:this,redirect:e,session:t}:{rp:this,body:e,session:t};const r=new c(n);return c.validateResponse(r)}userinfo(){try{let t=this.provider.configuration;r(t,"OpenID Configuration is not initialized."),r(t.userinfo_endpoint,"OpenID Configuration is missing userinfo_endpoint.");let n=t.userinfo_endpoint,o=this.store.access_token;r(o,"Missing access token.");let s=new a({"Content-Type":"application/json",Authorization:`Bearer ${o}`});return i(n,{headers:s}).then(h("Error fetching userinfo")).then(e=>e.json())}catch(e){return Promise.reject(e)}}logoutRequest(e={}){const{id_token_hint:t,post_logout_redirect_uri:n,state:i}=e;let a;if(r(this.provider,"OpenID Configuration is not initialized"),r(a=this.provider.configuration,"OpenID Configuration is not initialized"),!a.end_session_endpoint)return console.log("OpenId Configuration for "+`${a.issuer} is missing end_session_endpoint`),null;if(n&&!t)throw new Error("id_token_hint is required when using post_logout_redirect_uri");const s={};t&&(s.id_token_hint=t),n&&(s.post_logout_redirect_uri=n),i&&(s.state=i);const u=new o(a.end_session_endpoint);return u.search=p.encode(s),u.href}logout(){let e;try{r(this.provider,"OpenID Configuration is not initialized."),r(e=this.provider.configuration,"OpenID Configuration is not initialized."),r(e.end_session_endpoint,"OpenID Configuration is missing end_session_endpoint.")}catch(e){return Promise.reject(e)}return e.end_session_endpoint?i(e.end_session_endpoint,{method:"get",credentials:"include"}).then(h("Error logging out")).then(()=>this.clearSession()):(this.clearSession(),Promise.resolve(void 0))}clearSession(){let e=this.store;e&&delete e[g]}popTokenFor(e,t){return PoPToken.issueFor(e,t)}}const g="oidc.session.privateKey";d.SESSION_PRIVATE_KEY=g,e.exports=d}).call(this,n(21))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";(function(t){function r(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i=0;l--)if(c[l]!==f[l])return!1;for(l=c.length-1;l>=0;l--)if(!v(e[u=c[l]],t[u],n,r))return!1;return!0}(e,t,n,a))}return n?e===t:e==t}function b(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function w(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _(e,t,n,r){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!i&&m(i,n,"Missing expected exception"+r);var a="string"==typeof r,s=!e&&i&&!n;if((!e&&o.isError(i)&&a&&w(i,n)||s)&&m(i,n,"Got unwanted exception"+r),e&&i&&n&&!w(i,n)||!e&&i)throw i}f.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=d(g(this.actual),128)+" "+this.operator+" "+d(g(this.expected),128),this.generatedMessage=!0);var t=e.stackStartFunction||m;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var r=n.stack,i=p(t),o=r.indexOf("\n"+i);if(o>=0){var a=r.indexOf("\n",o+1);r=r.substring(a+1)}this.stack=r}}},o.inherits(f.AssertionError,Error),f.fail=m,f.ok=y,f.equal=function(e,t,n){e!=t&&m(e,t,n,"==",f.equal)},f.notEqual=function(e,t,n){e==t&&m(e,t,n,"!=",f.notEqual)},f.deepEqual=function(e,t,n){v(e,t,!1)||m(e,t,n,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(e,t,n){v(e,t,!0)||m(e,t,n,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(e,t,n){v(e,t,!1)&&m(e,t,n,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function e(t,n,r){v(t,n,!0)&&m(t,n,r,"notDeepStrictEqual",e)},f.strictEqual=function(e,t,n){e!==t&&m(e,t,n,"===",f.strictEqual)},f.notStrictEqual=function(e,t,n){e===t&&m(e,t,n,"!==",f.notStrictEqual)},f.throws=function(e,t,n){_(!0,e,t,n)},f.doesNotThrow=function(e,t,n){_(!1,e,t,n)},f.ifError=function(e){if(e)throw e};var x=Object.keys||function(e){var t=[];for(var n in e)a.call(e,n)&&t.push(n);return t}}).call(this,n(21))},function(e,t,n){(function(e,r){var i=/%[sdj%]/g;t.format=function(e){if(!y(e)){for(var t=[],n=0;n=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),u=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(n)?r.showHidden=n:n&&t._extend(r,n),v(r.showHidden)&&(r.showHidden=!1),v(r.depth)&&(r.depth=2),v(r.colors)&&(r.colors=!1),v(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),c(r,e,r.depth)}function u(e,t){var n=s.styles[t];return n?"\x1b["+s.colors[n][0]+"m"+e+"\x1b["+s.colors[n][1]+"m":e}function l(e,t){return e}function c(e,n,r){if(e.customInspect&&n&&S(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return y(i)||(i=c(e,i,r)),i}var o=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(y(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return m(t)?e.stylize(""+t,"number"):d(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}(e,n);if(o)return o;var a=Object.keys(n),s=function(e){var t={};return a.forEach(function(e,n){t[e]=!0}),t}();if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),x(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(n);if(0===a.length){if(S(n))return e.stylize("[Function"+(n.name?": "+n.name:"")+"]","special");if(b(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(_(n))return e.stylize(Date.prototype.toString.call(n),"date");if(x(n))return f(n)}var u,l="",w=!1,E=["{","}"];return p(n)&&(w=!0,E=["[","]"]),S(n)&&(l=" [Function"+(n.name?": "+n.name:"")+"]"),b(n)&&(l=" "+RegExp.prototype.toString.call(n)),_(n)&&(l=" "+Date.prototype.toUTCString.call(n)),x(n)&&(l=" "+f(n)),0!==a.length||w&&0!=n.length?r<0?b(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),u=w?function(e,t,n,r,i){for(var o=[],a=0,s=t.length;a60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}(u,l,E)):E[0]+l+E[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,n,r,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=e.stylize(u.set?"[Getter/Setter]":"[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),T(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=g(n)?c(e,u.value,null):c(e,u.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),v(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function p(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function g(e){return null===e}function m(e){return"number"==typeof e}function y(e){return"string"==typeof e}function v(e){return void 0===e}function b(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function _(e){return w(e)&&"[object Date]"===E(e)}function x(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function S(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function k(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(v(o)&&(o=r.env.NODE_DEBUG||""),e=e.toUpperCase(),!a[e])if(new RegExp("\\b"+e+"\\b","i").test(o)){var n=r.pid;a[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else a[e]=function(){};return a[e]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=p,t.isBoolean=d,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=m,t.isString=y,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=v,t.isRegExp=b,t.isObject=w,t.isDate=_,t.isError=x,t.isFunction=S,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(25);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;console.log("%s - %s",(n=[k((e=new Date).getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),C[e.getMonth()],n].join(" ")),t.format.apply(t,arguments))},t.inherits=n(26),t._extend=function(e,t){if(!t||!w(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,n(21),n(24))},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,l=[],c=!1,f=-1;function h(){c&&u&&(c=!1,u.length?l=u.concat(l):f=-1,l.length&&p())}function p(){if(!c){var e=s(h);c=!0;for(var t=l.length;t;){for(u=l,l=[];++f1)for(var n=1;nthis.root.depth&&(this.root.depth=this.level),this.level=this.level||0,this.schema=t}return i(e,[{key:"compile",value:function(){var e=this.root,t="",n="";if(n+=this.default(),n+=this.properties(),n+=this.items(),n+=this.member(),n+=this.item(),e===this){for(var r=1;r<=this.root.depth;r++)t+=this.declaration(r);return"\n options = options || {}\n\n if (options.filter === false) {\n Object.assign(target, JSON.parse(JSON.stringify(source)))\n }\n\n "+t+"\n "+n+"\n "}return n}},{key:"declaration",value:function(e){return"\n var target"+e+"\n var source"+e+"\n var count"+e+"\n "}},{key:"default",value:function(){var e=this.schema,t=this.level,n=this.key,r=this.index,i=e.default,o="";return e.hasOwnProperty("default")&&(n&&(o+="\n target"+t+"['"+n+"'] = "+JSON.stringify(i)+"\n "),r&&(o+="\n target"+t+"["+r+"] = "+JSON.stringify(i)+"\n "),t>1&&(o+="\n count"+t+"++\n "),o="\n if (options.defaults !== false) {\n "+o+"\n }\n "),o}},{key:"member",value:function(){var e=this.schema,t=this.level,n=this.key,r="";return!n||e.properties||e.additionalProperties||e.items||e.additionalItems||(r+="\n target"+t+"['"+n+"'] = source"+t+"['"+n+"']\n ",t>1&&(r+="\n count"+t+"++\n "),r="\n if (source"+t+".hasOwnProperty('"+n+"')) {\n "+r+"\n }\n "),r}},{key:"item",value:function(){var e=this.schema,t=this.level,n=this.index,r="";return!n||e.properties||e.additionalProperties||e.items||e.additionalItems||(r+="\n target"+t+"["+n+"] = source"+t+"["+n+"]\n ",t>1&&(r+="\n count"+t+"++\n "),r="\n if ("+n+" < len) {\n "+r+"\n }\n "),r}},{key:"properties",value:function(){var t=this.root,n=this.level,r=this.key,i=this.index,o=this.schema.properties,a="";return o&&(Object.keys(o).forEach(function(r){var i=new e(o[r],{key:r,root:t,level:n+1});a+=i.compile()}),t===this?a="\n if (typeof source === 'object' && source !== null && !Array.isArray(source)) {\n if (typeof target !== 'object') {\n throw new Error('?')\n }\n\n source1 = source\n target1 = target\n count1 = 0\n\n "+a+"\n }\n ":(i&&(a="\n if ("+i+" < source"+n+".length || typeof source"+n+"["+i+"] === 'object') {\n\n source"+(n+1)+" = source"+n+"["+i+"] || {}\n count"+(n+1)+" = 0\n\n if ("+i+" < target"+n+".length || typeof target"+n+"["+i+"] !== 'object') {\n target"+(n+1)+" = {}\n if ("+i+" < source"+n+".length) {\n count"+(n+1)+"++\n }\n } else {\n target"+(n+1)+" = target"+n+"["+i+"]\n }\n\n "+a+"\n\n if (count"+(n+1)+" > 0) {\n target"+n+"["+i+"] = target"+(n+1)+"\n count"+n+"++\n }\n\n } else {\n target"+n+"["+i+"] = source"+n+"["+i+"]\n count"+n+"++\n }\n "),r&&(a="\n if ((typeof source"+n+"['"+r+"'] === 'object'\n && source"+n+"['"+r+"'] !== null\n && !Array.isArray(source"+n+"['"+r+"']))\n || !source"+n+".hasOwnProperty('"+r+"')) {\n\n source"+(n+1)+" = source"+n+"['"+r+"'] || {}\n count"+(n+1)+" = 0\n\n if (!target"+n+".hasOwnProperty('"+r+"')\n || typeof target"+n+"['"+r+"'] !== 'object'\n || target"+n+"['"+r+"'] === null\n || Array.isArray(target"+n+"['"+r+"'])) {\n target"+(n+1)+" = {}\n if (source"+n+".hasOwnProperty('"+r+"')) {\n count"+(n+1)+"++\n }\n } else {\n target"+(n+1)+" = target"+n+"['"+r+"']\n count"+(n+1)+"++\n }\n\n "+a+"\n\n if (count"+(n+1)+" > 0) {\n target"+n+"['"+r+"'] = target"+(n+1)+"\n count"+n+"++\n }\n\n } else {\n target"+n+"['"+r+"'] = source"+n+"['"+r+"']\n count"+n+"++\n }\n "))),a}},{key:"additionalProperties",value:function(){}},{key:"items",value:function(){var t=this.root,n=this.level,i=this.key,o=this.schema.items,a="";if(o){if(Array.isArray(o));else if("object"===(void 0===o?"undefined":r(o))&&null!==o){var s="i"+(n+1);a+="\n var sLen = source"+(n+1)+".length || 0\n var tLen = target"+(n+1)+".length || 0\n var len = 0\n\n if (sLen > len) { len = sLen }\n // THIS IS WRONG, CAUSED SIMPLE ARRAY INIT TO FAIL (OVERWRITE\n // EXISTING TARGET VALUES WITH UNDEFINED WHEN SOURCE IS SHORTER THAN\n // TARGET). LEAVING HERE UNTIL WE FINISH TESTING AND SEE WHY IT MIGHT\n // HAVE BEEN HERE IN THE FIRST PLACE.\n //\n // if (tLen > len) { len = tLen }\n\n for (var "+s+" = 0; "+s+" < len; "+s+"++) {\n "+new e(o,{index:s,root:t,level:n+1}).compile()+"\n }\n "}a=t===this?"\n if (Array.isArray(source)) {\n if (!Array.isArray(target)) {\n throw new Error('?')\n }\n\n source1 = source\n target1 = target\n\n "+a+"\n }\n ":"\n if (Array.isArray(source"+n+"['"+i+"']) || !source"+n+".hasOwnProperty('"+i+"')) {\n\n source"+(n+1)+" = source"+n+"['"+i+"'] || []\n count"+(n+1)+" = 0\n\n if (!target"+n+".hasOwnProperty('"+i+"') || !Array.isArray(target"+n+"['"+i+"'])) {\n target"+(n+1)+" = []\n if (source"+n+".hasOwnProperty('"+i+"')) {\n count"+(n+1)+"++\n }\n\n } else {\n target"+(n+1)+" = target"+n+"['"+i+"']\n count"+(n+1)+"++\n }\n\n "+a+"\n\n if (count"+(n+1)+" > 0) {\n target"+n+"['"+i+"'] = target"+(n+1)+"\n count"+n+"++\n }\n\n } else {\n target"+n+"['"+i+"'] = source"+n+"['"+i+"']\n count"+n+"++\n }\n "}return a}},{key:"additionalItems",value:function(){}}],[{key:"compile",value:function(t){var n=new e(t).compile();try{return new Function("target","source","options",n)}catch(e){console.log(e,e.stack)}}}]),e}();e.exports=o},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initialize(t,n)}return r(e,null,[{key:"schema",get:function(){throw new Error("Schema must be defined by classes extending JSONDocument")}}]),r(e,[{key:"initialize",value:function(){this.constructor.schema.initialize(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}},{key:"validate",value:function(e){return(e||this.constructor.schema).validate(this)}},{key:"patch",value:function(e){new i(e).apply(this)}},{key:"select",value:function(){}},{key:"project",value:function(e){return e.project(this)}}],[{key:"serialize",value:function(e){return JSON.stringify(e)}},{key:"deserialize",value:function(e){try{return JSON.parse(e)}catch(e){throw new Error("Failed to parse JSON")}}}]),e}();e.exports=o},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i=function(){function e(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.schema=t,Object.assign(this,n),this.address||(this.address=""),!0!==this.require&&(this.require=!1)}return i(e,null,[{key:"compile",value:function(t){var n='\n // "cursor"\n let value = data\n let container\n let stack = []\n let top = -1\n\n // error state\n let valid = true\n let errors = []\n\n // complex schema state\n let initialValidity\n let anyValid\n let notValid\n let countOfValid\n let initialErrorCount\n let accumulatedErrorCount\n\n // validation code\n '+new e(t).compile()+"\n\n // validation result\n return {\n valid,\n errors\n }\n ";return new Function("data",n)}},{key:"counter",get:function(){return a++}}]),i(e,[{key:"compile",value:function(){var e="";return this.require&&(e+=this.required()),e+=this.type(),e+=this.array(),e+=this.number(),e+=this.object(),e+=this.string(),e+=this.enum(),e+=this.anyOf(),e+=this.allOf(),(e+=this.not())+this.oneOf()}},{key:"push",value:function(){return"\n stack.push(value)\n container = value\n top++\n "}},{key:"pop",value:function(){return"\n if (stack.length > 1) {\n top--\n stack.pop()\n }\n\n value = container = stack[top]\n "}},{key:"type",value:function(){var e=this.schema.type,t="";return e&&(t+="\n // "+this.address+" type checking\n if (value !== undefined && "+(Array.isArray(e)?e:[e]).map(function(e){return"array"===e?"!Array.isArray(value)":"boolean"===e?"typeof value !== 'boolean'":"integer"===e?"!Number.isInteger(value)":"null"===e?"value !== null":"number"===e?"typeof value !== 'number'":"object"===e?"(typeof value !== 'object' || Array.isArray(value) || value === null)":"string"===e?"typeof value !== 'string'":void 0}).join(" && ")+") {\n valid = false\n errors.push({\n keyword: 'type',\n message: 'invalid type'\n })\n }\n "),t}},{key:"array",value:function(){var e=this.validations(["additionalItems","items","minItems","maxItems","uniqueItems"]),t="";return e.length>0&&(t+="\n /**\n * Array validations\n */\n if (Array.isArray(value)) {\n "+e+"\n }\n "),t}},{key:"number",value:function(){var e=this.validations(["minimum","maximum","multipleOf"]),t="";return e.length>0&&(t+="\n /**\n * Number validations\n */\n if (typeof value === 'number') {\n "+e+"\n }\n "),t}},{key:"object",value:function(){var e=this.validations(["maxProperties","minProperties","additionalProperties","properties","patternProperties","dependencies","schemaDependencies","propertyDependencies"]),t="";return e.length>0&&(t+="\n /**\n * Object validations\n */\n if (typeof value === 'object' && value !== null && !Array.isArray(value)) {\n "+e+"\n }\n "),t}},{key:"string",value:function(){var e=this.validations(["maxLength","minLength","pattern","format"]),t="";return e.length>0&&(t+="\n /**\n * String validations\n */\n if (typeof value === 'string') {\n "+e+"\n }\n "),t}},{key:"validations",value:function(e){var t=this,n="";return Object.keys(this.schema).filter(function(t){return-1!==e.indexOf(t)}).forEach(function(e){n+=t[e]()}),n}},{key:"enum",value:function(){var e=this.schema.enum,t=this.address,n=["value !== undefined"],i="";return e&&(e.forEach(function(e){switch(void 0===e?"undefined":r(e)){case"boolean":case"number":n.push("value !== "+e);break;case"string":n.push('value !== "'+e+'"');break;case"object":n.push(null===e?"value !== null":"'"+JSON.stringify(e)+"' !== JSON.stringify(value)");break;default:throw new Error("Things are not well in the land of enum")}}),i+='\n /**\n * Validate "'+t+'" enum\n */\n if ('+n.join(" && ")+") {\n valid = false\n errors.push({\n keyword: 'enum',\n message: JSON.stringify(value) + ' is not an enumerated value'\n })\n }\n "),i}},{key:"anyOf",value:function(){var t=this.schema.anyOf,n=this.address,r="";return Array.isArray(t)&&(r+="\n initialValidity = valid\n initialErrorCount = errors.length\n anyValid = false\n ",t.forEach(function(t){var i=new e(t,{address:n});r+="\n accumulatedErrorCount = errors.length\n "+i.compile()+"\n if (accumulatedErrorCount === errors.length) {\n anyValid = true\n }\n "}),r+="\n if (anyValid === true) {\n valid = initialValidity\n errors = errors.slice(0, initialErrorCount)\n }\n "),r}},{key:"allOf",value:function(){var t=this.schema.allOf,n=this.address,r="";return Array.isArray(t)&&t.forEach(function(t){var i=new e(t,{address:n});r+="\n "+i.compile()+"\n "}),r}},{key:"oneOf",value:function(){var t=this.schema.oneOf,n=this.address,r="";return Array.isArray(t)&&(r+="\n /**\n * Validate "+n+" oneOf\n */\n initialValidity = valid\n initialErrorCount = errors.length\n countOfValid = 0\n ",t.forEach(function(t){var i=new e(t,{address:n});r+="\n accumulatedErrorCount = errors.length\n "+i.compile()+"\n if (accumulatedErrorCount === errors.length) {\n countOfValid += 1\n }\n "}),r+="\n if (countOfValid === 1) {\n valid = initialValidity\n errors = errors.slice(0, initialErrorCount)\n } else {\n valid = false\n errors.push({\n keyword: 'oneOf',\n message: 'what is a reasonable error message for this case?'\n })\n }\n "),r}},{key:"not",value:function(){var t=this.schema.not,n=this.address,i="";return"object"!==(void 0===t?"undefined":r(t))||null===t||Array.isArray(t)||(i+="\n /**\n * NOT\n */\n if (value !== undefined) {\n initialValidity = valid\n initialErrorCount = errors.length\n notValid = true\n\n accumulatedErrorCount = errors.length\n\n "+new e(t,{address:n}).compile()+"\n\n if (accumulatedErrorCount === errors.length) {\n notValid = false\n }\n\n if (notValid === true) {\n valid = initialValidity\n errors = errors.slice(0, initialErrorCount)\n } else {\n valid = false\n errors = errors.slice(0, initialErrorCount)\n errors.push({\n keyword: 'not',\n message: 'hmm...'\n })\n }\n }\n "),i}},{key:"properties",value:function(){var t=this.schema,n=this.address,i=t.properties,o=t.required,a=this.push();return o=Array.isArray(o)?o:[],"object"===(void 0===i?"undefined":r(i))&&Object.keys(i).forEach(function(t){var r=i[t],s=-1!==o.indexOf(t),u=new e(r,{address:[n,t].filter(function(e){return!!e}).join("."),require:s});a+="\n value = container['"+t+"']\n ",a+=u.compile()}),a+=this.pop()}},{key:"otherProperties",value:function(){return"\n /**\n * Validate Other Properties\n */\n "+this.push()+"\n\n for (let key in container) {\n value = container[key]\n matched = false\n\n "+this.patternValidations()+"\n "+this.additionalValidations()+"\n }\n\n "+this.pop()+"\n "}},{key:"patternValidations",value:function(){var t=this.schema.patternProperties,n="";return"object"===(void 0===t?"undefined":r(t))&&Object.keys(t).forEach(function(r){var i=new e(t[r]);n+="\n if (key.match('"+r+"')) {\n matched = true\n "+i.compile()+"\n }\n "}),n}},{key:"additionalValidations",value:function(){var t=this.schema,n=t.additionalProperties,i=this.address,o="",a=["matched !== true"];if(Object.keys(t.properties||{}).forEach(function(e){a.push("key !== '"+e+"'")}),"object"===(void 0===n?"undefined":r(n))){var s=new e(n,{address:i+"[APKey]"});o+="\n // validate additional properties\n if ("+a.join(" && ")+") {\n "+s.compile()+"\n }\n "}return!1===n&&(o+="\n // validate non-presence of additional properties\n if ("+a.join(" && ")+") {\n valid = false\n errors.push({\n keyword: 'additionalProperties',\n message: key + ' is not a defined property'\n })\n }\n "),o}},{key:"patternProperties",value:function(){var e="";return this.otherPropertiesCalled||(this.otherPropertiesCalled=!0,e+=this.otherProperties()),e}},{key:"additionalProperties",value:function(){var e="";return this.otherPropertiesCalled||(this.otherPropertiesCalled=!0,e+=this.otherProperties()),e}},{key:"minProperties",value:function(){return"\n // "+this.address+" min properties\n if (Object.keys(value).length < "+this.schema.minProperties+") {\n valid = false\n errors.push({\n keyword: 'minProperties',\n message: 'too few properties'\n })\n }\n "}},{key:"maxProperties",value:function(){return"\n // "+this.address+" max properties\n if (Object.keys(value).length > "+this.schema.maxProperties+") {\n valid = false\n errors.push({\n keyword: 'maxProperties',\n message: 'too many properties'\n })\n }\n "}},{key:"dependencies",value:function(){var t=this.schema.dependencies,n=this.address,i=this.push();return"object"===(void 0===t?"undefined":r(t))&&Object.keys(t).forEach(function(o){var a=t[o],s=[];if(Array.isArray(a))a.forEach(function(e){s.push("container['"+e+"'] === undefined")}),i+="\n if (container['"+o+"'] !== undefined && ("+s.join(" || ")+")) {\n valid = false\n errors.push({\n keyword: 'dependencies',\n message: 'unmet dependencies'\n })\n }\n ";else if("object"===(void 0===a?"undefined":r(a))){var u=new e(a,{address:n});i+="\n if (container['"+o+"'] !== undefined) {\n "+u.compile()+"\n }\n "}}),i+=this.pop()}},{key:"required",value:function(){return"\n // validate "+this.address+" presence\n if (value === undefined) {\n valid = false\n errors.push({\n keyword: 'required',\n message: 'is required'\n })\n }\n "}},{key:"additionalItems",value:function(){var t=this.schema,n=t.items,i=t.additionalItems,o="";if(!1===i&&Array.isArray(n)&&(o+="\n // don't allow additional items\n if (value.length > "+n.length+") {\n valid = false\n errors.push({\n keyword: 'additionalItems',\n message: 'additional items not allowed'\n })\n }\n "),"object"===(void 0===i?"undefined":r(i))&&null!==i&&Array.isArray(n)){var a=new e(i),s=e.counter;o+="\n // additional items\n "+this.push()+"\n\n for (var i"+s+" = "+n.length+"; i"+s+" <= container.length; i"+s+"++) {\n value = container[i"+s+"]\n "+a.compile()+"\n }\n\n "+this.pop()+"\n "}return o}},{key:"items",value:function(){var t=this.schema.items,n=this.address,i="";if(Array.isArray(t))i+=this.push(),t.forEach(function(t,r){var o=new e(t,{address:n+"["+r+"]"});i+="\n // item #"+r+"\n value = container["+r+"]\n "+o.compile()+"\n "}),i+=this.pop();else if("object"===(void 0===t?"undefined":r(t))&&null!==t){var o=new e(t),a=e.counter;i+="\n // items\n "+this.push()+"\n\n for (var i"+a+" = 0; i"+a+" < container.length; i"+a+"++) {\n // read array element\n value = container[i"+a+"]\n "+o.compile()+"\n }\n\n "+this.pop()+"\n "}return i}},{key:"minItems",value:function(){return"\n // "+this.address+" min items\n if (value.length < "+this.schema.minItems+") {\n valid = false\n errors.push({\n keyword: 'minItems',\n message: 'too few properties'\n })\n }\n "}},{key:"maxItems",value:function(){return"\n // "+this.address+" max items\n if (value.length > "+this.schema.maxItems+") {\n valid = false\n errors.push({\n keyword: 'maxItems',\n message: 'too many properties'\n })\n }\n "}},{key:"uniqueItems",value:function(){var e="";return!0===this.schema.uniqueItems&&(e+="\n // validate "+this.address+" unique items\n let values = value.map(v => JSON.stringify(v)) // TODO: optimize\n let set = new Set(values)\n if (values.length !== set.size) {\n valid = false\n errors.push({\n keyword: 'uniqueItems',\n message: 'items must be unique'\n })\n }\n "),e}},{key:"minLength",value:function(){return"\n // "+this.address+" validate minLength\n if (Array.from(value).length < "+this.schema.minLength+") {\n valid = false\n errors.push({\n keyword: 'minLength',\n message: 'too short'\n })\n }\n "}},{key:"maxLength",value:function(){return"\n // "+this.address+" validate maxLength\n if (Array.from(value).length > "+this.schema.maxLength+") {\n valid = false\n errors.push({\n keyword: 'maxLength',\n message: 'too long'\n })\n }\n "}},{key:"pattern",value:function(){var e=this.schema.pattern;if(e)return"\n // "+this.address+" validate pattern\n if (!value.match(new RegExp('"+e+"'))) {\n valid = false\n errors.push({\n keyword: 'pattern',\n message: 'does not match the required pattern'\n })\n }\n "}},{key:"format",value:function(){var e=this.schema.format,t=this.address,n=o.resolve(e);if(n)return"\n // "+t+" validate format\n if (!value.match("+n+")) {\n valid = false\n errors.push({\n keyword: 'format',\n message: 'is not \""+e+"\" format'\n })\n }\n "}},{key:"minimum",value:function(){var e=this.schema;return"\n // "+this.address+" validate minimum\n if (value "+(!0===e.exclusiveMinimum?"<=":"<")+" "+e.minimum+") {\n valid = false\n errors.push({\n keyword: 'minimum',\n message: 'too small'\n })\n }\n "}},{key:"maximum",value:function(){var e=this.schema;return"\n // "+this.address+" validate maximum\n if (value "+(!0===e.exclusiveMaximum?">=":">")+" "+e.maximum+") {\n valid = false\n errors.push({\n keyword: 'maximum',\n message: 'too large'\n })\n }\n "}},{key:"multipleOf",value:function(){var e=this.schema.multipleOf,t="";if("number"==typeof e){var n=e.toString().length-e.toFixed(0).length-1,r=n>0?Math.pow(10,n):1;t+="\n if ("+(n>0?"(value * "+r+") % "+e*r+" !== 0":"value % "+e+" !== 0")+") {\n valid = false\n errors.push({\n keyword: 'multipleOf',\n message: 'must be a multiple of "+e+"'\n })\n }\n "}return t}}]),e}();e.exports=s},function(e,t,n){"use strict";var r=n(38),i=n(57),o=n(60),a=n(62),s=n(67),u=n(64),l=n(66),c=n(58),f=n(61),h=n(65),p=n(63);e.exports={JWA:r,JWK:i,JWKSet:o,JWT:a,JWS:s,Base64URLSchema:u,JOSEHeaderSchema:l,JWKSchema:c,JWKSetSchema:f,JWTClaimsSetSchema:h,JWTSchema:p}},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function d(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return B(e).length;default:if(r)return V(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,i){if(0===e.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:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var f=!0,h=0;hi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i.push(n%256),i.push(r);return i}(t,e.length-n),e,n,r)}function E(e,t,n){return r.fromByteArray(0===t&&n===e.length?e:e.slice(t,n))}function k(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+f<=n)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:a=e[i+2],128==(192&(o=e[i+1]))&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:a=e[i+2],s=e[i+3],128==(192&(o=e[i+1]))&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(r.push((c-=65536)>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=f}return function(e){var t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);for(var n="",r=0;rthis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return O(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}).apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(r,i),c=e.slice(t,n),f=0;fi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return v(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return x(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function T(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function R(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function j(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function D(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(e,t,n,r,o){return o||D(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,o){return o||D(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||A(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||A(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||A(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||A(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||A(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||A(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||A(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||A(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||A(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||N(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):j(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):j(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return M(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return M(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=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),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function B(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(21))},function(e,t,n){"use strict";t.byteLength=function(e){var t=l(e),n=t[1];return 3*(t[0]+n)/4-n},t.toByteArray=function(e){for(var t,n=l(e),r=n[0],a=n[1],s=new o(NaN),u=0,c=a>0?r-4:r,f=0;f>16&255,s[u++]=t>>8&255,s[u++]=255&t;return 2===a&&(t=i[e.charCodeAt(f)]<<2|i[e.charCodeAt(f+1)]>>4,s[u++]=255&t),1===a&&(t=i[e.charCodeAt(f)]<<10|i[e.charCodeAt(f+1)]<<4|i[e.charCodeAt(f+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t),s},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=0,s=n-i;as?s:a+16383));return 1===i?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,n){for(var i,o=[],a=t;a>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,c=-7,f=n?i-1:0,h=n?-1:1,p=e[t+f];for(f+=h,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+e[t+f],f+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+f],f+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=l}return(p?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=d,s/=256,i-=8);for(a=a<0;e[n+p]=255&a,p+=d,a/=256,l-=8);e[n+p-d]|=128*g}},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){let n=t.length,r=n%4;if(!r)return t;let i=n,o=4-r,a=e.alloc(n+o);for(a.write(t);o--;)a.write("=",i++);return a.toString()}}).call(this,n(41).Buffer)},function(e,t,n){"use strict";var r=n(47),i=n(48),o=n(52),a=new(n(53));a.define("HS256","sign",new i({name:"HMAC",hash:{name:"SHA-256"}})),a.define("HS384","sign",new i({name:"HMAC",hash:{name:"SHA-384"}})),a.define("HS512","sign",new i({name:"HMAC",hash:{name:"SHA-512"}})),a.define("RS256","sign",new o({name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}})),a.define("RS384","sign",new o({name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}})),a.define("RS512","sign",new o({name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}})),a.define("none","sign",new r({})),a.define("HS256","verify",new i({name:"HMAC",hash:{name:"SHA-256"}})),a.define("HS384","verify",new i({name:"HMAC",hash:{name:"SHA-384"}})),a.define("HS512","verify",new i({name:"HMAC",hash:{name:"SHA-512"}})),a.define("RS256","verify",new o({name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}})),a.define("RS384","verify",new o({name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}})),a.define("RS512","verify",new o({name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}})),a.define("none","verify",new r({})),a.define("RS256","importKey",new o({name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}})),a.define("RS384","importKey",new o({name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}})),a.define("RS512","importKey",new o({name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}})),e.exports=a},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n(r(c.configuration,"RelyingParty provider OpenID Configuration is missing"),r(f.authenticate,"RelyingParty default authentication parameters are missing"),r(h,"RelyingParty client registration is missing"),p=c.configuration.issuer,d=c.configuration.authorization_endpoint,g={client_id:h.client_id},m=Object.assign(f.authenticate,g,n),r(p,"Missing issuer in provider OpenID Configuration"),r(d,"Missing authorization_endpoint in provider OpenID Configuration"),r(m.scope,"Missing scope parameter in authentication request"),r(m.response_type,"Missing response_type parameter in authentication request"),r(m.client_id,"Missing client_id parameter in authentication request"),r(m.redirect_uri,"Missing redirect_uri parameter in authentication request"),m.state=Array.from(o.getRandomValues(new Uint8Array(16))),m.nonce=Array.from(o.getRandomValues(new Uint8Array(16))),Promise.all([o.subtle.digest({name:"SHA-256"},new Uint8Array(m.state)),o.subtle.digest({name:"SHA-256"},new Uint8Array(m.nonce))]))).then(e=>{let n=i(t.from(e[0])),r=i(t.from(e[1]));a[`${p}/requestHistory/${n}`]=JSON.stringify(m),m.state=n,m.nonce=r}).then(()=>l.generateSessionKeys()).then(e=>{l.storeSessionKeys(e,m,a)}).then(()=>{if(c.configuration.request_parameter_supported)return l.encodeRequestParams(m).then(e=>{m=e})}).then(()=>{let e=new u(d);return e.search=s.encode(m),e.href})}static generateSessionKeys(){return o.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(e=>Promise.all([o.subtle.exportKey("jwk",e.publicKey),o.subtle.exportKey("jwk",e.privateKey)])).then(e=>{let[t,n]=e;return{public:t,private:n}})}static storeSessionKeys(e,t,n){n["oidc.session.privateKey"]=JSON.stringify(e.private),t.key=e.public}static encodeRequestParams(e){const t=["scope","client_id","response_type","state"],n=Object.keys(e).filter(e=>!t.includes(e));let r={};return n.forEach(t=>{r[t]=e[t]}),new a({header:{alg:"none"},payload:r},{filter:!1}).encode().then(t=>({scope:e.scope,client_id:e.client_id,response_type:e.response_type,request:t,state:e.state}))}}e.exports=l}).call(this,n(41).Buffer)},function(e,t){e.exports=class{static encode(e){let t=[];return Object.keys(e).forEach(function(n){t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]))}),t.join("&")}static decode(e){let t={};return e.split("&").forEach(function(e){let n=e.split("="),r=decodeURIComponent(n[0]),i=decodeURIComponent(n[1]);t[r]=i}),t}}},function(e,t,n){(function(t,r){const{URL:i}=n(27),o=n(22),a=n(49),s=n(39),u=n(6),l=u.Headers?u.Headers:t.Headers,c=n(69),f=n(71),h=n(73),p=n(74),d=n(76);class g{constructor({rp:e,redirect:t,body:n,session:r,mode:i,params:o={}}){this.rp=e,this.redirect=t,this.body=n,this.session=r,this.mode=i,this.params=o}static validateResponse(e){return Promise.resolve(e).then(this.parseResponse).then(this.errorResponse).then(this.matchRequest).then(this.validateStateParam).then(this.validateResponseMode).then(this.validateResponseParams).then(this.exchangeAuthorizationCode).then(this.validateIDToken).then(h.fromAuthResponse)}static parseResponse(e){let{redirect:t,body:n}=e;if(t&&n||!t&&!n)throw new d(400,"Invalid response mode");if(t){let n=new i(t),{search:r,hash:o}=n;if(r&&o||!r&&!o)throw new d(400,"Invalid response mode");r&&(e.params=c.decode(r.substring(1)),e.mode="query"),o&&(e.params=c.decode(o.substring(1)),e.mode="fragment")}return n&&(e.params=c.decode(n),e.mode="form_post"),e}static errorResponse(e){const t=e.params.error;if(t){const n={};n.error=t,n.error_description=e.params.error_description,n.error_uri=e.params.error_uri,n.state=e.params.state;const r=new Error(`AuthenticationResponse error: ${t}`);throw r.info=n,r}return e}static matchRequest(e){let{rp:t,params:n,session:r}=e,i=n.state,o=t.provider.configuration.issuer;if(!i)throw new Error("Missing state parameter in authentication response");let a=r[`${o}/requestHistory/${i}`];if(!a)throw new Error("Mismatching state parameter in authentication response");return e.request=JSON.parse(a),e}static validateStateParam(e){let t=new Uint8Array(e.request.state),n=e.params.state;return a.subtle.digest({name:"SHA-256"},t).then(t=>{if(n!==s(r.from(t)))throw new Error("Mismatching state parameter in authentication response");return e})}static validateResponseMode(e){if("code"!==e.request.response_type&&"query"===e.mode)throw new Error("Invalid response mode");return e}static validateResponseParams(e){let{request:t,params:n}=e,r=t.response_type.split(" ");return r.includes("code")&&o(n.code,"Missing authorization code in authentication response"),r.includes("id_token")&&o(n.id_token,"Missing id_token in authentication response"),r.includes("token")&&(o(n.access_token,"Missing access_token in authentication response"),o(n.token_type,"Missing token_type in authentication response")),e}static exchangeAuthorizationCode(e){let{rp:t,params:n,request:i}=e,a=n.code;if(!a||"code"!==i.response_type)return Promise.resolve(e);let{provider:s,registration:f}=t,h=f.client_id,d=f.client_secret;if(!d)return Promise.reject(new Error("Client cannot exchange authorization code because it is not a confidential client"));let g=s.configuration.token_endpoint,m=new l({"Content-Type":"application/x-www-form-urlencoded"}),y={grant_type:"authorization_code",code:a,redirect_uri:i.redirect_uri},v=f.token_endpoint_auth_method||"client_secret_basic";if("client_secret_basic"===v){let e=new r(`${h}:${d}`).toString("base64");m.set("Authorization",`Basic ${e}`)}"client_secret_post"===v&&(y.client_id=h,y.client_secret=d);let b=c.encode(y);return u(g,{method:"POST",headers:m,body:b}).then(p("Error exchanging authorization code")).then(e=>e.json()).then(t=>(o(t.access_token,"Missing access_token in token response"),o(t.token_type,"Missing token_type in token response"),o(t.id_token,"Missing id_token in token response"),e.params=Object.assign(e.params,t),e))}static validateIDToken(e){return e.params.id_token?Promise.resolve(e).then(g.decryptIDToken).then(g.decodeIDToken).then(g.validateIssuer).then(g.validateAudience).then(g.resolveKeys).then(g.verifySignature).then(g.validateExpires).then(g.verifyNonce).then(g.validateAcr).then(g.validateAuthTime).then(g.validateAccessTokenHash).then(g.validateAuthorizationCodeHash):Promise.resolve(e)}static decryptIDToken(e){return Promise.resolve(e)}static decodeIDToken(e){let t=e.params.id_token;try{e.decoded=f.decode(t)}catch(e){const n=new d(400,"Error decoding ID Token");throw n.cause=e,n.info={id_token:t},n}return e}static validateIssuer(e){if(e.decoded.payload.iss!==e.rp.provider.configuration.issuer)throw new Error("Mismatching issuer in ID Token");return e}static validateAudience(e){let t=e.rp.registration,{aud:n,azp:r}=e.decoded.payload;if("string"==typeof n&&n!==t.client_id)throw new Error("Mismatching audience in id_token");if(Array.isArray(n)&&!n.includes(t.client_id))throw new Error("Mismatching audience in id_token");if(Array.isArray(n)&&!r)throw new Error("Missing azp claim in id_token");if(r&&r!==t.client_id)throw new Error("Mismatching azp claim in id_token");return e}static resolveKeys(e){let t=e.rp,n=e.decoded;return Promise.resolve(t.provider.jwks).then(e=>e||t.jwks()).then(t=>{if(n.resolveKeys(t))return Promise.resolve(e);throw new Error("Cannot resolve signing key for ID Token")})}static verifySignature(e){let t=e.rp.registration.id_token_signed_response_alg||"RS256";if(e.decoded.header.alg!==t)throw new Error(`Expected ID Token to be signed with ${t}`);return e.decoded.verify().then(t=>{if(!t)throw new Error("Invalid ID Token signature");return e})}static validateExpires(e){if(e.decoded.payload.exp<=Math.floor(Date.now()/1e3))throw new Error("Expired ID Token");return e}static verifyNonce(e){let t=new Uint8Array(e.request.nonce),n=e.decoded.payload.nonce;if(!n)throw new Error("Missing nonce in ID Token");return a.subtle.digest({name:"SHA-256"},t).then(t=>{if(n!==s(r.from(t)))throw new Error("Mismatching nonce in ID Token");return e})}static validateAcr(e){return e}static validateAuthTime(e){return e}static validateAccessTokenHash(e){return e}static validateAuthorizationCodeHash(e){return e}}e.exports=g}).call(this,n(21),n(41).Buffer)},function(e,t,n){const{JWT:r}=n(37),i=n(72);e.exports=class extends r{static get schema(){return i}}},function(e,t,n){const{JWTSchema:r}=n(37),i=r.extend({properties:{header:{},payload:{properties:{iss:{type:"string",format:"url"},sub:{type:"string",maxLength:255},auth_time:{type:"integer",format:"NumericDate"},nonce:{type:"string"},acr:{type:"string"},amr:{type:"array",items:{type:"string"}},azp:{type:"string",format:"StringOrURI"}},required:["iss","sub","aud","exp","iat"]}}});e.exports=i},function(e,t,n){"use strict";const r=n(6),i=n(74),o=n(75);class a{constructor(e){this.credentialType=e.credentialType||"access_token",this.issuer=e.issuer,this.authorization=e.authorization||{},this.sessionKey=e.sessionKey,this.idClaims=e.idClaims,this.accessClaims=e.accessClaims}static from(e){return new a(e)}static fromAuthResponse(e){const t=n(20);let r=e.decoded&&e.decoded.payload||{},{rp:i}=e;return a.from({credentialType:(i.defaults.authenticate||{}).credential_type||i.defaults.popToken?"pop_token":"access_token",sessionKey:e.session[t.SESSION_PRIVATE_KEY],issuer:r.iss,idClaims:r,authorization:{client_id:i.registration.client_id,access_token:e.params.access_token,id_token:e.params.id_token,refresh_token:e.params.refresh_token}})}get fetch(){return(e,t)=>Promise.resolve().then(()=>this.hasCredentials()?this.fetchWithCredentials(e,t):r(e,t)).then(i("Error while fetching resource"))}bearerTokenFor(e){switch(this.credentialType){case"pop_token":return o.issueFor(e,this);default:return Promise.resolve(this.authorization[this.credentialType])}}hasCredentials(){switch(this.credentialType){case"pop_token":return!!this.authorization.id_token;default:return!!this.authorization[this.credentialType]}}fetchWithCredentials(e,t={}){return t.headers=t.headers||{},this.bearerTokenFor(e).then(n=>(t.headers.authorization=`Bearer ${n}`,r(e,t)))}}e.exports=a},function(e,t,n){"use strict";e.exports=function(e="fetch error"){return t=>{if(t.status>=200&&t.status<300)return t;let n=new Error(`${e}: ${t.status} ${t.statusText}`);throw n.response=t,n.statusCode=t.status,n}}},function(e,t,n){"use strict";const{URL:r}=n(27),{JWT:i,JWK:o}=n(37),a=3600;class s extends i{static issueFor(e,t){if(!e)throw new Error("Cannot issue PoPToken - missing resource server URI");if(!t.sessionKey)throw new Error("Cannot issue PoPToken - missing session key");if(!t.authorization.id_token)throw new Error("Cannot issue PoPToken - missing id token");let n=JSON.parse(t.sessionKey);return o.importKey(n).then(n=>{let i={aud:new r(e).origin,key:n,iss:t.authorization.client_id,id_token:t.authorization.id_token};return s.issue(i)}).then(e=>e.encode())}static issue(e){let{aud:t,iss:n,key:r}=e,i=r.alg,o=e.iat||Math.floor(Date.now()/1e3);return new s({header:{alg:i},payload:{iss:n,aud:t,exp:o+(e.max||a),iat:o,id_token:e.id_token,token_type:"pop"},key:r.cryptoKey},{filter:!1})}}e.exports=s},function(e,t,n){t=e.exports=a;var r=n(77),i=n(78),o=t;function a(e,t,n){if("string"==typeof e&&(e=o[e]),"number"!=typeof e)throw new TypeError("Non-numeric HTTP code");"object"==typeof t&&null!=t&&(n=t,t=null),r.call(this,t||i[e],n),this.code=e}for(var s in(a.prototype=Object.create(r.prototype,{constructor:{value:a,configurable:!0,writable:!0}})).name="HttpError",Object.defineProperties(a.prototype,{statusCode:u("code"),statusMessage:u("message"),status:{configurable:!0,get:function(){return this.code},set:function(e){Object.defineProperty(this,"status",{value:e,configurable:!0,enumerable:!0,writable:!0})}}}),a.prototype.toString=function(){return this.name+": "+this.code+" "+this.message},i)t[i[s].replace("'","").replace(/[- ]/g,"_").toUpperCase()]=+s;function u(e){return{configurable:!0,get:function(){return this[e]},set:function(t){return this[e]=t}}}},function(e,t){var n=Object.hasOwnProperty,r=Object.getPrototypeOf,i=Error.captureStackTrace;function o(e,t){if(e&&"object"==typeof e?(t=e,e=void 0):this.message=e,t)for(var o in t)this[o]=t[o];n.call(this,"name")||(this.name=n.call(r(this),"name")?this.name:this.constructor.name),!i||"stack"in this||i(this,this.constructor)}e.exports=o,(o.prototype=Object.create(Error.prototype,{constructor:{value:o,configurable:!0,writable:!0}})).name="StandardError"},function(e){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},function(e,t,n){const{JSONSchema:r}=n(28),i=new r({type:"object",properties:{provider:{type:"object",properties:{name:{type:"string"},url:{type:"string",format:"uri"},configuration:{},jwks:{}},required:["url"]},defaults:{type:"object",properties:{popToken:{type:"boolean",default:!1},authenticate:{type:"object",properties:{redirect_uri:{type:"string",format:"uri"},response_type:{type:"string",default:"id_token token",enum:["code","token","id_token token","id_token token code"]},display:{type:"string",default:"page",enum:["page","popup"]},scope:{type:["string","array"],default:["openid"]}}},register:{}}},registration:{},store:{type:"object",default:{}}}});e.exports=i},function(e,t,n){"use strict";var r=function(){function e(e,t){for(var n=0;n{const u=new r.Server(t,Object(i.originOf)(n.popupUri||""),s(e,n,e=>{u.stop(),o(e)}));u.start()})}function s(e,{popupUri:t,callbackUri:n},r){return async(i,...o)=>{switch(i){case"getAppOrigin":return window.location.origin;case"storage/getItem":return e.getItem(...o);case"storage/setItem":return e.setItem(...o);case"storage/removeItem":return e.removeItem(...o);case"getLoginOptions":return{popupUri:t,callbackUri:n};case"foundSession":r(...o)}}}}]).default},function(e,t,n){(function(t){var n=String.fromCharCode,r="function"==typeof t?t:function(e){setTimeout(e,0)},i=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\[uU]|\\(.)/g,o={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},a=/[\x00-\x20<>\\"\{\}\|\^\`]/;function s(e){if(!(this instanceof s))return new s(e);if(e&&e.lineMode){this._tripleQuotedString=this._number=this._boolean=/$0^/;var t=this;this._tokenize=this.tokenize,this.tokenize=function(e,n){this._tokenize(e,function(e,r){!e&&/^(?:IRI|prefixed|literal|langcode|type|\.|eof)$/.test(r.type)?n&&n(e,r):n&&n(e||t._syntaxError(r.type,n=null))})}}}s.prototype={_iri:/^<((?:[^>\\]|\\[uU])+)>/,_unescapedIri:/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>/,_unescapedString:/^"[^"\\]+"(?=[^"\\])/,_singleQuotedString:/^"[^"\\]*(?:\\.[^"\\]*)*"(?=[^"\\])|^'[^'\\]*(?:\\.[^'\\]*)*'(?=[^'\\])/,_tripleQuotedString:/^""("[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*")""|^''('[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*')''/,_langcode:/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,_prefix:/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,_prefixed:/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?=\.?[,;\s#()\[\]\{\}"'<])/,_blank:/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=\.?[,;:\s#()\[\]\{\}"'<])/,_number:/^[\-+]?(?:\d+\.?\d*([eE](?:[\-\+])?\d+)|\d*\.?\d+)(?=[.,;:\s#()\[\]\{\}"'<])/,_boolean:/^(?:true|false)(?=[.,;:\s#()\[\]\{\}"'<])/,_keyword:/^@[a-z]+(?=[\s#<:])/,_sparqlKeyword:/^(?:PREFIX|BASE|GRAPH)(?=[\s#<:])/i,_shortPredicates:/^a(?=\s+|<)/,_newline:/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,_whitespace:/^[ \t]+/,_endOfFile:/^(?:#[^\n\r]*)?$/,_tokenizeToEnd:function(e,t){for(var n=this._input;;){for(var r;r=this._newline.exec(n);)n=n.substr(r[0].length,n.length),this._line++;if((r=this._whitespace.exec(n))&&(n=n.substr(r[0].length,n.length)),this._endOfFile.test(n))return t&&e(n=null,{line:this._line,type:"eof",value:"",prefix:""}),this._input=n;var i,o=this._line,s="",u="",l="",c=n[0],f=null,h=0,p=!1;switch(c){case"^":if(1===n.length)break;if("^"!==n[1])return d(this);if(this._prevTokenType="^","<"!==(n=n.substr(2))[0]){p=!0;break}case"<":if(f=this._unescapedIri.exec(n))s="IRI",u=f[1];else if(f=this._iri.exec(n)){if(null===(i=this._unescape(f[1]))||a.test(i))return d(this);s="IRI",u=i}break;case"_":((f=this._blank.exec(n))||t&&(f=this._blank.exec(n+" ")))&&(s="prefixed",l="_",u=f[1]);break;case'"':case"'":if(f=this._unescapedString.exec(n))s="literal",u=f[0];else if(f=this._singleQuotedString.exec(n)){if(null===(i=this._unescape(f[0])))return d(this);s="literal",u=i.replace(/^'|'$/g,'"')}else if(f=this._tripleQuotedString.exec(n)){if(this._line+=(i=f[1]||f[2]).split(/\r\n|\r|\n/).length-1,null===(i=this._unescape(i)))return d(this);s="literal",u=i.replace(/^'|'$/g,'"')}break;case"@":"literal"===this._prevTokenType&&(f=this._langcode.exec(n))?(s="langcode",u=f[1]):(f=this._keyword.exec(n))&&(s=f[0]);break;case".":if(1===n.length?t:n[1]<"0"||n[1]>"9"){s=".",h=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(f=this._number.exec(n))&&(s="literal",u='"'+f[0]+'"^^http://www.w3.org/2001/XMLSchema#'+(f[1]?"double":/^[+\-]?\d+$/.test(f[0])?"integer":"decimal"));break;case"B":case"b":case"p":case"P":case"G":case"g":(f=this._sparqlKeyword.exec(n))?s=f[0].toUpperCase():p=!0;break;case"f":case"t":(f=this._boolean.exec(n))?(s="literal",u='"'+f[0]+'"^^http://www.w3.org/2001/XMLSchema#boolean'):p=!0;break;case"a":(f=this._shortPredicates.exec(n))?(s="abbreviation",u="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"):p=!0;break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":h=1,s=c;break;default:p=!0}if(p&&("@prefix"!==this._prevTokenType&&"PREFIX"!==this._prevTokenType||!(f=this._prefix.exec(n))?((f=this._prefixed.exec(n))||t&&(f=this._prefixed.exec(n+" ")))&&(s="prefixed",l=f[1]||"",u=this._unescape(f[2])):(s="prefix",u=f[1]||"")),"^"===this._prevTokenType&&(s="IRI"===s||"prefixed"===s?"type":""),!s)return t||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?d(this):this._input=n;e(null,{line:o,type:s,value:u,prefix:l}),this._prevTokenType=s,n=n.substr(h||f[0].length,n.length)}function d(t){e(t._syntaxError(/^\S*/.exec(n)[0]))}},_unescape:function(e){try{return e.replace(i,function(e,t,r,i){var a;if(t){if(a=parseInt(t,16),isNaN(a))throw new Error;return n(a)}if(r){if(a=parseInt(r,16),isNaN(a))throw new Error;return a<=65535?n(a):n(55296+(a-=65536)/1024,56320+(1023&a))}var s=o[i];if(!s)throw new Error;return s})}catch(e){return null}},_syntaxError:function(e){return this._input=null,new Error('Syntax error: unexpected "'+e+'" on line '+this._line+".")},tokenize:function(e,t){var n=this;function i(e){null!==n._input&&(n._input+=e,n._tokenizeToEnd(t,!1))}function o(){null!==n._input&&n._tokenizeToEnd(t,!0)}this._line=1,"string"==typeof e?(this._input=e,r(function(){n._tokenizeToEnd(t,!0)})):(this._input="",e&&"function"!=typeof e?("function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",i),e.on("end",o)):(this.addChunk=i,this.end=o,t||(t=e)))}},e.exports=s}).call(this,n(16).setImmediate)},function(e,t,n){var r=n(29),i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",o=i+"nil",a=i+"first",s=/^[a-z][a-z0-9+.-]*:/i,u=/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i,l=/(?:^|\/)\.\.?(?:$|[\/#?])/,c=0,f=0;function h(e){if(!(this instanceof h))return new h(e);this._tripleStack=[],this._graph=null,this._setBase((e=e||{}).documentIRI);var t="string"==typeof e.format&&e.format.match(/\w*$/)[0].toLowerCase(),n="turtle"===t,i="trig"===t,o=/triple/.test(t),a=/quad/.test(t),s=o||a;(this._supportsNamedGraphs=!n)||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||i||o),s&&(this._base="",this._resolveIRI=function(e){return this._error("Disallowed relative IRI",e),this._callback=p,this._subject=null}),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":"_:"+e.blankNodePrefix.replace(/^_:/,""),this._lexer=e.lexer||new r({lineMode:s})}function p(){}h._resetBlankNodeIds=function(){c=f=0},h.prototype={_setBase:function(e){if(e){if(e.indexOf("#")>=0)throw new Error("Invalid base IRI "+e)}else e=null;(this._base=e)&&(this._basePath=e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(u),this._baseRoot=e[0],this._baseScheme=e[1])},_readInTopContext:function(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"@prefix":return this._sparqlStyle=!1,this._readPrefix;case"PREFIX":return this._sparqlStyle=!0,this._readPrefix;case"@base":return this._sparqlStyle=!1,this._readBaseIRI;case"BASE":return this._sparqlStyle=!0,this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}},_readSubject:function(e){switch(this._predicate=null,e.type){case"IRI":this._subject=null===this._base||s.test(e.value)?e.value:this._resolveIRI(e);break;case"prefixed":var t=this._prefixes[e.prefix];if(void 0===t)return this._error('Undefined prefix "'+e.prefix+':"',e);this._subject=t+e.value;break;case"[":return this._subject="_:b"+f++,this._tripleStack.push({subject:this._subject,predicate:null,object:null,type:"blank"}),this._readBlankNodeHead;case"(":return this._tripleStack.push({subject:o,predicate:null,object:null,type:"list"}),this._subject=null,this._readListItem;case"}":return this._readPunctuation(e);default:return this._error("Expected subject but got "+e.type,e)}return this._readPredicateOrNamedGraph},_readPredicate:function(e){var t=e.type;switch(t){case"IRI":case"abbreviation":this._predicate=null===this._base||s.test(e.value)?e.value:this._resolveIRI(e);break;case"prefixed":if("_"===e.prefix)return this._error("Disallowed blank node as predicate",e);var n=this._prefixes[e.prefix];if(void 0===n)return this._error('Undefined prefix "'+e.prefix+':"',e);this._predicate=n+e.value;break;case".":case"]":case"}":return null===this._predicate?this._error("Unexpected "+t,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._readPredicate;default:return this._error('Expected predicate to follow "'+this._subject+'"',e)}return this._readObject},_readObject:function(e){switch(e.type){case"IRI":this._object=null===this._base||s.test(e.value)?e.value:this._resolveIRI(e);break;case"prefixed":var t=this._prefixes[e.prefix];if(void 0===t)return this._error('Undefined prefix "'+e.prefix+':"',e);this._object=t+e.value;break;case"literal":return this._object=e.value,this._readDataTypeOrLang;case"[":var n="_:b"+f++;return this._tripleStack.push({subject:this._subject,predicate:this._predicate,object:n,type:"blank"}),this._subject=n,this._readBlankNodeHead;case"(":return this._tripleStack.push({subject:this._subject,predicate:this._predicate,object:o,type:"list"}),this._subject=null,this._readListItem;default:return this._error('Expected object to follow "'+this._predicate+'"',e)}return this._getTripleEndReader()},_readPredicateOrNamedGraph:function(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)},_readGraph:function(e){return"{"!==e.type?this._error("Expected graph but got "+e.type,e):(this._graph=this._subject,this._subject=null,this._readSubject)},_readBlankNodeHead:function(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))},_readBlankNodeTail:function(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._callback(null,{subject:this._subject,predicate:this._predicate,object:this._object,graph:this._graph||""});var t=this._tripleStack.pop();return this._subject=t.subject,null!==t.object?(this._predicate=t.predicate,this._object=t.object,this._getTripleEndReader()):null!==this._predicate?this._readPredicate:this._readPredicateOrNamedGraph},_readDataTypeOrLang:function(e){switch(e.type){case"type":var t;if(""===e.prefix)t=null===this._base||s.test(e.value)?e.value:this._resolveIRI(e);else{var n=this._prefixes[e.prefix];if(void 0===n)return this._error('Undefined prefix "'+e.prefix+':"',e);t=n+e.value}return this._object+="^^"+t,this._getTripleEndReader();case"langcode":return this._object+="@"+e.value.toLowerCase(),this._getTripleEndReader();default:return this._getTripleEndReader().call(this,e)}},_readListItem:function(e){var t=null,n=null,r=this._subject,i=this._tripleStack,u=i[i.length-1],l=this._readListItem;switch(e.type){case"IRI":t=null===this._base||s.test(e.value)?e.value:this._resolveIRI(e);break;case"prefixed":var c=this._prefixes[e.prefix];if(void 0===c)return this._error('Undefined prefix "'+e.prefix+':"',e);t=c+e.value;break;case"literal":t=e.value,l=this._readDataTypeOrLang;break;case"[":n="_:b"+f++,t="_:b"+f++,i.push({subject:n,predicate:a,object:t,type:"blank"}),this._subject=t,l=this._readBlankNodeHead;break;case"(":n="_:b"+f++,i.push({subject:n,predicate:a,object:o,type:"list"}),this._subject=null,l=this._readListItem;break;case")":if(i.pop(),0!==i.length&&"list"===i[i.length-1].type&&this._callback(null,{subject:u.subject,predicate:u.predicate,object:u.object,graph:this._graph||""}),this._subject=u.subject,null===u.predicate){if(l=this._readPredicate,u.subject===o)return l}else if(this._predicate=u.predicate,this._object=u.object,l=this._getTripleEndReader(),u.object===o)return l;n=o;break;default:return this._error('Expected list item instead of "'+e.type+'"',e)}return null===n&&(this._subject=n="_:b"+f++),null===r?u.object===o?u.object=n:u.subject=n:this._callback(null,{subject:r,predicate:"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",object:n,graph:this._graph||""}),null!==t&&this._callback(null,{subject:n,predicate:a,object:t,graph:this._graph||""}),l},_readPunctuation:function(e){var t,n=this._subject,r=this._graph;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);this._graph=null;case".":this._subject=null,t=this._readInTopContext;break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;case"IRI":if(this._supportsQuads&&null===this._graph){r=null===this._base||s.test(e.value)?e.value:this._resolveIRI(e),n=this._subject,t=this._readQuadPunctuation;break}case"prefixed":if(this._supportsQuads&&null===this._graph){var i=this._prefixes[e.prefix];if(void 0===i)return this._error('Undefined prefix "'+e.prefix+':"',e);r=i+e.value,t=this._readQuadPunctuation;break}default:return this._error('Expected punctuation to follow "'+this._object+'"',e)}return null!==n&&this._callback(null,{subject:n,predicate:this._predicate,object:this._object,graph:r||""}),t},_readBlankNodePunctuation:function(e){var t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error('Expected punctuation to follow "'+this._object+'"',e)}return this._callback(null,{subject:this._subject,predicate:this._predicate,object:this._object,graph:this._graph||""}),t},_readQuadPunctuation:function(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext},_readPrefix:function(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)},_readPrefixIRI:function(e){return"IRI"!==e.type?this._error('Expected IRI to follow prefix "'+this._prefix+':"',e):(t=null===this._base||s.test(e.value)?e.value:this._resolveIRI(e),this._prefixes[this._prefix]=t,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation);var t},_readBaseIRI:function(e){if("IRI"!==e.type)return this._error("Expected IRI to follow base declaration",e);try{this._setBase(null===this._base||s.test(e.value)?e.value:this._resolveIRI(e))}catch(t){this._error(t.message,e)}return this._readDeclarationPunctuation},_readNamedGraphLabel:function(e){switch(e.type){case"IRI":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}},_readNamedGraphBlankLabel:function(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject="_:b"+f++,this._readGraph)},_readDeclarationPunctuation:function(e){return this._sparqlStyle?this._readInTopContext(e):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext},_getTripleEndReader:function(){var e=this._tripleStack;if(0===e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem}},_error:function(e,t){this._callback(new Error(e+" at line "+t.line+"."))},_resolveIRI:function(e){var t=e.value;switch(t[0]){case void 0:return this._base;case"#":return this._base+t;case"?":return this._base.replace(/(?:\?.*)?$/,t);case"/":return("/"===t[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(t);default:return this._removeDotSegments(this._basePath+t)}},_removeDotSegments:function(e){if(!l.test(e))return e;for(var t="",n=e.length,r=-1,i=-1,o=0,a="/";r=i&&(t=t.substr(0,o)),"/"!==a)return t+"/"+e.substr(r+1);o=r+1}}}a=e[++r]}return t+e.substring(o)},parse:function(e,t,n){this._readCallback=this._readInTopContext,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix||"_:b"+c+++"_","function"==typeof e&&(n=t,t=e,e=null),this._callback=t||p,this._prefixCallback=n||p;var r=this;this._lexer.tokenize(e,function(e,t){null!==e?(r._callback(e),r._callback=p):void 0!==r._readCallback&&(r._readCallback=r._readCallback(t))}),e||(this.addChunk=this._lexer.addChunk,this.end=this._lexer.end)}},e.exports=h},function(e,t){var n={isIRI:function(e){if(!e)return e;var t=e[0];return'"'!==t&&"_"!==t},isLiteral:function(e){return e&&'"'===e[0]},isBlank:function(e){return e&&"_:"===e.substr(0,2)},getLiteralValue:function(e){var t=/^"([^]*)"/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]},getLiteralType:function(e){var t=/^"[^]*"(?:\^\^([^"]+)|(@)[^@"]+)?$/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]||(t[2]?"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString":"http://www.w3.org/2001/XMLSchema#string")},getLiteralLanguage:function(e){var t=/^"[^]*"(?:@([^@"]+)|\^\^[^"]+)?$/.exec(e);if(!t)throw new Error(e+" is not a literal");return t[1]?t[1].toLowerCase():""},isPrefixedName:function(e){return e&&/^[^:\/"']*:[^:\/"']+$/.test(e)},expandPrefixedName:function(e,t){var n,r,i,o=/(?:^|"\^\^)([^:\/#"'\^_]*):[^\/]*$/.exec(e);return o&&(r=t[n=o[1]],i=o.index),void 0===r?e:0===i?r+e.substr(n.length+1):e.substr(0,i+3)+r+e.substr(i+n.length+4)},createIRI:function(e){return e&&'"'===e[0]?n.getLiteralValue(e):e},createLiteral:function(e,t){if(!t)switch(typeof e){case"boolean":t="http://www.w3.org/2001/XMLSchema#boolean";break;case"number":if(isFinite(e)){t=e%1==0?"http://www.w3.org/2001/XMLSchema#integer":"http://www.w3.org/2001/XMLSchema#decimal";break}default:return'"'+e+'"'}return'"'+e+(/^[a-z]+(-[a-z0-9]+)*$/i.test(t)?'"@'+t.toLowerCase():'"^^'+t)}};function r(e,t){for(var r in n)t?e.prototype[r]=i(n[r]):e[r]=n[r];return e}function i(e){return function(t){return e(this,t)}}e.exports=r(r)},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function i(e){return"object"==typeof e&&null!==e}function o(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,a,s,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(o(n=this._events[e]))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(i(n))for(s=Array.prototype.slice.call(arguments,1),a=(l=n.slice()).length,u=0;u0&&this._events[e].length>a&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.once=function(e,t){if(!r(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},n.prototype.removeListener=function(e,t){var n,o,a,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(a=(n=this._events[e]).length,o=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){o=s;break}if(o<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){(t=e.exports=n(49)).Stream=t,t.Readable=t,t.Writable=n(34),t.Duplex=n(12),t.Transform=n(55),t.PassThrough=n(76)},function(e,t,n){"use strict";(function(t,r,i){var o=n(21);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;for(e.entry=null;r;){var i=r.callback;t.pendingcb--,i(void 0),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=v;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:o.nextTick;v.WritableState=y;var l=n(17);l.inherits=n(11);var c,f={deprecate:n(75)},h=n(51),p=n(22).Buffer,d=i.Uint8Array||function(){},g=n(53);function m(){}function y(e,t){s=s||n(12);var r=t instanceof s;this.objectMode=!!(e=e||{}).objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,l=e.writableHighWaterMark;this.highWaterMark=i||0===i?i:r&&(l||0===l)?l:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===e.decodeStrings),this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(o.nextTick(i,r),o.nextTick(E,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),E(e,t))}(e,n,r,t,i);else{var a=x(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||_(e,n),r?u(w,e,n,a,i):w(e,n,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function v(e){if(s=s||n(12),!(c.call(v,this)||this instanceof s))return new v(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),h.call(this)}function b(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function w(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),E(e,t)}function _(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=new Array(t.bufferedRequestCount),i=t.corkedRequestsFree;i.entry=n;for(var o=0,s=!0;n;)r[o]=n,n.isBuf||(s=!1),n=n.next,o+=1;r.allBuffers=s,b(e,t,!0,t.length,r,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk;if(b(e,t,!1,t.objectMode?1:u.length,u,n.encoding,n.callback),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function x(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function S(e,t){e._final(function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),E(e,t)})}function E(e,t){var n=x(t);return n&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(S,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}l.inherits(v,h),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===v&&e&&e._writableState instanceof y}})):c=function(e){return e instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(e,t,n){var r,i=this._writableState,a=!1,s=!i.objectMode&&(p.isBuffer(r=e)||r instanceof d);return s&&!p.isBuffer(e)&&(e=function(e){return p.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=m),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),o.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var i=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(r,a),i=!1),i}(this,i,e,n))&&(i.pendingcb++,a=function(e,t,n,r,i,o){if(!n){var a=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=p.from(t,i)),t}(t,r);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,E(e,t),n&&(t.finished?o.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),v.prototype.destroy=g.destroy,v.prototype._undestroy=g.undestroy,v.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(8),n(16).setImmediate,n(6))},function(e,t){var n=/^"([^]*)"(?:\^\^(.+)|@([\-a-z]+))?$/i,r=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,i=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,o={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};function a(e,t){if(!(this instanceof a))return new a(e,t);if(e&&"function"!=typeof e.write&&(t=e,e=null),t=t||{},e)this._outputStream=e,this._endStream=void 0===t.end||!!t.end;else{var n="";this._outputStream={write:function(e,t,r){n+=e,r&&r()},end:function(e){e&&e(null,n)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?this._writeTriple=this._writeTripleLine:(this._graph="",this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes))}function s(e){var t=o[e];return void 0===t&&(1===e.length?(t=e.charCodeAt(0).toString(16),t="\\u0000".substr(0,6-t.length)+t):(t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16),t="\\U00000000".substr(0,10-t.length)+t)),t}a.prototype={_write:function(e,t){this._outputStream.write(e,"utf8",t)},_writeTriple:function(e,t,n,r,i){try{this._graph!==r&&(this._write((null===this._subject?"":this._graph?"\n}\n":".\n")+(r?this._encodeIriOrBlankNode(r)+" {\n":"")),this._subject=null,this._graph="["!==r[0]?r:"]"),this._write(this._subject===e?this._predicate===t?", "+this._encodeObject(n):";\n "+this._encodePredicate(this._predicate=t)+" "+this._encodeObject(n):(null===this._subject?"":".\n")+this._encodeSubject(this._subject=e)+" "+this._encodePredicate(this._predicate=t)+" "+this._encodeObject(n),i)}catch(e){i&&i(e)}},_writeTripleLine:function(e,t,n,r,i){delete this._prefixMatch;try{this._write(this._encodeIriOrBlankNode(e)+" "+this._encodeIriOrBlankNode(t)+" "+this._encodeObject(n)+(r?" "+this._encodeIriOrBlankNode(r)+".\n":".\n"),i)}catch(e){i&&i(e)}},_encodeIriOrBlankNode:function(e){var t=e[0];if("["===t||"("===t||"_"===t&&":"===e[1])return e;r.test(e)&&(e=e.replace(i,s));var n=this._prefixRegex.exec(e);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:e:"<"+e+">"},_encodeLiteral:function(e,t,n){return r.test(e)&&(e=e.replace(i,s)),n?'"'+e+'"@'+n:t?'"'+e+'"^^'+this._encodeIriOrBlankNode(t):'"'+e+'"'},_encodeSubject:function(e){if('"'===e[0])throw new Error("A literal as subject is not allowed: "+e);return"["===e[0]&&(this._subject="]"),this._encodeIriOrBlankNode(e)},_encodePredicate:function(e){if('"'===e[0])throw new Error("A literal as predicate is not allowed: "+e);return"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===e?"a":this._encodeIriOrBlankNode(e)},_encodeObject:function(e){if('"'!==e[0])return this._encodeIriOrBlankNode(e);var t=n.exec(e);if(!t)throw new Error("Invalid literal: "+e);return this._encodeLiteral(t[1],t[2],t[3])},_blockedWrite:function(){throw new Error("Cannot write because the writer has been closed.")},addTriple:function(e,t,n,r,i){void 0===n?this._writeTriple(e.subject,e.predicate,e.object,e.graph||"",t):"string"!=typeof r?this._writeTriple(e,t,n,"",r):this._writeTriple(e,t,n,r,i)},addTriples:function(e){for(var t=0;t.\n"))}if(r){var a="",s="";for(var u in n)a+=a?"|"+u:u,s+=(s?"|":"")+n[u];a=a.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp("^(?:"+s+")[^/]*$|^("+a+")([a-zA-Z][\\-_a-zA-Z0-9]*)$")}this._write(r?"\n":"",t)},blank:function(e,t){var n,r,i=e;switch(void 0===e?i=[]:"string"==typeof e?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),r=i.length){case 0:return"[]";case 1:if("["!==(n=i[0]).object[0])return"[ "+this._encodePredicate(n.predicate)+" "+this._encodeObject(n.object)+" ]";default:for(var o="[",a=0;a0&&a.add(n.resource,k.dc("title"),a.literal(s[0].textContent),n.resource);for(var u=this.dom.getElementsByTagName("link"),l=u.length-1;l>=0;l--)o=!1,(i=u[l].getAttribute("rel"))||(i=u[l].getAttribute("rev"),o=!0),i&&e.linkData(n.original,i,u[l].getAttribute("href"),n.resource,o);for(var c=this.dom.getElementsByTagName("script"),f=0;f]+\?>/))return e.addStatus(n.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new O(this.response).parse(e,t,n,r);if(t.match(/.*/))return e.addStatus(n.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new O(this.response).parse(e,t,n,r);if(t.match(/[^(/))return e.addStatus(n.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new O(this.response).parse(e,t,n,r);var o=new RegExp("([\\s\\S]+?)","im").exec(t);return o&&i.add(n.resource,k.dc("title"),i.literal(o[1]),n.resource),i.add(n.resource,k.rdf("type"),k.link("WebPage"),e.appNode),e.addStatus(n.req,"non-XML HTML document, not parsed for data."),e.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"HTMLHandler"}},{key:"register",value:function(e){e.mediatypes["text/html"]={q:.9}}}]),t}();P.pattern=new RegExp("text/html");var A=function(e){function t(){return l(this,t),a(this,s(t).apply(this,arguments))}return u(t,C),o(t,[{key:"parse",value:function(e,t,n,r){return t.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)?(e.addStatus(n.req,"Warning: "+n.resource+" has an XML declaration. We'll assume it's XML but its content-type wasn't XML.\n"),new I(this.response).parse(e,t,n,r)):t.slice(0,500).match(/xmlns:/)?(e.addStatus(n.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new I(this.response).parse(e,t,n,r)):(e.addStatus(n.req,"Plain text document, no known RDF semantics."),e.doneFetch(n,this.response))}}],[{key:"toString",value:function(){return"TextHandler"}},{key:"register",value:function(e){e.mediatypes["text/plain"]={q:.5}}}]),t}();A.pattern=new RegExp("text/plain");var N=function(e){function t(){return l(this,t),a(this,s(t).apply(this,arguments))}return u(t,C),o(t,[{key:"parse",value:function(e,t,n,r){var i=e.store,o=h(i,i,n.original.uri,n.original.uri,null,null,"",null);try{o.loadBuf(t)}catch(t){return e.failFetch(n,"Error trying to parse "+n.resource+" as Notation3:\n"+t,"parse_error",r)}return e.addStatus(n.req,"N3 parsed: "+o.statementCount+" triples in "+o.lines+" lines."),e.store.add(n.original,k.rdf("type"),k.link("RDFDocument"),e.appNode),e.doneFetch(n,this.response)}}],[{key:"toString",value:function(){return"N3Handler"}},{key:"register",value:function(e){e.mediatypes["text/n3"]={q:"1.0"},e.mediatypes["text/turtle"]={q:1}}}]),t}();N.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");var R={RDFXMLHandler:T,XHTMLHandler:O,XMLHandler:I,HTMLHandler:P,TextHandler:A,N3Handler:N},j=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(l(this,e),this.store=t||new c,this.timeout=r.timeout||3e4,this._fetch=r.fetch||x,!this._fetch)throw new Error("No _fetch function availble for Fetcher");this.appNode=this.store.bnode(),this.store.fetcher=this,this.requested={},this.timeouts={},this.redirectedTo={},this.fetchQueue={},this.fetchCallbacks={},this.nonexistent={},this.lookedUp={},this.handlers=[],this.mediatypes={"image/*":{q:.9},"*/*":{q:.1}},b.callbackify(this,["request","fail","refresh","retract","done"]),Object.keys(R).map(function(e){return n.addHandler(R[e])})}return o(e,[{key:"load",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e instanceof Array)return Promise.all(e.map(function(e){return t.load(e,Object.assign({},n))}));var r=e.uri||e;return r=r.split("#")[0],n=this.initFetchOptions(r,n),this.pendingFetchPromise(r,n.baseURI,n)}},{key:"pendingFetchPromise",value:function(e,t,n){var r,i=this;return!n.force&&this.fetchQueue[t]?r=this.fetchQueue[t]:(r=Promise.race([this.setRequestTimeout(e,n),this.fetchUri(e,n)]),this.fetchQueue[t]=r,this.cleanupFetchRequest(t,n,this.timeout)),r.then(function(t){return e in i.timeouts&&(i.timeouts[e].forEach(clearTimeout),delete i.timeouts[e]),t})}},{key:"cleanupFetchRequest",value:function(e,t,n){var r=this;this.timeouts[e]=(this.timeouts[e]||[]).concat(setTimeout(function(){r.isPending(e)||delete r.fetchQueue[e]},n))}},{key:"initFetchOptions",value:function(t,n){var r=this.store;!n.method||"GET"===n.method.toUpperCase()||(n.force=!0),n.resource=r.sym(t),n.baseURI=n.baseURI||t,n.original=r.sym(n.baseURI),n.req=r.bnode(),n.headers=n.headers||{},n.contentType&&(n.headers["content-type"]=n.contentType),n.force&&(n.cache="no-cache");var i=this.acceptString();n.headers.accept=i;var o=e.offlineOverride(t);n.requestedURI=o,e.withCredentials(o,n)&&(n.credentials="include");var a=e.proxyIfNecessary(o);return o!==a&&(n.proxyUsed=!0),n.actualProxyURI=a,n}},{key:"fetchUri",value:function(t,n){var r=this;if(!t)return Promise.reject(new Error("Cannot fetch an empty uri"));if(e.unsupportedProtocol(t))return this.failFetch(n,"fetcher: Unsupported protocol","unsupported_protocol");var i=this.getState(t);if(n.force)delete this.nonexistent[t];else{if("fetched"===i)return Promise.resolve(this.doneFetch(n,{status:200,ok:!0,statusText:"Already loaded into quadstore."}));if("failed"===i&&404===this.requested[t]){var o="Previously failed: "+this.requested[t];return this.failFetch(n,o,this.requested[t],{url:t,status:this.requested[t],statusText:o,responseText:o,headers:{},ok:!1,body:null,bodyUsed:!1,size:0,timeout:0})}}this.fireCallbacks("request",[t]),this.requested[t]=!0,n.noMeta||this.saveRequestMetadata(t,n);var a=n.actualProxyURI;return this._fetch(a,n).then(function(e){return r.handleResponse(e,t,n)},function(e){var t={url:a,status:999,statusText:(e.name||"network failure")+": "+(e.errno||e.code||e.type),responseText:e.message,headers:{},ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return console.log("Fetcher: <"+a+"> Non-HTTP fetch error: "+e),r.failFetch(n,"fetch failed: "+e,999,t)})}},{key:"nowOrWhenFetched",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e=e.uri||e,"function"==typeof t?n=t:void 0===t||(t instanceof p?r.referringTerm=t:r=t),this.load(e,r).then(function(t){if(n)if(t)if(t.ok)n(!0,"OK",t);else{console.log("@@@ fetcher.js Should not take this path !!!!!!!!!!!!");var r="HTTP error: Status "+t.status+" ("+t.statusText+")";t.responseText&&(r+=" "+t.responseText),console.log(r+" fetching "+e),n(!1,r,t)}else{var i="@@ nowOrWhenFetched: no response object!";console.log(i),n(!1,i)}},function(t){var r=t.message||t.statusText;r="Failed to load <"+e+"> "+r,console.log(r),t.response&&t.response.status&&(r+=" status: "+t.response.status),n(!1,r,t.response)})}},{key:"addStatus",value:function(e,t){var n=new Date;t="["+n.getHours()+":"+n.getMinutes()+":"+n.getSeconds()+"."+n.getMilliseconds()+"] "+t;var r=this.store,i=r.the(e,k.link("status"));i&&i.append?i.append(r.literal(t)):f.warn("web.js: No list to add to: "+i+","+t)}},{key:"failFetch",value:function(e,t,n,r){this.addStatus(e.req,t),e.noMeta||this.store.add(e.original,k.link("error"),t);var i=(e.method||"GET").toUpperCase();("GET"===i||"HEAD"===i)&&(e.resource.sameTerm(e.original)?console.log("@@ Recording "+i+" failure for "+e.original+": "+n):console.log("@@ Recording failure "+i+" original "+e.original+"( as "+e.resource+") : "+n),this.requested[v.docpart(e.original.uri)]=n,this.fireCallbacks("fail",[e.original.uri,t]));var o=new Error("Fetcher: "+t);return o.status=n,o.statusText=t,o.response=r,Promise.reject(o)}},{key:"linkData",value:function(e,t,n,r,i){if(n){var o,a=this.store,s=a.sym(v.join(n,e.uri));if("alternate"===t||"seeAlso"===t||"meta"===t||"describedby"===t){if(s.uri===e.uri)return;o=k.rdfs("seeAlso")}else o=a.sym("type"===t?"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":v.join(encodeURIComponent(t),"http://www.iana.org/assignments/link-relations/"));i?a.add(s,o,e,r):a.add(e,o,s,r)}}},{key:"parseLinkHeader",value:function(e,t,n){if(e)for(var r=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,i=e.match(/<[^>]*>\s*(\s*;\s*[^()<>@,;:"\/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g),o=0;o"),s=a[0].substring(1),u=a[1].match(r),l=0;l1&&void 0!==arguments[1]?arguments[1]:{},n=new p(e=e.uri||e).doc();return t.contentType=t.contentType||"text/turtle",t.data=w(n,this.store,n.uri,t.contentType),this.webOperation("PUT",e,t)}},{key:"webCopy",value:function(e,t,n){var r=this;return this.webOperation("GET",e).then(function(e){return r.webOperation("PUT",t,{data:e.responseText,contentType:n})})}},{key:"delete",value:function(e,t){var n=this;return this.webOperation("DELETE",e,t).then(function(t){return n.requested[e]=404,n.nonexistent[e]=!0,n.unload(n.store.sym(e)),t})}},{key:"createContainer",value:function(e,t,n){var r={"content-type":"text/turtle",link:k.ldp("BasicContainer")+'; rel="type"'};t&&(r.slug=t);var i={headers:r};return n&&(i.body=n),this.webOperation("POST",e,i)}},{key:"webOperation",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n=n.uri||n,r.method=t,r.body=r.data||r.body,r.force=!0;var i=this;if(r.body&&!r.contentType)throw new Error("Web operation sending data must have a defined contentType.");return r.contentType&&(r.headers=r.headers||{},r.headers["content-type"]=r.contentType),e.withCredentials(n,r)&&(r.credentials="include"),new Promise(function(e,o){i._fetch(n,r).then(function(r){if(r.ok)r.body?r.text().then(function(t){r.responseText=t,e(r)}):e(r);else{var i="Web error: "+r.status;r.statusText&&(i+=" ("+r.statusText+")"),i+=" on "+t+" of <"+n+">",r.responseText&&(i+=": "+r.responseText);var a=new Error(i);a.response=r,o(a)}},function(e){o(new Error("Fetch error for "+t+" of <"+n+">:"+e))})})}},{key:"lookUpThing",value:function(e,t){var n=this,r=this.store.uris(e);return(r=r.map(function(e){return v.docpart(e)})).forEach(function(e){n.lookedUp[e]=!0}),this.load(r,{referringTerm:t})}},{key:"getHeader",value:function(e,t){for(var n=this.store,r=n.each(void 0,k.link("requestedURI"),e.uri),i=0;i=400)return 404===e.status&&(this.nonexistent[n.original.uri]=!0,this.nonexistent[t]=!0),this.saveErrorResponse(e,s).then(function(){return r.failFetch(n,n.resource+" "+e.statusText,e.status,e)});var c=null,f=null;if(l&&(f=v.join(l,t))!==t&&(c=f),200===e.status){this.addType(k.link("Document"),a,i,t),c&&this.addType(k.link("Document"),a,i,c),n.clearPreviousData&&i.removeDocument(n.resource);var h=u.includes("image/")||u.includes("application/pdf");u&&h&&(this.addType(i.sym("http://purl.org/dc/terms/Image"),a,i,t),c&&this.addType(i.sym("http://purl.org/dc/terms/Image"),a,i,c))}if(l){if(!n.force&&c&&"done"===this.requested[f])return this.doneFetch(n,e);this.requested[f]=!0}this.parseLinkHeader(o.get("link"),n.original,a);var p=this.handlerForContentType(u,e);return p?e.text().then(function(t){return e.responseText=t,p.parse(r,t,n,e)}):(this.addStatus(a,"Fetch over. No data handled."),this.doneFetch(n,e))}},{key:"saveErrorResponse",value:function(e,t){var n=this.store;return e.text().then(function(e){e.length>10&&n.add(t,k.http("content"),n.literal(e),t)})}},{key:"handlerForContentType",value:function(e,t){if(!e)return null;var n=this.handlers.find(function(t){return e.match(t.pattern)});return n?new n(t):null}},{key:"guessContentType",value:function(e){return E[e.split(".").pop()]}},{key:"normalizedContentType",value:function(e,t){if(e.forceContentType)return e.forceContentType;var n=t.get("content-type");if(!n||n.includes("application/octet-stream")){var r=this.guessContentType(e.resource.uri);if(r)return r}var i=v.protocol(e.resource.uri);return!n&&["file","chrome"].includes(i)?"text/xml":n}},{key:"redirectToProxy",value:function(e,t){var n=this;this.addStatus(t.req,"BLOCKED -> Cross-site Proxy to <"+e+">"),t.proxyUsed=!0;var r=this.store,i=t.req;t.noMeta||(r.add(i,k.link("redirectedTo"),r.sym(e),i),this.addStatus(i,"redirected to new request")),this.requested[t.resource.uri]="redirected",this.redirectedTo[t.resource.uri]=e;var o=Object.assign({},t);return o.baseURI=t.resource.uri,this.fetchUri(e,o).then(function(e){return o.noMeta||r.add(i,k.link("redirectedRequest"),o.req,n.appNode),e})}},{key:"setRequestTimeout",value:function(e,t){var n=this;return new Promise(function(r){n.timeouts[e]=(n.timeouts[e]||[]).concat(setTimeout(function(){!n.isPending(e)||t.retriedWithNoCredentials||t.proxyUsed||r(n.failFetch(t,"Request to ".concat(e," timed out"),"timeout"))},n.timeout))})}},{key:"addFetchCallback",value:function(e,t){this.fetchCallbacks[e]?this.fetchCallbacks[e].push(t):this.fetchCallbacks[e]=[t]}},{key:"acceptString",value:function(){var e="";for(var t in this.mediatypes)for(var n in""!==e&&(e+=", "),e+=t,this.mediatypes[t])e+=";"+n+"="+this.mediatypes[t][n];return e}}],[{key:"crossSiteProxy",value:function(t){return e.crossSiteProxyTemplate?e.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):void 0}},{key:"offlineOverride",value:function(e){var t,n=e;return"undefined"!=typeof window&&window.panes&&(t=window.panes.UI)&&t.preferences&&t.preferences.get("offlineModeUsingLocalhost")&&"http://"===n.slice(0,7)&&"localhost/"!==n.slice(7,17)&&(n="http://localhost/"+n.slice(7),f.warn("Localhost kludge for offline use: actually getting <"+n+">")),n}},{key:"proxyIfNecessary",value:function(t){var n;if("undefined"!=typeof window&&window.panes&&(n=window.panes.UI)&&n.isExtension)return t;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){var r=function e(t,n){var r=n[t.shift()];return r?"string"==typeof r?r+t.join("/"):t?e(t,r):null:null}(t.split("/").slice(2),$SolidTestEnvironment.localSiteMap);if(r)return r}return e.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===t.slice(0,5)?e.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):t}},{key:"unsupportedProtocol",value:function(e){var t=v.protocol(e);return"tel"===t||"mailto"===t||"urn"===t}},{key:"withCredentials",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.startsWith("https:");return void 0!==t.withCredentials&&(n=t.withCredentials),n}}]),e}();e.exports=j,e.exports.HANDLERS=R,e.exports.CONTENT_TYPE_BY_EXT=E},function(e,t,n){"use strict";e.exports=function(e,t,n,o,a,s){n=n||e.uri,s=s||{},o=o||"text/turtle";try{var u=i(t);s.flags&&u.setFlags(s.flags);var l,c=t.statementsMatching(void 0,void 0,void 0,e);switch(u.suggestNamespaces(t.namespaces),u.setBase(n),o){case"application/rdf+xml":return f(null,u.statementsToXML(c));case"text/n3":case"application/n3":return f(null,u.statementsToN3(c));case"text/turtle":case"application/x-turtle":return u.setFlags("si"),f(null,u.statementsToN3(c));case"application/n-triples":return u.setFlags("deinprstux"),f(null,u.statementsToNTriples(c));case"application/ld+json":u.setFlags("deinprstux"),l=u.statementsToNTriples(c),r.convertToJson(l,a);break;case"application/n-quads":case"application/nquads":return u.setFlags("deinprstux q"),f(null,u.statementsToNTriples(c));default:throw new Error("Serialize: Content-type "+o+" not supported for data write.")}}catch(e){if(a)return a(e);throw e}function f(e,t){return a?void a(e,t):t}};var r=n(42),i=n(38)},function(e,t,n){"use strict";var r=n(2),i=n(9),o=n(4),a=n(7),s=n(41),u=function(){var e=function(e){this.flags="",this.base=null,this.prefixes=[],this.namespaces=[],this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.suggestPrefix("xml","reserved:reservedForFutureUse"),this.namespacesUsed=[],this.keywords=["a"],this.prefixchars="abcdefghijklmnopqustuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",this.incoming=null,this.formulas=[],this.store=e};return e.prototype.setBase=function(e){return this.base=e,this},e.prototype.setFlags=function(e){return this.flags=e||"",this},e.prototype.toStr=function(e){var t=e.toNT();return"Graph"===e.termType&&(this.formulas[t]=e),t},e.prototype.fromStr=function(e){if("{"===e[0]){var t=this.formulas[e];return t||console.log("No formula object for "+e),t}return this.store.fromNT(e)},e.prototype.suggestPrefix=function(e,t){"default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t&&(e in this.namespaces||t in this.prefixes||(this.prefixes[t]=e,this.namespaces[e]=t))},e.prototype.suggestNamespaces=function(e){for(var t in e)return this.suggestPrefix(t,e[t]),this},e.prototype.checkIntegrity=function(){var e,t;for(e in this.namespaces)if(this.prefixes[this.namespaces[e]]!==e)throw new Error("Serializer integity error 1: "+e+", "+this.namespaces[e]+", "+this.prefixes[this.namespaces[e]]+"!");for(t in this.prefixes)if(this.namespaces[this.prefixes[t]]!==t)throw new Error("Serializer integity error 2: "+t+", "+this.prefixs[t]+", "+this.namespaces[this.prefixes[t]]+"!")},e.prototype.makeUpPrefix=function(t){var n=t,r=(function(n){return!!e.prototype.validPrefix.test(n)&&"ns"!==n&&!(n in this.namespaces)&&(this.prefixes[t]=n,this.namespaces[n]=t,n)}).bind(this);"#/".indexOf(n[n.length-1])>=0&&(n=n.slice(0,-1));var i=n.lastIndexOf("/");i>=0&&(n=n.slice(i+1));for(var o=0;o?@[\\]^`{|}~")+":",e.prototype.explicitURI=function(e){return"<"+(e=this.flags.indexOf("r")<0&&this.base?o.refTo(this.base,e):this.flags.indexOf("u")>=0?function(e){for(var t,n="",r=0;r65535?"\\U"+("00000000"+t.toString(16)).slice(-8):t>126?"\\u"+("0000"+t.toString(16)).slice(-4):e[r];return n}(e):encodeURI(e))+">"},e.prototype.statementsToNTriples=function(e){var t=e.slice();t.sort();for(var n="",r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",o=this,a=this.store,s=function e(t){if("Collection"!==t.termType)return o.atomicTermToN3(t);for(var s=t.elements,u=a.sym(r+"nill"),l=s.length-1;l>=0;l--){var c=new i;n+=e(c)+" "+e(a.sym(r+"first"))+" "+e(s[l])+".\n",n+=e(c)+" "+e(a.sym(r+"rest"))+" "+e(u)+".\n",u=c}return o.atomicTermToN3(u)},u=0;u=0&&(c+=s(l.why)+" "),n+=c+=".\n"}return n},e.prototype.statementsToN3=function(t){var n=this.store,r={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};t.sort(function(e,t){return a.heavyCompareSPO(e,t,n,r)}),this.base&&!this.defaultNamespace&&(this.defaultNamespace=this.base+"#");var i={};this.flags.indexOf("s")<0&&(i["http://www.w3.org/2002/07/owl#sameAs"]="="),this.flags.indexOf("t")<0&&(i["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]="a"),this.flags.indexOf("i")<0&&(i["http://www.w3.org/2000/10/swap/log#implies"]="=>");var o=function(e){for(var t="",n=0;n=0){r=r.slice(0,-1)+u+"\n",i+=1;continue}if(i<4*n+4||i+u.length+1<80&&";.".indexOf(r[r.length-2])<0)r=r.slice(0,-1)+" "+u+"\n",i+=u.length+1;else{var f=o(4*n)+u;r+=f+"\n",i=f.length,n<0&&(r+="\n",i=1e5)}}}return r}(d)},e.prototype.atomicTermToN3=function(e,t){switch(e.termType){case"BlankNode":case"Variable":return e.toNT();case"Literal":var n=e.value;if("string"!=typeof n)throw new TypeError("Value of RDF literal node must be a string");if(e.datatype&&this.flags.indexOf("x")<0)switch(e.datatype.uri){case"http://www.w3.org/2001/XMLSchema#integer":return n;case"http://www.w3.org/2001/XMLSchema#decimal":return n.indexOf(".")<0&&(n+=".0"),n;case"http://www.w3.org/2001/XMLSchema#double":return n.indexOf(".")<0&&(n+=".0"),n.indexOf("e")<0&&(n+="e0"),n;case"http://www.w3.org/2001/XMLSchema#boolean":return"1"===e.value?"true":"false"}var r=this.stringToN3(e.value);return e.language?r+="@"+e.language:e.datatype.equals(s.string)||(r+="^^"+this.atomicTermToN3(e.datatype,t)),r;case"NamedNode":return this.symbolToN3(e);default:throw new Error("Internal: atomicTermToN3 cannot handle "+e+" of termType: "+e.termType)}},e.prototype.validPrefix=new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/),e.prototype.forbidden1=new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm),e.prototype.forbidden3=new RegExp(/[\\"\b\f\r\v\u0080-\uffff]/gm),e.prototype.stringToN3=function(t,n){n||(n="e");var r,i,o,a,s,u="";for(t.length>20&&'"'!==t.slice(-1)&&n.indexOf("n")<0&&(t.indexOf("\n")>0||t.indexOf('"')>0)?(a='"""',s=e.prototype.forbidden3):(a='"',s=e.prototype.forbidden1),r=0;r=0?u+="\\"+'bfrtvn\\"'[o]:n.indexOf("e")>=0?u+="\\u"+("000"+l.charCodeAt(0).toString(16).toLowerCase()).slice(-4):u+=l,r=i+1}return a+u+t.slice(r)+a},e.prototype.symbolToN3=function(t){var n=t.uri,r=n.indexOf("#");if(r<0&&this.flags.indexOf("/")<0&&(r=n.lastIndexOf("/")),r>=0&&this.flags.indexOf("p")<0&&(0===n.indexOf("http")||0===n.indexOf("ws")||0===n.indexOf("file"))){for(var i=!0,o=r+1;o=0){i=!1;break}if(i){var a=n.slice(r+1),s=n.slice(0,r+1);if(this.defaultNamespace&&this.defaultNamespace===s&&this.flags.indexOf("d")<0)return this.flags.indexOf("k")>=0&&this.keyords.indexOf(a)<0?a:":"+a;var u=this.prefixes[s];if(u||(u=this.makeUpPrefix(s)),u)return this.namespacesUsed[s]=!0,u+":"+a}}return this.explicitURI(n)},e.prototype.writeStore=function(e){var t=this.store,n=t.fetcher,r=n&&n.appNode,i=this.store.index[3];for(var o in i){var a=t.fromNT(o);r&&a.sameTerm(r)||e("\n"+this.atomicTermToN3(a)+" "+this.atomicTermToN3(t.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(t.statementsMatching(void 0,void 0,void 0,a))+" }.\n")}t.statementsMatching(void 0,t.sym("http://www.w3.org/2007/ont/link#requestedURI")).map(function(n){e("\n<"+n.object.value+"> log:metadata {\n");var r=t.statementsMatching(void 0,void 0,void 0,n.subject);e(this.statementsToN3(this.statementsToN3(r))),e("}.\n")});var s=[];r&&s.push(r);var u=[];s.map(function(e){u=u.concat(t.statementsMatching(void 0,void 0,void 0,e))}),e(this.statementsToN3(u))},e.prototype.statementsToXML=function(t){var n=[];n["http://www.w3.org/1999/02/22-rdf-syntax-ns#"]=!0;var i="http://www.w3.org/1999/02/22-rdf-syntax-ns#_",o=function(e){for(var t="",n=0;n',h(a.object,t),""]:["<"+o+' rdf:nodeID="'+a.object.toNT().slice(2)+'"/>']);break;case"NamedNode":l=l.concat(["<"+o+' rdf:resource="'+f(a.object)+'"/>']);break;case"Literal":l=l.concat(["<"+o+(a.object.datatype.equals(s.string)?"":' rdf:datatype="'+c(a.object.datatype.uri)+'"')+(a.object.language?' xml:lang="'+a.object.language+'"':"")+">"+c(a.object.value)+""]);break;case"Collection":l=l.concat(["<"+o+' rdf:parseType="Collection">',p(a.object,t),""]);break;default:throw new Error("Can't serialize object of type "+a.object.termType+" into XML")}}else n=a.object;var b=n?g(n):"rdf:Description",w="";return"BlankNode"===e.termType?t.incoming[e]&&1===t.incoming[e].length||(w=' rdf:nodeID="'+e.toNT().slice(2)+'"'):w=' rdf:about="'+f(e)+'"',["<"+b+w+">"].concat([l]).concat([""])}).bind(this);function p(e,t){for(var n=[],r=0;r',""]):n.concat(["<"+g(o.predicate)+' rdf:parseType="Resource">',d(o.object,t),""]);break;case"NamedNode":n=n.concat(["<"+g(o.predicate)+' rdf:resource="'+f(o.object)+'"/>']);break;case"Literal":n=n.concat(["<"+g(o.predicate)+(o.object.datatype.equals(s.string)?"":' rdf:datatype="'+c(o.object.datatype.value)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+c(o.object.value)+""]);break;case"Collection":n=n.concat(["<"+g(o.predicate)+' rdf:parseType="Collection">',p(o.object,t),""]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}return n}).bind(this),g=(function(t){var r=t.uri,i=r.indexOf("#");if(i<0&&this.flags.indexOf("/")<0&&(i=r.lastIndexOf("/")),i<0)throw new Error("Cannot make qname out of <"+r+">");for(var o=i+1;o=0)throw new Error('Invalid character "'+r[o]+'" cannot be in XML qname for URI: '+r);var a=r.slice(i+1),s=r.slice(0,i+1);if(this.defaultNamespace&&this.defaultNamespace===s&&this.flags.indexOf("d")<0)return a;var u=this.prefixes[s];return u||(u=this.makeUpPrefix(s)),n[s]=!0,u+":"+a}).bind(this),m=l(t),y=""],-1)},function(t){return new e(t)}}();e.exports=u},function(e,t,n){"use strict";function r(e,t){for(var n=0;n=0){var a=t.substring(0,o);if(""===a)return(i=n[""])?i+t.substring(o+1):null;if("_"===a)return"_:"+t.substring(o+1);if(e.NCNAME.test(a)&&(i=n[a]))return i+t.substring(o+1)}return null}},{key:"parseCURIEOrURI",value:function(e,t,n){return this.parseCURIE(e,t,n)||this.resolveAndNormalize(n,e)}},{key:"parsePredicate",value:function(e,t,n,r,i,o){if(""===e)return null;var a=this.parseTermOrCURIEOrAbsURI(e,t,o?null:n,r,i);return a&&0===a.indexOf("_:")?null:a}},{key:"parsePrefixMappings",value:function(e,t){for(var n=this.tokenize(e),r=null,i=0;i=0&&(e=e.substring(0,t)),n&&n.baseURIMap&&(e=n.baseURIMap(e)),e};for(i.push({current:t,context:this.push(null,o(t.baseURI))});i.length>0;){var a=i.shift();if(a.parent){if(a.context.parent&&a.context.parent.listMapping===a.listMapping)continue;for(var s in a.listMapping){var l=a.listMapping[s];if(0!==l.length){for(var f=[],h=0;h0?this.addTriple(d,r.spec,"http://www.w3.org/ns/rdfa#usesVocabulary",{type:e.objectURI,value:C=O}):C=this.vocabulary}for(var I=0;I0?M:null}var L,U,F=d.getAttributeNode("rel"),V=d.getAttributeNode("rev"),B=d.getAttributeNode("typeof"),z=d.getAttributeNode("property"),q=d.getAttributeNode("datatype"),H=this.inHTMLMode?d.getAttributeNode("datetime"):null,W=d.getAttributeNode("content"),$=d.getAttributeNode("about"),G=d.getAttributeNode("src"),J=d.getAttributeNode("resource"),K=d.getAttributeNode("href"),Q=d.getAttributeNode("inlist"),Y=[];if(F){U=this.tokenize(F.value);for(var Z=0;Z=0?t+=e.nodeName.split(":")[1]:t+=e.nodeName),t}).bind(this),u=!0;e.parent;){var l=e.element,c=l.attributes;if(l.nodeType===i||l.nodeType===o)e.parent.nodeType===e.NODE&&(e.addArc(t+"value"),e=this.buildFrame(e)),e.addLiteral(l.nodeValue);else if(s(l)!==t+"RDF")if(e.parent&&e.parent.collection&&(e.addCollectionArc(),(e=this.buildFrame(e,e.element)).parent.element=null),e.parent&&e.parent.nodeType&&e.parent.nodeType!==e.ARC){e.addArc(s(l)),this.reify&&(a=this.getAttributeNodeNS(l,t,"ID"))&&(e.rdfid=a.nodeValue,l.removeAttributeNode(a));var f=this.getAttributeNodeNS(l,t,"parseType"),h=this.getAttributeNodeNS(l,t,"datatype");if(h&&(e.datatype=h.nodeValue,l.removeAttributeNode(h)),f){var p=f.nodeValue;"Literal"===p?(e.datatype=t+"XMLLiteral",(e=this.buildFrame(e)).addLiteral(l.childNodes),u=!1):"Resource"===p?((e=this.buildFrame(e,e.element)).parent.element=null,e.addBNode()):"Collection"===p&&((e=this.buildFrame(e,e.element)).parent.element=null,e.addCollection()),l.removeAttributeNode(f)}if(0!==c.length){var d=this.getAttributeNodeNS(l,t,"resource"),g=this.getAttributeNodeNS(l,t,"nodeID");e=this.buildFrame(e),d?(e.addNode(d.nodeValue),l.removeAttributeNode(d)):g?(e.addBNode(g.nodeValue),l.removeAttributeNode(g)):e.addBNode();for(var m=c.length-1;m>=0;m--){var y=this.buildFrame(e);y.addArc(s(c[m])),s(c[m])===t+"type"?this.buildFrame(y).addNode(c[m].nodeValue):this.buildFrame(y).addLiteral(c[m].nodeValue)}}else 0===l.childNodes.length&&this.buildFrame(e).addLiteral("")}else{var v=this.getAttributeNodeNS(l,t,"about");if(a=this.getAttributeNodeNS(l,t,"ID"),v&&a)throw new Error("RDFParser: "+l.nodeName+" has both rdf:id and rdf:about. Halting. Only one of these properties may be specified on a node.");if(!v&&a)e.addNode("#"+a.nodeValue),l.removeAttributeNode(a);else if(null==v&&null==a){var b=this.getAttributeNodeNS(l,t,"nodeID");b?(e.addBNode(b.nodeValue),l.removeAttributeNode(b)):e.addBNode()}else e.addNode(v.nodeValue),l.removeAttributeNode(v);var w=this.getAttributeNodeNS(l,t,"type");t+"Description"!==s(l)&&(w={nodeValue:s(l)}),null!=w&&(this.store.add(e.node,this.store.sym(t+"type"),this.store.sym(r.join(w.nodeValue,e.base)),this.why),w.nodeName&&l.removeAttributeNode(w));for(var _=c.length-1;_>=0;_--)this.store.add(e.node,this.store.sym(s(c[_])),this.store.literal(c[_].nodeValue,e.lang),this.why)}for(l=e.element;e.parent;){for(var x=e;null==l;)l=(e=e.parent).element;var S=l.childNodes&&l.childNodes[e.lastChild];if(S&&u){if((S.nodeType===n||S.nodeType===i||S.nodeType===o)&&(S.nodeType!==i&&S.nodeType!==o||1===l.childNodes.length)){e.lastChild++,e=this.buildFrame(x,l.childNodes[e.lastChild-1]);break}e.lastChild++}else{if(e.terminateFrame(),!(e=e.parent))break;l=e.element,u=!0}}}},this.cleanParser=function(){this.bnodes={},this.why=null},this.buildFrame=function(e,t){var n=this.frameFactory(this,e,t);if(e&&(n.base=e.base,n.lang=e.lang),!t||t.nodeType===i||t.nodeType===o)return n;var a=t.attributes,s=t.getAttributeNode("xml:base");null!=s&&(n.base=s.nodeValue,t.removeAttribute("xml:base"));var u=t.getAttributeNode("xml:lang");null!=u&&(n.lang=u.nodeValue,t.removeAttribute("xml:lang"));for(var l=a.length-1;l>=0;l--)if("xml"===a[l].nodeName.substr(0,3)){if("xmlns:"===a[l].name.slice(0,6)){var c=a[l].nodeValue;this.base&&(c=r.join(c,this.base)),this.store.setPrefixForURI(a[l].name.slice(6),c)}t.removeAttributeNode(a[l])}return n}}},function(e,t,n){"use strict";var r=n(2),i=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)};i.boolean=new r("http://www.w3.org/2001/XMLSchema#boolean"),i.dateTime=new r("http://www.w3.org/2001/XMLSchema#dateTime"),i.decimal=new r("http://www.w3.org/2001/XMLSchema#decimal"),i.double=new r("http://www.w3.org/2001/XMLSchema#double"),i.integer=new r("http://www.w3.org/2001/XMLSchema#integer"),i.langString=new r("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),i.string=new r("http://www.w3.org/2001/XMLSchema#string"),e.exports=i},function(e,t,n){"use strict";e.exports.convertToJson=function(e,t){var n,a=o.Parser(),s=o.Writer({format:"N-Quads"});r.waterfall([function(t){a.parse(e,t)},function(e,t,n){null!==e&&s.addTriple(e),"function"==typeof n&&s.end(n)},function(e,t){try{i.fromRDF(e,{format:"application/nquads"},t)}catch(e){t(e)}},function(e,r){n=JSON.stringify(e),t(null,n)}],function(e,r){t(e,n)})},e.exports.convertToNQuads=function(e,t){var n,i=o.Parser(),a=o.Writer({format:"N-Quads"});r.waterfall([function(t){i.parse(e,t)},function(e,t,n){null!==e&&a.addTriple(e),"function"==typeof n&&a.end(n)},function(e,r){t(null,n=e)}],function(e,r){t(e,n)})};var r=n(65),i=n(43),o=n(45)},function(e,t,n){(function(r,i,o,a){var s;!function(){var u=void 0!==r&&r.versions&&r.versions.node,l=!u&&("undefined"!=typeof window||"undefined"!=typeof self);l&&void 0===i&&("undefined"!=typeof window?i=window:"undefined"!=typeof self?i=self:"undefined"!=typeof $&&(i=$));var c=function(e){function t(){}e.compact=function(t,n,r,i){return arguments.length<2?e.nextTick(function(){i(new TypeError("Could not compact, too few arguments."))}):("function"==typeof r&&(i=r,r={}),r=r||{},null===n?e.nextTick(function(){i(new T("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"}))}):null===t?e.nextTick(function(){i(null,null)}):("base"in r||(r.base="string"==typeof t?t:""),"compactArrays"in r||(r.compactArrays=!0),"graph"in r||(r.graph=!1),"skipExpansion"in r||(r.skipExpansion=!1),"documentLoader"in r||(r.documentLoader=e.loadDocument),"link"in r||(r.link=!1),r.link&&(r.skipExpansion=!0),void function(t,n,r){if(n.skipExpansion)return e.nextTick(function(){r(null,t)});e.expand(t,n,r)}(t,r,function(t,o){if(t)return i(new T("Could not expand input before compaction.","jsonld.CompactError",{cause:t}));var a=Y(r);e.processContext(a,n,r,function(e,t){if(e)return i(new T("Could not process context before compaction.","jsonld.CompactError",{cause:e}));var a;try{a=(new O).compact(t,null,o,r)}catch(e){return i(e)}!function(e,t,r,o){o.compactArrays&&!o.graph&&ee(t)?1===t.length?t=t[0]:0===t.length&&(t={}):o.graph&&X(t)&&(t=[t]),X(n)&&"@context"in n&&(n=n["@context"]),ee(n=he(n))||(n=[n]);var a=n;n=[];for(var s=0;s0)&&n.push(a[s]);var u=n.length>0;if(1===n.length&&(n=n[0]),ee(t)){var l=J(r,"@graph"),c=t;t={},u&&(t["@context"]=n),t[l]=c}else if(X(t)&&u)for(var f in c=t,t={"@context":n},c)t[f]=c[f];i(null,t,r)}(0,a,t,r)})})))},e.expand=function(t,n,r){if(arguments.length<1)return e.nextTick(function(){r(new TypeError("Could not expand, too few arguments."))});function i(e){"base"in n||(n.base=e.documentUrl||"");var t={document:he(e.document),remoteContext:{"@context":e.contextUrl}};if("expandContext"in n){var i=he(n.expandContext);t.expandContext="object"==typeof i&&"@context"in i?i:{"@context":i}}de(t,n,function(e,t){if(e)return r(e);var i;try{var o=new O,a=Y(n),s=t.document,u=t.remoteContext["@context"];t.expandContext&&(a=o.processContext(a,t.expandContext["@context"],n)),u&&(a=o.processContext(a,u,n)),X(i=o.expand(a,null,s,n,!1))&&"@graph"in i&&1===Object.keys(i).length?i=i["@graph"]:null===i&&(i=[]),ee(i)||(i=[i])}catch(e){return r(e)}r(null,i)})}"function"==typeof n&&(r=n,n={}),"documentLoader"in(n=n||{})||(n.documentLoader=e.loadDocument),"keepFreeFloatingNodes"in n||(n.keepFreeFloatingNodes=!1),e.nextTick(function(){if("string"!=typeof t)i({contextUrl:null,documentUrl:null,document:t});else{var e=function(e,t){if(e)return r(e);try{if(!t.document)throw new T("No remote document found at the given URL.","jsonld.NullRemoteDocument");"string"==typeof t.document&&(t.document=JSON.parse(t.document))}catch(e){return r(new T("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:t}))}i(t)},o=n.documentLoader(t,e);o&&"then"in o&&o.then(e.bind(null,null),e)}})},e.flatten=function(t,n,r,i){if(arguments.length<1)return e.nextTick(function(){i(new TypeError("Could not flatten, too few arguments."))});"function"==typeof r?(i=r,r={}):"function"==typeof n&&(i=n,n=null,r={}),"base"in(r=r||{})||(r.base="string"==typeof t?t:""),"documentLoader"in r||(r.documentLoader=e.loadDocument),e.expand(t,r,function(t,o){if(t)return i(new T("Could not expand input before flattening.","jsonld.FlattenError",{cause:t}));var a;try{a=(new O).flatten(o)}catch(e){return i(e)}if(null===n)return i(null,a);r.graph=!0,r.skipExpansion=!0,e.compact(a,n,r,function(e,t){if(e)return i(new T("Could not compact flattened output.","jsonld.FlattenError",{cause:e}));i(null,t)})})},e.frame=function(t,n,r,i){if(arguments.length<2)return e.nextTick(function(){i(new TypeError("Could not frame, too few arguments."))});function o(n){var o,a=n.document;a?(o=a["@context"],n.contextUrl?(o?ee(o)?o.push(n.contextUrl):o=[o,n.contextUrl]:o=n.contextUrl,a["@context"]=o):o=o||{}):o={},e.expand(t,r,function(t,n){if(t)return i(new T("Could not expand input before framing.","jsonld.FrameError",{cause:t}));var s=he(r);s.isFrame=!0,s.keepFreeFloatingNodes=!0,e.expand(a,s,function(t,r){if(t)return i(new T("Could not expand frame before framing.","jsonld.FrameError",{cause:t}));var a;try{a=(new O).frame(n,r,s)}catch(e){return i(e)}s.graph=!0,s.skipExpansion=!0,s.link={},e.compact(a,o,s,function(t,n,r){if(t)return i(new T("Could not compact framed output.","jsonld.FrameError",{cause:t}));var o=J(r,"@graph");s.link={},n[o]=function t(n,r,i){if(ee(r)){for(var o=[],a=0;a0&&"/"!==o.substr(-1)&&(o+="/"),o+=r.path),i.path=o}i.query=r.query}i.path=_e(i.path,!!i.authority);var a=i.protocol;return null!==i.authority&&(a+="//"+i.authority),a+=i.path,null!==i.query&&(a+="?"+i.query),null!==r.fragment&&(a+="#"+r.fragment),""===a&&(a="./"),a}(t,n)},e.documentLoader=function(t,n){var r=new T("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed"});return u?n(r,{contextUrl:null,documentUrl:t,document:null}):e.promisify(function(e){e(r)})},e.loadDocument=function(t,n){var r=e.documentLoader(t,n);r&&"then"in r&&r.then(n.bind(null,null),n)},e.promises=function(t){t=t||{};var r=Array.prototype.slice,o=e.promisify,a=t.api||{},s=t.version||"jsonld.js";"string"==typeof t.api&&(t.version||(s=t.api),a={}),a.expand=function(t){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");return o.apply(null,[e.expand].concat(r.call(arguments)))},a.compact=function(t,n){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");return o.apply(null,[function(t,n,r,i){"function"==typeof r&&(i=r,r={}),e.compact(t,n,r=r||{},function(e,t){i(e,t)})}].concat(r.call(arguments)))},a.flatten=function(t){if(arguments.length<1)throw new TypeError("Could not flatten, too few arguments.");return o.apply(null,[e.flatten].concat(r.call(arguments)))},a.frame=function(t,n){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");return o.apply(null,[e.frame].concat(r.call(arguments)))},a.fromRDF=function(t){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");return o.apply(null,[e.fromRDF].concat(r.call(arguments)))},a.toRDF=function(t){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");return o.apply(null,[e.toRDF].concat(r.call(arguments)))},a.normalize=function(t){if(arguments.length<1)throw new TypeError("Could not normalize, too few arguments.");return o.apply(null,[e.normalize].concat(r.call(arguments)))},"jsonld.js"===s&&(a.link=function(t,n){if(arguments.length<2)throw new TypeError("Could not link, too few arguments.");return o.apply(null,[e.link].concat(r.call(arguments)))},a.objectify=function(t){return o.apply(null,[e.objectify].concat(r.call(arguments)))},a.createNodeMap=function(t){return o.apply(null,[e.createNodeMap].concat(r.call(arguments)))},a.merge=function(t){return o.apply(null,[e.merge].concat(r.call(arguments)))});try{e.Promise=i.Promise||n(44).Promise}catch(e){var u=function(){throw new Error("Unable to find a Promise implementation.")};for(var l in a)a[l]=u}return a},e.promisify=function(t){if(!e.Promise)try{e.Promise=i.Promise||n(44).Promise}catch(e){throw new Error("Unable to find a Promise implementation.")}var r=Array.prototype.slice.call(arguments,1);return new e.Promise(function(e,n){t.apply(null,r.concat(function(t,r){t?n(t):e(r)}))})},e.promises({api:e.promises}),(t.prototype=e.promises({version:"json-ld-1.0"})).toString=function(){return this instanceof t?"[object JsonLdProcessor]":"[object JsonLdProcessorPrototype]"},e.JsonLdProcessor=t;var s=!!Object.defineProperty;if(s)try{Object.defineProperty({},"x",{})}catch(e){s=!1}s&&(Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t})),l&&void 0===i.JsonLdProcessor&&(s?Object.defineProperty(i,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:t}):i.JsonLdProcessor=t);var c="function"==typeof o&&o,f=c?function(e){c(e)}:function(e){setTimeout(e,0)};e.nextTick="object"==typeof r&&"function"==typeof r.nextTick?r.nextTick:f,e.setImmediate=c?f:e.nextTick,e.parseLinkHeader=function(e){for(var t={},n=e.match(/(?:<[^>]*?>|"[^"]*?"|[^,])+/g),r=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,i=0;i=+new Date)return t.ctx;delete this.cache[e],this.order.splice(this.order.indexOf(e),1)}return null},e.DocumentCache.prototype.set=function(e,t){this.order.length===this.size&&delete this.cache[this.order.shift()],this.order.push(e),this.cache[e]={ctx:t,expires:+new Date+this.expires}},e.ActiveContextCache=function(e){this.order=[],this.cache={},this.size=e||100},e.ActiveContextCache.prototype.get=function(e,t){var n=JSON.stringify(e),r=JSON.stringify(t),i=this.cache[n];return i&&r in i?i[r]:null},e.ActiveContextCache.prototype.set=function(e,t,n){if(this.order.length===this.size){var r=this.order.shift();delete this.cache[r.activeCtx][r.localCtx]}var i=JSON.stringify(e),o=JSON.stringify(t);this.order.push({activeCtx:i,localCtx:o}),i in this.cache||(this.cache[i]={}),this.cache[i][o]=he(n)},e.cache={activeCtx:new e.ActiveContextCache},e.documentLoaders={},e.documentLoaders.jquery=function(t,n){n=n||{};var r=new e.RequestQueue;return("usePromise"in n?n.usePromise:"undefined"!=typeof Promise)?r.wrapLoader(function(t){return e.promisify(i,t)}):r.wrapLoader(i);function i(r,i){return 0!==r.indexOf("http:")&&0!==r.indexOf("https:")?i(new T('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:r}),{contextUrl:null,documentUrl:r,document:null}):n.secure&&0!==r.indexOf("https")?i(new T('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:r}),{contextUrl:null,documentUrl:r,document:null}):void t.ajax({url:r,accepts:{json:"application/ld+json, application/json"},headers:{Accept:"application/ld+json, application/json"},dataType:"json",crossDomain:!0,success:function(t,n,o){var a={contextUrl:null,documentUrl:r,document:t},s=o.getResponseHeader("Content-Type"),u=o.getResponseHeader("Link");if(u&&"application/ld+json"!==s){if(ee(u=e.parseLinkHeader(u)[k]))return i(new T("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:r}),a);u&&(a.contextUrl=u.target)}i(null,a)},error:function(e,t,n){i(new T("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:r,cause:n}),{contextUrl:null,documentUrl:r,document:null})}})}},e.documentLoaders.node=function(t){var r=!("strictSSL"in(t=t||{}))||t.strictSSL,i="maxRedirects"in t?t.maxRedirects:-1,o="request"in t?t.request:n(10),a="application/ld+json, application/json",s=n(10),u=new e.RequestQueue;if(t.usePromise)return u.wrapLoader(function(t){return e.promisify(c,t,[])});var l=t.headers||{};if("Accept"in l||"accept"in l)throw new RangeError('Accept header may not be specified as an option; only "'+a+'" is supported.');return u.wrapLoader(function(e,t){c(e,[],t)});function c(n,u,l){if(0!==n.indexOf("http:")&&0!==n.indexOf("https:"))return l(new T('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:n}),{contextUrl:null,documentUrl:n,document:null});if(t.secure&&0!==n.indexOf("https"))return l(new T('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:n}),{contextUrl:null,documentUrl:n,document:null});var f=null;if(null!==f)return l(null,f);var h={Accept:a};for(var p in t.headers)h[p]=t.headers[p];o({url:n,headers:h,strictSSL:r,followRedirect:!1},function(t,r,o){if(f={contextUrl:null,documentUrl:n,document:o||null},t)return l(new T("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:n,cause:t}),f);if(r.statusCode>=400)return l(new T("URL could not be dereferenced: "+s.STATUS_CODES[r.statusCode],"jsonld.InvalidUrl",{code:"loading document failed",url:n,httpStatusCode:r.statusCode}),f);if(r.headers.link&&"application/ld+json"!==r.headers["content-type"]){var a=e.parseLinkHeader(r.headers.link)[k];if(ee(a))return l(new T("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:n}),f);a&&(f.contextUrl=a.target)}if(r.statusCode>=300&&r.statusCode<400&&r.headers.location)return u.length===i?l(new T("URL could not be dereferenced; there were too many redirects.","jsonld.TooManyRedirects",{code:"loading document failed",url:n,httpStatusCode:r.statusCode,redirects:u}),f):-1!==u.indexOf(n)?l(new T("URL could not be dereferenced; infinite redirection was detected.","jsonld.InfiniteRedirectDetected",{code:"recursive context inclusion",url:n,httpStatusCode:r.statusCode,redirects:u}),f):(u.push(n),c(r.headers.location,u,l));u.push(n),l(t,f)})}},e.documentLoaders.xhr=function(t){t=t||{};var n=/(^|(\r\n))link:/i,r=new e.RequestQueue;return("usePromise"in t?t.usePromise:"undefined"!=typeof Promise)?r.wrapLoader(function(t){return e.promisify(i,t)}):r.wrapLoader(i);function i(r,i){if(0!==r.indexOf("http:")&&0!==r.indexOf("https:"))return i(new T('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:r}),{contextUrl:null,documentUrl:r,document:null});if(t.secure&&0!==r.indexOf("https"))return i(new T('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:r}),{contextUrl:null,documentUrl:r,document:null});var o=new(t.xhr||XMLHttpRequest);o.onload=function(){if(o.status>=400)return i(new T("URL could not be dereferenced: "+o.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:r,httpStatusCode:o.status}),{contextUrl:null,documentUrl:r,document:null});var t,a={contextUrl:null,documentUrl:r,document:o.response},s=o.getResponseHeader("Content-Type");if(n.test(o.getAllResponseHeaders())&&(t=o.getResponseHeader("Link")),t&&"application/ld+json"!==s){if(ee(t=e.parseLinkHeader(t)[k]))return i(new T("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:r}),a);t&&(a.contextUrl=t.target)}i(null,a)},o.onerror=function(){i(new T("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:r}),{contextUrl:null,documentUrl:r,document:null})},o.open("GET",r,!0),o.setRequestHeader("Accept","application/ld+json, application/json"),o.send()}},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new T('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.processContext=function(t,n){var r={},i=2;arguments.length>3&&(r=arguments[2]||{},i+=1);var o=arguments[i];if("base"in r||(r.base=""),"documentLoader"in r||(r.documentLoader=e.loadDocument),null===n)return o(null,Y(r));X(n=he(n))&&"@context"in n||(n={"@context":n}),de(n,r,function(e,n){if(e)return o(e);try{n=(new O).processContext(t,n,r)}catch(e){return o(e)}o(null,n)})},e.hasProperty=function(e,t){var n=!1;if(t in e){var r=e[t];n=!ee(r)||r.length>0}return n},e.hasValue=function(t,n,r){var i=!1;if(e.hasProperty(t,n)){var o=t[n],a=le(o);if(ee(o)||a){a&&(o=o["@list"]);for(var s=0;s0){var k=J(t,h);e.addValue(o,k,C)}}else{var C;if(ne(p))C=J(t,p,null,{vocab:"@type"===h});else{C=[];for(var O=0;O1&&!(2===C&&"@index"in s))throw new T('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:s});"@set"in s&&(s=s["@set"],C=(h=Object.keys(s)).length)}else 1===C&&"@language"in s&&(s=null);return!X(s)||i.keepFreeFloatingNodes||o||null!==n&&"@graph"!==f||(0===C||"@value"in s||"@list"in s||1===C&&"@id"in s)&&(s=null),s},O.prototype.createNodeMap=function(e,t){var n={"@default":{}};return F(e,n,"@default",(t=t||{}).namer||t.issuer||new ye("_:b")),V(n)},O.prototype.flatten=function(e){for(var t=this.createNodeMap(e),n=[],r=Object.keys(t).sort(),i=0;i=r.MAX_TOTAL_DEPTH)return n(new Error("Maximum total call stack depth exceeded; normalization aborting."));!function i(){if(r.depth===r.MAX_DEPTH)return r.depth=0,r.running=!1,e.nextTick(i);var o=(new Date).getTime();if(r.running||(r.start=(new Date).getTime(),r.deadline=r.start+r.timeSlice),o1)return o();var s=a[0];r.canonicalIssuer.getId(s),delete i[s],delete r.hashToBlankNodes[e],t=!0,o()},e)}],e)},e)},function(e){var t=Object.keys(r.hashToBlankNodes).sort();r.forEach(t,function(e,t,n){var i=[],o=r.hashToBlankNodes[e];r.waterfall([function(e){r.forEach(o,function(e,t,n){if(r.canonicalIssuer.hasId(e))return n();var o=new ye("_:b");o.getId(e),r.hashNDegreeQuads(e,o,function(e,t){if(e)return n(e);i.push(t),n()})},e)},function(e){i.sort(function(e,t){return e.hasht.hash?1:0}),r.forEach(i,function(e,t,n){for(var i in e.issuer.existing)r.canonicalIssuer.getId(i);n()},e)}],n)},e)},function(e){var t=[];r.waterfall([function(e){r.forEach(r.quads,function(e,n,i){r.forEachComponent(e,function(e){"blank node"===e.type&&0!==e.value.indexOf(r.canonicalIssuer.prefix)&&(e.value=r.canonicalIssuer.getId(e.value))}),t.push(me(e)),i()},e)},function(e){if(t.sort(),"application/nquads"===r.options.format)return n=t.join(""),e();n=ge(t.join("")),e()}],e)}],function(e){t(e,n)})},M.prototype.hashFirstDegreeQuads=function(e,t){var n=this,r=n.blankNodeInfo[e];if("hash"in r)return t(null,r.hash);var i=[];n.forEach(r.quads,function(t,r,o){var a={predicate:t.predicate};n.forEachComponent(t,function(t,r){a[r]=n.modifyFirstDegreeComponent(e,t,r)}),i.push(me(a)),o()},function(e){if(e)return t(e);i.sort(),r.hash=be.hashNQuads(n.name,i),t(null,r.hash)})},M.prototype.modifyFirstDegreeComponent=function(e,t){return"blank node"!==t.type?t:((t=he(t)).value=t.value===e?"_:a":"_:z",t)},M.prototype.hashRelatedBlankNode=function(e,t,n,r,i){var o,a=this;a.waterfall([function(t){return a.canonicalIssuer.hasId(e)?(o=a.canonicalIssuer.getId(e),t()):n.hasId(e)?(o=n.getId(e),t()):void a.hashFirstDegreeQuads(e,function(e,n){if(e)return t(e);o=n,t()})}],function(e){if(e)return i(e);var n=new be(a.name);return n.update(r),"g"!==r&&n.update(a.getRelatedPredicate(t)),n.update(o),i(null,n.digest())})},M.prototype.getRelatedPredicate=function(e){return"<"+e.predicate.value+">"},M.prototype.hashNDegreeQuads=function(e,t,n){var r,i=this,o=new be(i.name);i.waterfall([function(n){i.createHashToRelated(e,t,function(e,t){if(e)return n(e);r=t,n()})},function(e){var n=Object.keys(r).sort();i.forEach(n,function(e,n,a){o.update(e);var s,u="",l=new ve(r[e]);i.whilst(function(){return l.hasNext()},function(e){var n=l.next(),r=t.clone(),o="",a=[];i.waterfall([function(t){i.forEach(n,function(t,n,s){if(i.canonicalIssuer.hasId(t)?o+=i.canonicalIssuer.getId(t):(r.hasId(t)||a.push(t),o+=r.getId(t)),0!==u.length&&o.length>=u.length&&o>u)return e();s()},t)},function(t){i.forEach(a,function(t,n,a){i.hashNDegreeQuads(t,r,function(n,i){return n?a(n):(o+=r.getId(t),o+="<"+i.hash+">",r=i.issuer,0!==u.length&&o.length>=u.length&&o>u?e():void a())})},t)},function(e){(0===u.length||o=0;--n)if(t[n]["@id"]===e["@id"])return!0;return!1}function q(e,t,n){var r="@"+n,i=r in e?e[r][0]:t[n];return"embed"===n&&(!0===i?i="@last":!1===i?i="@never":"@always"!==i&&"@never"!==i&&"@link"!==i&&(i="@last")),i}function H(t,n,r){if("@type"in n&&(1!==n["@type"].length||!X(n["@type"][0]))){for(var i=n["@type"],o=0;o=0;--d)for(var C=S[d],T=C.terms,O=0;O0&&a.length>s&&o[0]===a[0];)o.shift(),a.shift();var u="";if(o.length>0){o.pop();for(var l=0;l=(i=a[u].iri).length?"":i[r])in s?s[o].push(a[u]):s[o]=[a[u]];for(var t in s)""!==t&&n(s,t,r+1)}function r(e,t,n,r){r in n||(n[r]=t)}}function Z(e){if(!ne(e))return!1;switch(e){case"@base":case"@context":case"@container":case"@default":case"@embed":case"@explicit":case"@graph":case"@id":case"@index":case"@language":case"@list":case"@omitDefault":case"@preserve":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@vocab":return!0}return!1}function X(e){return"[object Object]"===Object.prototype.toString.call(e)}function ee(e){return Array.isArray(e)}function te(e){if(!ne(e)&&!function(e){return X(e)&&0===Object.keys(e).length}(e)){var t=!1;if(ee(e)){t=!0;for(var n=0;n1||!("@id"in e)),t}function se(e){return X(e)&&1===Object.keys(e).length&&"@id"in e}function ue(e){return X(e)&&"@value"in e}function le(e){return X(e)&&"@list"in e}function ce(e){var t=!1;return X(e)&&(t="@id"in e?0===e["@id"].indexOf("_:"):0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e)),t}function fe(e){return ne(e)&&-1!==e.indexOf(":")}function he(e){if(e&&"object"==typeof e){var t;if(ee(e)){t=[];for(var n=0;nC)return r=new T("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"loading remote context failed",max:C}),a(r);var s={},u=function(){pe(e,s,!0,o),a(null,e)};if(!pe(e,s,!1,o))return u();var l=[];for(var c in s)!1===s[c]&&l.push(c);for(var f=l.length,h=0;h]*)>)|(_:(?:[A-Za-z0-9]+)))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-z0-9]+))|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-z]+(?:-[a-z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-z0-9]+)))[ \\t]*\\.))[ \\t]*(?:#.*)?$'),r={},i=e.split(/(?:\r\n)|(?:\n)|(?:\r)/g),o=0,a=0;a":n.value,a+=" ",a+="IRI"===r.type?"<"+r.value+">":r.value,a+=" ","IRI"===i.type?a+="<"+i.value+">":"blank node"===i.type?a+=i.value:(a+='"'+i.value.replace(/\\/g,"\\\\").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\"/g,'\\"')+'"',i.datatype===E?i.language&&(a+="@"+i.language):i.datatype!==v&&(a+="^^<"+i.datatype+">")),null!=o&&(0!==o.indexOf("_:")?a+=" <"+o+">":a+=" "+o),a+" .\n"}function ye(e){this.prefix=e,this.counter=0,this.existing={}}Object.keys||(Object.keys=function(e){if(e!==Object(e))throw new TypeError("Object.keys called on non-object");var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}),e.registerRDFParser("application/nquads",ge),e.registerRDFParser("rdfa-api",function(e){for(var t={"@default":[]},n=e.getSubjects(),r=0;rt)&&(a&&i>0&&o>this.list[i-1]||!a&&ithis.list[i+1])&&(t=o,n=i)}if(null===t)this.done=!0;else{var s=this.left[t]?n-1:n+1;for(this.list[n]=this.list[s],this.list[s]=t,i=0;it&&(this.left[this.list[i]]=!this.left[this.list[i]])}return e};var be=function(e){if(!(this instanceof be))return new be(e);if(-1===["URDNA2015","URGNA2012"].indexOf(e))throw new Error("Invalid RDF Dataset Normalization algorithm: "+e);be._init.call(this,e)};if(be.hashNQuads=function(e,t){for(var n=new be(e),r=0;r0;)1&r&&(t._padding+=n),(r>>>=1)>0&&(n+=n)}this.start()};t.prototype.start=function(){this.messageLength=0,this.fullMessageLength=[];for(var e=this._algorithm.messageLengthSize/4,n=0;n>>0,n>>>0];for(var r=this.fullMessageLength.length-1;r>=0;--r)this.fullMessageLength[r]+=n[1],n[1]=n[0]+(this.fullMessageLength[r]/4294967296>>>0),this.fullMessageLength[r]=this.fullMessageLength[r]>>>0,n[0]=n[1]/4294967296>>>0;for(this._input.putBytes(e.bytes());this._input.length()>=this._algorithm.blockSize;)this.state=this._algorithm.digest(this.state,this._input);return(this._input.read>2048||0===this._input.length())&&this._input.compact(),this},t.prototype.digest=function(){var e=new t.ByteBuffer;e.putBytes(this._input.bytes()),e.putBytes(t._padding.substr(0,this._algorithm.blockSize-(this.fullMessageLength[this.fullMessageLength.length-1]+this._algorithm.messageLengthSize&this._algorithm.blockSize-1)));for(var n=new t.ByteBuffer,r=0;r>>28);this._algorithm.writeMessageLength(e,n);var i=this._algorithm.digest(this.state.copy(),e),o=new t.ByteBuffer;return i.write(o),o},t.ByteBuffer=function(e){this.data="string"==typeof e?e:"",this.read=0},t.ByteBuffer.prototype.putInt32=function(e){this.data+=String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)},t.ByteBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},t.ByteBuffer.prototype.putBytes=function(e){this.data+=e},t.ByteBuffer.prototype.bytes=function(){return this.data.slice(this.read)},t.ByteBuffer.prototype.length=function(){return this.data.length-this.read},t.ByteBuffer.prototype.compact=function(){this.data=this.data.slice(this.read),this.read=0},t.ByteBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=64;){for(i=e.h0,o=e.h1,a=e.h2,s=e.h3,u=e.h4,l=0;l<16;++l)r=t.getInt32(),f[l]=r,r=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+r,u=s,s=a,a=o<<30|o>>>2,o=i,i=r;for(;l<20;++l)r=(r=f[l-3]^f[l-8]^f[l-14]^f[l-16])<<1|r>>>31,f[l]=r,r=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+r,u=s,s=a,a=o<<30|o>>>2,o=i,i=r;for(;l<32;++l)r=(r=f[l-3]^f[l-8]^f[l-14]^f[l-16])<<1|r>>>31,f[l]=r,r=(i<<5|i>>>27)+(o^a^s)+u+1859775393+r,u=s,s=a,a=o<<30|o>>>2,o=i,i=r;for(;l<40;++l)r=(r=f[l-6]^f[l-16]^f[l-28]^f[l-32])<<2|r>>>30,f[l]=r,r=(i<<5|i>>>27)+(o^a^s)+u+1859775393+r,u=s,s=a,a=o<<30|o>>>2,o=i,i=r;for(;l<60;++l)r=(r=f[l-6]^f[l-16]^f[l-28]^f[l-32])<<2|r>>>30,f[l]=r,r=(i<<5|i>>>27)+(o&a|s&(o^a))+u+2400959708+r,u=s,s=a,a=o<<30|o>>>2,o=i,i=r;for(;l<80;++l)r=(r=f[l-6]^f[l-16]^f[l-28]^f[l-32])<<2|r>>>30,f[l]=r,r=(i<<5|i>>>27)+(o^a^s)+u+3395469782+r,u=s,s=a,a=o<<30|o>>>2,o=i,i=r;e.h0=e.h0+i|0,e.h1=e.h1+o|0,e.h2=e.h2+a|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,c-=64}return e},n._createState=function(){var e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520,copy:function(){var t=n._createState();return t.h0=e.h0,t.h1=e.h1,t.h2=e.h2,t.h3=e.h3,t.h4=e.h4,t},write:function(t){t.putInt32(e.h0),t.putInt32(e.h1),t.putInt32(e.h2),t.putInt32(e.h3),t.putInt32(e.h4)}};return e};var r={_k:null,_w:null,Algorithm:function(){this.name="sha256",this.blockSize=64,this.digestLength=32,this.messageLengthSize=8}};r.Algorithm.prototype.start=function(){return r._k||r._init(),r._createState()},r.Algorithm.prototype.writeMessageLength=function(e,t){e.putBytes(t.bytes())},r.Algorithm.prototype.digest=function(e,t){for(var n,i,o,a,s,u,l,c,f,h,p,d,g=t.length(),m=r._k,y=r._w;g>=64;){for(a=0;a<16;++a)y[a]=t.getInt32();for(;a<64;++a)n=((n=y[a-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=y[a-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,y[a]=n+y[a-7]+i+y[a-16]|0;for(s=e.h0,u=e.h1,l=e.h2,c=e.h3,f=e.h4,h=e.h5,p=e.h6,d=e.h7,a=0;a<64;++a)o=s&u|l&(s^u),n=d+((f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7))+(p^f&(h^p))+m[a]+y[a],d=p,p=h,h=f,f=c+n|0,c=l,l=u,u=s,s=n+(i=((s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10))+o)|0;e.h0=e.h0+s|0,e.h1=e.h1+u|0,e.h2=e.h2+l|0,e.h3=e.h3+c|0,e.h4=e.h4+f|0,e.h5=e.h5+h|0,e.h6=e.h6+p|0,e.h7=e.h7+d|0,g-=64}return e},r._createState=function(){var e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225,copy:function(){var t=r._createState();return t.h0=e.h0,t.h1=e.h1,t.h2=e.h2,t.h3=e.h3,t.h4=e.h4,t.h5=e.h5,t.h6=e.h6,t.h7=e.h7,t},write:function(t){t.putInt32(e.h0),t.putInt32(e.h1),t.putInt32(e.h2),t.putInt32(e.h3),t.putInt32(e.h4),t.putInt32(e.h5),t.putInt32(e.h6),t.putInt32(e.h7)}};return e},r._init=function(){r._k=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],r._w=new Array(64)}}(),!p)var we=function(){p=n(10).XMLSerializer};function _e(e,t){var n="";0===e.indexOf("/")&&(n="/");for(var r=e.split("/"),i=[];r.length>0;)"."===r[0]||""===r[0]&&r.length>1?r.shift():".."!==r[0]?i.push(r.shift()):(r.shift(),t||i.length>0&&".."!==i[i.length-1]?i.pop():i.push(".."));return n+i.join("/")}if(e.url={},e.url.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},e.url.parse=function(t,n){for(var r={},i=e.url.parsers[n||"full"],o=i.regex.exec(t),a=i.keys.length;a--;)r[i.keys[a]]=void 0===o[a]?null:o[a];return r.normalizedPath=_e(r.path,!!r.authority),r},u?e.useDocumentLoader("node"):"undefined"!=typeof XMLHttpRequest&&e.useDocumentLoader("xhr"),u){e.use=function(t){switch(t){case"request":e.request=n(10);break;default:throw new T("Unknown extension.","jsonld.UnknownExtension",{extension:t})}};var xe={exports:{},filename:a};n(10)(xe,"version"),e.version=xe.exports.version}return e},f=function(){return c(function(){return f()})};!u&&n(68)?void 0===(s=(function(){return c(f),f}).apply(t,[]))||(e.exports=s):(c(f),e.exports&&(e.exports=f),l&&("undefined"==typeof jsonld?jsonld=jsonldjs=f:jsonldjs=f))}()}).call(this,n(8),n(6),n(16).setImmediate,"/")},function(e,t,n){(function(r,i,o){var a;(function(){"use strict";function s(e){return"function"==typeof e}var u,l,c=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)},f=0,h=function(e,t){C[f]=e,C[f+1]=t,2===(f+=2)&&(l?l(T):b())},p="undefined"!=typeof window?window:void 0,d=p||{},g=d.MutationObserver||d.WebKitMutationObserver,m=void 0!==r&&"[object process]"==={}.toString.call(r),y="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function v(){return function(){setTimeout(T,1)}}var b,w,_,x,S,E,k,C=new Array(1e3);function T(){for(var e=0;e<"]=0,this._entityCount=0,this._blankNodeIndex=0,t||!e||e[0]||(t=e,e=null),this._prefixes=Object.create(null),t&&t.prefixes&&this.addPrefixes(t.prefixes),e&&this.addTriples(e)}i.prototype={get size(){var e=this._size;if(null!==e)return e;var t,n,r=this._graphs;for(var i in r)for(var o in t=r[i].subjects)for(var a in n=t[o])e+=Object.keys(n[a]).length;return this._size=e},_addToIndex:function(e,t,n,r){var i=e[t]||(e[t]={});(i[n]||(i[n]={}))[r]=null},_removeFromIndex:function(e,t,n,r){var i,o=e[t],a=o[n];for(i in delete a[r],a)return;for(i in delete o[n],o)return;delete e[t]},_findInIndex:function(e,t,n,r,i,o,a,s){var u,l,c,f=[],h=Object.keys(this._entities);for(var p in t&&((u=e,e={})[t]=u[t]),e){var d=h[p];if(l=e[p])for(var g in n&&((u=l,l={})[n]=u[n]),l){var m=h[g];if(c=l[g])for(var y=(r?r in c?[r]:[]:Object.keys(c)),v=y.length-1;v>=0;v--){var b={subject:"",predicate:"",object:"",graph:s};b[i]=d,b[o]=m,b[a]=h[y[v]],f.push(b)}}}return f},_countInIndex:function(e,t,n,r){var i,o,a,s=0;for(var u in t&&((i=e,e={})[t]=i[t]),e)if(o=e[u])for(var l in n&&((i=o,o={})[n]=i[n]),o)(a=o[l])&&(r?r in a&&s++:s+=Object.keys(a).length);return s},addTriple:function(e,t,n,r){t||(r=e.graph,n=e.object,t=e.predicate,e=e.subject);var i=this._graphs[r=r||""];i||(i=this._graphs[r]={subjects:{},predicates:{},objects:{}},Object.freeze(i));var o=this._entities;e=o[e]||(o[e]=++this._entityCount),t=o[t]||(o[t]=++this._entityCount),n=o[n]||(o[n]=++this._entityCount),this._addToIndex(i.subjects,e,t,n),this._addToIndex(i.predicates,t,n,e),this._addToIndex(i.objects,n,e,t),this._size=null},addTriples:function(e){for(var t=e.length-1;t>=0;t--)this.addTriple(e[t])},addPrefix:function(e,t){this._prefixes[e]=t},addPrefixes:function(e){for(var t in e)this.addPrefix(t,e[t])},removeTriple:function(e,t,n,r){t||(r=e.graph,n=e.object,t=e.predicate,e=e.subject),r=r||"";var i,o,a,s=this._entities,u=this._graphs;if((e=s[e])&&(t=s[t])&&(n=s[n])&&(i=u[r])&&(o=i.subjects[e])&&(a=o[t])&&n in a){for(e in this._removeFromIndex(i.subjects,e,t,n),this._removeFromIndex(i.predicates,t,n,e),this._removeFromIndex(i.objects,n,e,t),null!==this._size&&this._size--,i.subjects)return;delete u[r]}},removeTriples:function(e){for(var t=e.length-1;t>=0;t--)this.removeTriple(e[t])},find:function(e,t,n,i){var o=this._prefixes;return this.findByIRI(r(e,o),r(t,o),r(n,o),r(i,o))},findByIRI:function(e,t,n,r){var i=this._graphs[r=r||""],o=this._entities;return i?e&&!(e=o[e])?[]:t&&!(t=o[t])?[]:n&&!(n=o[n])?[]:e?n?this._findInIndex(i.objects,n,e,t,"object","subject","predicate",r):this._findInIndex(i.subjects,e,t,null,"subject","predicate","object",r):t?this._findInIndex(i.predicates,t,n,null,"predicate","object","subject",r):n?this._findInIndex(i.objects,n,null,null,"object","subject","predicate",r):this._findInIndex(i.subjects,null,null,null,"subject","predicate","object",r):[]},count:function(e,t,n,i){var o=this._prefixes;return this.countByIRI(r(e,o),r(t,o),r(n,o),r(i,o))},countByIRI:function(e,t,n,r){var i=this._graphs[r=r||""],o=this._entities;return i?e&&!(e=o[e])?0:t&&!(t=o[t])?0:n&&!(n=o[n])?0:e?n?this._countInIndex(i.objects,n,e,t):this._countInIndex(i.subjects,e,t,n):t?this._countInIndex(i.predicates,t,n,e):this._countInIndex(i.objects,n,e,t):0},createBlankNode:function(e){var t,n;if(e)for(t=e="_:"+e,n=1;this._entities[t];)t=e+n++;else do{t="_:b"+this._blankNodeIndex++}while(this._entities[t]);return this._entities[t]=++this._entityCount,t}},e.exports=i},function(e,t,n){var r=n(48).Transform,i=n(56),o=n(30);function a(e){if(!(this instanceof a))return new a(e);r.call(this,{decodeStrings:!0}),this._readableState.objectMode=!0;var t=this,n=new o(e);n.parse(function(e,n){n&&t.push(n)||e&&t.emit("error",e)},this.emit.bind(this,"prefix")),this._transform=function(e,t,r){n.addChunk(e),r()},this._flush=function(e){n.end(),e()}}i.inherits(a,r),e.exports=a},function(e,t,n){e.exports=i;var r=n(32).EventEmitter;function i(){r.call(this)}n(11)(i,r),i.Readable=n(33),i.Writable=n(77),i.Duplex=n(78),i.Transform=n(79),i.PassThrough=n(80),i.Stream=i,i.prototype.pipe=function(e,t){var n=this;function i(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(n.on("end",s),n.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function l(e){if(c(),0===r.listenerCount(this,"error"))throw e}function c(){n.removeListener("data",i),e.removeListener("drain",o),n.removeListener("end",s),n.removeListener("close",u),n.removeListener("error",l),e.removeListener("error",l),n.removeListener("end",c),n.removeListener("close",c),e.removeListener("close",c)}return n.on("error",l),e.on("error",l),n.on("end",c),n.on("close",c),e.on("close",c),e.emit("pipe",n),e}},function(e,t,n){"use strict";(function(t,r){var i=n(21);e.exports=b;var o,a=n(50);b.ReadableState=v,n(32);var s=function(e,t){return e.listeners(t).length},u=n(51),l=n(22).Buffer,c=t.Uint8Array||function(){},f=n(17);f.inherits=n(11);var h=n(72),p=void 0;p=h&&h.debuglog?h.debuglog("stream"):function(){};var d,g=n(73),m=n(53);f.inherits(b,u);var y=["error","close","destroy","pause","resume"];function v(e,t){e=e||{};var r=t instanceof(o=o||n(12));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark;this.highWaterMark=i||0===i?i:r&&(a||0===a)?a:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(d||(d=n(54).StringDecoder),this.decoder=new d(e.encoding),this.encoding=e.encoding)}function b(e){if(o=o||n(12),!(this instanceof b))return new b(e);this._readableState=new v(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,n,r,i){var o,a=e._readableState;return null===t?(a.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,E(e)}}(e,a)):(i||(o=function(e,t){var n,r;return l.isBuffer(r=t)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=l.from(t)),r?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!n?(t=a.decoder.write(t),a.objectMode||0!==t.length?_(e,a,t,!1):C(e,a)):_(e,a,t,!1))):r||(a.reading=!1)),!a.ended&&(a.needReadable||a.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=x?e=x:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(p("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(k,e):k(e))}function k(e){p("emit readable"),e.emit("readable"),P(e)}function C(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(T,e,t))}function T(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;return eo.length?o.length:e;if(i+=a===o.length?o:o.slice(0,e),0==(e-=a)){a===o.length?(++r,t.head=n.next?n.next:t.tail=null):(t.head=n,n.data=o.slice(a));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=l.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),0==(e-=a)){a===o.length?(++i,t.head=r.next?r.next:t.tail=null):(t.head=r,r.data=o.slice(a));break}++i}return t.length-=i,n}(e,t),r}(e,t.buffer,t.decoder),n);var n}function N(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function j(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return p("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?N(this):E(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&N(this),null;var r,i=t.needReadable;return p("need readable",i),(0===t.length||t.length-e0?A(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&N(this)),null!==r&&this.emit("data",r),r},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,p("pipe count=%d opts=%j",o.pipesCount,t);var u=t&&!1===t.end||e===r.stdout||e===r.stderr?v:l;function l(){p("onend"),e.end()}o.endEmitted?i.nextTick(u):n.once("end",u),e.on("unpipe",function t(r,i){p("onunpipe"),r===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,p("cleanup"),e.removeListener("close",m),e.removeListener("finish",y),e.removeListener("drain",c),e.removeListener("error",g),e.removeListener("unpipe",t),n.removeListener("end",l),n.removeListener("end",v),n.removeListener("data",d),f=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||c())});var c=function(e){return function(){var t=e._readableState;p("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,P(e))}}(n);e.on("drain",c);var f=!1,h=!1;function d(t){p("ondata"),h=!1,!1!==e.write(t)||h||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==j(o.pipes,e))&&!f&&(p("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,h=!0),n.pause())}function g(t){p("onerror",t),v(),e.removeListener("error",g),0===s(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",y),v()}function y(){p("onfinish"),e.removeListener("close",m),v()}function v(){p("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",g),e.once("close",m),e.once("finish",y),e.emit("pipe",n),o.flowing||(p("pipe resume"),n.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n),this);if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function d(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return B(e).length;default:if(r)return V(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function m(e,t,n,r,i){if(0===e.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:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;os&&(n=s-u),o=n;o>=0;o--){for(var f=!0,h=0;hi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i.push(n%256),i.push(r);return i}(t,e.length-n),e,n,r)}function E(e,t,n){return r.fromByteArray(0===t&&n===e.length?e:e.slice(t,n))}function k(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+f<=n)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:a=e[i+2],128==(192&(o=e[i+1]))&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:a=e[i+2],s=e[i+3],128==(192&(o=e[i+1]))&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(r.push((c-=65536)>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=f}return function(e){var t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);for(var n="",r=0;rthis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,n);case"utf8":case"utf-8":return k(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return O(this,t,n);case"base64":return E(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}).apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(r,i),c=e.slice(t,n),f=0;fi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return v(this,e,t,n);case"utf8":case"utf-8":return b(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return x(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function T(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function R(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function j(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function D(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function M(e,t,n,r,o){return o||D(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,o){return o||D(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||A(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||A(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||A(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=this[e],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||A(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||A(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||A(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||A(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||A(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||A(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||A(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||N(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):j(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);N(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):j(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return M(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return M(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=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),e.length-t=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function B(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(U,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(6))},function(e,t,n){"use strict";var r=n(21);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(r.nextTick(i,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,n){"use strict";var r=n(22).Buffer,i=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):t}function c(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(i>0&&(e.lastNeed=i-1),i):--r=0?(i>0&&(e.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){"use strict";e.exports=a;var r=n(12),i=n(17);function o(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),u=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),d(n)?r.showHidden=n:n&&t._extend(r,n),v(r.showHidden)&&(r.showHidden=!1),v(r.depth)&&(r.depth=2),v(r.colors)&&(r.colors=!1),v(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),c(r,e,r.depth)}function u(e,t){var n=s.styles[t];return n?"\x1b["+s.colors[n][0]+"m"+e+"\x1b["+s.colors[n][1]+"m":e}function l(e,t){return e}function c(e,n,r){if(e.customInspect&&n&&S(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,e);return y(i)||(i=c(e,i,r)),i}var o=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(y(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return m(t)?e.stylize(""+t,"number"):d(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}(e,n);if(o)return o;var a=Object.keys(n),s=function(e){var t={};return a.forEach(function(e,n){t[e]=!0}),t}();if(e.showHidden&&(a=Object.getOwnPropertyNames(n)),x(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(n);if(0===a.length){if(S(n))return e.stylize("[Function"+(n.name?": "+n.name:"")+"]","special");if(b(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(_(n))return e.stylize(Date.prototype.toString.call(n),"date");if(x(n))return f(n)}var u,l="",w=!1,E=["{","}"];return p(n)&&(w=!0,E=["[","]"]),S(n)&&(l=" [Function"+(n.name?": "+n.name:"")+"]"),b(n)&&(l=" "+RegExp.prototype.toString.call(n)),_(n)&&(l=" "+Date.prototype.toUTCString.call(n)),x(n)&&(l=" "+f(n)),0!==a.length||w&&0!=n.length?r<0?b(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),u=w?function(e,t,n,r,i){for(var o=[],a=0,s=t.length;a60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}(u,l,E)):E[0]+l+E[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,n,r,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=e.stylize(u.set?"[Getter/Setter]":"[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),T(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=g(n)?c(e,u.value,null):c(e,u.value,n-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),v(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function p(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function g(e){return null===e}function m(e){return"number"==typeof e}function y(e){return"string"==typeof e}function v(e){return void 0===e}function b(e){return w(e)&&"[object RegExp]"===E(e)}function w(e){return"object"==typeof e&&null!==e}function _(e){return w(e)&&"[object Date]"===E(e)}function x(e){return w(e)&&("[object Error]"===E(e)||e instanceof Error)}function S(e){return"function"==typeof e}function E(e){return Object.prototype.toString.call(e)}function k(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(v(o)&&(o=r.env.NODE_DEBUG||""),e=e.toUpperCase(),!a[e])if(new RegExp("\\b"+e+"\\b","i").test(o)){var n=r.pid;a[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else a[e]=function(){};return a[e]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=p,t.isBoolean=d,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=m,t.isString=y,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=v,t.isRegExp=b,t.isObject=w,t.isDate=_,t.isError=x,t.isFunction=S,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(81);var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;console.log("%s - %s",(n=[k((e=new Date).getHours()),k(e.getMinutes()),k(e.getSeconds())].join(":"),[e.getDate(),C[e.getMonth()],n].join(" ")),t.format.apply(t,arguments))},t.inherits=n(11),t._extend=function(e,t){if(!t||!w(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,n(6),n(8))},function(e,t,n){var r=n(48).Transform,i=n(56),o=n(35);function a(e){if(!(this instanceof a))return new a(e);r.call(this,{encoding:"utf8"}),this._writableState.objectMode=!0;var t=this,n=new o({write:function(e,n,r){t.push(e),r&&r()},end:function(e){t.push(null),e&&e()}},e);this._transform=function(e,t,r){n.addTriple(e,r)},this._flush=function(e){n.end(e)}}i.inherits(a,r),e.exports=a},function(e,t){function n(e,t){for(var n in e)t[n]=e[n]}function r(e,t){var r=e.prototype;if(Object.create){var i=Object.create(t.prototype);r.__proto__=i}if(!(r instanceof t)){function o(){}o.prototype=t.prototype,n(r,o=new o),e.prototype=r=o}r.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),r.constructor=e)}var i="http://www.w3.org/1999/xhtml",o={},a=o.ELEMENT_NODE=1,s=o.ATTRIBUTE_NODE=2,u=o.TEXT_NODE=3,l=o.CDATA_SECTION_NODE=4,c=o.ENTITY_REFERENCE_NODE=5,f=o.ENTITY_NODE=6,h=o.PROCESSING_INSTRUCTION_NODE=7,p=o.COMMENT_NODE=8,d=o.DOCUMENT_NODE=9,g=o.DOCUMENT_TYPE_NODE=10,m=o.DOCUMENT_FRAGMENT_NODE=11,y=o.NOTATION_NODE=12,v={},b={},w=(v.INDEX_SIZE_ERR=(b[1]="Index size error",1),v.DOMSTRING_SIZE_ERR=(b[2]="DOMString size error",2),v.HIERARCHY_REQUEST_ERR=(b[3]="Hierarchy request error",3)),_=(v.WRONG_DOCUMENT_ERR=(b[4]="Wrong document",4),v.INVALID_CHARACTER_ERR=(b[5]="Invalid character",5),v.NO_DATA_ALLOWED_ERR=(b[6]="No data allowed",6),v.NO_MODIFICATION_ALLOWED_ERR=(b[7]="No modification allowed",7),v.NOT_FOUND_ERR=(b[8]="Not found",8)),x=(v.NOT_SUPPORTED_ERR=(b[9]="Not supported",9),v.INUSE_ATTRIBUTE_ERR=(b[10]="Attribute in use",10));function S(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,b[e]),this.message=b[e],Error.captureStackTrace&&Error.captureStackTrace(this,S);return n.code=e,t&&(this.message=this.message+": "+t),n}function E(){}function k(e,t){this._node=e,this._refresh=t,C(this)}function C(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var r=e._refresh(e._node);ne(e,"length",r.length),n(r,e),e._inc=t}}function T(){}function O(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function I(e,t,n,r){if(r?t[O(t,r)]=n:t[t.length++]=n,e){n.ownerElement=e;var i=e.ownerDocument;i&&(r&&M(i,e,r),function(e,t,n){i&&i._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&(t._nsMap[n.prefix?n.localName:""]=n.value)}(0,e,n))}}function P(e,t,n){var r=O(t,n);if(!(r>=0))throw S(_,new Error(e.tagName+"@"+n));for(var i=t.length-1;r"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function j(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(j(e,t))return!0}while(e=e.nextSibling)}function D(){}function M(e,t,n,r){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&delete t._nsMap[n.prefix?n.localName:""]}function L(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var i=t.firstChild,o=0;i;)r[o++]=i,i=i.nextSibling;r.length=o}}}function U(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,L(e.ownerDocument,e),t}function F(e,t,n){var r=t.parentNode;if(r&&r.removeChild(t),t.nodeType===m){var i=t.firstChild;if(null==i)return t;var o=t.lastChild}else i=o=t;var a=n?n.previousSibling:e.lastChild;i.previousSibling=a,o.nextSibling=n,a?a.nextSibling=i:e.firstChild=i,null==n?e.lastChild=o:n.previousSibling=o;do{i.parentNode=e}while(i!==o&&(i=i.nextSibling));return L(e.ownerDocument||e,e),t.nodeType==m&&(t.firstChild=t.lastChild=null),t}function V(){this._nsMap={}}function B(){}function z(){}function q(){}function H(){}function W(){}function $(){}function G(){}function J(){}function K(){}function Q(){}function Y(){}function Z(){}function X(e,t){var n=[],r=9==this.nodeType?this.documentElement:this,i=r.prefix,o=r.namespaceURI;if(o&&null==i&&null==(i=r.lookupPrefix(o)))var a=[{namespace:o,prefix:null}];return te(this,n,e,t,a),n.join("")}function ee(e,t,n){var r=e.prefix||"",i=e.namespaceURI;if(!r&&!i)return!1;if("xml"===r&&"http://www.w3.org/XML/1998/namespace"===i||"http://www.w3.org/2000/xmlns/"==i)return!1;for(var o=n.length;o--;){var a=n[o];if(a.prefix==r)return a.namespace!=i}return!0}function te(e,t,n,r,o){if(r){if(!(e=r(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case a:o||(o=[]);var f=e.attributes,y=f.length,v=e.firstChild,b=e.tagName;n=i===e.namespaceURI||n,t.push("<",b);for(var w=0;w"),n&&/^script$/i.test(b))for(;v;)v.data?t.push(v.data):te(v,t,n,r,o),v=v.nextSibling;else for(;v;)te(v,t,n,r,o),v=v.nextSibling;t.push("")}else t.push("/>");return;case d:case m:for(v=e.firstChild;v;)te(v,t,n,r,o),v=v.nextSibling;return;case s:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,R),'"');case u:return t.push(e.data.replace(/[<&]/g,R));case l:return t.push("");case p:return t.push("\x3c!--",e.data,"--\x3e");case g:var k=e.publicId,C=e.systemId;if(t.push("');else if(C&&"."!=C)t.push(' SYSTEM "',C,'">');else{var T=e.internalSubset;T&&t.push(" [",T,"]"),t.push(">")}return;case h:return t.push("");case c:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function ne(e,t,n){e[t]=n}v.INVALID_STATE_ERR=(b[11]="Invalid state",11),v.SYNTAX_ERR=(b[12]="Syntax error",12),v.INVALID_MODIFICATION_ERR=(b[13]="Invalid modification",13),v.NAMESPACE_ERR=(b[14]="Invalid namespace",14),v.INVALID_ACCESS_ERR=(b[15]="Invalid access",15),S.prototype=Error.prototype,n(v,S),E.prototype={length:0,item:function(e){return this[e]||null},toString:function(e,t){for(var n=[],r=0;r0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var r in n)if(n[r]==e)return r;t=t.nodeType==s?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==s?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},n(o,N),n(o,N.prototype),D.prototype={nodeName:"#document",nodeType:d,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==m){for(var n=e.firstChild;n;){var r=n.nextSibling;this.insertBefore(n,t),n=r}return e}return null==this.documentElement&&e.nodeType==a&&(this.documentElement=e),F(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),U(this,e)},importNode:function(e,t){return function e(t,n,r){var i;switch(n.nodeType){case a:(i=n.cloneNode(!1)).ownerDocument=t;case m:break;case s:r=!0}if(i||(i=n.cloneNode(!1)),i.ownerDocument=t,i.parentNode=null,r)for(var o=n.firstChild;o;)i.appendChild(e(t,o,r)),o=o.nextSibling;return i}(this,e,t)},getElementById:function(e){var t=null;return j(this.documentElement,function(n){if(n.nodeType==a&&n.getAttribute("id")==e)return t=n,!0}),t},createElement:function(e){var t=new V;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new E,(t.attributes=new T)._ownerElement=t,t},createDocumentFragment:function(){var e=new Q;return e.ownerDocument=this,e.childNodes=new E,e},createTextNode:function(e){var t=new q;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new H;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new W;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new Y;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new B;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new K;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new V,r=t.split(":"),i=n.attributes=new T;return n.childNodes=new E,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,i._ownerElement=n,n},createAttributeNS:function(e,t){var n=new B,r=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==r.length?(n.prefix=r[0],n.localName=r[1]):n.localName=t,n}},r(D,N),D.prototype.getElementsByTagName=(V.prototype={nodeType:a,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===m?this.insertBefore(e,null):function(e,t){var n=t.parentNode;if(n){var r=e.lastChild;n.removeChild(t),r=e.lastChild}return r=e.lastChild,t.parentNode=e,t.previousSibling=r,t.nextSibling=null,r?r.nextSibling=t:e.firstChild=t,e.lastChild=t,L(e.ownerDocument,e,t),t}(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var r=this.ownerDocument.createAttributeNS(e,t);r.value=r.nodeValue=""+n,this.setAttributeNode(r)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new k(this,function(t){var n=[];return j(t,function(r){r===t||r.nodeType!=a||"*"!==e&&r.tagName!=e||n.push(r)}),n})},getElementsByTagNameNS:function(e,t){return new k(this,function(n){var r=[];return j(n,function(i){i===n||i.nodeType!==a||"*"!==e&&i.namespaceURI!==e||"*"!==t&&i.localName!=t||r.push(i)}),r})}}).getElementsByTagName,D.prototype.getElementsByTagNameNS=V.prototype.getElementsByTagNameNS,r(V,N),B.prototype.nodeType=s,r(B,N),z.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){this.nodeValue=this.data=e=this.data+e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(b[w])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},r(z,N),q.prototype={nodeName:"#text",nodeType:u,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var r=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(r,this.nextSibling),r}},r(q,z),H.prototype={nodeName:"#comment",nodeType:p},r(H,z),W.prototype={nodeName:"#cdata-section",nodeType:l},r(W,z),$.prototype.nodeType=g,r($,N),G.prototype.nodeType=y,r(G,N),J.prototype.nodeType=f,r(J,N),K.prototype.nodeType=c,r(K,N),Q.prototype.nodeName="#document-fragment",Q.prototype.nodeType=m,r(Q,N),Y.prototype.nodeType=h,r(Y,N),Z.prototype.serializeToString=function(e,t,n){return X.call(e,t,n)},N.prototype.toString=X;try{Object.defineProperty&&(Object.defineProperty(k.prototype,"length",{get:function(){return C(this),this.$$length}}),Object.defineProperty(N.prototype,"textContent",{get:function(){return function e(t){switch(t.nodeType){case a:case m:var n=[];for(t=t.firstChild;t;)7!==t.nodeType&&8!==t.nodeType&&n.push(e(t)),t=t.nextSibling;return n.join("");default:return t.nodeValue}}(this)},set:function(e){switch(this.nodeType){case a:case m:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),ne=function(e,t,n){e["$$"+t]=n})}catch(e){}t.DOMImplementation=A,t.XMLSerializer=Z},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var s=n(9),u=n(14),l=n(20),c=n(15),f=n(13),h=n(2),p=n(3),d=n(37),g=n(24),m=n(25),y=function(e){function t(e,n,r,a){var s;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(s=i(this,o(t).call(this))).termType=t.termType,s.statements=e||[],s.constraints=n||[],s.initBindings=r||[],s.optional=a||[],s}var n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(t,p),(n=[{key:"add",value:function(e,t,n,r){return this.statements.push(new g(e,t,n,r))}},{key:"addStatement",value:function(e){return this.statements.push(e)}},{key:"bnode",value:function(e){return new s(e)}},{key:"addAll",value:function(e){var t=this;e.forEach(function(e){t.add(e.subject,e.predicate,e.object,e.graph)})}},{key:"any",value:function(e,t,n,r){var i=this.anyStatementMatching(e,t,n,r);if(null!=i)return null==e?i.subject:null==t?i.predicate:null==n?i.object:void 0}},{key:"anyValue",value:function(e,t,n,r){var i=this.any(e,t,n,r);return i?i.value:void 0}},{key:"anyStatementMatching",value:function(e,t,n,r){var i=this.statementsMatching(e,t,n,r,!0);if(i&&0!==i.length)return i[0]}},{key:"statementsMatching",value:function(e,t,n,r,i){return this.statements.filter(function(i){return(!e||e.sameTerm(i.subject))&&(!t||t.sameTerm(i.predicate))&&(!n||e.sameTerm(i.object))&&(!r||r.sameTerm(i.subject))})}},{key:"bottomTypeURIs",value:function(e){var t,n,r,i,o,a,s;for(i in t=[],e)if(e.hasOwnProperty(i)){for(s=e[i],n=!0,r=0,o=(a=this.each(void 0,this.sym("http://www.w3.org/2000/01/rdf-schema#subClassOf"),this.sym(i))).length;r as "+d+":\n"+e+":\n"+e.stack);g(e,n)}}(e)}function b(){g&&g(null,n)}function w(e,t){e&&g(e,n);try{m.parse(t,_)}catch(e){g(e,n)}}function _(e,t,r){if(e&&g(e,n),t)y.push(t);else{for(var i=0;i: Bad syntax:\n "+i+'\n at: "'+n.slice(r,r+30)+'"'};o=0;var p=t.sym(n+"#query");for(f.query=p;;){if((a=c.skipSpace(e,o))<0)return f;if(";"===e[a]){if((o=c.skipSpace(e,a+1))<0)return f;a=o}var d=!1;for(s=0;s=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,e.exports=n(64),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(e){r.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";var n,r=Object.prototype,i=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag",l="object"==typeof e,c=t.regeneratorRuntime;if(c)l&&(e.exports=c);else{(c=t.regeneratorRuntime=l?e.exports:{}).wrap=w;var f="suspendedStart",h="suspendedYield",p="executing",d="completed",g={},m={};m[a]=function(){return this};var y=Object.getPrototypeOf,v=y&&y(y(A([])));v&&v!==r&&i.call(v,a)&&(m=v);var b=E.prototype=x.prototype=Object.create(m);S.prototype=b.constructor=E,E.constructor=S,E[u]=S.displayName="GeneratorFunction",c.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===S||"GeneratorFunction"===(t.displayName||t.name))},c.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,u in e||(e[u]="GeneratorFunction")),e.prototype=Object.create(b),e},c.awrap=function(e){return{__await:e}},k(C.prototype),C.prototype[s]=function(){return this},c.AsyncIterator=C,c.async=function(e,t,n,r){var i=new C(w(e,t,n,r));return c.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},k(b),b[u]="Generator",b[a]=function(){return this},b.toString=function(){return"[object Generator]"},c.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},c.values=A,P.prototype={constructor:P,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(I),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=n)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,i){return s.type="throw",s.arg=e,t.next=r,i&&(t.method="next",t.arg=n),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),I(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;I(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=n),g}}}function w(e,t,n,r){var i=Object.create((t&&t.prototype instanceof x?t:x).prototype),o=new P(r||[]);return i._invoke=function(e,t,n){var r=f;return function(i,o){if(r===p)throw new Error("Generator is already running");if(r===d){if("throw"===i)throw o;return N()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=T(a,n);if(s){if(s===g)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=_(e,t,n);if("normal"===u.type){if(r=n.done?d:h,u.arg===g)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=d,n.method="throw",n.arg=u.arg)}}}(e,n,o),i}function _(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function x(){}function S(){}function E(){}function k(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function C(e){var t;this._invoke=function(n,r){function o(){return new Promise(function(t,o){!function t(n,r,o,a){var s=_(e[n],e,r);if("throw"!==s.type){var u=s.arg,l=u.value;return l&&"object"==typeof l&&i.call(l,"__await")?Promise.resolve(l.__await).then(function(e){t("next",e,o,a)},function(e){t("throw",e,o,a)}):Promise.resolve(l).then(function(e){u.value=e,o(u)},function(e){return t("throw",e,o,a)})}a(s.arg)}(n,r,t,o)})}return t=t?t.then(o,o):o()}}function T(e,t){var r=e.iterator[t.method];if(r===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=n,T(e,t),"throw"===t.method))return g;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var i=_(r,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,g;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=n),t.delegate=null,g):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,g)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function A(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r=e.length&&n()}f(e,function(e){t(e,u(i))})},s.forEach=s.each,s.eachSeries=function(e,t,n){if(n=n||function(){},!e.length)return n();var r=0,i=function(){t(e[r],function(t){t?(n(t),n=function(){}):(r+=1)>=e.length?n():i()})};i()},s.forEachSeries=s.eachSeries,s.eachLimit=function(e,t,n,r){d(t).apply(null,[e,n,r])},s.forEachLimit=s.eachLimit;var d=function(e){return function(t,n,r){if(r=r||function(){},!t.length||e<=0)return r();var i=0,o=0,a=0;!function s(){if(i>=t.length)return r();for(;a=t.length?r():s())})}()}},g=function(e){return function(){var t=Array.prototype.slice.call(arguments);return e.apply(null,[s.each].concat(t))}},m=function(e){return function(){var t=Array.prototype.slice.call(arguments);return e.apply(null,[s.eachSeries].concat(t))}},y=function(e,t,n,r){if(t=h(t,function(e,t){return{index:t,value:e}}),r){var i=[];e(t,function(e,t){n(e.value,function(n,r){i[e.index]=r,t(n)})},function(e){r(e,i)})}else e(t,function(e,t){n(e.value,function(e){t(e)})})};s.map=g(y),s.mapSeries=m(y),s.mapLimit=function(e,t,n,r){return v(t)(e,n,r)};var v=function(e){return function(e,t){return function(){var n=Array.prototype.slice.call(arguments);return t.apply(null,[d(e)].concat(n))}}(e,y)};s.reduce=function(e,t,n,r){s.eachSeries(e,function(e,r){n(t,e,function(e,n){t=n,r(e)})},function(e){r(e,t)})},s.inject=s.reduce,s.foldl=s.reduce,s.reduceRight=function(e,t,n,r){var i=h(e,function(e){return e}).reverse();s.reduce(i,t,n,r)},s.foldr=s.reduceRight;var b=function(e,t,n,r){var i=[];e(t=h(t,function(e,t){return{index:t,value:e}}),function(e,t){n(e.value,function(n){n&&i.push(e),t()})},function(e){r(h(i.sort(function(e,t){return e.index-t.index}),function(e){return e.value}))})};s.filter=g(b),s.filterSeries=m(b),s.select=s.filter,s.selectSeries=s.filterSeries;var w=function(e,t,n,r){var i=[];e(t=h(t,function(e,t){return{index:t,value:e}}),function(e,t){n(e.value,function(n){n||i.push(e),t()})},function(e){r(h(i.sort(function(e,t){return e.index-t.index}),function(e){return e.value}))})};s.reject=g(w),s.rejectSeries=m(w);var _=function(e,t,n,r){e(t,function(e,t){n(e,function(n){n?(r(e),r=function(){}):t()})},function(e){r()})};s.detect=g(_),s.detectSeries=m(_),s.some=function(e,t,n){s.each(e,function(e,r){t(e,function(e){e&&(n(!0),n=function(){}),r()})},function(e){n(!1)})},s.any=s.some,s.every=function(e,t,n){s.each(e,function(e,r){t(e,function(e){e||(n(!1),n=function(){}),r()})},function(e){n(!0)})},s.all=s.every,s.sortBy=function(e,t,n){s.map(e,function(e,n){t(e,function(t,r){t?n(t):n(null,{value:e,criteria:r})})},function(e,t){if(e)return n(e);n(null,h(t.sort(function(e,t){var n=e.criteria,r=t.criteria;return nr?1:0}),function(e){return e.value}))})},s.auto=function(e,t){t=t||function(){};var n=p(e),r=n.length;if(!r)return t();var i={},o=[],a=function(e){o.unshift(e)},u=function(){r--,f(o.slice(0),function(e){e()})};a(function(){if(!r){var e=t;t=function(){},e(null,i)}}),f(n,function(n){var r=c(e[n])?e[n]:[e[n]],l=function(e){var r=Array.prototype.slice.call(arguments,1);if(r.length<=1&&(r=r[0]),e){var o={};f(p(i),function(e){o[e]=i[e]}),o[n]=r,t(e,o),t=function(){}}else i[n]=r,s.setImmediate(u)},h=r.slice(0,Math.abs(r.length-1))||[],d=function(){return t=function(e,t){return e&&i.hasOwnProperty(t)},r=!0,((e=h).reduce?e.reduce(t,r):(f(e,function(e,n,i){r=t(r,e)}),r))&&!i.hasOwnProperty(n);var e,t,r};if(d())r[r.length-1](l,i);else{var g=function(){d()&&(function(e){for(var t=0;t>>1);n(t,e[o])>=0?r=o:i=o-1}return r}(e.tasks,o,n)+1,0,o),e.saturated&&e.tasks.length===e.concurrency&&e.saturated(),s.setImmediate(e.process)})}(r,e,t,i)},delete r.unshift,r},s.cargo=function(e,t){var n=!1,r=[],i={tasks:r,payload:t,saturated:null,empty:null,drain:null,drained:!0,push:function(e,n){c(e)||(e=[e]),f(e,function(e){r.push({data:e,callback:"function"==typeof n?n:null}),i.drained=!1,i.saturated&&r.length===t&&i.saturated()}),s.setImmediate(i.process)},process:function o(){if(!n){if(0===r.length)return i.drain&&!i.drained&&i.drain(),void(i.drained=!0);var a=r.splice(0,"number"==typeof t?t:r.length),s=h(a,function(e){return e.data});i.empty&&i.empty(),n=!0,e(s,function(){n=!1;var e=arguments;f(a,function(t){t.callback&&t.callback.apply(null,e)}),o()})}},length:function(){return r.length},running:function(){return n}};return i};var E=function(e){return function(t){var n=Array.prototype.slice.call(arguments,1);t.apply(null,n.concat([function(t){var n=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(t?console.error&&console.error(t):console[e]&&f(n,function(t){console[e](t)}))}]))}};s.log=E("log"),s.dir=E("dir"),s.memoize=function(e,t){var n={},r={};t=t||function(e){return e};var i=function(){var i=Array.prototype.slice.call(arguments),o=i.pop(),a=t.apply(null,i);a in n?s.nextTick(function(){o.apply(null,n[a])}):a in r?r[a].push(o):(r[a]=[o],e.apply(null,i.concat([function(){n[a]=arguments;var e=r[a];delete r[a];for(var t=0,i=e.length;t2){var r=Array.prototype.slice.call(arguments,2);return n.apply(this,r)}return n};s.applyEach=g(k),s.applyEachSeries=m(k),s.forever=function(e,t){!function n(r){if(r){if(t)return t(r);throw r}e(n)}()},e.exports?e.exports=s:void 0===(i=(function(){return s}).apply(t,[]))||(e.exports=i)}()}).call(this,n(8),n(16).setImmediate)},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,o,a,s,u=1,l={},c=!1,f=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick(function(){d(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&d(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){d(e.data)},r=function(e){o.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(d,0,e)},h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n0?r-4:r,f=0;f>16&255,s[u++]=t>>8&255,s[u++]=255&t;return 2===a&&(t=i[e.charCodeAt(f)]<<2|i[e.charCodeAt(f+1)]>>4,s[u++]=255&t),1===a&&(t=i[e.charCodeAt(f)]<<10|i[e.charCodeAt(f+1)]<<4|i[e.charCodeAt(f+2)]>>2,s[u++]=t>>8&255,s[u++]=255&t),s},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=0,s=n-i;as?s:a+16383));return 1===i?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function c(e,t,n){for(var i,o=[],a=t;a>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<>1,c=-7,f=n?i-1:0,h=n?-1:1,p=e[t+f];for(f+=h,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+e[t+f],f+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=256*a+e[t+f],f+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=l}return(p?-1:1)*a*Math.pow(2,o-r)},t.write=function(e,t,n,r,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+p]=255&s,p+=d,s/=256,i-=8);for(a=a<0;e[n+p]=255&a,p+=d,a/=256,l-=8);e[n+p-d]|=128*g}},function(e,t){},function(e,t,n){"use strict";var r=n(22).Buffer,i=n(74);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t=r.allocUnsafe(e>>>0),n=this.head,i=0;n;)n.data.copy(t,i),i+=n.data.length,n=n.next;return t},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,n){(function(t){function n(e){try{if(!t.localStorage)return!1}catch(e){return!1}var n=t.localStorage[e];return null!=n&&"true"===String(n).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,n(6))},function(e,t,n){"use strict";e.exports=o;var r=n(55),i=n(17);function o(e){if(!(this instanceof o))return new o(e);r.call(this,e)}i.inherits=n(11),i.inherits(o,r),o.prototype._transform=function(e,t,n){n(null,e)}},function(e,t,n){e.exports=n(34)},function(e,t,n){e.exports=n(12)},function(e,t,n){e.exports=n(33).Transform},function(e,t,n){e.exports=n(33).PassThrough},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var s=n(3),u=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=i(this,o(t).call(this))).termType="DefaultGraph",e.value="",e}var n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(t,s),(n=[{key:"toCanonical",value:function(){return this.value}}])&&function(e,t){for(var n=0;n=t+n||t?new java.lang.String(e,t,n)+"":e}function u(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}r.prototype.parseFromString=function(e,t){var n=this.options,r=new l,o=n.domBuilder||new i,s=n.errorHandler,u=n.locator,c=n.xmlns||{},f={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return u&&o.setDocumentLocator(u),r.errorHandler=function(e,t,n){if(!e){if(t instanceof i)return t;e=t}var r={},o=e instanceof Function;function s(t){var i=e[t];!i&&o&&(i=2==e.length?function(n){e(t,n)}:e),r[t]=i&&function(e){i("[xmldom "+t+"]\t"+e+a(n))}||function(){}}return n=n||{},s("warning"),s("error"),s("fatalError"),r}(s,o,u),r.domBuilder=n.domBuilder||o,/\/x?html?$/.test(t)&&(f.nbsp="\xa0",f.copy="\xa9",c[""]="http://www.w3.org/1999/xhtml"),c.xml=c.xml||"http://www.w3.org/XML/1998/namespace",e?r.parse(e,c,f):r.errorHandler.error("invalid doc source"),o.doc},i.prototype={startDocument:function(){this.doc=(new c).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var i=this.doc,a=i.createElementNS(e,n||t),s=r.length;u(this,a),this.currentElement=a,this.locator&&o(this.locator,a);for(var l=0;l":switch(m){case o:n.setTagName(e.slice(t,g));case c:case f:case h:break;case l:case a:"/"===(v=e.slice(t,g)).slice(-1)&&(n.closed=!0,v=v.slice(0,-1));case s:m===s&&(v=d),m==l?(p.warning('attribute "'+v+'" missed quot(")!!'),n.add(d,v.replace(/&#?\w+;/g,i),t)):("http://www.w3.org/1999/xhtml"===r[""]&&v.match(/^(?:disabled|checked|selected)$/i)||p.warning('attribute "'+v+'" missed value!! "'+v+'" instead!!'),n.add(v,v,t));break;case u:throw new Error("attribute value missed!!")}return g;case"\x80":y=" ";default:if(y<=" ")switch(m){case o:n.setTagName(e.slice(t,g)),m=f;break;case a:d=e.slice(t,g),m=s;break;case l:var v=e.slice(t,g).replace(/&#?\w+;/g,i);p.warning('attribute "'+v+'" missed quot(")!!'),n.add(d,v,t);case c:m=f}else switch(m){case s:"http://www.w3.org/1999/xhtml"===r[""]&&d.match(/^(?:disabled|checked|selected)$/i)||p.warning('attribute "'+d+'" missed value!! "'+d+'" instead2!!'),n.add(d,d,t),t=g,m=a;break;case c:p.warning('attribute space is required"'+d+'"!!');case f:m=a,t=g;break;case u:m=l,t=g;break;case h:throw new Error("elements closed character '/' and '>' must be connected to")}}g++}}function m(e,t,n){for(var r=e.tagName,i=null,o=e.length;o--;){var a=e[o],s=a.qName,u=a.value;if((h=s.indexOf(":"))>0)var l=a.prefix=s.slice(0,h),c=s.slice(h+1),f="xmlns"===l&&c;else c=s,l=null,f="xmlns"===s&&"";a.localName=c,!1!==f&&(null==i&&(i={},b(n,n={})),n[f]=i[f]=u,a.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(f,u))}for(o=e.length;o--;)(l=(a=e[o]).prefix)&&("xml"===l&&(a.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==l&&(a.uri=n[l||""]));var h;(h=r.indexOf(":"))>0?(l=e.prefix=r.slice(0,h),c=e.localName=r.slice(h+1)):(l=null,c=e.localName=r);var p=e.uri=n[l||""];if(t.startElement(p,c,r,e),!e.closed)return e.currentNSMap=n,e.localNSMap=i,!0;if(t.endElement(p,c,r),i)for(l in i)t.endPrefixMapping(l)}function y(e,t,n,r,i){if(/^(?:script|textarea)$/i.test(n)){var o=e.indexOf("",t),a=e.substring(t+1,o);if(/[&<]/.test(a))return/^script$/i.test(n)?(i.characters(a,0,a.length),o):(a=a.replace(/&#?\w+;/g,r),i.characters(a,0,a.length),o)}return t+1}function v(e,t,n,r){var i=r[n];return null==i&&((i=e.lastIndexOf(""))t?(n.comment(e,t+4,i-t-4),i+3):(r.error("Unclosed comment"),-1):-1;default:if("CDATA["==e.substr(t+3,6)){var i=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,i-t-9),n.endCDATA(),i+3}var o=function(e,t){var n,r=[],i=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(i.lastIndex=t,i.exec(e);n=i.exec(e);)if(r.push(n),n[1])return r}(e,t),a=o.length;if(a>1&&/!doctype/i.test(o[0][0])){var s=o[1][0],u=a>3&&/^public$/i.test(o[2][0])&&o[3][0],l=a>4&&o[4][0],c=o[a-1];return n.startDTD(s,u&&u.replace(/^(['"])(.*?)\1$/,"$2"),l&&l.replace(/^(['"])(.*?)\1$/,"$2")),n.endDTD(),c.index+c[0].length}}return-1}function _(e,t,n){var r=e.indexOf("?>",t);if(r){var i=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return i?(n.processingInstruction(i[1],i[2]),r+2):-1}return-1}function x(e){}function S(e,t){return e.__proto__=t,e}p.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),b(t,t={}),function(e,t,n,r,i){function o(e){var t=e.slice(1,-1);return t in n?n[t]:"#"===t.charAt(0)?function(e){if(e>65535){var t=55296+((e-=65536)>>10);return String.fromCharCode(t,56320+(1023&e))}return String.fromCharCode(e)}(parseInt(t.substr(1).replace("x","0x"))):(i.error("entity not found:"+e),e)}function a(t){if(t>b){var n=e.substring(b,t).replace(/&#?\w+;/g,o);f&&s(b),r.characters(n,0,t-b),b=t}}function s(t,n){for(;t>=l&&(n=c.exec(e));)l=(u=n.index)+n[0].length,f.lineNumber++;f.columnNumber=t-u+1}for(var u=0,l=0,c=/.*(?:\r\n?|\n)|.*$/g,f=r.locator,h=[{currentNSMap:t}],p={},b=0;;){try{var S=e.indexOf("<",b);if(S<0){if(!e.substr(b).match(/^\s*$/)){var E=r.doc,k=E.createTextNode(e.substr(b));E.appendChild(k),r.currentElement=k}return}switch(S>b&&a(S),e.charAt(S+1)){case"/":var C=e.indexOf(">",S+3),T=e.substring(S+2,C),O=h.pop();C<0?(T=e.substring(S+2).replace(/[\s<].*/,""),i.error("end tag name: "+T+" is not complete:"+O.tagName),C=S+1+T.length):T.match(/\sb?b=C:a(Math.max(S,b)+1)}}(e,t,n,r,this.errorHandler),r.endDocument()}},x.prototype={setTagName:function(e){if(!i.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},add:function(e,t,n){if(!i.test(e))throw new Error("invalid attribute:"+e);this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},S({},S.prototype)instanceof S||(S=function(e,t){function n(){}for(t in n.prototype=t,n=new n,e)n[t]=e[t];return n}),t.XMLReader=p},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var s=n(3),u=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=i(this,o(t).call(this))).termType=t.termType,e}var n;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(t,s),(n=[{key:"toString",value:function(){return"()"}}])&&function(e,t){for(var n=0;n]*>$/)}function l(e){return"string"==typeof e&&(e.match(/^_:/)||e.match(/^$/))}function c(e){return"string"==typeof e&&e.match(/^:|^[^_][^:]*:/)}function f(e){return e.split(":")[0]}function h(e){return e.split(":")[1]}function p(e){return u(e)?e.slice(1,e.length-1):e}function d(e){e=e.replace(/\(/g," ( ").replace(/\)/g," ) ").replace(//g,"> ").replace(/{/g," { ").replace(/}/g," } ").replace(/[\t\n\r]/g," ").replace(/; /g," ; ").replace(/\. /g," . ").replace(/, /g," , "),r.info("New str into spaceDelimit: \n"+e);var t,n=[],i=e.split(" ");for(var o in i)"string"==typeof(t=i[o])&&t.match(/[^ \n\t]/)&&(n=n.concat(i[o]));return n}function g(e,t){for(var n=0;n"===e[1]?(r.debug("Constraint added: "+e),t.constraints[e[0]]=new v(e[2])):"<"===e[1]?(r.debug("Constraint added: "+e),t.constraints[e[0]]=new v(e[2])):r.warn("I don't know how to handle the constraint: "+e)}function _(e,t){r.debug("Optional query: "+e+" not yet implemented.");var i=n.formula();x(e,i),t.optional.push(i)}function x(e,t){var i,o,d=function(e){for(var t,i=[],o=0;o"):t,s(e[o])?i[o]=a(e[o].slice(1)):l(e[o])?(r.info(e[o]+" was identified as a bnode."),i[o]=n.bnode()):u(e[o])?(r.info(e[o]+" was identified as a symbol."),i[o]=n.sym(p(e[o]))):c(e[o])?(r.info(e[o]+" was identified as a prefixed symbol"),k[f(e[o])]?i[o]=n.sym(e[o]=k[f(e[o])]+h(e[o])):(r.error("SPARQL error: "+e[o]+" with prefix "+f(e[o])+" does not have a correct prefix entry."),i[o]=e[o])):i[o]=e[o]):i[o]=e[o];return i}(e);for(r.debug("WHERE: "+d);g("OPTIONAL",d);)o=g("OPTIONAL",d),r.debug("OPT: "+o+" "+d[o]+" in "+d),"{"!==d[o+1]&&r.warn("Bad optional opening bracket in word "+o),-1===(i=y(d.slice(o+2),"{","}"))?r.error("No matching bracket in word "+o):(_(d.slice(o+2,o+2+i),t),o=g("OPTIONAL",d),i=y(d.slice(o+2),"{","}"),d.splice(o,i+3));for(r.debug("WHERE after optionals: "+d);g("FILTER",d);){var v=g("FILTER",d);"("!==d[v+1]&&r.warn("Bad filter opening bracket in word "+v),-1===(i=y(d.slice(v+2),"(",")"))?r.error("No matching bracket in word "+v):(w(d.slice(v+2,v+2+i),t),v=g("FILTER",d),i=y(d.slice(v+2),"(",")"),d.splice(v,i+3))}r.debug("WHERE after filters and optionals: "+d),function(e,t){var n=new Array(1);n[0]=-1;for(var i=n.concat(m(".",e)),o=[],a=0;a"),"is"===t[n]&&"of"===t[n+2]){t.splice(n,1),t.splice(n+1,1);var r=t[n-1];t[n-1]=t[n+1],t[n+1]=r}return t}(),r.info("SPARQL Tokens: "+i),i}(e),k=function(e){var t,n=m("PREFIX",e),i=[];for(var o in n){var a=e[n[o]+1],s=e[n[o]+2];if("string"==typeof(t=a)&&t.match(/:$/))if(u(s)){r.info("Prefix found: "+a+" -> "+s);var l=f(a),c=p(s);i[l]=c}else r.error("Invalid SPARQL symbol: "+s);else r.error("Invalid SPARQL prefix: "+a)}return i}(E);k.rdf||(k.rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"),k.rdfs||(k.rdfs="http://www.w3.org/2000/01/rdf-schema#");var C=g("SELECT",E),T=g("WHERE",E);if(C<0||T<0||C>T)return r.error("Invalid or nonexistent SELECT and WHERE tags in SPARQL query"),!1;if(function(e,t){for(var n in r.info("SPARQL vars: "+e),e)if(s(e[n])){r.info("Added "+e[n]+" to query variables from SPARQL");var i=a(e[n].slice(1));t.vars.push(i),i.label=e[n].slice(1)}else r.warn("Incorrect SPARQL variable in SELECT: "+e[n])}(E.slice(C+1,T),S),x(E.slice(T+2,E.length-1),S.pat),t)return S;for(var O in S.pat.statements){var I=S.pat.statements[O];"NamedNode"===I.subject.termType&&n.fetcher&&n.fetcher.lookUpThing(I.subject,"sparql:"+I.subject),"NamedNode"===I.object.termType&&n.fetcher&&n.fetcher.lookUpThing(I.object,"sparql:"+I.object)}return S}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=n(18),o=n(4).docpart,a=n(36),s=n(23).namedNode,u=n(19),l=n(38),c=n(4).join,f=n(7),h=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=t||new i,this.store=t,t.updater)throw new Error("You can't have two UpdateManagers for the same store");t.fetcher||(t.fetcher=new a(t)),t.updater=this,this.ifps={},this.fps={},this.ns={},this.ns.link=u("http://www.w3.org/2007/ont/link#"),this.ns.http=u("http://www.w3.org/2007/ont/http#"),this.ns.httph=u("http://www.w3.org/2007/ont/httph#"),this.ns.ldp=u("http://www.w3.org/ns/ldp#"),this.ns.rdf=u("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.rdfs=u("http://www.w3.org/2000/01/rdf-schema#"),this.ns.rdf=u("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.owl=u("http://www.w3.org/2002/07/owl#"),this.patchControl=[]}var t;return(t=[{key:"patchControlFor",value:function(e){return this.patchControl[e.uri]||(this.patchControl[e.uri]=[]),this.patchControl[e.uri]}},{key:"editable",value:function(e,t){if(!e)return!1;if(t||(t=this.store),"file:///"===e.slice(0,8)){if(t.holds(t.sym(e),s("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),s("http://www.w3.org/2007/ont/link#MachineEditableDocument")))return"LOCALFILE";var n=t.statementsMatching(t.sym(e));return console.log("UpdateManager.editable: Not MachineEditableDocument file "+e+"\n"),console.log(n.map(function(e){return e.toNT()}).join("\n")),!1}var r,i,a=!1,u=t.each(void 0,this.ns.link("requestedURI"),o(e));if(t.holds(s(e),this.ns.rdf("type"),this.ns.ldp("Resource")))return"SPARQL";for(var l=0;l=0)return"SPARQL";var p=t.each(c,this.ns.httph("ms-author-via"));if(p.length)for(var d=0;d=0)return"SPARQL";if(i.indexOf("DAV")>=0)return"DAV"}var g=t.each(c,this.ns.http("status"));if(g.length)for(var m=0;m"),r.store.fetcher.webOperation("PATCH",e,{noMeta:!0,contentType:"application/sparql-update",body:t})}).then(function(r){if(!r.ok){var i="UpdateManager: update failed for <"+e+"> status="+r.status+", "+r.statusText+"\n for query: "+t;throw console.log(i),new Error(i)}console.log("UpdateManager: update Ok for <"+e+">"),n(e,r.ok,r.responseText,r)}).catch(function(t){n(e,!1,t.message,t)})}},{key:"update_statement",value:function(e){if(!e||e.why){var t=this,n=this.statementContext(e);return{statement:e?[e.subject,e.predicate,e.object,e.why]:void 0,statementNT:e?this.anonymizeNT(e):void 0,where:t.contextWhere(n),set_object:function(e,n){var r=this.where;r+="DELETE DATA { "+this.statementNT+" } ;\n",r+="INSERT DATA { "+this.anonymize(this.statement[0])+" "+this.anonymize(this.statement[1])+" "+this.anonymize(e)+" . }\n",t.fire(this.statement[3].uri,r,n)}}}}},{key:"insert_statement",value:function(e,t){var n=e instanceof Array?e[0]:e,r=this.contextWhere(this.statementContext(n));if(e instanceof Array){for(var i="",o=0;o 1 different downstream actions")}else n.downstreamAction=t;else t(e)}},{key:"clearUpstreamCount",value:function(e){this.patchControlFor(e).upstreamCount=0}},{key:"getUpdatesVia",value:function(e){var t=this.store.fetcher.getHeader(e,"updates-via");return t&&t.length?t[0].trim():null}},{key:"addDownstreamChangeListener",value:function(e,t){var n=this,r=this.patchControlFor(e);r.downstreamChangeListeners||(r.downstreamChangeListeners=[]),r.downstreamChangeListeners.push(t),this.setRefreshHandler(e,function(e){n.reloadAndSync(e)})}},{key:"reloadAndSync",value:function(e){var t=this.patchControlFor(e),n=this;if(t.reloading)console.log(" Already reloading - stop");else{t.reloading=!0;var r=1e3;!function i(){console.log("try reload - timeout = "+r),n.reload(n.store,e,function(n,o,a){if(t.reloading=!1,n){if(t.downstreamChangeListeners)for(var s=0;s=0))return void console.log("just an echo: "+l.upstreamCount);console.log("Assume a real downstream change: "+l.upstreamCount+" -> 0"),l.upstreamCount=0,i.requestDownstreamAction(e,r)}}}(),!0):(console.log("Server doies not support live updates thoughUpdates-Via :-("),!1)}},{key:"update",value:function(e,t,n,o){var a=this;try{var s=this.store,u=e?e instanceof i?e.statements:e instanceof Array?e:[e]:[],l=t?t instanceof i?t.statements:t instanceof Array?t:[t]:[];if(!(u instanceof Array))throw new Error("Type Error "+r(u)+": "+u);if(!(l instanceof Array))throw new Error("Type Error "+r(l)+": "+l);if(0===u.length&&0===l.length)return n(null,!0);var c=u.length?u[0].why:l[0].why;if(!c){var h="Error patching: statement does not specify which document to patch:"+u[0]+", "+l[0];throw console.log(h),new Error(h)}var p=this.patchControlFor(c),d=Date.now(),g=["subject","predicate","object","why"],m={delete:u,insert:l};["insert","delete"].map(function(e){m[e].map(function(e){if(!c.sameTerm(e.why))throw new Error("update: destination "+c+" inconsistent with delete quad "+e.why);g.map(function(t){if(void 0===e[t])throw new Error("update: undefined "+t+" of statement.")})})});var y=this.editable(c.uri,s);if(!1===y)throw new Error("Update: Can't make changes in uneditable "+c);if(void 0===y){if(o)throw new Error("Update: Loaded "+c+"but stil can't figure out what editing protcol it supports.");return console.log("Update: have not loaded ".concat(c," before: loading now...")),void this.store.fetcher.load(c).then(function(r){a.update(e,t,n,!0)},function(e){throw new Error("Update: Can't read ".concat(c," before patching: ").concat(e))})}if(y.indexOf("SPARQL")>=0){var v=[];u.length&&(v=this.statementArrayBnodes(u)),l.length&&(v=v.concat(this.statementArrayBnodes(l)));var b=this.bnodeContext(v,c),w=this.contextWhere(b),_="";if(w.length){if(u.length){_+="DELETE { ";for(var x=0;x=0)this.updateDav(c,u,l,n);else{if(!(y.indexOf("LOCALFILE")>=0))throw new Error("Unhandled edit method: '"+y+"' for "+c);try{this.updateLocalFile(c,u,l,n)}catch(e){n(c.uri,!1,"Exception trying to write back file <"+c.uri+">\n")}}}catch(e){n(void 0,!1,"Exception in update: "+e+"\n"+f.stackString(e))}}},{key:"updateDav",value:function(e,t,n,r){var i=this.store,o=i.any(e,this.ns.link("request"));if(!o)throw new Error("No record of our HTTP GET request for document: "+e);var a=i.any(o,this.ns.link("response"));if(!a)return null;for(var s=i.the(a,this.ns.httph("content-type")).value,u=i.statementsMatching(void 0,void 0,void 0,e).slice(),l=0;l>>");var d=e.uri.slice(7),g=Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);if(g.initWithPath(d),!g.exists())throw new Error("Rewriting file <"+e.uri+"> but it does not exist!");var m=Components.classes["@mozilla.org/network/file-output-stream;1"].createInstance(Components.interfaces.nsIFileOutputStream);m.init(g,42,parseInt("0666",8),0),m.write(p,p.length),m.close();for(var y=0;y3&&void 0!==arguments[3]?arguments[3]:"";return n=n||{},console.log("deepCopying "+e+"\n"+r+"-> "+t),e.match(/\/$/)||(e+="/"),t.match(/\/$/)||(t+="/"),new Promise(function(i,o){M(e).then(function(a){for(var s=[],u=a.folders.concat(a.files),l=function(){var i=u[c],o=function(e,t,n){if(!n.startsWith(e))throw new Error("source {".concat(n,"} is not in tree {").concat(e,"}"));return t+n.slice(e.length)}(e,t,i.url);"folder"===i.type?O(o).then(function(){s.push(y(i.url,o,n,r+" "))}):(console.log("copying "+o),s.push(_(i.url,o)))},c=0;c; rel="type"',a="text/turtle");var u={method:"POST",headers:{slug:n,link:s},body:i};void 0===a&&"undefined"==typeof window||(u.headers["Content-Type"]=a),r.auth.fetch(t,u).then(function(n){var r=n.headers.get("location"),i=r.substr(r.lastIndexOf("/")+1);e(t+i)},function(e){o(e)})}));case 1:case"end":return e.stop()}},e,this)}))).apply(this,arguments)}function O(e){return(function(){return s()(o.a.mark(function e(t){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){D(t).then(function(t){e()},function(r){I(t,void 0,"folder").then(function(t){e(t)},function(e){n(e)})})}));case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function I(e,t,n){return(function(){return s()(o.a.mark(function e(t,n,r){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,i){var o=t.replace(/\/$/,"").replace(/.*\//,"");C(t.substring(0,t.lastIndexOf(o)),o,n,r).then(function(t){e(t)},function(e){i(e)})}));case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function P(){return(function(){return s()(o.a.mark(function e(){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r.auth.logout());case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function A(e){return(function(){return s()(o.a.mark(function e(t){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",R(t));case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function N(e){return(function(){return s()(o.a.mark(function e(t){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",R(t));case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function R(e){return(function(){return s()(o.a.mark(function e(t){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){L(t,{method:"DELETE"}).then(function(t){e(t)},function(t){e(t)})}));case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function j(e,t,n){return(function(){return s()(o.a.mark(function e(t,n,r){var i;return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R(t);case 2:if(!(i=e.sent).match||!i.match(/409/)){e.next=5;break}throw new Error("Coulnd't delete, conflict!");case 5:return e.next=7,I(t,n,r);case 7:return e.abrupt("return",i=e.sent);case 9:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function D(e){return(function(){return s()(o.a.mark(function e(t){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,n){L(t).then(function(t){e(t)},function(e){return n("fetch error "+e)})}));case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function M(e){return(function(){return s()(o.a.mark(function e(t){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return"/"!=t.substr(-1)&&(t+="/"),e.abrupt("return",new Promise(function(e,n){L(t).then(function(r){m(r,t,"text/turtle").then(function(n){e(d(n,t,r))},function(e){return n(e)})},function(e){return n(e)})}));case 2:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function L(e,t){return(function(){return s()(o.a.mark(function e(t,n){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,i){r.auth.fetch(t,n).then(function(n){n.ok||i(n.status+" ("+n.statusText+") "+t);var r=n.headers._headers?n.headers._headers["content-type"]:"";(r=r.toString()).match(/(image|audio|video)/)?n.buffer().then(function(t){e(t)},function(e){return i("buffer error "+e)}):n.text?n.text().then(function(t){e(t)},function(e){return i("buffer error "+e)}):e(n)},function(e){i("fetch errror "+e+t)})}));case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function U(e){return(function(){return s()(o.a.mark(function e(t){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",r.auth.getCredentials(t));case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function F(e){return(function(){return s()(o.a.mark(function e(t){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",!0);case 1:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function V(e,t){return(function(){return s()(o.a.mark(function e(t,n){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"==typeof window){e.next=2;break}return e.abrupt("return",F(t));case 2:return e.abrupt("return",new Promise(function(e,r){L(t,{encoding:null}).then(function(i){n.match(/\/$/)||(n+="/");var o=n+t.replace(/.*\//,"");try{fs.writeFileSync(o,i),e(o)}catch(e){r("write error "+o+" "+e)}},function(e){r("fetch error "+e)})}));case 3:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}function B(e,t){return(function(){return s()(o.a.mark(function e(t,n){return o.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("undefined"==typeof window){e.next=2;break}return e.abrupt("return",F(n));case 2:return e.abrupt("return",new Promise(function(e,r){var i=fs.readFileSync(t,"utf-8");n.match(/\/$/)||(n+="/"),A(n+=t.replace(/.*\//,"")).then(function(){I(n,i).then(function(){e(t)},function(e){r("create "+e)})},function(e){r("delete error "+e)})}));case 3:case"end":return e.stop()}},e,this)})).apply(this,arguments)}).apply(this,arguments)}n.d(t,"copyFolder",function(){return y}),n.d(t,"guessFileType",function(){return v}),n.d(t,"processFolder",function(){return b}),n.d(t,"text2graph",function(){return w}),n.d(t,"copyFile",function(){return _}),n.d(t,"fetchAndParse",function(){return x}),n.d(t,"popupLogin",function(){return S}),n.d(t,"checkSession",function(){return E}),n.d(t,"login",function(){return k}),n.d(t,"add",function(){return C}),n.d(t,"createFolder",function(){return O}),n.d(t,"createFile",function(){return I}),n.d(t,"logout",function(){return P}),n.d(t,"deleteFile",function(){return A}),n.d(t,"deleteFolder",function(){return N}),n.d(t,"remove",function(){return R}),n.d(t,"updateFile",function(){return j}),n.d(t,"readFile",function(){return D}),n.d(t,"readFolder",function(){return M}),n.d(t,"fetch",function(){return L}),n.d(t,"getCredentials",function(){return U}),n.d(t,"doWin",function(){return F}),n.d(t,"downloadFile",function(){return V}),n.d(t,"uploadFile",function(){return B}),void 0!==l.a&&(r={auth:l.a})}])},crnd:function(e,t){function n(e){return Promise.resolve().then(function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t})}n.keys=function(){return[]},n.resolve=n,e.exports=n,n.id="crnd"},zUnb:function(e,t,n){"use strict";n.r(t);var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function i(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function s(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}function l(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function c(){for(var e=[],t=0;t0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(K);function ie(e){return e}function oe(e){return void 0===e&&(e=Number.POSITIVE_INFINITY),te(ie,e)}function ae(){for(var e=[],t=0;t1&&"number"==typeof e[e.length-1]&&(n=e.pop())):"number"==typeof i&&(n=e.pop()),null===r&&1===e.length&&e[0]instanceof I?e[0]:oe(n)(X(e,r))}function se(){return function(e){return e.lift(new ue(e))}}var ue=function(){function e(e){this.connectable=e}return e.prototype.call=function(e,t){var n=this.connectable;n._refCount++;var r=new le(e,n),i=t.subscribe(r);return r.closed||(r.connection=n.connect()),i},e}(),le=function(e){function t(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return i(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._refCount;if(t<=0)this.connection=null;else if(e._refCount=t-1,t>1)this.connection=null;else{var n=this.connection,r=e._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()}}else this.connection=null},t}(S),ce=function(e){function t(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return i(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype.connect=function(){var e=this._connection;return e||(this._isComplete=!1,(e=this._connection=new m).add(this.source.subscribe(new he(this.getSubject(),this))),e.closed?(this._connection=null,e=m.EMPTY):this._connection=e),e},t.prototype.refCount=function(){return se()(this)},t}(I).prototype,fe={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:ce._subscribe},_isComplete:{value:ce._isComplete,writable:!0},getSubject:{value:ce.getSubject},connect:{value:ce.connect},refCount:{value:ce.refCount}},he=function(e){function t(t,n){var r=e.call(this,t)||this;return r.connectable=n,r}return i(t,e),t.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},t.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}},t}(j);function pe(){return new D}function de(e){return{providedIn:e.providedIn||null,factory:e.factory,value:void 0}}var ge=function(){function e(e,t){this._desc=e,this.ngMetadataName="InjectionToken",this.ngInjectableDef=void 0!==t?de({providedIn:t.providedIn||"root",factory:t.factory}):void 0}return e.prototype.toString=function(){return"InjectionToken "+this._desc},e}(),me="__parameters__",ye="__prop__metadata__";function ve(e){return function(){for(var t=[],n=0;n ");else if("object"==typeof t){var i=[];for(var o in t)if(t.hasOwnProperty(o)){var a=t[o];i.push(o+":"+("string"==typeof a?JSON.stringify(a):Ne(a)))}r="{"+i.join(", ")+"}"}return"StaticInjectorError"+(n?"("+n+")":"")+"["+r+"]: "+e.replace(Ye,"\n ")}function nt(e,t){return new Error(tt(e,t))}function rt(e){for(var t in e)if(e[t]===Je)return t;throw Error("!prop")}var it=void 0;function ot(e){var t=it;return it=e,t}function at(e,t){if(void 0===t&&(t=0),void 0===it)throw new Error("inject() must be called from an injection context");if(null===it){var n=e.ngInjectableDef;if(n&&"root"==n.providedIn)return void 0===n.value?n.value=n.factory():n.value;if(8&t)return null;throw new Error("Injector: NOT_FOUND ["+Ne(e)+"]")}return it.get(e,8&t?null:void 0,t)}var st=function(e){return e[e.Emulated=0]="Emulated",e[e.Native=1]="Native",e[e.None=2]="None",e[e.ShadowDom=3]="ShadowDom",e}({}),ut=new(function(){return function(e){this.full=e,this.major=e.split(".")[0],this.minor=e.split(".")[1],this.patch=e.split(".").slice(2).join(".")}}())("6.1.10"),lt="ngDebugContext",ct="ngOriginalError",ft="ngErrorLogger";function ht(e){return e[lt]}function pt(e){return e[ct]}function dt(e){for(var t=[],n=1;n0&&(i=setTimeout(function(){r._callbacks=r._callbacks.filter(function(e){return e.timeoutId!==i}),e(r._didWork,r.getPendingTasks())},t)),this._callbacks.push({doneCb:e,timeoutId:i,updateCb:n})},e.prototype.whenStable=function(e,t,n){if(n&&!this.taskTrackingZone)throw new Error('Task tracking zone is required when passing an update callback to whenStable(). Is "zone.js/dist/task-tracking.js" loaded?');this.addCallback(e,t,n),this._runCallbacksIfReady()},e.prototype.getPendingRequestCount=function(){return this._pendingCount},e.prototype.findProviders=function(e,t,n){return[]},e}(),on=function(){function e(){this._applications=new Map,an.addToWindow(this)}return e.prototype.registerApplication=function(e,t){this._applications.set(e,t)},e.prototype.unregisterApplication=function(e){this._applications.delete(e)},e.prototype.unregisterAllApplications=function(){this._applications.clear()},e.prototype.getTestability=function(e){return this._applications.get(e)||null},e.prototype.getAllTestabilities=function(){return Array.from(this._applications.values())},e.prototype.getAllRootElements=function(){return Array.from(this._applications.keys())},e.prototype.findTestabilityInTree=function(e,t){return void 0===t&&(t=!0),an.findTestabilityInTree(this,e,t)},a([s("design:paramtypes",[])],e)}(),an=new(function(){function e(){}return e.prototype.addToWindow=function(e){},e.prototype.findTestabilityInTree=function(e,t,n){return null},e}()),sn=!0,un=!1,ln=new ge("AllowMultipleToken");function cn(){return un=!0,sn}var fn=function(){return function(e,t){this.name=e,this.token=t}}();function hn(e,t,n){void 0===n&&(n=[]);var r="Platform: "+t,i=new ge(r);return function(t){void 0===t&&(t=[]);var o=pn();if(!o||o.injector.get(ln,!1))if(e)e(n.concat(t).concat({provide:i,useValue:!0}));else{var a=n.concat(t).concat({provide:i,useValue:!0});!function(e){if(tn&&!tn.destroyed&&!tn.injector.get(ln,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");tn=e.get(dn);var t=e.get(Et,null);t&&t.forEach(function(e){return e()})}(qe.create({providers:a,name:r}))}return function(e){var t=pn();if(!t)throw new Error("No platform exists!");if(!t.injector.get(e,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return t}(i)}}function pn(){return tn&&!tn.destroyed?tn:null}var dn=function(){function e(e){this._injector=e,this._modules=[],this._destroyListeners=[],this._destroyed=!1}return e.prototype.bootstrapModuleFactory=function(e,t){var n,r=this,i="noop"===(n=t?t.ngZone:void 0)?new nn:("zone.js"===n?void 0:n)||new Kt({enableLongStackTrace:cn()}),o=[{provide:Kt,useValue:i}];return i.run(function(){var t=qe.create({providers:o,parent:r.injector,name:e.moduleType.name}),n=e.create(t),a=n.injector.get(gt,null);if(!a)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return n.onDestroy(function(){return yn(r._modules,n)}),i.runOutsideAngular(function(){return i.onError.subscribe({next:function(e){a.handleError(e)}})}),function(e,t,i){try{var o=((a=n.injector.get(wt)).runInitializers(),a.donePromise.then(function(){return r._moduleDoBootstrap(n),n}));return yt(o)?o.catch(function(n){throw t.runOutsideAngular(function(){return e.handleError(n)}),n}):o}catch(s){throw t.runOutsideAngular(function(){return e.handleError(s)}),s}var a}(a,i)})},e.prototype.bootstrapModule=function(e,t){var n=this;void 0===t&&(t=[]);var r=this.injector.get(Pt),i=gn({},t);return r.createCompiler([i]).compileModuleAsync(e).then(function(e){return n.bootstrapModuleFactory(e,i)})},e.prototype._moduleDoBootstrap=function(e){var t=e.injector.get(mn);if(e._bootstrapComponents.length>0)e._bootstrapComponents.forEach(function(e){return t.bootstrap(e)});else{if(!e.instance.ngDoBootstrap)throw new Error("The module "+Ne(e.instance.constructor)+' was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.');e.instance.ngDoBootstrap(t)}this._modules.push(e)},e.prototype.onDestroy=function(e){this._destroyListeners.push(e)},Object.defineProperty(e.prototype,"injector",{get:function(){return this._injector},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){if(this._destroyed)throw new Error("The platform has already been destroyed!");this._modules.slice().forEach(function(e){return e.destroy()}),this._destroyListeners.forEach(function(e){return e()}),this._destroyed=!0},Object.defineProperty(e.prototype,"destroyed",{get:function(){return this._destroyed},enumerable:!0,configurable:!0}),e}();function gn(e,t){return Array.isArray(t)?t.reduce(gn,e):o({},e,t)}var mn=function(){function e(e,t,n,r,i,o){var a=this;this._zone=e,this._console=t,this._injector=n,this._exceptionHandler=r,this._componentFactoryResolver=i,this._initStatus=o,this._bootstrapListeners=[],this._views=[],this._runningTick=!1,this._enforceNoNewChanges=!1,this._stable=!0,this.componentTypes=[],this.components=[],this._enforceNoNewChanges=cn(),this._zone.onMicrotaskEmpty.subscribe({next:function(){a._zone.run(function(){a.tick()})}});var s=new I(function(e){a._stable=a._zone.isStable&&!a._zone.hasPendingMacrotasks&&!a._zone.hasPendingMicrotasks,a._zone.runOutsideAngular(function(){e.next(a._stable),e.complete()})}),u=new I(function(e){var t;a._zone.runOutsideAngular(function(){t=a._zone.onStable.subscribe(function(){Kt.assertNotInAngularZone(),Pe(function(){a._stable||a._zone.hasPendingMacrotasks||a._zone.hasPendingMicrotasks||(a._stable=!0,e.next(!0))})})});var n=a._zone.onUnstable.subscribe(function(){Kt.assertInAngularZone(),a._stable&&(a._stable=!1,a._zone.runOutsideAngular(function(){e.next(!1)}))});return function(){t.unsubscribe(),n.unsubscribe()}});this.isStable=ae(s,u.pipe(function(e){return se()((t=pe,function(e){var n;n="function"==typeof t?t:function(){return t};var r=Object.create(e,fe);return r.source=e,r.subjectFactory=n,r})(e));var t}))}var t;return t=e,e.prototype.bootstrap=function(e,t){var n,r=this;if(!this._initStatus.done)throw new Error("Cannot bootstrap as there are still asynchronous initializers running. Bootstrap components in the `ngDoBootstrap` method of the root module.");n=e instanceof Nt?e:this._componentFactoryResolver.resolveComponentFactory(e),this.componentTypes.push(n.componentType);var i=n instanceof Vt?null:this._injector.get(Bt),o=n.create(qe.NULL,[],t||n.selector,i);o.onDestroy(function(){r._unloadComponent(o)});var a=o.injector.get(rn,null);return a&&o.injector.get(on).registerApplication(o.location.nativeElement,a),this._loadComponent(o),cn()&&this._console.log("Angular is running in the development mode. Call enableProdMode() to enable the production mode."),o},e.prototype.tick=function(){var e=this;if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");var n=t._tickScope();try{this._runningTick=!0,this._views.forEach(function(e){return e.detectChanges()}),this._enforceNoNewChanges&&this._views.forEach(function(e){return e.checkNoChanges()})}catch(r){this._zone.runOutsideAngular(function(){return e._exceptionHandler.handleError(r)})}finally{this._runningTick=!1,Gt(n)}},e.prototype.attachView=function(e){var t=e;this._views.push(t),t.attachToAppRef(this)},e.prototype.detachView=function(e){var t=e;yn(this._views,t),t.detachFromAppRef()},e.prototype._loadComponent=function(e){this.attachView(e.hostView),this.tick(),this.components.push(e),this._injector.get(Ct,[]).concat(this._bootstrapListeners).forEach(function(t){return t(e)})},e.prototype._unloadComponent=function(e){this.detachView(e.hostView),yn(this.components,e)},e.prototype.ngOnDestroy=function(){this._views.slice().forEach(function(e){return e.destroy()})},Object.defineProperty(e.prototype,"viewCount",{get:function(){return this._views.length},enumerable:!0,configurable:!0}),e._tickScope=$t("ApplicationRef#tick()"),e}();function yn(e,t){var n=e.indexOf(t);n>-1&&e.splice(n,1)}var vn=function(){return function(){}}(),bn=function(){return function(){}}(),wn=function(e){return e[e.Important=1]="Important",e[e.DashCase=2]="DashCase",e}({}),_n=function(){return function(){}}(),xn=function(){return function(e){this.nativeElement=e}}(),Sn=function(){return function(){}}(),En=function(){function e(){this.dirty=!0,this._results=[],this.changes=new Jt,this.length=0}return e.prototype.map=function(e){return this._results.map(e)},e.prototype.filter=function(e){return this._results.filter(e)},e.prototype.find=function(e){return this._results.find(e)},e.prototype.reduce=function(e,t){return this._results.reduce(e,t)},e.prototype.forEach=function(e){this._results.forEach(e)},e.prototype.some=function(e){return this._results.some(e)},e.prototype.toArray=function(){return this._results.slice()},e.prototype[Ie()]=function(){return this._results[Ie()]()},e.prototype.toString=function(){return this._results.toString()},e.prototype.reset=function(e){this._results=function e(t){return t.reduce(function(t,n){var r=Array.isArray(n)?e(n):n;return t.concat(r)},[])}(e),this.dirty=!1,this.length=this._results.length,this.last=this._results[this.length-1],this.first=this._results[0]},e.prototype.notifyOnChanges=function(){this.changes.emit(this)},e.prototype.setDirty=function(){this.dirty=!0},e.prototype.destroy=function(){this.changes.complete(),this.changes.unsubscribe()},e}(),kn=function(){return function(){}}(),Cn={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"},Tn=function(){function e(e,t){this._compiler=e,this._config=t||Cn}return e.prototype.load=function(e){return this._compiler instanceof It?this.loadFactory(e):this.loadAndCompile(e)},e.prototype.loadAndCompile=function(e){var t=this,r=l(e.split("#"),2),i=r[0],o=r[1];return void 0===o&&(o="default"),n("crnd")(i).then(function(e){return e[o]}).then(function(e){return On(e,i,o)}).then(function(e){return t._compiler.compileModuleAsync(e)})},e.prototype.loadFactory=function(e){var t=l(e.split("#"),2),r=t[0],i=t[1],o="NgFactory";return void 0===i&&(i="default",o=""),n("crnd")(this._config.factoryPathPrefix+r+this._config.factoryPathSuffix).then(function(e){return e[i+o]}).then(function(e){return On(e,r,i)})},e}();function On(e,t,n){if(!e)throw new Error("Cannot find '"+n+"' in '"+t+"'");return e}var In=function(){return function(){}}(),Pn=function(){return function(){}}(),An=function(){return function(){}}(),Nn=function(){return function(e,t){this.name=e,this.callback=t}}(),Rn=function(){function e(e,t,n){this._debugContext=n,this.nativeNode=e,t&&t instanceof jn?t.addChild(this):this.parent=null,this.listeners=[]}return Object.defineProperty(e.prototype,"injector",{get:function(){return this._debugContext.injector},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"componentInstance",{get:function(){return this._debugContext.component},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"context",{get:function(){return this._debugContext.context},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"references",{get:function(){return this._debugContext.references},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"providerTokens",{get:function(){return this._debugContext.providerTokens},enumerable:!0,configurable:!0}),e}(),jn=function(e){function t(t,n,r){var i=e.call(this,t,n,r)||this;return i.properties={},i.attributes={},i.classes={},i.styles={},i.childNodes=[],i.nativeElement=t,i}return i(t,e),t.prototype.addChild=function(e){e&&(this.childNodes.push(e),e.parent=this)},t.prototype.removeChild=function(e){var t=this.childNodes.indexOf(e);-1!==t&&(e.parent=null,this.childNodes.splice(t,1))},t.prototype.insertChildrenAfter=function(e,t){var n,r=this,i=this.childNodes.indexOf(e);-1!==i&&((n=this.childNodes).splice.apply(n,c([i+1,0],t)),t.forEach(function(e){e.parent&&e.parent.removeChild(e),e.parent=r}))},t.prototype.insertBefore=function(e,t){var n=this.childNodes.indexOf(e);-1===n?this.addChild(t):(t.parent&&t.parent.removeChild(t),t.parent=this,this.childNodes.splice(n,0,t))},t.prototype.query=function(e){return this.queryAll(e)[0]||null},t.prototype.queryAll=function(e){var t=[];return function e(t,n,r){t.childNodes.forEach(function(t){t instanceof jn&&(n(t)&&r.push(t),e(t,n,r))})}(this,e,t),t},t.prototype.queryAllNodes=function(e){var t=[];return function e(t,n,r){t instanceof jn&&t.childNodes.forEach(function(t){n(t)&&r.push(t),t instanceof jn&&e(t,n,r)})}(this,e,t),t},Object.defineProperty(t.prototype,"children",{get:function(){return this.childNodes.filter(function(e){return e instanceof t})},enumerable:!0,configurable:!0}),t.prototype.triggerEventHandler=function(e,t){this.listeners.forEach(function(n){n.name==e&&n.callback(t)})},t}(Rn),Dn=new Map;function Mn(e){return Dn.get(e)||null}function Ln(e){Dn.set(e.nativeNode,e)}function Un(e,t){var n=Bn(e),r=Bn(t);return n&&r?function(e,t,n){for(var r=e[Ie()](),i=t[Ie()]();;){var o=r.next(),a=i.next();if(o.done&&a.done)return!0;if(o.done||a.done)return!1;if(!n(o.value,a.value))return!1}}(e,t,Un):!(n||!e||"object"!=typeof e&&"function"!=typeof e||r||!t||"object"!=typeof t&&"function"!=typeof t)||Ae(e,t)}var Fn=function(){function e(e){this.wrapped=e}return e.wrap=function(t){return new e(t)},e.unwrap=function(t){return e.isWrapped(t)?t.wrapped:t},e.isWrapped=function(t){return t instanceof e},e}(),Vn=function(){function e(e,t,n){this.previousValue=e,this.currentValue=t,this.firstChange=n}return e.prototype.isFirstChange=function(){return this.firstChange},e}();function Bn(e){return!!zn(e)&&(Array.isArray(e)||!(e instanceof Map)&&Ie()in e)}function zn(e){return null!==e&&("function"==typeof e||"object"==typeof e)}var qn=function(){function e(){}return e.prototype.supports=function(e){return Bn(e)},e.prototype.create=function(e){return new Wn(e)},e}(),Hn=function(e,t){return t},Wn=function(){function e(e){this.length=0,this._linkedRecords=null,this._unlinkedRecords=null,this._previousItHead=null,this._itHead=null,this._itTail=null,this._additionsHead=null,this._additionsTail=null,this._movesHead=null,this._movesTail=null,this._removalsHead=null,this._removalsTail=null,this._identityChangesHead=null,this._identityChangesTail=null,this._trackByFn=e||Hn}return e.prototype.forEachItem=function(e){var t;for(t=this._itHead;null!==t;t=t._next)e(t)},e.prototype.forEachOperation=function(e){for(var t=this._itHead,n=this._removalsHead,r=0,i=null;t||n;){var o=!n||t&&t.currentIndex',!this.inertBodyElement.querySelector||this.inertBodyElement.querySelector("svg")?(this.inertBodyElement.innerHTML='

',this.getInertBodyElement=this.inertBodyElement.querySelector&&this.inertBodyElement.querySelector("svg img")&&function(){try{return!!window.DOMParser}catch(e){return!1}}()?this.getInertBodyElement_DOMParser:this.getInertBodyElement_InertDocument):this.getInertBodyElement=this.getInertBodyElement_XHR}return e.prototype.getInertBodyElement_XHR=function(e){e=""+e+"";try{e=encodeURI(e)}catch(r){return null}var t=new XMLHttpRequest;t.responseType="document",t.open("GET","data:text/html;charset=utf-8,"+e,!1),t.send(null);var n=t.response.body;return n.removeChild(n.firstChild),n},e.prototype.getInertBodyElement_DOMParser=function(e){e=""+e+"";try{var t=(new window.DOMParser).parseFromString(e,"text/html").body;return t.removeChild(t.firstChild),t}catch(n){return null}},e.prototype.getInertBodyElement_InertDocument=function(e){var t=this.inertDocument.createElement("template");return"content"in t?(t.innerHTML=e,t):(this.inertBodyElement.innerHTML=e,this.defaultDoc.documentMode&&this.stripCustomNsAttrs(this.inertBodyElement),this.inertBodyElement)},e.prototype.stripCustomNsAttrs=function(e){for(var t=e.attributes,n=t.length-1;0")}else this.sanitizedSomething=!0},e.prototype.endElement=function(e){var t=e.nodeName.toLowerCase();_r.hasOwnProperty(t)&&!yr.hasOwnProperty(t)&&(this.buf.push(""))},e.prototype.chars=function(e){this.buf.push(Or(e))},e.prototype.checkClobberedElement=function(e,t){if(t&&(e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)===Node.DOCUMENT_POSITION_CONTAINED_BY)throw new Error("Failed to sanitize html because the element is clobbered: "+e.outerHTML);return t},e}(),Cr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Tr=/([^\#-~ |!])/g;function Or(e){return e.replace(/&/g,"&").replace(Cr,function(e){return"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";"}).replace(Tr,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}function Ir(e){return"content"in e&&function(e){return e.nodeType===Node.ELEMENT_NODE&&"TEMPLATE"===e.nodeName}(e)?e.content:null}var Pr=new RegExp("^([-,.\"'%_!# a-zA-Z0-9]+|(?:(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|3d)?|(?:rgb|hsl)a?|(?:repeating-)?(?:linear|radial)-gradient|(?:calc|attr))\\([-0-9.%, #a-zA-Z]+\\))$","g"),Ar=/^url\(([^)]+)\)$/,Nr=function(e){return e[e.NONE=0]="NONE",e[e.HTML=1]="HTML",e[e.STYLE=2]="STYLE",e[e.SCRIPT=3]="SCRIPT",e[e.URL=4]="URL",e[e.RESOURCE_URL=5]="RESOURCE_URL",e}({}),Rr=function(){return function(){}}();function jr(e,t,n){var r=e.state,i=1792&r;return i===t?(e.state=-1793&r|n,e.initIndex=-1,!0):i===n}function Dr(e,t,n){return(1792&e.state)===t&&e.initIndex<=n&&(e.initIndex=n+1,!0)}function Mr(e,t){return e.nodes[t]}function Lr(e,t){return e.nodes[t]}function Ur(e,t){return e.nodes[t]}function Fr(e,t){return e.nodes[t]}function Vr(e,t){return e.nodes[t]}var Br={setCurrentNode:void 0,createRootView:void 0,createEmbeddedView:void 0,createComponentView:void 0,createNgModuleRef:void 0,overrideProvider:void 0,overrideComponentView:void 0,clearOverrides:void 0,checkAndUpdateView:void 0,checkNoChangesView:void 0,destroyView:void 0,resolveDep:void 0,createDebugContext:void 0,handleEvent:void 0,updateDirectives:void 0,updateRenderer:void 0,dirtyParentQueries:void 0};function zr(e,t,n,r){var i="ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '"+t+"'. Current value: '"+n+"'.";return r&&(i+=" It seems like the view has been created after its parent and its children have been dirty checked. Has it been created in a change detection hook ?"),function(e,t){var n=new Error(e);return qr(n,t),n}(i,e)}function qr(e,t){e[lt]=t,e[ft]=t.logError.bind(t)}function Hr(e){return new Error("ViewDestroyedError: Attempt to use a destroyed view: "+e)}var Wr=function(){},$r=new Map;function Gr(e){var t=$r.get(e);return t||(t=Ne(e)+"_"+$r.size,$r.set(e,t)),t}function Jr(e,t,n,r){if(Fn.isWrapped(r)){r=Fn.unwrap(r);var i=e.def.nodes[t].bindingIndex+n,o=Fn.unwrap(e.oldValues[i]);e.oldValues[i]=new Fn(o)}return r}var Kr="$$undefined",Qr="$$empty";function Yr(e){return{id:Kr,styles:e.styles,encapsulation:e.encapsulation,data:e.data}}var Zr=0;function Xr(e,t,n,r){return!(!(2&e.state)&&Ae(e.oldValues[t.bindingIndex+n],r))}function ei(e,t,n,r){return!!Xr(e,t,n,r)&&(e.oldValues[t.bindingIndex+n]=r,!0)}function ti(e,t,n,r){var i=e.oldValues[t.bindingIndex+n];if(1&e.state||!Un(i,r)){var o=t.bindings[n].name;throw zr(Br.createDebugContext(e,t.nodeIndex),o+": "+i,o+": "+r,0!=(1&e.state))}}function ni(e){for(var t=e;t;)2&t.def.flags&&(t.state|=8),t=t.viewContainerParent||t.parent}function ri(e,t){for(var n=e;n&&n!==t;)n.state|=64,n=n.viewContainerParent||n.parent}function ii(e,t,n,r){try{return ni(33554432&e.def.nodes[t].flags?Lr(e,t).componentView:e),Br.handleEvent(e,t,n,r)}catch(i){e.root.errorHandler.handleError(i)}}function oi(e){return e.parent?Lr(e.parent,e.parentNodeDef.nodeIndex):null}function ai(e){return e.parent?e.parentNodeDef.parent:null}function si(e,t){switch(201347067&t.flags){case 1:return Lr(e,t.nodeIndex).renderElement;case 2:return Mr(e,t.nodeIndex).renderText}}function ui(e){return!!e.parent&&!!(32768&e.parentNodeDef.flags)}function li(e){return!(!e.parent||32768&e.parentNodeDef.flags)}function ci(e){return 1<-1}(r)||"root"===i.providedIn&&r._def.isRoot))){var l=e._providers.length;return e._def.providersByKey[t.tokenKey]={flags:5120,value:t.token.ngInjectableDef.factory,deps:[],index:l,token:t.token},e._providers[l]=Pi,e._providers[l]=Mi(e,e._def.providersByKey[t.tokenKey])}return 4&t.flags?n:e._parent.get(t.token,n)}finally{ot(o)}}function Mi(e,t){var n;switch(201347067&t.flags){case 512:n=function(e,t,n){var r=n.length;switch(r){case 0:return new t;case 1:return new t(Di(e,n[0]));case 2:return new t(Di(e,n[0]),Di(e,n[1]));case 3:return new t(Di(e,n[0]),Di(e,n[1]),Di(e,n[2]));default:for(var i=new Array(r),o=0;o=n.length)&&(t=n.length-1),t<0)return null;var r=n[t];return r.viewContainerParent=null,Bi(n,t),Br.dirtyParentQueries(r),Fi(r),r}function Ui(e,t,n){var r=t?si(t,t.def.lastRenderRootNode):e.renderElement,i=n.renderer.parentNode(r),o=n.renderer.nextSibling(r);mi(n,2,i,o,void 0)}function Fi(e){mi(e,3,null,null,void 0)}function Vi(e,t,n){t>=e.length?e.push(n):e.splice(t,0,n)}function Bi(e,t){t>=e.length-1?e.pop():e.splice(t,1)}var zi=new Object;function qi(e,t,n,r,i,o){return new Hi(e,t,n,r,i,o)}var Hi=function(e){function t(t,n,r,i,o,a){var s=e.call(this)||this;return s.selector=t,s.componentType=n,s._inputs=i,s._outputs=o,s.ngContentSelectors=a,s.viewDefFactory=r,s}return i(t,e),Object.defineProperty(t.prototype,"inputs",{get:function(){var e=[],t=this._inputs;for(var n in t)e.push({propName:n,templateName:t[n]});return e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"outputs",{get:function(){var e=[];for(var t in this._outputs)e.push({propName:t,templateName:this._outputs[t]});return e},enumerable:!0,configurable:!0}),t.prototype.create=function(e,t,n,r){if(!r)throw new Error("ngModule should be provided");var i=gi(this.viewDefFactory),o=i.nodes[0].element.componentProvider.nodeIndex,a=Br.createRootView(e,t||[],n,i,r,zi),s=Ur(a,o).instance;return n&&a.renderer.setAttribute(Lr(a,0).renderElement,"ng-version",ut.full),new Wi(a,new Ki(a),s)},t}(Nt),Wi=function(e){function t(t,n,r){var i=e.call(this)||this;return i._view=t,i._viewRef=n,i._component=r,i._elDef=i._view.def.nodes[0],i.hostView=n,i.changeDetectorRef=n,i.instance=r,i}return i(t,e),Object.defineProperty(t.prototype,"location",{get:function(){return new xn(Lr(this._view,this._elDef.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"injector",{get:function(){return new Xi(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentType",{get:function(){return this._component.constructor},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){this._viewRef.destroy()},t.prototype.onDestroy=function(e){this._viewRef.onDestroy(e)},t}(At);function $i(e,t,n){return new Gi(e,t,n)}var Gi=function(){function e(e,t,n){this._view=e,this._elDef=t,this._data=n,this._embeddedViews=[]}return Object.defineProperty(e.prototype,"element",{get:function(){return new xn(this._data.renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"injector",{get:function(){return new Xi(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parentInjector",{get:function(){for(var e=this._view,t=this._elDef.parent;!t&&e;)t=ai(e),e=e.parent;return e?new Xi(e,t):new Xi(this._view,null)},enumerable:!0,configurable:!0}),e.prototype.clear=function(){for(var e=this._embeddedViews.length-1;e>=0;e--){var t=Li(this._data,e);Br.destroyView(t)}},e.prototype.get=function(e){var t=this._embeddedViews[e];if(t){var n=new Ki(t);return n.attachToViewContainerRef(this),n}return null},Object.defineProperty(e.prototype,"length",{get:function(){return this._embeddedViews.length},enumerable:!0,configurable:!0}),e.prototype.createEmbeddedView=function(e,t,n){var r=e.createEmbeddedView(t||{});return this.insert(r,n),r},e.prototype.createComponent=function(e,t,n,r,i){var o=n||this.parentInjector;i||e instanceof Vt||(i=o.get(Bt));var a=e.create(o,r,void 0,i);return this.insert(a.hostView,t),a},e.prototype.insert=function(e,t){if(e.destroyed)throw new Error("Cannot insert a destroyed View in a ViewContainer!");var n,r,i,o,a=e;return o=(n=this._data).viewContainer._embeddedViews,null==(r=t)&&(r=o.length),(i=a._view).viewContainerParent=this._view,Vi(o,r,i),function(e,t){var n=oi(t);if(n&&n!==e&&!(16&t.state)){t.state|=16;var r=n.template._projectedViews;r||(r=n.template._projectedViews=[]),r.push(t),function(e,n){if(!(4&n.flags)){t.parent.def.nodeFlags|=4,n.flags|=4;for(var r=n.parent;r;)r.childFlags|=4,r=r.parent}}(0,t.parentNodeDef)}}(n,i),Br.dirtyParentQueries(i),Ui(n,r>0?o[r-1]:null,i),a.attachToViewContainerRef(this),e},e.prototype.move=function(e,t){if(e.destroyed)throw new Error("Cannot move a destroyed View in a ViewContainer!");var n,r,i,o,a,s=this._embeddedViews.indexOf(e._view);return i=t,a=(o=(n=this._data).viewContainer._embeddedViews)[r=s],Bi(o,r),null==i&&(i=o.length),Vi(o,i,a),Br.dirtyParentQueries(a),Fi(a),Ui(n,i>0?o[i-1]:null,a),e},e.prototype.indexOf=function(e){return this._embeddedViews.indexOf(e._view)},e.prototype.remove=function(e){var t=Li(this._data,e);t&&Br.destroyView(t)},e.prototype.detach=function(e){var t=Li(this._data,e);return t?new Ki(t):null},e}();function Ji(e){return new Ki(e)}var Ki=function(){function e(e){this._view=e,this._viewContainerRef=null,this._appRef=null}return Object.defineProperty(e.prototype,"rootNodes",{get:function(){return mi(this._view,0,void 0,void 0,e=[]),e;var e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"context",{get:function(){return this._view.context},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"destroyed",{get:function(){return 0!=(128&this._view.state)},enumerable:!0,configurable:!0}),e.prototype.markForCheck=function(){ni(this._view)},e.prototype.detach=function(){this._view.state&=-5},e.prototype.detectChanges=function(){var e=this._view.root.rendererFactory;e.begin&&e.begin();try{Br.checkAndUpdateView(this._view)}finally{e.end&&e.end()}},e.prototype.checkNoChanges=function(){Br.checkNoChangesView(this._view)},e.prototype.reattach=function(){this._view.state|=4},e.prototype.onDestroy=function(e){this._view.disposables||(this._view.disposables=[]),this._view.disposables.push(e)},e.prototype.destroy=function(){this._appRef?this._appRef.detachView(this):this._viewContainerRef&&this._viewContainerRef.detach(this._viewContainerRef.indexOf(this)),Br.destroyView(this._view)},e.prototype.detachFromAppRef=function(){this._appRef=null,Fi(this._view),Br.dirtyParentQueries(this._view)},e.prototype.attachToAppRef=function(e){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=e},e.prototype.attachToViewContainerRef=function(e){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=e},e}();function Qi(e,t){return new Yi(e,t)}var Yi=function(e){function t(t,n){var r=e.call(this)||this;return r._parentView=t,r._def=n,r}return i(t,e),t.prototype.createEmbeddedView=function(e){return new Ki(Br.createEmbeddedView(this._parentView,this._def,this._def.element.template,e))},Object.defineProperty(t.prototype,"elementRef",{get:function(){return new xn(Lr(this._parentView,this._def.nodeIndex).renderElement)},enumerable:!0,configurable:!0}),t}(In);function Zi(e,t){return new Xi(e,t)}var Xi=function(){function e(e,t){this.view=e,this.elDef=t}return e.prototype.get=function(e,t){return void 0===t&&(t=qe.THROW_IF_NOT_FOUND),Br.resolveDep(this.view,this.elDef,!!this.elDef&&0!=(33554432&this.elDef.flags),{flags:0,token:e,tokenKey:Gr(e)},t)},e}();function eo(e,t){var n=e.def.nodes[t];if(1&n.flags){var r=Lr(e,n.nodeIndex);return n.element.template?r.template:r.renderElement}if(2&n.flags)return Mr(e,n.nodeIndex).renderText;if(20240&n.flags)return Ur(e,n.nodeIndex).instance;throw new Error("Illegal state: read nodeValue for node index "+t)}function to(e){return new no(e.renderer)}var no=function(){function e(e){this.delegate=e}return e.prototype.selectRootElement=function(e){return this.delegate.selectRootElement(e)},e.prototype.createElement=function(e,t){var n=l(xi(t),2),r=this.delegate.createElement(n[1],n[0]);return e&&this.delegate.appendChild(e,r),r},e.prototype.createViewRoot=function(e){return e},e.prototype.createTemplateAnchor=function(e){var t=this.delegate.createComment("");return e&&this.delegate.appendChild(e,t),t},e.prototype.createText=function(e,t){var n=this.delegate.createText(t);return e&&this.delegate.appendChild(e,n),n},e.prototype.projectNodes=function(e,t){for(var n=0;n0,t.provider.value,t.provider.deps);if(t.outputs.length)for(var r=0;r0,r=t.provider;switch(201347067&t.flags){case 512:return So(e,t.parent,n,r.value,r.deps);case 1024:return function(e,t,n,r,i){var o=i.length;switch(o){case 0:return r();case 1:return r(ko(e,t,n,i[0]));case 2:return r(ko(e,t,n,i[0]),ko(e,t,n,i[1]));case 3:return r(ko(e,t,n,i[0]),ko(e,t,n,i[1]),ko(e,t,n,i[2]));default:for(var a=Array(o),s=0;s0)l=g,Ho(g)||(c=g);else for(;l&&d===l.nodeIndex+l.childCount;){var v=l.parent;v&&(v.childFlags|=l.childFlags,v.childMatchedQueries|=l.childMatchedQueries),c=(l=v)&&Ho(l)?l.renderParent:l}}return{factory:null,nodeFlags:a,rootNodeFlags:s,nodeMatchedQueries:u,flags:e,nodes:t,updateDirectives:n||Wr,updateRenderer:r||Wr,handleEvent:function(e,n,r,i){return t[n].element.handleEvent(e,r,i)},bindingCount:i,outputCount:o,lastRenderRootNode:p}}function Ho(e){return 0!=(1&e.flags)&&null===e.element.name}function Wo(e,t,n){var r=t.element&&t.element.template;if(r){if(!r.lastRenderRootNode)throw new Error("Illegal State: Embedded templates without nodes are not allowed!");if(r.lastRenderRootNode&&16777216&r.lastRenderRootNode.flags)throw new Error("Illegal State: Last root node of a template can't have embedded views, at index "+t.nodeIndex+"!")}if(20224&t.flags&&0==(1&(e?e.flags:0)))throw new Error("Illegal State: StaticProvider/Directive nodes need to be children of elements or anchors, at index "+t.nodeIndex+"!");if(t.query){if(67108864&t.flags&&(!e||0==(16384&e.flags)))throw new Error("Illegal State: Content Query nodes need to be children of directives, at index "+t.nodeIndex+"!");if(134217728&t.flags&&e)throw new Error("Illegal State: View Query nodes have to be top level nodes, at index "+t.nodeIndex+"!")}if(t.childCount){var i=e?e.nodeIndex+e.childCount:n-1;if(t.nodeIndex<=i&&t.nodeIndex+t.childCount>i)throw new Error("Illegal State: childCount of node leads outside of parent, at index "+t.nodeIndex+"!")}}function $o(e,t,n,r){var i=Ko(e.root,e.renderer,e,t,n);return Qo(i,e.component,r),Yo(i),i}function Go(e,t,n){var r=Ko(e,e.renderer,null,null,t);return Qo(r,n,n),Yo(r),r}function Jo(e,t,n,r){var i,o=t.element.componentRendererType;return i=o?e.root.rendererFactory.createRenderer(r,o):e.root.renderer,Ko(e.root,i,e,t.element.componentProvider,n)}function Ko(e,t,n,r,i){var o=new Array(i.nodes.length),a=i.outputCount?new Array(i.outputCount):null;return{def:i,parent:n,viewContainerParent:null,parentNodeDef:r,context:null,component:null,nodes:o,state:13,root:e,renderer:t,oldValues:new Array(i.bindingCount),disposables:a,initIndex:-1}}function Qo(e,t,n){e.component=t,e.context=n}function Yo(e){var t;ui(e)&&(t=Lr(e.parent,e.parentNodeDef.parent.nodeIndex).renderElement);for(var n=e.def,r=e.nodes,i=0;i0&&Ii(e,t,0,n)&&(p=!0),h>1&&Ii(e,t,1,r)&&(p=!0),h>2&&Ii(e,t,2,i)&&(p=!0),h>3&&Ii(e,t,3,o)&&(p=!0),h>4&&Ii(e,t,4,a)&&(p=!0),h>5&&Ii(e,t,5,s)&&(p=!0),h>6&&Ii(e,t,6,u)&&(p=!0),h>7&&Ii(e,t,7,l)&&(p=!0),h>8&&Ii(e,t,8,c)&&(p=!0),h>9&&Ii(e,t,9,f)&&(p=!0),p}(e,t,n,r,i,o,a,s,u,l,c,f);case 2:return function(e,t,n,r,i,o,a,s,u,l,c,f){var h=!1,p=t.bindings,d=p.length;if(d>0&&ei(e,t,0,n)&&(h=!0),d>1&&ei(e,t,1,r)&&(h=!0),d>2&&ei(e,t,2,i)&&(h=!0),d>3&&ei(e,t,3,o)&&(h=!0),d>4&&ei(e,t,4,a)&&(h=!0),d>5&&ei(e,t,5,s)&&(h=!0),d>6&&ei(e,t,6,u)&&(h=!0),d>7&&ei(e,t,7,l)&&(h=!0),d>8&&ei(e,t,8,c)&&(h=!0),d>9&&ei(e,t,9,f)&&(h=!0),h){var g=t.text.prefix;d>0&&(g+=zo(n,p[0])),d>1&&(g+=zo(r,p[1])),d>2&&(g+=zo(i,p[2])),d>3&&(g+=zo(o,p[3])),d>4&&(g+=zo(a,p[4])),d>5&&(g+=zo(s,p[5])),d>6&&(g+=zo(u,p[6])),d>7&&(g+=zo(l,p[7])),d>8&&(g+=zo(c,p[8])),d>9&&(g+=zo(f,p[9]));var m=Mr(e,t.nodeIndex).renderText;e.renderer.setValue(m,g)}return h}(e,t,n,r,i,o,a,s,u,l,c,f);case 16384:return function(e,t,n,r,i,o,a,s,u,l,c,f){var h=Ur(e,t.nodeIndex),p=h.instance,d=!1,g=void 0,m=t.bindings.length;return m>0&&Xr(e,t,0,n)&&(d=!0,g=To(e,h,t,0,n,g)),m>1&&Xr(e,t,1,r)&&(d=!0,g=To(e,h,t,1,r,g)),m>2&&Xr(e,t,2,i)&&(d=!0,g=To(e,h,t,2,i,g)),m>3&&Xr(e,t,3,o)&&(d=!0,g=To(e,h,t,3,o,g)),m>4&&Xr(e,t,4,a)&&(d=!0,g=To(e,h,t,4,a,g)),m>5&&Xr(e,t,5,s)&&(d=!0,g=To(e,h,t,5,s,g)),m>6&&Xr(e,t,6,u)&&(d=!0,g=To(e,h,t,6,u,g)),m>7&&Xr(e,t,7,l)&&(d=!0,g=To(e,h,t,7,l,g)),m>8&&Xr(e,t,8,c)&&(d=!0,g=To(e,h,t,8,c,g)),m>9&&Xr(e,t,9,f)&&(d=!0,g=To(e,h,t,9,f,g)),g&&p.ngOnChanges(g),65536&t.flags&&Dr(e,256,t.nodeIndex)&&p.ngOnInit(),262144&t.flags&&p.ngDoCheck(),d}(e,t,n,r,i,o,a,s,u,l,c,f);case 32:case 64:case 128:return function(e,t,n,r,i,o,a,s,u,l,c,f){var h=t.bindings,p=!1,d=h.length;if(d>0&&ei(e,t,0,n)&&(p=!0),d>1&&ei(e,t,1,r)&&(p=!0),d>2&&ei(e,t,2,i)&&(p=!0),d>3&&ei(e,t,3,o)&&(p=!0),d>4&&ei(e,t,4,a)&&(p=!0),d>5&&ei(e,t,5,s)&&(p=!0),d>6&&ei(e,t,6,u)&&(p=!0),d>7&&ei(e,t,7,l)&&(p=!0),d>8&&ei(e,t,8,c)&&(p=!0),d>9&&ei(e,t,9,f)&&(p=!0),p){var g=Fr(e,t.nodeIndex),m=void 0;switch(201347067&t.flags){case 32:m=new Array(h.length),d>0&&(m[0]=n),d>1&&(m[1]=r),d>2&&(m[2]=i),d>3&&(m[3]=o),d>4&&(m[4]=a),d>5&&(m[5]=s),d>6&&(m[6]=u),d>7&&(m[7]=l),d>8&&(m[8]=c),d>9&&(m[9]=f);break;case 64:m={},d>0&&(m[h[0].name]=n),d>1&&(m[h[1].name]=r),d>2&&(m[h[2].name]=i),d>3&&(m[h[3].name]=o),d>4&&(m[h[4].name]=a),d>5&&(m[h[5].name]=s),d>6&&(m[h[6].name]=u),d>7&&(m[h[7].name]=l),d>8&&(m[h[8].name]=c),d>9&&(m[h[9].name]=f);break;case 128:var y=n;switch(d){case 1:m=y.transform(n);break;case 2:m=y.transform(r);break;case 3:m=y.transform(r,i);break;case 4:m=y.transform(r,i,o);break;case 5:m=y.transform(r,i,o,a);break;case 6:m=y.transform(r,i,o,a,s);break;case 7:m=y.transform(r,i,o,a,s,u);break;case 8:m=y.transform(r,i,o,a,s,u,l);break;case 9:m=y.transform(r,i,o,a,s,u,l,c);break;case 10:m=y.transform(r,i,o,a,s,u,l,c,f)}}g.value=m}return p}(e,t,n,r,i,o,a,s,u,l,c,f);default:throw"unreachable"}}(e,t,r,i,o,a,s,u,l,f,h,p):function(e,t,n){switch(201347067&t.flags){case 1:return function(e,t,n){for(var r=!1,i=0;i0&&ti(e,t,0,n),h>1&&ti(e,t,1,r),h>2&&ti(e,t,2,i),h>3&&ti(e,t,3,o),h>4&&ti(e,t,4,a),h>5&&ti(e,t,5,s),h>6&&ti(e,t,6,u),h>7&&ti(e,t,7,l),h>8&&ti(e,t,8,c),h>9&&ti(e,t,9,f)}(e,t,r,i,o,a,s,u,l,c,f,h):function(e,t,n){for(var r=0;r0){var o=new Set(e.modules);ba.forEach(function(t,r){if(o.has(r.ngInjectableDef.providedIn)){var i={token:r,flags:t.flags|(n?4096:0),deps:hi(t.deps),value:t.value,index:e.providers.length};e.providers.push(i),e.providersByKey[Gr(r)]=i}})}}(e=e.factory(function(){return Wr})),e):e}(r))}var va=new Map,ba=new Map,wa=new Map;function _a(e){va.set(e.token,e),"function"==typeof e.token&&e.token.ngInjectableDef&&"function"==typeof e.token.ngInjectableDef.providedIn&&ba.set(e.token,e)}function xa(e,t){var n=gi(t.viewDefFactory),r=gi(n.nodes[0].element.componentView);wa.set(e,r)}function Sa(){va.clear(),ba.clear(),wa.clear()}function Ea(e){if(0===va.size)return e;var t=function(e){for(var t=[],n=null,r=0;r0?t.substring(1):t},t.prototype.prepareExternalUrl=function(e){var t=rs.joinWithSlash(this._baseHref,e);return t.length>0?"#"+t:t},t.prototype.pushState=function(e,t,n,r){var i=this.prepareExternalUrl(n+rs.normalizeQueryParams(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.pushState(e,t,i)},t.prototype.replaceState=function(e,t,n,r){var i=this.prepareExternalUrl(n+rs.normalizeQueryParams(r));0==i.length&&(i=this._platformLocation.pathname),this._platformLocation.replaceState(e,t,i)},t.prototype.forward=function(){this._platformLocation.forward()},t.prototype.back=function(){this._platformLocation.back()},t}(ts),as=function(e){function t(t,n){var r=e.call(this)||this;if(r._platformLocation=t,null==n&&(n=r._platformLocation.getBaseHrefFromDOM()),null==n)throw new Error("No base href set. Please provide a value for the APP_BASE_HREF token or add a base element to the document.");return r._baseHref=n,r}return i(t,e),t.prototype.onPopState=function(e){this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e)},t.prototype.getBaseHref=function(){return this._baseHref},t.prototype.prepareExternalUrl=function(e){return rs.joinWithSlash(this._baseHref,e)},t.prototype.path=function(e){void 0===e&&(e=!1);var t=this._platformLocation.pathname+rs.normalizeQueryParams(this._platformLocation.search),n=this._platformLocation.hash;return n&&e?""+t+n:t},t.prototype.pushState=function(e,t,n,r){var i=this.prepareExternalUrl(n+rs.normalizeQueryParams(r));this._platformLocation.pushState(e,t,i)},t.prototype.replaceState=function(e,t,n,r){var i=this.prepareExternalUrl(n+rs.normalizeQueryParams(r));this._platformLocation.replaceState(e,t,i)},t.prototype.forward=function(){this._platformLocation.forward()},t.prototype.back=function(){this._platformLocation.back()},t}(ts),ss=void 0,us=["en",[["a","p"],["AM","PM"],ss],[["AM","PM"],ss,ss],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],ss,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],ss,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",ss,"{1} 'at' {0}",ss],[".",",",";","%","+","-","E","\xd7","\u2030","\u221e","NaN",":"],["#,##0.###","#,##0%","\xa4#,##0.00","#E0"],"$","US Dollar",{},function(e){var t=Math.floor(Math.abs(e)),n=e.toString().replace(/^[^.]*\.?/,"").length;return 1===t&&0===n?1:5}],ls={},cs=function(e){return e[e.Zero=0]="Zero",e[e.One=1]="One",e[e.Two=2]="Two",e[e.Few=3]="Few",e[e.Many=4]="Many",e[e.Other=5]="Other",e}({}),fs=function(e){return e[e.Format=0]="Format",e[e.Standalone=1]="Standalone",e}({}),hs=function(e){return e[e.Narrow=0]="Narrow",e[e.Abbreviated=1]="Abbreviated",e[e.Wide=2]="Wide",e[e.Short=3]="Short",e}({}),ps=function(e){return e[e.Short=0]="Short",e[e.Medium=1]="Medium",e[e.Long=2]="Long",e[e.Full=3]="Full",e}({}),ds=function(e){return e[e.Decimal=0]="Decimal",e[e.Group=1]="Group",e[e.List=2]="List",e[e.PercentSign=3]="PercentSign",e[e.PlusSign=4]="PlusSign",e[e.MinusSign=5]="MinusSign",e[e.Exponential=6]="Exponential",e[e.SuperscriptingExponent=7]="SuperscriptingExponent",e[e.PerMille=8]="PerMille",e[e[1/0]=9]="Infinity",e[e.NaN=10]="NaN",e[e.TimeSeparator=11]="TimeSeparator",e[e.CurrencyDecimal=12]="CurrencyDecimal",e[e.CurrencyGroup=13]="CurrencyGroup",e}({});function gs(e,t){return ws(xs(e)[10],t)}function ms(e,t){return ws(xs(e)[11],t)}function ys(e,t){return ws(xs(e)[12],t)}function vs(e,t){var n=xs(e),r=n[13][t];if(void 0===r){if(t===ds.CurrencyDecimal)return n[13][ds.Decimal];if(t===ds.CurrencyGroup)return n[13][ds.Group]}return r}function bs(e){if(!e[19])throw new Error('Missing extra locale data for the locale "'+e[0]+'". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.')}function ws(e,t){for(var n=t;n>-1;n--)if(void 0!==e[n])return e[n];throw new Error("Locale data API: locale data undefined")}function _s(e){var t=l(e.split(":"),2);return{hours:+t[0],minutes:+t[1]}}function xs(e){var t=e.toLowerCase().replace(/_/g,"-"),n=ls[t];if(n)return n;var r=t.split("-")[0];if(n=ls[r])return n;if("en"===r)return us;throw new Error('Missing locale data for the locale "'+e+'".')}var Ss=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,Es={},ks=/((?:[^GyMLwWdEabBhHmsSzZO']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/,Cs=function(e){return e[e.Short=0]="Short",e[e.ShortGMT=1]="ShortGMT",e[e.Long=2]="Long",e[e.Extended=3]="Extended",e}({}),Ts=function(e){return e[e.FullYear=0]="FullYear",e[e.Month=1]="Month",e[e.Date=2]="Date",e[e.Hours=3]="Hours",e[e.Minutes=4]="Minutes",e[e.Seconds=5]="Seconds",e[e.FractionalSeconds=6]="FractionalSeconds",e[e.Day=7]="Day",e}({}),Os=function(e){return e[e.DayPeriods=0]="DayPeriods",e[e.Days=1]="Days",e[e.Months=2]="Months",e[e.Eras=3]="Eras",e}({});function Is(e,t){return t&&(e=e.replace(/\{([^}]+)}/g,function(e,n){return null!=t&&n in t?t[n]:e})),e}function Ps(e,t,n,r,i){void 0===n&&(n="-");var o="";(e<0||i&&e<=0)&&(i?e=1-e:(e=-e,o=n));for(var a=String(e);a.length0||u>-n)&&(u+=n),e===Ts.Hours)0===u&&-12===n&&(u=12);else if(e===Ts.FractionalSeconds)return s=t,Ps(u,3).substr(0,s);var l=vs(a,ds.MinusSign);return Ps(u,t,l,r,i)}}function Ns(e,t,n,r){return void 0===n&&(n=fs.Format),void 0===r&&(r=!1),function(i,o){return function(e,t,n,r,i,o){switch(n){case Os.Months:return function(e,t,n){var r=xs(e),i=ws([r[5],r[6]],t);return ws(i,n)}(t,i,r)[e.getMonth()];case Os.Days:return function(e,t,n){var r=xs(e),i=ws([r[3],r[4]],t);return ws(i,n)}(t,i,r)[e.getDay()];case Os.DayPeriods:var a=e.getHours(),s=e.getMinutes();if(o){var u,l=function(e){var t=xs(e);return bs(t),(t[19][2]||[]).map(function(e){return"string"==typeof e?_s(e):[_s(e[0]),_s(e[1])]})}(t),c=function(e,t,n){var r=xs(e);bs(r);var i=ws([r[19][0],r[19][1]],t)||[];return ws(i,n)||[]}(t,i,r);if(l.forEach(function(e,t){if(Array.isArray(e)){var n=e[0],r=e[1],i=r.hours;a>=n.hours&&s>=n.minutes&&(a0?Math.floor(i/60):Math.ceil(i/60);switch(e){case Cs.Short:return(i>=0?"+":"")+Ps(a,2,o)+Ps(Math.abs(i%60),2,o);case Cs.ShortGMT:return"GMT"+(i>=0?"+":"")+Ps(a,1,o);case Cs.Long:return"GMT"+(i>=0?"+":"")+Ps(a,2,o)+":"+Ps(Math.abs(i%60),2,o);case Cs.Extended:return 0===r?"Z":(i>=0?"+":"")+Ps(a,2,o)+":"+Ps(Math.abs(i%60),2,o);default:throw new Error('Unknown zone width "'+e+'"')}}}var js=0,Ds=4;function Ms(e,t){return void 0===t&&(t=!1),function(n,r){var i,o,a,s;if(t){var u=new Date(n.getFullYear(),n.getMonth(),1).getDay()-1,l=n.getDate();i=1+Math.floor((l+u)/7)}else{var c=(a=n.getFullYear(),s=new Date(a,js,1).getDay(),new Date(a,0,1+(s<=Ds?Ds:Ds+7)-s)),f=(o=n,new Date(o.getFullYear(),o.getMonth(),o.getDate()+(Ds-o.getDay()))).getTime()-c.getTime();i=1+Math.round(f/6048e5)}return Ps(i,e,vs(r,ds.MinusSign))}}var Ls={};function Us(e,t){e=e.replace(/:/g,"");var n=Date.parse("Jan 01, 1970 00:00:00 "+e)/6e4;return isNaN(n)?t:n}function Fs(e){return e instanceof Date&&!isNaN(e.valueOf())}var Vs=new ge("UseV4Plurals"),Bs=function(){return function(){}}(),zs=function(e){function t(t,n){var r=e.call(this)||this;return r.locale=t,r.deprecatedPluralFn=n,r}return i(t,e),t.prototype.getPluralCategory=function(e,t){switch(this.deprecatedPluralFn?this.deprecatedPluralFn(t||this.locale,e):function(e){return xs(e)[18]}(t||this.locale)(e)){case cs.Zero:return"zero";case cs.One:return"one";case cs.Two:return"two";case cs.Few:return"few";case cs.Many:return"many";default:return"other"}},t}(Bs),qs=function(){function e(e,t,n,r){this._iterableDiffers=e,this._keyValueDiffers=t,this._ngEl=n,this._renderer=r,this._initialClasses=[]}return Object.defineProperty(e.prototype,"klass",{set:function(e){this._removeClasses(this._initialClasses),this._initialClasses="string"==typeof e?e.split(/\s+/):[],this._applyClasses(this._initialClasses),this._applyClasses(this._rawClass)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngClass",{set:function(e){this._removeClasses(this._rawClass),this._applyClasses(this._initialClasses),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof e?e.split(/\s+/):e,this._rawClass&&(Bn(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())},enumerable:!0,configurable:!0}),e.prototype.ngDoCheck=function(){if(this._iterableDiffer){var e=this._iterableDiffer.diff(this._rawClass);e&&this._applyIterableChanges(e)}else if(this._keyValueDiffer){var t=this._keyValueDiffer.diff(this._rawClass);t&&this._applyKeyValueChanges(t)}},e.prototype._applyKeyValueChanges=function(e){var t=this;e.forEachAddedItem(function(e){return t._toggleClass(e.key,e.currentValue)}),e.forEachChangedItem(function(e){return t._toggleClass(e.key,e.currentValue)}),e.forEachRemovedItem(function(e){e.previousValue&&t._toggleClass(e.key,!1)})},e.prototype._applyIterableChanges=function(e){var t=this;e.forEachAddedItem(function(e){if("string"!=typeof e.item)throw new Error("NgClass can only toggle CSS classes expressed as strings, got "+Ne(e.item));t._toggleClass(e.item,!0)}),e.forEachRemovedItem(function(e){return t._toggleClass(e.item,!1)})},e.prototype._applyClasses=function(e){var t=this;e&&(Array.isArray(e)||e instanceof Set?e.forEach(function(e){return t._toggleClass(e,!0)}):Object.keys(e).forEach(function(n){return t._toggleClass(n,!!e[n])}))},e.prototype._removeClasses=function(e){var t=this;e&&(Array.isArray(e)||e instanceof Set?e.forEach(function(e){return t._toggleClass(e,!1)}):Object.keys(e).forEach(function(e){return t._toggleClass(e,!1)}))},e.prototype._toggleClass=function(e,t){var n=this;(e=e.trim())&&e.split(/\s+/g).forEach(function(e){t?n._renderer.addClass(n._ngEl.nativeElement,e):n._renderer.removeClass(n._ngEl.nativeElement,e)})},e}(),Hs=function(){function e(e,t,n,r){this.$implicit=e,this.ngForOf=t,this.index=n,this.count=r}return Object.defineProperty(e.prototype,"first",{get:function(){return 0===this.index},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"last",{get:function(){return this.index===this.count-1},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"even",{get:function(){return this.index%2==0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"odd",{get:function(){return!this.even},enumerable:!0,configurable:!0}),e}(),Ws=function(){function e(e,t,n){this._viewContainer=e,this._template=t,this._differs=n,this._ngForOfDirty=!0,this._differ=null}return Object.defineProperty(e.prototype,"ngForOf",{set:function(e){this._ngForOf=e,this._ngForOfDirty=!0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngForTrackBy",{get:function(){return this._trackByFn},set:function(e){cn()&&null!=e&&"function"!=typeof e&&console&&console.warn&&console.warn("trackBy must be a function, but received "+JSON.stringify(e)+". See https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html#!#change-propagation for more information."),this._trackByFn=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngForTemplate",{set:function(e){e&&(this._template=e)},enumerable:!0,configurable:!0}),e.prototype.ngDoCheck=function(){if(this._ngForOfDirty){this._ngForOfDirty=!1;var e=this._ngForOf;if(!this._differ&&e)try{this._differ=this._differs.find(e).create(this.ngForTrackBy)}catch(r){throw new Error("Cannot find a differ supporting object '"+e+"' of type '"+((t=e).name||typeof t)+"'. NgFor only supports binding to Iterables such as Arrays.")}}var t;if(this._differ){var n=this._differ.diff(this._ngForOf);n&&this._applyChanges(n)}},e.prototype._applyChanges=function(e){var t=this,n=[];e.forEachOperation(function(e,r,i){if(null==e.previousIndex){var o=t._viewContainer.createEmbeddedView(t._template,new Hs(null,t._ngForOf,-1,-1),i),a=new $s(e,o);n.push(a)}else null==i?t._viewContainer.remove(r):(o=t._viewContainer.get(r),t._viewContainer.move(o,i),a=new $s(e,o),n.push(a))});for(var r=0;r0},t.prototype.tagName=function(e){return e.tagName},t.prototype.attributeMap=function(e){for(var t=new Map,n=e.attributes,r=0;r0;a||(a=e[o]=[]);var u=Ku(t)?Zone.root:Zone.current;if(0===a.length)a.push({zone:u,handler:i});else{for(var l=!1,c=0;c-1},t}(Ou),rl=["alt","control","meta","shift"],il={alt:function(e){return e.altKey},control:function(e){return e.ctrlKey},meta:function(e){return e.metaKey},shift:function(e){return e.shiftKey}},ol=function(e){function t(t){return e.call(this,t)||this}var n;return i(t,e),n=t,t.prototype.supports=function(e){return null!=n.parseEventName(e)},t.prototype.addEventListener=function(e,t,r){var i=n.parseEventName(t),o=n.eventCallback(i.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(function(){return lu().onAndCancel(e,i.domEventName,o)})},t.parseEventName=function(e){var t=e.toLowerCase().split("."),r=t.shift();if(0===t.length||"keydown"!==r&&"keyup"!==r)return null;var i=n._normalizeKey(t.pop()),o="";if(rl.forEach(function(e){var n=t.indexOf(e);n>-1&&(t.splice(n,1),o+=e+".")}),o+=i,0!=t.length||0===i.length)return null;var a={};return a.domEventName=r,a.fullKey=o,a},t.getEventFullKey=function(e){var t="",n=lu().getEventKey(e);return" "===(n=n.toLowerCase())?n="space":"."===n&&(n="dot"),rl.forEach(function(r){r!=n&&(0,il[r])(e)&&(t+=r+".")}),t+=n},t.eventCallback=function(e,t,r){return function(i){n.getEventFullKey(i)===e&&r.runGuarded(function(){return t(i)})}},t._normalizeKey=function(e){switch(e){case"esc":return"escape";default:return e}},t}(Ou),al=function(){return function(){}}(),sl=function(e){function t(t){var n=e.call(this)||this;return n._doc=t,n}return i(t,e),t.prototype.sanitize=function(e,t){if(null==t)return null;switch(e){case Nr.NONE:return t;case Nr.HTML:return t instanceof ll?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"HTML"),function(e,t){var n=null;try{mr=mr||new cr(e);var r=t?String(t):"";n=mr.getInertBodyElement(r);var i=5,o=r;do{if(0===i)throw new Error("Failed to sanitize html because the input is unstable");i--,r=o,o=n.innerHTML,n=mr.getInertBodyElement(r)}while(r!==o);var a=new kr,s=a.sanitizeChildren(Ir(n)||n);return cn()&&a.sanitizedSomething&&console.warn("WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss)."),s}finally{if(n)for(var u=Ir(n)||n;u.firstChild;)u.removeChild(u.firstChild)}}(this._doc,String(t)));case Nr.STYLE:return t instanceof cl?t.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(t,"Style"),function(e){if(!(e=String(e).trim()))return"";var t=e.match(Ar);return t&&pr(t[1])===t[1]||e.match(Pr)&&function(e){for(var t=!0,n=!0,r=0;r=this.toastrConfig.maxOpened&&(a=!0,this.toastrConfig.autoDismiss&&this.clear(this.toasts[0].toastId));var s=this.overlay.create(r.positionClass,this.overlayContainer);this.index=this.index+1;var u=t;t&&r.enableHtml&&(u=this.sanitizer.sanitize(Nr.HTML,t));var l=new kl(s),c=new yl(this.index,r,u,n,e,l),f=new Cl(c,this._injector),h=new wl(r.toastComponent,f),p=s.attach(h,this.toastrConfig.newestOnTop);l.componentInstance=p._component;var d={toastId:this.index,message:t||"",toastRef:l,onShown:l.afterActivate(),onHidden:l.afterClosed(),onTap:c.onTap(),onAction:c.onAction(),portal:p};return a||setTimeout(function(){d.toastRef.activate(),i.currentlyActive=i.currentlyActive+1}),this.toasts.push(d),d},e.ngInjectableDef=de({factory:function(){return new e(at(bl),at(El),at(Be),at(al),at(Kt))},token:e,providedIn:"root"}),e}(),Ol=function(){function e(e,t,n){var r=this;this.toastrService=e,this.toastPackage=t,this.ngZone=n,this.width=-1,this.toastClasses="",this.state={value:"inactive",params:{easeTime:this.toastPackage.config.easeTime,easing:"ease-in"}},this.message=t.message,this.title=t.title,this.options=t.config,this.originalTimeout=t.config.timeOut,this.toastClasses=t.toastType+" "+t.config.toastClass,this.sub=t.toastRef.afterActivate().subscribe(function(){r.activateToast()}),this.sub1=t.toastRef.manualClosed().subscribe(function(){r.remove()}),this.sub2=t.toastRef.timeoutReset().subscribe(function(){r.resetTimeout()})}return Object.defineProperty(e.prototype,"displayStyle",{get:function(){return"inactive"===this.state.value?"none":"inherit"},enumerable:!0,configurable:!0}),e.prototype.ngOnDestroy=function(){this.sub.unsubscribe(),this.sub1.unsubscribe(),this.sub2.unsubscribe(),clearInterval(this.intervalId),clearTimeout(this.timeout)},e.prototype.activateToast=function(){var e=this;this.state=o({},this.state,{value:"active"}),!this.options.disableTimeOut&&this.options.timeOut&&(this.outsideTimeout(function(){return e.remove()},this.options.timeOut),this.hideTime=(new Date).getTime()+this.options.timeOut,this.options.progressBar&&this.outsideInterval(function(){return e.updateProgress()},10))},e.prototype.updateProgress=function(){if(0!==this.width&&100!==this.width&&this.options.timeOut){var e=(new Date).getTime();this.width=(this.hideTime-e)/this.options.timeOut*100,"increasing"===this.options.progressAnimation&&(this.width=100-this.width),this.width<=0&&(this.width=0),this.width>=100&&(this.width=100)}},e.prototype.resetTimeout=function(){var e=this;clearTimeout(this.timeout),clearInterval(this.intervalId),this.state=o({},this.state,{value:"active"}),this.outsideTimeout(function(){return e.remove()},this.originalTimeout),this.options.timeOut=this.originalTimeout,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(function(){return e.updateProgress()},10)},e.prototype.remove=function(){var e=this;"removed"!==this.state.value&&(clearTimeout(this.timeout),this.state=o({},this.state,{value:"removed"}),this.outsideTimeout(function(){return e.toastrService.remove(e.toastPackage.toastId)},+this.toastPackage.config.easeTime))},e.prototype.tapToast=function(){"removed"!==this.state.value&&(this.toastPackage.triggerTap(),this.options.tapToDismiss&&this.remove())},e.prototype.stickAround=function(){"removed"!==this.state.value&&(clearTimeout(this.timeout),this.options.timeOut=0,this.hideTime=0,clearInterval(this.intervalId),this.width=0)},e.prototype.delayedHideToast=function(){var e=this;this.options.disableTimeOut||0===this.options.extendedTimeOut||"removed"===this.state.value||(this.outsideTimeout(function(){return e.remove()},this.options.extendedTimeOut),this.options.timeOut=this.options.extendedTimeOut,this.hideTime=(new Date).getTime()+(this.options.timeOut||0),this.width=-1,this.options.progressBar&&this.outsideInterval(function(){return e.updateProgress()},10))},e.prototype.outsideTimeout=function(e,t){var n=this;this.ngZone?this.ngZone.runOutsideAngular(function(){return n.timeout=setTimeout(function(){return n.runInsideAngular(e)},t)}):this.timeout=setTimeout(function(){return e()},t)},e.prototype.outsideInterval=function(e,t){var n=this;this.ngZone?this.ngZone.runOutsideAngular(function(){return n.intervalId=setInterval(function(){return n.runInsideAngular(e)},t)}):this.intervalId=setInterval(function(){return e()},t)},e.prototype.runInsideAngular=function(e){this.ngZone?this.ngZone.run(function(){return e()}):e()},e}(),Il=o({},vl,{toastComponent:Ol}),Pl=function(){function e(){}return e.forRoot=function(t){return void 0===t&&(t={}),{ngModule:e,providers:[{provide:bl,useValue:{default:Il,config:t}}]}},e}(),Al=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(a,s)}u((r=r.apply(e,t||[])).next())})},Nl=function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0||r.deletions.length>0)&&this.updateManager.update(r.deletions,r.insertions,function(t,n,r){n?(i.toastr.success("Your Solid profile has been successfully updated","Success!"),e.form.markAsPristine(),e.form.markAsTouched()):i.toastr.error("Message: "+r,"An error has occurred")}),[2]})})},this.getAddress=function(){var e=t.getValueFromVcard("hasAddress");return e?{locality:t.getValueFromVcard("locality",e),country_name:t.getValueFromVcard("country-name",e),region:t.getValueFromVcard("region",e),street:t.getValueFromVcard("street-address",e)}:{}},this.getEmail=function(){var e=t.getValueFromVcard("hasEmail");return e?t.getValueFromVcard("value",e).split("mailto:")[1]:""},this.getPhone=function(){var e=t.getValueFromVcard("hasTelephone");if(e)return t.getValueFromVcard("value",e).split("tel:+")[1]},this.getProfile=function(){return Al(t,void 0,void 0,function(){var e;return Nl(this,function(t){switch(t.label){case 0:return this.session?[3,2]:[4,this.getSession()];case 1:t.sent(),t.label=2;case 2:return t.trys.push([2,4,,5]),[4,this.fetcher.load(this.session.webId)];case 3:return t.sent(),[2,{fn:this.getValueFromVcard("fn"),company:this.getValueFromVcard("organization-name"),phone:this.getPhone(),role:this.getValueFromVcard("role"),image:this.getValueFromVcard("hasPhoto"),address:this.getAddress(),email:this.getEmail()}];case 4:return e=t.sent(),console.log("Error fetching data: "+e),[3,5];case 5:return[2]}})})},this.postMessage=function(e,n){return Al(t,void 0,void 0,function(){var e;return Nl(this,function(t){return(e=$rdf.graph()).add(),$rdf.serialize(null,e,n,function(e,t){}),[2]})})},this.fetcher=new $rdf.Fetcher(this.store,{}),this.updateManager=new $rdf.UpdateManager(this.store),this.getSession()}return e.prototype.addNewLinkedField=function(e,t,n,r,i,o){var a=e+":"+Date.now(),s=$rdf.sym(this.session.webId.split("#")[0]+"#"+a),u="phone"===e?$rdf.sym(Rl("hasTelephone")):$rdf.sym(Rl("hasEmail"));t.push($rdf.st(s,n,r,i));var l="phone"===e?$rdf.literal("Home"):$rdf.literal("Personal");t.push($rdf.st(s,Rl("type"),l,i)),t.push($rdf.st(o,u,s,i))},e.prototype.getUriForField=function(e,t){var n,r;switch(e){case"phone":(n=this.getValueFromVcard("hasTelephone"))&&(r=$rdf.sym(n));break;case"email":(n=this.getValueFromVcard("hasEmail"))&&(r=$rdf.sym(n));break;default:r=t}return r},e.prototype.getFieldValue=function(e,t){var n;if(e.value[t]){switch(t){case"phone":n=$rdf.sym("tel:+"+e.value[t]);break;case"email":n=$rdf.sym("mailto:"+e.value[t]);break;default:n=e.value[t]}return n}},e.prototype.getOldFieldValue=function(e,t){var n;if(t&&t[e]){switch(e){case"phone":n=$rdf.sym("tel:+"+t[e]);break;case"email":n=$rdf.sym("mailto:"+t[e]);break;default:n=t[e]}return n}},e.prototype.getFieldName=function(e){switch(e){case"company":return"organization-name";case"phone":case"email":return"value";default:return e}},e.prototype.getValueFromNamespace=function(e,t,n){var r=this.store.any($rdf.sym(n||this.session.webId),t(e));return r?r.value:""},e.prototype.getFieldAsStringFromProfile=function(e){return Al(this,void 0,void 0,function(){return Nl(this,function(t){return[2,this.getFieldAsString(this.session.webId,e,Rl)]})})},e.prototype.getFieldAsString=function(e,t,n){return Al(this,void 0,void 0,function(){var r;return Nl(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.fetcher.load(this.store.sym(e).doc(),{force:!0,clearPreviousData:!0})];case 1:return i.sent(),[2,this.store.any(this.store.sym(e),n(t))];case 2:return r=i.sent(),console.log("Error fetching data: "+r),[3,3];case 3:return[2]}})})},e.prototype.getDataAsArray=function(e,t,n){return Al(this,void 0,void 0,function(){var r;return Nl(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.fetcher.load(this.store.sym(e).doc(),{force:!0,clearPreviousData:!0})];case 1:return i.sent(),[2,this.store.each(this.store.sym(e),n(t))];case 2:return r=i.sent(),console.log("Error fetching data: "+r),[3,3];case 3:return[2]}})})},e.prototype.getFriends=function(){return Al(this,void 0,void 0,function(){return Nl(this,function(e){return[2,this.getDataAsArray(this.session.webId,"knows",jl)]})})},e.prototype.getFriendData=function(e,t){return Al(this,void 0,void 0,function(){return Nl(this,function(n){return[2,this.getFieldAsString(e,t,Rl)]})})},e.prototype.getElementsFromContainer=function(e){return Al(this,void 0,void 0,function(){return Nl(this,function(t){return[2,this.getDataAsArray(e,"contains",Dl)]})})},e.prototype.addFriend=function(e){var t=this,n=$rdf.sym(this.session.webId),r=$rdf.sym(e),i=$rdf.st(n,jl("knows"),r,n.doc());this.updateManager.update([],i,function(e,n,r){n?t.toastr.success("Friend added","Success!"):t.toastr.error("Message: "+r,"An error has occurred")})},e.prototype.removeFriend=function(e){var t=this,n=$rdf.sym(this.session.webId),r=$rdf.sym(e),i=$rdf.st(n,jl("knows"),r,n.doc());this.updateManager.update(i,[],function(e,n,r){n?t.toastr.success("Friend removed","Success!"):t.toastr.error("Message: "+r,"An error has occurred")})},e.ngInjectableDef=de({factory:function(){return new e(at(Tl))},token:e,providedIn:"root"}),e}(),Ul=new I(function(e){return e.complete()});function Fl(e){return e?function(e){return new I(function(t){return e.schedule(function(){return t.complete()})})}(e):Ul}function Vl(e){var t=new I(function(t){t.next(e),t.complete()});return t._isScalar=!0,t.value=e,t}function Bl(){for(var e=[],t=0;t0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,i=0;i=2;return function(r){return r.pipe(e?$l(function(t,n){return e(t,n,r)}):ie,Yl(1),n?oc(t):rc(function(){return new ql}))}}function lc(e,t){return function(n){return n.lift(new cc(e,t,n))}}var cc=function(){function e(e,t,n){this.predicate=e,this.thisArg=t,this.source=n}return e.prototype.call=function(e,t){return t.subscribe(new fc(e,this.predicate,this.thisArg,this.source))},e}(),fc=function(e){function t(t,n,r,i){var o=e.call(this,t)||this;return o.predicate=n,o.thisArg=r,o.source=i,o.index=0,o.thisArg=r||o,o}return i(t,e),t.prototype.notifyComplete=function(e){this.destination.next(e),this.destination.complete()},t.prototype._next=function(e){var t=!1;try{t=this.predicate.call(this.thisArg,e,this.index++,this.source)}catch(n){return void this.destination.error(n)}t||this.notifyComplete(!1)},t.prototype._complete=function(){this.notifyComplete(!0)},t}(S);function hc(e){return function(t){var n=new pc(e),r=t.lift(n);return n.caught=r}}var pc=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new dc(e,this.selector,this.caught))},e}(),dc=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.selector=n,i.caught=r,i}return i(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=void 0;try{n=this.selector(t,this.caught)}catch(i){return void e.prototype.error.call(this,i)}this._unsubscribeAndRecycle();var r=new U(this,void 0,void 0);this.add(r),J(this,n,void 0,void 0,r)}},t}(K),gc=function(){function e(e){if(this.total=e,this.total<0)throw new Ql}return e.prototype.call=function(e,t){return t.subscribe(new mc(e,this.total))},e}(),mc=function(e){function t(t,n){var r=e.call(this,t)||this;return r.total=n,r.count=0,r}return i(t,e),t.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},t}(S);function yc(e,t){var n=arguments.length>=2;return function(r){return r.pipe(e?$l(function(t,n){return e(t,n,r)}):ie,function(e){return e.lift(new gc(1))},n?oc(t):rc(function(){return new ql}))}}function vc(e,t){return te(e,t,1)}function bc(e,t){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new wc(e,t,n))}}var wc=function(){function e(e,t,n){void 0===n&&(n=!1),this.accumulator=e,this.seed=t,this.hasSeed=n}return e.prototype.call=function(e,t){return t.subscribe(new _c(e,this.accumulator,this.seed,this.hasSeed))},e}(),_c=function(e){function t(t,n,r,i){var o=e.call(this,t)||this;return o.accumulator=n,o._seed=r,o.hasSeed=i,o.index=0,o}return i(t,e),Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e},enumerable:!0,configurable:!0}),t.prototype._next=function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)},t.prototype._tryNext=function(e){var t,n=this.index++;try{t=this.accumulator(this.seed,e,n)}catch(r){this.destination.error(r)}this.seed=t,this.destination.next(t)},t}(S),xc=function(){return function(e,t){this.id=e,this.url=t}}(),Sc=function(e){function t(t,n,r,i){void 0===r&&(r="imperative"),void 0===i&&(i=null);var o=e.call(this,t,n)||this;return o.navigationTrigger=r,o.restoredState=i,o}return i(t,e),t.prototype.toString=function(){return"NavigationStart(id: "+this.id+", url: '"+this.url+"')"},t}(xc),Ec=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.urlAfterRedirects=r,i}return i(t,e),t.prototype.toString=function(){return"NavigationEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"')"},t}(xc),kc=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.reason=r,i}return i(t,e),t.prototype.toString=function(){return"NavigationCancel(id: "+this.id+", url: '"+this.url+"')"},t}(xc),Cc=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.error=r,i}return i(t,e),t.prototype.toString=function(){return"NavigationError(id: "+this.id+", url: '"+this.url+"', error: "+this.error+")"},t}(xc),Tc=function(e){function t(t,n,r,i){var o=e.call(this,t,n)||this;return o.urlAfterRedirects=r,o.state=i,o}return i(t,e),t.prototype.toString=function(){return"RoutesRecognized(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},t}(xc),Oc=function(e){function t(t,n,r,i){var o=e.call(this,t,n)||this;return o.urlAfterRedirects=r,o.state=i,o}return i(t,e),t.prototype.toString=function(){return"GuardsCheckStart(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},t}(xc),Ic=function(e){function t(t,n,r,i,o){var a=e.call(this,t,n)||this;return a.urlAfterRedirects=r,a.state=i,a.shouldActivate=o,a}return i(t,e),t.prototype.toString=function(){return"GuardsCheckEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+", shouldActivate: "+this.shouldActivate+")"},t}(xc),Pc=function(e){function t(t,n,r,i){var o=e.call(this,t,n)||this;return o.urlAfterRedirects=r,o.state=i,o}return i(t,e),t.prototype.toString=function(){return"ResolveStart(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},t}(xc),Ac=function(e){function t(t,n,r,i){var o=e.call(this,t,n)||this;return o.urlAfterRedirects=r,o.state=i,o}return i(t,e),t.prototype.toString=function(){return"ResolveEnd(id: "+this.id+", url: '"+this.url+"', urlAfterRedirects: '"+this.urlAfterRedirects+"', state: "+this.state+")"},t}(xc),Nc=function(){function e(e){this.route=e}return e.prototype.toString=function(){return"RouteConfigLoadStart(path: "+this.route.path+")"},e}(),Rc=function(){function e(e){this.route=e}return e.prototype.toString=function(){return"RouteConfigLoadEnd(path: "+this.route.path+")"},e}(),jc=function(){function e(e){this.snapshot=e}return e.prototype.toString=function(){return"ChildActivationStart(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},e}(),Dc=function(){function e(e){this.snapshot=e}return e.prototype.toString=function(){return"ChildActivationEnd(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},e}(),Mc=function(){function e(e){this.snapshot=e}return e.prototype.toString=function(){return"ActivationStart(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},e}(),Lc=function(){function e(e){this.snapshot=e}return e.prototype.toString=function(){return"ActivationEnd(path: '"+(this.snapshot.routeConfig&&this.snapshot.routeConfig.path||"")+"')"},e}(),Uc=function(){function e(e,t,n){this.routerEvent=e,this.position=t,this.anchor=n}return e.prototype.toString=function(){return"Scroll(anchor: '"+this.anchor+"', position: '"+(this.position?this.position[0]+", "+this.position[1]:null)+"')"},e}(),Fc=function(){return function(){}}(),Vc="primary",Bc=function(){function e(e){this.params=e||{}}return e.prototype.has=function(e){return this.params.hasOwnProperty(e)},e.prototype.get=function(e){if(this.has(e)){var t=this.params[e];return Array.isArray(t)?t[0]:t}return null},e.prototype.getAll=function(e){if(this.has(e)){var t=this.params[e];return Array.isArray(t)?t:[t]}return[]},Object.defineProperty(e.prototype,"keys",{get:function(){return Object.keys(this.params)},enumerable:!0,configurable:!0}),e}();function zc(e){return new Bc(e)}function qc(e,t,n){var r=n.path.split("/");if(r.length>e.length)return null;if("full"===n.pathMatch&&(t.hasChildren()||r.length0?e[e.length-1]:null}function Zc(e,t){for(var n in e)e.hasOwnProperty(n)&&t(e[n],n)}function Xc(e){return e.pipe(oe(),lc(function(e){return!0===e}))}function ef(e){return vt(e)?e:yt(e)?ee(Promise.resolve(e)):Bl(e)}function tf(e,t,n){return n?function(e,t){return Kc(e,t)}(e.queryParams,t.queryParams)&&function e(t,n){if(!af(t.segments,n.segments))return!1;if(t.numberOfChildren!==n.numberOfChildren)return!1;for(var r in n.children){if(!t.children[r])return!1;if(!e(t.children[r],n.children[r]))return!1}return!0}(e.root,t.root):function(e,t){return Object.keys(t).length<=Object.keys(e).length&&Object.keys(t).every(function(n){return t[n]===e[n]})}(e.queryParams,t.queryParams)&&function e(t,n){return function t(n,r,i){if(n.segments.length>i.length)return!!af(a=n.segments.slice(0,i.length),i)&&!r.hasChildren();if(n.segments.length===i.length){if(!af(n.segments,i))return!1;for(var o in r.children){if(!n.children[o])return!1;if(!e(n.children[o],r.children[o]))return!1}return!0}var a=i.slice(0,n.segments.length),s=i.slice(n.segments.length);return!!af(n.segments,a)&&!!n.children[Vc]&&t(n.children[Vc],r,s)}(t,n,n.segments)}(e.root,t.root)}var nf=function(){function e(e,t,n){this.root=e,this.queryParams=t,this.fragment=n}return Object.defineProperty(e.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=zc(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return cf.serialize(this)},e}(),rf=function(){function e(e,t){var n=this;this.segments=e,this.children=t,this.parent=null,Zc(t,function(e,t){return e.parent=n})}return e.prototype.hasChildren=function(){return this.numberOfChildren>0},Object.defineProperty(e.prototype,"numberOfChildren",{get:function(){return Object.keys(this.children).length},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return ff(this)},e}(),of=function(){function e(e,t){this.path=e,this.parameters=t}return Object.defineProperty(e.prototype,"parameterMap",{get:function(){return this._parameterMap||(this._parameterMap=zc(this.parameters)),this._parameterMap},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return yf(this)},e}();function af(e,t){return e.length===t.length&&e.every(function(e,n){return e.path===t[n].path})}function sf(e,t){var n=[];return Zc(e.children,function(e,r){r===Vc&&(n=n.concat(t(e,r)))}),Zc(e.children,function(e,r){r!==Vc&&(n=n.concat(t(e,r)))}),n}var uf=function(){return function(){}}(),lf=function(){function e(){}return e.prototype.parse=function(e){var t=new xf(e);return new nf(t.parseRootSegment(),t.parseQueryParams(),t.parseFragment())},e.prototype.serialize=function(e){var t,n;return"/"+function e(t,n){if(!t.hasChildren())return ff(t);if(n){var r=t.children[Vc]?e(t.children[Vc],!1):"",i=[];return Zc(t.children,function(t,n){n!==Vc&&i.push(n+":"+e(t,!1))}),i.length>0?r+"("+i.join("//")+")":r}var o=sf(t,function(n,r){return r===Vc?[e(t.children[Vc],!1)]:[r+":"+e(n,!1)]});return ff(t)+"/("+o.join("//")+")"}(e.root,!0)+(t=e.queryParams,(n=Object.keys(t).map(function(e){var n=t[e];return Array.isArray(n)?n.map(function(t){return pf(e)+"="+pf(t)}).join("&"):pf(e)+"="+pf(n)})).length?"?"+n.join("&"):"")+("string"==typeof e.fragment?"#"+encodeURI(e.fragment):"")},e}(),cf=new lf;function ff(e){return e.segments.map(function(e){return yf(e)}).join("/")}function hf(e){return encodeURIComponent(e).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function pf(e){return hf(e).replace(/%3B/gi,";")}function df(e){return hf(e).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function gf(e){return decodeURIComponent(e)}function mf(e){return gf(e.replace(/\+/g,"%20"))}function yf(e){return""+df(e.path)+(t=e.parameters,Object.keys(t).map(function(e){return";"+df(e)+"="+df(t[e])}).join(""));var t}var vf=/^[^\/()?;=#]+/;function bf(e){var t=e.match(vf);return t?t[0]:""}var wf=/^[^=?&#]+/,_f=/^[^?&#]+/,xf=function(){function e(e){this.url=e,this.remaining=e}return e.prototype.parseRootSegment=function(){return this.consumeOptional("/"),""===this.remaining||this.peekStartsWith("?")||this.peekStartsWith("#")?new rf([],{}):new rf([],this.parseChildren())},e.prototype.parseQueryParams=function(){var e={};if(this.consumeOptional("?"))do{this.parseQueryParam(e)}while(this.consumeOptional("&"));return e},e.prototype.parseFragment=function(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null},e.prototype.parseChildren=function(){if(""===this.remaining)return{};this.consumeOptional("/");var e=[];for(this.peekStartsWith("(")||e.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),e.push(this.parseSegment());var t={};this.peekStartsWith("/(")&&(this.capture("/"),t=this.parseParens(!0));var n={};return this.peekStartsWith("(")&&(n=this.parseParens(!1)),(e.length>0||Object.keys(t).length>0)&&(n[Vc]=new rf(e,t)),n},e.prototype.parseSegment=function(){var e=bf(this.remaining);if(""===e&&this.peekStartsWith(";"))throw new Error("Empty path url segment cannot have parameters: '"+this.remaining+"'.");return this.capture(e),new of(gf(e),this.parseMatrixParams())},e.prototype.parseMatrixParams=function(){for(var e={};this.consumeOptional(";");)this.parseParam(e);return e},e.prototype.parseParam=function(e){var t=bf(this.remaining);if(t){this.capture(t);var n="";if(this.consumeOptional("=")){var r=bf(this.remaining);r&&this.capture(n=r)}e[gf(t)]=gf(n)}},e.prototype.parseQueryParam=function(e){var t,n=(t=this.remaining.match(wf))?t[0]:"";if(n){this.capture(n);var r="";if(this.consumeOptional("=")){var i=function(e){var t=e.match(_f);return t?t[0]:""}(this.remaining);i&&this.capture(r=i)}var o=mf(n),a=mf(r);if(e.hasOwnProperty(o)){var s=e[o];Array.isArray(s)||(e[o]=s=[s]),s.push(a)}else e[o]=a}},e.prototype.parseParens=function(e){var t={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){var n=bf(this.remaining),r=this.remaining[n.length];if("/"!==r&&")"!==r&&";"!==r)throw new Error("Cannot parse url '"+this.url+"'");var i=void 0;n.indexOf(":")>-1?(i=n.substr(0,n.indexOf(":")),this.capture(i),this.capture(":")):e&&(i=Vc);var o=this.parseChildren();t[i]=1===Object.keys(o).length?o[Vc]:new rf([],o),this.consumeOptional("//")}return t},e.prototype.peekStartsWith=function(e){return this.remaining.startsWith(e)},e.prototype.consumeOptional=function(e){return!!this.peekStartsWith(e)&&(this.remaining=this.remaining.substring(e.length),!0)},e.prototype.capture=function(e){if(!this.consumeOptional(e))throw new Error('Expected "'+e+'".')},e}(),Sf=function(){return function(e){this.segmentGroup=e||null}}(),Ef=function(){return function(e){this.urlTree=e}}();function kf(e){return new I(function(t){return t.error(new Sf(e))})}function Cf(e){return new I(function(t){return t.error(new Ef(e))})}function Tf(e){return new I(function(t){return t.error(new Error("Only absolute redirects can have named outlets. redirectTo: '"+e+"'"))})}var Of=function(){function e(e,t,n,r,i){this.configLoader=t,this.urlSerializer=n,this.urlTree=r,this.config=i,this.allowRedirects=!0,this.ngModule=e.get(Bt)}return e.prototype.apply=function(){var e=this;return this.expandSegmentGroup(this.ngModule,this.config,this.urlTree.root,Vc).pipe(Q(function(t){return e.createUrlTree(t,e.urlTree.queryParams,e.urlTree.fragment)})).pipe(hc(function(t){if(t instanceof Ef)return e.allowRedirects=!1,e.match(t.urlTree);if(t instanceof Sf)throw e.noMatchError(t);throw t}))},e.prototype.match=function(e){var t=this;return this.expandSegmentGroup(this.ngModule,this.config,e.root,Vc).pipe(Q(function(n){return t.createUrlTree(n,e.queryParams,e.fragment)})).pipe(hc(function(e){if(e instanceof Sf)throw t.noMatchError(e);throw e}))},e.prototype.noMatchError=function(e){return new Error("Cannot match any routes. URL Segment: '"+e.segmentGroup+"'")},e.prototype.createUrlTree=function(e,t,n){var r,i=e.segments.length>0?new rf([],((r={})[Vc]=e,r)):e;return new nf(i,t,n)},e.prototype.expandSegmentGroup=function(e,t,n,r){return 0===n.segments.length&&n.hasChildren()?this.expandChildren(e,t,n).pipe(Q(function(e){return new rf([],e)})):this.expandSegment(e,n,t,n.segments,r,!0)},e.prototype.expandChildren=function(e,t,n){var r=this;return function(n,i){if(0===Object.keys(n).length)return Bl({});var o=[],a=[],s={};return Zc(n,function(n,i){var u,l,c=(u=i,l=n,r.expandSegmentGroup(e,t,l,u)).pipe(Q(function(e){return s[i]=e}));i===Vc?o.push(c):a.push(c)}),Bl.apply(null,o.concat(a)).pipe(Wl(),uc(),Q(function(){return s}))}(n.children)},e.prototype.expandSegment=function(e,t,n,r,i,o){var a=this;return Bl.apply(void 0,c(n)).pipe(Q(function(s){return a.expandSegmentAgainstRoute(e,t,n,s,r,i,o).pipe(hc(function(e){if(e instanceof Sf)return Bl(null);throw e}))}),Wl(),yc(function(e){return!!e}),hc(function(e,n){if(e instanceof ql||"EmptyError"===e.name){if(a.noLeftoversInUrl(t,r,i))return Bl(new rf([],{}));throw new Sf(t)}throw e}))},e.prototype.noLeftoversInUrl=function(e,t,n){return 0===t.length&&!e.children[n]},e.prototype.expandSegmentAgainstRoute=function(e,t,n,r,i,o,a){return Nf(r)!==o?kf(t):void 0===r.redirectTo?this.matchSegmentAgainstRoute(e,t,r,i):a&&this.allowRedirects?this.expandSegmentAgainstRouteUsingRedirect(e,t,n,r,i,o):kf(t)},e.prototype.expandSegmentAgainstRouteUsingRedirect=function(e,t,n,r,i,o){return"**"===r.path?this.expandWildCardWithParamsAgainstRouteUsingRedirect(e,n,r,o):this.expandRegularSegmentAgainstRouteUsingRedirect(e,t,n,r,i,o)},e.prototype.expandWildCardWithParamsAgainstRouteUsingRedirect=function(e,t,n,r){var i=this,o=this.applyRedirectCommands([],n.redirectTo,{});return n.redirectTo.startsWith("/")?Cf(o):this.lineralizeSegments(n,o).pipe(te(function(n){var o=new rf(n,{});return i.expandSegment(e,o,t,n,r,!1)}))},e.prototype.expandRegularSegmentAgainstRouteUsingRedirect=function(e,t,n,r,i,o){var a=this,s=If(t,r,i),u=s.consumedSegments,l=s.lastChild,c=s.positionalParamSegments;if(!s.matched)return kf(t);var f=this.applyRedirectCommands(u,r.redirectTo,c);return r.redirectTo.startsWith("/")?Cf(f):this.lineralizeSegments(r,f).pipe(te(function(r){return a.expandSegment(e,t,n,r.concat(i.slice(l)),o,!1)}))},e.prototype.matchSegmentAgainstRoute=function(e,t,n,r){var i=this;if("**"===n.path)return n.loadChildren?this.configLoader.load(e.injector,n).pipe(Q(function(e){return n._loadedConfig=e,new rf(r,{})})):Bl(new rf(r,{}));var a=If(t,n,r),s=a.consumedSegments,l=a.lastChild;if(!a.matched)return kf(t);var c=r.slice(l);return this.getChildConfig(e,n).pipe(te(function(e){var n=e.module,r=e.routes,a=function(e,t,n,r){return n.length>0&&function(e,t,n){return r.some(function(n){return Af(e,t,n)&&Nf(n)!==Vc})}(e,n)?{segmentGroup:Pf(new rf(t,function(e,t){var n,r,i={};i[Vc]=t;try{for(var o=u(e),a=o.next();!a.done;a=o.next()){var s=a.value;""===s.path&&Nf(s)!==Vc&&(i[Nf(s)]=new rf([],{}))}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}(r,new rf(n,e.children)))),slicedSegments:[]}:0===n.length&&function(e,t,n){return r.some(function(n){return Af(e,t,n)})}(e,n)?{segmentGroup:Pf(new rf(e.segments,function(e,t,n,r){var i,a,s={};try{for(var l=u(n),c=l.next();!c.done;c=l.next()){var f=c.value;Af(e,t,f)&&!r[Nf(f)]&&(s[Nf(f)]=new rf([],{}))}}catch(h){i={error:h}}finally{try{c&&!c.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}return o({},r,s)}(e,n,r,e.children))),slicedSegments:n}:{segmentGroup:e,slicedSegments:n}}(t,s,c,r),l=a.segmentGroup,f=a.slicedSegments;return 0===f.length&&l.hasChildren()?i.expandChildren(n,r,l).pipe(Q(function(e){return new rf(s,e)})):0===r.length&&0===f.length?Bl(new rf(s,{})):i.expandSegment(n,l,r,f,Vc,!0).pipe(Q(function(e){return new rf(s.concat(e.segments),e.children)}))}))},e.prototype.getChildConfig=function(e,t){var n=this;return t.children?Bl(new Hc(t.children,e)):t.loadChildren?void 0!==t._loadedConfig?Bl(t._loadedConfig):function(e,t){var n=t.canLoad;return n&&0!==n.length?Xc(ee(n).pipe(Q(function(n){var r=e.get(n);return ef(r.canLoad?r.canLoad(t):r(t))}))):Bl(!0)}(e.injector,t).pipe(te(function(r){return r?n.configLoader.load(e.injector,t).pipe(Q(function(e){return t._loadedConfig=e,e})):function(e){return new I(function(t){return t.error(((n=Error("NavigationCancelingError: Cannot load children because the guard of the route \"path: '"+e.path+"'\" returned false")).ngNavigationCancelingError=!0,n));var n})}(t)})):Bl(new Hc([],e))},e.prototype.lineralizeSegments=function(e,t){for(var n=[],r=t.root;;){if(n=n.concat(r.segments),0===r.numberOfChildren)return Bl(n);if(r.numberOfChildren>1||!r.children[Vc])return Tf(e.redirectTo);r=r.children[Vc]}},e.prototype.applyRedirectCommands=function(e,t,n){return this.applyRedirectCreatreUrlTree(t,this.urlSerializer.parse(t),e,n)},e.prototype.applyRedirectCreatreUrlTree=function(e,t,n,r){var i=this.createSegmentGroup(e,t.root,n,r);return new nf(i,this.createQueryParams(t.queryParams,this.urlTree.queryParams),t.fragment)},e.prototype.createQueryParams=function(e,t){var n={};return Zc(e,function(e,r){if("string"==typeof e&&e.startsWith(":")){var i=e.substring(1);n[r]=t[i]}else n[r]=e}),n},e.prototype.createSegmentGroup=function(e,t,n,r){var i=this,o=this.createSegments(e,t.segments,n,r),a={};return Zc(t.children,function(t,o){a[o]=i.createSegmentGroup(e,t,n,r)}),new rf(o,a)},e.prototype.createSegments=function(e,t,n,r){var i=this;return t.map(function(t){return t.path.startsWith(":")?i.findPosParam(e,t,r):i.findOrReturn(t,n)})},e.prototype.findPosParam=function(e,t,n){var r=n[t.path.substring(1)];if(!r)throw new Error("Cannot redirect to '"+e+"'. Cannot find '"+t.path+"'.");return r},e.prototype.findOrReturn=function(e,t){var n,r,i=0;try{for(var o=u(t),a=o.next();!a.done;a=o.next()){var s=a.value;if(s.path===e.path)return t.splice(i),s;i++}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return e},e}();function If(e,t,n){if(""===t.path)return"full"===t.pathMatch&&(e.hasChildren()||n.length>0)?{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}:{matched:!0,consumedSegments:[],lastChild:0,positionalParamSegments:{}};var r=(t.matcher||qc)(n,e,t);return r?{matched:!0,consumedSegments:r.consumed,lastChild:r.consumed.length,positionalParamSegments:r.posParams}:{matched:!1,consumedSegments:[],lastChild:0,positionalParamSegments:{}}}function Pf(e){if(1===e.numberOfChildren&&e.children[Vc]){var t=e.children[Vc];return new rf(e.segments.concat(t.segments),t.children)}return e}function Af(e,t,n){return(!(e.hasChildren()||t.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0!==n.redirectTo}function Nf(e){return e.outlet||Vc}var Rf=function(){function e(e){this._root=e}return Object.defineProperty(e.prototype,"root",{get:function(){return this._root.value},enumerable:!0,configurable:!0}),e.prototype.parent=function(e){var t=this.pathFromRoot(e);return t.length>1?t[t.length-2]:null},e.prototype.children=function(e){var t=jf(e,this._root);return t?t.children.map(function(e){return e.value}):[]},e.prototype.firstChild=function(e){var t=jf(e,this._root);return t&&t.children.length>0?t.children[0].value:null},e.prototype.siblings=function(e){var t=Df(e,this._root);return t.length<2?[]:t[t.length-2].children.map(function(e){return e.value}).filter(function(t){return t!==e})},e.prototype.pathFromRoot=function(e){return Df(e,this._root).map(function(e){return e.value})},e}();function jf(e,t){var n,r;if(e===t.value)return t;try{for(var i=u(t.children),o=i.next();!o.done;o=i.next()){var a=jf(e,o.value);if(a)return a}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return null}function Df(e,t){var n,r;if(e===t.value)return[t];try{for(var i=u(t.children),o=i.next();!o.done;o=i.next()){var a=Df(e,o.value);if(a.length)return a.unshift(t),a}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return[]}var Mf=function(){function e(e,t){this.value=e,this.children=t}return e.prototype.toString=function(){return"TreeNode("+this.value+")"},e}();function Lf(e){var t={};return e&&e.children.forEach(function(e){return t[e.value.outlet]=e}),t}var Uf=function(e){function t(t,n){var r=e.call(this,t)||this;return r.snapshot=n,Hf(r,t),r}return i(t,e),t.prototype.toString=function(){return this.snapshot.toString()},t}(Rf);function Ff(e,t){var n=function(e,t){var n=new zf([],{},{},"",{},Vc,t,null,e.root,-1,{});return new qf("",new Mf(n,[]))}(e,t),r=new Hl([new of("",{})]),i=new Hl({}),o=new Hl({}),a=new Hl({}),s=new Hl(""),u=new Vf(r,i,a,s,o,Vc,t,n.root);return u.snapshot=n.root,new Uf(new Mf(u,[]),n)}var Vf=function(){function e(e,t,n,r,i,o,a,s){this.url=e,this.params=t,this.queryParams=n,this.fragment=r,this.data=i,this.outlet=o,this.component=a,this._futureSnapshot=s}return Object.defineProperty(e.prototype,"routeConfig",{get:function(){return this._futureSnapshot.routeConfig},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=this.params.pipe(Q(function(e){return zc(e)}))),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=this.queryParams.pipe(Q(function(e){return zc(e)}))),this._queryParamMap},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return this.snapshot?this.snapshot.toString():"Future("+this._futureSnapshot+")"},e}();function Bf(e,t){void 0===t&&(t="emptyOnly");var n=e.pathFromRoot,r=0;if("always"!==t)for(r=n.length-1;r>=1;){var i=n[r],a=n[r-1];if(i.routeConfig&&""===i.routeConfig.path)r--;else{if(a.component)break;r--}}return function(e){return e.reduce(function(e,t){return{params:o({},e.params,t.params),data:o({},e.data,t.data),resolve:o({},e.resolve,t._resolvedData)}},{params:{},data:{},resolve:{}})}(n.slice(r))}var zf=function(){function e(e,t,n,r,i,o,a,s,u,l,c){this.url=e,this.params=t,this.queryParams=n,this.fragment=r,this.data=i,this.outlet=o,this.component=a,this.routeConfig=s,this._urlSegment=u,this._lastPathIndex=l,this._resolve=c}return Object.defineProperty(e.prototype,"root",{get:function(){return this._routerState.root},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._routerState.parent(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"firstChild",{get:function(){return this._routerState.firstChild(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"children",{get:function(){return this._routerState.children(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pathFromRoot",{get:function(){return this._routerState.pathFromRoot(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"paramMap",{get:function(){return this._paramMap||(this._paramMap=zc(this.params)),this._paramMap},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"queryParamMap",{get:function(){return this._queryParamMap||(this._queryParamMap=zc(this.queryParams)),this._queryParamMap},enumerable:!0,configurable:!0}),e.prototype.toString=function(){return"Route(url:'"+this.url.map(function(e){return e.toString()}).join("/")+"', path:'"+(this.routeConfig?this.routeConfig.path:"")+"')"},e}(),qf=function(e){function t(t,n){var r=e.call(this,n)||this;return r.url=t,Hf(r,n),r}return i(t,e),t.prototype.toString=function(){return Wf(this._root)},t}(Rf);function Hf(e,t){t.value._routerState=e,t.children.forEach(function(t){return Hf(e,t)})}function Wf(e){var t=e.children.length>0?" { "+e.children.map(Wf).join(", ")+" } ":"";return""+e.value+t}function $f(e){if(e.snapshot){var t=e.snapshot,n=e._futureSnapshot;e.snapshot=n,Kc(t.queryParams,n.queryParams)||e.queryParams.next(n.queryParams),t.fragment!==n.fragment&&e.fragment.next(n.fragment),Kc(t.params,n.params)||e.params.next(n.params),function(e,t){if(e.length!==t.length)return!1;for(var n=0;n0&&Kf(n[0]))throw new Error("Root segment cannot have matrix parameters");var r=n.find(function(e){return"object"==typeof e&&null!=e&&e.outlets});if(r&&r!==Yc(n))throw new Error("{outlets:{}} has to be the last command")}return e.prototype.toRoot=function(){return this.isAbsolute&&1===this.commands.length&&"/"==this.commands[0]},e}(),Zf=function(){return function(e,t,n){this.segmentGroup=e,this.processChildren=t,this.index=n}}();function Xf(e){return"object"==typeof e&&null!=e&&e.outlets?e.outlets[Vc]:""+e}function eh(e,t,n){if(e||(e=new rf([],{})),0===e.segments.length&&e.hasChildren())return th(e,t,n);var r=function(e,t,n){for(var r=0,i=t,o={match:!1,pathIndex:0,commandIndex:0};i=n.length)return o;var a=e.segments[i],s=Xf(n[r]),u=r0&&void 0===s)break;if(s&&u&&"object"==typeof u&&void 0===u.outlets){if(!oh(s,u,a))return o;r+=2}else{if(!oh(s,{},a))return o;r++}i++}return{match:!0,pathIndex:i,commandIndex:r}}(e,t,n),i=n.slice(r.commandIndex);if(r.match&&r.pathIndex=2?function(t){return T(bc(e,void 0),Yl(1),oc(void 0))(t)}:function(t){return T(bc(function(t,n,r){return e(t)}),Yl(1))(t)}}(function(e,t){return e})):Bl(null)},e.prototype.isDeactivating=function(){return 0!==this.canDeactivateChecks.length},e.prototype.isActivating=function(){return 0!==this.canActivateChecks.length},e.prototype.setupChildRouteGuards=function(e,t,n,r){var i=this,o=Lf(t);e.children.forEach(function(e){i.setupRouteGuards(e,o[e.value.outlet],n,r.concat([e.value])),delete o[e.value.outlet]}),Zc(o,function(e,t){return i.deactivateRouteAndItsChildren(e,n.getContext(t))})},e.prototype.setupRouteGuards=function(e,t,n,r){var i=e.value,o=t?t.value:null,a=n?n.getContext(e.value.outlet):null;if(o&&i.routeConfig===o.routeConfig){var s=this.shouldRunGuardsAndResolvers(o,i,i.routeConfig.runGuardsAndResolvers);s?this.canActivateChecks.push(new ah(r)):(i.data=o.data,i._resolvedData=o._resolvedData),this.setupChildRouteGuards(e,t,i.component?a?a.children:null:n,r),s&&this.canDeactivateChecks.push(new sh(a.outlet.component,o))}else o&&this.deactivateRouteAndItsChildren(t,a),this.canActivateChecks.push(new ah(r)),this.setupChildRouteGuards(e,null,i.component?a?a.children:null:n,r)},e.prototype.shouldRunGuardsAndResolvers=function(e,t,n){switch(n){case"always":return!0;case"paramsOrQueryParamsChange":return!Gf(e,t)||!Kc(e.queryParams,t.queryParams);case"paramsChange":default:return!Gf(e,t)}},e.prototype.deactivateRouteAndItsChildren=function(e,t){var n=this,r=Lf(e),i=e.value;Zc(r,function(e,r){n.deactivateRouteAndItsChildren(e,i.component?t?t.children.getContext(r):null:t)}),this.canDeactivateChecks.push(new sh(i.component&&t&&t.outlet&&t.outlet.isActivated?t.outlet.component:null,i))},e.prototype.runCanDeactivateChecks=function(){var e=this;return ee(this.canDeactivateChecks).pipe(te(function(t){return e.runCanDeactivate(t.component,t.route)}),lc(function(e){return!0===e}))},e.prototype.runCanActivateChecks=function(){var e=this;return ee(this.canActivateChecks).pipe(vc(function(t){return Xc(ee([e.fireChildActivationStart(t.route.parent),e.fireActivationStart(t.route),e.runCanActivateChild(t.path),e.runCanActivate(t.route)]))}),lc(function(e){return!0===e}))},e.prototype.fireActivationStart=function(e){return null!==e&&this.forwardEvent&&this.forwardEvent(new Mc(e)),Bl(!0)},e.prototype.fireChildActivationStart=function(e){return null!==e&&this.forwardEvent&&this.forwardEvent(new jc(e)),Bl(!0)},e.prototype.runCanActivate=function(e){var t=this,n=e.routeConfig?e.routeConfig.canActivate:null;return n&&0!==n.length?Xc(ee(n).pipe(Q(function(n){var r=t.getToken(n,e);return ef(r.canActivate?r.canActivate(e,t.future):r(e,t.future)).pipe(yc())}))):Bl(!0)},e.prototype.runCanActivateChild=function(e){var t=this,n=e[e.length-1];return Xc(ee(e.slice(0,e.length-1).reverse().map(function(e){return t.extractCanActivateChild(e)}).filter(function(e){return null!==e})).pipe(Q(function(e){return Xc(ee(e.guards).pipe(Q(function(r){var i=t.getToken(r,e.node);return ef(i.canActivateChild?i.canActivateChild(n,t.future):i(n,t.future)).pipe(yc())})))})))},e.prototype.extractCanActivateChild=function(e){var t=e.routeConfig?e.routeConfig.canActivateChild:null;return t&&0!==t.length?{node:e,guards:t}:null},e.prototype.runCanDeactivate=function(e,t){var n=this,r=t&&t.routeConfig?t.routeConfig.canDeactivate:null;return r&&0!==r.length?ee(r).pipe(te(function(r){var i=n.getToken(r,t);return ef(i.canDeactivate?i.canDeactivate(e,t,n.curr,n.future):i(e,t,n.curr,n.future)).pipe(yc())})).pipe(lc(function(e){return!0===e})):Bl(!0)},e.prototype.runResolve=function(e,t){return this.resolveNode(e._resolve,e).pipe(Q(function(n){return e._resolvedData=n,e.data=o({},e.data,Bf(e,t).resolve),null}))},e.prototype.resolveNode=function(e,t){var n=this,r=Object.keys(e);if(0===r.length)return Bl({});if(1===r.length){var i=r[0];return this.getResolver(e[i],t).pipe(Q(function(e){var t;return(t={})[i]=e,t}))}var o={};return ee(r).pipe(te(function(r){return n.getResolver(e[r],t).pipe(Q(function(e){return o[r]=e,e}))})).pipe(uc(),Q(function(){return o}))},e.prototype.getResolver=function(e,t){var n=this.getToken(e,t);return ef(n.resolve?n.resolve(t,this.future):n(t,this.future))},e.prototype.getToken=function(e,t){var n=function(e){if(!e)return null;for(var t=e.parent;t;t=t.parent){var n=t.routeConfig;if(n&&n._loadedConfig)return n._loadedConfig}return null}(t);return(n?n.module.injector:this.moduleInjector).get(e)},e}(),lh=function(){return function(){}}(),ch=function(){function e(e,t,n,r,i,o){this.rootComponentType=e,this.config=t,this.urlTree=n,this.url=r,this.paramsInheritanceStrategy=i,this.relativeLinkResolution=o}return e.prototype.recognize=function(){try{var e=ph(this.urlTree.root,[],[],this.config,this.relativeLinkResolution).segmentGroup,t=this.processSegmentGroup(this.config,e,Vc),n=new zf([],Object.freeze({}),Object.freeze(o({},this.urlTree.queryParams)),this.urlTree.fragment,{},Vc,this.rootComponentType,null,this.urlTree.root,-1,{}),r=new Mf(n,t),i=new qf(this.url,r);return this.inheritParamsAndData(i._root),Bl(i)}catch(a){return new I(function(e){return e.error(a)})}},e.prototype.inheritParamsAndData=function(e){var t=this,n=e.value,r=Bf(n,this.paramsInheritanceStrategy);n.params=Object.freeze(r.params),n.data=Object.freeze(r.data),e.children.forEach(function(e){return t.inheritParamsAndData(e)})},e.prototype.processSegmentGroup=function(e,t,n){return 0===t.segments.length&&t.hasChildren()?this.processChildren(e,t):this.processSegment(e,t,t.segments,n)},e.prototype.processChildren=function(e,t){var n,r=this,i=sf(t,function(t,n){return r.processSegmentGroup(e,t,n)});return n={},i.forEach(function(e){var t=n[e.value.outlet];if(t){var r=t.url.map(function(e){return e.toString()}).join("/"),i=e.value.url.map(function(e){return e.toString()}).join("/");throw new Error("Two segments cannot have the same outlet name: '"+r+"' and '"+i+"'.")}n[e.value.outlet]=e.value}),i.sort(function(e,t){return e.value.outlet===Vc?-1:t.value.outlet===Vc?1:e.value.outlet.localeCompare(t.value.outlet)}),i},e.prototype.processSegment=function(e,t,n,r){var i,o;try{for(var a=u(e),s=a.next();!s.done;s=a.next()){var l=s.value;try{return this.processSegmentAgainstRoute(l,t,n,r)}catch(c){if(!(c instanceof lh))throw c}}}catch(f){i={error:f}}finally{try{s&&!s.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}if(this.noLeftoversInUrl(t,n,r))return[];throw new lh},e.prototype.noLeftoversInUrl=function(e,t,n){return 0===t.length&&!e.children[n]},e.prototype.processSegmentAgainstRoute=function(e,t,n,r){if(e.redirectTo)throw new lh;if((e.outlet||Vc)!==r)throw new lh;var i,a=[],s=[];if("**"===e.path){var u=n.length>0?Yc(n).parameters:{};i=new zf(n,u,Object.freeze(o({},this.urlTree.queryParams)),this.urlTree.fragment,mh(e),r,e.component,e,fh(t),hh(t)+n.length,yh(e))}else{var l=function(e,t,n){if(""===t.path){if("full"===t.pathMatch&&(e.hasChildren()||n.length>0))throw new lh;return{consumedSegments:[],lastChild:0,parameters:{}}}var r=(t.matcher||qc)(n,e,t);if(!r)throw new lh;var i={};Zc(r.posParams,function(e,t){i[t]=e.path});var a=r.consumed.length>0?o({},i,r.consumed[r.consumed.length-1].parameters):i;return{consumedSegments:r.consumed,lastChild:r.consumed.length,parameters:a}}(t,e,n);a=l.consumedSegments,s=n.slice(l.lastChild),i=new zf(a,l.parameters,Object.freeze(o({},this.urlTree.queryParams)),this.urlTree.fragment,mh(e),r,e.component,e,fh(t),hh(t)+a.length,yh(e))}var c=function(e){return e.children?e.children:e.loadChildren?e._loadedConfig.routes:[]}(e),f=ph(t,a,s,c,this.relativeLinkResolution),h=f.segmentGroup,p=f.slicedSegments;if(0===p.length&&h.hasChildren()){var d=this.processChildren(c,h);return[new Mf(i,d)]}if(0===c.length&&0===p.length)return[new Mf(i,[])];var g=this.processSegment(c,h,p,Vc);return[new Mf(i,g)]},e}();function fh(e){for(var t=e;t._sourceSegment;)t=t._sourceSegment;return t}function hh(e){for(var t=e,n=t._segmentIndexShift?t._segmentIndexShift:0;t._sourceSegment;)n+=(t=t._sourceSegment)._segmentIndexShift?t._segmentIndexShift:0;return n-1}function ph(e,t,n,r,i){if(n.length>0&&function(e,t,n){return r.some(function(n){return dh(e,t,n)&&gh(n)!==Vc})}(e,n)){var a=new rf(t,function(e,t,n,r){var i,o,a={};a[Vc]=r,r._sourceSegment=e,r._segmentIndexShift=t.length;try{for(var s=u(n),l=s.next();!l.done;l=s.next()){var c=l.value;if(""===c.path&&gh(c)!==Vc){var f=new rf([],{});f._sourceSegment=e,f._segmentIndexShift=t.length,a[gh(c)]=f}}}catch(h){i={error:h}}finally{try{l&&!l.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}return a}(e,t,r,new rf(n,e.children)));return a._sourceSegment=e,a._segmentIndexShift=t.length,{segmentGroup:a,slicedSegments:[]}}if(0===n.length&&function(e,t,n){return r.some(function(n){return dh(e,t,n)})}(e,n)){var s=new rf(e.segments,function(e,t,n,r,i,a){var s,l,c={};try{for(var f=u(r),h=f.next();!h.done;h=f.next()){var p=h.value;if(dh(e,n,p)&&!i[gh(p)]){var d=new rf([],{});d._sourceSegment=e,d._segmentIndexShift="legacy"===a?e.segments.length:t.length,c[gh(p)]=d}}}catch(g){s={error:g}}finally{try{h&&!h.done&&(l=f.return)&&l.call(f)}finally{if(s)throw s.error}}return o({},i,c)}(e,t,n,r,e.children,i));return s._sourceSegment=e,s._segmentIndexShift=t.length,{segmentGroup:s,slicedSegments:n}}var l=new rf(e.segments,e.children);return l._sourceSegment=e,l._segmentIndexShift=t.length,{segmentGroup:l,slicedSegments:n}}function dh(e,t,n){return(!(e.hasChildren()||t.length>0)||"full"!==n.pathMatch)&&""===n.path&&void 0===n.redirectTo}function gh(e){return e.outlet||Vc}function mh(e){return e.data||{}}function yh(e){return e.resolve||{}}var vh=function(){return function(){}}(),bh=function(){function e(){}return e.prototype.shouldDetach=function(e){return!1},e.prototype.store=function(e,t){},e.prototype.shouldAttach=function(e){return!1},e.prototype.retrieve=function(e){return null},e.prototype.shouldReuseRoute=function(e,t){return e.routeConfig===t.routeConfig},e}(),wh=new ge("ROUTES"),_h=function(){function e(e,t,n,r){this.loader=e,this.compiler=t,this.onLoadStartListener=n,this.onLoadEndListener=r}return e.prototype.load=function(e,t){var n=this;return this.onLoadStartListener&&this.onLoadStartListener(t),this.loadModuleFactory(t.loadChildren).pipe(Q(function(r){n.onLoadEndListener&&n.onLoadEndListener(t);var i=r.create(e);return new Hc(Qc(i.injector.get(wh)).map(Jc),i)}))},e.prototype.loadModuleFactory=function(e){var t=this;return"string"==typeof e?ee(this.loader.load(e)):ef(e()).pipe(te(function(e){return e instanceof zt?Bl(e):ee(t.compiler.compileModuleAsync(e))}))},e}(),xh=function(){return function(){}}(),Sh=function(){function e(){}return e.prototype.shouldProcessUrl=function(e){return!0},e.prototype.extract=function(e){return e},e.prototype.merge=function(e,t){return e},e}();function Eh(e){throw e}function kh(e,t,n){return t.parse("/")}function Ch(e,t){return Bl(null)}var Th=function(){function e(e,t,n,r,i,o,a,s){var u=this;this.rootComponentType=e,this.urlSerializer=t,this.rootContexts=n,this.location=r,this.config=s,this.navigations=new Hl(null),this.navigationId=0,this.isNgZoneEnabled=!1,this.events=new D,this.errorHandler=Eh,this.malformedUriErrorHandler=kh,this.navigated=!1,this.lastSuccessfulId=-1,this.hooks={beforePreactivation:Ch,afterPreactivation:Ch},this.urlHandlingStrategy=new Sh,this.routeReuseStrategy=new bh,this.onSameUrlNavigation="ignore",this.paramsInheritanceStrategy="emptyOnly",this.urlUpdateStrategy="deferred",this.relativeLinkResolution="legacy",this.ngModule=i.get(Bt),this.console=i.get(Tt);var l=i.get(Kt);this.isNgZoneEnabled=l instanceof Kt,this.resetConfig(s),this.currentUrlTree=new nf(new rf([],{}),{},null),this.rawUrlTree=this.currentUrlTree,this.configLoader=new _h(o,a,function(e){return u.triggerEvent(new Nc(e))},function(e){return u.triggerEvent(new Rc(e))}),this.routerState=Ff(this.currentUrlTree,this.rootComponentType),this.processNavigations()}return e.prototype.resetRootComponentType=function(e){this.rootComponentType=e,this.routerState.root.component=this.rootComponentType},e.prototype.initialNavigation=function(){this.setUpLocationChangeListener(),0===this.navigationId&&this.navigateByUrl(this.location.path(!0),{replaceUrl:!0})},e.prototype.setUpLocationChangeListener=function(){var e=this;this.locationSubscription||(this.locationSubscription=this.location.subscribe(function(t){var n=e.parseUrl(t.url),r="popstate"===t.type?"popstate":"hashchange",i=t.state&&t.state.navigationId?{navigationId:t.state.navigationId}:null;setTimeout(function(){e.scheduleNavigation(n,r,i,{replaceUrl:!0})},0)}))},Object.defineProperty(e.prototype,"url",{get:function(){return this.serializeUrl(this.currentUrlTree)},enumerable:!0,configurable:!0}),e.prototype.triggerEvent=function(e){this.events.next(e)},e.prototype.resetConfig=function(e){Wc(e),this.config=e.map(Jc),this.navigated=!1,this.lastSuccessfulId=-1},e.prototype.ngOnDestroy=function(){this.dispose()},e.prototype.dispose=function(){this.locationSubscription&&(this.locationSubscription.unsubscribe(),this.locationSubscription=null)},e.prototype.createUrlTree=function(e,t){void 0===t&&(t={});var n=t.relativeTo,r=t.queryParams,i=t.fragment,a=t.preserveQueryParams,s=t.queryParamsHandling,u=t.preserveFragment;cn()&&a&&console&&console.warn&&console.warn("preserveQueryParams is deprecated, use queryParamsHandling instead.");var l=n||this.routerState.root,f=u?this.currentUrlTree.fragment:i,h=null;if(s)switch(s){case"merge":h=o({},this.currentUrlTree.queryParams,r);break;case"preserve":h=this.currentUrlTree.queryParams;break;default:h=r||null}else h=a?this.currentUrlTree.queryParams:r||null;return null!==h&&(h=this.removeEmptyProps(h)),function(e,t,n,r,i){if(0===n.length)return Qf(t.root,t.root,t,r,i);var o=function(e){if("string"==typeof e[0]&&1===e.length&&"/"===e[0])return new Yf(!0,0,e);var t=0,n=!1,r=e.reduce(function(e,r,i){if("object"==typeof r&&null!=r){if(r.outlets){var o={};return Zc(r.outlets,function(e,t){o[t]="string"==typeof e?e.split("/"):e}),c(e,[{outlets:o}])}if(r.segmentPath)return c(e,[r.segmentPath])}return"string"!=typeof r?c(e,[r]):0===i?(r.split("/").forEach(function(r,i){0==i&&"."===r||(0==i&&""===r?n=!0:".."===r?t++:""!=r&&e.push(r))}),e):c(e,[r])},[]);return new Yf(n,t,r)}(n);if(o.toRoot())return Qf(t.root,new rf([],{}),t,r,i);var a=function(e,n,r){if(e.isAbsolute)return new Zf(t.root,!0,0);if(-1===r.snapshot._lastPathIndex)return new Zf(r.snapshot._urlSegment,!0,0);var i=Kf(e.commands[0])?0:1;return function(t,n,o){for(var a=r.snapshot._urlSegment,s=r.snapshot._lastPathIndex+i,u=e.numberOfDoubleDots;u>s;){if(u-=s,!(a=a.parent))throw new Error("Invalid number of '../'");s=a.segments.length}return new Zf(a,!1,s-u)}()}(o,0,e),s=a.processChildren?th(a.segmentGroup,a.index,o.commands):eh(a.segmentGroup,a.index,o.commands);return Qf(a.segmentGroup,s,t,r,i)}(l,this.currentUrlTree,e,h,f)},e.prototype.navigateByUrl=function(e,t){void 0===t&&(t={skipLocationChange:!1}),cn()&&this.isNgZoneEnabled&&!Kt.isInAngularZone()&&this.console.warn("Navigation triggered outside Angular zone, did you forget to call 'ngZone.run()'?");var n=e instanceof nf?e:this.parseUrl(e),r=this.urlHandlingStrategy.merge(n,this.rawUrlTree);return this.scheduleNavigation(r,"imperative",null,t)},e.prototype.navigate=function(e,t){return void 0===t&&(t={skipLocationChange:!1}),function(e){for(var t=0;t0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]t.timeSent?1:e.timeSent.\n\n :message\n a schem:Message;\n schem:sender s:me;\n schem:text "'+e.message+'";\n schem:dateSent "'+e.timeSent.toISOString()+'".\n ',[4,this.getChatUrl(this.thisUser.value,this.otherUser)];case 1:return n=r.sent()+"message.ttl",gp.createFile(n).then(function(e){gp.updateFile(e,t).then(function(){console.log("Message has been sent successfully")},function(e){return console.log(e)})}),[2]}})})},e.prototype.changeChat=function(e){return mp(this,void 0,void 0,function(){var t=this;return yp(this,function(n){return this.isActive.next(!0),null===e?console.log("Trying to change to chat with a null user!"):(this.otherUser=e,this.checkFolderStructure().then(function(){t.loadMessages()})),[2]})})},e.prototype.addFriend=function(e){this.thisUser.value.webId!==e&&this.rdf.addFriend(e)},e.prototype.removeFriend=function(e){var t=this;this.thisUser.value.webId!==e&&(this.rdf.removeFriend(e),this.getChatUrl(this.thisUser.value,new dp(e,"","")).then(function(e){t.removeFolderStructure(e.toString())}))},e.prototype.removeFolderStructure=function(e){return mp(this,void 0,void 0,function(){return yp(this,function(t){return gp.deleteFolder(e).then(function(){console.log("Removed folder "+e+".")},function(e){return console.log(e)}),[2]})})},e.prototype.checkFolderStructure=function(){return mp(this,void 0,void 0,function(){var e=this;return yp(this,function(t){switch(t.label){case 0:return[4,this.rdf.getSession()];case 1:t.sent();try{this.getChatUrl(this.thisUser.value,this.otherUser).then(function(t){gp.readFolder(t).then(function(){console.log("Folder structure correct")},function(){console.log("Attempting to create: "+t),e.createFolderStructure(t).then(function(){console.log("Creating ACL file..."),e.grantAccessToFolder(t,e.otherUser)})})})}catch(n){console.log("Error creating folder structure/with permissions: "+n)}return[2]}})})},e.prototype.createFolderStructure=function(e){return mp(this,void 0,void 0,function(){var t;return yp(this,function(n){switch(n.label){case 0:return t=this.thisUser.value.webId.replace("/profile/card#me","/"),[4,gp.createFolder(t+"private/").then(function(){gp.createFolder(t+"private/dechat/").then(function(){gp.createFolder(e).then(function(){console.log("Folder structure created")},function(e){return console.log("Could not create folder structure: "+e)})},function(e){return console.log("Could not create folder structure: "+e)})},function(e){return console.log("Could not create folder structure: "+e)})];case 1:return n.sent(),[2]}})})},e.prototype.grantAccessToFolder=function(e,t){return mp(this,void 0,void 0,function(){var n,r;return yp(this,function(i){switch(i.label){case 0:return n=t.webId.replace("#me","#"),r="@prefix : <#>.\n @prefix n0: .\n @prefix ch: <./>.\n @prefix c: .\n @prefix c0: <"+n+">.\n\n :ControlReadWrite\n a n0:Authorization;\n n0:accessTo ch:;\n n0:agent c:me;\n n0:defaultForNew ch:;\n n0:mode n0:Control, n0:Read, n0:Write.\n :Read\n a n0:Authorization;\n n0:accessTo ch:;\n n0:agent c0:me;\n n0:defaultForNew ch:;\n n0:mode n0:Read.",e+=".acl",console.log(e),console.log(r),[4,gp.updateFile(e,r).then(function(){console.log("Folder permisions added")},function(e){return console.log("Could not set folder permisions"+e)})];case 1:return i.sent(),[2]}})})},e}(),bp=function(){function e(e){var t=this;this.chat=e,this.active=!1,this.chat.isChatActive().subscribe(function(e){t.active=e})}return e.prototype.ngOnInit=function(){},e.prototype.scrollToBottom=function(){this.feedContainer.nativeElement.scrollTop=this.feedContainer.nativeElement.scrollHeight},e.prototype.ngAfterViewChecked=function(){this.scrollToBottom()},e}(),wp=function(){function e(e,t,n,r){this.chat=e,this.toastr=t,this.auth=n,this.sdv=r}return e.prototype.ngOnInit=function(){this.identityProviders=this.auth.getIdentityProviders()},e.prototype.addFriend=function(){if(this.webIdAddFriend)if(""===this.webIdAddFriend.trim())this.toastr.error("Please add a webId","Wrong input");else{var e=this.createWebId(this.selectedAddProviderUrl,this.webIdAddFriend,this.customAddProviderUrl);this.chat.addFriend(e.trim()),this.webIdAddFriend=""}else this.toastr.error("Please add a webId","Wrong input")},e.prototype.removeFriend=function(){if(this.webIdRemoveFriend)if(""===this.webIdRemoveFriend.trim())this.toastr.error("Please add a webId","Wrong input");else{var e=this.createWebId(this.selectedRemoveProviderUrl,this.webIdRemoveFriend,this.customRemoveProviderUrl);this.chat.removeFriend(e.trim()),this.webIdRemoveFriend=""}else this.toastr.error("Please add a webId","Wrong input")},e.prototype.handleSubmit=function(e){13===e.keyCode&&this.addFriend()},e.prototype.createWebId=function(e,t,n){return"https://solid.community"===e?"https://"+t+".solid.community/profile/card#me":"https://inrupt.net/auth"===e?"https://"+t+".inrupt.net/profile/card#me":"https://"+t+"."+n+"/profile/card#me"},e}(),_p=function(){function e(){}return e.prototype.ngOnInit=function(){},e}(),xp=function(){return function(){}}(),Sp=function(){return function(){this.title="SolidDechat"}}(),Ep=Yr({encapsulation:2,styles:[],data:{}});function kp(e){return qo(0,[(e()(),ki(0,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),po(1,212992,null,0,jh,[Rh,Pn,Ut,[8,null],An],null,null)],function(e,t){e(t,1,0)},null)}function Cp(e){return qo(0,[(e()(),ki(0,0,null,null,1,"ng-component",[],null,null,null,kp,Ep)),po(1,49152,null,0,Fc,[],null,null)],null,null)}var Tp=qi("ng-component",Fc,Cp,{},{},[]),Op=Yr({encapsulation:2,styles:[],data:{animation:[{type:7,name:"flyInOut",definitions:[{type:0,name:"inactive",styles:{type:6,styles:{opacity:0},offset:null},options:void 0},{type:0,name:"active",styles:{type:6,styles:{opacity:1},offset:null},options:void 0},{type:0,name:"removed",styles:{type:6,styles:{opacity:0},offset:null},options:void 0},{type:1,expr:"inactive => active",animation:{type:4,styles:null,timings:"{{ easeTime }}ms {{ easing }}"},options:null},{type:1,expr:"active => removed",animation:{type:4,styles:null,timings:"{{ easeTime }}ms {{ easing }}"},options:null}],options:{}}]}});function Ip(e){return qo(0,[(e()(),ki(0,0,null,null,2,"button",[["aria-label","Close"],["class","toast-close-button"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.remove()&&r),r},null,null)),(e()(),ki(1,0,null,null,1,"span",[["aria-hidden","true"]],null,null,null,null,null)),(e()(),Vo(-1,null,["\xd7"]))],null,null)}function Pp(e){return qo(0,[(e()(),ki(0,0,null,null,1,"div",[],[[8,"className",0],[1,"aria-label",0]],null,null,null,null)),(e()(),Vo(1,null,[" "," "]))],null,function(e,t){var n=t.component;e(t,0,0,n.options.titleClass,n.title),e(t,1,0,n.title)})}function Ap(e){return qo(0,[(e()(),ki(0,0,null,null,0,"div",[["aria-live","polite"],["role","alertdialog"]],[[8,"className",0],[8,"innerHTML",1]],null,null,null,null))],null,function(e,t){var n=t.component;e(t,0,0,n.options.messageClass,n.message)})}function Np(e){return qo(0,[(e()(),ki(0,0,null,null,1,"div",[["aria-live","polite"],["role","alertdialog"]],[[8,"className",0],[1,"aria-label",0]],null,null,null,null)),(e()(),Vo(1,null,[" "," "]))],null,function(e,t){var n=t.component;e(t,0,0,n.options.messageClass,n.message),e(t,1,0,n.message)})}function Rp(e){return qo(0,[(e()(),ki(0,0,null,null,1,"div",[],null,null,null,null,null)),(e()(),ki(1,0,null,null,0,"div",[["class","toast-progress"]],[[4,"width",null]],null,null,null,null))],null,function(e,t){e(t,1,0,t.component.width+"%")})}function jp(e){return qo(0,[(e()(),Ei(16777216,null,null,1,null,Ip)),po(1,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,null,1,null,Pp)),po(3,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,null,1,null,Ap)),po(5,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,null,1,null,Np)),po(7,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,null,1,null,Rp)),po(9,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,1,0,n.options.closeButton),e(t,3,0,n.title),e(t,5,0,n.message&&n.options.enableHtml),e(t,7,0,n.message&&!n.options.enableHtml),e(t,9,0,n.options.progressBar)},null)}function Dp(e){return qo(0,[(e()(),ki(0,0,null,null,1,"div",[["toast-component",""]],[[8,"className",0],[40,"@flyInOut",0],[4,"display",null]],[[null,"click"],[null,"mouseenter"],[null,"mouseleave"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==eo(e,1).tapToast()&&r),"mouseenter"===t&&(r=!1!==eo(e,1).stickAround()&&r),"mouseleave"===t&&(r=!1!==eo(e,1).delayedHideToast()&&r),r},jp,Op)),po(1,180224,null,0,Ol,[Tl,yl,Kt],null,null)],null,function(e,t){e(t,0,0,eo(t,1).toastClasses,eo(t,1).state,eo(t,1).displayStyle)})}var Mp=qi("[toast-component]",Ol,Dp,{},{},[]),Lp=function(e){function t(t,n){var r=e.call(this,t)||this;r.sources=n,r.completed=0,r.haveValues=0;var i=n.length;r.values=new Array(i);for(var o=0;oe?{max:{max:e,actual:t.value}}:null}},e.required=function(e){return Vp(e.value)?{required:!0}:null},e.requiredTrue=function(e){return!0===e.value?null:{required:!0}},e.email=function(e){return Vp(e.value)?null:Bp.test(e.value)?null:{email:!0}},e.minLength=function(e){return function(t){if(Vp(t.value))return null;var n=t.value?t.value.length:0;return ne?{maxlength:{requiredLength:e,actualLength:n}}:null}},e.pattern=function(t){return t?("string"==typeof t?(r="","^"!==t.charAt(0)&&(r+="^"),r+=t,"$"!==t.charAt(t.length-1)&&(r+="$"),n=new RegExp(r)):(r=t.toString(),n=t),function(e){if(Vp(e.value))return null;var t=e.value;return n.test(t)?null:{pattern:{requiredPattern:r,actualValue:t}}}):e.nullValidator;var n,r},e.nullValidator=function(e){return null},e.compose=function(e){if(!e)return null;var t=e.filter(qp);return 0==t.length?null:function(e){return Wp(function(e,n){return t.map(function(t){return t(e)})}(e))}},e.composeAsync=function(e){if(!e)return null;var t=e.filter(qp);return 0==t.length?null:function(e){return function e(){for(var t,n=[],r=0;r=0;--t)if(this._accessors[t][1]===e)return void this._accessors.splice(t,1)},e.prototype.select=function(e){var t=this;this._accessors.forEach(function(n){t._isSameGroup(n,e)&&n[1]!==e&&n[1].fireUncheck(e.value)})},e.prototype._isSameGroup=function(e,t){return!!e[0].control&&e[0]._parent===t._control._parent&&e[1].name===t.name},e}(),nd=function(){function e(e,t,n,r){this._renderer=e,this._elementRef=t,this._registry=n,this._injector=r,this.onChange=function(){},this.onTouched=function(){}}return e.prototype.ngOnInit=function(){this._control=this._injector.get(ed),this._checkName(),this._registry.add(this._control,this)},e.prototype.ngOnDestroy=function(){this._registry.remove(this)},e.prototype.writeValue=function(e){this._state=e===this.value,this._renderer.setProperty(this._elementRef.nativeElement,"checked",this._state)},e.prototype.registerOnChange=function(e){var t=this;this._fn=e,this.onChange=function(){e(t.value),t._registry.select(t)}},e.prototype.fireUncheck=function(e){this.writeValue(e)},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)},e.prototype._checkName=function(){this.name&&this.formControlName&&this.name!==this.formControlName&&this._throwNameError(),!this.name&&this.formControlName&&(this.name=this.formControlName)},e.prototype._throwNameError=function(){throw new Error('\n If you define both a name and a formControlName attribute on your radio button, their values\n must match. Ex: \n ')},e}(),rd='\n

\n
\n \n
\n
\n\n In your class:\n\n this.myGroup = new FormGroup({\n person: new FormGroup({ firstName: new FormControl() })\n });',id='\n
\n
\n \n
\n
';function od(e,t){return c(t.path,[e])}function ad(e,t){e||ud(t,"Cannot find control with"),t.valueAccessor||ud(t,"No value accessor for form control with"),e.validator=zp.compose([e.validator,t.validator]),e.asyncValidator=zp.composeAsync([e.asyncValidator,t.asyncValidator]),t.valueAccessor.writeValue(e.value),function(e,t){t.valueAccessor.registerOnChange(function(n){e._pendingValue=n,e._pendingChange=!0,e._pendingDirty=!0,"change"===e.updateOn&&sd(e,t)})}(e,t),function(e,t){e.registerOnChange(function(e,n){t.valueAccessor.writeValue(e),n&&t.viewToModelUpdate(e)})}(e,t),function(e,t){t.valueAccessor.registerOnTouched(function(){e._pendingTouched=!0,"blur"===e.updateOn&&e._pendingChange&&sd(e,t),"submit"!==e.updateOn&&e.markAsTouched()})}(e,t),t.valueAccessor.setDisabledState&&e.registerOnDisabledChange(function(e){t.valueAccessor.setDisabledState(e)}),t._rawValidators.forEach(function(t){t.registerOnValidatorChange&&t.registerOnValidatorChange(function(){return e.updateValueAndValidity()})}),t._rawAsyncValidators.forEach(function(t){t.registerOnValidatorChange&&t.registerOnValidatorChange(function(){return e.updateValueAndValidity()})})}function sd(e,t){e._pendingDirty&&e.markAsDirty(),e.setValue(e._pendingValue,{emitModelToViewChange:!1}),t.viewToModelUpdate(e._pendingValue),e._pendingChange=!1}function ud(e,t){var n;throw n=e.path.length>1?"path: '"+e.path.join(" -> ")+"'":e.path[0]?"name: '"+e.path+"'":"unspecified name attribute",new Error(t+" "+n)}function ld(e){return null!=e?zp.compose(e.map(Qp)):null}function cd(e){return null!=e?zp.composeAsync(e.map(Yp)):null}var fd=[Gp,function(){function e(e,t){this._renderer=e,this._elementRef=t,this.onChange=function(e){},this.onTouched=function(){}}return e.prototype.writeValue=function(e){this._renderer.setProperty(this._elementRef.nativeElement,"value",parseFloat(e))},e.prototype.registerOnChange=function(e){this.onChange=function(t){e(""==t?null:parseFloat(t))}},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)},e}(),Zp,function(){function e(e,t){this._renderer=e,this._elementRef=t,this._optionMap=new Map,this._idCounter=0,this.onChange=function(e){},this.onTouched=function(){},this._compareWith=Ae}return Object.defineProperty(e.prototype,"compareWith",{set:function(e){if("function"!=typeof e)throw new Error("compareWith must be a function, but received "+JSON.stringify(e));this._compareWith=e},enumerable:!0,configurable:!0}),e.prototype.writeValue=function(e){this.value=e;var t=this._getOptionId(e);null==t&&this._renderer.setProperty(this._elementRef.nativeElement,"selectedIndex",-1);var n=function(e,t){return null==e?""+t:(t&&"object"==typeof t&&(t="Object"),(e+": "+t).slice(0,50))}(t,e);this._renderer.setProperty(this._elementRef.nativeElement,"value",n)},e.prototype.registerOnChange=function(e){var t=this;this.onChange=function(n){t.value=t._getOptionValue(n),e(t.value)}},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this._renderer.setProperty(this._elementRef.nativeElement,"disabled",e)},e.prototype._registerOption=function(){return(this._idCounter++).toString()},e.prototype._getOptionId=function(e){var t,n;try{for(var r=u(Array.from(this._optionMap.keys())),i=r.next();!i.done;i=r.next()){var o=i.value;if(this._compareWith(this._optionMap.get(o),e))return o}}catch(a){t={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return null},e.prototype._getOptionValue=function(e){var t=function(e){return e.split(":")[0]}(e);return this._optionMap.has(t)?this._optionMap.get(t):e},e}(),function(){function e(e,t){this._renderer=e,this._elementRef=t,this._optionMap=new Map,this._idCounter=0,this.onChange=function(e){},this.onTouched=function(){},this._compareWith=Ae}return Object.defineProperty(e.prototype,"compareWith",{set:function(e){if("function"!=typeof e)throw new Error("compareWith must be a function, but received "+JSON.stringify(e));this._compareWith=e},enumerable:!0,configurable:!0}),e.prototype.writeValue=function(e){var t,n=this;if(this.value=e,Array.isArray(e)){var r=e.map(function(e){return n._getOptionId(e)});t=function(e,t){e._setSelected(r.indexOf(t.toString())>-1)}}else t=function(e,t){e._setSelected(!1)};this._optionMap.forEach(t)},e.prototype.registerOnChange=function(e){var t=this;this.onChange=function(n){var r=[];if(n.hasOwnProperty("selectedOptions"))for(var i=n.selectedOptions,o=0;o0||this.disabled},t.prototype._checkAllValuesPresent=function(e){this._forEachChild(function(t,n){if(void 0===e[n])throw new Error("Must supply a value for form control with name: '"+n+"'.")})},t}(bd),xd=function(e){function t(t,n,r){var i=e.call(this,md(n),yd(r,n))||this;return i.controls=t,i._initObservables(),i._setUpdateStrategy(n),i._setUpControls(),i.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),i}return i(t,e),t.prototype.at=function(e){return this.controls[e]},t.prototype.push=function(e){this.controls.push(e),this._registerControl(e),this.updateValueAndValidity(),this._onCollectionChange()},t.prototype.insert=function(e,t){this.controls.splice(e,0,t),this._registerControl(t),this.updateValueAndValidity()},t.prototype.removeAt=function(e){this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),this.controls.splice(e,1),this.updateValueAndValidity()},t.prototype.setControl=function(e,t){this.controls[e]&&this.controls[e]._registerOnCollectionChange(function(){}),this.controls.splice(e,1),t&&(this.controls.splice(e,0,t),this._registerControl(t)),this.updateValueAndValidity(),this._onCollectionChange()},Object.defineProperty(t.prototype,"length",{get:function(){return this.controls.length},enumerable:!0,configurable:!0}),t.prototype.setValue=function(e,t){var n=this;void 0===t&&(t={}),this._checkAllValuesPresent(e),e.forEach(function(e,r){n._throwIfControlMissing(r),n.at(r).setValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)},t.prototype.patchValue=function(e,t){var n=this;void 0===t&&(t={}),e.forEach(function(e,r){n.at(r)&&n.at(r).patchValue(e,{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)},t.prototype.reset=function(e,t){void 0===e&&(e=[]),void 0===t&&(t={}),this._forEachChild(function(n,r){n.reset(e[r],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t),this._updatePristine(t),this._updateTouched(t)},t.prototype.getRawValue=function(){return this.controls.map(function(e){return e instanceof wd?e.value:e.getRawValue()})},t.prototype._syncPendingControls=function(){var e=this.controls.reduce(function(e,t){return!!t._syncPendingControls()||e},!1);return e&&this.updateValueAndValidity({onlySelf:!0}),e},t.prototype._throwIfControlMissing=function(e){if(!this.controls.length)throw new Error("\n There are no form controls registered with this array yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.at(e))throw new Error("Cannot find form control at index "+e)},t.prototype._forEachChild=function(e){this.controls.forEach(function(t,n){e(t,n)})},t.prototype._updateValue=function(){var e=this;this.value=this.controls.filter(function(t){return t.enabled||e.disabled}).map(function(e){return e.value})},t.prototype._anyControls=function(e){return this.controls.some(function(t){return t.enabled&&e(t)})},t.prototype._setUpControls=function(){var e=this;this._forEachChild(function(t){return e._registerControl(t)})},t.prototype._checkAllValuesPresent=function(e){this._forEachChild(function(t,n){if(void 0===e[n])throw new Error("Must supply a value for form control at index: "+n+".")})},t.prototype._allControlsDisabled=function(){var e,t;try{for(var n=u(this.controls),r=n.next();!r.done;r=n.next())if(r.value.enabled)return!1}catch(i){e={error:i}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}return this.controls.length>0||this.disabled},t.prototype._registerControl=function(e){e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)},t}(bd),Sd=Promise.resolve(null),Ed=function(e){function t(t,n){var r=e.call(this)||this;return r.submitted=!1,r._directives=[],r.ngSubmit=new Jt,r.form=new _d({},ld(t),cd(n)),r}return i(t,e),t.prototype.ngAfterViewInit=function(){this._setUpdateStrategy()},Object.defineProperty(t.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"controls",{get:function(){return this.form.controls},enumerable:!0,configurable:!0}),t.prototype.addControl=function(e){var t=this;Sd.then(function(){var n=t._findContainer(e.path);e.control=n.registerControl(e.name,e.control),ad(e.control,e),e.control.updateValueAndValidity({emitEvent:!1}),t._directives.push(e)})},t.prototype.getControl=function(e){return this.form.get(e.path)},t.prototype.removeControl=function(e){var t=this;Sd.then(function(){var n,r,i=t._findContainer(e.path);i&&i.removeControl(e.name),(r=(n=t._directives).indexOf(e))>-1&&n.splice(r,1)})},t.prototype.addFormGroup=function(e){var t=this;Sd.then(function(){var n=t._findContainer(e.path),r=new _d({});(function(e,t){null==e&&ud(t,"Cannot find control with"),e.validator=zp.compose([e.validator,t.validator]),e.asyncValidator=zp.composeAsync([e.asyncValidator,t.asyncValidator])})(r,e),n.registerControl(e.name,r),r.updateValueAndValidity({emitEvent:!1})})},t.prototype.removeFormGroup=function(e){var t=this;Sd.then(function(){var n=t._findContainer(e.path);n&&n.removeControl(e.name)})},t.prototype.getFormGroup=function(e){return this.form.get(e.path)},t.prototype.updateModel=function(e,t){var n=this;Sd.then(function(){n.form.get(e.path).setValue(t)})},t.prototype.setValue=function(e){this.control.setValue(e)},t.prototype.onSubmit=function(e){return this.submitted=!0,t=this._directives,this.form._syncPendingControls(),t.forEach(function(e){var t=e.control;"submit"===t.updateOn&&t._pendingChange&&(e.viewToModelUpdate(t._pendingValue),t._pendingChange=!1)}),this.ngSubmit.emit(e),!1;var t},t.prototype.onReset=function(){this.resetForm()},t.prototype.resetForm=function(e){void 0===e&&(e=void 0),this.form.reset(e),this.submitted=!1},t.prototype._setUpdateStrategy=function(){this.options&&null!=this.options.updateOn&&(this.form._updateOn=this.options.updateOn)},t.prototype._findContainer=function(e){return e.pop(),e.length?this.form.get(e):this.form},t}(Fp),kd=function(){function e(){}return e.modelParentException=function(){throw new Error('\n ngModel cannot be used to register form controls with a parent formGroup directive. Try using\n formGroup\'s partner directive "formControlName" instead. Example:\n\n \n
\n \n
\n\n In your class:\n\n this.myGroup = new FormGroup({\n firstName: new FormControl()\n });\n\n Or, if you\'d like to avoid registering this form control, indicate that it\'s standalone in ngModelOptions:\n\n Example:\n\n \n
\n \n \n
\n ')},e.formGroupNameException=function(){throw new Error("\n ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive.\n\n Option 1: Use formControlName instead of ngModel (reactive strategy):\n\n "+rd+"\n\n Option 2: Update ngModel's parent be ngModelGroup (template-driven strategy):\n\n "+id)},e.missingNameException=function(){throw new Error('If ngModel is used within a form tag, either the name attribute must be set or the form\n control must be defined as \'standalone\' in ngModelOptions.\n\n Example 1: \n Example 2: ')},e.modelGroupParentException=function(){throw new Error("\n ngModelGroup cannot be used with a parent formGroup directive.\n\n Option 1: Use formGroupName instead of ngModelGroup (reactive strategy):\n\n "+rd+"\n\n Option 2: Use a regular form tag instead of the formGroup directive (template-driven strategy):\n\n "+id)},e}(),Cd=function(e){function t(t,n,r){var i=e.call(this)||this;return i._parent=t,i._validators=n,i._asyncValidators=r,i}var n;return i(t,e),n=t,t.prototype._checkParentType=function(){this._parent instanceof n||this._parent instanceof Ed||kd.modelGroupParentException()},t}(hd),Td=Promise.resolve(null),Od=function(e){function t(t,n,r,i){var o=e.call(this)||this;return o.control=new wd,o._registered=!1,o.update=new Jt,o._parent=t,o._rawValidators=n||[],o._rawAsyncValidators=r||[],o.valueAccessor=function(e,t){if(!t)return null;Array.isArray(t)||ud(e,"Value accessor was not provided as an array for form control with");var n=void 0,r=void 0,i=void 0;return t.forEach(function(t){var o;t.constructor===Kp?n=t:(o=t,fd.some(function(e){return o.constructor===e})?(r&&ud(e,"More than one built-in value accessor matches form control with"),r=t):(i&&ud(e,"More than one custom value accessor matches form control with"),i=t))}),i||r||n||(ud(e,"No valid value accessor for form control with"),null)}(o,i),o}return i(t,e),t.prototype.ngOnChanges=function(e){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in e&&this._updateDisabled(e),function(e,t){if(!e.hasOwnProperty("model"))return!1;var n=e.model;return!!n.isFirstChange()||!Ae(t,n.currentValue)}(e,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)},t.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeControl(this)},Object.defineProperty(t.prototype,"path",{get:function(){return this._parent?od(this.name,this._parent):[this.name]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"validator",{get:function(){return ld(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"asyncValidator",{get:function(){return cd(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),t.prototype.viewToModelUpdate=function(e){this.viewModel=e,this.update.emit(e)},t.prototype._setUpControl=function(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0},t.prototype._setUpdateStrategy=function(){this.options&&null!=this.options.updateOn&&(this.control._updateOn=this.options.updateOn)},t.prototype._isStandalone=function(){return!this._parent||!(!this.options||!this.options.standalone)},t.prototype._setUpStandalone=function(){ad(this.control,this),this.control.updateValueAndValidity({emitEvent:!1})},t.prototype._checkForErrors=function(){this._isStandalone()||this._checkParentType(),this._checkName()},t.prototype._checkParentType=function(){!(this._parent instanceof Cd)&&this._parent instanceof hd?kd.formGroupNameException():this._parent instanceof Cd||this._parent instanceof Ed||kd.modelParentException()},t.prototype._checkName=function(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()||this.name||kd.missingNameException()},t.prototype._updateValue=function(e){var t=this;Td.then(function(){t.control.setValue(e,{emitViewToModelChange:!1})})},t.prototype._updateDisabled=function(e){var t=this,n=e.isDisabled.currentValue,r=""===n||n&&"false"!==n;Td.then(function(){r&&!t.control.disabled?t.control.disable():!r&&t.control.disabled&&t.control.enable()})},t}(ed),Id=function(){return function(){}}(),Pd=function(){return function(){}}(),Ad=function(){return function(){}}();function Nd(e){return function(t){return t.lift(new Rd(e))}}var Rd=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){var n=new jd(e),r=J(n,this.notifier);return r&&!n.seenValue?(n.add(r),t.subscribe(n)):n},e}(),jd=function(e){function t(t){var n=e.call(this,t)||this;return n.seenValue=!1,n}return i(t,e),t.prototype.notifyNext=function(e,t,n,r,i){this.seenValue=!0,this.complete()},t.prototype.notifyComplete=function(){},t}(K),Dd=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return i(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(r,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return t;clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n=!1,r=void 0;try{this.work(e)}catch(i){n=!0,r=!!i&&i||new Error(i)}if(n)return this.unsubscribe(),r},t.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,n=t.actions,r=n.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},t}(function(e){function t(t,n){return e.call(this)||this}return i(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(m)),Md=function(){function e(t,n){void 0===n&&(n=e.now),this.SchedulerAction=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(n,t)},e.now=function(){return Date.now()},e}(),Ld=new(function(e){function t(n,r){void 0===r&&(r=Md.now);var i=e.call(this,n,function(){return t.delegate&&t.delegate!==i?t.delegate.now():r()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return i(t,e),t.prototype.schedule=function(n,r,i){return void 0===r&&(r=0),t.delegate&&t.delegate!==this?t.delegate.schedule(n,r,i):e.prototype.schedule.call(this,n,r,i)},t.prototype.flush=function(e){var t=this.actions;if(this.active)t.push(e);else{var n;this.active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(Md))(Dd),Ud=function(){function e(e,t){this.dueTime=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new Fd(e,this.dueTime,this.scheduler))},e}(),Fd=function(e){function t(t,n,r){var i=e.call(this,t)||this;return i.dueTime=n,i.scheduler=r,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return i(t,e),t.prototype._next=function(e){this.clearDebounce(),this.lastValue=e,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Vd,this.dueTime,this))},t.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},t.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var e=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(e)}},t.prototype.clearDebounce=function(){var e=this.debouncedSubscription;null!==e&&(this.remove(e),e.unsubscribe(),this.debouncedSubscription=null)},t}(S);function Vd(e){e.debouncedNext()}function Bd(e,t,n,r){return p(n)&&(r=n,n=void 0),r?Bd(e,t,n).pipe(Q(function(e){return f(e)?r.apply(void 0,e):r(e)})):new I(function(r){!function e(t,n,r,i,o){var a;if(function(e){return e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener}(t)){var s=t;t.addEventListener(n,r,o),a=function(){return s.removeEventListener(n,r,o)}}else if(function(e){return e&&"function"==typeof e.on&&"function"==typeof e.off}(t)){var u=t;t.on(n,r),a=function(){return u.off(n,r)}}else if(function(e){return e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener}(t)){var l=t;t.addListener(n,r),a=function(){return l.removeListener(n,r)}}else{if(!t||!t.length)throw new TypeError("Invalid event target");for(var c=0,f=t.length;c1?Array.prototype.slice.call(arguments):e)},r,n)})}var zd=function(){return function(e){this.template=e}}(),qd=function(){function e(){}return e.prototype.warn=function(e){console.warn(e)},e.ngInjectableDef=de({factory:function(){return new e},token:e,providedIn:"root"}),e}();function Hd(e){return null!=e}function Wd(e){return"object"==typeof e&&Hd(e)}function $d(e){return e instanceof Function}var Gd={"\u24b6":"A","\uff21":"A","\xc0":"A","\xc1":"A","\xc2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\xc3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A","\xc4":"A","\u01de":"A","\u1ea2":"A","\xc5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A","\ua732":"AA","\xc6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\xc7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D","\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\xc8":"E","\xc9":"E","\xca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\xcb":"E","\u1eba":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F","\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H","\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\xcc":"I","\xcd":"I","\xce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\xcf":"I","\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K","\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L","\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\xd1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N","\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\xd2":"O","\xd3":"O","\xd4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O","\xd5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\xd6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O","\u1ed8":"O","\u01ea":"O","\u01ec":"O","\xd8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P","\u1e54":"P","\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R","\ua75a":"R","\ua7a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S","\u0218":"S","\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\xd9":"U","\xda":"U","\xdb":"U","\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\xdc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U","\u0214":"U","\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W","\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\xdd":"Y","\u0176":"Y","\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a","\u1e9a":"a","\xe0":"a","\xe1":"a","\xe2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\xe3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a","\u1eb3":"a","\u0227":"a","\u01e1":"a","\xe4":"a","\u01df":"a","\u1ea3":"a","\xe5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\xe6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av","\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\xe7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e","\xe8":"e","\xe9":"e","\xea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e","\xeb":"e","\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g","\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h","\u021f":"h","\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\xec":"i","\xed":"i","\xee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\xef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i","\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k","\u0137":"k","\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l","\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\xf1":"n","\u1e45":"n","\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\xf2":"o","\xf3":"o","\xf4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\xf5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o","\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\xf6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o","\u1edd":"o","\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\xf8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p","\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u0157":"r","\u1e5f":"r","\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\xdf":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s","\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t","\u0288":"t","\u2c66":"t","\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\xf9":"u","\xfa":"u","\xfb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\xfc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u","\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v","\u1e7d":"v","\u1e7f":"v","\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\xfd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y","\u1e8f":"y","\xff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f":"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z","\u017c":"z","\u017e":"z","\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038a":"\u0399","\u03aa":"\u0399","\u038c":"\u039f","\u038e":"\u03a5","\u03ab":"\u03a5","\u038f":"\u03a9","\u03ac":"\u03b1","\u03ad":"\u03b5","\u03ae":"\u03b7","\u03af":"\u03b9","\u03ca":"\u03b9","\u0390":"\u03b9","\u03cc":"\u03bf","\u03cd":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u03c9":"\u03c9","\u03c2":"\u03c3"};function Jd(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return Gd[e]||e})}function Kd(){return"axxxxxxxxxxx".replace(/[x]/g,function(e){return(16*Math.random()|0).toString(16)})}var Qd=function(){function e(e,t){this._ngSelect=e,this._selectionModel=t,this._items=[],this._filteredItems=[],this._markedIndex=-1}return Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filteredItems",{get:function(){return this._filteredItems},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"markedIndex",{get:function(){return this._markedIndex},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedItems",{get:function(){return this._selectionModel.value},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"markedItem",{get:function(){return this._filteredItems[this._markedIndex]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"noItemsToSelect",{get:function(){return this._ngSelect.hideSelected&&this._items.length===this.selectedItems.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxItemsSelected",{get:function(){return this._ngSelect.multiple&&this._ngSelect.maxSelectedItems<=this.selectedItems.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"lastSelectedItem",{get:function(){for(var e=this.selectedItems.length-1;e>=0;e--){var t=this.selectedItems[e];if(!t.disabled)return t}return null},enumerable:!0,configurable:!0}),e.prototype.setItems=function(e){var t=this;this._items=e.map(function(e,n){return t.mapItem(e,n)}),this._ngSelect.groupBy?(this._groups=this._groupBy(this._items,this._ngSelect.groupBy),this._items=this._flatten(this._groups)):(this._groups=new Map,this._groups.set(void 0,this._items)),this._filteredItems=c(this._items)},e.prototype.select=function(e){if(!e.selected&&!this.maxItemsSelected){var t=this._ngSelect.multiple;t||this.clearSelected(),this._selectionModel.select(e,t,this._ngSelect.selectableGroupAsModel),this._ngSelect.hideSelected&&this._hideSelected(e)}},e.prototype.unselect=function(e){e.selected&&(this._selectionModel.unselect(e,this._ngSelect.multiple),this._ngSelect.hideSelected&&Hd(e.index)&&this._ngSelect.multiple&&this._showSelected(e))},e.prototype.findItem=function(e){var t,n=this;return t=this._ngSelect.compareWith?function(t){return n._ngSelect.compareWith(t.value,e)}:this._ngSelect.bindValue?function(t){return!t.children&&n.resolveNested(t.value,n._ngSelect.bindValue)===e}:function(t){return t.value===e||!t.children&&t.label&&t.label===n.resolveNested(e,n._ngSelect.bindLabel)},this._items.find(function(e){return t(e)})},e.prototype.addItem=function(e){var t=this.mapItem(e,this._items.length);return this._items.push(t),this._filteredItems.push(t),t},e.prototype.clearSelected=function(e){void 0===e&&(e=!1),this._selectionModel.clear(e),this._items.forEach(function(t){t.selected=e&&t.selected&&t.disabled,t.marked=!1}),this._ngSelect.hideSelected&&this.resetFilteredItems()},e.prototype.findByLabel=function(e){return e=Jd(e).toLocaleLowerCase(),this.filteredItems.find(function(t){return Jd(t.label).toLocaleLowerCase().substr(0,e.length)===e})},e.prototype.filter=function(e){var t,n;if(e){this._filteredItems=[],e=this._ngSelect.searchFn?e:Jd(e).toLocaleLowerCase();var r=this._ngSelect.searchFn||this._defaultSearchFn,i=this._ngSelect.hideSelected,o=function(t){var n,o,s,f=[];try{for(var h=u(a._groups.get(t)),p=h.next();!p.done;p=h.next()){var d=p.value;i&&(d.parent&&d.parent.selected||d.selected)||r(e,a._ngSelect.searchFn?d.value:d)&&f.push(d)}}catch(y){n={error:y}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(n)throw n.error}}if(f.length>0){var g=l(f.slice(-1),1)[0];if(g.parent){var m=a._items.find(function(e){return e===g.parent});a._filteredItems.push(m)}(s=a._filteredItems).push.apply(s,c(f))}},a=this;try{for(var s=u(Array.from(this._groups.keys())),f=s.next();!f.done;f=s.next())o(f.value)}catch(h){t={error:h}}finally{try{f&&!f.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}}else this.resetFilteredItems()},e.prototype.resetFilteredItems=function(){this._filteredItems.length!==this._items.length&&(this._filteredItems=this._ngSelect.hideSelected&&this.selectedItems.length>0?this._items.filter(function(e){return!e.selected}):this._items)},e.prototype.unmarkItem=function(){this._markedIndex=-1},e.prototype.markNextItem=function(){this._stepToItem(1)},e.prototype.markPreviousItem=function(){this._stepToItem(-1)},e.prototype.markItem=function(e){this._markedIndex=this._filteredItems.indexOf(e)},e.prototype.markSelectedOrDefault=function(e){if(0!==this._filteredItems.length){var t=this._ngSelect.hideSelected?-1:this._filteredItems.indexOf(this.lastSelectedItem);this._markedIndex=this.lastSelectedItem&&t>-1?t:this._ngSelect.excludeGroupsFromDefaultSelection?e?this.filteredItems.findIndex(function(e){return!e.disabled&&!e.children}):-1:e?this.filteredItems.findIndex(function(e){return!e.disabled}):-1}},e.prototype.resolveNested=function(e,t){if(!Wd(e))return e;if(-1===t.indexOf("."))return e[t];for(var n=t.split("."),r=e,i=0,o=n.length;i-1},e.prototype._getNextItemIndex=function(e){return e>0?this._markedIndex===this._filteredItems.length-1?0:this._markedIndex+1:this._markedIndex<=0?this._filteredItems.length-1:this._markedIndex-1},e.prototype._stepToItem=function(e){0===this._filteredItems.length||this._filteredItems.every(function(e){return e.disabled})||(this._markedIndex=this._getNextItemIndex(e),this.markedItem.disabled&&this._stepToItem(e))},e.prototype._groupBy=function(e,t){var n,r,i,o,a=this,s=new Map;if(0===e.length)return s;if(Array.isArray(e[0].value[t])){try{for(var l=u(e),c=l.next();!c.done;c=l.next()){var f=((m=c.value).value[t]||[]).map(function(e,t){return a.mapItem(e,t)});s.set(m,f)}}catch(b){n={error:b}}finally{try{c&&!c.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}return s}var h=$d(this._ngSelect.groupBy),p=function(e){var n=h?t(e.value):e.value[t];return Hd(n)?n:void 0};try{for(var d=u(e),g=d.next();!g.done;g=d.next()){var m,y=p(m=g.value),v=s.get(y);v?v.push(m):s.set(y,[m])}}catch(w){i={error:w}}finally{try{g&&!g.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}return s},e.prototype._flatten=function(e){var t,n,r=$d(this._ngSelect.groupBy),i=[],o=e.get(void 0)||[];i.push.apply(i,c(o));var a=o.length,s=function(t){if(!Hd(t))return"continue";var n=Wd(t),o={label:n?"":t,children:void 0,parent:null,index:a++,disabled:!l._ngSelect.selectableGroup,htmlId:Kd()},s=r?l._ngSelect.bindLabel:l._ngSelect.groupBy,u=l._ngSelect.groupValue||function(){var e;return n?t.value:((e={})[s]=t,e)},f=e.get(t).map(function(e){return e.parent=o,e.children=void 0,e.index=a++,e});o.children=f,o.value=u(t,f.map(function(e){return e.value})),i.push(o),i.push.apply(i,c(f))},l=this;try{for(var f=u(Array.from(e.keys())),h=f.next();!h.done;h=f.next())s(h.value)}catch(p){t={error:p}}finally{try{h&&!h.done&&(n=f.return)&&n.call(f)}finally{if(t)throw t.error}}return i},e}(),Yd=function(){var e={Tab:9,Enter:13,Esc:27,Space:32,ArrowUp:38,ArrowDown:40,Backspace:8};return e[e.Tab]="Tab",e[e.Enter]="Enter",e[e.Esc]="Esc",e[e.Space]="Space",e[e.ArrowUp]="ArrowUp",e[e.ArrowDown]="ArrowDown",e[e.Backspace]="Backspace",e}(),Zd=function(){function e(){}return e.prototype.requestAnimationFrame=function(e){return window.requestAnimationFrame(e)},e.prototype.setTimeout=function(e,t){return window.setTimeout(e,t)},e.ngInjectableDef=de({factory:function(){return new e},token:e,providedIn:"root"}),e}(),Xd=function(){function e(){}return e.prototype.calculateItems=function(e,t,n){var r=e.childHeight*e.itemsLength;t.scrollTop>r&&(t.scrollTop=r);var i=Math.max(0,t.scrollTop)/r*e.itemsLength,o=Math.min(e.itemsLength,Math.ceil(i)+(e.itemsPerCol+1)),a=Math.max(0,o-e.itemsPerCol-1),s=Math.min(a,Math.floor(i)),u=e.childHeight*Math.ceil(s)-e.childHeight*Math.min(s,n);return u=isNaN(u)?0:u,s=isNaN(s)?-1:s,o=isNaN(o)?-1:o,s-=n,o+=n,{topPadding:u,scrollHeight:r,start:s=Math.max(0,s),end:o=Math.min(e.itemsLength,o)}},e.prototype.calculateDimensions=function(e,t,n,r){var i=n.getBoundingClientRect(),o=r.children[t]?r.children[t].getBoundingClientRect():{width:i.width,height:i.height,top:0},a=Math.max(1,Math.floor(i.height/o.height));return{itemsLength:e,viewWidth:i.width,viewHeight:i.height,childWidth:o.width,childHeight:o.height,itemsPerCol:a}},e.ngInjectableDef=de({factory:function(){return new e},token:e,providedIn:"root"}),e}(),eg=function(){function e(e,t,n,r,i,o){this._renderer=e,this._zone=t,this._virtualScrollService=n,this._window=r,this._document=o,this.items=[],this.position="auto",this.bufferAmount=4,this.virtualScroll=!1,this.filterValue=null,this.update=new Jt,this.scroll=new Jt,this.scrollToEnd=new Jt,this.outsideClick=new Jt,this._destroy$=new D,this._startupLoop=!0,this._isScrolledToMarked=!1,this._scrollToEndFired=!1,this._disposeScrollListener=function(){},this._disposeDocumentResizeListener=function(){},this._dropdown=i.nativeElement}return e.prototype.handleMousedown=function(e){"INPUT"!==e.target.tagName&&(e.preventDefault(),e.stopPropagation())},e.prototype.ngOnInit=function(){var e=this;this._select=this._dropdown.parentElement,this._handleScroll(),this._document&&ae(Bd(this._document,"touchstart",{capture:!0}),Bd(this._document,"mousedown",{capture:!0})).pipe(Nd(this._destroy$)).subscribe(function(t){return e._handleOutsideClick(t)})},e.prototype.ngOnChanges=function(e){e.items&&(this._isScrolledToMarked=!1,this._handleItemsChange(e.items))},e.prototype.ngOnDestroy=function(){this._disposeDocumentResizeListener(),this._disposeScrollListener(),this._destroy$.next(),this._destroy$.complete(),this._destroy$.unsubscribe(),this.appendTo&&this._renderer.removeChild(this._dropdown.parentNode,this._dropdown)},e.prototype.ngAfterContentInit=function(){var e=this;this._whenContentReady().then(function(){e._destroy$.closed||(e.appendTo&&(e._appendDropdown(),e._handleDocumentResize()),e.updateDropdownPosition())})},e.prototype.refresh=function(){var e=this;return new Promise(function(t){e._zone.runOutsideAngular(function(){e._window.requestAnimationFrame(function(){e._updateItems().then(t)})})})},e.prototype.scrollInto=function(e){if(e){var t=this.items.indexOf(e);if(!(t<0||t>=this.items.length)){var n=this._calculateDimensions(this.virtualScroll?0:t),r=this.scrollElementRef.nativeElement,i=Math.floor(n.viewHeight/n.childHeight)-1;if(this.virtualScroll)r.scrollTop=t*n.childHeight-n.childHeight*Math.min(t,i);else{var o=Array.from(this.contentElementRef.nativeElement.children).slice(0,t).reduce(function(e,t){return e+t.clientHeight},0);r.scrollTop=o-n.childHeight*Math.min(t,i)}}}},e.prototype.scrollIntoTag=function(){var e=this.scrollElementRef.nativeElement,t=this._calculateDimensions();e.scrollTop=t.childHeight*(t.itemsLength+1)},e.prototype.updateDropdownPosition=function(){var e=this;this._window.setTimeout(function(){e._currentPosition=e._calculateCurrentPosition(e._dropdown),"top"===e._currentPosition?(e._renderer.addClass(e._dropdown,"ng-select-top"),e._renderer.removeClass(e._dropdown,"ng-select-bottom"),e._renderer.addClass(e._select,"ng-select-top"),e._renderer.removeClass(e._select,"ng-select-bottom")):(e._renderer.addClass(e._dropdown,"ng-select-bottom"),e._renderer.removeClass(e._dropdown,"ng-select-top"),e._renderer.addClass(e._select,"ng-select-bottom"),e._renderer.removeClass(e._select,"ng-select-top")),e.appendTo&&e._updateAppendedDropdownPosition(),e._dropdown.style.opacity="1"},0)},e.prototype._handleOutsideClick=function(e){if(!this._select.contains(e.target)&&!this._dropdown.contains(e.target)){var t=e.path||e.composedPath&&e.composedPath();e.target&&e.target.shadowRoot&&t&&t[0]&&this._select.contains(t[0])||this.outsideClick.emit()}},e.prototype._handleScroll=function(){var e=this;this._disposeScrollListener=this._renderer.listen(this.scrollElementRef.nativeElement,"scroll",function(){e.refresh(),e._fireScrollToEnd()})},e.prototype._handleItemsChange=function(e){var t=this;this._scrollToEndFired=!1,this._previousStart=void 0,this._previousEnd=void 0,(void 0!==e&&void 0===e.previousValue||void 0!==e.previousValue&&0===e.previousValue.length)&&(this._startupLoop=!0),this.items=e.currentValue||[],this.refresh().then(function(){t.appendTo&&"top"===t._currentPosition&&t._updateAppendedDropdownPosition()})},e.prototype._updateItems=function(){var e=this;if(Kt.assertNotInAngularZone(),!this.virtualScroll)return this._zone.run(function(){e.update.emit(e.items.slice()),e._scrollToMarked()}),Promise.resolve();var t=function(n){var r=e._calculateDimensions(),i=e._virtualScrollService.calculateItems(r,e.scrollElementRef.nativeElement,e.bufferAmount||0);e.paddingElementRef.nativeElement.style.height=i.scrollHeight+"px",e.contentElementRef.nativeElement.style.transform="translateY("+i.topPadding+"px)",i.start!==e._previousStart||i.end!==e._previousEnd?(e._zone.run(function(){e.update.emit(e.items.slice(i.start,i.end)),e.scroll.emit({start:i.start,end:i.end})}),e._previousStart=i.start,e._previousEnd=i.end,!0===e._startupLoop&&t(n)):!0===e._startupLoop&&(e._startupLoop=!1,e._scrollToMarked(),n())};return new Promise(function(e){return t(e)})},e.prototype._fireScrollToEnd=function(){this._scrollToEndFired||this.scrollElementRef.nativeElement.scrollTop+this._dropdown.clientHeight>=(this.virtualScroll?this.paddingElementRef.nativeElement:this.contentElementRef.nativeElement).clientHeight&&(this.scrollToEnd.emit(),this._scrollToEndFired=!0)},e.prototype._calculateDimensions=function(e){return void 0===e&&(e=0),this._virtualScrollService.calculateDimensions(this.items.length,e,this.scrollElementRef.nativeElement,this.contentElementRef.nativeElement)},e.prototype._handleDocumentResize=function(){var e=this;this.appendTo&&(this._disposeDocumentResizeListener=this._renderer.listen("window","resize",function(){e._updateAppendedDropdownPosition()}))},e.prototype._scrollToMarked=function(){!this._isScrolledToMarked&&this.markedItem&&(this._isScrolledToMarked=!0,this.scrollInto(this.markedItem))},e.prototype._calculateCurrentPosition=function(e){if("auto"!==this.position)return this.position;var t=this._select.getBoundingClientRect(),n=document.documentElement.scrollTop||document.body.scrollTop;return t.top+window.pageYOffset+t.height+e.getBoundingClientRect().height>n+document.documentElement.clientHeight?"top":"bottom"},e.prototype._appendDropdown=function(){var e=document.querySelector(this.appendTo);if(!e)throw new Error("appendTo selector "+this.appendTo+" did not found any parent element");e.appendChild(this._dropdown)},e.prototype._updateAppendedDropdownPosition=function(){var e=document.querySelector(this.appendTo)||document.body;this._dropdown.style.display="none";var t=this._select.getBoundingClientRect(),n=e.getBoundingClientRect();this._dropdown.style.display="";var r=t.left-n.left;this._dropdown.style.top=t.top-n.top+("bottom"===this._currentPosition?t.height:-this._dropdown.clientHeight)+"px",this._dropdown.style.bottom="auto",this._dropdown.style.left=r+"px",this._dropdown.style.width=t.width+"px",this._dropdown.style.minWidth=t.width+"px"},e.prototype._whenContentReady=function(){var e=this;if(0===this.items.length)return Promise.resolve();var t=function(n){e._dropdown.querySelector(".ng-option")?n():e._zone.runOutsideAngular(function(){setTimeout(function(){return t(n)},5)})};return new Promise(function(e){return t(e)})},e}(),tg=function(){function e(){this.notFoundText="No items found",this.typeToSearchText="Type to search",this.addTagText="Add item",this.loadingText="Loading...",this.clearAllText="Clear all",this.disableVirtualScroll=!0,this.openOnEnter=!0}return e.ngInjectableDef=de({factory:function(){return new e},token:e,providedIn:"root"}),e}(),ng=new ge("ng-select-selection-model"),rg=function(){function e(e,t,n,r,i,o,a,s){var u=this;this.classes=e,this.tabIndex=t,this.autoFocus=n,this._cd=a,this._console=s,this.clearable=!0,this.markFirst=!0,this.dropdownPosition="auto",this.loading=!1,this.closeOnSelect=!0,this.hideSelected=!1,this.selectOnTab=!1,this.bufferAmount=4,this.selectableGroup=!1,this.selectableGroupAsModel=!0,this.searchFn=null,this.excludeGroupsFromDefaultSelection=!1,this.clearOnBackspace=!0,this.labelForId=null,this.autoCorrect="off",this.autoCapitalize="off",this.multiple=!1,this.addTag=!1,this.searchable=!0,this.isOpen=!1,this.blurEvent=new Jt,this.focusEvent=new Jt,this.changeEvent=new Jt,this.openEvent=new Jt,this.closeEvent=new Jt,this.searchEvent=new Jt,this.clearEvent=new Jt,this.addEvent=new Jt,this.removeEvent=new Jt,this.scroll=new Jt,this.scrollToEnd=new Jt,this.disabled=!1,this.viewPortItems=[],this.filterValue=null,this.dropdownId=Kd(),this._items=[],this._defaultLabel="label",this._primitive=!0,this._pressedKeys=[],this._destroy$=new D,this._keyPress$=new D,this._onChange=function(e){},this._onTouched=function(){},this.clearItem=function(e){var t=u.selectedItems.find(function(t){return t.value===e});u.unselect(t)},this._mergeGlobalConfig(r),this.itemsList=new Qd(this,i()),this.element=o.nativeElement}return Object.defineProperty(e.prototype,"items",{get:function(){return this._items},set:function(e){this._itemsAreUsed=!0,this._items=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"compareWith",{get:function(){return this._compareWith},set:function(e){if(!$d(e))throw Error("`compareWith` must be a function.");this._compareWith=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clearSearchOnAdd",{get:function(){return Hd(this._clearSearchOnAdd)?this._clearSearchOnAdd:this.closeOnSelect},set:function(e){this._clearSearchOnAdd=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"filtered",{get:function(){return!!this.filterValue&&this.searchable},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedItems",{get:function(){return this.itemsList.selectedItems},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedValues",{get:function(){return this.selectedItems.map(function(e){return e.value})},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasValue",{get:function(){return this.selectedItems.length>0},enumerable:!0,configurable:!0}),e.prototype.ngOnInit=function(){this._handleKeyPresses()},e.prototype.ngOnChanges=function(e){e.multiple&&this.itemsList.clearSelected(),e.items&&this._setItems(e.items.currentValue||[]),e.isOpen&&(this._manualOpen=Hd(e.isOpen.currentValue))},e.prototype.ngAfterViewInit=function(){this._itemsAreUsed||this._setItemsFromNgOptions(),Hd(this.autoFocus)&&this.focus()},e.prototype.ngOnDestroy=function(){this._destroy$.next(),this._destroy$.complete()},e.prototype.handleKeyDown=function(e){if(Yd[e.which])switch(e.which){case Yd.ArrowDown:this._handleArrowDown(e);break;case Yd.ArrowUp:this._handleArrowUp(e);break;case Yd.Space:this._handleSpace(e);break;case Yd.Enter:this._handleEnter(e);break;case Yd.Tab:this._handleTab(e);break;case Yd.Esc:this.close(),e.preventDefault(),e.stopPropagation();break;case Yd.Backspace:this._handleBackspace()}else e.key&&1===e.key.length&&this._keyPress$.next(e.key.toLocaleLowerCase())},e.prototype.handleMousedown=function(e){var t=e.target;"INPUT"!==t.tagName&&e.preventDefault(),e.stopPropagation(),t.classList.contains("ng-clear-wrapper")?this.handleClearClick():t.classList.contains("ng-arrow-wrapper")?this.handleArrowClick():t.classList.contains("ng-value-icon")||(this.focused||this.focus(),this.searchable?this.open():this.toggle())},e.prototype.handleArrowClick=function(){this.isOpen?this.close():this.open()},e.prototype.handleClearClick=function(){this.hasValue&&(this.itemsList.clearSelected(!0),this._updateNgModel()),this._clearSearch(),this.focus(),this._isTypeahead&&this.typeahead.next(null),this.clearEvent.emit()},e.prototype.clearModel=function(){this.clearable&&(this.itemsList.clearSelected(),this._updateNgModel())},e.prototype.writeValue=function(e){this.itemsList.clearSelected(),this._handleWriteValue(e),this._cd.markForCheck()},e.prototype.registerOnChange=function(e){this._onChange=e},e.prototype.registerOnTouched=function(e){this._onTouched=e},e.prototype.setDisabledState=function(e){this.disabled=e,this._cd.markForCheck()},e.prototype.toggle=function(){this.isOpen?this.close():this.open()},e.prototype.open=function(){this.disabled||this.isOpen||this.itemsList.maxItemsSelected||this._manualOpen||(this._isTypeahead||this.addTag||!this.itemsList.noItemsToSelect)&&(this.isOpen=!0,this.itemsList.markSelectedOrDefault(this.markFirst),this.openEvent.emit(),this.filterValue||this.focus(),this.detectChanges())},e.prototype.close=function(){this.isOpen&&!this._manualOpen&&(this.isOpen=!1,this._clearSearch(),this._onTouched(),this.closeEvent.emit(),this._cd.markForCheck())},e.prototype.toggleItem=function(e){!e||e.disabled||this.disabled||(this.multiple&&e.selected?this.unselect(e):this.select(e))},e.prototype.select=function(e){e.selected||(this.itemsList.select(e),this.clearSearchOnAdd&&this._clearSearch(),this.multiple&&this.addEvent.emit(e.value),this._updateNgModel()),(this.closeOnSelect||this.itemsList.noItemsToSelect)&&this.close()},e.prototype.focus=function(){this.filterInput.nativeElement.focus()},e.prototype.unselect=function(e){e&&(this.itemsList.unselect(e),this.focus(),this._updateNgModel(),this.removeEvent.emit(e))},e.prototype.selectTag=function(){var e,t,n=this;t=$d(this.addTag)?this.addTag(this.filterValue):this._primitive?this.filterValue:((e={})[this.bindLabel]=this.filterValue,e);var r=function(e){return n._isTypeahead||!n.isOpen?n.itemsList.mapItem(e,null):n.itemsList.addItem(e)};t instanceof Promise?t.then(function(e){return n.select(r(e))}).catch(function(){}):t&&this.select(r(t))},e.prototype.showClear=function(){return this.clearable&&(this.hasValue||this.filterValue)&&!this.disabled},Object.defineProperty(e.prototype,"showAddTag",{get:function(){if(!this.filterValue)return!1;var e=this.filterValue.toLowerCase();return this.addTag&&!this.itemsList.filteredItems.some(function(t){return t.label.toLowerCase()===e})&&(!this.hideSelected&&this.isOpen||!this.selectedItems.some(function(t){return t.label.toLowerCase()===e}))&&!this.loading},enumerable:!0,configurable:!0}),e.prototype.showNoItemsFound=function(){var e=0===this.itemsList.filteredItems.length;return(e&&!this._isTypeahead&&!this.loading||e&&this._isTypeahead&&this.filterValue&&!this.loading)&&!this.showAddTag},e.prototype.showTypeToSearch=function(){return 0===this.itemsList.filteredItems.length&&this._isTypeahead&&!this.filterValue&&!this.loading},e.prototype.filter=function(e){this.filterValue=e,this._isTypeahead?this.typeahead.next(this.filterValue):(this.itemsList.filter(this.filterValue),this.isOpen&&this.itemsList.markSelectedOrDefault(this.markFirst)),this.searchEvent.emit({term:e,items:this.itemsList.filteredItems.map(function(e){return e.value})}),this.open()},e.prototype.onInputFocus=function(e){this.focused||(this.element.classList.add("ng-select-focused"),this.focusEvent.emit(e),this.focused=!0)},e.prototype.onInputBlur=function(e){this.element.classList.remove("ng-select-focused"),this.blurEvent.emit(e),this.isOpen||this.disabled||this._onTouched(),this.focused=!1},e.prototype.onItemHover=function(e){e.disabled||this.itemsList.markItem(e)},e.prototype.detectChanges=function(){this._cd.destroyed||this._cd.detectChanges()},e.prototype.updateDropdownPosition=function(){this.dropdownPanel&&this.dropdownPanel.updateDropdownPosition()},e.prototype._setItems=function(e){var t=e[0];this.bindLabel=this.bindLabel||this._defaultLabel,this._primitive=Hd(t)?!Wd(t):this._primitive,this.itemsList.setItems(e),e.length>0&&this.hasValue&&this.itemsList.mapSelectedItems(),this.isOpen&&Hd(this.filterValue)&&!this._isTypeahead&&this.itemsList.filter(this.filterValue),(this._isTypeahead||this.isOpen)&&this.itemsList.markSelectedOrDefault(this.markFirst)},e.prototype._setItemsFromNgOptions=function(){var e=this;this.ngOptions.changes.pipe(function(){for(var e=[],t=0;t0?X(e,n):Fl(n):Vl(e[0]),t)}}(this.ngOptions),Nd(this._destroy$)).subscribe(function(t){var n;e.bindLabel=e._defaultLabel,function(t){e.items=t.map(function(e){return{$ngOptionValue:e.value,$ngOptionLabel:e.elementRef.nativeElement.innerHTML,disabled:e.disabled}}),e.itemsList.setItems(e.items),e.hasValue&&e.itemsList.mapSelectedItems(),e.detectChanges()}(t),n=ae(e.ngOptions.changes,e._destroy$),ae.apply(void 0,c(e.ngOptions.map(function(e){return e.stateChange$}))).pipe(Nd(n)).subscribe(function(t){e.itemsList.findItem(t.value).disabled=t.disabled,e._cd.markForCheck()})})},e.prototype._isValidWriteValue=function(e){var t=this;if(!Hd(e)||this.multiple&&""===e||Array.isArray(e)&&0===e.length)return!1;var n=function(e){return!(!Hd(t.compareWith)&&Wd(e)&&t.bindValue&&(t._console.warn("Binding object("+JSON.stringify(e)+") with bindValue is not allowed."),1))};return this.multiple?Array.isArray(e)?e.every(function(e){return n(e)}):(this._console.warn("Multiple select ngModel should be array."),!1):n(e)},e.prototype._handleWriteValue=function(e){var t=this;if(this._isValidWriteValue(e)){var n=function(e){var n,r=t.itemsList.findItem(e);if(r)t.itemsList.select(r);else{var i=Wd(e);i||!i&&!t.bindValue?t.itemsList.select(t.itemsList.mapItem(e,null)):t.bindValue&&((n={})[t.bindLabel]=null,n[t.bindValue]=e,t.itemsList.select(t.itemsList.mapItem(r=n,null)))}};this.multiple?e.forEach(function(e){return n(e)}):n(e)}},e.prototype._handleKeyPresses=function(){var e,t=this;this.searchable||this._keyPress$.pipe(Nd(this._destroy$),ec(function(e){return t._pressedKeys.push(e)}),(void 0===e&&(e=Ld),function(t){return t.lift(new Ud(200,e))}),$l(function(){return t._pressedKeys.length>0}),Q(function(){return t._pressedKeys.join("")})).subscribe(function(e){var n=t.itemsList.findByLabel(e);n&&(t.isOpen?(t.itemsList.markItem(n),t._cd.markForCheck()):t.select(n)),t._pressedKeys=[]})},e.prototype._updateNgModel=function(){var e,t,n=[];try{for(var r=u(this.selectedItems),i=r.next();!i.done;i=r.next()){var o,a=i.value;if(this.bindValue)o=a.children?a.value[this.groupBy]:this.itemsList.resolveNested(a.value,this.bindValue),n.push(o);else n.push(a.value)}}catch(l){e={error:l}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}var s=this.selectedItems.map(function(e){return e.value});this.multiple?(this._onChange(n),this.changeEvent.emit(s)):(this._onChange(Hd(n[0])?n[0]:null),this.changeEvent.emit(s[0])),this._cd.markForCheck()},e.prototype._clearSearch=function(){this.filterValue&&(this.filterValue=null,this.itemsList.resetFilteredItems())},e.prototype._scrollToMarked=function(){this.isOpen&&this.dropdownPanel&&this.dropdownPanel.scrollInto(this.itemsList.markedItem)},e.prototype._scrollToTag=function(){this.isOpen&&this.dropdownPanel&&this.dropdownPanel.scrollIntoTag()},e.prototype._handleTab=function(e){this.isOpen&&(this.selectOnTab?this.itemsList.markedItem?(this.toggleItem(this.itemsList.markedItem),e.preventDefault()):this.showAddTag?(this.selectTag(),e.preventDefault()):this.close():this.close())},e.prototype._handleEnter=function(e){if(this.isOpen||this._manualOpen)this.itemsList.markedItem?this.toggleItem(this.itemsList.markedItem):this.showAddTag&&this.selectTag();else{if(!this.openOnEnter)return;this.open()}e.preventDefault(),e.stopPropagation()},e.prototype._handleSpace=function(e){this.isOpen||this._manualOpen||(this.open(),e.preventDefault())},e.prototype._handleArrowDown=function(e){this._nextItemIsTag(1)?(this.itemsList.unmarkItem(),this._scrollToTag()):(this.itemsList.markNextItem(),this._scrollToMarked()),this.open(),e.preventDefault()},e.prototype._handleArrowUp=function(e){this.isOpen&&(this._nextItemIsTag(-1)?(this.itemsList.unmarkItem(),this._scrollToTag()):(this.itemsList.markPreviousItem(),this._scrollToMarked()),e.preventDefault())},e.prototype._nextItemIsTag=function(e){var t=this.itemsList.markedIndex+e;return this.addTag&&this.filterValue&&this.itemsList.markedItem&&(t<0||t===this.itemsList.filteredItems.length)},e.prototype._handleBackspace=function(){!this.filterValue&&this.clearable&&this.clearOnBackspace&&this.hasValue&&(this.multiple?this.unselect(this.itemsList.lastSelectedItem):this.clearModel())},Object.defineProperty(e.prototype,"_isTypeahead",{get:function(){return this.typeahead&&this.typeahead.observers.length>0},enumerable:!0,configurable:!0}),e.prototype._mergeGlobalConfig=function(e){this.placeholder=this.placeholder||e.placeholder,this.notFoundText=this.notFoundText||e.notFoundText,this.typeToSearchText=this.typeToSearchText||e.typeToSearchText,this.addTagText=this.addTagText||e.addTagText,this.loadingText=this.loadingText||e.loadingText,this.clearAllText=this.clearAllText||e.clearAllText,this.virtualScroll=Hd(this.virtualScroll)?this.virtualScroll:!!Hd(e.disableVirtualScroll)&&!e.disableVirtualScroll,this.openOnEnter=Hd(this.openOnEnter)?this.openOnEnter:e.openOnEnter},e}();function ig(){return new og}var og=function(){function e(){this._selected=[]}return Object.defineProperty(e.prototype,"value",{get:function(){return this._selected},enumerable:!0,configurable:!0}),e.prototype.select=function(e,t,n){if(e.selected=!0,!n&&e.children||this._selected.push(e),t)if(e.parent){var r=e.parent.children.length,i=e.parent.children.filter(function(e){return e.selected}).length;e.parent.selected=r===i}else e.children&&(this._setChildrenSelectedState(e.children,!0),this._removeChildren(e),n||(this._selected=c(this._selected,e.children)))},e.prototype.unselect=function(e,t){var n;if(this._selected=this._selected.filter(function(t){return t!==e}),e.selected=!1,t)if(e.parent&&e.parent.selected){var r=e.parent.children;this._removeParent(e.parent),this._removeChildren(e.parent),(n=this._selected).push.apply(n,c(r.filter(function(t){return t!==e}))),e.parent.selected=!1}else e.children&&(this._setChildrenSelectedState(e.children,!1),this._removeChildren(e))},e.prototype.clear=function(e){this._selected=e?this._selected.filter(function(e){return e.disabled}):[]},e.prototype._setChildrenSelectedState=function(e,t){e.forEach(function(e){return e.selected=t})},e.prototype._removeChildren=function(e){this._selected=this._selected.filter(function(t){return t.parent!==e})},e.prototype._removeParent=function(e){this._selected=this._selected.filter(function(t){return t!==e})},e}(),ag=function(){return function(){}}(),sg=Yr({encapsulation:2,styles:[".ng-select{position:relative;display:block;box-sizing:border-box}.ng-select div,.ng-select input,.ng-select span{box-sizing:border-box}.ng-select [hidden]{display:none}.ng-select.ng-select-searchable .ng-select-container .ng-value-container .ng-input{opacity:1}.ng-select.ng-select-opened .ng-select-container{z-index:1001}.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-placeholder,.ng-select.ng-select-disabled .ng-select-container .ng-value-container .ng-value{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.ng-select.ng-select-disabled .ng-arrow-wrapper{cursor:default}.ng-select.ng-select-filtered .ng-placeholder{display:none}.ng-select .ng-select-container{color:#333;cursor:default;display:flex;outline:0;overflow:hidden;position:relative;width:100%}.ng-select .ng-select-container .ng-value-container{display:flex;flex:1}.ng-select .ng-select-container .ng-value-container .ng-input{opacity:0}.ng-select .ng-select-container .ng-value-container .ng-input>input{box-sizing:content-box;background:none;border:0;box-shadow:none;outline:0;cursor:default;width:100%}.ng-select .ng-select-container .ng-value-container .ng-input>input::-ms-clear{display:none}.ng-select .ng-select-container .ng-value-container .ng-input>input[readonly]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:0;padding:0}.ng-select.ng-select-single.ng-select-filtered .ng-select-container .ng-value-container .ng-value{visibility:hidden}.ng-select.ng-select-single .ng-select-container .ng-value-container,.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-single .ng-select-container .ng-value-container .ng-input{position:absolute;left:0;width:100%}.ng-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container{flex-wrap:wrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{white-space:nowrap}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value.ng-value-disabled .ng-value-icon{display:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{cursor:pointer}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-input{flex:1;z-index:2}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-placeholder{position:absolute;z-index:1}.ng-select .ng-clear-wrapper{cursor:pointer;position:relative;width:17px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ng-select .ng-clear-wrapper .ng-clear{display:inline-block;font-size:18px;line-height:1;pointer-events:none}.ng-select .ng-spinner-loader{border-radius:50%;width:17px;height:17px;margin-right:5px;font-size:10px;position:relative;text-indent:-9999em;border-top:2px solid rgba(66,66,66,.2);border-right:2px solid rgba(66,66,66,.2);border-bottom:2px solid rgba(66,66,66,.2);border-left:2px solid #424242;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation:.8s linear infinite load8;animation:.8s linear infinite load8}.ng-select .ng-spinner-loader:after{border-radius:50%;width:17px;height:17px}@-webkit-keyframes load8{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes load8{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.ng-select .ng-arrow-wrapper{cursor:pointer;position:relative;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ng-select .ng-arrow-wrapper .ng-arrow{pointer-events:none;display:inline-block;height:0;width:0;position:relative}.ng-dropdown-panel{box-sizing:border-box;position:absolute;opacity:0;width:100%;z-index:1050;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .ng-dropdown-panel-items{display:block;height:auto;box-sizing:border-box;max-height:240px;overflow-y:auto}.ng-dropdown-panel .ng-dropdown-panel-items .ng-optgroup{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option{box-sizing:border-box;cursor:pointer;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option .highlighted{font-weight:700;text-decoration:underline}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.disabled{cursor:default}.ng-dropdown-panel .scroll-host{overflow:hidden;overflow-y:auto;position:relative;display:block;-webkit-overflow-scrolling:touch}.ng-dropdown-panel .scrollable-content{top:0;left:0;width:100%;height:100%;position:absolute}.ng-dropdown-panel .total-padding{width:1px;opacity:0}"],data:{}});function ug(e){return qo(0,[(e()(),ki(0,0,null,null,1,"span",[["aria-hidden","true"],["class","ng-value-icon left"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.unselect(e.parent.context.$implicit)&&r),r},null,null)),(e()(),Vo(-1,null,["\xd7"])),(e()(),ki(2,0,null,null,1,"span",[["class","ng-value-label"]],null,null,null,null,null)),(e()(),Vo(3,null,["",""]))],null,function(e,t){e(t,3,0,t.parent.context.$implicit.label)})}function lg(e){return qo(0,[(e()(),Ei(0,null,null,0))],null,null)}function cg(e){return qo(0,[(e()(),ki(0,0,null,null,4,"div",[["class","ng-value"]],[[2,"ng-value-disabled",null]],null,null,null,null)),(e()(),Ei(0,[["defaultLabelTemplate",2]],null,0,null,ug)),(e()(),Ei(16777216,null,null,2,null,lg)),po(3,540672,null,0,Qs,[Pn],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null),Uo(4,{item:0,clear:1,label:2})],function(e,t){var n=t.component,r=e(t,4,0,t.context.$implicit.value,n.clearItem,t.context.$implicit.label);e(t,3,0,r,n.labelTemplate||eo(t,1))},function(e,t){e(t,0,0,t.context.$implicit.disabled)})}function fg(e){return qo(0,[(e()(),ki(0,0,null,null,2,null,null,null,null,null,null,null)),(e()(),Ei(16777216,null,null,1,null,cg)),po(2,278528,null,0,Ws,[Pn,In,Xn],{ngForOf:[0,"ngForOf"]},null),(e()(),Ei(0,null,null,0))],function(e,t){e(t,2,0,t.component.selectedItems)},null)}function hg(e){return qo(0,[(e()(),Ei(0,null,null,0))],null,null)}function pg(e){return qo(0,[(e()(),Ei(16777216,null,null,2,null,hg)),po(1,540672,null,0,Qs,[Pn],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null),Uo(2,{items:0,clear:1}),(e()(),Ei(0,null,null,0))],function(e,t){var n=t.component,r=e(t,2,0,n.selectedValues,n.clearItem);e(t,1,0,r,n.multiLabelTemplate)},null)}function dg(e){return qo(0,[(e()(),ki(0,0,null,null,0,"div",[["class","ng-spinner-loader"]],null,null,null,null,null))],null,null)}function gg(e){return qo(0,[(e()(),Ei(0,null,null,0))],null,null)}function mg(e){return qo(0,[(e()(),ki(0,0,null,null,3,null,null,null,null,null,null,null)),(e()(),Ei(0,[["defautlLoadingSpinnerTemplate",2]],null,0,null,dg)),(e()(),Ei(16777216,null,null,1,null,gg)),po(3,540672,null,0,Qs,[Pn],{ngTemplateOutlet:[0,"ngTemplateOutlet"]},null),(e()(),Ei(0,null,null,0))],function(e,t){e(t,3,0,t.component.loadingSpinnerTemplate||eo(t,1))},null)}function yg(e){return qo(0,[(e()(),ki(0,0,null,null,2,"span",[["class","ng-clear-wrapper"]],[[8,"title",0]],null,null,null,null)),(e()(),ki(1,0,null,null,1,"span",[["aria-hidden","true"],["class","ng-clear"]],null,null,null,null,null)),(e()(),Vo(-1,null,["\xd7"]))],null,function(e,t){var n;e(t,0,0,""+(null!=(n=t.component.clearAllText)?n.toString():""))})}function vg(e){return qo(0,[(e()(),ki(0,0,null,null,1,"span",[["class","ng-option-label"]],null,null,null,null,null)),(e()(),Vo(1,null,["",""]))],null,function(e,t){e(t,1,0,t.parent.context.$implicit.label)})}function bg(e){return qo(0,[(e()(),Ei(0,null,null,0))],null,null)}function wg(e){return qo(0,[(e()(),ki(0,0,null,null,4,"div",[["class","ng-option"]],[[1,"role",0],[2,"ng-option-disabled",null],[2,"ng-option-selected",null],[2,"ng-optgroup",null],[2,"ng-option",null],[2,"ng-option-child",null],[2,"ng-option-marked",null],[1,"aria-selected",0],[1,"id",0]],[[null,"click"],[null,"mouseover"]],function(e,t,n){var r=!0,i=e.component;return"click"===t&&(r=!1!==i.toggleItem(e.context.$implicit)&&r),"mouseover"===t&&(r=!1!==i.onItemHover(e.context.$implicit)&&r),r},null,null)),(e()(),Ei(0,[["defaultOptionTemplate",2]],null,0,null,vg)),(e()(),Ei(16777216,null,null,2,null,bg)),po(3,540672,null,0,Qs,[Pn],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null),Uo(4,{item:0,item$:1,index:2,searchTerm:3})],function(e,t){var n=t.component,r=e(t,4,0,t.context.$implicit.value,t.context.$implicit,t.context.$implicit.index,n.filterValue);e(t,3,0,r,t.context.$implicit.children?n.optgroupTemplate||eo(t,1):n.optionTemplate||eo(t,1))},function(e,t){e(t,0,0,t.context.$implicit.children?"group":"option",t.context.$implicit.disabled,t.context.$implicit.selected,t.context.$implicit.children,!t.context.$implicit.children,!!t.context.$implicit.parent,t.context.$implicit===t.component.itemsList.markedItem,t.context.$implicit.selected,null==t.context.$implicit?null:t.context.$implicit.htmlId)})}function _g(e){return qo(0,[(e()(),ki(0,0,null,null,3,"span",[],null,null,null,null,null)),(e()(),ki(1,0,null,null,1,"span",[["class","ng-tag-label"]],null,null,null,null,null)),(e()(),Vo(2,null,["",""])),(e()(),Vo(3,null,['"','"']))],null,function(e,t){var n=t.component;e(t,2,0,n.addTagText),e(t,3,0,n.filterValue)})}function xg(e){return qo(0,[(e()(),Ei(0,null,null,0))],null,null)}function Sg(e){return qo(0,[(e()(),ki(0,0,null,null,4,"div",[["class","ng-option"],["role","option"]],[[2,"ng-option-marked",null]],[[null,"mouseover"],[null,"click"]],function(e,t,n){var r=!0,i=e.component;return"mouseover"===t&&(r=!1!==i.itemsList.unmarkItem()&&r),"click"===t&&(r=!1!==i.selectTag()&&r),r},null,null)),(e()(),Ei(0,[["defaultTagTemplate",2]],null,0,null,_g)),(e()(),Ei(16777216,null,null,2,null,xg)),po(3,540672,null,0,Qs,[Pn],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null),Uo(4,{searchTerm:0})],function(e,t){var n=t.component,r=e(t,4,0,n.filterValue);e(t,3,0,r,n.tagTemplate||eo(t,1))},function(e,t){e(t,0,0,!t.component.itemsList.markedItem)})}function Eg(e){return qo(0,[(e()(),ki(0,0,null,null,1,"div",[["class","ng-option ng-option-disabled"]],null,null,null,null,null)),(e()(),Vo(1,null,["",""]))],null,function(e,t){e(t,1,0,t.component.notFoundText)})}function kg(e){return qo(0,[(e()(),Ei(0,null,null,0))],null,null)}function Cg(e){return qo(0,[(e()(),ki(0,0,null,null,4,null,null,null,null,null,null,null)),(e()(),Ei(0,[["defaultNotFoundTemplate",2]],null,0,null,Eg)),(e()(),Ei(16777216,null,null,2,null,kg)),po(3,540672,null,0,Qs,[Pn],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null),Uo(4,{searchTerm:0}),(e()(),Ei(0,null,null,0))],function(e,t){var n=t.component,r=e(t,4,0,n.filterValue);e(t,3,0,r,n.notFoundTemplate||eo(t,1))},null)}function Tg(e){return qo(0,[(e()(),ki(0,0,null,null,1,"div",[["class","ng-option ng-option-disabled"]],null,null,null,null,null)),(e()(),Vo(1,null,["",""]))],null,function(e,t){e(t,1,0,t.component.typeToSearchText)})}function Og(e){return qo(0,[(e()(),Ei(0,null,null,0))],null,null)}function Ig(e){return qo(0,[(e()(),ki(0,0,null,null,3,null,null,null,null,null,null,null)),(e()(),Ei(0,[["defaultTypeToSearchTemplate",2]],null,0,null,Tg)),(e()(),Ei(16777216,null,null,1,null,Og)),po(3,540672,null,0,Qs,[Pn],{ngTemplateOutlet:[0,"ngTemplateOutlet"]},null),(e()(),Ei(0,null,null,0))],function(e,t){e(t,3,0,t.component.typeToSearchTemplate||eo(t,1))},null)}function Pg(e){return qo(0,[(e()(),ki(0,0,null,null,1,"div",[["class","ng-option ng-option-disabled"]],null,null,null,null,null)),(e()(),Vo(1,null,["",""]))],null,function(e,t){e(t,1,0,t.component.loadingText)})}function Ag(e){return qo(0,[(e()(),Ei(0,null,null,0))],null,null)}function Ng(e){return qo(0,[(e()(),ki(0,0,null,null,4,null,null,null,null,null,null,null)),(e()(),Ei(0,[["defaultLoadingTextTemplate",2]],null,0,null,Pg)),(e()(),Ei(16777216,null,null,2,null,Ag)),po(3,540672,null,0,Qs,[Pn],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null),Uo(4,{searchTerm:0}),(e()(),Ei(0,null,null,0))],function(e,t){var n=t.component,r=e(t,4,0,n.filterValue);e(t,3,0,r,n.loadingTextTemplate||eo(t,1))},null)}function Rg(e){return qo(0,[(e()(),ki(0,0,null,null,13,"ng-dropdown-panel",[["class","ng-dropdown-panel"]],[[2,"ng-select-multiple",null],[8,"id",0]],[[null,"update"],[null,"scroll"],[null,"scrollToEnd"],[null,"outsideClick"],[null,"mousedown"]],function(e,t,n){var r=!0,i=e.component;return"mousedown"===t&&(r=!1!==eo(e,2).handleMousedown(n)&&r),"update"===t&&(r=!1!==(i.viewPortItems=n)&&r),"scroll"===t&&(r=!1!==i.scroll.emit(n)&&r),"scrollToEnd"===t&&(r=!1!==i.scrollToEnd.emit(n)&&r),"outsideClick"===t&&(r=!1!==i.close()&&r),r},Ug,Dg)),po(1,278528,null,0,qs,[Xn,er,xn,_n],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),po(2,1818624,[[1,4]],0,eg,[_n,Kt,Xd,Zd,xn,[2,iu]],{items:[0,"items"],markedItem:[1,"markedItem"],position:[2,"position"],appendTo:[3,"appendTo"],bufferAmount:[4,"bufferAmount"],virtualScroll:[5,"virtualScroll"],headerTemplate:[6,"headerTemplate"],footerTemplate:[7,"footerTemplate"],filterValue:[8,"filterValue"]},{update:"update",scroll:"scroll",scrollToEnd:"scrollToEnd",outsideClick:"outsideClick"}),(e()(),ki(3,0,null,0,4,null,null,null,null,null,null,null)),(e()(),Ei(16777216,null,null,1,null,wg)),po(5,278528,null,0,Ws,[Pn,In,Xn],{ngForOf:[0,"ngForOf"]},null),(e()(),Ei(16777216,null,null,1,null,Sg)),po(7,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,0,1,null,Cg)),po(9,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,0,1,null,Ig)),po(11,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,0,1,null,Ng)),po(13,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,1,0,"ng-dropdown-panel",n.appendTo?n.classes:null),e(t,2,0,n.itemsList.filteredItems,n.itemsList.markedItem,n.dropdownPosition,n.appendTo,n.bufferAmount,n.virtualScroll,n.headerTemplate,n.footerTemplate,n.filterValue),e(t,5,0,n.viewPortItems),e(t,7,0,n.showAddTag),e(t,9,0,n.showNoItemsFound()),e(t,11,0,n.showTypeToSearch()),e(t,13,0,n.loading&&0===n.itemsList.filteredItems.length)},function(e,t){var n=t.component;e(t,0,0,n.multiple,n.dropdownId)})}function jg(e){return qo(2,[Ao(671088640,1,{dropdownPanel:0}),Ao(402653184,2,{filterInput:0}),(e()(),ki(2,0,null,null,15,"div",[["class","ng-select-container"]],[[2,"ng-has-value",null]],[[null,"mousedown"]],function(e,t,n){var r=!0;return"mousedown"===t&&(r=!1!==e.component.handleMousedown(n)&&r),r},null,null)),(e()(),ki(3,0,null,null,8,"div",[["class","ng-value-container"]],null,null,null,null,null)),(e()(),ki(4,0,null,null,1,"div",[["class","ng-placeholder"]],null,null,null,null,null)),(e()(),Vo(5,null,["",""])),(e()(),Ei(16777216,null,null,1,null,fg)),po(7,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,null,1,null,pg)),po(9,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),ki(10,0,null,null,1,"div",[["class","ng-input"]],null,null,null,null,null)),(e()(),ki(11,0,[[2,0],["filterInput",1]],null,0,"input",[["role","combobox"],["type","text"]],[[1,"autocomplete",0],[1,"id",0],[1,"tabindex",0],[1,"autocorrect",0],[1,"autocapitalize",0],[8,"readOnly",0],[8,"disabled",0],[8,"value",0],[1,"aria-expanded",0],[1,"aria-owns",0],[1,"aria-activedescendant",0]],[[null,"input"],[null,"focus"],[null,"blur"],[null,"change"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==i.filter(eo(e,11).value)&&r),"focus"===t&&(r=!1!==i.onInputFocus(n)&&r),"blur"===t&&(r=!1!==i.onInputBlur(n)&&r),"change"===t&&(r=!1!==n.stopPropagation()&&r),r},null,null)),(e()(),Ei(16777216,null,null,1,null,mg)),po(13,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,null,1,null,yg)),po(15,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),ki(16,0,null,null,1,"span",[["class","ng-arrow-wrapper"]],null,null,null,null,null)),(e()(),ki(17,0,null,null,0,"span",[["class","ng-arrow"]],null,null,null,null,null)),(e()(),Ei(16777216,null,null,1,null,Rg)),po(19,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,7,0,!n.multiLabelTemplate&&n.selectedItems.length>0),e(t,9,0,n.multiLabelTemplate&&n.selectedValues.length>0),e(t,13,0,n.loading),e(t,15,0,n.showClear()),e(t,19,0,n.isOpen)},function(e,t){var n=t.component;e(t,2,0,n.hasValue),e(t,5,0,n.placeholder),e(t,11,1,[n.labelForId?"off":n.dropdownId,n.labelForId,n.tabIndex,n.autoCorrect,n.autoCapitalize,!n.searchable,n.disabled,n.filterValue?n.filterValue:"",n.isOpen,n.isOpen?n.dropdownId:null,n.isOpen?null==n.itemsList?null:null==n.itemsList.markedItem?null:n.itemsList.markedItem.htmlId:null])})}var Dg=Yr({encapsulation:2,styles:[],data:{}});function Mg(e){return qo(0,[(e()(),ki(0,0,null,null,3,"div",[["class","ng-dropdown-header"]],null,null,null,null,null)),(e()(),ki(1,16777216,null,null,2,null,null,null,null,null,null,null)),po(2,540672,null,0,Qs,[Pn],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null),Uo(3,{searchTerm:0})],function(e,t){var n=t.component,r=e(t,3,0,n.filterValue);e(t,2,0,r,n.headerTemplate)},null)}function Lg(e){return qo(0,[(e()(),ki(0,0,null,null,3,"div",[["class","ng-dropdown-footer"]],null,null,null,null,null)),(e()(),ki(1,16777216,null,null,2,null,null,null,null,null,null,null)),po(2,540672,null,0,Qs,[Pn],{ngTemplateOutletContext:[0,"ngTemplateOutletContext"],ngTemplateOutlet:[1,"ngTemplateOutlet"]},null),Uo(3,{searchTerm:0})],function(e,t){var n=t.component,r=e(t,3,0,n.filterValue);e(t,2,0,r,n.footerTemplate)},null)}function Ug(e){return qo(2,[Ao(402653184,1,{contentElementRef:0}),Ao(402653184,2,{scrollElementRef:0}),Ao(402653184,3,{paddingElementRef:0}),(e()(),Ei(16777216,null,null,1,null,Mg)),po(4,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),ki(5,0,[[2,0],["scroll",1]],null,3,"div",[["class","ng-dropdown-panel-items scroll-host"]],null,null,null,null,null)),(e()(),ki(6,0,[[3,0],["padding",1]],null,0,"div",[],[[2,"total-padding",null]],null,null,null,null)),(e()(),ki(7,0,[[1,0],["content",1]],null,1,"div",[],[[2,"scrollable-content",null]],null,null,null,null)),(null,0,{nodeIndex:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,checkIndex:-1,flags:8,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:{},matchedQueryIds:0,references:{},ngContentIndex:null,childCount:0,bindings:[],bindingFlags:0,outputs:[],element:null,provider:null,text:null,query:null,ngContent:{index:0}}),(e()(),Ei(16777216,null,null,1,null,Lg)),po(10,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,4,0,n.headerTemplate),e(t,10,0,n.footerTemplate)},function(e,t){var n=t.component;e(t,6,0,n.virtualScroll),e(t,7,0,n.virtualScroll&&n.items.length>0)})}var Fg=Yr({encapsulation:0,styles:[[".login-page[_ngcontent-%COMP%]{text-align:center;font-family:Roboto,sans-serif;color:#666}.login-page[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:38px;text-transform:uppercase;font-weight:700;line-height:50px;letter-spacing:1.9px;padding-top:12px;margin-top:0}.login-page[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{color:#666;font-size:16px;font-weight:500;letter-spacing:1px;line-height:21px;margin-top:48px}.login-page[_ngcontent-%COMP%] .small-link[_ngcontent-%COMP%]{font-size:12px;color:#666;letter-spacing:.75px;line-height:16px}.login-page[_ngcontent-%COMP%] .registration-link[_ngcontent-%COMP%]{margin-top:38px}.login-page[_ngcontent-%COMP%] .registration-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font-size:16px;color:#666;letter-spacing:1px}.login-page[_ngcontent-%COMP%] .item-divider[_ngcontent-%COMP%]{box-sizing:border-box;height:1px;width:354px;border-bottom:1px solid #e0e0e0;position:absolute;bottom:-8px;left:-9px}"]],data:{}});function Vg(e){return qo(0,[(e()(),ki(0,0,null,null,5,"div",[["style","height:40px; padding-top:10px; position: relative;"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,0,"img",[["style","float: left; height: 32px; width: 32px; margin-top:-5px;"]],[[8,"src",4]],null,null,null,null)),(e()(),ki(2,0,null,null,1,"span",[["style","float: left; margin-left: 10px;"]],null,null,null,null,null)),(e()(),Vo(3,null,["",""])),(e()(),ki(4,0,null,null,0,"div",[["style","clear: both;"]],null,null,null,null,null)),(e()(),ki(5,0,null,null,0,"div",[["class","item-divider"]],null,null,null,null,null))],null,function(e,t){e(t,1,0,t.context.item.image),e(t,3,0,t.context.item.name)})}function Bg(e){return qo(0,[(e()(),ki(0,0,null,null,5,"input",[["class","wide-text"],["placeholder","Enter WebID"],["style","margin-top:10px; padding: 12px 10px; width: 340px; height: 16px; display: block; margin-left: auto; margin-right: auto;"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,1)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,1).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,1)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,1)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.customProviderUrl=n)&&r),r},null,null)),po(1,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(3,671744,null,0,Od,[[8,null],[8,null],[8,null],[6,$p]],{model:[0,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(5,16384,null,0,dd,[[4,ed]],null,null)],function(e,t){e(t,3,0,t.component.customProviderUrl)},function(e,t){e(t,0,0,eo(t,5).ngClassUntouched,eo(t,5).ngClassTouched,eo(t,5).ngClassPristine,eo(t,5).ngClassDirty,eo(t,5).ngClassValid,eo(t,5).ngClassInvalid,eo(t,5).ngClassPending)})}function zg(e){return qo(0,[(e()(),ki(0,0,null,null,1,"button",[["class","wide-button"],["id","btn-go"],["style","margin-top:10px;"]],[[8,"disabled",0]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.onLogin()&&r),r},null,null)),(e()(),Vo(-1,null,["Go"]))],null,function(e,t){var n=t.component;e(t,0,0,null===n.selectedProviderUrl&&!n.customProviderUrl)})}function qg(e){return qo(0,[(e()(),ki(0,0,null,null,40,"div",[["class","login-page"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,1,"div",[["style","margin-top:60px;"]],null,null,null,null,null)),(e()(),ki(2,0,null,null,0,"i",[["class","fas fa-user-circle"],["style","font-size: 64px;"]],null,null,null,null,null)),(e()(),ki(3,0,null,null,1,"h1",[],null,null,null,null,null)),(e()(),Vo(-1,null,[" DE-CHAT "])),(e()(),ki(5,0,null,null,1,"h2",[],null,null,null,null,null)),(e()(),Vo(-1,null,[" Login with Solid Identity "])),(e()(),ki(7,0,null,null,24,"div",[["style","margin-top: 10px;"]],null,null,null,null,null)),(e()(),ki(8,0,null,null,19,"ng-select",[["bindLabel","name"],["bindValue","loginUrl"],["class","login-select ng-select"],["dropdownPosition","bottom"],["placeholder","Select ID Provider"],["role","listbox"],["style","width: 360px; height: 48px; margin-left: auto; margin-right: auto;"]],[[2,"ng-select-single",null],[2,"ng-select-typeahead",null],[2,"ng-select-multiple",null],[2,"ng-select-taggable",null],[2,"ng-select-searchable",null],[2,"ng-select-opened",null],[2,"ng-select-disabled",null],[2,"ng-select-filtered",null],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"keydown"]],function(e,t,n){var r=!0,i=e.component;return"keydown"===t&&(r=!1!==eo(e,9).handleKeyDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedProviderUrl=n)&&r),r},jg,sg)),po(9,4964352,null,12,rg,[[8,"login-select"],[8,null],[8,null],tg,ng,xn,An,qd],{bindLabel:[0,"bindLabel"],bindValue:[1,"bindValue"],placeholder:[2,"placeholder"],dropdownPosition:[3,"dropdownPosition"],items:[4,"items"]},null),Ao(335544320,1,{optionTemplate:0}),Ao(335544320,2,{optgroupTemplate:0}),Ao(335544320,3,{labelTemplate:0}),Ao(335544320,4,{multiLabelTemplate:0}),Ao(335544320,5,{headerTemplate:0}),Ao(335544320,6,{footerTemplate:0}),Ao(335544320,7,{notFoundTemplate:0}),Ao(335544320,8,{typeToSearchTemplate:0}),Ao(335544320,9,{loadingTextTemplate:0}),Ao(335544320,10,{tagTemplate:0}),Ao(335544320,11,{loadingSpinnerTemplate:0}),Ao(603979776,12,{ngOptions:1}),mo(1024,null,$p,function(e){return[e]},[rg]),po(23,671744,null,0,Od,[[8,null],[8,null],[8,null],[6,$p]],{model:[0,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(25,16384,null,0,dd,[[4,ed]],null,null),(e()(),Ei(0,[[1,2]],null,1,null,Vg)),po(27,16384,null,0,zd,[In],null,null),(e()(),Ei(16777216,null,null,1,null,Bg)),po(29,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,null,1,null,zg)),po(31,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),ki(32,0,null,null,4,"div",[["class","registration-link"]],null,null,null,null,null)),(e()(),ki(33,0,null,null,1,"p",[["style","margin: 12px;"]],null,null,null,null,null)),(e()(),Vo(-1,null,["Don't have a Solid Identity?"])),(e()(),ki(35,0,null,null,1,"button",[["class","wide-button"],["id","btn-register"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.goToRegistration()&&r),r},null,null)),(e()(),Vo(-1,null,["Register"])),(e()(),ki(37,0,null,null,3,"div",[["style","margin-top: 48px;"]],null,null,null,null,null)),(e()(),ki(38,0,null,null,2,"a",[["class","small-link"],["href","https://solid.mit.edu"],["target","_blank"]],null,null,null,null,null)),(e()(),ki(39,0,null,null,0,"i",[["class","fas fa-info-circle"]],null,null,null,null,null)),(e()(),Vo(-1,null,[" What is a Solid Identity? "]))],function(e,t){var n=t.component;e(t,9,0,"name","loginUrl","Select ID Provider","bottom",n.identityProviders),e(t,23,0,n.selectedProviderUrl),e(t,29,0,null===n.selectedProviderUrl),e(t,31,0,void 0!==n.selectedProviderUrl||void 0!==n.customProviderUrl)},function(e,t){e(t,8,1,[!eo(t,9).multiple,eo(t,9).typeahead,eo(t,9).multiple,eo(t,9).addTag,eo(t,9).searchable,eo(t,9).isOpen,eo(t,9).disabled,eo(t,9).filtered,eo(t,25).ngClassUntouched,eo(t,25).ngClassTouched,eo(t,25).ngClassPristine,eo(t,25).ngClassDirty,eo(t,25).ngClassValid,eo(t,25).ngClassInvalid,eo(t,25).ngClassPending])})}function Hg(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-login",[],null,null,null,qg,Fg)),po(1,114688,null,0,sp,[ip,Th],null,null)],function(e,t){e(t,1,0)},null)}var Wg=qi("app-login",sp,Hg,{},{},[]),$g=Yr({encapsulation:0,styles:[[""]],data:{}});function Gg(e){return qo(0,[(e()(),ki(0,0,null,null,1,"div",[["id","app-container"]],null,null,null,null,null)),(e()(),Vo(-1,null,["Loading..."]))],null,null)}function Jg(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-login-popup",[],null,null,null,Gg,$g)),po(1,114688,null,0,Za,[xn],null,null)],function(e,t){e(t,1,0)},null)}var Kg=qi("app-login-popup",Za,Jg,{},{},[]),Qg=Yr({encapsulation:0,styles:[[".profile-container[_ngcontent-%COMP%]{font-family:Roboto,sans-serif;height:calc(100vh - 50px)}.profile-container[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:24px;color:#7c55fb;font-weight:700;line-height:32px;letter-spacing:1.2px;text-align:center;padding-top:70px;text-transform:uppercase}.profile-fields-container[_ngcontent-%COMP%]{max-width:740px;min-height:500px;margin:0 auto;border:1px solid #ccc;box-shadow:rgba(0,0,0,.226) 1px 1px 4px;position:relative}.profile-fields-container[_ngcontent-%COMP%] .profile-image-container[_ngcontent-%COMP%]{height:200px;width:100%;background:url(/assets/images/Solid_Pattern.png)}.profile-fields-container[_ngcontent-%COMP%] .profile-image-container[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:128px;border-radius:50%;margin-left:auto;margin-right:auto;position:relative;top:40px;display:block}.profile-fields-container[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:14px;color:#89969f;padding-left:26px;padding-right:10px;margin-top:24px}.profile-fields-container[_ngcontent-%COMP%] input[type=text].field-text[_ngcontent-%COMP%]{height:12px;width:280px;border:1px solid #89969f;border-radius:4px;padding:10px}.profile-fields-container[_ngcontent-%COMP%] input[type=text].field-text[_ngcontent-%COMP%]::-webkit-input-placeholder{color:rgba(102,102,102,.2)}.profile-fields-container[_ngcontent-%COMP%] input[type=text].field-text[_ngcontent-%COMP%]:-ms-input-placeholder{color:rgba(102,102,102,.2)}.profile-fields-container[_ngcontent-%COMP%] input[type=text].field-text[_ngcontent-%COMP%]::-ms-input-placeholder{color:rgba(102,102,102,.2)}.profile-fields-container[_ngcontent-%COMP%] input[type=text].field-text[_ngcontent-%COMP%]::placeholder{color:rgba(102,102,102,.2)}.profile-save-button-container[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:auto;height:100px;flex-direction:column;justify-content:flex-end}.profile-save-button[_ngcontent-%COMP%]{background-color:#7c55fb;margin-left:auto;margin-right:auto;width:280px}.profile-save-button[_ngcontent-%COMP%]:disabled{background-color:#f0eeeb;border-color:#f0eeeb;cursor:not-allowed}.loading-image[_ngcontent-%COMP%]{text-align:center;margin-top:50px}"]],data:{}});function Yg(e){return qo(0,[(e()(),ki(0,0,null,null,1,"div",[["class","loading-image"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,0,"i",[["class","fas fa-circle-notch fa-4x fa-spin"]],null,null,null,null,null))],null,null)}function Zg(e){return qo(0,[(e()(),ki(0,0,null,null,61,"div",[["class","profile-fields-container"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,1,"div",[["class","profile-image-container"]],null,null,null,null,null)),(e()(),ki(2,0,null,null,0,"img",[],[[8,"src",4]],null,null,null,null)),(e()(),ki(3,0,null,null,58,"form",[["novalidate",""],["style","padding-top: 26px;"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"submit"],[null,"reset"]],function(e,t,n){var r=!0,i=e.component;return"submit"===t&&(r=!1!==eo(e,5).onSubmit(n)&&r),"reset"===t&&(r=!1!==eo(e,5).onReset()&&r),"submit"===t&&(r=!1!==i.onSubmit()&&r),r},null,null)),po(4,16384,null,0,Id,[],null,null),po(5,4210688,[[1,4],["f",4]],0,Ed,[[8,null],[8,null]],null,null),mo(2048,null,Fp,null,[Ed]),po(7,16384,null,0,gd,[[4,Fp]],null,null),(e()(),ki(8,0,null,null,16,"div",[["class","fields pure-g"]],null,null,null,null,null)),(e()(),ki(9,0,null,null,7,"div",[["class","pure-u-1-1 pure-u-md-1-2 form-group"]],null,null,null,null,null)),(e()(),ki(10,0,null,null,0,"i",[["class","fas fa-user"]],null,null,null,null,null)),(e()(),ki(11,0,null,null,5,"input",[["class","field-text form-control"],["name","fn"],["placeholder","NAME"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,12)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,12).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,12)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,12)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.profile.fn=n)&&r),r},null,null)),po(12,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(14,671744,null,0,Od,[[2,Fp],[8,null],[8,null],[6,$p]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(16,16384,null,0,dd,[[4,ed]],null,null),(e()(),ki(17,0,null,null,7,"div",[["class","pure-u-1-1 pure-u-md-1-2 form-group"]],null,null,null,null,null)),(e()(),ki(18,0,null,null,0,"i",[["class","fas fa-phone"]],null,null,null,null,null)),(e()(),ki(19,0,null,null,5,"input",[["class","field-text form-control"],["name","phone"],["placeholder","PHONE"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,20)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,20).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,20)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,20)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.profile.phone=n)&&r),r},null,null)),po(20,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(22,671744,null,0,Od,[[2,Fp],[8,null],[8,null],[6,$p]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(24,16384,null,0,dd,[[4,ed]],null,null),(e()(),ki(25,0,null,null,16,"div",[["class","fields pure-g"]],null,null,null,null,null)),(e()(),ki(26,0,null,null,7,"div",[["class","pure-u-1-1 pure-u-md-1-2 form-group"]],null,null,null,null,null)),(e()(),ki(27,0,null,null,0,"i",[["class","fas fa-user-astronaut"]],null,null,null,null,null)),(e()(),ki(28,0,null,null,5,"input",[["class","field-text form-control"],["name","role"],["placeholder","ROLE"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,29)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,29).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,29)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,29)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.profile.role=n)&&r),r},null,null)),po(29,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(31,671744,null,0,Od,[[2,Fp],[8,null],[8,null],[6,$p]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(33,16384,null,0,dd,[[4,ed]],null,null),(e()(),ki(34,0,null,null,7,"div",[["class","pure-u-1-1 pure-u-md-1-2 form-group"]],null,null,null,null,null)),(e()(),ki(35,0,null,null,0,"i",[["class","fas fa-envelope"]],null,null,null,null,null)),(e()(),ki(36,0,null,null,5,"input",[["class","field-text form-control"],["name","email"],["placeholder","EMAIL"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,37)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,37).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,37)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,37)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.profile.email=n)&&r),r},null,null)),po(37,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(39,671744,null,0,Od,[[2,Fp],[8,null],[8,null],[6,$p]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(41,16384,null,0,dd,[[4,ed]],null,null),(e()(),ki(42,0,null,null,16,"div",[["class","fields pure-g"]],null,null,null,null,null)),(e()(),ki(43,0,null,null,7,"div",[["class","pure-u-1-1 pure-u-md-1-2 form-group"]],null,null,null,null,null)),(e()(),ki(44,0,null,null,0,"i",[["class","fas fa-building"]],null,null,null,null,null)),(e()(),ki(45,0,null,null,5,"input",[["class","field-text form-control"],["name","company"],["placeholder","ORGANIZATION"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,46)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,46).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,46)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,46)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.profile.company=n)&&r),r},null,null)),po(46,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(48,671744,null,0,Od,[[2,Fp],[8,null],[8,null],[6,$p]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(50,16384,null,0,dd,[[4,ed]],null,null),(e()(),ki(51,0,null,null,7,"div",[["class","pure-u-1-1 pure-u-md-1-2 form-group"]],null,null,null,null,null)),(e()(),ki(52,0,null,null,0,"i",[["class","fas fa-map-marker-alt"],["style","width: 12px; margin-left: 2px;"]],null,null,null,null,null)),(e()(),ki(53,0,null,null,5,"input",[["class","field-text form-control"],["name","address"],["placeholder","ADDRESS"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,54)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,54).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,54)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,54)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.profile.address.street=n)&&r),r},null,null)),po(54,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(56,671744,null,0,Od,[[2,Fp],[8,null],[8,null],[6,$p]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(58,16384,null,0,dd,[[4,ed]],null,null),(e()(),ki(59,0,null,null,2,"div",[["class","profile-save-button-container"]],null,null,null,null,null)),(e()(),ki(60,0,null,null,1,"button",[["class","wide-button profile-save-button"],["type","submit"]],[[8,"disabled",0]],null,null,null,null)),(e()(),Vo(-1,null,["Save"]))],function(e,t){var n=t.component;e(t,14,0,"fn",n.profile.fn),e(t,22,0,"phone",n.profile.phone),e(t,31,0,"role",n.profile.role),e(t,39,0,"email",n.profile.email),e(t,48,0,"company",n.profile.company),e(t,56,0,"address",n.profile.address.street)},function(e,t){var n=t.component;e(t,2,0,n.profileImage),e(t,3,0,eo(t,7).ngClassUntouched,eo(t,7).ngClassTouched,eo(t,7).ngClassPristine,eo(t,7).ngClassDirty,eo(t,7).ngClassValid,eo(t,7).ngClassInvalid,eo(t,7).ngClassPending),e(t,11,0,eo(t,16).ngClassUntouched,eo(t,16).ngClassTouched,eo(t,16).ngClassPristine,eo(t,16).ngClassDirty,eo(t,16).ngClassValid,eo(t,16).ngClassInvalid,eo(t,16).ngClassPending),e(t,19,0,eo(t,24).ngClassUntouched,eo(t,24).ngClassTouched,eo(t,24).ngClassPristine,eo(t,24).ngClassDirty,eo(t,24).ngClassValid,eo(t,24).ngClassInvalid,eo(t,24).ngClassPending),e(t,28,0,eo(t,33).ngClassUntouched,eo(t,33).ngClassTouched,eo(t,33).ngClassPristine,eo(t,33).ngClassDirty,eo(t,33).ngClassValid,eo(t,33).ngClassInvalid,eo(t,33).ngClassPending),e(t,36,0,eo(t,41).ngClassUntouched,eo(t,41).ngClassTouched,eo(t,41).ngClassPristine,eo(t,41).ngClassDirty,eo(t,41).ngClassValid,eo(t,41).ngClassInvalid,eo(t,41).ngClassPending),e(t,45,0,eo(t,50).ngClassUntouched,eo(t,50).ngClassTouched,eo(t,50).ngClassPristine,eo(t,50).ngClassDirty,eo(t,50).ngClassValid,eo(t,50).ngClassInvalid,eo(t,50).ngClassPending),e(t,53,0,eo(t,58).ngClassUntouched,eo(t,58).ngClassTouched,eo(t,58).ngClassPristine,eo(t,58).ngClassDirty,eo(t,58).ngClassValid,eo(t,58).ngClassInvalid,eo(t,58).ngClassPending),e(t,60,0,!n.cardForm||n.cardForm.pristine)})}function Xg(e){return qo(0,[Ao(671088640,1,{cardForm:0}),(e()(),ki(1,0,null,null,6,"div",[["class","profile-container"]],null,null,null,null,null)),(e()(),ki(2,0,null,null,1,"h1",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Profile"])),(e()(),Ei(16777216,null,null,1,null,Yg)),po(5,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),Ei(16777216,null,null,1,null,Zg)),po(7,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null)],function(e,t){var n=t.component;e(t,5,0,n.loadingProfile),e(t,7,0,!n.loadingProfile)},null)}function em(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-card",[],null,null,null,Xg,Qg)),po(1,114688,null,0,cp,[Ll,Vf,ip],null,null)],function(e,t){e(t,1,0)},null)}var tm=qi("app-card",cp,em,{},{},[]),nm=function(){function e(e){this.chatService=e,this.user=new dp("","Test","")}return e.prototype.ngOnInit=function(){},e.prototype.changeChat=function(){this.chatService.changeChat(this.user)},e}(),rm=Yr({encapsulation:0,styles:[[".userItem[_ngcontent-%COMP%]{height:auto;padding:10px;align-items:flex-start;background-color:#201835;color:#a098a5;align-items:center;display:flex;transition:ease-in .2s}.userItem[_ngcontent-%COMP%]:hover{background-color:#453968;color:#ddd;transition:ease-in .1s}.profilePic[_ngcontent-%COMP%]{border-radius:100%;border-width:1em;width:2em;height:2em;margin-right:1em}.online[_ngcontent-%COMP%]{border-color:#0fa}.busy[_ngcontent-%COMP%]{border-color:#fb0}.offline[_ngcontent-%COMP%]{border-color:#888}.status[_ngcontent-%COMP%]{border:1px solid #000;display:inline-block;min-width:10px;min-height:10px;border-radius:50%;margin:10px 12px 0 10px}.userName[_ngcontent-%COMP%]{display:inline-block}"]],data:{}});function im(e){return qo(0,[(e()(),ki(0,0,null,null,3,"div",[["class","userItem"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.changeChat()&&r),r},null,null)),(e()(),ki(1,0,null,null,0,"img",[["class","profilePic"]],[[8,"src",4]],null,null,null,null)),(e()(),ki(2,0,null,null,1,"span",[["class","userName"]],null,null,null,null,null)),(e()(),Vo(3,null,[" "," "]))],null,function(e,t){var n=t.component;e(t,1,0,n.user.profilePicture),e(t,3,0,n.user.username)})}var om=function(){return function(e){var t=this;e.getUsers().subscribe(function(e){t.users=e})}}(),am=Yr({encapsulation:0,styles:[[""]],data:{}});function sm(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-user-item",[],null,null,null,im,rm)),po(1,114688,null,0,nm,[vp],{user:[0,"user"]},null)],function(e,t){e(t,1,0,t.context.$implicit)},null)}function um(e){return qo(0,[(e()(),ki(0,0,null,null,2,"div",[["class","userList"]],null,null,null,null,null)),(e()(),Ei(16777216,null,null,1,null,sm)),po(2,278528,null,0,Ws,[Pn,In,Xn],{ngForOf:[0,"ngForOf"]},null)],function(e,t){e(t,2,0,t.component.users)},null)}var lm=function(){function e(e,t){this.chatService=e,this.toastr=t,this.timeStamp=new Date}return e.prototype.ngOnInit=function(e){var t=this;void 0===e&&(e=this.chatMessage),e||(e=new pp("","Failed to load")),this.messageContent=e.message,this.timeStamp=e.timeSent,this.userName=e.userName,this.chatService.getUser().subscribe(function(e){e&&(t.isOwnMessage=0===e.username.toString().localeCompare(t.userName.toString()))})},e.prototype.removeMessage=function(){this.messageContent?!0===this.isOwnMessage&&(this.toastr.error("Are you sure?"),this.messageContent=""):this.toastr.error("Cannot remove this message")},e}(),cm=Yr({encapsulation:0,styles:[[".msg[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;height:auto;width:auto;max-width:70%;border-radius:5px;box-shadow:0 3px 6px rgba(0,0,0,.26),0 3px 6px rgba(0,0,0,.23)}.ownMsg[_ngcontent-%COMP%]{float:right;background-color:#01579b}.ownMsg[_ngcontent-%COMP%]:after{content:'';position:absolute;border-style:solid;border-width:12px 0 12px 15px;border-color:transparent #01579b;display:block;width:0;z-index:1;right:-15px;top:10px}.otherMsg[_ngcontent-%COMP%]{float:inline-start;background-color:#eee}.otherMsg[_ngcontent-%COMP%]:after{content:'';position:absolute;border-style:solid;border-width:12px 15px 12px 0;border-color:transparent #eee;display:block;width:0;z-index:1;left:-15px;top:10px}.messageData[_ngcontent-%COMP%]{padding:10px;font-size:.7em}.sender[_ngcontent-%COMP%]{display:block;color:#222;font-weight:700}.isOwnSender[_ngcontent-%COMP%]{color:#e1f5fe}.timestamp[_ngcontent-%COMP%]{color:#555;font-style:italic}.isOwnTimestamp[_ngcontent-%COMP%]{color:#4fc3f7}.messageContent[_ngcontent-%COMP%]{background-color:#fff;padding:10px;border-bottom-left-radius:5px;border-bottom-right-radius:5px;overflow-wrap:break-word}.isOwnMessageContent[_ngcontent-%COMP%]{background-color:#e3f2fd}"]],data:{}});function fm(e){return qo(0,[go(0,nu,[or]),(e()(),ki(1,0,null,null,18,"div",[["class","msg"]],null,null,null,null,null)),po(2,278528,null,0,qs,[Xn,er,xn,_n],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),Uo(3,{ownMsg:0,otherMsg:1}),(e()(),ki(4,0,null,null,11,"div",[["class","messageData"]],null,null,null,null,null)),po(5,278528,null,0,qs,[Xn,er,xn,_n],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),Uo(6,{isOwnMessageData:0}),(e()(),ki(7,0,null,null,3,"span",[["class","sender"]],null,null,null,null,null)),po(8,278528,null,0,qs,[Xn,er,xn,_n],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),Uo(9,{isOwnSender:0}),(e()(),Vo(10,null,[" "," "])),(e()(),ki(11,0,null,null,4,"span",[["class","timestamp"]],null,null,null,null,null)),po(12,278528,null,0,qs,[Xn,er,xn,_n],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),Uo(13,{isOwnTimestamp:0}),(e()(),Vo(14,null,[" "," "])),Fo(128,15,new Array(3)),(e()(),ki(16,0,null,null,3,"div",[["class","messageContent"]],null,null,null,null,null)),po(17,278528,null,0,qs,[Xn,er,xn,_n],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),Uo(18,{isOwnMessageContent:0}),(e()(),Vo(19,null,[" "," "]))],function(e,t){var n=t.component,r=e(t,3,0,n.isOwnMessage,!n.isOwnMessage);e(t,2,0,"msg",r);var i=e(t,6,0,n.isOwnMessage);e(t,5,0,"messageData",i);var o=e(t,9,0,n.isOwnMessage);e(t,8,0,"sender",o);var a=e(t,13,0,n.isOwnMessage);e(t,12,0,"timestamp",a);var s=e(t,18,0,n.isOwnMessage);e(t,17,0,"messageContent",s)},function(e,t){var n=t.component;e(t,10,0,n.userName);var r=Jr(t,14,0,e(t,15,0,eo(t,0),n.timeStamp,"medium"));e(t,14,0,r),e(t,19,0,n.messageContent)})}var hm=function(){function e(e){this.chat=e}return e.prototype.ngOnInit=function(){this.feed=this.chat.getMessages()},e.prototype.ngOnChanges=function(){this.feed=this.chat.getMessages()},e}(),pm=Yr({encapsulation:0,styles:[["[_nghost-%COMP%]{flex-grow:1}.feed[_ngcontent-%COMP%]{display:flex;flex-direction:column;overflow-x:hidden;overflow-y:auto}.message[_ngcontent-%COMP%]{flex-direction:column;margin:.6em 1em}.feed[_ngcontent-%COMP%]:first-child{margin-top:auto}"]],data:{}});function dm(e){return qo(0,[(e()(),ki(0,0,null,null,2,"div",[["class","message"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,1,"app-message",[],null,null,null,fm,cm)),po(2,114688,null,0,lm,[vp,Tl],{chatMessage:[0,"chatMessage"]},null)],function(e,t){e(t,2,0,t.context.$implicit)},null)}function gm(e){return qo(0,[(e()(),ki(0,0,null,null,3,"div",[["class","feed"]],null,null,null,null,null)),(e()(),Ei(16777216,null,null,2,null,dm)),po(2,278528,null,0,Ws,[Pn,In,Xn],{ngForOf:[0,"ngForOf"]},null),go(131072,tu,[An])],function(e,t){var n=t.component;e(t,2,0,Jr(t,2,0,eo(t,3).transform(n.feed)))},null)}var mm=function(){function e(e){this.chat=e,this.message="",this.active=!0}return e.prototype.ngOnInit=function(){var e=this;this.chat.isChatActive().subscribe(function(t){e.active=t})},e.prototype.send=function(){this.chat.sendMessage(this.message),this.message=""},e.prototype.handleSubmit=function(e){13===e.keyCode&&this.send()},e}(),ym=Yr({encapsulation:0,styles:[[".chatFormWrapper[_ngcontent-%COMP%]{display:flex;background-color:#7c4dff}.chatInput[_ngcontent-%COMP%]{border-radius:5px;margin:5px;padding:5px;font-size:1.3em;font-family:'Open Sans',sans-serif;background-color:#eee;color:#000;transition:.1s ease-out;flex-grow:1}.chatInput[_ngcontent-%COMP%]:focus{background-color:#e4f1fe;color:#222;transition:.2s ease-in}.chatButton[_ngcontent-%COMP%]{width:150px;border-radius:5px;margin:0;padding:8px 24px;font-size:1.3em;font-family:'Droid Sans',sans-serif;background-color:#2a2845;color:#fff;transition:.2s ease-out;min-width:50px}.chatButton[_ngcontent-%COMP%]:hover{background-color:#444}"]],data:{}});function vm(e){return qo(0,[(e()(),ki(0,0,null,null,8,"div",[["class","chatFormWrapper"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,5,"input",[["class","chatInput"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"keydown"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,2)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,2).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,2)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,2)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.message=n)&&r),"keydown"===t&&(r=!1!==i.handleSubmit(n)&&r),r},null,null)),po(2,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(4,671744,null,0,Od,[[8,null],[8,null],[8,null],[6,$p]],{isDisabled:[0,"isDisabled"],model:[1,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(6,16384,null,0,dd,[[4,ed]],null,null),(e()(),ki(7,0,null,null,1,"button",[["class","chatButton"]],[[8,"disabled",0]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.send()&&r),r},null,null)),(e()(),Vo(-1,null,["Send"]))],function(e,t){var n=t.component;e(t,4,0,!n.active,n.message)},function(e,t){var n=t.component;e(t,1,0,eo(t,6).ngClassUntouched,eo(t,6).ngClassTouched,eo(t,6).ngClassPristine,eo(t,6).ngClassDirty,eo(t,6).ngClassValid,eo(t,6).ngClassInvalid,eo(t,6).ngClassPending),e(t,7,0,!n.active)})}var bm=Yr({encapsulation:0,styles:[['.mainContent[_ngcontent-%COMP%]{display:flex;height:calc(100vh - 50px);background-color:#7c4dff}.chat[_ngcontent-%COMP%]{display:flex;flex:5;order:2;flex-direction:column;transition:.3s}.blurred[_ngcontent-%COMP%]{color:rgba(0,0,0,.25);-webkit-filter:blur(4px) brightness(50%);filter:blur(4px) brightness(50%);transition:.3s}.userListWrapper[_ngcontent-%COMP%]{background-color:#2a2845;color:#fff;display:flex;font-family:"Open Sans",sans-serif;font-size:1.2em;flex:1;order:1;border-right:1px solid #222;overflow-x:hidden;overflow-y:auto}.feedWrapper[_ngcontent-%COMP%]{background:linear-gradient(181deg,rgba(100,200,255,.6),rgba(0,0,0,.9)),url(Solid_Pattern.9051b19429853f670436.png) center center no-repeat;font-family:"Open Sans",sans-serif;font-size:1.2em;display:flex;overflow-x:hidden;overflow-y:auto;flex-grow:1}.chatFormWrapper[_ngcontent-%COMP%]{height:50px;background-color:#7c4dff;padding:.1em}#scroll-style[_ngcontent-%COMP%]::-webkit-scrollbar-track{border-radius:10px;background-color:#f5f5f5}app-user-list[_ngcontent-%COMP%]{width:100%}']],data:{}});function wm(e){return qo(0,[Ao(402653184,1,{feedContainer:0}),(e()(),ki(1,0,null,null,12,"div",[["class","mainContent"]],null,null,null,null,null)),(e()(),ki(2,0,null,null,2,"div",[["class","userListWrapper"]],null,null,null,null,null)),(e()(),ki(3,0,null,null,1,"app-user-list",[],null,null,null,um,am)),po(4,49152,null,0,om,[vp],null,null),(e()(),ki(5,0,null,null,8,"div",[["class","chat"]],null,null,null,null,null)),po(6,278528,null,0,qs,[Xn,er,xn,_n],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),Uo(7,{blurred:0}),(e()(),ki(8,0,[[1,0],["scroller",1]],null,2,"div",[["class","feedWrapper"]],null,null,null,null,null)),(e()(),ki(9,0,null,null,1,"app-feed",[],null,null,null,gm,pm)),po(10,638976,null,0,hm,[vp],null,null),(e()(),ki(11,0,null,null,2,"div",[["class","chatFormWrapper"]],null,null,null,null,null)),(e()(),ki(12,0,null,null,1,"app-chat-form",[],null,null,null,vm,ym)),po(13,114688,null,0,mm,[vp],null,null)],function(e,t){var n=e(t,7,0,!t.component.active);e(t,6,0,"chat",n),e(t,10,0),e(t,13,0)},null)}function _m(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-chatroom",[],null,null,null,wm,bm)),po(1,8503296,null,0,bp,[vp],null,null)],function(e,t){e(t,1,0)},null)}var xm=qi("app-chatroom",bp,_m,{},{},[]),Sm=function(){function e(e,t){this.chatService=e,this.toastr=t,this.user=new dp("","Test","")}return e.prototype.ngOnInit=function(){},e.prototype.deleteUser=function(){this.removeFriend(this.user.webId)},e.prototype.removeFriend=function(e){""===e.trim()?this.toastr.error("Please add a webId","Wrong input"):this.chatService.removeFriend(e)},e}(),Em=Yr({encapsulation:0,styles:[[".userItem[_ngcontent-%COMP%]{height:auto;width:130%;padding:10px;align-items:flex-start;background-color:#201835;color:#a098a5;align-items:center;display:flex;transition:ease-in .2s}.userItem[_ngcontent-%COMP%]:hover{background-color:#453968;color:#ddd;transition:ease-in .1s}.profilePic[_ngcontent-%COMP%]{border-radius:100%;border-width:1em;width:2em;height:2em;margin-right:1em}.online[_ngcontent-%COMP%]{border-color:#0fa}.busy[_ngcontent-%COMP%]{border-color:#fb0}.offline[_ngcontent-%COMP%]{border-color:#888}.status[_ngcontent-%COMP%]{border:1px solid #000;display:inline-block;min-width:10px;min-height:10px;border-radius:50%;margin:10px 12px 0 10px}.userName[_ngcontent-%COMP%]{display:inline-block}button[_ngcontent-%COMP%]{position:relative;left:15px;width:30px;height:30px;border-radius:5px;margin:0;padding:.3em .4em;font-size:.7em;font-family:'Droid Sans',sans-serif;background-color:#2a2845;color:#fff;transition:.2s ease-out;min-width:50px}"]],data:{}});function km(e){return qo(0,[(e()(),ki(0,0,null,null,5,"div",[["class","userItem"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,0,"img",[["class","profilePic"]],[[8,"src",4]],null,null,null,null)),(e()(),ki(2,0,null,null,1,"span",[["class","userName"]],null,null,null,null,null)),(e()(),Vo(3,null,[" "," "])),(e()(),ki(4,0,null,null,1,"button",[],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.deleteUser()&&r),r},null,null)),(e()(),Vo(-1,null,["Delete"]))],null,function(e,t){var n=t.component;e(t,1,0,n.user.profilePicture),e(t,3,0,n.user.username)})}var Cm=function(){return function(e){var t=this;e.getUsers().subscribe(function(e){t.users=e})}}(),Tm=Yr({encapsulation:0,styles:[[".button[_ngcontent-%COMP%]{width:50px;border-radius:5px;margin:0;padding:.3em .4em;font-size:1.3em;font-family:'Droid Sans',sans-serif;background-color:#2a2845;color:#fff;transition:.2s ease-out;min-width:50px}"]],data:{}});function Om(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-user-settings-item",[],null,null,null,km,Em)),po(1,114688,null,0,Sm,[vp,Tl],{user:[0,"user"]},null)],function(e,t){e(t,1,0,t.context.$implicit)},null)}function Im(e){return qo(0,[(e()(),ki(0,0,null,null,2,"div",[["class","userSettingsList"]],null,null,null,null,null)),(e()(),Ei(16777216,null,null,1,null,Om)),po(2,278528,null,0,Ws,[Pn,In,Xn],{ngForOf:[0,"ngForOf"]},null)],function(e,t){e(t,2,0,t.component.users)},null)}var Pm=Yr({encapsulation:0,styles:[[".settingsFormWrapper[_ngcontent-%COMP%]{display:flex;flex-direction:column;font-family:\"Open Sans\",sans-serif;width:100%;height:calc(100vh - 50px);background:linear-gradient(181deg,rgba(100,200,255,.6),rgba(0,0,0,.9)),url(Solid_Pattern.9051b19429853f670436.png) center center no-repeat}h2[_ngcontent-%COMP%]{margin-top:.2em;margin-bottom:.4em}.setting[_ngcontent-%COMP%]{margin:5em;padding:1em;border-radius:1em;background-color:#7c4dff;box-shadow:4px 4px 5px 0 rgba(0,0,0,.67)}.setting[_ngcontent-%COMP%] > p[_ngcontent-%COMP%]{margin:.25em;color:#171d1d}#listOfUsers[_ngcontent-%COMP%]{width:40%;height:160px}.group[_ngcontent-%COMP%]{display:flex;margin:.6em}.textInput[_ngcontent-%COMP%]{border-radius:5px;margin:.3em;padding:.2em;font-size:1.3em;font-family:'Open Sans',sans-serif;background-color:#eee;color:#000;flex-grow:1}.button[_ngcontent-%COMP%]{width:150px;border-radius:5px;margin:0;padding:.3em .4em;font-size:1.3em;font-family:'Droid Sans',sans-serif;background-color:#2a2845;color:#fff;transition:.2s ease-out;min-width:50px}.userListWrapper[_ngcontent-%COMP%]{background-color:#2a2845;color:#fff;display:flex;font-family:\"Open Sans\",sans-serif;font-size:1.2em;flex:1;order:1;border-right:1px solid #222;overflow-x:hidden;overflow-y:auto}"]],data:{}});function Am(e){return qo(0,[(e()(),ki(0,0,null,null,5,"div",[["style","height:40px; padding-top:10px; position: relative;"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,0,"img",[["style","float: left; height: 32px; width: 32px; margin-top:-5px;"]],[[8,"src",4]],null,null,null,null)),(e()(),ki(2,0,null,null,1,"span",[["style","float: left; margin-left: 10px;"]],null,null,null,null,null)),(e()(),Vo(3,null,["",""])),(e()(),ki(4,0,null,null,0,"div",[["style","clear: both;"]],null,null,null,null,null)),(e()(),ki(5,0,null,null,0,"div",[["class","item-divider"]],null,null,null,null,null))],null,function(e,t){e(t,1,0,t.context.item.image),e(t,3,0,t.context.item.name)})}function Nm(e){return qo(0,[(e()(),ki(0,0,null,null,5,"input",[["class","wide-text"],["placeholder","Enter a provider"],["style","margin-top:10px; padding: 12px 10px; width: 340px; height: 16px; display: block; margin-left: auto; margin-right: auto;"],["type","text"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,1)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,1).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,1)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,1)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.customAddProviderUrl=n)&&r),r},null,null)),po(1,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(3,671744,null,0,Od,[[8,null],[8,null],[8,null],[6,$p]],{model:[0,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(5,16384,null,0,dd,[[4,ed]],null,null)],function(e,t){e(t,3,0,t.component.customAddProviderUrl)},function(e,t){e(t,0,0,eo(t,5).ngClassUntouched,eo(t,5).ngClassTouched,eo(t,5).ngClassPristine,eo(t,5).ngClassDirty,eo(t,5).ngClassValid,eo(t,5).ngClassInvalid,eo(t,5).ngClassPending)})}function Rm(e){return qo(0,[(e()(),ki(0,0,null,null,49,"div",[["class","settingsFormWrapper"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,48,"div",[["class","setting"]],null,null,null,null,null)),(e()(),ki(2,0,null,null,1,"h2",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Add a friend"])),(e()(),ki(4,0,null,null,3,"p",[],null,null,null,null,null)),(e()(),Vo(-1,null,[" Note: although this adds this user to your friends list, this does not mean that we you can chat with him/her. "])),(e()(),ki(6,0,null,null,0,"br",[],null,null,null,null,null)),(e()(),Vo(-1,null,[" The other user should add you to their list and then click on your profile in order to set everything up. "])),(e()(),ki(8,0,null,null,31,"div",[["class","group"]],null,null,null,null,null)),(e()(),ki(9,0,null,null,5,"input",[["class","textInput"],["placeholder","Enter your friend's username"]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"keydown"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"]],function(e,t,n){var r=!0,i=e.component;return"input"===t&&(r=!1!==eo(e,10)._handleInput(n.target.value)&&r),"blur"===t&&(r=!1!==eo(e,10).onTouched()&&r),"compositionstart"===t&&(r=!1!==eo(e,10)._compositionStart()&&r),"compositionend"===t&&(r=!1!==eo(e,10)._compositionEnd(n.target.value)&&r),"ngModelChange"===t&&(r=!1!==(i.webIdAddFriend=n)&&r),"keydown"===t&&(r=!1!==i.handleSubmit(n)&&r),r},null,null)),po(10,16384,null,0,Kp,[_n,xn,[2,Jp]],null,null),mo(1024,null,$p,function(e){return[e]},[Kp]),po(12,671744,null,0,Od,[[8,null],[8,null],[8,null],[6,$p]],{model:[0,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(14,16384,null,0,dd,[[4,ed]],null,null),(e()(),ki(15,0,null,null,22,"div",[],null,null,null,null,null)),(e()(),ki(16,0,null,null,19,"ng-select",[["bindLabel","name"],["bindValue","loginUrl"],["class","login-select ng-select"],["dropdownPosition","bottom"],["placeholder","Select ID Provider"],["role","listbox"],["style","width: 360px; height: 45px; margin-left: auto; margin-right: auto;"]],[[2,"ng-select-single",null],[2,"ng-select-typeahead",null],[2,"ng-select-multiple",null],[2,"ng-select-taggable",null],[2,"ng-select-searchable",null],[2,"ng-select-opened",null],[2,"ng-select-disabled",null],[2,"ng-select-filtered",null],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"keydown"]],function(e,t,n){var r=!0,i=e.component;return"keydown"===t&&(r=!1!==eo(e,17).handleKeyDown(n)&&r),"ngModelChange"===t&&(r=!1!==(i.selectedAddProviderUrl=n)&&r),r},jg,sg)),po(17,4964352,null,12,rg,[[8,"login-select"],[8,null],[8,null],tg,ng,xn,An,qd],{bindLabel:[0,"bindLabel"],bindValue:[1,"bindValue"],placeholder:[2,"placeholder"],dropdownPosition:[3,"dropdownPosition"],items:[4,"items"]},null),Ao(335544320,1,{optionTemplate:0}),Ao(335544320,2,{optgroupTemplate:0}),Ao(335544320,3,{labelTemplate:0}),Ao(335544320,4,{multiLabelTemplate:0}),Ao(335544320,5,{headerTemplate:0}),Ao(335544320,6,{footerTemplate:0}),Ao(335544320,7,{notFoundTemplate:0}),Ao(335544320,8,{typeToSearchTemplate:0}),Ao(335544320,9,{loadingTextTemplate:0}),Ao(335544320,10,{tagTemplate:0}),Ao(335544320,11,{loadingSpinnerTemplate:0}),Ao(603979776,12,{ngOptions:1}),mo(1024,null,$p,function(e){return[e]},[rg]),po(31,671744,null,0,Od,[[8,null],[8,null],[8,null],[6,$p]],{model:[0,"model"]},{update:"ngModelChange"}),mo(2048,null,ed,null,[Od]),po(33,16384,null,0,dd,[[4,ed]],null,null),(e()(),Ei(0,[[1,2]],null,1,null,Am)),po(35,16384,null,0,zd,[In],null,null),(e()(),Ei(16777216,null,null,1,null,Nm)),po(37,16384,null,0,Gs,[Pn,In],{ngIf:[0,"ngIf"]},null),(e()(),ki(38,0,null,null,1,"button",[["class","button"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.addFriend()&&r),r},null,null)),(e()(),Vo(-1,null,["Add friend"])),(e()(),ki(40,0,null,null,1,"h2",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Remove a friend"])),(e()(),ki(42,0,null,null,1,"p",[],null,null,null,null,null)),(e()(),Vo(-1,null,[" Note: this will delete a friend from your POD and (IMPORTANT!) all the messages that you have sent. "])),(e()(),ki(44,0,null,null,3,"div",[["class","group"],["id","listOfUsers"]],null,null,null,null,null)),(e()(),ki(45,0,null,null,2,"div",[["class","userListWrapper"]],null,null,null,null,null)),(e()(),ki(46,0,null,null,1,"app-user-settings-list",[],null,null,null,Im,Tm)),po(47,49152,null,0,Cm,[vp],null,null),(e()(),ki(48,0,null,null,1,"button",[["class","button"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.removeFriend()&&r),r},null,null)),(e()(),Vo(-1,null,["Remove friend"]))],function(e,t){var n=t.component;e(t,12,0,n.webIdAddFriend),e(t,17,0,"name","loginUrl","Select ID Provider","bottom",n.identityProviders),e(t,31,0,n.selectedAddProviderUrl),e(t,37,0,null===n.selectedAddProviderUrl)},function(e,t){e(t,9,0,eo(t,14).ngClassUntouched,eo(t,14).ngClassTouched,eo(t,14).ngClassPristine,eo(t,14).ngClassDirty,eo(t,14).ngClassValid,eo(t,14).ngClassInvalid,eo(t,14).ngClassPending),e(t,16,1,[!eo(t,17).multiple,eo(t,17).typeahead,eo(t,17).multiple,eo(t,17).addTag,eo(t,17).searchable,eo(t,17).isOpen,eo(t,17).disabled,eo(t,17).filtered,eo(t,33).ngClassUntouched,eo(t,33).ngClassTouched,eo(t,33).ngClassPristine,eo(t,33).ngClassDirty,eo(t,33).ngClassValid,eo(t,33).ngClassInvalid,eo(t,33).ngClassPending])})}function jm(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-settings",[],null,null,null,Rm,Pm)),po(1,114688,null,0,wp,[vp,Tl,ip,Th],null,null)],function(e,t){e(t,1,0)},null)}var Dm=qi("app-settings",wp,jm,{},{},[]),Mm=Yr({encapsulation:0,styles:[['.main[_ngcontent-%COMP%]{display:flex;flex-direction:column;font-family:"Open Sans",sans-serif;width:100%;height:calc(100vh - 50px);color:#000;background:linear-gradient(181deg,rgba(100,200,255,.6),rgba(0,0,0,.9)),url(Solid_Pattern.9051b19429853f670436.png) center center no-repeat}.question[_ngcontent-%COMP%]{margin:1.5em;padding:1em;border-radius:1em;background-color:#7c4dff;box-shadow:4px 4px 5px 0 rgba(0,0,0,.67)}.description[_ngcontent-%COMP%]{color:#fff}']],data:{}});function Lm(e){return qo(0,[(e()(),ki(0,0,null,null,22,"div",[["class","main"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,1,"h1",[["class","description"]],null,null,null,null,null)),(e()(),Vo(-1,null,["Here there is a recopilation of questions frequently asqued of how to use DeChat:"])),(e()(),ki(3,0,null,null,4,"section",[["class","question"]],null,null,null,null,null)),(e()(),ki(4,0,null,null,1,"h2",[["class","query"]],null,null,null,null,null)),(e()(),Vo(-1,null,["How can I add friends?"])),(e()(),ki(6,0,null,null,1,"p",[["class","answer"]],null,null,null,null,null)),(e()(),Vo(-1,null,[' You simply have to go to the "Settings" section in the navigation bar. Then you select the username of your friend, as well as one provider, and you click on the "Add Friend" button. '])),(e()(),ki(8,0,null,null,4,"section",[["class","question"]],null,null,null,null,null)),(e()(),ki(9,0,null,null,1,"h2",[["class","query"]],null,null,null,null,null)),(e()(),Vo(-1,null,["How can I start a chat with a friend?"])),(e()(),ki(11,0,null,null,1,"p",[["class","answer"]],null,null,null,null,null)),(e()(),Vo(-1,null,[" Go to the right section on the chat, where your friends are listed, and click on his name. Now you must click on the chat form, and your friend too. Then you should be able to talk with him. "])),(e()(),ki(13,0,null,null,4,"section",[["class","question"]],null,null,null,null,null)),(e()(),ki(14,0,null,null,1,"h2",[["class","query"]],null,null,null,null,null)),(e()(),Vo(-1,null,["With which providers can I log in?"])),(e()(),ki(16,0,null,null,1,"p",[["class","answer"]],null,null,null,null,null)),(e()(),Vo(-1,null,[" There exist three ways to log in the application.You can use a Solid account, using Inrupt, or with an specific web id. "])),(e()(),ki(18,0,null,null,4,"section",[["class","question"]],null,null,null,null,null)),(e()(),ki(19,0,null,null,1,"h2",[["class","query"]],null,null,null,null,null)),(e()(),Vo(-1,null,["Can I cange my personal data in the application?"])),(e()(),ki(21,0,null,null,1,"p",[["class","answer"]],null,null,null,null,null)),(e()(),Vo(-1,null,[' Yes, you can go to the "Profile" section and add or modify the information as you want. ']))],null,null)}function Um(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-help-component",[],null,null,null,Lm,Mm)),po(1,114688,null,0,_p,[],null,null)],function(e,t){e(t,1,0)},null)}var Fm=qi("app-help-component",_p,Um,{},{},[]),Vm=Yr({encapsulation:0,styles:[[".registration[_ngcontent-%COMP%]{text-align:center;font-family:Roboto,sans-serif}.registration[_ngcontent-%COMP%] .header-bar[_ngcontent-%COMP%]{margin:0;height:44px;width:calc(100% + 16px);background-color:#3d6deb;color:#fff;position:absolute;top:0;left:0}.registration[_ngcontent-%COMP%] .header-bar[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-align:center;font-family:Roboto,sans-serif;font-weight:700;font-size:14px;letter-spacing:1px;line-height:15px}.registration[_ngcontent-%COMP%] .header-text[_ngcontent-%COMP%]{margin-top:92px;width:360px;margin-left:auto;margin-right:auto;font-size:14px;color:#666}.registration[_ngcontent-%COMP%] .header-text[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#666;font-size:12px}.registration[_ngcontent-%COMP%] .provider-card-container[_ngcontent-%COMP%]{margin-top:28px}.registration[_ngcontent-%COMP%] .provider-card[_ngcontent-%COMP%]{height:140px;width:320px;border:1px solid #dae0e6;border-radius:2px;background-color:#fff;margin:10px;display:inline-block;box-shadow:#dae0e6 1px 1px 6px}.registration[_ngcontent-%COMP%] .provider-card[_ngcontent-%COMP%] .provider-logo[_ngcontent-%COMP%]{height:44px;width:44px;margin-left:auto;margin-right:auto;margin-top:16px}.registration[_ngcontent-%COMP%] .provider-card[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{color:#656e75;font-size:18px;margin-top:-2px;letter-spacing:.9px;line-height:24px}.registration[_ngcontent-%COMP%] .provider-card[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:#656e75;font-size:12px;line-height:16px}"]],data:{}});function Bm(e){return qo(0,[(e()(),ki(0,0,null,null,5,"div",[["class","provider-card"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,0,"img",[["class","provider-logo"]],[[8,"src",4]],null,null,null,null)),(e()(),ki(2,0,null,null,1,"h2",[],null,null,null,null,null)),(e()(),Vo(3,null,["",""])),(e()(),ki(4,0,null,null,1,"p",[],null,null,null,null,null)),(e()(),Vo(5,null,["",""]))],null,function(e,t){e(t,1,0,t.context.$implicit.image),e(t,3,0,t.context.$implicit.name),e(t,5,0,t.context.$implicit.desc)})}function zm(e){return qo(0,[(e()(),ki(0,0,null,null,11,"div",[["class","registration"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,2,"div",[["class","header-bar"]],null,null,null,null,null)),(e()(),ki(2,0,null,null,1,"p",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Select Solid Identity Provider"])),(e()(),ki(4,0,null,null,4,"div",[["class","header-text"]],null,null,null,null,null)),(e()(),ki(5,0,null,null,1,"p",[],null,null,null,null,null)),(e()(),Vo(-1,null,[" With a Solid Identity your personal data is stored securely in a POD. You control who has access to it. "])),(e()(),ki(7,0,null,null,1,"a",[["href","https://solid.mit.edu"],["target","_blank"]],null,null,null,null,null)),(e()(),Vo(-1,null,[" Learn more about Solid IDs and PODs "])),(e()(),ki(9,0,null,null,2,"div",[["class","provider-card-container"]],null,null,null,null,null)),(e()(),Ei(16777216,null,null,1,null,Bm)),po(11,278528,null,0,Ws,[Pn,In,Xn],{ngForOf:[0,"ngForOf"]},null)],function(e,t){e(t,11,0,t.component.availableProviders)},null)}function qm(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-register",[],null,null,null,zm,Vm)),po(1,114688,null,0,hp,[ip],null,null)],function(e,t){e(t,1,0)},null)}var Hm=qi("app-register",hp,qm,{},{},[]),Wm=function(){function e(e){this.authService=e}return e.prototype.ngOnInit=function(){},e.prototype.logout=function(){this.authService.solidSignOut()},e}(),$m=Yr({encapsulation:0,styles:[[".topnav[_ngcontent-%COMP%]{width:100%;background-color:#7c4dff;height:50px;color:#fff}.topnav[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%]{height:80%;margin-left:10px;padding-top:5px}.topnav[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{text-decoration:none;color:inherit}.topnav[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{background-color:rgba(0,0,0,.25)}.topnav[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:active{background-color:rgba(0,0,0,.5);box-shadow:inset 0 0 15px 6px rgba(0,0,0,.25)}.topnav[_ngcontent-%COMP%] .logoText[_ngcontent-%COMP%]{display:inline-block;font-family:'Roboto Slab',serif;font-size:24px;font-weight:700;text-transform:uppercase;line-height:32px;padding-right:80px;position:relative;top:-8px;left:28px}.topnav[_ngcontent-%COMP%] .menu-item[_ngcontent-%COMP%]{display:inline-block;background-color:#7c4dff;color:#fff;font-size:15px;line-height:13px;width:150px;height:100%;text-align:center}.topnav[_ngcontent-%COMP%] .menu-item[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{font-size:24px;margin-top:8px;margin-bottom:2px}.topnav[_ngcontent-%COMP%] .profile-menu[_ngcontent-%COMP%]{float:right}.topnav[_ngcontent-%COMP%] .profile-menu[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{display:block;height:30px;width:30px;border-radius:50%;margin:10px auto 0;cursor:pointer}.loading-image[_ngcontent-%COMP%]{text-align:center;margin-top:50px}"]],data:{}});function Gm(e){return qo(0,[(e()(),ki(0,0,null,null,42,"div",[["class","topnav"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,41,"div",[["class","topnav"]],null,null,null,null,null)),(e()(),ki(2,0,null,null,0,"img",[["class","logo"],["src","../assets/images/Solid.png"]],null,null,null,null,null)),(e()(),ki(3,0,null,null,1,"span",[["class","logoText"]],null,null,null,null,null)),(e()(),Vo(-1,null,["Solid DeChat"])),(e()(),ki(5,0,null,null,6,"a",[["class","menu-item"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==eo(e,6).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),po(6,671744,null,0,Ph,[Th,Vf,ts],{routerLink:[0,"routerLink"]},null),Lo(7,1),(e()(),ki(8,0,null,null,1,"div",[],null,null,null,null,null)),(e()(),ki(9,0,null,null,0,"i",[["class","far fa-comments"]],null,null,null,null,null)),(e()(),ki(10,0,null,null,1,"span",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Chat"])),(e()(),ki(12,0,null,null,6,"a",[["class","menu-item"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==eo(e,13).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),po(13,671744,null,0,Ph,[Th,Vf,ts],{routerLink:[0,"routerLink"]},null),Lo(14,1),(e()(),ki(15,0,null,null,1,"div",[],null,null,null,null,null)),(e()(),ki(16,0,null,null,0,"i",[["class","fas fa-sliders-h"]],null,null,null,null,null)),(e()(),ki(17,0,null,null,1,"span",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Settings"])),(e()(),ki(19,0,null,null,6,"a",[["class","menu-item"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==eo(e,20).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),po(20,671744,null,0,Ph,[Th,Vf,ts],{routerLink:[0,"routerLink"]},null),Lo(21,1),(e()(),ki(22,0,null,null,1,"div",[],null,null,null,null,null)),(e()(),ki(23,0,null,null,0,"i",[["class","fas fa-question"]],null,null,null,null,null)),(e()(),ki(24,0,null,null,1,"span",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Help"])),(e()(),ki(26,0,null,null,6,"a",[["class","menu-item"]],[[1,"target",0],[8,"href",4]],[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==eo(e,27).onClick(n.button,n.ctrlKey,n.metaKey,n.shiftKey)&&r),r},null,null)),po(27,671744,null,0,Ph,[Th,Vf,ts],{routerLink:[0,"routerLink"]},null),Lo(28,1),(e()(),ki(29,0,null,null,1,"div",[],null,null,null,null,null)),(e()(),ki(30,0,null,null,0,"i",[["class","fas fa-user"]],null,null,null,null,null)),(e()(),ki(31,0,null,null,1,"span",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Solid Profile"])),(e()(),ki(33,0,null,null,4,"a",[["class","menu-item profile-menu"]],null,[[null,"click"]],function(e,t,n){var r=!0;return"click"===t&&(r=!1!==e.component.logout()&&r),r},null,null)),(e()(),ki(34,0,null,null,1,"div",[],null,null,null,null,null)),(e()(),ki(35,0,null,null,0,"i",[["class","fas fa-sign-out-alt"]],null,null,null,null,null)),(e()(),ki(36,0,null,null,1,"span",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Sign out"])),(e()(),ki(38,0,null,null,4,"a",[["class","menu-item profile-menu"],["href","https://arquisoft.github.io/dechat_en1b/docs/"]],null,null,null,null,null)),(e()(),ki(39,0,null,null,1,"div",[],null,null,null,null,null)),(e()(),ki(40,0,null,null,0,"i",[["class","fas fa-file-alt"]],null,null,null,null,null)),(e()(),ki(41,0,null,null,1,"span",[],null,null,null,null,null)),(e()(),Vo(-1,null,["Documentation"]))],function(e,t){var n=e(t,7,0,"/chat");e(t,6,0,n);var r=e(t,14,0,"/settings");e(t,13,0,r);var i=e(t,21,0,"/help");e(t,20,0,i);var o=e(t,28,0,"/card");e(t,27,0,o)},function(e,t){e(t,5,0,eo(t,6).target,eo(t,6).href),e(t,12,0,eo(t,13).target,eo(t,13).href),e(t,19,0,eo(t,20).target,eo(t,20).href),e(t,26,0,eo(t,27).target,eo(t,27).href)})}var Jm=Yr({encapsulation:0,styles:[[""]],data:{}});function Km(e){return qo(0,[(e()(),ki(0,0,null,null,5,"div",[["class","chatRoom"]],null,null,null,null,null)),(e()(),ki(1,0,null,null,2,"div",[["class","chatHeaderWrapper"]],null,null,null,null,null)),(e()(),ki(2,0,null,null,1,"app-navbar",[],null,null,null,Gm,$m)),po(3,114688,null,0,Wm,[ip],null,null),(e()(),ki(4,16777216,null,null,1,"router-outlet",[],null,null,null,null,null)),po(5,212992,null,0,jh,[Rh,Pn,Ut,[8,null],An],null,null)],function(e,t){e(t,3,0),e(t,5,0)},null)}function Qm(e){return qo(0,[(e()(),ki(0,0,null,null,1,"app-root",[],null,null,null,Km,Jm)),po(1,49152,null,0,Sp,[],null,null)],null,null)}var Ym=qi("app-root",Sp,Qm,{},{},[]),Zm=function(){return function(){}}(),Xm=function(){return function(){}}(),ey="*";function ty(e,t){return void 0===t&&(t=null),{type:2,steps:e,options:t}}function ny(e){return{type:6,styles:e,offset:null}}function ry(e){Promise.resolve(null).then(e)}var iy=function(){function e(e,t){void 0===e&&(e=0),void 0===t&&(t=0),this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this._destroyed=!1,this._finished=!1,this.parentPlayer=null,this.totalTime=e+t}return e.prototype._onFinish=function(){this._finished||(this._finished=!0,this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[])},e.prototype.onStart=function(e){this._onStartFns.push(e)},e.prototype.onDone=function(e){this._onDoneFns.push(e)},e.prototype.onDestroy=function(e){this._onDestroyFns.push(e)},e.prototype.hasStarted=function(){return this._started},e.prototype.init=function(){},e.prototype.play=function(){this.hasStarted()||(this._onStart(),this.triggerMicrotask()),this._started=!0},e.prototype.triggerMicrotask=function(){var e=this;ry(function(){return e._onFinish()})},e.prototype._onStart=function(){this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[]},e.prototype.pause=function(){},e.prototype.restart=function(){},e.prototype.finish=function(){this._onFinish()},e.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.hasStarted()||this._onStart(),this.finish(),this._onDestroyFns.forEach(function(e){return e()}),this._onDestroyFns=[])},e.prototype.reset=function(){},e.prototype.setPosition=function(e){},e.prototype.getPosition=function(){return 0},e.prototype.triggerCallback=function(e){var t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(function(e){return e()}),t.length=0},e}(),oy=function(){function e(e){var t=this;this._onDoneFns=[],this._onStartFns=[],this._finished=!1,this._started=!1,this._destroyed=!1,this._onDestroyFns=[],this.parentPlayer=null,this.totalTime=0,this.players=e;var n=0,r=0,i=0,o=this.players.length;0==o?ry(function(){return t._onFinish()}):this.players.forEach(function(e){e.onDone(function(){++n==o&&t._onFinish()}),e.onDestroy(function(){++r==o&&t._onDestroy()}),e.onStart(function(){++i==o&&t._onStart()})}),this.totalTime=this.players.reduce(function(e,t){return Math.max(e,t.totalTime)},0)}return e.prototype._onFinish=function(){this._finished||(this._finished=!0,this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[])},e.prototype.init=function(){this.players.forEach(function(e){return e.init()})},e.prototype.onStart=function(e){this._onStartFns.push(e)},e.prototype._onStart=function(){this.hasStarted()||(this._started=!0,this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[])},e.prototype.onDone=function(e){this._onDoneFns.push(e)},e.prototype.onDestroy=function(e){this._onDestroyFns.push(e)},e.prototype.hasStarted=function(){return this._started},e.prototype.play=function(){this.parentPlayer||this.init(),this._onStart(),this.players.forEach(function(e){return e.play()})},e.prototype.pause=function(){this.players.forEach(function(e){return e.pause()})},e.prototype.restart=function(){this.players.forEach(function(e){return e.restart()})},e.prototype.finish=function(){this._onFinish(),this.players.forEach(function(e){return e.finish()})},e.prototype.destroy=function(){this._onDestroy()},e.prototype._onDestroy=function(){this._destroyed||(this._destroyed=!0,this._onFinish(),this.players.forEach(function(e){return e.destroy()}),this._onDestroyFns.forEach(function(e){return e()}),this._onDestroyFns=[])},e.prototype.reset=function(){this.players.forEach(function(e){return e.reset()}),this._destroyed=!1,this._finished=!1,this._started=!1},e.prototype.setPosition=function(e){var t=e*this.totalTime;this.players.forEach(function(e){var n=e.totalTime?Math.min(1,t/e.totalTime):1;e.setPosition(n)})},e.prototype.getPosition=function(){var e=0;return this.players.forEach(function(t){var n=t.getPosition();e=Math.min(n,e)}),e},e.prototype.beforeDestroy=function(){this.players.forEach(function(e){e.beforeDestroy&&e.beforeDestroy()})},e.prototype.triggerCallback=function(e){var t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(function(e){return e()}),t.length=0},e}(),ay="!";function sy(){return"undefined"!=typeof process}function uy(e){switch(e.length){case 0:return new iy;case 1:return e[0];default:return new oy(e)}}function ly(e,t,n,r,i,o){void 0===i&&(i={}),void 0===o&&(o={});var a=[],s=[],u=-1,l=null;if(r.forEach(function(e){var n=e.offset,r=n==u,c=r&&l||{};Object.keys(e).forEach(function(n){var r=n,s=e[n];if("offset"!==n)switch(r=t.normalizePropertyName(r,a),s){case ay:s=i[n];break;case ey:s=o[n];break;default:s=t.normalizeStyleValue(n,r,s,a)}c[r]=s}),r||s.push(c),l=c,u=n}),a.length)throw new Error("Unable to animate due to the following errors:\n - "+a.join("\n - "));return s}function cy(e,t,n,r){switch(t){case"start":e.onStart(function(){return r(n&&fy(n,"start",e))});break;case"done":e.onDone(function(){return r(n&&fy(n,"done",e))});break;case"destroy":e.onDestroy(function(){return r(n&&fy(n,"destroy",e))})}}function fy(e,t,n){var r=n.totalTime,i=hy(e.element,e.triggerName,e.fromState,e.toState,t||e.phaseName,null==r?e.totalTime:r,!!n.disabled),o=e._data;return null!=o&&(i._data=o),i}function hy(e,t,n,r,i,o,a){return void 0===i&&(i=""),void 0===o&&(o=0),{element:e,triggerName:t,fromState:n,toState:r,phaseName:i,totalTime:o,disabled:!!a}}function py(e,t,n){var r;return e instanceof Map?(r=e.get(t))||e.set(t,r=n):(r=e[t])||(r=e[t]=n),r}function dy(e){var t=e.indexOf(":");return[e.substring(1,t),e.substr(t+1)]}var gy=function(e,t){return!1},my=function(e,t){return!1},yy=function(e,t,n){return[]},vy=sy();if(vy||"undefined"!=typeof Element){if(gy=function(e,t){return e.contains(t)},vy||Element.prototype.matches)my=function(e,t){return e.matches(t)};else{var by=Element.prototype,wy=by.matchesSelector||by.mozMatchesSelector||by.msMatchesSelector||by.oMatchesSelector||by.webkitMatchesSelector;wy&&(my=function(e,t){return wy.apply(e,[t])})}yy=function(e,t,n){var r=[];if(n)r.push.apply(r,c(e.querySelectorAll(t)));else{var i=e.querySelector(t);i&&r.push(i)}return r}}var _y=null,xy=!1;function Sy(e){_y||(_y=("undefined"!=typeof document?document.body:null)||{},xy=!!_y.style&&"WebkitAppearance"in _y.style);var t=!0;return _y.style&&!function(e){return"ebkit"==e.substring(1,6)}(e)&&!(t=e in _y.style)&&xy&&(t="Webkit"+e.charAt(0).toUpperCase()+e.substr(1)in _y.style),t}var Ey=my,ky=gy,Cy=yy;function Ty(e){var t={};return Object.keys(e).forEach(function(n){var r=n.replace(/([a-z])([A-Z])/g,"$1-$2");t[r]=e[n]}),t}var Oy=function(){function e(){}return e.prototype.validateStyleProperty=function(e){return Sy(e)},e.prototype.matchesElement=function(e,t){return Ey(e,t)},e.prototype.containsElement=function(e,t){return ky(e,t)},e.prototype.query=function(e,t,n){return Cy(e,t,n)},e.prototype.computeStyle=function(e,t,n){return n||""},e.prototype.animate=function(e,t,n,r,i,o,a){return void 0===o&&(o=[]),new iy(n,r)},e}(),Iy=function(){function e(){}return e.NOOP=new Oy,e}(),Py=1e3;function Ay(e){if("number"==typeof e)return e;var t=e.match(/^(-?[\.\d]+)(m?s)/);return!t||t.length<2?0:Ny(parseFloat(t[1]),t[2])}function Ny(e,t){switch(t){case"s":return e*Py;default:return e}}function Ry(e,t,n){return e.hasOwnProperty("duration")?e:function(e,t,n){var r,i=0,o="";if("string"==typeof e){var a=e.match(/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i);if(null===a)return t.push('The provided timing value "'+e+'" is invalid.'),{duration:0,delay:0,easing:""};r=Ny(parseFloat(a[1]),a[2]);var s=a[3];null!=s&&(i=Ny(Math.floor(parseFloat(s)),a[4]));var u=a[5];u&&(o=u)}else r=e;if(!n){var l=!1,c=t.length;r<0&&(t.push("Duration values below 0 are not allowed for this animation step."),l=!0),i<0&&(t.push("Delay values below 0 are not allowed for this animation step."),l=!0),l&&t.splice(c,0,'The provided timing value "'+e+'" is invalid.')}return{duration:r,delay:i,easing:o}}(e,t,n)}function jy(e,t){return void 0===t&&(t={}),Object.keys(e).forEach(function(n){t[n]=e[n]}),t}function Dy(e,t,n){if(void 0===n&&(n={}),t)for(var r in e)n[r]=e[r];else jy(e,n);return n}function My(e,t,n){return n?t+":"+n+";":""}function Ly(e){for(var t="",n=0;n *";case":leave":return"* => void";case":increment":return function(e,t){return parseFloat(t)>parseFloat(e)};case":decrement":return function(e,t){return parseFloat(t) *"}}(e,n);if("function"==typeof r)return void t.push(r);e=r}var i=e.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/);if(null==i||i.length<4)return n.push('The provided transition expression "'+e+'" is not supported'),t;var o=i[1],a=i[2],s=i[3];t.push(ev(o,s)),"<"!=a[0]||o==Yy&&s==Yy||t.push(ev(s,o))}(e,i,r)}):i.push(n),i),animation:o,queryCount:t.queryCount,depCount:t.depCount,options:av(e.options)}},e.prototype.visitSequence=function(e,t){var n=this;return{type:2,steps:e.steps.map(function(e){return Ky(n,e,t)}),options:av(e.options)}},e.prototype.visitGroup=function(e,t){var n=this,r=t.currentTime,i=0,o=e.steps.map(function(e){t.currentTime=r;var o=Ky(n,e,t);return i=Math.max(i,t.currentTime),o});return t.currentTime=i,{type:3,steps:o,options:av(e.options)}},e.prototype.visitAnimate=function(e,t){var n,r=function(e,t){var n=null;if(e.hasOwnProperty("duration"))n=e;else if("number"==typeof e)return sv(Ry(e,t).duration,0,"");var r=e;if(r.split(/\s+/).some(function(e){return"{"==e.charAt(0)&&"{"==e.charAt(1)})){var i=sv(0,0,"");return i.dynamic=!0,i.strValue=r,i}return sv((n=n||Ry(r,t)).duration,n.delay,n.easing)}(e.timings,t.errors);t.currentAnimateTimings=r;var i=e.styles?e.styles:ny({});if(5==i.type)n=this.visitKeyframes(i,t);else{var o=e.styles,a=!1;if(!o){a=!0;var s={};r.easing&&(s.easing=r.easing),o=ny(s)}t.currentTime+=r.duration+r.delay;var u=this.visitStyle(o,t);u.isEmptyStep=a,n=u}return t.currentAnimateTimings=null,{type:4,timings:r,style:n,options:null}},e.prototype.visitStyle=function(e,t){var n=this._makeStyleAst(e,t);return this._validateStyleAst(n,t),n},e.prototype._makeStyleAst=function(e,t){var n=[];Array.isArray(e.styles)?e.styles.forEach(function(e){"string"==typeof e?e==ey?n.push(e):t.errors.push("The provided style string value "+e+" is not allowed."):n.push(e)}):n.push(e.styles);var r=!1,i=null;return n.forEach(function(e){if(ov(e)){var t=e,n=t.easing;if(n&&(i=n,delete t.easing),!r)for(var o in t)if(t[o].toString().indexOf("{{")>=0){r=!0;break}}}),{type:6,styles:n,easing:i,offset:e.offset,containsDynamicStyles:r,options:null}},e.prototype._validateStyleAst=function(e,t){var n=this,r=t.currentAnimateTimings,i=t.currentTime,o=t.currentTime;r&&o>0&&(o-=r.duration+r.delay),e.styles.forEach(function(e){"string"!=typeof e&&Object.keys(e).forEach(function(r){if(n._driver.validateStyleProperty(r)){var a,s,u,l=t.collectedStyles[t.currentQuerySelector],c=l[r],f=!0;c&&(o!=i&&o>=c.startTime&&i<=c.endTime&&(t.errors.push('The CSS property "'+r+'" that exists between the times of "'+c.startTime+'ms" and "'+c.endTime+'ms" is also being animated in a parallel animation between the times of "'+o+'ms" and "'+i+'ms"'),f=!1),o=c.startTime),f&&(l[r]={startTime:o,endTime:i}),t.options&&(a=t.errors,s=t.options.params||{},(u=zy(e[r])).length&&u.forEach(function(e){s.hasOwnProperty(e)||a.push("Unable to resolve the local animation param "+e+" in the given list of values")}))}else t.errors.push('The provided animation property "'+r+'" is not a supported CSS property for animations')})})},e.prototype.visitKeyframes=function(e,t){var n=this,r={type:5,styles:[],options:null};if(!t.currentAnimateTimings)return t.errors.push("keyframes() must be placed inside of a call to animate()"),r;var i=0,o=[],a=!1,s=!1,u=0,l=e.steps.map(function(e){var r=n._makeStyleAst(e,t),l=null!=r.offset?r.offset:function(e){if("string"==typeof e)return null;var t=null;if(Array.isArray(e))e.forEach(function(e){if(ov(e)&&e.hasOwnProperty("offset")){var n=e;t=parseFloat(n.offset),delete n.offset}});else if(ov(e)&&e.hasOwnProperty("offset")){var n=e;t=parseFloat(n.offset),delete n.offset}return t}(r.styles),c=0;return null!=l&&(i++,c=r.offset=l),s=s||c<0||c>1,a=a||c0&&i0?i==h?1:f*i:o[i],s=a*g;t.currentTime=p+d.delay+s,d.duration=s,n._validateStyleAst(e,t),e.offset=a,r.styles.push(e)}),r},e.prototype.visitReference=function(e,t){return{type:8,animation:Ky(this,Vy(e.animation),t),options:av(e.options)}},e.prototype.visitAnimateChild=function(e,t){return t.depCount++,{type:9,options:av(e.options)}},e.prototype.visitAnimateRef=function(e,t){return{type:10,animation:this.visitReference(e.animation,t),options:av(e.options)}},e.prototype.visitQuery=function(e,t){var n=t.currentQuerySelector,r=e.options||{};t.queryCount++,t.currentQuery=e;var i=l(function(e){var t=!!e.split(/\s*,\s*/).find(function(e){return":self"==e});return t&&(e=e.replace(tv,"")),[e=e.replace(/@\*/g,".ng-trigger").replace(/@\w+/g,function(e){return".ng-trigger-"+e.substr(1)}).replace(/:animating/g,".ng-animating"),t]}(e.selector),2),o=i[0],a=i[1];t.currentQuerySelector=n.length?n+" "+o:o,py(t.collectedStyles,t.currentQuerySelector,{});var s=Ky(this,Vy(e.animation),t);return t.currentQuery=null,t.currentQuerySelector=n,{type:11,selector:o,limit:r.limit||0,optional:!!r.optional,includeSelf:a,animation:s,originalSelector:e.selector,options:av(e.options)}},e.prototype.visitStagger=function(e,t){t.currentQuery||t.errors.push("stagger() can only be used inside of query()");var n="full"===e.timings?{duration:0,delay:0,easing:"full"}:Ry(e.timings,t.errors,!0);return{type:12,animation:Ky(this,Vy(e.animation),t),timings:n,options:null}},e}(),iv=function(){return function(e){this.errors=e,this.queryCount=0,this.depCount=0,this.currentTransition=null,this.currentQuery=null,this.currentQuerySelector=null,this.currentAnimateTimings=null,this.currentTime=0,this.collectedStyles={},this.options=null}}();function ov(e){return!Array.isArray(e)&&"object"==typeof e}function av(e){var t;return e?(e=jy(e)).params&&(e.params=(t=e.params)?jy(t):null):e={},e}function sv(e,t,n){return{duration:e,delay:t,easing:n}}function uv(e,t,n,r,i,o,a,s){return void 0===a&&(a=null),void 0===s&&(s=!1),{type:1,element:e,keyframes:t,preStyleProps:n,postStyleProps:r,duration:i,delay:o,totalTime:i+o,easing:a,subTimeline:s}}var lv=function(){function e(){this._map=new Map}return e.prototype.consume=function(e){var t=this._map.get(e);return t?this._map.delete(e):t=[],t},e.prototype.append=function(e,t){var n=this._map.get(e);n||this._map.set(e,n=[]),n.push.apply(n,c(t))},e.prototype.has=function(e){return this._map.has(e)},e.prototype.clear=function(){this._map.clear()},e}(),cv=new RegExp(":enter","g"),fv=new RegExp(":leave","g");function hv(e,t,n,r,i,o,a,s,u,l){return void 0===o&&(o={}),void 0===a&&(a={}),void 0===l&&(l=[]),(new pv).buildKeyframes(e,t,n,r,i,o,a,s,u,l)}var pv=function(){function e(){}return e.prototype.buildKeyframes=function(e,t,n,r,i,o,a,s,u,l){void 0===l&&(l=[]),u=u||new lv;var c=new gv(e,t,u,r,i,l,[]);c.options=s,c.currentTimeline.setStyles([o],null,c.errors,s),Ky(this,n,c);var f=c.timelines.filter(function(e){return e.containsAnimation()});if(f.length&&Object.keys(a).length){var h=f[f.length-1];h.allowOnlyTimelineStyles()||h.setStyles([a],null,c.errors,s)}return f.length?f.map(function(e){return e.buildKeyframes()}):[uv(t,[],[],[],0,0,"",!1)]},e.prototype.visitTrigger=function(e,t){},e.prototype.visitState=function(e,t){},e.prototype.visitTransition=function(e,t){},e.prototype.visitAnimateChild=function(e,t){var n=t.subInstructions.consume(t.element);if(n){var r=t.createSubContext(e.options),i=t.currentTimeline.currentTime,o=this._visitSubInstructions(n,r,r.options);i!=o&&t.transformIntoNewTimeline(o)}t.previousNode=e},e.prototype.visitAnimateRef=function(e,t){var n=t.createSubContext(e.options);n.transformIntoNewTimeline(),this.visitReference(e.animation,n),t.transformIntoNewTimeline(n.currentTimeline.currentTime),t.previousNode=e},e.prototype._visitSubInstructions=function(e,t,n){var r=t.currentTimeline.currentTime,i=null!=n.duration?Ay(n.duration):null,o=null!=n.delay?Ay(n.delay):null;return 0!==i&&e.forEach(function(e){var n=t.appendInstructionToTimeline(e,i,o);r=Math.max(r,n.duration+n.delay)}),r},e.prototype.visitReference=function(e,t){t.updateOptions(e.options,!0),Ky(this,e.animation,t),t.previousNode=e},e.prototype.visitSequence=function(e,t){var n=this,r=t.subContextCount,i=t,o=e.options;if(o&&(o.params||o.delay)&&((i=t.createSubContext(o)).transformIntoNewTimeline(),null!=o.delay)){6==i.previousNode.type&&(i.currentTimeline.snapshotCurrentStyles(),i.previousNode=dv);var a=Ay(o.delay);i.delayNextStep(a)}e.steps.length&&(e.steps.forEach(function(e){return Ky(n,e,i)}),i.currentTimeline.applyStylesToKeyframe(),i.subContextCount>r&&i.transformIntoNewTimeline()),t.previousNode=e},e.prototype.visitGroup=function(e,t){var n=this,r=[],i=t.currentTimeline.currentTime,o=e.options&&e.options.delay?Ay(e.options.delay):0;e.steps.forEach(function(a){var s=t.createSubContext(e.options);o&&s.delayNextStep(o),Ky(n,a,s),i=Math.max(i,s.currentTimeline.currentTime),r.push(s.currentTimeline)}),r.forEach(function(e){return t.currentTimeline.mergeTimelineCollectedStyles(e)}),t.transformIntoNewTimeline(i),t.previousNode=e},e.prototype._visitTiming=function(e,t){if(e.dynamic){var n=e.strValue;return Ry(t.params?qy(n,t.params,t.errors):n,t.errors)}return{duration:e.duration,delay:e.delay,easing:e.easing}},e.prototype.visitAnimate=function(e,t){var n=t.currentAnimateTimings=this._visitTiming(e.timings,t),r=t.currentTimeline;n.delay&&(t.incrementTime(n.delay),r.snapshotCurrentStyles());var i=e.style;5==i.type?this.visitKeyframes(i,t):(t.incrementTime(n.duration),this.visitStyle(i,t),r.applyStylesToKeyframe()),t.currentAnimateTimings=null,t.previousNode=e},e.prototype.visitStyle=function(e,t){var n=t.currentTimeline,r=t.currentAnimateTimings;!r&&n.getCurrentStyleProperties().length&&n.forwardFrame();var i=r&&r.easing||e.easing;e.isEmptyStep?n.applyEmptyStep(i):n.setStyles(e.styles,i,t.errors,t.options),t.previousNode=e},e.prototype.visitKeyframes=function(e,t){var n=t.currentAnimateTimings,r=t.currentTimeline.duration,i=n.duration,o=t.createSubContext().currentTimeline;o.easing=n.easing,e.styles.forEach(function(e){o.forwardTime((e.offset||0)*i),o.setStyles(e.styles,e.easing,t.errors,t.options),o.applyStylesToKeyframe()}),t.currentTimeline.mergeTimelineCollectedStyles(o),t.transformIntoNewTimeline(r+i),t.previousNode=e},e.prototype.visitQuery=function(e,t){var n=this,r=t.currentTimeline.currentTime,i=e.options||{},o=i.delay?Ay(i.delay):0;o&&(6===t.previousNode.type||0==r&&t.currentTimeline.getCurrentStyleProperties().length)&&(t.currentTimeline.snapshotCurrentStyles(),t.previousNode=dv);var a=r,s=t.invokeQuery(e.selector,e.originalSelector,e.limit,e.includeSelf,!!i.optional,t.errors);t.currentQueryTotal=s.length;var u=null;s.forEach(function(r,i){t.currentQueryIndex=i;var s=t.createSubContext(e.options,r);o&&s.delayNextStep(o),r===t.element&&(u=s.currentTimeline),Ky(n,e.animation,s),s.currentTimeline.applyStylesToKeyframe(),a=Math.max(a,s.currentTimeline.currentTime)}),t.currentQueryIndex=0,t.currentQueryTotal=0,t.transformIntoNewTimeline(a),u&&(t.currentTimeline.mergeTimelineCollectedStyles(u),t.currentTimeline.snapshotCurrentStyles()),t.previousNode=e},e.prototype.visitStagger=function(e,t){var n=t.parentContext,r=t.currentTimeline,i=e.timings,o=Math.abs(i.duration),a=o*(t.currentQueryTotal-1),s=o*t.currentQueryIndex;switch(i.duration<0?"reverse":i.easing){case"reverse":s=a-s;break;case"full":s=n.currentStaggerTime}var u=t.currentTimeline;s&&u.delayNextStep(s);var l=u.currentTime;Ky(this,e.animation,t),t.previousNode=e,n.currentStaggerTime=r.currentTime-l+(r.startTime-n.currentTimeline.startTime)},e}(),dv={},gv=function(){function e(e,t,n,r,i,o,a,s){this._driver=e,this.element=t,this.subInstructions=n,this._enterClassName=r,this._leaveClassName=i,this.errors=o,this.timelines=a,this.parentContext=null,this.currentAnimateTimings=null,this.previousNode=dv,this.subContextCount=0,this.options={},this.currentQueryIndex=0,this.currentQueryTotal=0,this.currentStaggerTime=0,this.currentTimeline=s||new mv(this._driver,t,0),a.push(this.currentTimeline)}return Object.defineProperty(e.prototype,"params",{get:function(){return this.options.params},enumerable:!0,configurable:!0}),e.prototype.updateOptions=function(e,t){var n=this;if(e){var r=e,i=this.options;null!=r.duration&&(i.duration=Ay(r.duration)),null!=r.delay&&(i.delay=Ay(r.delay));var o=r.params;if(o){var a=i.params;a||(a=this.options.params={}),Object.keys(o).forEach(function(e){t&&a.hasOwnProperty(e)||(a[e]=qy(o[e],a,n.errors))})}}},e.prototype._copyOptions=function(){var e={};if(this.options){var t=this.options.params;if(t){var n=e.params={};Object.keys(t).forEach(function(e){n[e]=t[e]})}}return e},e.prototype.createSubContext=function(t,n,r){void 0===t&&(t=null);var i=n||this.element,o=new e(this._driver,i,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(i,r||0));return o.previousNode=this.previousNode,o.currentAnimateTimings=this.currentAnimateTimings,o.options=this._copyOptions(),o.updateOptions(t),o.currentQueryIndex=this.currentQueryIndex,o.currentQueryTotal=this.currentQueryTotal,o.parentContext=this,this.subContextCount++,o},e.prototype.transformIntoNewTimeline=function(e){return this.previousNode=dv,this.currentTimeline=this.currentTimeline.fork(this.element,e),this.timelines.push(this.currentTimeline),this.currentTimeline},e.prototype.appendInstructionToTimeline=function(e,t,n){var r={duration:null!=t?t:e.duration,delay:this.currentTimeline.currentTime+(null!=n?n:0)+e.delay,easing:""},i=new yv(this._driver,e.element,e.keyframes,e.preStyleProps,e.postStyleProps,r,e.stretchStartingKeyframe);return this.timelines.push(i),r},e.prototype.incrementTime=function(e){this.currentTimeline.forwardTime(this.currentTimeline.duration+e)},e.prototype.delayNextStep=function(e){e>0&&this.currentTimeline.delayNextStep(e)},e.prototype.invokeQuery=function(e,t,n,r,i,o){var a=[];if(r&&a.push(this.element),e.length>0){e=(e=e.replace(cv,"."+this._enterClassName)).replace(fv,"."+this._leaveClassName);var s=this._driver.query(this.element,e,1!=n);0!==n&&(s=n<0?s.slice(s.length+n,s.length):s.slice(0,n)),a.push.apply(a,c(s))}return i||0!=a.length||o.push('`query("'+t+'")` returned zero elements. (Use `query("'+t+'", { optional: true })` if you wish to allow this.)'),a},e}(),mv=function(){function e(e,t,n,r){this._driver=e,this.element=t,this.startTime=n,this._elementTimelineStylesLookup=r,this.duration=0,this._previousKeyframe={},this._currentKeyframe={},this._keyframes=new Map,this._styleSummary={},this._pendingStyles={},this._backFill={},this._currentEmptyStepKeyframe=null,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._localTimelineStyles=Object.create(this._backFill,{}),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(t),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(t,this._localTimelineStyles)),this._loadKeyframe()}return e.prototype.containsAnimation=function(){switch(this._keyframes.size){case 0:return!1;case 1:return this.getCurrentStyleProperties().length>0;default:return!0}},e.prototype.getCurrentStyleProperties=function(){return Object.keys(this._currentKeyframe)},Object.defineProperty(e.prototype,"currentTime",{get:function(){return this.startTime+this.duration},enumerable:!0,configurable:!0}),e.prototype.delayNextStep=function(e){var t=1==this._keyframes.size&&Object.keys(this._pendingStyles).length;this.duration||t?(this.forwardTime(this.currentTime+e),t&&this.snapshotCurrentStyles()):this.startTime+=e},e.prototype.fork=function(t,n){return this.applyStylesToKeyframe(),new e(this._driver,t,n||this.currentTime,this._elementTimelineStylesLookup)},e.prototype._loadKeyframe=function(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=Object.create(this._backFill,{}),this._keyframes.set(this.duration,this._currentKeyframe))},e.prototype.forwardFrame=function(){this.duration+=1,this._loadKeyframe()},e.prototype.forwardTime=function(e){this.applyStylesToKeyframe(),this.duration=e,this._loadKeyframe()},e.prototype._updateStyle=function(e,t){this._localTimelineStyles[e]=t,this._globalTimelineStyles[e]=t,this._styleSummary[e]={time:this.currentTime,value:t}},e.prototype.allowOnlyTimelineStyles=function(){return this._currentEmptyStepKeyframe!==this._currentKeyframe},e.prototype.applyEmptyStep=function(e){var t=this;e&&(this._previousKeyframe.easing=e),Object.keys(this._globalTimelineStyles).forEach(function(e){t._backFill[e]=t._globalTimelineStyles[e]||ey,t._currentKeyframe[e]=ey}),this._currentEmptyStepKeyframe=this._currentKeyframe},e.prototype.setStyles=function(e,t,n,r){var i=this;t&&(this._previousKeyframe.easing=t);var o=r&&r.params||{},a=function(e,t){var n,r={};return e.forEach(function(e){"*"===e?(n=n||Object.keys(t)).forEach(function(e){r[e]=ey}):Dy(e,!1,r)}),r}(e,this._globalTimelineStyles);Object.keys(a).forEach(function(e){var t=qy(a[e],o,n);i._pendingStyles[e]=t,i._localTimelineStyles.hasOwnProperty(e)||(i._backFill[e]=i._globalTimelineStyles.hasOwnProperty(e)?i._globalTimelineStyles[e]:ey),i._updateStyle(e,t)})},e.prototype.applyStylesToKeyframe=function(){var e=this,t=this._pendingStyles,n=Object.keys(t);0!=n.length&&(this._pendingStyles={},n.forEach(function(n){e._currentKeyframe[n]=t[n]}),Object.keys(this._localTimelineStyles).forEach(function(t){e._currentKeyframe.hasOwnProperty(t)||(e._currentKeyframe[t]=e._localTimelineStyles[t])}))},e.prototype.snapshotCurrentStyles=function(){var e=this;Object.keys(this._localTimelineStyles).forEach(function(t){var n=e._localTimelineStyles[t];e._pendingStyles[t]=n,e._updateStyle(t,n)})},e.prototype.getFinalKeyframe=function(){return this._keyframes.get(this.duration)},Object.defineProperty(e.prototype,"properties",{get:function(){var e=[];for(var t in this._currentKeyframe)e.push(t);return e},enumerable:!0,configurable:!0}),e.prototype.mergeTimelineCollectedStyles=function(e){var t=this;Object.keys(e._styleSummary).forEach(function(n){var r=t._styleSummary[n],i=e._styleSummary[n];(!r||i.time>r.time)&&t._updateStyle(n,i.value)})},e.prototype.buildKeyframes=function(){var e=this;this.applyStylesToKeyframe();var t=new Set,n=new Set,r=1===this._keyframes.size&&0===this.duration,i=[];this._keyframes.forEach(function(o,a){var s=Dy(o,!0);Object.keys(s).forEach(function(e){var r=s[e];r==ay?t.add(e):r==ey&&n.add(e)}),r||(s.offset=a/e.duration),i.push(s)});var o=t.size?Hy(t.values()):[],a=n.size?Hy(n.values()):[];if(r){var s=i[0],u=jy(s);s.offset=0,u.offset=1,i=[s,u]}return uv(this.element,i,o,a,this.duration,this.startTime,this.easing,!1)},e}(),yv=function(e){function t(t,n,r,i,o,a,s){void 0===s&&(s=!1);var u=e.call(this,t,n,a.delay)||this;return u.element=n,u.keyframes=r,u.preStyleProps=i,u.postStyleProps=o,u._stretchStartingKeyframe=s,u.timings={duration:a.duration,delay:a.delay,easing:a.easing},u}return i(t,e),t.prototype.containsAnimation=function(){return this.keyframes.length>1},t.prototype.buildKeyframes=function(){var e=this.keyframes,t=this.timings,n=t.delay,r=t.duration,i=t.easing;if(this._stretchStartingKeyframe&&n){var o=[],a=r+n,s=n/a,u=Dy(e[0],!1);u.offset=0,o.push(u);var l=Dy(e[0],!1);l.offset=vv(s),o.push(l);for(var c=e.length-1,f=1;f<=c;f++){var h=Dy(e[f],!1);h.offset=vv((n+h.offset*r)/a),o.push(h)}r=a,n=0,i="",e=o}return uv(this.element,e,this.preStyleProps,this.postStyleProps,r,n,i,!0)},t}(mv);function vv(e,t){void 0===t&&(t=3);var n=Math.pow(10,t-1);return Math.round(e*n)/n}var bv=function(){return function(){}}(),wv=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.normalizePropertyName=function(e,t){return $y(e)},t.prototype.normalizeStyleValue=function(e,t,n,r){var i="",o=n.toString().trim();if(_v[t]&&0!==n&&"0"!==n)if("number"==typeof n)i="px";else{var a=n.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&0==a[1].length&&r.push("Please provide a CSS unit value for "+e+":"+n)}return o+i},t}(bv),_v=xv("width,height,minWidth,minHeight,maxWidth,maxHeight,left,top,bottom,right,fontSize,outlineWidth,outlineOffset,paddingTop,paddingLeft,paddingBottom,paddingRight,marginTop,marginLeft,marginBottom,marginRight,borderRadius,borderWidth,borderTopWidth,borderLeftWidth,borderRightWidth,borderBottomWidth,textIndent,perspective".split(","));function xv(e){var t={};return e.forEach(function(e){return t[e]=!0}),t}function Sv(e,t,n,r,i,o,a,s,u,l,c,f,h){return{type:0,element:e,triggerName:t,isRemovalTransition:i,fromState:n,fromStyles:o,toState:r,toStyles:a,timelines:s,queriedElements:u,preStyleProps:l,postStyleProps:c,totalTime:f,errors:h}}var Ev={},kv=function(){function e(e,t,n){this._triggerName=e,this.ast=t,this._stateStyles=n}return e.prototype.match=function(e,t,n,r){return function(e,t,n,r,i){return e.some(function(e){return e(t,n,r,i)})}(this.ast.matchers,e,t,n,r)},e.prototype.buildStyles=function(e,t,n){var r=this._stateStyles["*"],i=this._stateStyles[e],o=r?r.buildStyles(t,n):{};return i?i.buildStyles(t,n):o},e.prototype.build=function(e,t,n,r,i,a,s,u,l,c){var f=[],h=this.ast.options&&this.ast.options.params||Ev,p=this.buildStyles(n,s&&s.params||Ev,f),d=u&&u.params||Ev,g=this.buildStyles(r,d,f),m=new Set,y=new Map,v=new Map,b="void"===r,w={params:o({},h,d)},_=c?[]:hv(e,t,this.ast.animation,i,a,p,g,w,l,f),x=0;if(_.forEach(function(e){x=Math.max(e.duration+e.delay,x)}),f.length)return Sv(t,this._triggerName,n,r,b,p,g,[],[],y,v,x,f);_.forEach(function(e){var n=e.element,r=py(y,n,{});e.preStyleProps.forEach(function(e){return r[e]=!0});var i=py(v,n,{});e.postStyleProps.forEach(function(e){return i[e]=!0}),n!==t&&m.add(n)});var S=Hy(m.values());return Sv(t,this._triggerName,n,r,b,p,g,_,S,y,v,x)},e}(),Cv=function(){function e(e,t){this.styles=e,this.defaultParams=t}return e.prototype.buildStyles=function(e,t){var n={},r=jy(this.defaultParams);return Object.keys(e).forEach(function(t){var n=e[t];null!=n&&(r[t]=n)}),this.styles.styles.forEach(function(e){if("string"!=typeof e){var i=e;Object.keys(i).forEach(function(e){var o=i[e];o.length>1&&(o=qy(o,r,t)),n[e]=o})}}),n},e}(),Tv=function(){function e(e,t){var n=this;this.name=e,this.ast=t,this.transitionFactories=[],this.states={},t.states.forEach(function(e){n.states[e.name]=new Cv(e.style,e.options&&e.options.params||{})}),Ov(this.states,"true","1"),Ov(this.states,"false","0"),t.transitions.forEach(function(t){n.transitionFactories.push(new kv(e,t,n.states))}),this.fallbackTransition=new kv(e,{type:1,animation:{type:2,steps:[],options:null},matchers:[function(e,t){return!0}],options:null,queryCount:0,depCount:0},this.states)}return Object.defineProperty(e.prototype,"containsQueries",{get:function(){return this.ast.queryCount>0},enumerable:!0,configurable:!0}),e.prototype.matchTransition=function(e,t,n,r){return this.transitionFactories.find(function(i){return i.match(e,t,n,r)})||null},e.prototype.matchStyles=function(e,t,n){return this.fallbackTransition.buildStyles(e,t,n)},e}();function Ov(e,t,n){e.hasOwnProperty(t)?e.hasOwnProperty(n)||(e[n]=e[t]):e.hasOwnProperty(n)&&(e[t]=e[n])}var Iv=new lv,Pv=function(){function e(e,t,n){this.bodyNode=e,this._driver=t,this._normalizer=n,this._animations={},this._playersById={},this.players=[]}return e.prototype.register=function(e,t){var n=[],r=nv(this._driver,t,n);if(n.length)throw new Error("Unable to build the animation due to the following errors: "+n.join("\n"));this._animations[e]=r},e.prototype._buildPlayer=function(e,t,n){var r=e.element,i=ly(0,this._normalizer,0,e.keyframes,t,n);return this._driver.animate(r,i,e.duration,e.delay,e.easing,[],!0)},e.prototype.create=function(e,t,n){var r=this;void 0===n&&(n={});var i,o=[],a=this._animations[e],s=new Map;if(a?(i=hv(this._driver,t,a,"ng-enter","ng-leave",{},{},n,Iv,o)).forEach(function(e){var t=py(s,e.element,{});e.postStyleProps.forEach(function(e){return t[e]=null})}):(o.push("The requested animation doesn't exist or has already been destroyed"),i=[]),o.length)throw new Error("Unable to create the animation due to the following errors: "+o.join("\n"));s.forEach(function(e,t){Object.keys(e).forEach(function(n){e[n]=r._driver.computeStyle(t,n,ey)})});var u=uy(i.map(function(e){var t=s.get(e.element);return r._buildPlayer(e,{},t)}));return this._playersById[e]=u,u.onDestroy(function(){return r.destroy(e)}),this.players.push(u),u},e.prototype.destroy=function(e){var t=this._getPlayer(e);t.destroy(),delete this._playersById[e];var n=this.players.indexOf(t);n>=0&&this.players.splice(n,1)},e.prototype._getPlayer=function(e){var t=this._playersById[e];if(!t)throw new Error("Unable to find the timeline player referenced by "+e);return t},e.prototype.listen=function(e,t,n,r){var i=hy(t,"","","");return cy(this._getPlayer(e),n,i,r),function(){}},e.prototype.command=function(e,t,n,r){if("register"!=n)if("create"!=n){var i=this._getPlayer(e);switch(n){case"play":i.play();break;case"pause":i.pause();break;case"reset":i.reset();break;case"restart":i.restart();break;case"finish":i.finish();break;case"init":i.init();break;case"setPosition":i.setPosition(parseFloat(r[0]));break;case"destroy":this.destroy(e)}}else this.create(e,t,r[0]||{});else this.register(e,r[0])},e}(),Av=[],Nv={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},Rv={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},jv="__ng_removed",Dv=function(){function e(e,t){void 0===t&&(t=""),this.namespaceId=t;var n=e&&e.hasOwnProperty("value");if(this.value=function(e){return null!=e?e:null}(n?e.value:e),n){var r=jy(e);delete r.value,this.options=r}else this.options={};this.options.params||(this.options.params={})}return Object.defineProperty(e.prototype,"params",{get:function(){return this.options.params},enumerable:!0,configurable:!0}),e.prototype.absorbOptions=function(e){var t=e.params;if(t){var n=this.options.params;Object.keys(t).forEach(function(e){null==n[e]&&(n[e]=t[e])})}},e}(),Mv=new Dv("void"),Lv=function(){function e(e,t,n){this.id=e,this.hostElement=t,this._engine=n,this.players=[],this._triggers={},this._queue=[],this._elementListeners=new Map,this._hostClassName="ng-tns-"+e,Wv(t,this._hostClassName)}return e.prototype.listen=function(e,t,n,r){var i,o=this;if(!this._triggers.hasOwnProperty(t))throw new Error('Unable to listen on the animation trigger event "'+n+'" because the animation trigger "'+t+"\" doesn't exist!");if(null==n||0==n.length)throw new Error('Unable to listen on the animation trigger "'+t+'" because the provided event is undefined!');if("start"!=(i=n)&&"done"!=i)throw new Error('The provided animation trigger event "'+n+'" for the animation trigger "'+t+'" is not supported!');var a=py(this._elementListeners,e,[]),s={name:t,phase:n,callback:r};a.push(s);var u=py(this._engine.statesByElement,e,{});return u.hasOwnProperty(t)||(Wv(e,"ng-trigger"),Wv(e,"ng-trigger-"+t),u[t]=Mv),function(){o._engine.afterFlush(function(){var e=a.indexOf(s);e>=0&&a.splice(e,1),o._triggers[t]||delete u[t]})}},e.prototype.register=function(e,t){return!this._triggers[e]&&(this._triggers[e]=t,!0)},e.prototype._getTrigger=function(e){var t=this._triggers[e];if(!t)throw new Error('The provided animation trigger "'+e+'" has not been registered!');return t},e.prototype.trigger=function(e,t,n,r){var i=this;void 0===r&&(r=!0);var o=this._getTrigger(t),a=new Fv(this.id,t,e),s=this._engine.statesByElement.get(e);s||(Wv(e,"ng-trigger"),Wv(e,"ng-trigger-"+t),this._engine.statesByElement.set(e,s={}));var u=s[t],l=new Dv(n,this.id);if(!(n&&n.hasOwnProperty("value"))&&u&&l.absorbOptions(u.options),s[t]=l,u||(u=Mv),"void"===l.value||u.value!==l.value){var c=py(this._engine.playersByElement,e,[]);c.forEach(function(e){e.namespaceId==i.id&&e.triggerName==t&&e.queued&&e.destroy()});var f=o.matchTransition(u.value,l.value,e,l.params),h=!1;if(!f){if(!r)return;f=o.fallbackTransition,h=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:e,triggerName:t,transition:f,fromState:u,toState:l,player:a,isFallbackTransition:h}),h||(Wv(e,"ng-animate-queued"),a.onStart(function(){$v(e,"ng-animate-queued")})),a.onDone(function(){var t=i.players.indexOf(a);t>=0&&i.players.splice(t,1);var n=i._engine.playersByElement.get(e);if(n){var r=n.indexOf(a);r>=0&&n.splice(r,1)}}),this.players.push(a),c.push(a),a}if(!function(e,t){var n=Object.keys(e),r=Object.keys(t);if(n.length!=r.length)return!1;for(var i=0;i=0){for(var r=!1,i=n;i>=0;i--)if(this.driver.containsElement(this._namespaceList[i].hostElement,t)){this._namespaceList.splice(i+1,0,e),r=!0;break}r||this._namespaceList.splice(0,0,e)}else this._namespaceList.push(e);return this.namespacesByHostElement.set(t,e),e},e.prototype.register=function(e,t){var n=this._namespaceLookup[e];return n||(n=this.createNamespace(e,t)),n},e.prototype.registerTrigger=function(e,t,n){var r=this._namespaceLookup[e];r&&r.register(t,n)&&this.totalAnimations++},e.prototype.destroy=function(e,t){var n=this;if(e){var r=this._fetchNamespace(e);this.afterFlush(function(){n.namespacesByHostElement.delete(r.hostElement),delete n._namespaceLookup[e];var t=n._namespaceList.indexOf(r);t>=0&&n._namespaceList.splice(t,1)}),this.afterFlushAnimationsDone(function(){return r.destroy(t)})}},e.prototype._fetchNamespace=function(e){return this._namespaceLookup[e]},e.prototype.fetchNamespacesByElement=function(e){var t=new Set,n=this.statesByElement.get(e);if(n)for(var r=Object.keys(n),i=0;i=0&&this.collectedLeaveElements.splice(o,1)}if(e){var a=this._fetchNamespace(e);a&&a.insertNode(t,n)}r&&this.collectEnterElement(t)}},e.prototype.collectEnterElement=function(e){this.collectedEnterElements.push(e)},e.prototype.markElementAsDisabled=function(e,t){t?this.disabledNodes.has(e)||(this.disabledNodes.add(e),Wv(e,"ng-animate-disabled")):this.disabledNodes.has(e)&&(this.disabledNodes.delete(e),$v(e,"ng-animate-disabled"))},e.prototype.removeNode=function(e,t,n){if(Vv(t)){var r=e?this._fetchNamespace(e):null;r?r.removeNode(t,n):this.markElementAsRemoved(e,t,!1,n)}else this._onRemovalComplete(t,n)},e.prototype.markElementAsRemoved=function(e,t,n,r){this.collectedLeaveElements.push(t),t[jv]={namespaceId:e,setForRemoval:r,hasAnimation:n,removedBeforeQueried:!1}},e.prototype.listen=function(e,t,n,r,i){return Vv(t)?this._fetchNamespace(e).listen(t,n,r,i):function(){}},e.prototype._buildInstruction=function(e,t,n,r,i){return e.transition.build(this.driver,e.element,e.fromState.value,e.toState.value,n,r,e.fromState.options,e.toState.options,t,i)},e.prototype.destroyInnerAnimations=function(e){var t=this,n=this.driver.query(e,".ng-trigger",!0);n.forEach(function(e){return t.destroyActiveAnimationsForElement(e)}),0!=this.playersByQueriedElement.size&&(n=this.driver.query(e,".ng-animating",!0)).forEach(function(e){return t.finishActiveQueriedAnimationOnElement(e)})},e.prototype.destroyActiveAnimationsForElement=function(e){var t=this.playersByElement.get(e);t&&t.forEach(function(e){e.queued?e.markedForDestroy=!0:e.destroy()})},e.prototype.finishActiveQueriedAnimationOnElement=function(e){var t=this.playersByQueriedElement.get(e);t&&t.forEach(function(e){return e.finish()})},e.prototype.whenRenderingDone=function(){var e=this;return new Promise(function(t){if(e.players.length)return uy(e.players).onDone(function(){return t()});t()})},e.prototype.processLeaveNode=function(e){var t=this,n=e[jv];if(n&&n.setForRemoval){if(e[jv]=Nv,n.namespaceId){this.destroyInnerAnimations(e);var r=this._fetchNamespace(n.namespaceId);r&&r.clearElementCache(e)}this._onRemovalComplete(e,n.setForRemoval)}this.driver.matchesElement(e,".ng-animate-disabled")&&this.markElementAsDisabled(e,!1),this.driver.query(e,".ng-animate-disabled",!0).forEach(function(n){t.markElementAsDisabled(e,!1)})},e.prototype.flush=function(e){var t=this;void 0===e&&(e=-1);var n=[];if(this.newHostElements.size&&(this.newHostElements.forEach(function(e,n){return t._balanceNamespaceList(e,n)}),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(var r=0;r=0;C--)this._namespaceList[C].drainQueuedTransitions(t).forEach(function(e){var t=e.player,o=e.element;if(E.push(t),n.collectedEnterElements.length){var a=o[jv];if(a&&a.setForMove)return void t.destroy()}var c=!p||!n.driver.containsElement(p,o),h=x.get(o),d=m.get(o),g=n._buildInstruction(e,r,d,h,c);if(g.errors&&g.errors.length)k.push(g);else{if(c)return t.onStart(function(){return Fy(o,g.fromStyles)}),t.onDestroy(function(){return Uy(o,g.toStyles)}),void i.push(t);if(e.isFallbackTransition)return t.onStart(function(){return Fy(o,g.fromStyles)}),t.onDestroy(function(){return Uy(o,g.toStyles)}),void i.push(t);g.timelines.forEach(function(e){return e.stretchStartingKeyframe=!0}),r.append(o,g.timelines),s.push({instruction:g,player:t,element:o}),g.queriedElements.forEach(function(e){return py(u,e,[]).push(t)}),g.preStyleProps.forEach(function(e,t){var n=Object.keys(e);if(n.length){var r=l.get(t);r||l.set(t,r=new Set),n.forEach(function(e){return r.add(e)})}}),g.postStyleProps.forEach(function(e,t){var n=Object.keys(e),r=f.get(t);r||f.set(t,r=new Set),n.forEach(function(e){return r.add(e)})})}});if(k.length){var T=[];k.forEach(function(e){T.push("@"+e.triggerName+" has failed due to:\n"),e.errors.forEach(function(e){return T.push("- "+e+"\n")})}),E.forEach(function(e){return e.destroy()}),this.reportError(T)}var O=new Map,I=new Map;s.forEach(function(e){var t=e.element;r.has(t)&&(I.set(t,t),n._beforeAnimationBuild(e.player.namespaceId,e.instruction,O))}),i.forEach(function(e){var t=e.element;n._getPreviousPlayers(t,!1,e.namespaceId,e.triggerName,null).forEach(function(e){py(O,t,[]).push(e),e.destroy()})});var P=v.filter(function(e){return Jv(e,l,f)}),A=new Map;zv(A,this.driver,w,f,ey).forEach(function(e){Jv(e,l,f)&&P.push(e)});var N=new Map;g.forEach(function(e,t){zv(N,n.driver,new Set(e),l,ay)}),P.forEach(function(e){var t=A.get(e),n=N.get(e);A.set(e,o({},t,n))});var R=[],j=[],D={};s.forEach(function(e){var t=e.element,o=e.player,s=e.instruction;if(r.has(t)){if(h.has(t))return o.onDestroy(function(){return Uy(t,s.toStyles)}),o.disabled=!0,o.overrideTotalTime(s.totalTime),void i.push(o);var u=D;if(I.size>1){for(var l=t,c=[];l=l.parentNode;){var f=I.get(l);if(f){u=f;break}c.push(l)}c.forEach(function(e){return I.set(e,u)})}var p=n._buildAnimation(o.namespaceId,s,O,a,N,A);if(o.setRealPlayer(p),u===D)R.push(o);else{var d=n.playersByElement.get(u);d&&d.length&&(o.parentPlayer=uy(d)),i.push(o)}}else Fy(t,s.fromStyles),o.onDestroy(function(){return Uy(t,s.toStyles)}),j.push(o),h.has(t)&&i.push(o)}),j.forEach(function(e){var t=a.get(e.element);if(t&&t.length){var n=uy(t);e.setRealPlayer(n)}}),i.forEach(function(e){e.parentPlayer?e.syncPlayerEvents(e.parentPlayer):e.destroy()});for(var M=0;M0?this.driver.animate(e.element,t,e.duration,e.delay,e.easing,n):new iy(e.duration,e.delay)},e}(),Fv=function(){function e(e,t,n){this.namespaceId=e,this.triggerName=t,this.element=n,this._player=new iy,this._containsRealPlayer=!1,this._queuedCallbacks={},this.destroyed=!1,this.markedForDestroy=!1,this.disabled=!1,this.queued=!0,this.totalTime=0}return e.prototype.setRealPlayer=function(e){var t=this;this._containsRealPlayer||(this._player=e,Object.keys(this._queuedCallbacks).forEach(function(n){t._queuedCallbacks[n].forEach(function(t){return cy(e,n,void 0,t)})}),this._queuedCallbacks={},this._containsRealPlayer=!0,this.overrideTotalTime(e.totalTime),this.queued=!1)},e.prototype.getRealPlayer=function(){return this._player},e.prototype.overrideTotalTime=function(e){this.totalTime=e},e.prototype.syncPlayerEvents=function(e){var t=this,n=this._player;n.triggerCallback&&e.onStart(function(){return n.triggerCallback("start")}),e.onDone(function(){return t.finish()}),e.onDestroy(function(){return t.destroy()})},e.prototype._queueEvent=function(e,t){py(this._queuedCallbacks,e,[]).push(t)},e.prototype.onDone=function(e){this.queued&&this._queueEvent("done",e),this._player.onDone(e)},e.prototype.onStart=function(e){this.queued&&this._queueEvent("start",e),this._player.onStart(e)},e.prototype.onDestroy=function(e){this.queued&&this._queueEvent("destroy",e),this._player.onDestroy(e)},e.prototype.init=function(){this._player.init()},e.prototype.hasStarted=function(){return!this.queued&&this._player.hasStarted()},e.prototype.play=function(){!this.queued&&this._player.play()},e.prototype.pause=function(){!this.queued&&this._player.pause()},e.prototype.restart=function(){!this.queued&&this._player.restart()},e.prototype.finish=function(){this._player.finish()},e.prototype.destroy=function(){this.destroyed=!0,this._player.destroy()},e.prototype.reset=function(){!this.queued&&this._player.reset()},e.prototype.setPosition=function(e){this.queued||this._player.setPosition(e)},e.prototype.getPosition=function(){return this.queued?0:this._player.getPosition()},e.prototype.triggerCallback=function(e){var t=this._player;t.triggerCallback&&t.triggerCallback(e)},e}();function Vv(e){return e&&1===e.nodeType}function Bv(e,t){var n=e.style.display;return e.style.display=null!=t?t:"none",n}function zv(e,t,n,r,i){var o=[];n.forEach(function(e){return o.push(Bv(e))});var a=[];r.forEach(function(n,r){var o={};n.forEach(function(e){var n=o[e]=t.computeStyle(r,e,i);n&&0!=n.length||(r[jv]=Rv,a.push(r))}),e.set(r,o)});var s=0;return n.forEach(function(e){return Bv(e,o[s++])}),a}function qv(e,t){var n=new Map;if(e.forEach(function(e){return n.set(e,[])}),0==t.length)return n;var r=new Set(t),i=new Map;return t.forEach(function(e){var t=function e(t){if(!t)return 1;var o=i.get(t);if(o)return o;var a=t.parentNode;return o=n.has(a)?a:r.has(a)?1:e(a),i.set(t,o),o}(e);1!==t&&n.get(t).push(e)}),n}var Hv="$$classes";function Wv(e,t){if(e.classList)e.classList.add(t);else{var n=e[Hv];n||(n=e[Hv]={}),n[t]=!0}}function $v(e,t){if(e.classList)e.classList.remove(t);else{var n=e[Hv];n&&delete n[t]}}function Gv(e,t,n){uy(n).onDone(function(){return e.processLeaveNode(t)})}function Jv(e,t,n){var r=n.get(e);if(!r)return!1;var i=t.get(e);return i?r.forEach(function(e){return i.add(e)}):t.set(e,r),n.delete(e),!0}var Kv=function(){function e(e,t,n){var r=this;this.bodyNode=e,this._driver=t,this._triggerCache={},this.onRemovalComplete=function(e,t){},this._transitionEngine=new Uv(e,t,n),this._timelineEngine=new Pv(e,t,n),this._transitionEngine.onRemovalComplete=function(e,t){return r.onRemovalComplete(e,t)}}return e.prototype.registerTrigger=function(e,t,n,r,i){var o=e+"-"+r,a=this._triggerCache[o];if(!a){var s=[],u=nv(this._driver,i,s);if(s.length)throw new Error('The animation trigger "'+r+'" has failed to build due to the following errors:\n - '+s.join("\n - "));a=function(e,t){return new Tv(e,t)}(r,u),this._triggerCache[o]=a}this._transitionEngine.registerTrigger(t,r,a)},e.prototype.register=function(e,t){this._transitionEngine.register(e,t)},e.prototype.destroy=function(e,t){this._transitionEngine.destroy(e,t)},e.prototype.onInsert=function(e,t,n,r){this._transitionEngine.insertNode(e,t,n,r)},e.prototype.onRemove=function(e,t,n){this._transitionEngine.removeNode(e,t,n)},e.prototype.disableAnimations=function(e,t){this._transitionEngine.markElementAsDisabled(e,t)},e.prototype.process=function(e,t,n,r){if("@"==n.charAt(0)){var i=l(dy(n),2);this._timelineEngine.command(i[0],t,i[1],r)}else this._transitionEngine.trigger(e,t,n,r)},e.prototype.listen=function(e,t,n,r,i){if("@"==n.charAt(0)){var o=l(dy(n),2);return this._timelineEngine.listen(o[0],t,o[1],i)}return this._transitionEngine.listen(e,t,n,r,i)},e.prototype.flush=function(e){void 0===e&&(e=-1),this._transitionEngine.flush(e)},Object.defineProperty(e.prototype,"players",{get:function(){return this._transitionEngine.players.concat(this._timelineEngine.players)},enumerable:!0,configurable:!0}),e.prototype.whenRenderingDone=function(){return this._transitionEngine.whenRenderingDone()},e}(),Qv="animation",Yv="animationend",Zv=function(){function e(e,t,n,r,i,o,a){var s=this;this._element=e,this._name=t,this._duration=n,this._delay=r,this._easing=i,this._fillMode=o,this._onDoneFn=a,this._finished=!1,this._destroyed=!1,this._startTime=0,this._position=0,this._eventFn=function(e){return s._handleCallback(e)}}return e.prototype.apply=function(){var e,t,n;t=this._duration+"ms "+this._easing+" "+this._delay+"ms 1 normal "+this._fillMode+" "+this._name,(n=ib(e=this._element,"").trim()).length&&(function(e,t){for(var n=0;n=this._delay&&n>=this._duration&&this.finish()},e.prototype.finish=function(){this._finished||(this._finished=!0,this._onDoneFn(),nb(this._element,this._eventFn,!0))},e.prototype.destroy=function(){var e,t,n,r;this._destroyed||(this._destroyed=!0,this.finish(),t=this._name,(r=tb(n=ib(e=this._element,"").split(","),t))>=0&&(n.splice(r,1),rb(e,"",n.join(","))))},e}();function Xv(e,t,n){rb(e,"PlayState",n,eb(e,t))}function eb(e,t){var n=ib(e,"");return n.indexOf(",")>0?tb(n.split(","),t):tb([n],t)}function tb(e,t){for(var n=0;n=0)return n;return-1}function nb(e,t,n){n?e.removeEventListener(Yv,t):e.addEventListener(Yv,t)}function rb(e,t,n,r){var i=Qv+t;if(null!=r){var o=e.style[i];if(o.length){var a=o.split(",");a[r]=n,n=a.join(",")}}e.style[i]=n}function ib(e,t){return e.style[Qv+t]}var ob="linear",ab=function(){function e(e,t,n,r,i,o,a){this.element=e,this.keyframes=t,this.animationName=n,this._duration=r,this._delay=i,this._finalStyles=a,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._started=!1,this.currentSnapshot={},this._state=0,this.easing=o||ob,this.totalTime=r+i,this._buildStyler()}return e.prototype.onStart=function(e){this._onStartFns.push(e)},e.prototype.onDone=function(e){this._onDoneFns.push(e)},e.prototype.onDestroy=function(e){this._onDestroyFns.push(e)},e.prototype.destroy=function(){this.init(),this._state>=4||(this._state=4,this._styler.destroy(),this._flushStartFns(),this._flushDoneFns(),this._onDestroyFns.forEach(function(e){return e()}),this._onDestroyFns=[])},e.prototype._flushDoneFns=function(){this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[]},e.prototype._flushStartFns=function(){this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[]},e.prototype.finish=function(){this.init(),this._state>=3||(this._state=3,this._styler.finish(),this._flushStartFns(),this._flushDoneFns())},e.prototype.setPosition=function(e){this._styler.setPosition(e)},e.prototype.getPosition=function(){return this._styler.getPosition()},e.prototype.hasStarted=function(){return this._state>=2},e.prototype.init=function(){this._state>=1||(this._state=1,this._styler.apply(),this._delay&&this._styler.pause())},e.prototype.play=function(){this.init(),this.hasStarted()||(this._flushStartFns(),this._state=2),this._styler.resume()},e.prototype.pause=function(){this.init(),this._styler.pause()},e.prototype.restart=function(){this.reset(),this.play()},e.prototype.reset=function(){this._styler.destroy(),this._buildStyler(),this._styler.apply()},e.prototype._buildStyler=function(){var e=this;this._styler=new Zv(this.element,this.animationName,this._duration,this._delay,this.easing,"forwards",function(){return e.finish()})},e.prototype.triggerCallback=function(e){var t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(function(e){return e()}),t.length=0},e.prototype.beforeDestroy=function(){var e=this;this.init();var t={};if(this.hasStarted()){var n=this._state>=3;Object.keys(this._finalStyles).forEach(function(r){"offset"!=r&&(t[r]=n?e._finalStyles[r]:Qy(e.element,r))})}this.currentSnapshot=t},e}(),sb=function(e){function t(t,n){var r=e.call(this)||this;return r.element=t,r._startingStyles={},r.__initialized=!1,r._styles=Ty(n),r}return i(t,e),t.prototype.init=function(){var t=this;!this.__initialized&&this._startingStyles&&(this.__initialized=!0,Object.keys(this._styles).forEach(function(e){t._startingStyles[e]=t.element.style[e]}),e.prototype.init.call(this))},t.prototype.play=function(){var t=this;this._startingStyles&&(this.init(),Object.keys(this._styles).forEach(function(e){return t.element.style.setProperty(e,t._styles[e])}),e.prototype.play.call(this))},t.prototype.destroy=function(){var t=this;this._startingStyles&&(Object.keys(this._startingStyles).forEach(function(e){var n=t._startingStyles[e];n?t.element.style.setProperty(e,n):t.element.style.removeProperty(e)}),this._startingStyles=null,e.prototype.destroy.call(this))},t}(iy),ub=function(){function e(){this._count=0,this._head=document.querySelector("head"),this._warningIssued=!1}return e.prototype.validateStyleProperty=function(e){return Sy(e)},e.prototype.matchesElement=function(e,t){return Ey(e,t)},e.prototype.containsElement=function(e,t){return ky(e,t)},e.prototype.query=function(e,t,n){return Cy(e,t,n)},e.prototype.computeStyle=function(e,t,n){return window.getComputedStyle(e)[t]},e.prototype.buildKeyframeElement=function(e,t,n){n=n.map(function(e){return Ty(e)});var r="@keyframes "+t+" {\n",i="";n.forEach(function(e){i=" ";var t=parseFloat(e.offset);r+=""+i+100*t+"% {\n",i+=" ",Object.keys(e).forEach(function(t){var n=e[t];switch(t){case"offset":return;case"easing":return void(n&&(r+=i+"animation-timing-function: "+n+";\n"));default:return void(r+=""+i+t+": "+n+";\n")}}),r+=i+"}\n"}),r+="}\n";var o=document.createElement("style");return o.innerHTML=r,o},e.prototype.animate=function(e,t,n,r,i,o,a){void 0===o&&(o=[]),a&&this._notifyFaultyScrubber();var s=o.filter(function(e){return e instanceof ab}),u={};Gy(n,r)&&s.forEach(function(e){var t=e.currentSnapshot;Object.keys(t).forEach(function(e){return u[e]=t[e]})});var l=function(e){var t={};return e&&(Array.isArray(e)?e:[e]).forEach(function(e){Object.keys(e).forEach(function(n){"offset"!=n&&"easing"!=n&&(t[n]=e[n])})}),t}(t=Jy(e,t,u));if(0==n)return new sb(e,l);var c="gen_css_kf_"+this._count++,f=this.buildKeyframeElement(e,c,t);document.querySelector("head").appendChild(f);var h=new ab(e,t,c,n,r,i,l);return h.onDestroy(function(){var e;(e=f).parentNode.removeChild(e)}),h},e.prototype._notifyFaultyScrubber=function(){this._warningIssued||(console.warn("@angular/animations: please load the web-animations.js polyfill to allow programmatic access...\n"," visit http://bit.ly/IWukam to learn more about using the web-animation-js polyfill."),this._warningIssued=!0)},e}(),lb=function(){function e(e,t,n){this.element=e,this.keyframes=t,this.options=n,this._onDoneFns=[],this._onStartFns=[],this._onDestroyFns=[],this._initialized=!1,this._finished=!1,this._started=!1,this._destroyed=!1,this.time=0,this.parentPlayer=null,this.currentSnapshot={},this._duration=n.duration,this._delay=n.delay||0,this.time=this._duration+this._delay}return e.prototype._onFinish=function(){this._finished||(this._finished=!0,this._onDoneFns.forEach(function(e){return e()}),this._onDoneFns=[])},e.prototype.init=function(){this._buildPlayer(),this._preparePlayerBeforeStart()},e.prototype._buildPlayer=function(){var e=this;if(!this._initialized){this._initialized=!0;var t=this.keyframes;this.domPlayer=this._triggerWebAnimation(this.element,t,this.options),this._finalKeyframe=t.length?t[t.length-1]:{},this.domPlayer.addEventListener("finish",function(){return e._onFinish()})}},e.prototype._preparePlayerBeforeStart=function(){this._delay?this._resetDomPlayerState():this.domPlayer.pause()},e.prototype._triggerWebAnimation=function(e,t,n){return e.animate(t,n)},e.prototype.onStart=function(e){this._onStartFns.push(e)},e.prototype.onDone=function(e){this._onDoneFns.push(e)},e.prototype.onDestroy=function(e){this._onDestroyFns.push(e)},e.prototype.play=function(){this._buildPlayer(),this.hasStarted()||(this._onStartFns.forEach(function(e){return e()}),this._onStartFns=[],this._started=!0),this.domPlayer.play()},e.prototype.pause=function(){this.init(),this.domPlayer.pause()},e.prototype.finish=function(){this.init(),this._onFinish(),this.domPlayer.finish()},e.prototype.reset=function(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1},e.prototype._resetDomPlayerState=function(){this.domPlayer&&this.domPlayer.cancel()},e.prototype.restart=function(){this.reset(),this.play()},e.prototype.hasStarted=function(){return this._started},e.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._onDestroyFns.forEach(function(e){return e()}),this._onDestroyFns=[])},e.prototype.setPosition=function(e){this.domPlayer.currentTime=e*this.time},e.prototype.getPosition=function(){return this.domPlayer.currentTime/this.time},Object.defineProperty(e.prototype,"totalTime",{get:function(){return this._delay+this._duration},enumerable:!0,configurable:!0}),e.prototype.beforeDestroy=function(){var e=this,t={};this.hasStarted()&&Object.keys(this._finalKeyframe).forEach(function(n){"offset"!=n&&(t[n]=e._finished?e._finalKeyframe[n]:Qy(e.element,n))}),this.currentSnapshot=t},e.prototype.triggerCallback=function(e){var t="start"==e?this._onStartFns:this._onDoneFns;t.forEach(function(e){return e()}),t.length=0},e}(),cb=function(){function e(){this._isNativeImpl=/\{\s*\[native\s+code\]\s*\}/.test(fb().toString()),this._cssKeyframesDriver=new ub}return e.prototype.validateStyleProperty=function(e){return Sy(e)},e.prototype.matchesElement=function(e,t){return Ey(e,t)},e.prototype.containsElement=function(e,t){return ky(e,t)},e.prototype.query=function(e,t,n){return Cy(e,t,n)},e.prototype.computeStyle=function(e,t,n){return window.getComputedStyle(e)[t]},e.prototype.overrideWebAnimationsSupport=function(e){this._isNativeImpl=e},e.prototype.animate=function(e,t,n,r,i,o,a){if(void 0===o&&(o=[]),!a&&!this._isNativeImpl)return this._cssKeyframesDriver.animate(e,t,n,r,i,o);var s={duration:n,delay:r,fill:0==r?"both":"forwards"};i&&(s.easing=i);var u={},l=o.filter(function(e){return e instanceof lb});return Gy(n,r)&&l.forEach(function(e){var t=e.currentSnapshot;Object.keys(t).forEach(function(e){return u[e]=t[e]})}),t=Jy(e,t=t.map(function(e){return Dy(e,!1)}),u),new lb(e,t,s)},e}();function fb(){return"undefined"!=typeof window&&void 0!==window.document&&Element.prototype.animate||{}}var hb=function(e){function t(t,n){var r=e.call(this)||this;return r._nextAnimationId=0,r._renderer=t.createRenderer(n.body,{id:"0",encapsulation:st.None,styles:[],data:{animation:[]}}),r}return i(t,e),t.prototype.build=function(e){var t=this._nextAnimationId.toString();this._nextAnimationId++;var n=Array.isArray(e)?ty(e):e;return gb(this._renderer,null,t,"register",[n]),new pb(t,this._renderer)},t}(Zm),pb=function(e){function t(t,n){var r=e.call(this)||this;return r._id=t,r._renderer=n,r}return i(t,e),t.prototype.create=function(e,t){return new db(this._id,e,t||{},this._renderer)},t}(Xm),db=function(){function e(e,t,n,r){this.id=e,this.element=t,this._renderer=r,this.parentPlayer=null,this._started=!1,this.totalTime=0,this._command("create",n)}return e.prototype._listen=function(e,t){return this._renderer.listen(this.element,"@@"+this.id+":"+e,t)},e.prototype._command=function(e){for(var t=[],n=1;n=0&&e Sign out - +