text
stringlengths
3
1.05M
let handler = async (m, { conn, text }) => { let who if (m.isGroup) who = m.mentionedJid[0] ? m.mentionedJid[0] : m.quoted ? m.quoted.sender : text else who = m.chat if (!who) throw `tag orangnya!` if (global.prems.includes(who.split`@`[0])) throw 'dia udah premium!' global.prems.push(`${who.split`@`[0]}`) conn.reply(m.chat, `@${who.split`@`[0]} sekarang premium!`, m, { contextInfo: { mentionedJid: [who] } }) } handler.help = ['addprem [@user]'] handler.tags = ['owner'] handler.command = /^(add|tambah|\+)prem$/i handler.rowner = true module.exports = handler
addEventListener('fetch', event => { event.respondWith(handleRequest(event.request)) }) let tracker = null; let restart = true; const baseUrl = "https://cfw-takehome.developers.workers.dev/api/variants"; class ElementHandler { element(element) { const attribute = element.getAttribute('id'); // variant 1 => Linkedin // variant 2 => Github if (tracker == 1) { if (attribute == 'title') { element.setInnerContent('Jesse\'s GitHub'); } if (element.tagName == 'title') { element.setInnerContent('Jesse\'s GitHub'); } if (attribute == 'description') { element.setInnerContent('This is displaying Jesse\'s GitHub!'); } if (attribute == 'url') { element.setInnerContent('Go to Jesse\'s GitHub!'); } if (element.getAttribute('href')) { element.setAttribute('href', 'https://github.com/butler-jelee21'); } } else { if (attribute == 'title') { element.setInnerContent('Jesse\'s LinkedIn'); } if (element.tagName == 'title') { element.setInnerContent('Jesse\'s LinkedIn'); } if (attribute == 'description') { element.setInnerContent('This is displaying Jesse\'s LinkedIn!'); } if (attribute == 'url') { element.setInnerContent('Go to Jesse\'s LinkedIn!'); } if (element.getAttribute('href')) { element.setAttribute('href', 'https://www.linkedin.com/in/jesselee615/'); } } } } const rewriter = new HTMLRewriter() .on('h1#title', new ElementHandler()) .on('title', new ElementHandler()) .on('p#description', new ElementHandler()) .on('a#url', new ElementHandler()); /** * Respond a random variant from base url if no cookies * if there is cookie, respond with appropriate url * @param {Request} request * * Sources Used: * https://developers.cloudflare.com/workers/templates/pages/ab_testing/ */ async function handleRequest(request) { const NAME = 'variant'; const cookie = request.headers.get('cookie'); console.log('Cookie received:', cookie); let variant = null; // get the list of variants let response = await fetch(baseUrl).then((response) => response.json()); // store the variants for later access let variants = response.variants; // preprocess the responses of the two variants in the case that there is a cookie let v1 = await fetch(variants[0]).then((response) => response.body); let v2 = await fetch(variants[1]).then((response) => response.body); const VARIANT_ONE = new Response(v1); const VARIANT_TWO = new Response(v2); // if there is a cookie and the cookie is the first variant, return VARIANT_ONE if (!restart && cookie && cookie.includes(`${NAME}=${variants[0]}`)) { return rewriter.transform(VARIANT_ONE); } // if there is a cookie and the cookie is the second variant, return VARIANT_TWO else if (!restart && cookie && cookie.includes(`${NAME}=${variants[1]}`)) { return rewriter.transform(VARIANT_TWO); } // otherwise, pick a random variant with probability of 0.5 and set the cookie with the variant chosen else { restart = false; let randUrl = getRandom(variants); let idx = variants.indexOf(randUrl); tracker = idx; let randVariant = fetch(randUrl) .then((response) => { let tmpResponse = new Response(response.body); tmpResponse.headers.append('Set-Cookie', `${NAME}=${variants[idx]}`); return rewriter.transform(tmpResponse); }); return randVariant; } } function getRandom(array) { let idx = Math.random() < 0.5 ? 0 : 1; return array[idx]; }
const path = require('path'); module.exports = { entry: './client/index.js', output: { path: path.resolve(`${__dirname}/build`), filename: 'bundle.js', publicPath: '/' }, mode: process.env.NODE_ENV, devServer: { hot: true, publicPath: "/build/", proxy: { '/api': 'http://localhost:3000' } }, module: { rules: [ { test: /\.jsx?/, exclude: /(node_modules)/, use: { loader: "babel-loader", options: { presets: ["@babel/preset-env", "@babel/preset-react"], }, }, }, { test: /\.html$/, use: 'html-loader' }, { test: /\.css$/, use: ['style-loader', "css-loader"] } ] }, }
const { expect } = require('chai'); const path = require('path'); const fs = require('fs'); const tmp = require('tmp'); const { find } = require('lodash'); const CliArgumentParser = require('../../lib/cli/argument-parser'); const nanoid = require('nanoid'); describe('CLI argument parser', function () { this.timeout(10000); tmp.setGracefulCleanup(); function parse (args, cwd) { const parser = new CliArgumentParser(cwd); args = ['node', 'index.js'].concat(typeof args === 'string' ? args.split(/\s+/) : args); return parser.parse(args) .then(function () { return parser; }); } function assertRaisesError (args, expectedMsg) { return parse(args) .then(function () { throw new Error('Promise rejection expected'); }) .catch(function (err) { expect(err.message).eql(expectedMsg); }); } describe('Set browser provider name', function () { it('Should set the default provider name to "locally-installed" from "--list-browsers"', function () { return parse('--list-browsers') .then(function (parser) { expect(parser.opts.listBrowsers).eql(true); expect(parser.opts.providerName).eql('locally-installed'); }); }); it('Should parse the browser provider name from "--list-browsers saucelabs"', function () { return parse('--list-browsers saucelabs') .then(function (parser) { expect(parser.opts.listBrowsers).eql(true); expect(parser.opts.providerName).eql('saucelabs'); }); }); it('Should set the default provider name to "locally-installed" from "-b"', function () { return parse('-b') .then(function (parser) { expect(parser.opts.listBrowsers).eql(true); expect(parser.opts.providerName).eql('locally-installed'); }); }); it('Should parse "-b saucelabs" browser provider name from "-b saucelabs"', function () { return parse('-b saucelabs') .then(function (parser) { expect(parser.opts.listBrowsers).eql(true); expect(parser.opts.providerName).eql('saucelabs'); }); }); }); describe('Browser list', function () { it('Should be parsed as array of aliases or paths', function () { return parse('path:"/Applications/Firefox.app",ie,chrome,firefox,') .then(function (parser) { expect(parser.opts.browsers).eql(['path:/Applications/Firefox.app', 'ie', 'chrome', 'firefox']); }); }); it('Should accept "remote" alias', function () { return parse('remote:12,ie,remote,chrome,remote:3') .then(function (parser) { expect(parser.opts.browsers).eql(['ie', 'chrome']); expect(parser.remoteCount).eql(16); }); }); it('Should accept "all" alias', function () { return parse('ie,chrome,all') .then(function (parser) { expect(parser.opts.browsers).eql(['ie', 'chrome', 'all']); }); }); it('Should split browsers correctly if paths have commas and quotes', function () { return parse('path:"/Apps,Libs/\'Firefox.app",ie,chrome,firefox,path:\'/Apps,Libs/"Chrome.app\'') .then(function (parser) { expect(parser.opts.browsers).eql([ 'path:/Apps,Libs/\'Firefox.app', 'ie', 'chrome', 'firefox', 'path:/Apps,Libs/"Chrome.app' ]); }); }); it('Should split browsers correctly if providers have arguments', function () { return parse(['path:"/Apps/Firefox.app --arg1",chrome --arg2']) .then(function (parser) { expect(parser.opts.browsers).eql([ 'path:/Apps/Firefox.app --arg1', 'chrome --arg2' ]); }); }); }); describe('Ports', function () { it('Should parse "--ports" option as array of two integers', function () { return parse('--ports 1337,1338') .then(function (parser) { expect(parser.opts.ports).eql([1337, 1338]); }); }); it('Should raise error if "--ports" option value is not a integer', function () { return assertRaisesError('--ports 1337,yo', 'Port number is expected to be a non-negative number, but it was "yo".'); }); it('Should raise error if "--ports" option has less than 2 ports specified', function () { return assertRaisesError('--ports 1337', 'The "--ports" option requires two numbers to be specified.'); }); }); describe('Selector timeout', function () { it('Should parse "--selector-timeout" option as integer value', function () { return parse('--selector-timeout 1000') .then(function (parser) { expect(parser.opts.selectorTimeout).eql(1000); }); }); it('Should raise an error if the "--selector-timeout" option value is not an integer', function () { return assertRaisesError('--selector-timeout yo', 'Selector timeout is expected to be a non-negative number, but it was "yo".'); }); }); describe('Assertion timeout', function () { it('Should parse "--assertion-timeout" option as integer value', function () { return parse('--assertion-timeout 1000') .then(function (parser) { expect(parser.opts.assertionTimeout).eql(1000); }); }); it('Should raise an error if the "--assertion-timeout" option value is not an integer', function () { return assertRaisesError('--assertion-timeout yo', 'Assertion timeout is expected to be a non-negative number, but it was "yo".'); }); }); describe('Page load timeout', function () { it('Should parse "--page-load-timeout" option as integer value', function () { return parse('--page-load-timeout 1000') .then(function (parser) { expect(parser.opts.pageLoadTimeout).eql(1000); }); }); it('Should raise an error if the "--page-load-timeout" option value is not an integer', function () { return assertRaisesError('--page-load-timeout yo', 'Page load timeout is expected to be a non-negative number, but it was "yo".'); }); }); describe('Speed', function () { it('Should parse "--speed" option as a number', function () { return parse('--speed 0.01') .then(function (parser) { expect(parser.opts.speed).eql(0.01); }); }); }); describe('Concurrency', function () { it('Should parse "--concurrency" option as a number', function () { return parse('--concurrency 2') .then(function (parser) { expect(parser.opts.concurrency).eql(2); }); }); it('Should parse "-c" option as a number', function () { return parse('-c 2') .then(function (parser) { expect(parser.opts.concurrency).eql(2); }); }); }); describe('App initialization delay', function () { it('Should parse "--app-init-delay" option as integer value', function () { return parse('--app-init-delay 1000') .then(function (parser) { expect(parser.opts.appInitDelay).eql(1000); }); }); it('Should raise an error if the "--app-init-delay" option value is not an integer', function () { return assertRaisesError('--app-init-delay yo', 'Tested app initialization delay is expected to be a non-negative number, but it was "yo".'); }); }); describe('Filtering options', function () { it('Should filter by test name with "-t, --test" option', function () { return parse('-t test.js') .then(function (parser) { expect(parser.opts.filter('test.js')).to.be.true; expect(parser.opts.filter('1test.js')).to.be.false; expect(parser.opts.filter('test-js')).to.be.false; }); }); it('Should filter by test name with "-T, --test-grep" option', function () { parse('-T ^test\\d+$') .then(function (parser) { expect(parser.opts.filter.testGrep.test('test1')).to.be.true; expect(parser.opts.filter.testGrep.test('test')).to.be.false; expect(parser.opts.filter('test1')).to.be.true; expect(parser.opts.filter('test2')).to.be.true; expect(parser.opts.filter('test')).to.be.false; }); }); it('Should raise error if "-T, --test-grep" value is invalid regular expression', function () { return assertRaisesError('-T *+', 'The "--test-grep" option value is not a valid regular expression.'); }); it('Should filter by fixture name with "-f, --fixture" option', function () { return parse('-f fixture.js') .then(function (parser) { expect(parser.opts.filter('test', 'fixture.js')).to.be.true; expect(parser.opts.filter('test', '1fixture.js')).to.be.false; expect(parser.opts.filter('test', 'fixture-js')).to.be.false; }); }); it('Should filter by fixture name with "-F, --fixture-grep" option', function () { return parse('-F ^fixture\\d+$') .then(function (parser) { expect(parser.opts.filter.fixtureGrep.test('fixture1')).to.be.true; expect(parser.opts.filter.fixtureGrep.test('fixture')).to.be.false; expect(parser.opts.filter('test', 'fixture1')).to.be.true; expect(parser.opts.filter('test', 'fixture2')).to.be.true; expect(parser.opts.filter('test', 'fixture')).to.be.false; }); }); it('Should raise error if "-F, --fixture-grep" value is invalid regular expression', function () { return assertRaisesError('-F *+', 'The "--fixture-grep" option value is not a valid regular expression.'); }); it('Should filter by test meta with "--test-meta" option', function () { return parse('--test-meta meta=test') .then(function (parser) { expect(parser.opts.filter.testMeta).to.be.deep.equal({ meta: 'test' }); expect(parser.opts.filter(null, null, null, { meta: 'test' })).to.be.true; expect(parser.opts.filter(null, null, null, { another: 'meta', meta: 'test' })).to.be.true; expect(parser.opts.filter(null, null, null, {})).to.be.false; expect(parser.opts.filter(null, null, null, { meta: 'notest' })).to.be.false; }); }); it('Should filter by fixture meta with "--fixture-meta" option', function () { return parse('--fixture-meta meta=test,more=meta') .then(function (parser) { expect(parser.opts.fixtureMeta).to.be.deep.equal({ meta: 'test', more: 'meta' }); expect(parser.opts.filter(null, null, null, null, { meta: 'test', more: 'meta' })).to.be.true; expect(parser.opts.filter(null, null, null, null, { another: 'meta', meta: 'test', more: 'meta' })).to.be.true; expect(parser.opts.filter(null, null, null, null, {})).to.be.false; expect(parser.opts.filter(null, null, null, null, { meta: 'test' })).to.be.false; expect(parser.opts.filter(null, null, null, null, { meta: 'test', more: 'another' })).to.be.false; }); }); it('Should throw an error if invalid meta is specified', () => { return parse('--fixture-meta meta') .then(() => { throw new Error('Promise rejection expected'); }) .catch(function (error) { expect(error.message).contains('The "--fixture-meta" option value is not a valid key-value pair.'); return parse('--fixture-meta =test'); }) .then(() => { throw new Error('Promise rejection expected'); }) .catch(function (error) { expect(error.message).contains('The "--fixture-meta" option value is not a valid key-value pair.'); return parse('--test-meta meta'); }) .then(() => { throw new Error('Promise rejection expected'); }) .catch(function (error) { expect(error.message).contains('The "--test-meta" option value is not a valid key-value pair.'); return parse('--test-meta =test'); }) .then(() => { throw new Error('Promise rejection expected'); }) .catch(function (error) { expect(error.message).contains('The "--test-meta" option value is not a valid key-value pair.'); }); }); it('Should raise error if "--test-meta" value is invalid json', function () { return assertRaisesError('--test-meta error', 'The "--test-meta" option value is not a valid key-value pair.'); }); it('Should raise error if "--fixture-meta" value is invalid json', function () { return assertRaisesError('--fixture-meta error', 'The "--fixture-meta" option value is not a valid key-value pair.'); }); it('Should combine filters provided by multiple options', function () { return parse('-t thetest1 -T test\\d+$') .then(function (parser) { expect(parser.opts.filter('thetest1')).to.be.true; expect(parser.opts.filter('thetest2')).to.be.false; }) .then(function () { return parse('-t thetest1 -T test$ '); }) .then(function (parser) { expect(parser.opts.filter('thetest1')).to.be.false; expect(parser.opts.filter('thetest')).to.be.false; }) .then(function () { return parse('-f thefixture1 -F fixture\\d+$'); }) .then(function (parser) { expect(parser.opts.filter(null, 'thefixture1')).to.be.true; expect(parser.opts.filter(null, 'thefixture2')).to.be.false; }) .then(function () { return parse('-f thefixture1 -F fixture$'); }) .then(function (parser) { expect(parser.opts.filter(null, 'thefixture1')).to.be.false; expect(parser.opts.filter(null, 'thefixture')).to.be.false; }) .then(function () { return parse('-t thetest1 -f thefixture1'); }) .then(function (parser) { expect(parser.opts.filter('thetest1', 'thefixture1')).to.be.true; expect(parser.opts.filter('thetest', 'thefixture1')).to.be.false; expect(parser.opts.filter('thetest1', 'thefixture')).to.be.false; }) .then(function () { return parse('-T test\\d+$ -f thefixture1 -F fixture\\d+$'); }) .then(function (parser) { expect(parser.opts.filter('thetest1', 'thefixture1')).to.be.true; expect(parser.opts.filter('thetest', 'thefixture1')).to.be.false; expect(parser.opts.filter('thetest1', 'thefixture')).to.be.false; }) .then(function () { return parse('-t thetest1 --test-meta meta=test'); }) .then(function (parser) { expect(parser.opts.filter('thetest1', null, null, { meta: 'test' })).to.be.true; expect(parser.opts.filter('thetest1', null, null, {})).to.be.false; expect(parser.opts.filter('thetest2', null, null, { meta: 'test' })).to.be.false; }) .then(function () { return parse('-f thefixture1 --test-meta meta=test'); }) .then(function (parser) { expect(parser.opts.filter(null, 'thefixture1', null, { meta: 'test' })).to.be.true; expect(parser.opts.filter(null, 'thefixture1', null, {})).to.be.false; expect(parser.opts.filter(null, 'thefixture2', null, { meta: 'test' })).to.be.false; }) .then(function () { return parse('-t thetest1 -f thefixture1 --test-meta meta=test'); }) .then(function (parser) { expect(parser.opts.filter('thetest1', 'thefixture1', null, { meta: 'test' })).to.be.true; expect(parser.opts.filter('thetest1', 'thefixture1', null, {})).to.be.false; expect(parser.opts.filter('thetest1', 'thefixture2', null, { meta: 'test' })).to.be.false; expect(parser.opts.filter('thetest2', 'thefixture1', null, { meta: 'test' })).to.be.false; }) .then(function () { return parse('-t thetest1 --fixture-meta meta=test'); }) .then(function (parser) { expect(parser.opts.filter('thetest1', null, null, null, { meta: 'test' })).to.be.true; expect(parser.opts.filter('thetest1', null, null, null, {})).to.be.false; expect(parser.opts.filter('thetest2', null, null, null, { meta: 'test' })).to.be.false; }) .then(function () { return parse('-f thefixture1 --fixture-meta meta=test'); }) .then(function (parser) { expect(parser.opts.filter(null, 'thefixture1', null, null, { meta: 'test' })).to.be.true; expect(parser.opts.filter(null, 'thefixture1', null, null, {})).to.be.false; expect(parser.opts.filter(null, 'thefixture2', null, null, { meta: 'test' })).to.be.false; }) .then(function () { return parse('-t thetest1 -f thefixture1 --fixture-meta meta=test'); }) .then(function (parser) { expect(parser.opts.filter('thetest1', 'thefixture1', null, null, { meta: 'test' })).to.be.true; expect(parser.opts.filter('thetest1', 'thefixture1', null, null, {})).to.be.false; expect(parser.opts.filter('thetest1', 'thefixture2', null, null, { meta: 'test' })).to.be.false; expect(parser.opts.filter('thetest2', 'thefixture1', null, null, { meta: 'test' })).to.be.false; }) .then(function () { return parse('-t thetest1 -f thefixture1 --test-meta test=test --fixture-meta fixture=test'); }) .then(function (parser) { expect(parser.opts.filter('thetest1', 'thefixture1', null, { test: 'test' }, { fixture: 'test' })).to.be.true; expect(parser.opts.filter('thetest1', 'thefixture1', null, {}, { fixture: 'test' })).to.be.false; expect(parser.opts.filter('thetest1', 'thefixture1', null, { test: 'test' }, {})).to.be.false; expect(parser.opts.filter('thetest1', 'thefixture2', null, { test: 'test' }, { fixture: 'test' })).to.be.false; expect(parser.opts.filter('thetest2', 'thefixture1', null, { test: 'test' }, { fixture: 'test' })).to.be.false; }); }); it("'.filter' property should equal undefined if filtering options are not provided", () => { return parse('param1') .then(parser => { expect(parser.filter).is.undefined; }); }); }); describe('Ssl options', () => { it('Should parse ssl options', () => { return parse('param1 --ssl passphrase=sample;sessionTimeout=1000;rejectUnauthorized=false;=onlyValue;onlyKey=') .then(parser => { expect(parser.opts.ssl.passphrase).eql('sample'); expect(parser.opts.ssl.sessionTimeout).eql(1000); expect(parser.opts.ssl.rejectUnauthorized).eql(false); expect(parser.opts.ssl.onlyKey).to.be.undefined; }); }); describe('`key`, `cert` and `pfx` keys', () => { it('Should parse keys as file paths and read its content', () => { const keyFile = tmp.fileSync(); const certFile = tmp.fileSync(); const pfxFile = tmp.fileSync(); const keyFileContent = Buffer.from(nanoid()); const certFileContent = Buffer.from(nanoid()); const pfxFileContent = Buffer.from(nanoid()); fs.writeFileSync(keyFile.name, keyFileContent); fs.writeFileSync(certFile.name, certFileContent); fs.writeFileSync(pfxFile.name, pfxFileContent); return parse(`--ssl key=${keyFile.name};cert=${certFile.name};pfx=${pfxFile.name}`) .then(parser => { expect(parser.opts.ssl.key).deep.eql(keyFileContent); expect(parser.opts.ssl.cert).deep.eql(certFileContent); expect(parser.opts.ssl.pfx).deep.eql(pfxFileContent); }); }); it('Should not read file content if file does not exists', () => { const dummyFilePath = '/dummy-file-path'; return parse(`--ssl key=${dummyFilePath}`) .then(parser => { expect(parser.opts.ssl.key).eql(dummyFilePath); }); }); it('Should interpret a long path as a certificate content', () => { const keyFileContent = nanoid(5000); return parse(`--ssl key=${keyFileContent}`) .then(parser => { expect(parser.opts.ssl.key).eql(keyFileContent); }); }); it('Should throw an error if a file is not readable', () => { return parse(`--ssl key=${__dirname}`) .catch(error => { expect(error.message).to.include( `Unable to read the "${__dirname}" file, specified by the "key" ssl option. Error details:` ); }) .then(() => parse(`--ssl cert=${__dirname}`)) .catch(error => { expect(error.message).to.include( `Unable to read the "${__dirname}" file, specified by the "cert" ssl option. Error details:` ); }) .then(() => parse(`--ssl pfx=${__dirname}`)) .catch(error => { expect(error.message).to.include( `Unable to read the "${__dirname}" file, specified by the "pfx" ssl option. Error details:` ); }); }); }); }); describe('Video options', () => { it('Should parse video recording options', () => { return parse(`--video /home/user/video --video-options singleFile=true,failedOnly --video-encoding-options c:v=x264`) .then(parser => { expect(parser.opts.video).eql('/home/user/video'); expect(parser.opts.videoOptions.singleFile).eql(true); expect(parser.opts.videoOptions.failedOnly).eql(true); expect(parser.opts.videoEncodingOptions['c:v']).eql('x264'); }); }); it('Should provide "undefined" as a default value for video recording options', () => { return parse(``) .then(parser => { expect(parser.opts.video).eql(void 0); expect(parser.opts.videoOptions).eql(void 0); expect(parser.opts.videoEncodingOptions).eql(void 0); }); }); }); it('Client scripts', () => { return parse('--client-scripts asserts/jquery.js,mockDate.js') .then(parser => { expect(parser.opts.clientScripts).eql([ 'asserts/jquery.js', 'mockDate.js' ]); }); }); it('Should parse reporters and their output file paths and ensure they exist', function () { const cwd = process.cwd(); const filePath = path.join(tmp.dirSync().name, 'my/reports/report.json'); return parse('-r list,json:' + filePath) .then(function (parser) { expect(parser.opts.reporter[0].name).eql('list'); expect(parser.opts.reporter[0].output).to.be.undefined; expect(parser.opts.reporter[1].name).eql('json'); expect(parser.opts.reporter[1].output).eql(path.resolve(cwd, filePath)); }); }); it('Should parse command line arguments', function () { return parse('-r list -S -q -e --hostname myhost --proxy localhost:1234 --proxy-bypass localhost:5678 --qr-code --app run-app --speed 0.5 --debug-on-fail --disable-page-reloads --dev --sf --disable-page-caching ie test/server/data/file-list/file-1.js') .then(parser => { expect(parser.opts.browsers).eql(['ie']); expect(parser.opts.src).eql(['test/server/data/file-list/file-1.js']); expect(parser.opts.reporter[0].name).eql('list'); expect(parser.opts.hostname).eql('myhost'); expect(parser.opts.app).eql('run-app'); expect(parser.opts.screenshots).to.be.undefined; expect(parser.opts.screenshotsOnFails).to.be.ok; expect(parser.opts.quarantineMode).to.be.ok; expect(parser.opts.skipJsErrors).to.be.ok; expect(parser.opts.disablePageReloads).to.be.ok; expect(parser.opts.dev).to.be.ok; expect(parser.opts.speed).eql(0.5); expect(parser.opts.qrCode).to.be.ok; expect(parser.opts.proxy).to.be.ok; expect(parser.opts.proxyBypass).to.be.ok; expect(parser.opts.debugOnFail).to.be.ok; expect(parser.opts.stopOnFirstFail).to.be.ok; expect(parser.opts.disablePageCaching).to.be.ok; }); }); it('Should have static CLI', () => { const WARNING = 'IMPORTANT: Please be sure what you want to change CLI if this test is failing!'; const EXPECTED_OPTIONS = [ { long: '--version', short: '-v' }, { long: '--list-browsers', short: '-b' }, { long: '--reporter', short: '-r' }, { long: '--screenshots', short: '-s' }, { long: '--screenshot-path-pattern', short: '-p' }, { long: '--screenshots-on-fails', short: '-S' }, { long: '--quarantine-mode', short: '-q' }, { long: '--debug-mode', short: '-d' }, { long: '--skip-js-errors', short: '-e' }, { long: '--test', short: '-t' }, { long: '--test-grep', short: '-T' }, { long: '--fixture', short: '-f' }, { long: '--fixture-grep', short: '-F' }, { long: '--app', short: '-a' }, { long: '--concurrency', short: '-c' }, { long: '--live', short: '-L' }, { long: '--test-meta' }, { long: '--fixture-meta' }, { long: '--debug-on-fail' }, { long: '--app-init-delay' }, { long: '--selector-timeout' }, { long: '--assertion-timeout' }, { long: '--page-load-timeout' }, { long: '--speed' }, { long: '--ports' }, { long: '--hostname' }, { long: '--proxy' }, { long: '--proxy-bypass' }, { long: '--disable-page-reloads' }, { long: '--dev' }, { long: '--ssl' }, { long: '--qr-code' }, { long: '--skip-uncaught-errors', short: '-u' }, { long: '--color' }, { long: '--no-color' }, { long: '--stop-on-first-fail', short: '--sf' }, { long: '--video' }, { long: '--video-options' }, { long: '--video-encoding-options' }, { long: '--ts-config-path' }, { long: '--client-scripts', short: '--cs' }, { long: '--screenshots-full-page' }, { long: '--disable-page-caching' } ]; const parser = new CliArgumentParser(''); const options = parser.program.options; expect(options.length).eql(EXPECTED_OPTIONS.length, WARNING); for (let i = 0; i < EXPECTED_OPTIONS.length; i++) { const option = find(options, EXPECTED_OPTIONS[i]); expect(option).not.eql(void 0, WARNING); expect(option.long).eql(EXPECTED_OPTIONS[i].long, WARNING); expect(option.short).eql(EXPECTED_OPTIONS[i].short, WARNING); } }); it('run options', () => { const argumentsString = 'ie,chrome test.js' + [ '--debug-on-fail', '--skip-js-errors', '--skip-uncaught-errors', '--quarantine-mode', '--debug-mode', '--debug-on-fail', '--selector-timeout 1000', '--assertion-timeout 1000', '--page-load-timeout 1000', '--speed 1', '--stop-on-first-fail', '--disable-page-caching', '--disable-page-reloads' ].join(' '); return parse(argumentsString) .then(parser => { const runOpts = parser.getRunOptions(); expect(runOpts.skipJsErrors).eql(true); expect(runOpts.skipUncaughtErrors).eql(true); expect(runOpts.quarantineMode).eql(true); expect(runOpts.debugMode).eql(true); expect(runOpts.debugOnFail).eql(true); expect(runOpts.selectorTimeout).eql(1000); expect(runOpts.assertionTimeout).eql(1000); expect(runOpts.pageLoadTimeout).eql(1000); expect(runOpts.speed).eql(1); expect(runOpts.stopOnFirstFail).eql(true); expect(runOpts.disablePageCaching).eql(true); expect(runOpts.disablePageReloads).eql(true); expect(runOpts.browsers).to.be.undefined; }); }); });
/* Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang( 'pastefromword', 'ms', { confirmCleanup: 'The text you want to paste seems to be copied from Word. Do you want to clean it before pasting?', // MISSING error: 'It was not possible to clean up the pasted data due to an internal error', // MISSING title: 'Tampal dari Word', toolbar: 'Tampal dari Word' } );
const webpack = require('webpack'); const loaders = require("./helpers/webpack.loaders.config"); const preloaders = require("./helpers/webpack.preloaders.config"); const HtmlWebpackPlugin = require('html-webpack-plugin'); const CopyWebpackPlugin = require('copy-webpack-plugin'); module.exports = { entry: ['./src/app/app.module.js'], output: { filename: 'build.js', path: './dist' }, resolve: { root: __dirname, extensions: ['', '.js', '.json'] }, resolveLoader: { modulesDirectories: ["node_modules"] }, plugins: [ new HtmlWebpackPlugin({ template: './src/index.html', inject: 'body', hash: true }), new CopyWebpackPlugin([{ from: './src/assets/img/', to: 'assets/img/' }]) ], module:{ preloaders: preloaders, loaders: loaders } };
'use strict'; angular.module('wanderlustApp') .directive('starRating', function(){ return { restrict: 'E', template: '<span class="glyphicon glyphicon-star"></span>' }; }) .directive('tagPrice', function(){ return { restrict: 'E', template: '<span class="glyphicon glyphicon-usd"></span>' }; }) .directive('tagCamera', function(){ return { restrict: 'E', template: '<span class="glyphicon glyphicon-camera"></span>' }; }) .directive('tagTree', function(){ return { restrict: 'E', template: '<span class="glyphicon glyphicon-tree-conifer"></span>' }; }) .factory('httpGET', function($http){ return { getData: function(callback){ return $http({ method: 'GET', url: '/api/tours' }).success(function(data){ callback(data); }); } } }) .controller('ToursCtrl', function ($scope, $location, $http, httpGET, $stateParams) { console.log('PARAMS', $stateParams); $scope.tourFilter = $stateParams.filter || ''; httpGET.getData(function(data){ $scope.tours = data; console.log($scope.tours); }); //route to tour on click $scope.selectedTour = function(tour){ $location.path('/tours/showtour/' + tour._id); }; });
""" RenderPipeline Copyright (c) 2014-2016 tobspr <[email protected]> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ # Load the base plugin class from rpcore.pluginbase.base_plugin import BasePlugin # Load your additional plugin classes here, if required from .demo_stage import DemoStage class Plugin(BasePlugin): name = "Plugin Prefab" author = "tobspr <[email protected]>" description = ("This is the most basic structure of a plugin. You can copy " "it to produce your own plugins") version = "1.0" def on_stage_setup(self): """ This method gets called when the pipeline setups the render stages. You should create your custom stages here """ # Setup a demo stage self.stage = self.create_stage(DemoStage) def on_pipeline_created(self): """ This method gets called after the pipeline finished the setup, and is about to start rendering """ def update_some_setting(self): """ This method gets called when the setting "some_setting" of your plugin gets called. You should do all work to update required inputs etc. yourself. """
import React from 'react'; import PropTypes from 'prop-types'; import TreeView from '@material-ui/lab/TreeView'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; import ChevronRightIcon from '@material-ui/icons/ChevronRight'; import TreeItem from '@material-ui/lab/TreeItem'; import Column from './Column'; import NavEntry from './NavEntry'; import { applyAllFilters } from './navUtils'; import { STATUS } from "../Common/defaults"; import { CATEGORIES } from "../Common/defaults"; import { generatePath } from 'react-router'; import { NavLink } from 'react-router-dom'; import TagList from './TagList'; /** * Render a vertical list of all the currently selected entries children. */ const TreeViewNav = (props) => { return ( <> <Column width={props.width} handleColumnResizing={props.handleColumnResizing}> <TreeView disableSelection={true} defaultCollapseIcon={<ExpandMoreIcon />} defaultExpandIcon={<ChevronRightIcon />}> {createTree(props)} </TreeView> </Column > </> ); }; TreeViewNav.propTypes = { /** Nav list entries to be displayed */ entries: PropTypes.arrayOf(PropTypes.shape({ uid: PropTypes.string, name: PropTypes.string, description: PropTypes.string, status: PropTypes.oneOf(STATUS), counter: PropTypes.shape({ passed: PropTypes.number, failed: PropTypes.number, }), })), /** Number of entries in the breadcrumb menu */ breadcrumbLength: PropTypes.number, /** Function to handle Nav list resizing */ handleColumnResizing: PropTypes.func, /** Entity filter */ filter: PropTypes.string, /** Flag to display empty testcase on navbar */ displayEmpty: PropTypes.bool, /** Flag to display tags on navbar */ displayTags: PropTypes.bool, /** Flag to display execution time on navbar */ displayTime: PropTypes.bool, /** Entry uid to be focused */ selectedUid: PropTypes.string, url: PropTypes.string }; export default TreeViewNav; const LeafNodeStyle = { webkitUserSelect: "text", MozUserSelect: "text", MsUserSelect: "text", UserSelect: "text", textDecoration: 'none' }; const createTree = (props) => { let entries = applyAllFilters(props, props.entries); return Array.isArray(entries) ? entries.map((entry) => createTreeHelper(props, entry)) : null; }; const createTreeHelper = (props, entry) => { return entry.category === CATEGORIES['testcase'] ? createLeafNode(props, entry) : createNode(props, entry); }; const createLeafNode = (props, entry) => { let [reportuid, ...selectionuids] = entry.uids; const linkTo = generatePath(props.url, { uid: reportuid, selection: selectionuids }); const tags = ( (props.displayTags && entry.tags) ? <TagList entryName={entry.name} tags={entry.tags} /> : null ); return ( <TreeItem nodeId={entry.uid || entry.hash} key={entry.uid || entry.hash} label={ <NavLink style={LeafNodeStyle} key={entry.hash || entry.uid} to={linkTo}> {tags} {createNavEntry(props, entry)} </NavLink> }></TreeItem> ); }; const createNode = (props, entry) => { return ( <TreeItem nodeId={entry.uid || entry.hash} key={entry.uid || entry.hash} label={createNavEntry(props, entry)}> {Array.isArray(entry.entries) ? entry.entries.map((entry) => createTreeHelper(props, entry)) : null} </TreeItem> ); }; const createNavEntry = (props, entry) => { return ( <NavEntry name={entry.name} description={entry.description} status={entry.status} type={entry.category} caseCountPassed={entry.counter.passed} caseCountFailed={entry.counter.failed + (entry.counter.error || 0)} executionTime={(entry.timer && entry.timer.run) ? ( (new Date(entry.timer.run.end)).getTime() - (new Date(entry.timer.run.start)).getTime()) / 1000 : null} displayTime={props.displayTime} /> ); };
//----------------------------------------------------------------------------- // Phina.Asset.Sound exports._play = function(sound) { return sound.stop().play(); }; exports._stop = function(sound) { return sound.stop(); }; exports._pause = function(sound) { sound.source != null && sound.pause(); return sound; }; exports._resume = function(sound) { sound.source != null && sound.resume(); return sound; };
# coding=utf-8 # Copyright 2021 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Util methods for the MinDiff Keras colab.""" import pandas as pd import tensorflow as tf import tensorflow_hub as hub TEXT_FEATURE = 'comment_text' LABEL = 'toxicity' def download_and_process_civil_comments_data(): """Download and process the civil comments dataset into a Pandas DataFrame.""" # Download data. toxicity_data_url = 'https://storage.googleapis.com/civil_comments_dataset/' train_csv_file = tf.keras.utils.get_file( 'train_df_processed.csv', toxicity_data_url + 'train_df_processed.csv') validate_csv_file = tf.keras.utils.get_file( 'validate_df_processed.csv', toxicity_data_url + 'validate_df_processed.csv') # Get validation data as TFRecords. validate_tfrecord_file = tf.keras.utils.get_file( 'validate_tf_processed.tfrecord', toxicity_data_url + 'validate_tf_processed.tfrecord') # Read data into Pandas DataFrame. data_train = pd.read_csv(train_csv_file) data_validate = pd.read_csv(validate_csv_file) # Fix type interpretation. data_train[TEXT_FEATURE] = data_train[TEXT_FEATURE].astype(str) data_validate[TEXT_FEATURE] = data_validate[TEXT_FEATURE].astype(str) # Shape labels to match output. labels_train = data_train[LABEL].values.reshape(-1, 1) * 1.0 labels_validate = data_validate[LABEL].values.reshape(-1, 1) * 1.0 return data_train, data_validate, validate_tfrecord_file, labels_train, labels_validate def _create_embedding_layer(hub_url): return hub.KerasLayer( hub_url, output_shape=[128], input_shape=[], dtype=tf.string) # pylint does not understand the default arg values, thinks they are empty [] # pylint:disable=dangerous-default-value def create_keras_sequential_model( hub_url='https://tfhub.dev/google/tf2-preview/nnlm-en-dim128/1', cnn_filter_sizes=[128, 128, 128], cnn_kernel_sizes=[5, 5, 5], cnn_pooling_sizes=[5, 5, 40]): """Create baseline keras sequential model.""" model = tf.keras.Sequential() # Embedding layer. hub_layer = _create_embedding_layer(hub_url) model.add(hub_layer) model.add(tf.keras.layers.Reshape((1, 128))) # Convolution layers. for filter_size, kernel_size, pool_size in zip(cnn_filter_sizes, cnn_kernel_sizes, cnn_pooling_sizes): model.add( tf.keras.layers.Conv1D( filter_size, kernel_size, activation='relu', padding='same')) model.add(tf.keras.layers.MaxPooling1D(pool_size, padding='same')) # Flatten, fully connected, and output layers. model.add(tf.keras.layers.Flatten()) model.add(tf.keras.layers.Dense(128, activation='relu')) model.add(tf.keras.layers.Dense(1, activation='sigmoid')) return model
/* * DragZoomControl Class * Copyright (c) 2005-2007, Andre Lewis, [email protected] * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * This class lets you add a control to the map which will let the user * zoom by dragging a rectangle. * More info on original GZoom at http://earthcode.com */ /** * Constructor for DragZoomControl, which takes 3 option hashes and * uses them to customize the control. * @param {opts_boxStyle} Named optional arguments: * opts_boxStyle.opacity {Number} Opacity from 0-1 * opts_boxStyle.fillColor {String} Hex value of fill color * opts_boxStyle.border {String} CSS-style declaration of border * @param {opts_other} Named optional arguments: * opts_other.buttonHTML {String} The zoom button HTML in non-activated state * opts_other.buttonStartingStyle {Object} A hash of css styles for the * zoom button which are common to both un-activated and activated state * opts_other.buttonStyle {Object} A hash of css styles for the zoom button * which will be applied when the button is in un-activated state. * opts_other.buttonZoomingHTML {String} HTML which is placed in the * zoom button when the button is activated. * opts_other.buttonZoomingStyle {Object} A hash of css styles for the * zoom button which will be applied when the button is activated. * opts_other.overlayRemoveTime {Number} The number of milliseconds to wait before * removing the rectangle indicating the zoomed-in area after the zoom has happened. * opts_other.stickyZoomEnabled {Boolean} Whether or not the control stays in * "zoom mode" until turned off. When true, the user can zoom repeatedly, * until clicking on the zoom button again to turn zoom mode off. * @param {opts_callbacks} Named optional arguments: * opts_callbacks.buttonclick {Function} Called when the DragZoom is activated * by clicking on the "zoom" button. * opts_callbacks.dragstart {Function} Called when user starts to drag a rectangle. * Callback args are x,y -- the PIXEL values, relative to the upper-left-hand * corner of the map, where the user began dragging. * opts_callbacks.dragging {Function} Called repeatedly while the user is dragging. * Callback args are startX,startY, currentX,currentY -- the PIXEL values of the * start of the drag, and the current drag point, respectively. * opts_callbacks.dragend {Function} Called when the user releases the mouse button * after dragging the rectangle. Callback args are: NW {GLatLng}, NE {GLatLng}, * SE {GLatLng}, SW {GLatLng}, NW {GPoint}, NE {GPoint}, SE {GPoint}, SW {GPoint}. * The first 4 are the latitudes/longitudes; the last 4 are the pixel coords on the map. */ function DragZoomControl(opts_boxStyle, opts_other, opts_callbacks) { // Holds all information needed globally // Not all globals are initialized here this.globals = { draggingOn: false, cornerTopDiv: null, cornerRightDiv: null, cornerBottomDiv: null, cornerLeftDiv: null, mapPosition: null, outlineDiv: null, mapWidth: 0, mapHeight: 0, mapRatio: 0, startX: 0, startY: 0, borderCorrection: 0 }; //box style options this.globals.style = { opacity: .2, fillColor: "#000", border: "2px solid blue" }; var style = this.globals.style; for (var s in opts_boxStyle) { style[s]=opts_boxStyle[s]; } var borderStyleArray = style.border.split(' '); style.outlineWidth = parseInt(borderStyleArray[0].replace(/\D/g,'')); style.outlineColor = borderStyleArray[2]; style.alphaIE = 'alpha(opacity=' + (style.opacity * 100) + ')'; // Other options this.globals.options={ buttonHTML: 'zoom ...', buttonStartingStyle: {width: '52px', border: '1px solid black', padding: '2px'}, buttonStyle: {background: '#FFF'}, buttonZoomingHTML: 'Drag a region on the map', buttonZoomingStyle: {background: '#FF0'}, overlayRemoveTime: 6000, stickyZoomEnabled: false }; for (var s in opts_other) { this.globals.options[s] = opts_other[s] } // callbacks: buttonclick, dragstart, dragging, dragend if (opts_callbacks == null) { opts_callbacks = {} } this.globals.callbacks = opts_callbacks; } DragZoomControl.prototype = new GControl(); /** * Creates a new button to control gzoom and appends to map div. * @param {DOM Node} map The div returned by map.getContainer() */ DragZoomControl.prototype.initButton_ = function(mapDiv) { var G = this.globals; var buttonDiv = document.createElement('div'); buttonDiv.innerHTML = G.options.buttonHTML; buttonDiv.id = 'gzoom-control'; DragZoomUtil.style([buttonDiv], {cursor: 'pointer', zIndex:200}); DragZoomUtil.style([buttonDiv], G.options.buttonStartingStyle); DragZoomUtil.style([buttonDiv], G.options.buttonStyle); mapDiv.appendChild(buttonDiv); return buttonDiv; }; /** * Sets button mode to zooming or otherwise, changes CSS & HTML. * @param {String} mode Either "zooming" or not. */ DragZoomControl.prototype.setButtonMode_ = function(mode){ var G = this.globals; if (mode == 'zooming') { G.buttonDiv.innerHTML = G.options.buttonZoomingHTML; DragZoomUtil.style([G.buttonDiv], G.options.buttonZoomingStyle); } else { G.buttonDiv.innerHTML = G.options.buttonHTML; DragZoomUtil.style([G.buttonDiv], G.options.buttonStyle); } }; /** * Is called by GMap2's addOverlay method. Creates the zoom control * divs and appends to the map div. * @param {GMap2} map The map that has had this DragZoomControl added to it. * @return {DOM Object} Div that holds the gzoomcontrol button */ DragZoomControl.prototype.initialize = function(map) { var G = this.globals; var me = this; var mapDiv = map.getContainer(); //DOM:button var buttonDiv = this.initButton_(mapDiv); //DOM:map covers var zoomDiv = document.createElement("div"); zoomDiv.id ='gzoom-map-cover'; zoomDiv.innerHTML ='<div id="gzoom-outline" style="position:absolute;display:none;"></div><div id="gzoom-cornerTopDiv" style="position:absolute;display:none;"></div><div id="gzoom-cornerLeftDiv" style="position:absolute;display:none;"></div><div id="gzoom-cornerRightDiv" style="position:absolute;display:none;"></div><div id="gzoom-cornerBottomDiv" style="position:absolute;display:none;"></div>'; DragZoomUtil.style([zoomDiv], {position: 'absolute', display: 'none', overflow: 'hidden', cursor: 'crosshair', zIndex: 101}); mapDiv.appendChild(zoomDiv); // add event listeners GEvent.addDomListener(buttonDiv, 'click', function(e) { me.buttonclick_(e); }); GEvent.addDomListener(zoomDiv, 'mousedown', function(e) { me.coverMousedown_(e); }); GEvent.addDomListener(document, 'mousemove', function(e) { me.drag_(e); }); GEvent.addDomListener(document, 'mouseup', function(e) { me.mouseup_(e); }); // get globals G.mapPosition = DragZoomUtil.getElementPosition(mapDiv); G.outlineDiv = DragZoomUtil.gE("gzoom-outline"); G.buttonDiv = DragZoomUtil.gE("gzoom-control"); G.mapCover = DragZoomUtil.gE("gzoom-map-cover"); G.cornerTopDiv = DragZoomUtil.gE("gzoom-cornerTopDiv"); G.cornerRightDiv = DragZoomUtil.gE("gzoom-cornerRightDiv"); G.cornerBottomDiv = DragZoomUtil.gE("gzoom-cornerBottomDiv"); G.cornerLeftDiv = DragZoomUtil.gE("gzoom-cornerLeftDiv"); G.map = map; G.borderCorrection = G.style.outlineWidth * 2; this.setDimensions_(); //styles this.initStyles_(); return buttonDiv; }; /** * Required by GMaps API for controls. * @return {GControlPosition} Default location for control */ DragZoomControl.prototype.getDefaultPosition = function() { return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(3, 120)); }; /** * Function called when mousedown event is captured. * @param {Object} e */ DragZoomControl.prototype.coverMousedown_ = function(e){ var G = this.globals; var pos = this.getRelPos_(e); G.startX = pos.left; G.startY = pos.top; DragZoomUtil.style([G.mapCover], {background: 'transparent', opacity: 1, filter: 'alpha(opacity=100)'}); DragZoomUtil.style([G.outlineDiv], {left: G.startX + 'px', top: G.startY + 'px', display: 'block', width: '1px', height: '1px'}); G.draggingOn = true; G.cornerTopDiv.style.top = (G.startY - G.mapHeight) + 'px'; G.cornerTopDiv.style.display ='block'; G.cornerLeftDiv.style.left = (G.startX - G.mapWidth) +'px'; G.cornerLeftDiv.style.top = G.startY + 'px'; G.cornerLeftDiv.style.display = 'block'; G.cornerRightDiv.style.left = G.startX + 'px'; G.cornerRightDiv.style.top = G.startY + 'px'; G.cornerRightDiv.style.display = 'block'; G.cornerBottomDiv.style.left = G.startX + 'px'; G.cornerBottomDiv.style.top = G.startY + 'px'; G.cornerBottomDiv.style.width = '0px'; G.cornerBottomDiv.style.display = 'block'; // invoke the callback if provided if (G.callbacks.dragstart != null) { G.callbacks.dragstart(G.startX, G.startY); } return false; }; /** * Function called when drag event is captured * @param {Object} e */ DragZoomControl.prototype.drag_ = function(e){ var G = this.globals; if(G.draggingOn) { var pos = this.getRelPos_(e); rect = this.getRectangle_(G.startX, G.startY, pos, G.mapRatio); if (rect.left) { addX = -rect.width; } else { addX = 0; } if (rect.top) { addY = -rect.height; } else { addY = 0; } DragZoomUtil.style([G.outlineDiv], {left: G.startX + addX + 'px', top: G.startY + addY + 'px', display: 'block', width: '1px', height: '1px'}); G.outlineDiv.style.width = rect.width + "px"; G.outlineDiv.style.height = rect.height + "px"; G.cornerTopDiv.style.height = ((G.startY + addY) - (G.startY - G.mapHeight)) + 'px'; G.cornerLeftDiv.style.top = (G.startY + addY) + 'px'; G.cornerLeftDiv.style.width = ((G.startX + addX) - (G.startX - G.mapWidth)) + 'px'; G.cornerRightDiv.style.top = G.cornerLeftDiv.style.top; G.cornerRightDiv.style.left = (G.startX + addX + rect.width + G.borderCorrection) + 'px'; G.cornerBottomDiv.style.top = (G.startY + addY + rect.height + G.borderCorrection) + 'px'; G.cornerBottomDiv.style.left = (G.startX - G.mapWidth + ((G.startX + addX) - (G.startX - G.mapWidth))) + 'px'; G.cornerBottomDiv.style.width = (rect.width + G.borderCorrection) + 'px'; // invoke callback if provided if (G.callbacks.dragging != null) { G.callbacks.dragging(G.startX, G.startY, rect.endX, rect.endY) } return false; } }; /** * Function called when mouseup event is captured * @param {Event} e */ DragZoomControl.prototype.mouseup_ = function(e){ var G = this.globals; if (G.draggingOn) { var pos = this.getRelPos_(e); G.draggingOn = false; var rect = this.getRectangle_(G.startX, G.startY, pos, G.mapRatio); if (rect.left) rect.endX = rect.startX - rect.width; if (rect.top) rect.endY = rect.startY - rect.height; this.resetDragZoom_(); if (rect.startY var nwpx = new GPoint(rect.startX, rect.startY); var nepx = new GPoint(rect.endX, rect.startY); var sepx = new GPoint(rect.endX, rect.endY); var swpx = new GPoint(rect.startX, rect.endY); var nw = G.map.fromContainerPixelToLatLng(nwpx); var ne = G.map.fromContainerPixelToLatLng(nepx); var se = G.map.fromContainerPixelToLatLng(sepx); var sw = G.map.fromContainerPixelToLatLng(swpx); map.removeOverlay(this.globals.zoomAreaPoly); this.globals.zoomAreaPoly = new GPolyline([nw, ne, se, sw, nw], G.style.outlineColor, G.style.outlineWidth + 1,.4); try{ G.map.addOverlay(this.globals.zoomAreaPoly); }catch(e) {} oBounds = new GLatLngBounds(); oBounds.extend(nw); oBounds.extend(ne); oBounds.extend(se); oBounds.extend(sw); zoomLevel = G.map.getBoundsZoomLevel(oBounds); center = oBounds.getCenter(); //G.map.setCenter(center, zoomLevel); // invoke callback if provided if (G.callbacks.dragend != null) { G.callbacks.dragend(nw, ne, se, sw, nwpx, nepx, sepx, swpx); } //re-init if sticky if (G.options.stickyZoomEnabled) { this.initCover_(); } } }; /** * Set the cover sizes according to the size of the map */ DragZoomControl.prototype.setDimensions_ = function() { var G = this.globals; var mapSize = G.map.getSize(); G.mapWidth = mapSize.width; G.mapHeight = mapSize.height; G.mapRatio = G.mapHeight / G.mapWidth; DragZoomUtil.style([G.mapCover, G.cornerTopDiv, G.cornerRightDiv, G.cornerBottomDiv, G.cornerLeftDiv], {width: G.mapWidth + 'px', height: G.mapHeight +'px'}); }; /** * Initializes styles based on global parameters */ DragZoomControl.prototype.initStyles_ = function(){ var G = this.globals; DragZoomUtil.style([G.mapCover, G.cornerTopDiv, G.cornerRightDiv, G.cornerBottomDiv, G.cornerLeftDiv], {filter: G.style.alphaIE, opacity: G.style.opacity, background:G.style.fillColor}); G.outlineDiv.style.border = G.style.border; }; /** * Function called when the zoom button's click event is captured. */ DragZoomControl.prototype.buttonclick_ = function(){ if (this.globals.mapCover.style.display == 'block') { // reset if clicked before dragging this.resetDragZoom_(); } else { this.initCover_(); } }; /** * Shows the cover over the map */ DragZoomControl.prototype.initCover_ = function(){ var G = this.globals; G.mapPosition = DragZoomUtil.getElementPosition(G.map.getContainer()); this.setDimensions_(); this.setButtonMode_('zooming'); DragZoomUtil.style([G.mapCover], {display: 'block', background: G.style.fillColor}); DragZoomUtil.style([G.outlineDiv], {width: '0px', height: '0px'}); //invoke callback if provided if(G.callbacks['buttonclick'] != null){ G.callbacks.buttonclick(); } }; /** * Gets position of the mouse relative to the map * @param {Object} e */ DragZoomControl.prototype.getRelPos_ = function(e) { var pos = DragZoomUtil.getMousePosition(e); var G = this.globals; return {top: (pos.top - G.mapPosition.top), left: (pos.left - G.mapPosition.left)}; }; /** * Figures out the rectangle the user's trying to draw * @param {Number} startX * @param {Number} startY * @param {Object} pos * @param {Number} ratio * @return {Object} Describes the rectangle */ DragZoomControl.prototype.getRectangle_ = function(startX, startY, pos, ratio){ var left = false; var top = false; var dX = pos.left - startX; var dY = pos.top - startY; if (dX < 0) { dX = dX * -1; left = true; } if (dY < 0) { dY = dY * -1; top = true; } delta = dX > dY ? dX : dY; return { startX: startX, startY: startY, endX: startX + delta, endY: startY + parseInt(delta * ratio), width: delta, height: parseInt(delta * ratio), left:left, top:top } }; /** * Resets CSS and button display when drag zoom done */ DragZoomControl.prototype.resetDragZoom_ = function() { var G = this.globals; DragZoomUtil.style([G.mapCover, G.cornerTopDiv, G.cornerRightDiv, G.cornerBottomDiv, G.cornerLeftDiv], {display: 'none', opacity: G.style.opacity, filter: G.style.alphaIE}); G.outlineDiv.style.display = 'none'; this.setButtonMode_('normal'); }; /* utility functions in DragZoomUtil.namespace */ var DragZoomUtil={}; /** * Alias function for getting element by id * @param {String} sId * @return {Object} DOM object with sId id */ DragZoomUtil.gE = function(sId) { return document.getElementById(sId); } /** * A general-purpose function to get the absolute position * of the mouse. * @param {Object} e Mouse event * @return {Object} Describes position */ DragZoomUtil.getMousePosition = function(e) { var posX = 0; var posY = 0; if (!e) var e = window.event; if (e.pageX || e.pageY) { posX = e.pageX; posY = e.pageY; } else if (e.clientX || e.clientY){ posX = e.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft); posY = e.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop); } return {left: posX, top: posY}; }; /** * Gets position of element * @param {Object} element * @return {Object} Describes position */ DragZoomUtil.getElementPosition = function(element) { var leftPos = element.offsetLeft; // initialize var to store calculations var topPos = element.offsetTop; // initialize var to store calculations var parElement = element.offsetParent; // identify first offset parent element while (parElement != null ) { // move up through element hierarchy leftPos += parElement.offsetLeft; // appending left offset of each parent topPos += parElement.offsetTop; parElement = parElement.offsetParent; // until no more offset parents exist } return {left: leftPos, top: topPos}; }; /** * Applies styles to DOM objects * @param {String/Object} elements Either comma-delimited list of ids * or an array of DOM objects * @param {Object} styles Hash of styles to be applied */ DragZoomUtil.style = function(elements, styles){ if (typeof(elements) == 'string') { elements = DragZoomUtil.getManyElements(elements); } for (var i = 0; i < elements.length; i++){ for (var s in styles) { elements[i].style[s] = styles[s]; } } }; /** * Gets DOM elements array according to list of IDs * @param {String} elementsString Comma-delimited list of IDs * @return {Array} Array of DOM elements corresponding to s */ DragZoomUtil.getManyElements = function(idsString){ var idsArray = idsString.split(','); var elements = []; for (var i = 0; i < idsArray.length; i++){ elements[elements.length] = DragZoomUtil.gE(idsArray[i]) }; return elements; };
"use strict"; var basic_calendar = { init: function() { $('#cal-basic').fullCalendar({ defaultDate: '2016-06-12', editable: true, selectable: true, selectHelper: true, droppable: true, eventLimit: true, select: function(start, end, allDay) { var title = prompt('Event Title:'); if (title) { $('#cal-basic').fullCalendar('renderEvent', { title: title, start: start._d, end: end._d, allDay: allDay }, true ); } $('#cal-basic').fullCalendar('unselect'); }, events: [ { title: 'All Day Event', start: '2016-06-01' }, { title: 'Long Event', start: '2016-06-07', end: '2016-06-10' }, { id: 999, title: 'Repeating Event', start: '2016-06-09T16:00:00' }, { id: 999, title: 'Repeating Event', start: '2016-06-16T16:00:00' }, { title: 'Conference', start: '2016-06-11', end: '2016-06-13' }, { title: 'Meeting', start: '2016-06-12T10:30:00', end: '2016-06-12T12:30:00' }, { title: 'Lunch', start: '2016-06-12T12:00:00' }, { title: 'Meeting', start: '2016-06-12T14:30:00' }, { title: 'Happy Hour', start: '2016-06-12T17:30:00' }, { title: 'Dinner', start: '2016-06-12T20:00:00' }, { title: 'Birthday Party', start: '2016-06-13T07:00:00' } ] }), $('#cal-basic-view').fullCalendar({ header: { right: 'prev,next today', center: 'title', left: 'month,basicWeek,basicDay' }, defaultDate: '2016-06-12', editable: true, droppable: true, eventLimit: true, select: function(start, end, allDay) { var title = prompt('Event Title:'); if (title) { $('#cal-basic-view').fullCalendar('renderEvent', { title: title, start: start._d, end: end._d, allDay: allDay }, true ); } $('#cal-basic-view').fullCalendar('unselect'); }, events: [ { title: 'All Day Event', start: '2016-06-01' }, { title: 'Long Event', start: '2016-06-07', end: '2016-06-10' }, { id: 999, title: 'Repeating Event', start: '2016-06-09T16:00:00' }, { id: 999, title: 'Repeating Event', start: '2016-06-16T16:00:00' }, { title: 'Conference', start: '2016-06-11', end: '2016-06-13' }, { title: 'Meeting', start: '2016-06-12T10:30:00', end: '2016-06-12T12:30:00' }, { title: 'Lunch', start: '2016-06-12T12:00:00' }, { title: 'Meeting', start: '2016-06-12T14:30:00' }, { title: 'Happy Hour', start: '2016-06-12T17:30:00' }, { title: 'Dinner', start: '2016-06-12T20:00:00' }, { title: 'Birthday Party', start: '2016-06-13T07:00:00' }, { title: 'Click for Google', url: 'http://google.com/', start: '2016-06-28' } ] }), $('#cal-agenda-view').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, defaultDate: '2016-06-12', defaultView: 'agendaWeek', editable: true, selectable: true, selectHelper: true, droppable: true, eventLimit: true, select: function(start, end, allDay) { var title = prompt('Event Title:'); if (title) { $('#cal-agenda-view').fullCalendar('renderEvent', { title: title, start: start._d, end: end._d, allDay: allDay }, true ); } $('#cal-agenda-view').fullCalendar('unselect'); }, events: [ { title: 'All Day Event', start: '2016-06-01' }, { title: 'Long Event', start: '2016-06-07', end: '2016-06-10' }, { id: 999, title: 'Repeating Event', start: '2016-06-09T16:00:00' }, { id: 999, title: 'Repeating Event', start: '2016-06-16T16:00:00' }, { title: 'Conference', start: '2016-06-11', end: '2016-06-13' }, { title: 'Meeting', start: '2016-06-12T10:30:00', end: '2016-06-12T12:30:00' }, { title: 'Lunch', start: '2016-06-12T12:00:00' }, { title: 'Meeting', start: '2016-06-12T14:30:00' }, { title: 'Happy Hour', start: '2016-06-12T17:30:00' }, { title: 'Dinner', start: '2016-06-12T20:00:00' }, { title: 'Birthday Party', start: '2016-06-13T07:00:00' }, { title: 'Click for Google', url: 'http://google.com/', start: '2016-06-28' } ] }), $('#cal-bg-events').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, defaultDate: '2018-02-03', businessHours: true, editable: true, selectable: true, selectHelper: true, droppable: true, eventLimit: true, select: function(start, end, allDay) { var title = prompt('Event Title:'); if (title) { $('#cal-bg-events').fullCalendar('renderEvent', { title: title, start: start._d, end: end._d, allDay: allDay }, true ); } $('#cal-bg-events').fullCalendar('unselect'); }, events: [ { title: 'Business Lunch', start: '2018-02-03T16:00:00', constraint: 'businessHours' }, { title: 'Meeting', start: '2018-02-13T11:00:00', constraint: 'availableForMeeting', color: '#ba895d' }, { title: 'Conference', start: '2018-02-18', end: '2016-06-20' }, { title: 'Party', start: '2018-02-28T20:00:00' }, { id: 'availableForMeeting', start: '2018-02-11T10:00:00', end: '2016-02-11T16:00:00', rendering: 'background' }, { id: 'availableForMeeting', start: '2018-02-13T10:00:00', end: '2018-02-13T16:00:00', rendering: 'background' }, { start: '2018-02-24', end: '2018-02-28', overlap: false, rendering: 'background', color: '#ba895d' }, { start: '2018-02-06', end: '2018-02-08', overlap: false, rendering: 'background', color: '#ba895d' } ] }), $('#cal-event-colors').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, defaultDate: '2016-06-12', businessHours: true, editable: true, selectable: true, selectHelper: true, droppable: true, eventLimit: true, select: function(start, end, allDay) { var title = prompt('Event Title:'); if (title) { $('#cal-event-colors').fullCalendar('renderEvent', { title: title, start: start._d, end: end._d, allDay: allDay }, true ); } $('#cal-event-colors').fullCalendar('unselect'); }, events: [ { title: 'All Day Event', start: '2016-06-01', color: '#24695c' }, { title: 'Long Event', start: '2016-06-07', end: '2016-06-10', color: '#ba895d' }, { id: 999, title: 'Repeating Event', start: '2016-06-09T16:00:00', color: '#ba895d' }, { id: 999, title: 'Repeating Event', start: '2016-06-16T16:00:00', color: '#FF5370' }, { title: 'Conference', start: '2016-06-11', end: '2016-06-13', color: '#ba895d' }, { title: 'Meeting', start: '2016-06-12T10:30:00', end: '2016-06-12T12:30:00', color: '#ba895d' }, { title: 'Lunch', start: '2016-06-12T12:00:00', color: '#ba895d' }, { title: 'Meeting', start: '2016-06-12T14:30:00', color: '#ba895d' }, { title: 'Happy Hour', start: '2016-06-12T17:30:00', color: '#ba895d' }, { title: 'Dinner', start: '2016-06-12T20:00:00', color: '#ba895d' }, { title: 'Birthday Party', start: '2016-06-13T07:00:00', color: '#ba895d' }, { title: 'Click for Google', url: 'http://google.com/', start: '2016-06-28', color: '#22af47' } ] }), $('#external-events .fc-event').each(function() { $(this).css({'backgroundColor': $(this).data('color'), 'borderColor': $(this).data('color')}); $(this).data('event', { title: $.trim($(this).text()), color: $(this).data('color'), stick: true }); $(this).draggable({ zIndex: 999, revert: true, revertDuration: 0 }); }), $('#fc-external-drag').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, editable: true, defaultDate: '2018-06-12', selectable: true, selectHelper: true, droppable: true, eventLimit: true, select: function(start, end, allDay) { var title = prompt('Event Title:'); if (title) { $('#fc-external-drag').fullCalendar('renderEvent', { title: title, start: start._d, end: end._d, allDay: allDay }, true ); } $('#fc-external-drag').fullCalendar('unselect'); }, events: [ { title: 'All Day Event', start: '2018-06-01', color: '#24695c' }, { title: 'Long Event', start: '2018-06-07', end: '2018-06-10', color: '#22af47' }, { id: 999, title: 'Repeating Event', start: '2018-06-09T16:00:00', color: '#22af47' }, { id: 999, title: 'Repeating Event', start: '2018-06-16T16:00:00', color: '#ff9f40' }, { title: 'Conference', start: '2018-06-11', end: '2018-06-13', color: '#FF5370' }, { title: 'Meeting', start: '2018-06-12T10:30:00', end: '2018-06-12T12:30:00', color: '#FF5370' }, { title: 'Lunch', start: '2018-06-12T12:00:00', color: '#FF5370' }, { title: 'Meeting', start: '2018-06-12T14:30:00', color: '#FF5370' }, { title: 'Happy Hour', start: '2018-06-12T17:30:00', color: '#FF5370' }, { title: 'Dinner', start: '2018-06-12T20:00:00', color: '#FF5370' }, { title: 'Birthday Party', start: '2018-06-13T07:00:00', color: '#FF5370' }, { title: 'Click for Google', url: 'http://google.com/', start: '2018-06-28', color: '#ba895d' } ], drop: function() { if ($('#drop-remove').is(':checked')) { $(this).remove(); } } }), $('#external-events .fc-event').each(function() { $(this).css({'backgroundColor': $(this).data('color'), 'borderColor': $(this).data('color')}); $(this).data('event', { title: $.trim($(this).text()), color: $(this).data('color'), stick: true }); $(this).draggable({ zIndex: 999, revert: true, revertDuration: 0 }); }), $('#fc-external-drag').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaWeek,agendaDay' }, editable: true, defaultDate: '2018-06-12', selectable: true, selectHelper: true, droppable: true, eventLimit: true, select: function(start, end, allDay) { var title = prompt('Event Title:'); if (title) { $('#fc-external-drag').fullCalendar('renderEvent', { title: title, start: start._d, end: end._d, allDay: allDay }, true ); } $('#fc-external-drag').fullCalendar('unselect'); }, events: [ { title: 'All Day Event', start: '2018-06-01', color: '#24695c' }, { title: 'Long Event', start: '2018-06-07', end: '2018-06-10', color: '#22af47' }, { id: 999, title: 'Repeating Event', start: '2018-06-09T16:00:00', color: '#22af47' }, { id: 999, title: 'Repeating Event', start: '2018-06-16T16:00:00', color: '#ff9f40' }, { title: 'Conference', start: '2018-06-11', end: '2018-06-13', color: '#FF5370' }, { title: 'Meeting', start: '2018-06-12T10:30:00', end: '2018-06-12T12:30:00', color: '#FF5370' }, { title: 'Lunch', start: '2018-06-12T12:00:00', color: '#FF5370' }, { title: 'Meeting', start: '2018-06-12T14:30:00', color: '#FF5370' }, { title: 'Happy Hour', start: '2018-06-12T17:30:00', color: '#FF5370' }, { title: 'Dinner', start: '2018-06-12T20:00:00', color: '#FF5370' }, { title: 'Birthday Party', start: '2018-06-13T07:00:00', color: '#FF5370' }, { title: 'Click for Google', url: 'http://google.com/', start: '2018-06-28', color: '#ba895d' } ], drop: function() { if ($('#drop-remove').is(':checked')) { $(this).remove(); } } }); } }; (function($) { "use strict"; basic_calendar.init() })(jQuery);
webpackJsonp([4,5],{"+3eL":function(t,e,n){"use strict";function r(){try{return i.apply(this,arguments)}catch(t){return s.errorObject.e=t,s.errorObject}}function o(t){return i=t,r}var i,s=n("WhVc");e.tryCatch=o},"+Qf+":function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r;!function(t){t[t.PREV=0]="PREV",t[t.NEXT=1]="NEXT"}(r||(r={}))},"+ayw":function(t,e,n){"use strict";function r(){return new s.Subject}function o(){return i.multicast.call(this,r).refCount()}var i=n("emOw"),s=n("EEr4");e.share=o},"+dDw":function(t,e,n){"use strict";var r=n("3j3K"),o=n("NVOs");n.d(e,"c",function(){return s}),n.d(e,"b",function(){return a}),n.d(e,"a",function(){return u});var i={provide:o.e,useExisting:n.i(r._9)(function(){return s}),multi:!0},s=function(){function t(){this._radios=new Set,this._value=null,this.onChange=function(t){},this.onTouched=function(){}}return Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this.setDisabledState(t)},enumerable:!0,configurable:!0}),t.prototype.onRadioChange=function(t){this.writeValue(t.value),this.onChange(t.value)},t.prototype.onRadioValueUpdate=function(){this._updateRadiosValue()},t.prototype.register=function(t){this._radios.add(t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._disabled=t,this._updateRadiosDisabled()},t.prototype.unregister=function(t){this._radios.delete(t)},t.prototype.writeValue=function(t){this._value=t,this._updateRadiosValue()},t.prototype._updateRadiosValue=function(){var t=this;this._radios.forEach(function(e){return e.updateValue(t._value)})},t.prototype._updateRadiosDisabled=function(){this._radios.forEach(function(t){return t.updateDisabled()})},t}();s.decorators=[{type:r.U,args:[{selector:"[ngbRadioGroup]",host:{"data-toggle":"buttons",class:"btn-group",role:"group"},providers:[i]}]}],s.ctorParameters=function(){return[]};var a=function(){function t(t,e){this._renderer=t,this._elRef=e}return Object.defineProperty(t.prototype,"active",{set:function(t){this._renderer.setElementClass(this._elRef.nativeElement,"active",t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{set:function(t){this._renderer.setElementClass(this._elRef.nativeElement,"disabled",t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"focused",{set:function(t){this._renderer.setElementClass(this._elRef.nativeElement,"focus",t)},enumerable:!0,configurable:!0}),t}();a.decorators=[{type:r.U,args:[{selector:"label.btn"}]}],a.ctorParameters=function(){return[{type:r.W},{type:r.V}]};var u=function(){function t(t,e,n,r){this._group=t,this._label=e,this._renderer=n,this._element=r,this._value=null,this._group&&this._group.register(this)}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this._value=t;var e=t?t.toString():"";this._renderer.setElementProperty(this._element.nativeElement,"value",e),this._group&&this._group.onRadioValueUpdate()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"checked",{get:function(){return this._checked},set:function(t){this._checked=!!this._element.nativeElement.hasAttribute("checked")||t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._group&&this._group.disabled||this._disabled},set:function(t){this._disabled=!1!==t,this.updateDisabled()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"focused",{set:function(t){this._label&&(this._label.focused=t)},enumerable:!0,configurable:!0}),t.prototype.ngOnDestroy=function(){this._group&&this._group.unregister(this)},t.prototype.onChange=function(){this._group&&this._group.onRadioChange(this)},t.prototype.updateValue=function(t){this._checked=this.value===t&&null!==t,this._label.active=this._checked},t.prototype.updateDisabled=function(){var t=this._group&&this._group.disabled||this._disabled;this._label&&(this._label.disabled=t)},t}();u.decorators=[{type:r.U,args:[{selector:"input[type=radio]",host:{"[checked]":"checked","[disabled]":"disabled","(change)":"onChange()","(focus)":"focused = true","(blur)":"focused = false"}}]}],u.ctorParameters=function(){return[{type:s,decorators:[{type:r.H}]},{type:a,decorators:[{type:r.H}]},{type:r.W},{type:r.V}]},u.propDecorators={value:[{type:r.X,args:["value"]}],checked:[{type:r.X,args:["checked"]}],disabled:[{type:r.X,args:["disabled"]}]}},"+pb+":function(t,e,n){"use strict";var r=n("rCTf"),o=n("xAJs");r.Observable.prototype.map=o.map},"/FbB":function(t,e,n){"use strict";function r(t){var e=t.getFullYear();return e%4==0&&e%100!=0||e%400==0}function o(t,e){return t-e*Math.floor(t/e)}var i=n("CO0D"),s=n("hlt1"),a=n("3j3K"),u=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},c=1721425.5,l=1948439.5,p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e.prototype.fromGregorian=function(t){var e=new Date(t),n=e.getFullYear(),o=e.getMonth(),i=e.getDate(),a=c-1+365*(n-1)+Math.floor((n-1)/4)+-Math.floor((n-1)/100)+Math.floor((n-1)/400)+Math.floor((367*(o+1)-362)/12+(o+1<=2?0:r(e)?-1:-2)+i);a=Math.floor(a)+.5;var u=a-l,p=Math.floor((30*u+10646)/10631),f=Math.ceil((u-29-this._getYearStart(p))/29.5);f=Math.min(f,11);var h=Math.ceil(u-this._getMonthStart(p,f))+1;return new s.a(p,f+1,h)},e.prototype.toGregorian=function(t){var e=t.year,n=t.month-1,i=t.day,s=i+Math.ceil(29.5*n)+354*(e-1)+Math.floor((3+11*e)/30)+l-1,a=Math.floor(s-.5)+.5,u=a-c,p=Math.floor(u/146097),f=o(u,146097),h=Math.floor(f/36524),d=o(f,36524),y=Math.floor(d/1461),m=o(d,1461),g=Math.floor(m/365),v=400*p+100*h+4*y+g;4!==h&&4!==g&&v++;var b=c+365*(v-1)+Math.floor((v-1)/4)-Math.floor((v-1)/100)+Math.floor((v-1)/400),_=a-b,w=c-1+365*(v-1)+Math.floor((v-1)/4)-Math.floor((v-1)/100)+Math.floor((v-1)/400)+Math.floor(739/12+(r(new Date(v,3,1))?-1:-2)+1),C=a<w?0:r(new Date(v,3,1))?1:2,E=Math.floor((12*(_+C)+373)/367),O=c-1+365*(v-1)+Math.floor((v-1)/4)-Math.floor((v-1)/100)+Math.floor((v-1)/400)+Math.floor((367*E-362)/12+(E<=2?0:r(new Date(v,E-1,1))?-1:-2)+1),x=a-O+1;return new Date(v,E-1,x)},e.prototype.getDaysInIslamicMonth=function(t,e){e+=Math.floor(t/13),t=(t-1)%12+1;var n=29+t%2;return 12===t&&this._isIslamicLeapYear(e)&&n++,n},e.prototype.getNext=function(t,e,n){switch(void 0===e&&(e="d"),void 0===n&&(n=1),t=s.a.from(t),e){case"y":return t=this.setYear(t,t.year+n),t.month=1,t.day=1,t;case"m":return t=this.setMonth(t,t.month+n),t.day=1,t;case"d":return this.setDay(t,t.day+n);default:return t}},e.prototype.getPrev=function(t,e,n){return void 0===e&&(e="d"),void 0===n&&(n=1),this.getNext(t,e,-n)},e.prototype.getWeekday=function(t){var e=this.toGregorian(t).getDay();return 0===e?7:e},e.prototype.getWeekNumber=function(t,e){7===e&&(e=0);var n=(11-e)%7,r=t[n],o=this.toGregorian(r);o.setDate(o.getDate()+4-(o.getDay()||7));var i=o.getTime(),a=this.toGregorian(new s.a(r.year,1,1));return Math.floor(Math.round((i-a.getTime())/864e5)/7)+1},e.prototype.getToday=function(){return this.fromGregorian(new Date)},e}(i.a);p.decorators=[{type:a.z}],p.ctorParameters=function(){return[]}},"/I96":function(t,e,n){"use strict";var r=n("3j3K"),o=n("2Je8"),i=n("l5HU"),s=n("DDfv");n.d(e,"a",function(){return a});var a=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[s.a]}},t}();a.decorators=[{type:r.A,args:[{declarations:i.a,exports:i.a,imports:[o.b]}]}],a.ctorParameters=function(){return[]}},"/J7H":function(t,e,n){"use strict";function r(t){return!!t&&"function"==typeof t.addListener&&"function"==typeof t.removeListener}function o(t){return!!t&&"function"==typeof t.on&&"function"==typeof t.off}function i(t){return!!t&&"[object NodeList]"===d.call(t)}function s(t){return!!t&&"[object HTMLCollection]"===d.call(t)}function a(t){return!!t&&"function"==typeof t.addEventListener&&"function"==typeof t.removeEventListener}var u=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},c=n("rCTf"),l=n("+3eL"),p=n("SKH6"),f=n("WhVc"),h=n("B00U"),d=Object.prototype.toString,y=function(t){function e(e,n,r,o){t.call(this),this.sourceObj=e,this.eventName=n,this.selector=r,this.options=o}return u(e,t),e.create=function(t,n,r,o){return p.isFunction(r)&&(o=r,r=void 0),new e(t,n,o,r)},e.setupSubscription=function(t,n,u,c,l){var p;if(i(t)||s(t))for(var f=0,d=t.length;f<d;f++)e.setupSubscription(t[f],n,u,c,l);else if(a(t)){var y=t;t.addEventListener(n,u,l),p=function(){return y.removeEventListener(n,u)}}else if(o(t)){var m=t;t.on(n,u),p=function(){return m.off(n,u)}}else{if(!r(t))throw new TypeError("Invalid event target");var g=t;t.addListener(n,u),p=function(){return g.removeListener(n,u)}}c.add(new h.Subscription(p))},e.prototype._subscribe=function(t){var n=this.sourceObj,r=this.eventName,o=this.options,i=this.selector,s=i?function(){for(var e=[],n=0;n<arguments.length;n++)e[n-0]=arguments[n];var r=l.tryCatch(i).apply(void 0,e);r===f.errorObject?t.error(f.errorObject.e):t.next(r)}:function(e){return t.next(e)};e.setupSubscription(n,r,s,t,o)},e}(c.Observable);e.FromEventObservable=y},"/KGk":function(t,e,n){"use strict";var r=n("3j3K"),o=n("NVOs"),i=n("lcaH"),s=n("hlt1"),a=n("fAHw"),u=n("+Qf+"),c=n("2yGx"),l=n("hwnt"),p=n("gEbu");n.d(e,"a",function(){return h});var f={provide:o.e,useExisting:n.i(r._9)(function(){return h}),multi:!0},h=function(){function t(t,e,n,o){this._service=t,this._calendar=e,this.i18n=n,this.months=[],this.navigate=new r.R,this.disabled=!1,this.onChange=function(t){},this.onTouched=function(){},this.dayTemplate=o.dayTemplate,this.displayMonths=o.displayMonths,this.firstDayOfWeek=o.firstDayOfWeek,this.markDisabled=o.markDisabled,this.minDate=o.minDate,this.maxDate=o.maxDate,this.navigation=o.navigation,this.outsideDays=o.outsideDays,this.showWeekdays=o.showWeekdays,this.showWeekNumbers=o.showWeekNumbers,this.startDate=o.startDate}return t.prototype.getHeaderHeight=function(){var t=this.showWeekdays?6.25:4.25;return 1===this.displayMonths||"select"!==this.navigation?t-2:t},t.prototype.getHeaderMargin=function(){var t=this.showWeekdays?2:0;return 1!==this.displayMonths||"select"!==this.navigation?t+2:t},t.prototype.navigateTo=function(t){this._setViewWithinLimits(this._service.toValidDate(t)),this._updateData()},t.prototype.ngOnInit=function(){this._setDates(),this.navigateTo(this._date)},t.prototype.ngOnChanges=function(t){this._setDates(),this._setViewWithinLimits(this._date),t.displayMonths&&(this.displayMonths=n.i(c.b)(this.displayMonths)),["startDate","minDate","maxDate","navigation","firstDayOfWeek","markDisabled","displayMonths"].some(function(e){return!!t[e]})&&this._updateData(!0)},t.prototype.onDateSelect=function(t){this._setViewWithinLimits(t),this.onTouched(),this.writeValue(t),this.onChange({year:t.year,month:t.month,day:t.day}),this._date.month!==this.months[0].number&&1===this.displayMonths&&this._updateData()},t.prototype.onNavigateDateSelect=function(t){this._setViewWithinLimits(t),this._updateData()},t.prototype.onNavigateEvent=function(t){switch(t){case u.a.PREV:this._setViewWithinLimits(this._calendar.getPrev(this.months[0].firstDate,"m"));break;case u.a.NEXT:this._setViewWithinLimits(this._calendar.getNext(this.months[0].firstDate,"m"))}this._updateData()},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.writeValue=function(t){this.model=this._service.toValidDate(t,null)},t.prototype.setDisabledState=function(t){this.disabled=t},t.prototype._setDates=function(){if(this._maxDate=s.a.from(this.maxDate),this._minDate=s.a.from(this.minDate),this._date=this._service.toValidDate(this.startDate),this._calendar.isValid(this._minDate)||(this._minDate=this._calendar.getPrev(this._date,"y",10),this.minDate={year:this._minDate.year,month:this._minDate.month,day:this._minDate.day}),this._calendar.isValid(this._maxDate)||(this._maxDate=this._calendar.getNext(this._date,"y",11),this._maxDate=this._calendar.getPrev(this._maxDate),this.maxDate={year:this._maxDate.year,month:this._maxDate.month,day:this._maxDate.day}),this._minDate&&this._maxDate&&this._maxDate.before(this._minDate))throw new Error("'maxDate' "+this._maxDate+" should be greater than 'minDate' "+this._minDate)},t.prototype._setViewWithinLimits=function(t){this._minDate&&t.before(this._minDate)?this._date=new s.a(this._minDate.year,this._minDate.month,1):this._maxDate&&t.after(this._maxDate)?this._date=new s.a(this._maxDate.year,this._maxDate.month,1):this._date=new s.a(t.year,t.month,1)},t.prototype._updateData=function(t){void 0===t&&(t=!1);for(var e=[],r=function(r){var i=o._calendar.getNext(o._date,"m",r),s=o.months.findIndex(function(t){return t.firstDate.equals(i)});t||-1===s?e.push(o._service.generateMonthViewModel(i,o._minDate,o._maxDate,n.i(c.b)(o.firstDayOfWeek),o.markDisabled)):e.push(o.months[s])},o=this,i=0;i<this.displayMonths;i++)r(i);var s=e[0].firstDate,a=this.months[0]?this.months[0].firstDate:null;this.months=e,s.equals(a)||this.navigate.emit({current:a?{year:a.year,month:a.month}:null,next:{year:s.year,month:s.month}})},t}();h.decorators=[{type:r._10,args:[{exportAs:"ngbDatepicker",selector:"ngb-datepicker",host:{class:"d-inline-block rounded"},styles:["\n :host {\n border: 1px solid rgba(0, 0, 0, 0.125);\n }\n .ngb-dp-header {\n border-bottom: 1px solid rgba(0, 0, 0, 0.125);\n }\n .ngb-dp-month {\n pointer-events: none;\n }\n ngb-datepicker-month-view {\n pointer-events: auto;\n }\n .ngb-dp-month:first-child {\n margin-left: 0 !important;\n } \n .ngb-dp-month-name {\n font-size: larger;\n height: 2rem;\n line-height: 2rem;\n } \n "],template:'\n <ng-template #dt let-date="date" let-currentMonth="currentMonth" let-selected="selected" let-disabled="disabled">\n <div ngbDatepickerDayView [date]="date" [currentMonth]="currentMonth" [selected]="selected" [disabled]="disabled"></div>\n </ng-template>\n \n <div class="ngb-dp-header bg-faded pt-1 rounded-top" [style.height.rem]="getHeaderHeight()" \n [style.marginBottom.rem]="-getHeaderMargin()">\n <ngb-datepicker-navigation *ngIf="navigation !== \'none\'"\n [date]="months[0]?.firstDate"\n [minDate]="_minDate"\n [maxDate]="_maxDate"\n [months]="months.length"\n [disabled]="disabled"\n [showWeekNumbers]="showWeekNumbers"\n [showSelect]="navigation === \'select\'"\n (navigate)="onNavigateEvent($event)"\n (select)="onNavigateDateSelect($event)">\n </ngb-datepicker-navigation>\n </div>\n\n <div class="ngb-dp-months d-flex px-1 pb-1">\n <ng-template ngFor let-month [ngForOf]="months" let-i="index">\n <div class="ngb-dp-month d-block ml-3"> \n <div *ngIf="navigation !== \'select\' || displayMonths > 1" class="ngb-dp-month-name text-center">\n {{ i18n.getMonthFullName(month.number) }} {{ month.year }}\n </div>\n <ngb-datepicker-month-view\n [month]="month"\n [selectedDate]="model"\n [dayTemplate]="dayTemplate || dt"\n [showWeekdays]="showWeekdays"\n [showWeekNumbers]="showWeekNumbers"\n [disabled]="disabled"\n [outsideDays]="displayMonths === 1 ? outsideDays : \'hidden\'"\n (select)="onDateSelect($event)">\n </ngb-datepicker-month-view>\n </div>\n </ng-template>\n </div>\n ',providers:[f,a.a]}]}],h.ctorParameters=function(){return[{type:a.a},{type:i.b},{type:p.b},{type:l.a}]},h.propDecorators={dayTemplate:[{type:r.X}],displayMonths:[{type:r.X}],firstDayOfWeek:[{type:r.X}],markDisabled:[{type:r.X}],minDate:[{type:r.X}],maxDate:[{type:r.X}],navigation:[{type:r.X}],outsideDays:[{type:r.X}],showWeekdays:[{type:r.X}],showWeekNumbers:[{type:r.X}],startDate:[{type:r.X}],navigate:[{type:r._14}]}},"/PMa":function(t,e,n){"use strict";var r=n("3j3K");n.d(e,"b",function(){return o}),n.d(e,"a",function(){return i});var o=function(){function t(t,e,n){this.nodes=t,this.viewRef=e,this.componentRef=n}return t}(),i=function(){function t(t,e,n,r,o){this._injector=e,this._viewContainerRef=n,this._renderer=r,this._windowFactory=o.resolveComponentFactory(t)}return t.prototype.open=function(t,e){return this._windowRef||(this._contentRef=this._getContentRef(t,e),this._windowRef=this._viewContainerRef.createComponent(this._windowFactory,0,this._injector,this._contentRef.nodes)),this._windowRef},t.prototype.close=function(){this._windowRef&&(this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._windowRef.hostView)),this._windowRef=null,this._contentRef.viewRef&&(this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._contentRef.viewRef)),this._contentRef=null))},t.prototype._getContentRef=function(t,e){if(t){if(t instanceof r._1){var n=this._viewContainerRef.createEmbeddedView(t,e);return new o([n.rootNodes],n)}return new o([[this._renderer.createText(null,""+t)]])}return new o([])},t}()},"/i+G":function(t,e,n){"use strict";var r=n("3j3K"),o=n("2yGx"),i=n("K0TW");n.d(e,"a",function(){return s});var s=function(){function t(t){this.pageCount=0,this.pages=[],this.page=0,this.pageChange=new r.R(!0),this.disabled=t.disabled,this.boundaryLinks=t.boundaryLinks,this.directionLinks=t.directionLinks,this.ellipses=t.ellipses,this.maxSize=t.maxSize,this.pageSize=t.pageSize,this.rotate=t.rotate,this.size=t.size}return t.prototype.hasPrevious=function(){return this.page>1},t.prototype.hasNext=function(){return this.page<this.pageCount},t.prototype.selectPage=function(t){this._updatePages(t)},t.prototype.ngOnChanges=function(t){this._updatePages(this.page)},t.prototype.isEllipsis=function(t){return-1===t},t.prototype._applyEllipses=function(t,e){this.ellipses&&(t>0&&(t>1&&this.pages.unshift(-1),this.pages.unshift(1)),e<this.pageCount&&(e<this.pageCount-1&&this.pages.push(-1),this.pages.push(this.pageCount)))},t.prototype._applyRotation=function(){var t=0,e=this.pageCount,n=Math.floor(this.maxSize/2),r=this.maxSize%2==0?n-1:n;return this.page<=n?e=this.maxSize:this.pageCount-this.page<n?t=this.pageCount-this.maxSize:(t=this.page-n-1,e=this.page+r),[t,e]},t.prototype._applyPagination=function(){var t=Math.ceil(this.page/this.maxSize)-1,e=t*this.maxSize;return[e,e+this.maxSize]},t.prototype._setPageInRange=function(t){var e=this.page;this.page=n.i(o.f)(t,this.pageCount,1),this.page!==e&&this.pageChange.emit(this.page)},t.prototype._updatePages=function(t){this.pageCount=Math.ceil(this.collectionSize/this.pageSize),n.i(o.a)(this.pageCount)||(this.pageCount=0),this.pages.length=0;for(var e=1;e<=this.pageCount;e++)this.pages.push(e);if(this._setPageInRange(t),this.maxSize>0&&this.pageCount>this.maxSize){var r=0,i=this.pageCount;this.rotate?(s=this._applyRotation(),r=s[0],i=s[1]):(a=this._applyPagination(),r=a[0],i=a[1]),this.pages=this.pages.slice(r,i),this._applyEllipses(r,i)}var s,a},t}();s.decorators=[{type:r._10,args:[{selector:"ngb-pagination",changeDetection:r._17.OnPush,host:{role:"navigation"},template:'\n <ul [class]="\'pagination\' + (size ? \' pagination-\' + size : \'\')">\n <li *ngIf="boundaryLinks" class="page-item"\n [class.disabled]="!hasPrevious() || disabled">\n <a aria-label="First" class="page-link" href (click)="!!selectPage(1)" [attr.tabindex]="(hasPrevious() ? null : \'-1\')">\n <span aria-hidden="true">&laquo;&laquo;</span>\n </a>\n </li>\n\n <li *ngIf="directionLinks" class="page-item"\n [class.disabled]="!hasPrevious() || disabled">\n <a aria-label="Previous" class="page-link" href (click)="!!selectPage(page-1)" [attr.tabindex]="(hasPrevious() ? null : \'-1\')">\n <span aria-hidden="true">&laquo;</span>\n </a>\n </li>\n <li *ngFor="let pageNumber of pages" class="page-item" [class.active]="pageNumber === page"\n [class.disabled]="isEllipsis(pageNumber) || disabled">\n <a *ngIf="isEllipsis(pageNumber)" class="page-link">...</a>\n <a *ngIf="!isEllipsis(pageNumber)" class="page-link" href (click)="!!selectPage(pageNumber)">\n {{pageNumber}}\n <span *ngIf="pageNumber === page" class="sr-only">(current)</span>\n </a>\n </li>\n <li *ngIf="directionLinks" class="page-item" [class.disabled]="!hasNext() || disabled">\n <a aria-label="Next" class="page-link" href (click)="!!selectPage(page+1)" [attr.tabindex]="(hasNext() ? null : \'-1\')">\n <span aria-hidden="true">&raquo;</span>\n </a>\n </li>\n\n <li *ngIf="boundaryLinks" class="page-item" [class.disabled]="!hasNext() || disabled">\n <a aria-label="Last" class="page-link" href (click)="!!selectPage(pageCount)" [attr.tabindex]="(hasNext() ? null : \'-1\')">\n <span aria-hidden="true">&raquo;&raquo;</span>\n </a>\n </li>\n </ul>\n '}]}],s.ctorParameters=function(){return[{type:i.a}]},s.propDecorators={disabled:[{type:r.X}],boundaryLinks:[{type:r.X}],directionLinks:[{type:r.X}],ellipses:[{type:r.X}],rotate:[{type:r.X}],collectionSize:[{type:r.X}],maxSize:[{type:r.X}],page:[{type:r.X}],pageSize:[{type:r.X}],pageChange:[{type:r._14}],size:[{type:r.X}]}},"1KT0":function(t,e,n){"use strict";var r=n("kkb0");e.merge=r.mergeStatic},"1Z2I":function(t,e,n){"use strict";var r=n("3j3K"),o=n("2Je8"),i=n("W5jB"),s=n("nCuf");n.d(e,"a",function(){return a});var a=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[s.a]}},t}();a.decorators=[{type:r.A,args:[{declarations:[i.a],exports:[i.a],imports:[o.b]}]}],a.ctorParameters=function(){return[]}},"1r8+":function(t,e,n){"use strict";e.isArrayLike=function(t){return t&&"number"==typeof t.length}},"2BXm":function(t,e,n){"use strict";var r=n("3j3K"),o=n("2yGx");n.d(e,"a",function(){return i});var i=function(){function t(){this.activeIdx=0,this.focusFirst=!0,this.formatter=o.e,this.selectEvent=new r.R,this.activeChangeEvent=new r.R}return t.prototype.getActive=function(){return this.results[this.activeIdx]},t.prototype.markActive=function(t){this.activeIdx=t,this._activeChanged()},t.prototype.next=function(){this.activeIdx===this.results.length-1?this.activeIdx=this.focusFirst?(this.activeIdx+1)%this.results.length:-1:this.activeIdx++,this._activeChanged()},t.prototype.prev=function(){this.activeIdx<0?this.activeIdx=this.results.length-1:0===this.activeIdx?this.activeIdx=this.focusFirst?this.results.length-1:-1:this.activeIdx--,this._activeChanged()},t.prototype.select=function(t){this.selectEvent.emit(t)},t.prototype.ngOnInit=function(){this.activeIdx=this.focusFirst?0:-1,this._activeChanged()},t.prototype._activeChanged=function(){this.activeChangeEvent.emit(this.activeIdx>=0?this.id+"-"+this.activeIdx:void 0)},t}();i.decorators=[{type:r._10,args:[{selector:"ngb-typeahead-window",exportAs:"ngbTypeaheadWindow",host:{class:"dropdown-menu",style:"display: block",role:"listbox","[id]":"id"},template:'\n <ng-template #rt let-result="result" let-term="term" let-formatter="formatter">\n <ngb-highlight [result]="formatter(result)" [term]="term"></ngb-highlight>\n </ng-template>\n <ng-template ngFor [ngForOf]="results" let-result let-idx="index">\n <button type="button" class="dropdown-item" role="option"\n [id]="id + \'-\' + idx"\n [class.active]="idx === activeIdx"\n (mouseenter)="markActive(idx)"\n (click)="select(result)">\n <ng-template [ngTemplateOutlet]="resultTemplate || rt"\n [ngOutletContext]="{result: result, term: term, formatter: formatter}"></ng-template>\n </button>\n </ng-template>\n '}]}],i.ctorParameters=function(){return[]},i.propDecorators={id:[{type:r.X}],focusFirst:[{type:r.X}],results:[{type:r.X}],term:[{type:r.X}],formatter:[{type:r.X}],resultTemplate:[{type:r.X}],selectEvent:[{type:r._14,args:["select"]}],activeChangeEvent:[{type:r._14,args:["activeChange"]}]}},"2Je8":function(t,e,n){"use strict";function r(t,e){return t&&e.startsWith(t)?e.substring(t.length):e}function o(t){return t.replace(/\/index.html$/,"")}function i(t,e,n){var r="="+t;if(e.indexOf(r)>-1)return r;if(r=n.getPluralCategory(t),e.indexOf(r)>-1)return r;if(e.indexOf("other")>-1)return"other";throw new Error('No plural message found for value "'+t+'"')}function s(t,e){"string"==typeof e&&(e=parseInt(e,10));var n=e,r=n.toString().replace(/^[^.]*\.?/,""),o=Math.floor(Math.abs(n)),i=r.length,s=parseInt(r,10),a=parseInt(n.toString().replace(/^[^.]*\.?|0+$/g,""),10)||0;switch(t.split("-")[0].toLowerCase()){case"af":case"asa":case"az":case"bem":case"bez":case"bg":case"brx":case"ce":case"cgg":case"chr":case"ckb":case"ee":case"el":case"eo":case"es":case"eu":case"fo":case"fur":case"gsw":case"ha":case"haw":case"hu":case"jgo":case"jmc":case"ka":case"kk":case"kkj":case"kl":case"ks":case"ksb":case"ky":case"lb":case"lg":case"mas":case"mgo":case"ml":case"mn":case"nb":case"nd":case"ne":case"nn":case"nnh":case"nyn":case"om":case"or":case"os":case"ps":case"rm":case"rof":case"rwk":case"saq":case"seh":case"sn":case"so":case"sq":case"ta":case"te":case"teo":case"tk":case"tr":case"ug":case"uz":case"vo":case"vun":case"wae":case"xog":return 1===n?H.One:H.Other;case"agq":case"bas":case"cu":case"dav":case"dje":case"dua":case"dyo":case"ebu":case"ewo":case"guz":case"kam":case"khq":case"ki":case"kln":case"kok":case"ksf":case"lrc":case"lu":case"luo":case"luy":case"mer":case"mfe":case"mgh":case"mua":case"mzn":case"nmg":case"nus":case"qu":case"rn":case"rw":case"sbp":case"twq":case"vai":case"yav":case"yue":case"zgh":case"ak":case"ln":case"mg":case"pa":case"ti":return n===Math.floor(n)&&n>=0&&n<=1?H.One:H.Other;case"am":case"as":case"bn":case"fa":case"gu":case"hi":case"kn":case"mr":case"zu":return 0===o||1===n?H.One:H.Other;case"ar":return 0===n?H.Zero:1===n?H.One:2===n?H.Two:n%100===Math.floor(n%100)&&n%100>=3&&n%100<=10?H.Few:n%100===Math.floor(n%100)&&n%100>=11&&n%100<=99?H.Many:H.Other;case"ast":case"ca":case"de":case"en":case"et":case"fi":case"fy":case"gl":case"it":case"nl":case"sv":case"sw":case"ur":case"yi":return 1===o&&0===i?H.One:H.Other;case"be":return n%10==1&&n%100!=11?H.One:n%10===Math.floor(n%10)&&n%10>=2&&n%10<=4&&!(n%100>=12&&n%100<=14)?H.Few:n%10==0||n%10===Math.floor(n%10)&&n%10>=5&&n%10<=9||n%100===Math.floor(n%100)&&n%100>=11&&n%100<=14?H.Many:H.Other;case"br":return n%10==1&&n%100!=11&&n%100!=71&&n%100!=91?H.One:n%10==2&&n%100!=12&&n%100!=72&&n%100!=92?H.Two:n%10===Math.floor(n%10)&&(n%10>=3&&n%10<=4||n%10==9)&&!(n%100>=10&&n%100<=19||n%100>=70&&n%100<=79||n%100>=90&&n%100<=99)?H.Few:0!==n&&n%1e6==0?H.Many:H.Other;case"bs":case"hr":case"sr":return 0===i&&o%10==1&&o%100!=11||s%10==1&&s%100!=11?H.One:0===i&&o%10===Math.floor(o%10)&&o%10>=2&&o%10<=4&&!(o%100>=12&&o%100<=14)||s%10===Math.floor(s%10)&&s%10>=2&&s%10<=4&&!(s%100>=12&&s%100<=14)?H.Few:H.Other;case"cs":case"sk":return 1===o&&0===i?H.One:o===Math.floor(o)&&o>=2&&o<=4&&0===i?H.Few:0!==i?H.Many:H.Other;case"cy":return 0===n?H.Zero:1===n?H.One:2===n?H.Two:3===n?H.Few:6===n?H.Many:H.Other;case"da":return 1===n||0!==a&&(0===o||1===o)?H.One:H.Other;case"dsb":case"hsb":return 0===i&&o%100==1||s%100==1?H.One:0===i&&o%100==2||s%100==2?H.Two:0===i&&o%100===Math.floor(o%100)&&o%100>=3&&o%100<=4||s%100===Math.floor(s%100)&&s%100>=3&&s%100<=4?H.Few:H.Other;case"ff":case"fr":case"hy":case"kab":return 0===o||1===o?H.One:H.Other;case"fil":return 0===i&&(1===o||2===o||3===o)||0===i&&o%10!=4&&o%10!=6&&o%10!=9||0!==i&&s%10!=4&&s%10!=6&&s%10!=9?H.One:H.Other;case"ga":return 1===n?H.One:2===n?H.Two:n===Math.floor(n)&&n>=3&&n<=6?H.Few:n===Math.floor(n)&&n>=7&&n<=10?H.Many:H.Other;case"gd":return 1===n||11===n?H.One:2===n||12===n?H.Two:n===Math.floor(n)&&(n>=3&&n<=10||n>=13&&n<=19)?H.Few:H.Other;case"gv":return 0===i&&o%10==1?H.One:0===i&&o%10==2?H.Two:0!==i||o%100!=0&&o%100!=20&&o%100!=40&&o%100!=60&&o%100!=80?0!==i?H.Many:H.Other:H.Few;case"he":return 1===o&&0===i?H.One:2===o&&0===i?H.Two:0!==i||n>=0&&n<=10||n%10!=0?H.Other:H.Many;case"is":return 0===a&&o%10==1&&o%100!=11||0!==a?H.One:H.Other;case"ksh":return 0===n?H.Zero:1===n?H.One:H.Other;case"kw":case"naq":case"se":case"smn":return 1===n?H.One:2===n?H.Two:H.Other;case"lag":return 0===n?H.Zero:0!==o&&1!==o||0===n?H.Other:H.One;case"lt":return n%10!=1||n%100>=11&&n%100<=19?n%10===Math.floor(n%10)&&n%10>=2&&n%10<=9&&!(n%100>=11&&n%100<=19)?H.Few:0!==s?H.Many:H.Other:H.One;case"lv":case"prg":return n%10==0||n%100===Math.floor(n%100)&&n%100>=11&&n%100<=19||2===i&&s%100===Math.floor(s%100)&&s%100>=11&&s%100<=19?H.Zero:n%10==1&&n%100!=11||2===i&&s%10==1&&s%100!=11||2!==i&&s%10==1?H.One:H.Other;case"mk":return 0===i&&o%10==1||s%10==1?H.One:H.Other;case"mt":return 1===n?H.One:0===n||n%100===Math.floor(n%100)&&n%100>=2&&n%100<=10?H.Few:n%100===Math.floor(n%100)&&n%100>=11&&n%100<=19?H.Many:H.Other;case"pl":return 1===o&&0===i?H.One:0===i&&o%10===Math.floor(o%10)&&o%10>=2&&o%10<=4&&!(o%100>=12&&o%100<=14)?H.Few:0===i&&1!==o&&o%10===Math.floor(o%10)&&o%10>=0&&o%10<=1||0===i&&o%10===Math.floor(o%10)&&o%10>=5&&o%10<=9||0===i&&o%100===Math.floor(o%100)&&o%100>=12&&o%100<=14?H.Many:H.Other;case"pt":return n===Math.floor(n)&&n>=0&&n<=2&&2!==n?H.One:H.Other;case"ro":return 1===o&&0===i?H.One:0!==i||0===n||1!==n&&n%100===Math.floor(n%100)&&n%100>=1&&n%100<=19?H.Few:H.Other;case"ru":case"uk":return 0===i&&o%10==1&&o%100!=11?H.One:0===i&&o%10===Math.floor(o%10)&&o%10>=2&&o%10<=4&&!(o%100>=12&&o%100<=14)?H.Few:0===i&&o%10==0||0===i&&o%10===Math.floor(o%10)&&o%10>=5&&o%10<=9||0===i&&o%100===Math.floor(o%100)&&o%100>=11&&o%100<=14?H.Many:H.Other;case"shi":return 0===o||1===n?H.One:n===Math.floor(n)&&n>=2&&n<=10?H.Few:H.Other;case"si":return 0===n||1===n||0===o&&1===s?H.One:H.Other;case"sl":return 0===i&&o%100==1?H.One:0===i&&o%100==2?H.Two:0===i&&o%100===Math.floor(o%100)&&o%100>=3&&o%100<=4||0!==i?H.Few:H.Other;case"tzm":return n===Math.floor(n)&&n>=0&&n<=1||n===Math.floor(n)&&n>=11&&n<=99?H.One:H.Other;default:return H.Other}}function a(t){return t.name||typeof t}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function u(t,e){return Error("InvalidPipeArgument: '"+e+"' for pipe '"+n.i(T.T)(t)+"'")}function c(t){return t?t[0].toUpperCase()+t.substr(1).toLowerCase():t}function l(t){return function(e,n){var r=t(e,n);return 1==r.length?"0"+r:r}}function p(t){return function(e,n){return t(e,n).split(" ")[1]}}function f(t){return function(e,n){return t(e,n).split(" ")[0]}}function h(t,e,n){return new Intl.DateTimeFormat(e,n).format(t).replace(/[\u200e\u200f]/g,"")}function d(t){var e={hour:"2-digit",hour12:!1,timeZoneName:t};return function(t,n){var r=h(t,n,e);return r?r.substring(3):""}}function y(t,e){return t.hour12=e,t}function m(t,e){var n={};return n[t]=2===e?"2-digit":"numeric",n}function g(t,e){var n={};return n[t]=e<4?e>1?"short":"narrow":"long",n}function v(t){return Object.assign.apply(Object,[{}].concat(t))}function b(t){return function(e,n){return h(e,n,t)}}function _(t,e,n){var r=ht[t];if(r)return r(e,n);var o=t,i=yt.get(o);if(!i){i=[];var s=void 0;ft.exec(t);for(var a=t;a;)s=ft.exec(a),s?(i=i.concat(s.slice(1)),a=i.pop()):(i.push(a),a=null);yt.set(o,i)}return i.reduce(function(t,r){var o=dt[r];return t+(o?o(e,n):w(r))},"")}function w(t){return"''"===t?"'":t.replace(/(^'|'$)/g,"").replace(/''/g,"'")}function C(t,e,n,r,o,i,s){if(void 0===i&&(i=null),void 0===s&&(s=!1),null==n)return null;if("number"!=typeof(n="string"==typeof n&&O(n)?+n:n))throw u(t,n);var a=void 0,c=void 0,l=void 0;if(r!==lt.Currency&&(a=1,c=0,l=3),o){var p=o.match(gt);if(null===p)throw new Error(o+" is not a valid digit info for number pipes");null!=p[1]&&(a=E(p[1])),null!=p[3]&&(c=E(p[3])),null!=p[5]&&(l=E(p[5]))}return pt.format(n,e,r,{minimumIntegerDigits:a,minimumFractionDigits:c,maximumFractionDigits:l,currency:i,currencyAsSymbol:s})}function E(t){var e=parseInt(t);if(isNaN(e))throw new Error("Invalid integer literal when parsing "+t);return e}function O(t){return!isNaN(t-parseFloat(t))}function x(t){return null==t||""===t}function P(t){return t instanceof Date&&!isNaN(t.valueOf())}function k(t){var e=new Date(0),n=0,r=0,o=t[8]?e.setUTCFullYear:e.setFullYear,i=t[8]?e.setUTCHours:e.setHours;t[9]&&(n=S(t[9]+t[10]),r=S(t[9]+t[11])),o.call(e,S(t[1]),S(t[2])-1,S(t[3]));var s=S(t[4]||"0")-n,a=S(t[5]||"0")-r,u=S(t[6]||"0"),c=Math.round(1e3*parseFloat("0."+(t[7]||0)));return i.call(e,s,a,u,c),e}function S(t){return parseInt(t,10)}var T=n("3j3K");n.d(e,"a",function(){return F}),n.d(e,"c",function(){return I}),n.d(e,"b",function(){return Tt}),n.d(e,"f",function(){return L}),n.d(e,"h",function(){return B}),n.d(e,"g",function(){return W}),n.d(e,"i",function(){return tt}),n.d(e,"e",function(){return At}),n.d(e,"d",function(){return D});var A=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},D=function(){function t(){}return t.prototype.getBaseHrefFromDOM=function(){},t.prototype.onPopState=function(t){},t.prototype.onHashChange=function(t){},t.prototype.pathname=function(){},t.prototype.search=function(){},t.prototype.hash=function(){},t.prototype.replaceState=function(t,e,n){},t.prototype.pushState=function(t,e,n){},t.prototype.forward=function(){},t.prototype.back=function(){},t}(),R=(new T.D("Location Initialized"),function(){function t(){}return t.prototype.path=function(t){},t.prototype.prepareExternalUrl=function(t){},t.prototype.pushState=function(t,e,n,r){},t.prototype.replaceState=function(t,e,n,r){},t.prototype.forward=function(){},t.prototype.back=function(){},t.prototype.onPopState=function(t){},t.prototype.getBaseHref=function(){},t}()),M=new T.D("appBaseHref"),V=function(){function t(e){var n=this;this._subject=new T.R,this._platformStrategy=e;var r=this._platformStrategy.getBaseHref();this._baseHref=t.stripTrailingSlash(o(r)),this._platformStrategy.onPopState(function(t){n._subject.emit({url:n.path(!0),pop:!0,type:t.type})})}return t.prototype.path=function(t){return void 0===t&&(t=!1),this.normalize(this._platformStrategy.path(t))},t.prototype.isCurrentPathEqualTo=function(e,n){return void 0===n&&(n=""),this.path()==this.normalize(e+t.normalizeQueryParams(n))},t.prototype.normalize=function(e){return t.stripTrailingSlash(r(this._baseHref,o(e)))},t.prototype.prepareExternalUrl=function(t){return t&&"/"!==t[0]&&(t="/"+t),this._platformStrategy.prepareExternalUrl(t)},t.prototype.go=function(t,e){void 0===e&&(e=""),this._platformStrategy.pushState(null,"",t,e)},t.prototype.replaceState=function(t,e){void 0===e&&(e=""),this._platformStrategy.replaceState(null,"",t,e)},t.prototype.forward=function(){this._platformStrategy.forward()},t.prototype.back=function(){this._platformStrategy.back()},t.prototype.subscribe=function(t,e,n){return this._subject.subscribe({next:t,error:e,complete:n})},t.normalizeQueryParams=function(t){return t&&"?"!==t[0]?"?"+t:t},t.joinWithSlash=function(t,e){if(0==t.length)return e;if(0==e.length)return t;var n=0;return t.endsWith("/")&&n++,e.startsWith("/")&&n++,2==n?t+e.substring(1):1==n?t+e:t+"/"+e},t.stripTrailingSlash=function(t){return t.replace(/\/$/,"")},t}();V.decorators=[{type:T.z}],V.ctorParameters=function(){return[{type:R}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var N=function(t){function e(e,n){var r=t.call(this)||this;return r._platformLocation=e,r._baseHref="",null!=n&&(r._baseHref=n),r}return A(e,t),e.prototype.onPopState=function(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)},e.prototype.getBaseHref=function(){return this._baseHref},e.prototype.path=function(t){void 0===t&&(t=!1);var e=this._platformLocation.hash;return null==e&&(e="#"),e.length>0?e.substring(1):e},e.prototype.prepareExternalUrl=function(t){var e=V.joinWithSlash(this._baseHref,t);return e.length>0?"#"+e:e},e.prototype.pushState=function(t,e,n,r){var o=this.prepareExternalUrl(n+V.normalizeQueryParams(r));0==o.length&&(o=this._platformLocation.pathname),this._platformLocation.pushState(t,e,o)},e.prototype.replaceState=function(t,e,n,r){var o=this.prepareExternalUrl(n+V.normalizeQueryParams(r));0==o.length&&(o=this._platformLocation.pathname),this._platformLocation.replaceState(t,e,o)},e.prototype.forward=function(){this._platformLocation.forward()},e.prototype.back=function(){this._platformLocation.back()},e}(R);N.decorators=[{type:T.z}],N.ctorParameters=function(){return[{type:D},{type:void 0,decorators:[{type:T.H},{type:T.E,args:[M]}]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var j=function(t){function e(e,n){var r=t.call(this)||this;if(r._platformLocation=e,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 A(e,t),e.prototype.onPopState=function(t){this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t)},e.prototype.getBaseHref=function(){return this._baseHref},e.prototype.prepareExternalUrl=function(t){return V.joinWithSlash(this._baseHref,t)},e.prototype.path=function(t){void 0===t&&(t=!1);var e=this._platformLocation.pathname+V.normalizeQueryParams(this._platformLocation.search),n=this._platformLocation.hash;return n&&t?""+e+n:e},e.prototype.pushState=function(t,e,n,r){var o=this.prepareExternalUrl(n+V.normalizeQueryParams(r));this._platformLocation.pushState(t,e,o)},e.prototype.replaceState=function(t,e,n,r){var o=this.prepareExternalUrl(n+V.normalizeQueryParams(r));this._platformLocation.replaceState(t,e,o)},e.prototype.forward=function(){this._platformLocation.forward()},e.prototype.back=function(){this._platformLocation.back()},e}(R);j.decorators=[{type:T.z}],j.ctorParameters=function(){return[{type:D},{type:void 0,decorators:[{type:T.H},{type:T.E,args:[M]}]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var I=function(){function t(){}return t.prototype.getPluralCategory=function(t){},t}(),F=function(t){function e(e){var n=t.call(this)||this;return n.locale=e,n}return A(e,t),e.prototype.getPluralCategory=function(t){switch(s(this.locale,t)){case H.Zero:return"zero";case H.One:return"one";case H.Two:return"two";case H.Few:return"few";case H.Many:return"many";default:return"other"}},e}(I);F.decorators=[{type:T.z}],F.ctorParameters=function(){return[{type:void 0,decorators:[{type:T.E,args:[T.c]}]}]};var H={};H.Zero=0,H.One=1,H.Two=2,H.Few=3,H.Many=4,H.Other=5,H[H.Zero]="Zero",H[H.One]="One",H[H.Two]="Two",H[H.Few]="Few",H[H.Many]="Many",H[H.Other]="Other";/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var L=function(){function t(t,e,n,r){this._iterableDiffers=t,this._keyValueDiffers=e,this._ngEl=n,this._renderer=r,this._initialClasses=[]}return Object.defineProperty(t.prototype,"klass",{set:function(t){this._applyInitialClasses(!0),this._initialClasses="string"==typeof t?t.split(/\s+/):[],this._applyInitialClasses(!1),this._applyClasses(this._rawClass,!1)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClass",{set:function(t){this._cleanupClasses(this._rawClass),this._iterableDiffer=null,this._keyValueDiffer=null,this._rawClass="string"==typeof t?t.split(/\s+/):t,this._rawClass&&(n.i(T.S)(this._rawClass)?this._iterableDiffer=this._iterableDiffers.find(this._rawClass).create():this._keyValueDiffer=this._keyValueDiffers.find(this._rawClass).create())},enumerable:!0,configurable:!0}),t.prototype.ngDoCheck=function(){if(this._iterableDiffer){var t=this._iterableDiffer.diff(this._rawClass);t&&this._applyIterableChanges(t)}else if(this._keyValueDiffer){var e=this._keyValueDiffer.diff(this._rawClass);e&&this._applyKeyValueChanges(e)}},t.prototype._cleanupClasses=function(t){this._applyClasses(t,!0),this._applyInitialClasses(!1)},t.prototype._applyKeyValueChanges=function(t){var e=this;t.forEachAddedItem(function(t){return e._toggleClass(t.key,t.currentValue)}),t.forEachChangedItem(function(t){return e._toggleClass(t.key,t.currentValue)}),t.forEachRemovedItem(function(t){t.previousValue&&e._toggleClass(t.key,!1)})},t.prototype._applyIterableChanges=function(t){var e=this;t.forEachAddedItem(function(t){if("string"!=typeof t.item)throw new Error("NgClass can only toggle CSS classes expressed as strings, got "+n.i(T.T)(t.item));e._toggleClass(t.item,!0)}),t.forEachRemovedItem(function(t){return e._toggleClass(t.item,!1)})},t.prototype._applyInitialClasses=function(t){var e=this;this._initialClasses.forEach(function(n){return e._toggleClass(n,!t)})},t.prototype._applyClasses=function(t,e){var n=this;t&&(Array.isArray(t)||t instanceof Set?t.forEach(function(t){return n._toggleClass(t,!e)}):Object.keys(t).forEach(function(r){null!=t[r]&&n._toggleClass(r,!e)}))},t.prototype._toggleClass=function(t,e){var n=this;(t=t.trim())&&t.split(/\s+/g).forEach(function(t){n._renderer.setElementClass(n._ngEl.nativeElement,t,!!e)})},t}();L.decorators=[{type:T.U,args:[{selector:"[ngClass]"}]}],L.ctorParameters=function(){return[{type:T.t},{type:T.u},{type:T.V},{type:T.W}]},L.propDecorators={klass:[{type:T.X,args:["class"]}],ngClass:[{type:T.X}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var U=function(){function t(t){this._viewContainerRef=t,this._componentRef=null,this._moduleRef=null}return t.prototype.ngOnChanges=function(t){if(this._viewContainerRef.clear(),this._componentRef=null,this.ngComponentOutlet){var e=this.ngComponentOutletInjector||this._viewContainerRef.parentInjector;if(t.ngComponentOutletNgModuleFactory)if(this._moduleRef&&this._moduleRef.destroy(),this.ngComponentOutletNgModuleFactory){var n=e.get(T.Y);this._moduleRef=this.ngComponentOutletNgModuleFactory.create(n.injector)}else this._moduleRef=null;var r=this._moduleRef?this._moduleRef.componentFactoryResolver:e.get(T.Z),o=r.resolveComponentFactory(this.ngComponentOutlet);this._componentRef=this._viewContainerRef.createComponent(o,this._viewContainerRef.length,e,this.ngComponentOutletContent)}},t.prototype.ngOnDestroy=function(){this._moduleRef&&this._moduleRef.destroy()},t}();U.decorators=[{type:T.U,args:[{selector:"[ngComponentOutlet]"}]}],U.ctorParameters=function(){return[{type:T._0}]},U.propDecorators={ngComponentOutlet:[{type:T.X}],ngComponentOutletInjector:[{type:T.X}],ngComponentOutletContent:[{type:T.X}],ngComponentOutletNgModuleFactory:[{type:T.X}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var z=function(){function t(t,e,n,r){this.$implicit=t,this.ngForOf=e,this.index=n,this.count=r}return Object.defineProperty(t.prototype,"first",{get:function(){return 0===this.index},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){return this.index===this.count-1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"even",{get:function(){return this.index%2==0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"odd",{get:function(){return!this.even},enumerable:!0,configurable:!0}),t}(),B=function(){function t(t,e,n){this._viewContainer=t,this._template=e,this._differs=n,this._differ=null}return Object.defineProperty(t.prototype,"ngForTrackBy",{get:function(){return this._trackByFn},set:function(t){n.i(T.K)()&&null!=t&&"function"!=typeof t&&console&&console.warn&&console.warn("trackBy must be a function, but received "+JSON.stringify(t)+". See https://angular.io/docs/ts/latest/api/common/index/NgFor-directive.html#!#change-propagation for more information."),this._trackByFn=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngForTemplate",{set:function(t){t&&(this._template=t)},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){if("ngForOf"in t){var e=t.ngForOf.currentValue;if(!this._differ&&e)try{this._differ=this._differs.find(e).create(this.ngForTrackBy)}catch(t){throw new Error("Cannot find a differ supporting object '"+e+"' of type '"+a(e)+"'. NgFor only supports binding to Iterables such as Arrays.")}}},t.prototype.ngDoCheck=function(){if(this._differ){var t=this._differ.diff(this.ngForOf);t&&this._applyChanges(t)}},t.prototype._applyChanges=function(t){var e=this,n=[];t.forEachOperation(function(t,r,o){if(null==t.previousIndex){var i=e._viewContainer.createEmbeddedView(e._template,new z(null,e.ngForOf,-1,-1),o),s=new X(t,i);n.push(s)}else if(null==o)e._viewContainer.remove(r);else{var i=e._viewContainer.get(r);e._viewContainer.move(i,o);var s=new X(t,i);n.push(s)}});for(var r=0;r<n.length;r++)this._perViewChange(n[r].view,n[r].record);for(var r=0,o=this._viewContainer.length;r<o;r++){var i=this._viewContainer.get(r);i.context.index=r,i.context.count=o}t.forEachIdentityChange(function(t){e._viewContainer.get(t.currentIndex).context.$implicit=t.item})},t.prototype._perViewChange=function(t,e){t.context.$implicit=e.item},t}();B.decorators=[{type:T.U,args:[{selector:"[ngFor][ngForOf]"}]}],B.ctorParameters=function(){return[{type:T._0},{type:T._1},{type:T.t}]},B.propDecorators={ngForOf:[{type:T.X}],ngForTrackBy:[{type:T.X}],ngForTemplate:[{type:T.X}]};var X=function(){function t(t,e){this.record=t,this.view=e}return t}(),W=function(){function t(t,e){this._viewContainer=t,this._context=new G,this._thenTemplateRef=null,this._elseTemplateRef=null,this._thenViewRef=null,this._elseViewRef=null,this._thenTemplateRef=e}return Object.defineProperty(t.prototype,"ngIf",{set:function(t){this._context.$implicit=this._context.ngIf=t,this._updateView()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngIfThen",{set:function(t){this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngIfElse",{set:function(t){this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()},enumerable:!0,configurable:!0}),t.prototype._updateView=function(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))},t}();W.decorators=[{type:T.U,args:[{selector:"[ngIf]"}]}],W.ctorParameters=function(){return[{type:T._0},{type:T._1}]},W.propDecorators={ngIf:[{type:T.X}],ngIfThen:[{type:T.X}],ngIfElse:[{type:T.X}]};var G=function(){function t(){this.$implicit=null,this.ngIf=null}return t}(),K=function(){function t(t,e){this._viewContainerRef=t,this._templateRef=e,this._created=!1}return t.prototype.create=function(){this._created=!0,this._viewContainerRef.createEmbeddedView(this._templateRef)},t.prototype.destroy=function(){this._created=!1,this._viewContainerRef.clear()},t.prototype.enforceState=function(t){t&&!this._created?this.create():!t&&this._created&&this.destroy()},t}(),q=function(){function t(){this._defaultUsed=!1,this._caseCount=0,this._lastCaseCheckIndex=0,this._lastCasesMatched=!1}return Object.defineProperty(t.prototype,"ngSwitch",{set:function(t){this._ngSwitch=t,0===this._caseCount&&this._updateDefaultCases(!0)},enumerable:!0,configurable:!0}),t.prototype._addCase=function(){return this._caseCount++},t.prototype._addDefault=function(t){this._defaultViews||(this._defaultViews=[]),this._defaultViews.push(t)},t.prototype._matchCase=function(t){var e=t==this._ngSwitch;return this._lastCasesMatched=this._lastCasesMatched||e,this._lastCaseCheckIndex++,this._lastCaseCheckIndex===this._caseCount&&(this._updateDefaultCases(!this._lastCasesMatched),this._lastCaseCheckIndex=0,this._lastCasesMatched=!1),e},t.prototype._updateDefaultCases=function(t){if(this._defaultViews&&t!==this._defaultUsed){this._defaultUsed=t;for(var e=0;e<this._defaultViews.length;e++){this._defaultViews[e].enforceState(t)}}},t}();q.decorators=[{type:T.U,args:[{selector:"[ngSwitch]"}]}],q.ctorParameters=function(){return[]},q.propDecorators={ngSwitch:[{type:T.X}]};var Z=function(){function t(t,e,n){this.ngSwitch=n,n._addCase(),this._view=new K(t,e)}return t.prototype.ngDoCheck=function(){this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase))},t}();Z.decorators=[{type:T.U,args:[{selector:"[ngSwitchCase]"}]}],Z.ctorParameters=function(){return[{type:T._0},{type:T._1},{type:q,decorators:[{type:T._2}]}]},Z.propDecorators={ngSwitchCase:[{type:T.X}]};var Q=function(){function t(t,e,n){n._addDefault(new K(t,e))}return t}();Q.decorators=[{type:T.U,args:[{selector:"[ngSwitchDefault]"}]}],Q.ctorParameters=function(){return[{type:T._0},{type:T._1},{type:q,decorators:[{type:T._2}]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var J=function(){function t(t){this._localization=t,this._caseViews={}}return Object.defineProperty(t.prototype,"ngPlural",{set:function(t){this._switchValue=t,this._updateView()},enumerable:!0,configurable:!0}),t.prototype.addCase=function(t,e){this._caseViews[t]=e},t.prototype._updateView=function(){this._clearViews();var t=Object.keys(this._caseViews),e=i(this._switchValue,t,this._localization);this._activateView(this._caseViews[e])},t.prototype._clearViews=function(){this._activeView&&this._activeView.destroy()},t.prototype._activateView=function(t){t&&(this._activeView=t,this._activeView.create())},t}();J.decorators=[{type:T.U,args:[{selector:"[ngPlural]"}]}],J.ctorParameters=function(){return[{type:I}]},J.propDecorators={ngPlural:[{type:T.X}]};var Y=function(){function t(t,e,n,r){this.value=t;var o=!isNaN(Number(t));r.addCase(o?"="+t:t,new K(n,e))}return t}();Y.decorators=[{type:T.U,args:[{selector:"[ngPluralCase]"}]}],Y.ctorParameters=function(){return[{type:void 0,decorators:[{type:T._3,args:["ngPluralCase"]}]},{type:T._1},{type:T._0},{type:J,decorators:[{type:T._2}]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var $=function(){function t(t,e,n){this._differs=t,this._ngEl=e,this._renderer=n}return Object.defineProperty(t.prototype,"ngStyle",{set:function(t){this._ngStyle=t,!this._differ&&t&&(this._differ=this._differs.find(t).create())},enumerable:!0,configurable:!0}),t.prototype.ngDoCheck=function(){if(this._differ){var t=this._differ.diff(this._ngStyle);t&&this._applyChanges(t)}},t.prototype._applyChanges=function(t){var e=this;t.forEachRemovedItem(function(t){return e._setStyle(t.key,null)}),t.forEachAddedItem(function(t){return e._setStyle(t.key,t.currentValue)}),t.forEachChangedItem(function(t){return e._setStyle(t.key,t.currentValue)})},t.prototype._setStyle=function(t,e){var n=t.split("."),r=n[0],o=n[1];e=null!=e&&o?""+e+o:e,this._renderer.setElementStyle(this._ngEl.nativeElement,r,e)},t}();$.decorators=[{type:T.U,args:[{selector:"[ngStyle]"}]}],$.ctorParameters=function(){return[{type:T.u},{type:T.V},{type:T.W}]},$.propDecorators={ngStyle:[{type:T.X}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var tt=function(){function t(t){this._viewContainerRef=t}return Object.defineProperty(t.prototype,"ngOutletContext",{set:function(t){this.ngTemplateOutletContext=t},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){this._viewRef&&this._viewContainerRef.remove(this._viewContainerRef.indexOf(this._viewRef)),this.ngTemplateOutlet&&(this._viewRef=this._viewContainerRef.createEmbeddedView(this.ngTemplateOutlet,this.ngTemplateOutletContext))},t}();tt.decorators=[{type:T.U,args:[{selector:"[ngTemplateOutlet]"}]}],tt.ctorParameters=function(){return[{type:T._0}]},tt.propDecorators={ngTemplateOutletContext:[{type:T.X}],ngTemplateOutlet:[{type:T.X}],ngOutletContext:[{type:T.X}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var et=[L,U,B,W,tt,$,q,Z,Q,J,Y],nt=function(){function t(){}return t.prototype.createSubscription=function(t,e){return t.subscribe({next:e,error:function(t){throw t}})},t.prototype.dispose=function(t){t.unsubscribe()},t.prototype.onDestroy=function(t){t.unsubscribe()},t}(),rt=function(){function t(){}return t.prototype.createSubscription=function(t,e){return t.then(e,function(t){throw t})},t.prototype.dispose=function(t){},t.prototype.onDestroy=function(t){},t}(),ot=new rt,it=new nt,st=function(){function t(t){this._ref=t,this._latestValue=null,this._latestReturnedValue=null,this._subscription=null,this._obj=null,this._strategy=null}return t.prototype.ngOnDestroy=function(){this._subscription&&this._dispose()},t.prototype.transform=function(t){return this._obj?t!==this._obj?(this._dispose(),this.transform(t)):this._latestValue===this._latestReturnedValue?this._latestReturnedValue:(this._latestReturnedValue=this._latestValue,T._4.wrap(this._latestValue)):(t&&this._subscribe(t),this._latestReturnedValue=this._latestValue,this._latestValue)},t.prototype._subscribe=function(t){var e=this;this._obj=t,this._strategy=this._selectStrategy(t),this._subscription=this._strategy.createSubscription(t,function(n){return e._updateLatestValue(t,n)})},t.prototype._selectStrategy=function(e){if(n.i(T._5)(e))return ot;if(n.i(T._6)(e))return it;throw u(t,e)},t.prototype._dispose=function(){this._strategy.dispose(this._subscription),this._latestValue=null,this._latestReturnedValue=null,this._subscription=null,this._obj=null},t.prototype._updateLatestValue=function(t,e){t===this._obj&&(this._latestValue=e,this._ref.markForCheck())},t}();st.decorators=[{type:T._7,args:[{name:"async",pure:!1}]}],st.ctorParameters=function(){return[{type:T._8}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var at=function(){function t(){}return t.prototype.transform=function(e){if(!e)return e;if("string"!=typeof e)throw u(t,e);return e.toLowerCase()},t}();at.decorators=[{type:T._7,args:[{name:"lowercase"}]}],at.ctorParameters=function(){return[]};var ut=function(){function t(){}return t.prototype.transform=function(e){if(!e)return e;if("string"!=typeof e)throw u(t,e);return e.split(/\b/g).map(function(t){return c(t)}).join("")},t}();ut.decorators=[{type:T._7,args:[{name:"titlecase"}]}],ut.ctorParameters=function(){return[]};var ct=function(){function t(){}return t.prototype.transform=function(e){if(!e)return e;if("string"!=typeof e)throw u(t,e);return e.toUpperCase()},t}();ct.decorators=[{type:T._7,args:[{name:"uppercase"}]}],ct.ctorParameters=function(){return[]};var lt={};lt.Decimal=0,lt.Percent=1,lt.Currency=2,lt[lt.Decimal]="Decimal",lt[lt.Percent]="Percent",lt[lt.Currency]="Currency";var pt=function(){function t(){}return t.format=function(t,e,n,r){var o=void 0===r?{}:r,i=o.minimumIntegerDigits,s=o.minimumFractionDigits,a=o.maximumFractionDigits,u=o.currency,c=o.currencyAsSymbol,l=void 0!==c&&c,p={minimumIntegerDigits:i,minimumFractionDigits:s,maximumFractionDigits:a,style:lt[n].toLowerCase()};return n==lt.Currency&&(p.currency="string"==typeof u?u:void 0,p.currencyDisplay=l?"symbol":"code"),new Intl.NumberFormat(e,p).format(t)},t}(),ft=/((?:[^yMLdHhmsazZEwGjJ']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|J+|j+|m+|s+|a|z|Z|G+|w+))(.*)/,ht={yMMMdjms:b(v([m("year",1),g("month",3),m("day",1),m("hour",1),m("minute",1),m("second",1)])),yMdjm:b(v([m("year",1),m("month",1),m("day",1),m("hour",1),m("minute",1)])),yMMMMEEEEd:b(v([m("year",1),g("month",4),g("weekday",4),m("day",1)])),yMMMMd:b(v([m("year",1),g("month",4),m("day",1)])),yMMMd:b(v([m("year",1),g("month",3),m("day",1)])),yMd:b(v([m("year",1),m("month",1),m("day",1)])),jms:b(v([m("hour",1),m("second",1),m("minute",1)])),jm:b(v([m("hour",1),m("minute",1)]))},dt={yyyy:b(m("year",4)),yy:b(m("year",2)),y:b(m("year",1)),MMMM:b(g("month",4)),MMM:b(g("month",3)),MM:b(m("month",2)),M:b(m("month",1)),LLLL:b(g("month",4)),L:b(g("month",1)),dd:b(m("day",2)),d:b(m("day",1)),HH:l(f(b(y(m("hour",2),!1)))),H:f(b(y(m("hour",1),!1))),hh:l(f(b(y(m("hour",2),!0)))),h:f(b(y(m("hour",1),!0))),jj:b(m("hour",2)),j:b(m("hour",1)),mm:l(b(m("minute",2))),m:b(m("minute",1)),ss:l(b(m("second",2))),s:b(m("second",1)),sss:b(m("second",3)),EEEE:b(g("weekday",4)),EEE:b(g("weekday",3)),EE:b(g("weekday",2)),E:b(g("weekday",1)),a:p(b(y(m("hour",1),!0))),Z:d("short"),z:d("long"),ww:b({}),w:b({}),G:b(g("era",1)),GG:b(g("era",2)),GGG:b(g("era",3)),GGGG:b(g("era",4))},yt=new Map,mt=function(){function t(){}return t.format=function(t,e,n){return _(n,t,e)},t}(),gt=/^(\d+)?\.((\d+)(-(\d+))?)?$/,vt=function(){function t(t){this._locale=t}return t.prototype.transform=function(e,n){return C(t,this._locale,e,lt.Decimal,n)},t}();vt.decorators=[{type:T._7,args:[{name:"number"}]}],vt.ctorParameters=function(){return[{type:void 0,decorators:[{type:T.E,args:[T.c]}]}]};var bt=function(){function t(t){this._locale=t}return t.prototype.transform=function(e,n){return C(t,this._locale,e,lt.Percent,n)},t}();bt.decorators=[{type:T._7,args:[{name:"percent"}]}],bt.ctorParameters=function(){return[{type:void 0,decorators:[{type:T.E,args:[T.c]}]}]};var _t=function(){function t(t){this._locale=t}return t.prototype.transform=function(e,n,r,o){return void 0===n&&(n="USD"),void 0===r&&(r=!1),C(t,this._locale,e,lt.Currency,o,n,r)},t}();_t.decorators=[{type:T._7,args:[{name:"currency"}]}],_t.ctorParameters=function(){return[{type:void 0,decorators:[{type:T.E,args:[T.c]}]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var wt=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,Ct=function(){function t(t){this._locale=t}return t.prototype.transform=function(e,n){void 0===n&&(n="mediumDate");var r;if(x(e)||e!==e)return null;if("string"==typeof e&&(e=e.trim()),P(e))r=e;else if(O(e))r=new Date(parseFloat(e));else if("string"==typeof e&&/^(\d{4}-\d{1,2}-\d{1,2})$/.test(e)){var o=e.split("-").map(function(t){return parseInt(t,10)}),i=o[0],s=o[1],a=o[2];r=new Date(i,s-1,a)}else r=new Date(e);if(!P(r)){var c=void 0;if("string"!=typeof e||!(c=e.match(wt)))throw u(t,e);r=k(c)}return mt.format(r,this._locale,t._ALIASES[n]||n)},t}();Ct._ALIASES={medium:"yMMMdjms",short:"yMdjm",fullDate:"yMMMMEEEEd",longDate:"yMMMMd",mediumDate:"yMMMd",shortDate:"yMd",mediumTime:"jms",shortTime:"jm"},Ct.decorators=[{type:T._7,args:[{name:"date",pure:!0}]}],Ct.ctorParameters=function(){return[{type:void 0,decorators:[{type:T.E,args:[T.c]}]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Et=/#/g,Ot=function(){function t(t){this._localization=t}return t.prototype.transform=function(e,n){if(null==e)return"";if("object"!=typeof n||null===n)throw u(t,n);return n[i(e,Object.keys(n),this._localization)].replace(Et,e.toString())},t}();Ot.decorators=[{type:T._7,args:[{name:"i18nPlural",pure:!0}]}],Ot.ctorParameters=function(){return[{type:I}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var xt=function(){function t(){}return t.prototype.transform=function(e,n){if(null==e)return"";if("object"!=typeof n||"string"!=typeof e)throw u(t,n);return n.hasOwnProperty(e)?n[e]:n.hasOwnProperty("other")?n.other:""},t}();xt.decorators=[{type:T._7,args:[{name:"i18nSelect",pure:!0}]}],xt.ctorParameters=function(){return[]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Pt=function(){function t(){}return t.prototype.transform=function(t){return JSON.stringify(t,null,2)},t}();Pt.decorators=[{type:T._7,args:[{name:"json",pure:!1}]}],Pt.ctorParameters=function(){return[]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var kt=function(){function t(){}return t.prototype.transform=function(e,n,r){if(null==e)return e;if(!this.supports(e))throw u(t,e);return e.slice(n,r)},t.prototype.supports=function(t){return"string"==typeof t||Array.isArray(t)},t}();kt.decorators=[{type:T._7,args:[{name:"slice",pure:!1}]}],kt.ctorParameters=function(){return[]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var St=[st,ct,at,Pt,kt,vt,bt,ut,_t,Ct,Ot,xt],Tt=function(){function t(){}return t}();Tt.decorators=[{type:T.A,args:[{declarations:[et,St],exports:[et,St],providers:[{provide:I,useClass:F}]}]}],Tt.ctorParameters=function(){return[]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var At="browser";new T.B("4.1.2")},"2yGx":function(t,e,n){"use strict";function r(t){return parseInt(""+t,10)}function o(t){return void 0!==t&&null!==t?""+t:""}function i(t,e,n){return void 0===n&&(n=0),Math.max(Math.min(t,e),n)}function s(t){return"string"==typeof t}function a(t){return!isNaN(r(t))}function u(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}function c(t){return void 0!==t&&null!==t}function l(t){return a(t)?("0"+t).slice(-2):""}function p(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}e.b=r,e.e=o,e.f=i,e.g=s,e.a=a,e.d=u,e.i=c,e.c=l,e.h=p},"3fcS":function(t,e,n){"use strict";var r=n("3j3K"),o=n("+Qf+"),i=n("gEbu"),s=n("lcaH");n.d(e,"a",function(){return a});var a=function(){function t(t,e){this.i18n=t,this._calendar=e,this.navigation=o.a,this.navigate=new r.R,this.select=new r.R}return t.prototype.doNavigate=function(t){this.navigate.emit(t)},t.prototype.nextDisabled=function(){return this.disabled||this.maxDate&&this._calendar.getNext(this.date,"m").after(this.maxDate)},t.prototype.prevDisabled=function(){var t=this._calendar.getPrev(this.date,"m");return this.disabled||this.minDate&&t.year<=this.minDate.year&&t.month<this.minDate.month},t.prototype.selectDate=function(t){this.select.emit(t)},t}();a.decorators=[{type:r._10,args:[{selector:"ngb-datepicker-navigation",host:{class:"d-flex justify-content-between","[class.collapsed]":"!showSelect"},styles:["\n :host {\n height: 2rem;\n line-height: 1.85rem;\n }\n :host.collapsed {\n margin-bottom: -2rem; \n }\n .ngb-dp-navigation-chevron::before {\n border-style: solid;\n border-width: 0.2em 0.2em 0 0;\n content: '';\n display: inline-block;\n height: 0.75em;\n transform: rotate(-135deg);\n -webkit-transform: rotate(-135deg);\n -ms-transform: rotate(-135deg);\n width: 0.75em;\n margin: 0 0 0 0.5rem;\n } \n .ngb-dp-navigation-chevron.right:before {\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n margin: 0 0.5rem 0 0;\n }\n .btn-link {\n cursor: pointer;\n outline: 0;\n }\n .btn-link[disabled] {\n cursor: not-allowed;\n opacity: .65;\n } \n "],template:'\n <button type="button" class="btn-link" (click)="!!doNavigate(navigation.PREV)" [disabled]="prevDisabled()">\n <span class="ngb-dp-navigation-chevron"></span> \n </button>\n \n <ngb-datepicker-navigation-select *ngIf="showSelect" class="d-block" [style.width.rem]="months * 9"\n [date]="date"\n [minDate]="minDate"\n [maxDate]="maxDate"\n [disabled] = "disabled"\n (select)="selectDate($event)">\n </ngb-datepicker-navigation-select>\n \n <button type="button" class="btn-link" (click)="!!doNavigate(navigation.NEXT)" [disabled]="nextDisabled()">\n <span class="ngb-dp-navigation-chevron right"></span>\n </button>\n '}]}],a.ctorParameters=function(){return[{type:i.b},{type:s.b}]},a.propDecorators={date:[{type:r.X}],disabled:[{type:r.X}],maxDate:[{type:r.X}],minDate:[{type:r.X}],months:[{type:r.X}],showSelect:[{type:r.X}],showWeekNumbers:[{type:r.X}],navigate:[{type:r._14}],select:[{type:r._14}]}},"3j3K":function(t,e,n){"use strict";(function(t){function r(){if(!Nr){var t=Vr.Symbol;if(t&&t.iterator)Nr=t.iterator;else for(var e=Object.getOwnPropertyNames(Map.prototype),n=0;n<e.length;++n){var r=e[n];"entries"!==r&&"size"!==r&&Map.prototype[r]===Map.prototype.entries&&(Nr=r)}}return Nr}function o(t){Zone.current.scheduleMicroTask("scheduleMicrotask",t)}function i(t,e){return t===e||"number"==typeof t&&"number"==typeof e&&isNaN(t)&&isNaN(e)}function s(t){if("string"==typeof t)return t;if(null==t)return""+t;if(t.overriddenName)return""+t.overriddenName;if(t.name)return""+t.name;var e=t.toString();if(null==e)return""+e;var n=e.indexOf("\n");return-1===n?e:e.substring(0,n)}function a(t){return"function"==typeof t&&t.hasOwnProperty("annotation")&&(t=t.annotation),t}function u(t,e){if(t===Object||t===String||t===Function||t===Number||t===Array)throw new Error("Can not use native "+s(t)+" as constructor");if("function"==typeof t)return t;if(Array.isArray(t)){var n=t,r=n.length-1,o=t[r];if("function"!=typeof o)throw new Error("Last position of Class method array must be Function in key "+e+" was '"+s(o)+"'");if(r!=o.length)throw new Error("Number of annotations ("+r+") does not match number of arguments ("+o.length+") in the function: "+s(o));for(var i=[],u=0,c=n.length-1;u<c;u++){var l=[];i.push(l);var p=n[u];if(Array.isArray(p))for(var f=0;f<p.length;f++)l.push(a(p[f]));else"function"==typeof p?l.push(a(p)):l.push(p)}return Ir.defineMetadata("parameters",i,o),o}throw new Error("Only Function or Array is supported in Class definition for key '"+e+"' is '"+s(t)+"'")}function c(t){var e=u(t.hasOwnProperty("constructor")?t.constructor:void 0,"constructor"),n=e.prototype;if(t.hasOwnProperty("extends")){if("function"!=typeof t.extends)throw new Error("Class definition 'extends' property must be a constructor function was: "+s(t.extends));e.prototype=n=Object.create(t.extends.prototype)}for(var r in t)"extends"!==r&&"prototype"!==r&&t.hasOwnProperty(r)&&(n[r]=u(t[r],r));this&&this.annotations instanceof Array&&Ir.defineMetadata("annotations",this.annotations,e);var o=e.name;return o&&"constructor"!==o||(e.overriddenName="class"+jr++),e}function l(t,e,n,r){function o(t){if(!Ir||!Ir.getOwnMetadata)throw"reflect-metadata shim is required when using class decorators";if(this instanceof o)return i.call(this,t),this;var e=new o(t),n="function"==typeof this&&Array.isArray(this.annotations)?this.annotations:[];n.push(e);var s=function(t){var n=Ir.getOwnMetadata("annotations",t)||[];return n.push(e),Ir.defineMetadata("annotations",n,t),t};return s.annotations=n,s.Class=c,r&&r(s),s}var i=p([e]);return n&&(o.prototype=Object.create(n.prototype)),o.prototype.toString=function(){return"@"+t},o.annotationCls=o,o}function p(t){return function(){for(var e=this,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];t.forEach(function(t,r){var o=n[r];if(Array.isArray(t))e[t[0]]=void 0===o?t[1]:o;else for(var i in t)e[i]=o&&o.hasOwnProperty(i)?o[i]:t[i]})}}function f(t,e,n){function r(){function t(t,e,n){for(var r=Ir.getOwnMetadata("parameters",t)||[];r.length<=n;)r.push(null);return r[n]=r[n]||[],r[n].push(i),Ir.defineMetadata("parameters",r,t),t}for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(this instanceof r)return o.apply(this,e),this;var i=new(r.bind.apply(r,[void 0].concat(e)));return t.annotation=i,t}var o=p(e);return n&&(r.prototype=Object.create(n.prototype)),r.prototype.toString=function(){return"@"+t},r.annotationCls=r,r}function h(t,e,n){function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(this instanceof r)return o.apply(this,t),this;var n=new(r.bind.apply(r,[void 0].concat(t)));return function(t,e){var r=Ir.getOwnMetadata("propMetadata",t.constructor)||{};r[e]=r.hasOwnProperty(e)&&r[e]||[],r[e].unshift(n),Ir.defineMetadata("propMetadata",r,t.constructor)}}var o=p(e);return n&&(r.prototype=Object.create(n.prototype)),r.prototype.toString=function(){return"@"+t},r.annotationCls=r,r}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function d(t){return t.__forward_ref__=d,t.toString=function(){return s(this())},t}function y(t){return"function"==typeof t&&t.hasOwnProperty("__forward_ref__")&&t.__forward_ref__===d?t():t}function m(t){return t[co]}function g(t){return t[lo]}function v(t){return t[po]||b}function b(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];t.error.apply(t,e)}function _(t,e){var n=t+" caused by: "+(e instanceof Error?e.message:e),r=Error(n);return r[lo]=e,r}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function w(t){for(var e=[],n=0;n<t.length;++n){if(e.indexOf(t[n])>-1)return e.push(t[n]),e;e.push(t[n])}return e}function C(t){if(t.length>1){return" ("+w(t.slice().reverse()).map(function(t){return s(t.token)}).join(" -> ")+")"}return""}function E(t,e,n,r){var o=r?_("",r):Error();return o.addKey=O,o.keys=[e],o.injectors=[t],o.constructResolvingMessage=n,o.message=o.constructResolvingMessage(),o[lo]=r,o}function O(t,e){this.injectors.push(t),this.keys.push(e),this.message=this.constructResolvingMessage()}function x(t,e){return E(t,e,function(){return"No provider for "+s(this.keys[0].token)+"!"+C(this.keys)})}function P(t,e){return E(t,e,function(){return"Cannot instantiate cyclic dependency!"+C(this.keys)})}function k(t,e,n,r){return E(t,r,function(){var t=s(this.keys[0].token);return g(this).message+": Error during instantiation of "+t+"!"+C(this.keys)+"."},e)}function S(t){return Error("Invalid provider - only instances of Provider and Type are allowed, got: "+t)}function T(t,e){for(var n=[],r=0,o=e.length;r<o;r++){var i=e[r];i&&0!=i.length?n.push(i.map(s).join(" ")):n.push("?")}return Error("Cannot resolve all parameters for '"+s(t)+"'("+n.join(", ")+"). Make sure that all the parameters are decorated with Inject or have valid type annotations and that '"+s(t)+"' is decorated with Injectable.")}function A(t){return Error("Index "+t+" is out-of-bounds.")}function D(t,e){return Error("Cannot mix multi providers and regular providers, got: "+t+" "+e)}function R(t){return"function"==typeof t}function M(t){return t?t.map(function(t){var e=t.type,n=e.annotationCls,r=t.args?t.args:[];return new(n.bind.apply(n,[void 0].concat(r)))}):[]}function V(t){var e=Object.getPrototypeOf(t.prototype);return(e?e.constructor:null)||Object}function N(t){var e,n;if(t.useClass){var r=y(t.useClass);e=Co.factory(r),n=U(r)}else t.useExisting?(e=function(t){return t},n=[Eo.fromKey(ho.get(t.useExisting))]):t.useFactory?(e=t.useFactory,n=L(t.useFactory,t.deps)):(e=function(){return t.useValue},n=Oo);return new Po(e,n)}function j(t){return new xo(ho.get(t.provide),[N(t)],t.multi||!1)}function I(t){var e=H(t,[]),n=e.map(j),r=F(n,new Map);return Array.from(r.values())}function F(t,e){for(var n=0;n<t.length;n++){var r=t[n],o=e.get(r.key.id);if(o){if(r.multiProvider!==o.multiProvider)throw D(o,r);if(r.multiProvider)for(var i=0;i<r.resolvedFactories.length;i++)o.resolvedFactories.push(r.resolvedFactories[i]);else e.set(r.key.id,r)}else{var s=void 0;s=r.multiProvider?new xo(r.key,r.resolvedFactories.slice(),r.multiProvider):r,e.set(r.key.id,s)}}return e}function H(t,e){return t.forEach(function(t){if(t instanceof go)e.push({provide:t,useClass:t});else if(t&&"object"==typeof t&&void 0!==t.provide)e.push(t);else{if(!(t instanceof Array))throw S(t);H(t,e)}}),e}function L(t,e){if(e){var n=e.map(function(t){return[t]});return e.map(function(e){return z(t,e,n)})}return U(t)}function U(t){var e=Co.parameters(t);if(!e)return[];if(e.some(function(t){return null==t}))throw T(t,e);return e.map(function(n){return z(t,n,e)})}function z(t,e,n){var r=null,o=!1;if(!Array.isArray(e))return e instanceof $r?B(e.token,o,null):B(e,o,null);for(var i=null,s=0;s<e.length;++s){var a=e[s];a instanceof go?r=a:a instanceof $r?r=a.token:a instanceof to?o=!0:a instanceof no||a instanceof ro?i=a:a instanceof Ar&&(r=a)}if(null!=(r=y(r)))return B(r,o,i);throw T(t,n)}function B(t,e,n){return new Eo(ho.get(t),e,n)}function X(t,e){for(var n=new Array(t._providers.length),r=0;r<t._providers.length;++r)n[r]=e(t.getProviderAtIndex(r));return n}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function W(t){return!!t&&"function"==typeof t.then}function G(t){return!!t&&"function"==typeof t.subscribe}function K(){return""+q()+q()+q()}function q(){return String.fromCharCode(97+Math.floor(25*Math.random()))}function Z(){throw new Error("Runtime compiler is not loaded")}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function Q(t){var e=Error("No component factory found for "+s(t)+". Did you add it to @NgModule.entryComponents?");return e[Bo]=t,e}function J(){var t=Vr.wtf;return!(!t||!(Go=t.trace))&&(Ko=Go.events,!0)}function Y(t,e){return void 0===e&&(e=null),Ko.createScope(t,e)}function $(t,e){return Go.leaveScope(t,e),e}function tt(t,e){return null}function et(t){ci=t}function nt(){if(pi)throw new Error("Cannot enable prod mode after platform setup.");li=!1}function rt(){return pi=!0,li}function ot(t){if(ai&&!ai.destroyed&&!ai.injector.get(fi,!1))throw new Error("There can be only one platform. Destroy the previous one to create a new one.");ai=t.get(di);var e=t.get(No,null);return e&&e.forEach(function(t){return t()}),ai}function it(t,e,n){void 0===n&&(n=[]);var r=new Ar("Platform: "+e);return function(e){void 0===e&&(e=[]);var o=at();return o&&!o.injector.get(fi,!1)||(t?t(n.concat(e).concat({provide:r,useValue:!0})):ot(So.resolveAndCreate(n.concat(e).concat({provide:r,useValue:!0})))),st(r)}}function st(t){var e=at();if(!e)throw new Error("No platform exists!");if(!e.injector.get(t,null))throw new Error("A platform with a different configuration has been created. Please destroy it first.");return e}function at(){return ai&&!ai.destroyed?ai:null}function ut(t,e){try{var n=e();return W(n)?n.catch(function(e){throw t.handleError(e),e}):n}catch(e){throw t.handleError(e),e}}function ct(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)}function lt(t){return t.reduce(function(t,e){var n=Array.isArray(e)?lt(e):e;return t.concat(n)},[])}function pt(t,e,n){if(!t)throw new Error("Cannot find '"+n+"' in '"+e+"'");return t}function ft(t,e,n){t.childNodes.forEach(function(t){t instanceof Ni&&(e(t)&&n.push(t),ft(t,e,n))})}function ht(t,e,n){t instanceof Ni&&t.childNodes.forEach(function(t){e(t)&&n.push(t),t instanceof Ni&&ht(t,e,n)})}function dt(t){return ji.get(t)||null}function yt(t){ji.set(t.nativeNode,t)}function mt(t){ji.delete(t.nativeNode)}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function gt(t,e){var n=vt(t),r=vt(e);if(n&&r)return bt(t,e,gt);var o=t&&("object"==typeof t||"function"==typeof t),s=e&&("object"==typeof e||"function"==typeof e);return!(n||!o||r||!s)||i(t,e)}function vt(t){return!!wt(t)&&(Array.isArray(t)||!(t instanceof Map)&&r()in t)}function bt(t,e,n){for(var o=t[r()](),i=e[r()]();;){var s=o.next(),a=i.next();if(s.done&&a.done)return!0;if(s.done||a.done)return!1;if(!n(s.value,a.value))return!1}}function _t(t,e){if(Array.isArray(t))for(var n=0;n<t.length;n++)e(t[n]);else for(var o=t[r()](),i=void 0;!(i=o.next()).done;)e(i.value)}function wt(t){return null!==t&&("function"==typeof t||"object"==typeof t)}function Ct(t,e,n){var r=t.previousIndex;if(null===r)return r;var o=0;return n&&r<n.length&&(o=n[r]),r+e+o}function Et(t){return t.name||typeof t}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function Ot(){return Co}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function xt(t,e){return t.nodes[e]}function Pt(t,e){return t.nodes[e]}function kt(t,e){return t.nodes[e]}function St(t,e){return t.nodes[e]}function Tt(t,e){return t.nodes[e]}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function At(t,e,n,r){var o="ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '"+e+"'. Current value: '"+n+"'.";return r&&(o+=" 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 ?"),Rt(o,t)}function Dt(t,e){return t instanceof Error||(t=new Error(t.toString())),Mt(t,e),t}function Rt(t,e){var n=new Error(t);return Mt(n,e),n}function Mt(t,e){t[co]=e,t[po]=e.logError.bind(e)}function Vt(t){return!!m(t)}function Nt(t){return new Error("ViewDestroyedError: Attempt to use a destroyed view: "+t)}function jt(t){var e=us.get(t);return e||(e=s(t)+"_"+us.size,us.set(t,e)),e}function It(t){return{id:cs,styles:t.styles,encapsulation:t.encapsulation,data:t.data}}function Ft(t){if(t&&t.id===cs){var e=null!=t.encapsulation&&t.encapsulation!==Qr.None||t.styles.length||Object.keys(t.data).length;t.id=e?"c"+ps++:ls}return t&&t.id===ls&&(t=null),t||null}function Ht(t,e,n,r){var o=t.oldValues;return!(!(2&t.state)&&i(o[e.bindingIndex+n],r))}function Lt(t,e,n,r){return!!Ht(t,e,n,r)&&(t.oldValues[e.bindingIndex+n]=r,!0)}function Ut(t,e,n,r){var o=t.oldValues[e.bindingIndex+n];if(1&t.state||!gt(o,r))throw At(ss.createDebugContext(t,e.index),o,r,0!=(1&t.state))}function zt(t){for(var e=t;e;)2&e.def.flags&&(e.state|=8),e=e.viewContainerParent||e.parent}function Bt(t,e){for(var n=t;n&&n!==e;)n.state|=64,n=n.viewContainerParent||n.parent}function Xt(t,e,n,r){return zt(33554432&t.def.nodes[e].flags?Pt(t,e).componentView:t),ss.handleEvent(t,e,n,r)}function Wt(t){if(t.parent){return Pt(t.parent,t.parentNodeDef.index)}return null}function Gt(t){return t.parent?t.parentNodeDef.parent:null}function Kt(t,e){switch(201347067&e.flags){case 1:return Pt(t,e.index).renderElement;case 2:return xt(t,e.index).renderText}}function qt(t,e){return t?t+":"+e:e}function Zt(t){return!!t.parent&&!!(32768&t.parentNodeDef.flags)}function Qt(t){return!(!t.parent||32768&t.parentNodeDef.flags)}function Jt(t){return 1<<t%32}function Yt(t){var e={},n=0,r={};return t&&t.forEach(function(t){var o=t[0],i=t[1];"number"==typeof o?(e[o]=i,n|=Jt(o)):r[o]=i}),{matchedQueries:e,references:r,matchedQueryIds:n}}function $t(t,e,n){var r=n.renderParent;return r?0==(1&r.flags)||0==(33554432&r.flags)||r.element.componentRendererType&&r.element.componentRendererType.encapsulation===Qr.Native?Pt(t,n.renderParent.index).renderElement:void 0:e}function te(t){var e=fs.get(t);return e||(e=t(function(){return as}),e.factory=t,fs.set(t,e)),e}function ee(t){var e=[];return ne(t,0,void 0,void 0,e),e}function ne(t,e,n,r,o){3===e&&(n=t.renderer.parentNode(Kt(t,t.def.lastRenderRootNode))),re(t,e,0,t.def.nodes.length-1,n,r,o)}function re(t,e,n,r,o,i,s){for(var a=n;a<=r;a++){var u=t.def.nodes[a];11&u.flags&&ie(t,u,e,o,i,s),a+=u.childCount}}function oe(t,e,n,r,o,i){for(var s=t;s&&!Zt(s);)s=s.parent;for(var a=s.parent,u=Gt(s),c=u.index+1,l=u.index+u.childCount,p=c;p<=l;p++){var f=a.def.nodes[p];f.ngContentIndex===e&&ie(a,f,n,r,o,i),p+=f.childCount}if(!a.parent){var h=t.root.projectableNodes[e];if(h)for(var p=0;p<h.length;p++)se(t,h[p],n,r,o,i)}}function ie(t,e,n,r,o,i){if(8&e.flags)oe(t,e.ngContent.index,n,r,o,i);else{var s=Kt(t,e);if(3===n&&33554432&e.flags&&48&e.bindingFlags){if(16&e.bindingFlags&&se(t,s,n,r,o,i),32&e.bindingFlags){var a=Pt(t,e.index).componentView;se(a,s,n,r,o,i)}}else se(t,s,n,r,o,i);if(16777216&e.flags)for(var u=Pt(t,e.index).viewContainer._embeddedViews,c=0;c<u.length;c++)ne(u[c],n,r,o,i);1&e.flags&&!e.element.name&&re(t,n,e.index+1,e.index+e.childCount,r,o,i)}}function se(t,e,n,r,o,i){var s=t.renderer;switch(n){case 1:s.appendChild(r,e);break;case 2:s.insertBefore(r,e,o);break;case 3:s.removeChild(r,e);break;case 0:i.push(e)}}function ae(t){if(":"===t[0]){var e=t.match(hs);return[e[1],e[2]]}return["",t]}function ue(t){for(var e=0,n=0;n<t.length;n++)e|=t[n].flags;return e}function ce(t,e,n,r,o,i,s,a,u,c,l,p,f,h,d,y,m,g,v,b){switch(t){case 1:return e+le(n)+r;case 2:return e+le(n)+r+le(o)+i;case 3:return e+le(n)+r+le(o)+i+le(s)+a;case 4:return e+le(n)+r+le(o)+i+le(s)+a+le(u)+c;case 5:return e+le(n)+r+le(o)+i+le(s)+a+le(u)+c+le(l)+p;case 6:return e+le(n)+r+le(o)+i+le(s)+a+le(u)+c+le(l)+p+le(f)+h;case 7:return e+le(n)+r+le(o)+i+le(s)+a+le(u)+c+le(l)+p+le(f)+h+le(d)+y;case 8:return e+le(n)+r+le(o)+i+le(s)+a+le(u)+c+le(l)+p+le(f)+h+le(d)+y+le(m)+g;case 9:return e+le(n)+r+le(o)+i+le(s)+a+le(u)+c+le(l)+p+le(f)+h+le(d)+y+le(m)+g+le(v)+b;default:throw new Error("Does not support more than 9 expressions")}}function le(t){return null!=t?t.toString():""}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function pe(t,e,n,r,o,i){t|=1;var s=Yt(e),a=s.matchedQueries,u=s.references;return{index:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,flags:t,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:a,matchedQueryIds:s.matchedQueryIds,references:u,ngContentIndex:n,childCount:r,bindings:[],bindingFlags:0,outputs:[],element:{ns:null,name:null,attrs:null,template:i?te(i):null,componentProvider:null,componentView:null,componentRendererType:null,publicProviders:null,allProviders:null,handleEvent:o||as},provider:null,text:null,query:null,ngContent:null}}function fe(t,e,n,r,o,i,s,a,u,c,l){void 0===i&&(i=[]),u||(u=as);var p=Yt(e),f=p.matchedQueries,h=p.references,d=p.matchedQueryIds,y=null,m=null;o&&(M=ae(o),y=M[0],m=M[1]),s=s||[];for(var g=new Array(s.length),v=0;v<s.length;v++){var b=s[v],_=b[0],w=b[1],C=b[2],E=ae(w),O=E[0],x=E[1],P=void 0,k=void 0;switch(15&_){case 4:k=C;break;case 1:case 8:P=C}g[v]={flags:_,ns:O,name:x,nonMinifiedName:x,securityContext:P,suffix:k}}a=a||[];for(var S=new Array(a.length),v=0;v<a.length;v++){var T=a[v],A=T[0],D=T[1];S[v]={type:0,target:A,eventName:D,propName:null}}i=i||[];var R=i.map(function(t){var e=t[0],n=t[1],r=ae(e);return[r[0],r[1],n]});return l=Ft(l),c&&(t|=33554432),t|=1,{index:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,flags:t,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:f,matchedQueryIds:d,references:h,ngContentIndex:n,childCount:r,bindings:g,bindingFlags:ue(g),outputs:S,element:{ns:y,name:m,attrs:R,template:null,componentProvider:null,componentView:c||null,componentRendererType:l,publicProviders:null,allProviders:null,handleEvent:u||as},provider:null,text:null,query:null,ngContent:null};var M}function he(t,e,n){var r,o=n.element,i=t.root.selectorOrNode,s=t.renderer;if(t.parent||!i){r=o.name?s.createElement(o.name,o.ns):s.createComment("");var a=$t(t,e,n);a&&s.appendChild(a,r)}else r=s.selectRootElement(i);if(o.attrs)for(var u=0;u<o.attrs.length;u++){var c=o.attrs[u],l=c[0],p=c[1],f=c[2];s.setAttribute(r,p,f,l)}return r}function de(t,e,n,r){for(var o=0;o<n.outputs.length;o++){var i=n.outputs[o],s=ye(t,n.index,qt(i.target,i.eventName)),a=i.target,u=t;"component"===i.target&&(a=null,u=e);var c=u.renderer.listen(a||r,i.eventName,s);t.disposables[n.outputIndex+o]=c}}function ye(t,e,n){return function(r){try{return Xt(t,e,n,r)}catch(e){t.root.errorHandler.handleError(e)}}}function me(t,e,n,r,o,i,s,a,u,c,l,p){var f=e.bindings.length,h=!1;return f>0&&ve(t,e,0,n)&&(h=!0),f>1&&ve(t,e,1,r)&&(h=!0),f>2&&ve(t,e,2,o)&&(h=!0),f>3&&ve(t,e,3,i)&&(h=!0),f>4&&ve(t,e,4,s)&&(h=!0),f>5&&ve(t,e,5,a)&&(h=!0),f>6&&ve(t,e,6,u)&&(h=!0),f>7&&ve(t,e,7,c)&&(h=!0),f>8&&ve(t,e,8,l)&&(h=!0),f>9&&ve(t,e,9,p)&&(h=!0),h}function ge(t,e,n){for(var r=!1,o=0;o<n.length;o++)ve(t,e,o,n[o])&&(r=!0);return r}function ve(t,e,n,r){if(!Lt(t,e,n,r))return!1;var o=e.bindings[n],i=Pt(t,e.index),s=i.renderElement,a=o.name;switch(15&o.flags){case 1:be(t,o,s,o.ns,a,r);break;case 2:_e(t,s,a,r);break;case 4:we(t,o,s,a,r);break;case 8:Ce(33554432&e.flags&&32&o.flags?i.componentView:t,o,s,a,r)}return!0}function be(t,e,n,r,o,i){var s=e.securityContext,a=s?t.root.sanitizer.sanitize(s,i):i;a=null!=a?a.toString():null;var u=t.renderer;null!=i?u.setAttribute(n,o,a,r):u.removeAttribute(n,o,r)}function _e(t,e,n,r){var o=t.renderer;r?o.addClass(e,n):o.removeClass(e,n)}function we(t,e,n,r,o){var i=t.root.sanitizer.sanitize(os.STYLE,o);if(null!=i){i=i.toString();var s=e.suffix;null!=s&&(i+=s)}else i=null;var a=t.renderer;null!=i?a.setStyle(n,r,i):a.removeStyle(n,r)}function Ce(t,e,n,r,o){var i=e.securityContext,s=i?t.root.sanitizer.sanitize(i,o):o;t.renderer.setProperty(n,r,s)}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function Ee(t,e){return{index:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,flags:8,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:{},matchedQueryIds:0,references:{},ngContentIndex:t,childCount:0,bindings:[],bindingFlags:0,outputs:[],element:null,provider:null,text:null,query:null,ngContent:{index:e}}}function Oe(t,e,n){var r=$t(t,e,n);if(r){oe(t,n.ngContent.index,1,r,null,void 0)}}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function xe(t,e,n,r){var o=e.viewContainer._embeddedViews;null!==n&&void 0!==n||(n=o.length),r.viewContainerParent=t,Me(o,n,r),Pe(e,r),ss.dirtyParentQueries(r),De(e,n>0?o[n-1]:null,r)}function Pe(t,e){var n=Wt(e);if(n&&n!==t&&!(16&e.state)){e.state|=16;var r=n.template._projectedViews;r||(r=n.template._projectedViews=[]),r.push(e),ke(e.parent.def,e.parentNodeDef)}}function ke(t,e){if(!(4&e.flags)){t.nodeFlags|=4,e.flags|=4;for(var n=e.parent;n;)n.childFlags|=4,n=n.parent}}function Se(t,e){var n=t.viewContainer._embeddedViews;if((null==e||e>=n.length)&&(e=n.length-1),e<0)return null;var r=n[e];return r.viewContainerParent=null,Ve(n,e),ss.dirtyParentQueries(r),Re(r),r}function Te(t){if(16&t.state){var e=Wt(t);if(e){var n=e.template._projectedViews;n&&(Ve(n,n.indexOf(t)),ss.dirtyParentQueries(t))}}}function Ae(t,e,n){var r=t.viewContainer._embeddedViews,o=r[e];return Ve(r,e),null==n&&(n=r.length),Me(r,n,o),ss.dirtyParentQueries(o),Re(o),De(t,n>0?r[n-1]:null,o),o}function De(t,e,n){var r=e?Kt(e,e.def.lastRenderRootNode):t.renderElement;ne(n,2,n.renderer.parentNode(r),n.renderer.nextSibling(r),void 0)}function Re(t){ne(t,3,null,null,void 0)}function Me(t,e,n){e>=t.length?t.push(n):t.splice(e,0,n)}function Ve(t,e){e>=t.length-1?t.pop():t.splice(e,1)}function Ne(t,e,n,r,o,i){return new ys(t,e,n,r,o,i)}function je(t,e,n){return new gs(t,e,n)}function Ie(t){return new vs(t)}function Fe(t,e){return new bs(t,e)}function He(t,e){return new _s(t,e)}function Le(t,e){var n=t.def.nodes[e];if(1&n.flags){var r=Pt(t,n.index);return n.element.template?r.template:r.renderElement}if(2&n.flags)return xt(t,n.index).renderText;if(20240&n.flags)return kt(t,n.index).instance;throw new Error("Illegal state: read nodeValue for node index "+e)}function Ue(t){return new ws(t.renderer)}function ze(t,e,n,r,o,i,s){var a=[];if(i)for(var u in i){var c=i[u],l=c[0],p=c[1];a[l]={flags:8,name:u,nonMinifiedName:p,ns:null,securityContext:null,suffix:null}}var f=[];if(s)for(var h in s)f.push({type:1,propName:h,target:null,eventName:s[h]});return t|=16384,Xe(t,e,n,r,r,o,a,f)}function Be(t,e,n,r,o){return Xe(t,e,0,n,r,o)}function Xe(t,e,n,r,o,i,s,a){var u=Yt(e),c=u.matchedQueries,l=u.references,p=u.matchedQueryIds;a||(a=[]),s||(s=[]);var f=i.map(function(t){var e,n;return Array.isArray(t)?(n=t[0],e=t[1]):(n=0,e=t),{flags:n,token:e,tokenKey:jt(e)}});return{index:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,flags:t,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:c,matchedQueryIds:p,references:l,ngContentIndex:-1,childCount:n,bindings:s,bindingFlags:ue(s),outputs:a,element:null,provider:{token:r,tokenKey:jt(r),value:o,deps:f},text:null,query:null,ngContent:null}}function We(t,e){return 4096&e.flags?Ts:Je(t,e)}function Ge(t,e){for(var n=t;n.parent&&!Zt(n);)n=n.parent;return Ye(n.parent,Gt(n),!0,e.provider.value,e.provider.deps)}function Ke(t,e){var n=(32768&e.flags)>0,r=Ye(t,e.parent,n,e.provider.value,e.provider.deps);if(e.outputs.length)for(var o=0;o<e.outputs.length;o++){var i=e.outputs[o],s=r[i.propName].subscribe(qe(t,e.parent.index,i.eventName));t.disposables[e.outputIndex+o]=s.unsubscribe.bind(s)}return r}function qe(t,e,n){return function(r){try{return Xt(t,e,n,r)}catch(e){t.root.errorHandler.handleError(e)}}}function Ze(t,e,n,r,o,i,s,a,u,c,l,p){var f=kt(t,e.index),h=f.instance,d=!1,y=void 0,m=e.bindings.length;return m>0&&Ht(t,e,0,n)&&(d=!0,y=nn(t,f,e,0,n,y)),m>1&&Ht(t,e,1,r)&&(d=!0,y=nn(t,f,e,1,r,y)),m>2&&Ht(t,e,2,o)&&(d=!0,y=nn(t,f,e,2,o,y)),m>3&&Ht(t,e,3,i)&&(d=!0,y=nn(t,f,e,3,i,y)),m>4&&Ht(t,e,4,s)&&(d=!0,y=nn(t,f,e,4,s,y)),m>5&&Ht(t,e,5,a)&&(d=!0,y=nn(t,f,e,5,a,y)),m>6&&Ht(t,e,6,u)&&(d=!0,y=nn(t,f,e,6,u,y)),m>7&&Ht(t,e,7,c)&&(d=!0,y=nn(t,f,e,7,c,y)),m>8&&Ht(t,e,8,l)&&(d=!0,y=nn(t,f,e,8,l,y)),m>9&&Ht(t,e,9,p)&&(d=!0,y=nn(t,f,e,9,p,y)),y&&h.ngOnChanges(y),2&t.state&&65536&e.flags&&h.ngOnInit(),262144&e.flags&&h.ngDoCheck(),d}function Qe(t,e,n){for(var r=kt(t,e.index),o=r.instance,i=!1,s=void 0,a=0;a<n.length;a++)Ht(t,e,a,n[a])&&(i=!0,s=nn(t,r,e,a,n[a],s));return s&&o.ngOnChanges(s),2&t.state&&65536&e.flags&&o.ngOnInit(),262144&e.flags&&o.ngDoCheck(),i}function Je(t,e){var n,r=(8192&e.flags)>0,o=e.provider;switch(201347067&e.flags){case 512:n=Ye(t,e.parent,r,o.value,o.deps);break;case 1024:n=$e(t,e.parent,r,o.value,o.deps);break;case 2048:n=tn(t,e.parent,r,o.deps[0]);break;case 256:n=o.value}return n}function Ye(t,e,n,r,o){var i,s=o.length;switch(s){case 0:i=new r;break;case 1:i=new r(tn(t,e,n,o[0]));break;case 2:i=new r(tn(t,e,n,o[0]),tn(t,e,n,o[1]));break;case 3:i=new r(tn(t,e,n,o[0]),tn(t,e,n,o[1]),tn(t,e,n,o[2]));break;default:for(var a=new Array(s),u=0;u<s;u++)a[u]=tn(t,e,n,o[u]);i=new(r.bind.apply(r,[void 0].concat(a)))}return i}function $e(t,e,n,r,o){var i,s=o.length;switch(s){case 0:i=r();break;case 1:i=r(tn(t,e,n,o[0]));break;case 2:i=r(tn(t,e,n,o[0]),tn(t,e,n,o[1]));break;case 3:i=r(tn(t,e,n,o[0]),tn(t,e,n,o[1]),tn(t,e,n,o[2]));break;default:for(var a=Array(s),u=0;u<s;u++)a[u]=tn(t,e,n,o[u]);i=r.apply(void 0,a)}return i}function tn(t,e,n,r,o){if(void 0===o&&(o=uo.THROW_IF_NOT_FOUND),8&r.flags)return r.token;var i=t;2&r.flags&&(o=null);var s=r.tokenKey;for(s===ks&&(n=!(!e||!e.element.componentView)),e&&1&r.flags&&(n=!1,e=e.parent);t;){if(e)switch(s){case Cs:var a=en(t,e,n);return Ue(a);case Es:var a=en(t,e,n);return a.renderer;case Os:return new Ci(Pt(t,e.index).renderElement);case xs:return Pt(t,e.index).viewContainer;case Ps:if(e.element.template)return Pt(t,e.index).template;break;case ks:return Ie(en(t,e,n));case Ss:return He(t,e);default:var u=(n?e.element.allProviders:e.element.publicProviders)[s];if(u){var c=kt(t,u.index);return c.instance===Ts&&(c.instance=Je(t,u)),c.instance}}n=Zt(t),e=Gt(t),t=t.parent}var l=i.root.injector.get(r.token,As);return l!==As||o===As?l:i.root.ngModule.injector.get(r.token,o)}function en(t,e,n){var r;if(n)r=Pt(t,e.index).componentView;else for(r=t;r.parent&&!Zt(r);)r=r.parent;return r}function nn(t,e,n,r,o,i){if(32768&n.flags){var s=Pt(t,n.parent.index).componentView;2&s.def.flags&&(s.state|=8)}var a=n.bindings[r],u=a.name;if(e.instance[u]=o,524288&n.flags){i=i||{};var c=t.oldValues[n.bindingIndex+r];c instanceof Ii&&(c=c.wrapped);i[n.bindings[r].nonMinifiedName]=new Fi(c,o,0!=(2&t.state))}return t.oldValues[n.bindingIndex+r]=o,i}function rn(t,e){if(t.def.nodeFlags&e)for(var n=t.def.nodes,r=0;r<n.length;r++){var o=n[r],i=o.parent;for(!i&&o.flags&e&&sn(t,r,o.flags&e),0==(o.childFlags&e)&&(r+=o.childCount);i&&1&i.flags&&r===i.index+i.childCount;)i.directChildFlags&e&&on(t,i,e),i=i.parent}}function on(t,e,n){for(var r=e.index+1;r<=e.index+e.childCount;r++){var o=t.def.nodes[r];o.flags&n&&sn(t,r,o.flags&n),r+=o.childCount}}function sn(t,e,n){var r=kt(t,e).instance;r!==Ts&&(ss.setCurrentNode(t,e),1048576&n&&r.ngAfterContentInit(),2097152&n&&r.ngAfterContentChecked(),4194304&n&&r.ngAfterViewInit(),8388608&n&&r.ngAfterViewChecked(),131072&n&&r.ngOnDestroy())}function an(t){return un(64,t)}function un(t,e){for(var n=new Array(e.length),r=0;r<e.length;r++){var o=e[r];n[r]={flags:8,name:o,ns:null,nonMinifiedName:o,securityContext:null,suffix:null}}return{index:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,flags:t,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:{},matchedQueryIds:0,references:{},ngContentIndex:-1,childCount:0,bindings:n,bindingFlags:ue(n),outputs:[],element:null,provider:null,text:null,query:null,ngContent:null}}function cn(t,e){return{value:void 0}}function ln(t,e,n,r,o,i,s,a,u,c,l,p){var f=e.bindings,h=!1,d=f.length;if(d>0&&Lt(t,e,0,n)&&(h=!0),d>1&&Lt(t,e,1,r)&&(h=!0),d>2&&Lt(t,e,2,o)&&(h=!0),d>3&&Lt(t,e,3,i)&&(h=!0),d>4&&Lt(t,e,4,s)&&(h=!0),d>5&&Lt(t,e,5,a)&&(h=!0),d>6&&Lt(t,e,6,u)&&(h=!0),d>7&&Lt(t,e,7,c)&&(h=!0),d>8&&Lt(t,e,8,l)&&(h=!0),d>9&&Lt(t,e,9,p)&&(h=!0),h){var y=St(t,e.index),m=void 0;switch(201347067&e.flags){case 32:m=new Array(f.length),d>0&&(m[0]=n),d>1&&(m[1]=r),d>2&&(m[2]=o),d>3&&(m[3]=i),d>4&&(m[4]=s),d>5&&(m[5]=a),d>6&&(m[6]=u),d>7&&(m[7]=c),d>8&&(m[8]=l),d>9&&(m[9]=p);break;case 64:m={},d>0&&(m[f[0].name]=n),d>1&&(m[f[1].name]=r),d>2&&(m[f[2].name]=o),d>3&&(m[f[3].name]=i),d>4&&(m[f[4].name]=s),d>5&&(m[f[5].name]=a),d>6&&(m[f[6].name]=u),d>7&&(m[f[7].name]=c),d>8&&(m[f[8].name]=l),d>9&&(m[f[9].name]=p);break;case 128:var g=n;switch(d){case 1:m=g.transform(n);break;case 2:m=g.transform(r);break;case 3:m=g.transform(r,o);break;case 4:m=g.transform(r,o,i);break;case 5:m=g.transform(r,o,i,s);break;case 6:m=g.transform(r,o,i,s,a);break;case 7:m=g.transform(r,o,i,s,a,u);break;case 8:m=g.transform(r,o,i,s,a,u,c);break;case 9:m=g.transform(r,o,i,s,a,u,c,l);break;case 10:m=g.transform(r,o,i,s,a,u,c,l,p)}}y.value=m}return h}function pn(t,e,n){for(var r=e.bindings,o=!1,i=0;i<n.length;i++)Lt(t,e,i,n[i])&&(o=!0);if(o){var s=St(t,e.index),a=void 0;switch(201347067&e.flags){case 32:a=n;break;case 64:a={};for(var i=0;i<n.length;i++)a[r[i].name]=n[i];break;case 128:var u=n[0],c=n.slice(1);a=u.transform.apply(u,c)}s.value=a}return o}function fn(){return new Ei}function hn(t){for(var e=t.def.nodeMatchedQueries;t.parent&&Qt(t);){var n=t.parentNodeDef;t=t.parent;for(var r=n.index+n.childCount,o=0;o<=r;o++){var i=t.def.nodes[o];67108864&i.flags&&536870912&i.flags&&(i.query.filterId&e)===i.query.filterId&&Tt(t,o).setDirty(),!(1&i.flags&&o+i.childCount<n.index)&&67108864&i.childFlags&&536870912&i.childFlags||(o+=i.childCount)}}if(134217728&t.def.nodeFlags)for(var o=0;o<t.def.nodes.length;o++){var i=t.def.nodes[o];134217728&i.flags&&536870912&i.flags&&Tt(t,o).setDirty(),o+=i.childCount}}function dn(t,e){var n=Tt(t,e.index);if(n.dirty){var r,o=void 0;if(67108864&e.flags){var i=e.parent.parent;o=yn(t,i.index,i.index+i.childCount,e.query,[]),r=kt(t,e.parent.index).instance}else 134217728&e.flags&&(o=yn(t,0,t.def.nodes.length-1,e.query,[]),r=t.component);n.reset(o);for(var s=e.query.bindings,a=!1,u=0;u<s.length;u++){var c=s[u],l=void 0;switch(c.bindingType){case 0:l=n.first;break;case 1:l=n,a=!0}r[c.propName]=l}a&&n.notifyOnChanges()}}function yn(t,e,n,r,o){for(var i=e;i<=n;i++){var s=t.def.nodes[i],a=s.matchedQueries[r.id];if(null!=a&&o.push(mn(t,s,a)),1&s.flags&&s.element.template&&(s.element.template.nodeMatchedQueries&r.filterId)===r.filterId){var u=Pt(t,i);if(16777216&s.flags)for(var c=u.viewContainer._embeddedViews,l=0;l<c.length;l++){var p=c[l],f=Wt(p);f&&f===u&&yn(p,0,p.def.nodes.length-1,r,o)}var h=u.template._projectedViews;if(h)for(var l=0;l<h.length;l++){var d=h[l];yn(d,0,d.def.nodes.length-1,r,o)}}(s.childMatchedQueries&r.filterId)!==r.filterId&&(i+=s.childCount)}return o}function mn(t,e,n){if(null!=n){var r=void 0;switch(n){case 1:r=Pt(t,e.index).renderElement;break;case 0:r=new Ci(Pt(t,e.index).renderElement);break;case 2:r=Pt(t,e.index).template;break;case 3:r=Pt(t,e.index).viewContainer;break;case 4:r=kt(t,e.index).instance}return r}}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function gn(t,e){for(var n=new Array(e.length-1),r=1;r<e.length;r++)n[r-1]={flags:8,name:null,ns:null,nonMinifiedName:null,securityContext:null,suffix:e[r]};return{index:-1,parent:null,renderParent:null,bindingIndex:-1,outputIndex:-1,flags:2,childFlags:0,directChildFlags:0,childMatchedQueries:0,matchedQueries:{},matchedQueryIds:0,references:{},ngContentIndex:t,childCount:0,bindings:n,bindingFlags:ue(n),outputs:[],element:null,provider:null,text:{prefix:e[0]},query:null,ngContent:null}}function vn(t,e,n){var r,o=t.renderer;r=o.createText(n.text.prefix);var i=$t(t,e,n);return i&&o.appendChild(i,r),{renderText:r}}function bn(t,e,n,r,o,i,s,a,u,c,l,p){var f=!1,h=e.bindings,d=h.length;if(d>0&&Lt(t,e,0,n)&&(f=!0),d>1&&Lt(t,e,1,r)&&(f=!0),d>2&&Lt(t,e,2,o)&&(f=!0),d>3&&Lt(t,e,3,i)&&(f=!0),d>4&&Lt(t,e,4,s)&&(f=!0),d>5&&Lt(t,e,5,a)&&(f=!0),d>6&&Lt(t,e,6,u)&&(f=!0),d>7&&Lt(t,e,7,c)&&(f=!0),d>8&&Lt(t,e,8,l)&&(f=!0),d>9&&Lt(t,e,9,p)&&(f=!0),f){var y=e.text.prefix;d>0&&(y+=wn(n,h[0])),d>1&&(y+=wn(r,h[1])),d>2&&(y+=wn(o,h[2])),d>3&&(y+=wn(i,h[3])),d>4&&(y+=wn(s,h[4])),d>5&&(y+=wn(a,h[5])),d>6&&(y+=wn(u,h[6])),d>7&&(y+=wn(c,h[7])),d>8&&(y+=wn(l,h[8])),d>9&&(y+=wn(p,h[9]));var m=xt(t,e.index).renderText;t.renderer.setValue(m,y)}return f}function _n(t,e,n){for(var r=e.bindings,o=!1,i=0;i<n.length;i++)Lt(t,e,i,n[i])&&(o=!0);if(o){for(var s="",i=0;i<n.length;i++)s+=wn(n[i],r[i]);s=e.text.prefix+s;var a=xt(t,e.index).renderText;t.renderer.setValue(a,s)}return o}function wn(t,e){return(null!=t?t.toString():"")+e.suffix}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function Cn(t,e,n,r){for(var o=0,i=0,s=0,a=0,u=0,c=null,l=!1,p=!1,f=null,h=0;h<e.length;h++){for(;c&&h>c.index+c.childCount;){var d=c.parent;d&&(d.childFlags|=c.childFlags,d.childMatchedQueries|=c.childMatchedQueries),c=d}var y=e[h];y.index=h,y.parent=c,y.bindingIndex=o,y.outputIndex=i;var m=void 0;if(m=c&&1&c.flags&&!c.element.name?c.renderParent:c,y.renderParent=m,y.element){var g=y.element;g.publicProviders=c?c.element.publicProviders:Object.create(null),g.allProviders=g.publicProviders,l=!1,p=!1}if(En(c,y,e.length),s|=y.flags,u|=y.matchedQueryIds,y.element&&y.element.template&&(u|=y.element.template.nodeMatchedQueries),c?(c.childFlags|=y.flags,c.directChildFlags|=y.flags,c.childMatchedQueries|=y.matchedQueryIds,y.element&&y.element.template&&(c.childMatchedQueries|=y.element.template.nodeMatchedQueries)):a|=y.flags,o+=y.bindings.length,i+=y.outputs.length,!m&&3&y.flags&&(f=y),20224&y.flags){l||(l=!0,c.element.publicProviders=Object.create(c.element.publicProviders),c.element.allProviders=c.element.publicProviders);var v=0!=(8192&y.flags),b=0!=(32768&y.flags);!v||b?c.element.publicProviders[y.provider.tokenKey]=y:(p||(p=!0,c.element.allProviders=Object.create(c.element.publicProviders)),c.element.allProviders[y.provider.tokenKey]=y),b&&(c.element.componentProvider=y)}y.childCount&&(c=y)}for(;c;){var d=c.parent;d&&(d.childFlags|=c.childFlags,d.childMatchedQueries|=c.childMatchedQueries),c=d}var _=function(t,n,r,o){return e[n].element.handleEvent(t,r,o)};return{factory:null,nodeFlags:s,rootNodeFlags:a,nodeMatchedQueries:u,flags:t,nodes:e,updateDirectives:n||as,updateRenderer:r||as,handleEvent:_||as,bindingCount:o,outputCount:i,lastRenderRootNode:f}}function En(t,e,n){var r=e.element&&e.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 "+e.index+"!")}if(20224&e.flags){if(0==(1&(t?t.flags:0)))throw new Error("Illegal State: Provider/Directive nodes need to be children of elements or anchors, at index "+e.index+"!")}if(e.query){if(67108864&e.flags&&(!t||0==(16384&t.flags)))throw new Error("Illegal State: Content Query nodes need to be children of directives, at index "+e.index+"!");if(134217728&e.flags&&t)throw new Error("Illegal State: View Query nodes have to be top level nodes, at index "+e.index+"!")}if(e.childCount){var o=t?t.index+t.childCount:n-1;if(e.index<=o&&e.index+e.childCount>o)throw new Error("Illegal State: childCount of node leads outside of parent, at index "+e.index+"!")}}function On(t,e,n){var r=Pn(t.root,t.renderer,t,e,e.element.template);return kn(r,t.component,n),Sn(r),r}function xn(t,e,n){var r=Pn(t,t.renderer,null,null,e);return kn(r,n,n),Sn(r),r}function Pn(t,e,n,r,o){var i=new Array(o.nodes.length),s=o.outputCount?new Array(o.outputCount):null;return{def:o,parent:n,viewContainerParent:null,parentNodeDef:r,context:null,component:null,nodes:i,state:13,root:t,renderer:e,oldValues:new Array(o.bindingCount),disposables:s}}function kn(t,e,n){t.component=e,t.context=n}function Sn(t){var e;if(Zt(t)){var n=t.parentNodeDef;e=Pt(t.parent,n.parent.index).renderElement}for(var r=t.def,o=t.nodes,i=0;i<r.nodes.length;i++){var s=r.nodes[i];ss.setCurrentNode(t,i);var a=void 0;switch(201347067&s.flags){case 1:var u=he(t,e,s),c=void 0;if(33554432&s.flags){var l=te(s.element.componentView),p=s.element.componentRendererType,f=void 0;f=p?t.root.rendererFactory.createRenderer(u,p):t.root.renderer,c=Pn(t.root,f,t,s.element.componentProvider,l)}de(t,c,s,u),a={renderElement:u,componentView:c,viewContainer:null,template:s.element.template?Fe(t,s):void 0},16777216&s.flags&&(a.viewContainer=je(t,s,a));break;case 2:a=vn(t,e,s);break;case 512:case 1024:case 2048:case 256:var h=We(t,s);a={instance:h};break;case 16:var h=Ge(t,s);a={instance:h};break;case 16384:var h=Ke(t,s);if(a={instance:h},32768&s.flags){kn(Pt(t,s.parent.index).componentView,h,h)}break;case 32:case 64:case 128:a=cn(t,s);break;case 67108864:case 134217728:a=fn();break;case 8:Oe(t,e,s),a=void 0}o[i]=a}Un(t,Ds.CreateViewNodes),Wn(t,201326592,268435456,0)}function Tn(t){Rn(t),ss.updateDirectives(t,1),zn(t,Ds.CheckNoChanges),ss.updateRenderer(t,1),Un(t,Ds.CheckNoChanges),t.state&=-97}function An(t){1&t.state?(t.state&=-2,t.state|=2):t.state&=-3,Rn(t),ss.updateDirectives(t,0),zn(t,Ds.CheckAndUpdate),Wn(t,67108864,536870912,0),rn(t,2097152|(2&t.state?1048576:0)),ss.updateRenderer(t,0),Un(t,Ds.CheckAndUpdate),Wn(t,134217728,536870912,0),rn(t,8388608|(2&t.state?4194304:0)),2&t.def.flags&&(t.state&=-9),t.state&=-97}function Dn(t,e,n,r,o,i,s,a,u,c,l,p,f){return 0===n?Mn(t,e,r,o,i,s,a,u,c,l,p,f):Vn(t,e,r)}function Rn(t){var e=t.def;if(4&e.nodeFlags)for(var n=0;n<e.nodes.length;n++){var r=e.nodes[n];if(4&r.flags){var o=Pt(t,n).template._projectedViews;if(o)for(var i=0;i<o.length;i++){var s=o[i];s.state|=32,Bt(s,t)}}else 0==(4&r.childFlags)&&(n+=r.childCount)}}function Mn(t,e,n,r,o,i,s,a,u,c,l,p){var f=!1;switch(201347067&e.flags){case 1:f=me(t,e,n,r,o,i,s,a,u,c,l,p);break;case 2:f=bn(t,e,n,r,o,i,s,a,u,c,l,p);break;case 16384:f=Ze(t,e,n,r,o,i,s,a,u,c,l,p);break;case 32:case 64:case 128:f=ln(t,e,n,r,o,i,s,a,u,c,l,p)}return f}function Vn(t,e,n){var r=!1;switch(201347067&e.flags){case 1:r=ge(t,e,n);break;case 2:r=_n(t,e,n);break;case 16384:r=Qe(t,e,n);break;case 32:case 64:case 128:r=pn(t,e,n)}if(r)for(var o=e.bindings.length,i=e.bindingIndex,s=t.oldValues,a=0;a<o;a++)s[i+a]=n[a];return r}function Nn(t,e,n,r,o,i,s,a,u,c,l,p,f){return 0===n?jn(t,e,r,o,i,s,a,u,c,l,p,f):In(t,e,r),!1}function jn(t,e,n,r,o,i,s,a,u,c,l,p){var f=e.bindings.length;f>0&&Ut(t,e,0,n),f>1&&Ut(t,e,1,r),f>2&&Ut(t,e,2,o),f>3&&Ut(t,e,3,i),f>4&&Ut(t,e,4,s),f>5&&Ut(t,e,5,a),f>6&&Ut(t,e,6,u),f>7&&Ut(t,e,7,c),f>8&&Ut(t,e,8,l),f>9&&Ut(t,e,9,p)}function In(t,e,n){for(var r=0;r<n.length;r++)Ut(t,e,r,n[r])}function Fn(t,e){if(Tt(t,e.index).dirty)throw At(ss.createDebugContext(t,e.index),"Query "+e.query.id+" not dirty","Query "+e.query.id+" dirty",0!=(1&t.state))}function Hn(t){if(!(128&t.state)){if(zn(t,Ds.Destroy),Un(t,Ds.Destroy),rn(t,131072),t.disposables)for(var e=0;e<t.disposables.length;e++)t.disposables[e]();Te(t),t.renderer.destroyNode&&Ln(t),Zt(t)&&t.renderer.destroy(),t.state|=128}}function Ln(t){for(var e=t.def.nodes.length,n=0;n<e;n++){var r=t.def.nodes[n];1&r.flags?t.renderer.destroyNode(Pt(t,n).renderElement):2&r.flags&&t.renderer.destroyNode(xt(t,n).renderText)}}function Un(t,e){var n=t.def;if(33554432&n.nodeFlags)for(var r=0;r<n.nodes.length;r++){var o=n.nodes[r];33554432&o.flags?Bn(Pt(t,r).componentView,e):0==(33554432&o.childFlags)&&(r+=o.childCount)}}function zn(t,e){var n=t.def;if(16777216&n.nodeFlags)for(var r=0;r<n.nodes.length;r++){var o=n.nodes[r];if(16777216&o.flags)for(var i=Pt(t,r).viewContainer._embeddedViews,s=0;s<i.length;s++)Bn(i[s],e);else 0==(16777216&o.childFlags)&&(r+=o.childCount)}}function Bn(t,e){var n=t.state;switch(e){case Ds.CheckNoChanges:0==(128&n)&&(12==(12&n)?Tn(t):64&n&&Xn(t,Ds.CheckNoChangesProjectedViews));break;case Ds.CheckNoChangesProjectedViews:0==(128&n)&&(32&n?Tn(t):64&n&&Xn(t,e));break;case Ds.CheckAndUpdate:0==(128&n)&&(12==(12&n)?An(t):64&n&&Xn(t,Ds.CheckAndUpdateProjectedViews));break;case Ds.CheckAndUpdateProjectedViews:0==(128&n)&&(32&n?An(t):64&n&&Xn(t,e));break;case Ds.Destroy:Hn(t);break;case Ds.CreateViewNodes:Sn(t)}}function Xn(t,e){zn(t,e),Un(t,e)}function Wn(t,e,n,r){if(t.def.nodeFlags&e&&t.def.nodeFlags&n)for(var o=t.def.nodes.length,i=0;i<o;i++){var s=t.def.nodes[i];if(s.flags&e&&s.flags&n)switch(ss.setCurrentNode(t,s.index),r){case 0:dn(t,s);break;case 1:Fn(t,s)}s.childFlags&e&&s.childFlags&n||(i+=s.childCount)}}function Gn(){if(!Rs){Rs=!0;var t=rt()?qn():Kn();ss.setCurrentNode=t.setCurrentNode,ss.createRootView=t.createRootView,ss.createEmbeddedView=t.createEmbeddedView,ss.checkAndUpdateView=t.checkAndUpdateView,ss.checkNoChangesView=t.checkNoChangesView,ss.destroyView=t.destroyView,ss.resolveDep=tn,ss.createDebugContext=t.createDebugContext,ss.handleEvent=t.handleEvent,ss.updateDirectives=t.updateDirectives,ss.updateRenderer=t.updateRenderer,ss.dirtyParentQueries=hn}}function Kn(){return{setCurrentNode:function(){},createRootView:Zn,createEmbeddedView:On,checkAndUpdateView:An,checkNoChangesView:Tn,destroyView:Hn,createDebugContext:function(t,e){return new Fs(t,e)},handleEvent:function(t,e,n,r){return t.def.handleEvent(t,e,n,r)},updateDirectives:function(t,e){return t.def.updateDirectives(0===e?Yn:$n,t)},updateRenderer:function(t,e){return t.def.updateRenderer(0===e?Yn:$n,t)}}}function qn(){return{setCurrentNode:or,createRootView:Qn,createEmbeddedView:tr,checkAndUpdateView:er,checkNoChangesView:nr,destroyView:rr,createDebugContext:function(t,e){return new Fs(t,e)},handleEvent:ir,updateDirectives:sr,updateRenderer:ar}}function Zn(t,e,n,r,o,i){return xn(Jn(t,o,o.injector.get(bi),e,n),r,i)}function Qn(t,e,n,r,o,i){var s=o.injector.get(bi),a=Jn(t,o,new Hs(s),e,n);return vr(Ms.create,xn,null,[a,r,i])}function Jn(t,e,n,r,o){var i=e.injector.get(is),s=e.injector.get(fo);return{ngModule:e,injector:t,projectableNodes:r,selectorOrNode:o,sanitizer:i,rendererFactory:n,renderer:n.createRenderer(null,null),errorHandler:s}}function Yn(t,e,n,r,o,i,s,a,u,c,l,p,f){var h=t.def.nodes[e];return Dn(t,h,n,r,o,i,s,a,u,c,l,p,f),224&h.flags?St(t,e).value:void 0}function $n(t,e,n,r,o,i,s,a,u,c,l,p,f){var h=t.def.nodes[e];return Nn(t,h,n,r,o,i,s,a,u,c,l,p,f),224&h.flags?St(t,e).value:void 0}function tr(t,e,n){return vr(Ms.create,On,null,[t,e,n])}function er(t){return vr(Ms.detectChanges,An,null,[t])}function nr(t){return vr(Ms.checkNoChanges,Tn,null,[t])}function rr(t){return vr(Ms.destroy,Hn,null,[t])}function or(t,e){Ns=t,js=e}function ir(t,e,n,r){return or(t,e),vr(Ms.handleEvent,t.def.handleEvent,null,[t,e,n,r])}function sr(t,e){function n(t,n,r){for(var o=[],i=3;i<arguments.length;i++)o[i-3]=arguments[i];var s=t.def.nodes[n];return 0===e?ur(t,s,r,o):cr(t,s,r,o),16384&s.flags&&or(t,hr(t,n)),224&s.flags?St(t,s.index).value:void 0}if(128&t.state)throw Nt(Ms[Vs]);return or(t,hr(t,0)),t.def.updateDirectives(n,t)}function ar(t,e){function n(t,n,r){for(var o=[],i=3;i<arguments.length;i++)o[i-3]=arguments[i];var s=t.def.nodes[n];return 0===e?ur(t,s,r,o):cr(t,s,r,o),3&s.flags&&or(t,dr(t,n)),224&s.flags?St(t,s.index).value:void 0}if(128&t.state)throw Nt(Ms[Vs]);return or(t,dr(t,0)),t.def.updateRenderer(n,t)}function ur(t,e,n,r){if(Dn.apply(void 0,[t,e,n].concat(r))){var o=1===n?r[0]:r;if(16384&e.flags){for(var i={},s=0;s<e.bindings.length;s++){var a=e.bindings[s],u=o[s];8&a.flags&&(i[lr(a.nonMinifiedName)]=fr(u))}var c=e.parent,l=Pt(t,c.index).renderElement;if(c.element.name)for(var p in i){var u=i[p];null!=u?t.renderer.setAttribute(l,p,u):t.renderer.removeAttribute(l,p)}else t.renderer.setValue(l,"bindings="+JSON.stringify(i,null,2))}}}function cr(t,e,n,r){Nn.apply(void 0,[t,e,n].concat(r))}function lr(t){return"ng-reflect-"+(t=pr(t.replace(/[$@]/g,"_")))}function pr(t){return t.replace(Is,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return"-"+t[1].toLowerCase()})}function fr(t){try{return null!=t?t.toString().slice(0,30):t}catch(t){return"[ERROR] Exception while trying to serialize the value"}}function hr(t,e){for(var n=e;n<t.def.nodes.length;n++){var r=t.def.nodes[n];if(16384&r.flags&&r.bindings&&r.bindings.length)return n}return null}function dr(t,e){for(var n=e;n<t.def.nodes.length;n++){var r=t.def.nodes[n];if(3&r.flags&&r.bindings&&r.bindings.length)return n}return null}function yr(t,e){for(var n=-1,r=0;r<=e;r++){3&t.nodes[r].flags&&n++}return n}function mr(t){for(;t&&!Zt(t);)t=t.parent;return t.parent?Pt(t.parent,Gt(t).index):null}function gr(t,e,n){for(var r in e.references)n[r]=mn(t,e,e.references[r])}function vr(t,e,n,r){var o=Vs,i=Ns,s=js;try{Vs=t;var a=e.apply(n,r);return Ns=i,js=s,Vs=o,a}catch(t){if(Vt(t)||!Ns)throw t;throw Dt(t,br())}}function br(){return Ns?new Fs(Ns,js):null}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function _r(){return Yi}function wr(){return $i}function Cr(t){return t||"en-US"}function Er(){Gn()}var Or=n("rCTf"),xr=(n.n(Or),n("1KT0")),Pr=(n.n(xr),n("+ayw")),kr=(n.n(Pr),n("EEr4"));n.n(kr);n.d(e,"r",function(){return mi}),n.d(e,"a",function(){return nt}),n.d(e,"K",function(){return rt}),n.d(e,"O",function(){return it}),n.d(e,"k",function(){return hi}),n.d(e,"s",function(){return Mo}),n.d(e,"N",function(){return No}),n.d(e,"M",function(){return jo}),n.d(e,"q",function(){return Do}),n.d(e,"l",function(){return Ro}),n.d(e,"G",function(){return dt}),n.d(e,"i",function(){return ii}),n.d(e,"F",function(){return et}),n.d(e,"c",function(){return ns}),n.d(e,"o",function(){return Us}),n.d(e,"R",function(){return ri}),n.d(e,"p",function(){return fo}),n.d(e,"v",function(){return is}),n.d(e,"L",function(){return os}),n.d(e,"_3",function(){return Fr}),n.d(e,"_15",function(){return Ur}),n.d(e,"_16",function(){return Lr}),n.d(e,"_10",function(){return Wr}),n.d(e,"U",function(){return Xr}),n.d(e,"X",function(){return Kr}),n.d(e,"_14",function(){return qr}),n.d(e,"_7",function(){return Gr}),n.d(e,"A",function(){return Zr}),n.d(e,"I",function(){return Qr}),n.d(e,"B",function(){return Jr}),n.d(e,"_9",function(){return d}),n.d(e,"_11",function(){return uo}),n.d(e,"_19",function(){return So}),n.d(e,"D",function(){return Ar}),n.d(e,"E",function(){return $r}),n.d(e,"H",function(){return to}),n.d(e,"z",function(){return eo}),n.d(e,"_13",function(){return no}),n.d(e,"Q",function(){return ro}),n.d(e,"_2",function(){return oo}),n.d(e,"h",function(){return oi}),n.d(e,"W",function(){return vi}),n.d(e,"w",function(){return bi}),n.d(e,"J",function(){return _i}),n.d(e,"d",function(){return Ho}),n.d(e,"_18",function(){return Uo}),n.d(e,"Z",function(){return Wo}),n.d(e,"V",function(){return Ci}),n.d(e,"y",function(){return Jo}),n.d(e,"Y",function(){return Qo}),n.d(e,"_1",function(){return Ti}),n.d(e,"_0",function(){return Ai}),n.d(e,"_17",function(){return zr}),n.d(e,"_8",function(){return Di}),n.d(e,"t",function(){return qi}),n.d(e,"u",function(){return Zi}),n.d(e,"_4",function(){return Ii}),n.d(e,"P",function(){return es}),n.d(e,"S",function(){return vt}),n.d(e,"n",function(){return Fo}),n.d(e,"C",function(){return Vr}),n.d(e,"_12",function(){return i}),n.d(e,"T",function(){return s}),n.d(e,"_6",function(){return G}),n.d(e,"_5",function(){return W}),n.d(e,"x",function(){return $o}),n.d(e,"_27",function(){return pe}),n.d(e,"_25",function(){return Ne}),n.d(e,"_20",function(){return It}),n.d(e,"_23",function(){return ze}),n.d(e,"_22",function(){return fe}),n.d(e,"_26",function(){return ce}),n.d(e,"_30",function(){return Ee}),n.d(e,"_28",function(){return Le}),n.d(e,"_29",function(){return Be}),n.d(e,"_31",function(){return an}),n.d(e,"_24",function(){return gn}),n.d(e,"_21",function(){return Cn}),n.d(e,"j",function(){return Er}),n.d(e,"f",function(){return _r}),n.d(e,"g",function(){return wr}),n.d(e,"b",function(){return Cr}),n.d(e,"m",function(){return gi}),n.d(e,"e",function(){return K});var Sr=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},Tr=function(){function t(t){this._desc=t}return t.prototype.toString=function(){return"Token "+this._desc},t}(),Ar=function(t){function e(e){return t.call(this,e)||this}return Sr(e,t),e.prototype.toString=function(){return"InjectionToken "+this._desc},e}(Tr),Dr="undefined"!=typeof window&&window,Rr="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,Mr=void 0!==t&&t,Vr=Dr||Mr||Rr,Nr=null,jr=0,Ir=Vr.Reflect,Fr=(new Ar("AnalyzeForEntryComponents"),f("Attribute",[["attributeName",void 0]])),Hr=function(){function t(){}return t}(),Lr=h("ContentChildren",[["selector",void 0],{first:!1,isViewQuery:!1,descendants:!1,read:void 0}],Hr),Ur=h("ContentChild",[["selector",void 0],{first:!0,isViewQuery:!1,descendants:!0,read:void 0}],Hr),zr=(h("ViewChildren",[["selector",void 0],{first:!1,isViewQuery:!0,descendants:!0,read:void 0}],Hr),h("ViewChild",[["selector",void 0],{first:!0,isViewQuery:!0,descendants:!0,read:void 0}],Hr),{});zr.OnPush=0,zr.Default=1,zr[zr.OnPush]="OnPush",zr[zr.Default]="Default";var Br={};Br.CheckOnce=0,Br.Checked=1,Br.CheckAlways=2,Br.Detached=3,Br.Errored=4,Br.Destroyed=5,Br[Br.CheckOnce]="CheckOnce",Br[Br.Checked]="Checked",Br[Br.CheckAlways]="CheckAlways",Br[Br.Detached]="Detached",Br[Br.Errored]="Errored",Br[Br.Destroyed]="Destroyed";/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Xr=l("Directive",{selector:void 0,inputs:void 0,outputs:void 0,host:void 0,providers:void 0,exportAs:void 0,queries:void 0}),Wr=l("Component",{selector:void 0,inputs:void 0,outputs:void 0,host:void 0,exportAs:void 0,moduleId:void 0,providers:void 0,viewProviders:void 0,changeDetection:zr.Default,queries:void 0,templateUrl:void 0,template:void 0,styleUrls:void 0,styles:void 0,animations:void 0,encapsulation:void 0,interpolation:void 0,entryComponents:void 0},Xr),Gr=l("Pipe",{name:void 0,pure:!0}),Kr=h("Input",[["bindingPropertyName",void 0]]),qr=h("Output",[["bindingPropertyName",void 0]]),Zr=(h("HostBinding",[["hostPropertyName",void 0]]),h("HostListener",[["eventName",void 0],["args",[]]]),l("NgModule",{providers:void 0,declarations:void 0,imports:void 0,exports:void 0,entryComponents:void 0,bootstrap:void 0,schemas:void 0,id:void 0})),Qr={};Qr.Emulated=0,Qr.Native=1,Qr.None=2,Qr[Qr.Emulated]="Emulated",Qr[Qr.Native]="Native",Qr[Qr.None]="None";var Jr=(function(){function t(t){var e=void 0===t?{}:t,n=e.templateUrl,r=e.template,o=e.encapsulation,i=e.styles,s=e.styleUrls,a=e.animations,u=e.interpolation;this.templateUrl=n,this.template=r,this.styleUrls=s,this.styles=i,this.encapsulation=o,this.animations=a,this.interpolation=u}}(),function(){function t(t){this.full=t}return Object.defineProperty(t.prototype,"major",{get:function(){return this.full.split(".")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minor",{get:function(){return this.full.split(".")[1]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"patch",{get:function(){return this.full.split(".").slice(2).join(".")},enumerable:!0,configurable:!0}),t}()),Yr=new Jr("4.1.2"),$r=f("Inject",[["token",void 0]]),to=f("Optional",[]),eo=l("Injectable",[]),no=f("Self",[]),ro=f("SkipSelf",[]),oo=f("Host",[]),io=new Object,so=io,ao=function(){function t(){}return t.prototype.get=function(t,e){if(void 0===e&&(e=io),e===io)throw new Error("No provider for "+s(t)+"!");return e},t}(),uo=function(){function t(){}return t.prototype.get=function(t,e){},t.prototype.get=function(t,e){},t}();uo.THROW_IF_NOT_FOUND=io,uo.NULL=new ao;/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var co="ngDebugContext",lo="ngOriginalError",po="ngErrorLogger",fo=function(){function t(t){this._console=console}return t.prototype.handleError=function(t){var e=this._findOriginalError(t),n=this._findContext(t),r=v(t);r(this._console,"ERROR",t),e&&r(this._console,"ORIGINAL ERROR",e),n&&r(this._console,"ERROR CONTEXT",n)},t.prototype._findContext=function(t){return t?m(t)?m(t):this._findContext(g(t)):null},t.prototype._findOriginalError=function(t){for(var e=g(t);e&&g(e);)e=g(e);return e},t}(),ho=function(){function t(t,e){if(this.token=t,this.id=e,!t)throw new Error("Token must be defined!")}return Object.defineProperty(t.prototype,"displayName",{get:function(){return s(this.token)},enumerable:!0,configurable:!0}),t.get=function(t){return mo.get(y(t))},Object.defineProperty(t,"numberOfKeys",{get:function(){return mo.numberOfKeys},enumerable:!0,configurable:!0}),t}(),yo=function(){function t(){this._allKeys=new Map}return t.prototype.get=function(t){if(t instanceof ho)return t;if(this._allKeys.has(t))return this._allKeys.get(t);var e=new ho(t,ho.numberOfKeys);return this._allKeys.set(t,e),e},Object.defineProperty(t.prototype,"numberOfKeys",{get:function(){return this._allKeys.size},enumerable:!0,configurable:!0}),t}(),mo=new yo,go=Function,vo=/^function\s+\S+\(\)\s*{[\s\S]+\.apply\(this,\s*arguments\)/,bo=function(){function t(t){this._reflect=t||Vr.Reflect}return t.prototype.isReflectionEnabled=function(){return!0},t.prototype.factory=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return new(t.bind.apply(t,[void 0].concat(e)))}},t.prototype._zipTypesAndAnnotations=function(t,e){var n;n=void 0===t?new Array(e.length):new Array(t.length);for(var r=0;r<n.length;r++)void 0===t?n[r]=[]:t[r]!=Object?n[r]=[t[r]]:n[r]=[],e&&null!=e[r]&&(n[r]=n[r].concat(e[r]));return n},t.prototype._ownParameters=function(t,e){if(vo.exec(t.toString()))return null;if(t.parameters&&t.parameters!==e.parameters)return t.parameters;var n=t.ctorParameters;if(n&&n!==e.ctorParameters){var r="function"==typeof n?n():n,o=r.map(function(t){return t&&t.type}),i=r.map(function(t){return t&&M(t.decorators)});return this._zipTypesAndAnnotations(o,i)}if(null!=this._reflect&&null!=this._reflect.getOwnMetadata){var i=this._reflect.getOwnMetadata("parameters",t),o=this._reflect.getOwnMetadata("design:paramtypes",t);if(o||i)return this._zipTypesAndAnnotations(o,i)}return new Array(t.length).fill(void 0)},t.prototype.parameters=function(t){if(!R(t))return[];var e=V(t),n=this._ownParameters(t,e);return n||e===Object||(n=this.parameters(e)),n||[]},t.prototype._ownAnnotations=function(t,e){if(t.annotations&&t.annotations!==e.annotations){var n=t.annotations;return"function"==typeof n&&n.annotations&&(n=n.annotations),n}return t.decorators&&t.decorators!==e.decorators?M(t.decorators):this._reflect&&this._reflect.getOwnMetadata?this._reflect.getOwnMetadata("annotations",t):null},t.prototype.annotations=function(t){if(!R(t))return[];var e=V(t),n=this._ownAnnotations(t,e)||[];return(e!==Object?this.annotations(e):[]).concat(n)},t.prototype._ownPropMetadata=function(t,e){if(t.propMetadata&&t.propMetadata!==e.propMetadata){var n=t.propMetadata;return"function"==typeof n&&n.propMetadata&&(n=n.propMetadata),n}if(t.propDecorators&&t.propDecorators!==e.propDecorators){var r=t.propDecorators,o={};return Object.keys(r).forEach(function(t){o[t]=M(r[t])}),o}return this._reflect&&this._reflect.getOwnMetadata?this._reflect.getOwnMetadata("propMetadata",t):null},t.prototype.propMetadata=function(t){if(!R(t))return{};var e=V(t),n={};if(e!==Object){var r=this.propMetadata(e);Object.keys(r).forEach(function(t){n[t]=r[t]})}var o=this._ownPropMetadata(t,e);return o&&Object.keys(o).forEach(function(t){var e=[];n.hasOwnProperty(t)&&e.push.apply(e,n[t]),e.push.apply(e,o[t]),n[t]=e}),n},t.prototype.hasLifecycleHook=function(t,e){return t instanceof go&&e in t.prototype},t.prototype.getter=function(t){return new Function("o","return o."+t+";")},t.prototype.setter=function(t){return new Function("o","v","return o."+t+" = v;")},t.prototype.method=function(t){var e="if (!o."+t+") throw new Error('\""+t+"\" is undefined');\n return o."+t+".apply(o, args);";return new Function("o","args",e)},t.prototype.importUri=function(t){return"object"==typeof t&&t.filePath?t.filePath:"./"+s(t)},t.prototype.resourceUri=function(t){return"./"+s(t)},t.prototype.resolveIdentifier=function(t,e,n,r){return r},t.prototype.resolveEnum=function(t,e){return t[e]},t}(),_o=function(){function t(){}return t.prototype.parameters=function(t){},t.prototype.annotations=function(t){},t.prototype.propMetadata=function(t){},t.prototype.importUri=function(t){},t.prototype.resourceUri=function(t){},t.prototype.resolveIdentifier=function(t,e,n,r){},t.prototype.resolveEnum=function(t,e){},t}(),wo=function(t){function e(e){var n=t.call(this)||this;return n.reflectionCapabilities=e,n}return Sr(e,t),e.prototype.updateCapabilities=function(t){this.reflectionCapabilities=t},e.prototype.factory=function(t){return this.reflectionCapabilities.factory(t)},e.prototype.parameters=function(t){return this.reflectionCapabilities.parameters(t)},e.prototype.annotations=function(t){return this.reflectionCapabilities.annotations(t)},e.prototype.propMetadata=function(t){return this.reflectionCapabilities.propMetadata(t)},e.prototype.hasLifecycleHook=function(t,e){return this.reflectionCapabilities.hasLifecycleHook(t,e)},e.prototype.getter=function(t){return this.reflectionCapabilities.getter(t)},e.prototype.setter=function(t){return this.reflectionCapabilities.setter(t)},e.prototype.method=function(t){return this.reflectionCapabilities.method(t)},e.prototype.importUri=function(t){return this.reflectionCapabilities.importUri(t)},e.prototype.resourceUri=function(t){return this.reflectionCapabilities.resourceUri(t)},e.prototype.resolveIdentifier=function(t,e,n,r){return this.reflectionCapabilities.resolveIdentifier(t,e,n,r)},e.prototype.resolveEnum=function(t,e){return this.reflectionCapabilities.resolveEnum(t,e)},e}(_o),Co=new wo(new bo),Eo=function(){function t(t,e,n){this.key=t,this.optional=e,this.visibility=n}return t.fromKey=function(e){return new t(e,!1,null)},t}(),Oo=[],xo=function(){function t(t,e,n){this.key=t,this.resolvedFactories=e,this.multiProvider=n}return Object.defineProperty(t.prototype,"resolvedFactory",{get:function(){return this.resolvedFactories[0]},enumerable:!0,configurable:!0}),t}(),Po=function(){function t(t,e){this.factory=t,this.dependencies=e}return t}(),ko=new Object,So=function(){function t(){}return t.resolve=function(t){return I(t)},t.resolveAndCreate=function(e,n){var r=t.resolve(e);return t.fromResolvedProviders(r,n)},t.fromResolvedProviders=function(t,e){return new To(t,e)},t.prototype.parent=function(){},t.prototype.resolveAndCreateChild=function(t){},t.prototype.createChildFromResolved=function(t){},t.prototype.resolveAndInstantiate=function(t){},t.prototype.instantiateResolved=function(t){},t.prototype.get=function(t,e){},t}(),To=function(){function t(t,e){this._constructionCounter=0,this._providers=t,this._parent=e||null;var n=t.length;this.keyIds=new Array(n),this.objs=new Array(n);for(var r=0;r<n;r++)this.keyIds[r]=t[r].key.id,this.objs[r]=ko}return t.prototype.get=function(t,e){return void 0===e&&(e=so),this._getByKey(ho.get(t),null,e)},Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),t.prototype.resolveAndCreateChild=function(t){var e=So.resolve(t);return this.createChildFromResolved(e)},t.prototype.createChildFromResolved=function(e){var n=new t(e);return n._parent=this,n},t.prototype.resolveAndInstantiate=function(t){return this.instantiateResolved(So.resolve([t])[0])},t.prototype.instantiateResolved=function(t){return this._instantiateProvider(t)},t.prototype.getProviderAtIndex=function(t){if(t<0||t>=this._providers.length)throw A(t);return this._providers[t]},t.prototype._new=function(t){if(this._constructionCounter++>this._getMaxNumberOfObjects())throw P(this,t.key);return this._instantiateProvider(t)},t.prototype._getMaxNumberOfObjects=function(){return this.objs.length},t.prototype._instantiateProvider=function(t){if(t.multiProvider){for(var e=new Array(t.resolvedFactories.length),n=0;n<t.resolvedFactories.length;++n)e[n]=this._instantiate(t,t.resolvedFactories[n]);return e}return this._instantiate(t,t.resolvedFactories[0])},t.prototype._instantiate=function(t,e){var n,r=this,o=e.factory;try{n=e.dependencies.map(function(t){return r._getByReflectiveDependency(t)})}catch(e){throw e.addKey&&e.addKey(this,t.key),e}var i;try{i=o.apply(void 0,n)}catch(e){throw k(this,e,e.stack,t.key)}return i},t.prototype._getByReflectiveDependency=function(t){return this._getByKey(t.key,t.visibility,t.optional?null:so)},t.prototype._getByKey=function(t,e,n){return t===Ao?this:e instanceof no?this._getByKeySelf(t,n):this._getByKeyDefault(t,n,e)},t.prototype._getObjByKeyId=function(t){for(var e=0;e<this.keyIds.length;e++)if(this.keyIds[e]===t)return this.objs[e]===ko&&(this.objs[e]=this._new(this._providers[e])),this.objs[e];return ko},t.prototype._throwOrNull=function(t,e){if(e!==so)return e;throw x(this,t)},t.prototype._getByKeySelf=function(t,e){var n=this._getObjByKeyId(t.id);return n!==ko?n:this._throwOrNull(t,e)},t.prototype._getByKeyDefault=function(e,n,r){var o;for(o=r instanceof ro?this._parent:this;o instanceof t;){var i=o,s=i._getObjByKeyId(e.id);if(s!==ko)return s;o=i._parent}return null!==o?o.get(e.token,n):this._throwOrNull(e,n)},Object.defineProperty(t.prototype,"displayName",{get:function(){return"ReflectiveInjector(providers: ["+X(this,function(t){return' "'+t.key.displayName+'" '}).join(", ")+"])"},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this.displayName},t}(),Ao=ho.get(uo),Do=new Ar("Application Initializer"),Ro=function(){function t(t){var e=this;this._done=!1;var n=[];if(t)for(var r=0;r<t.length;r++){var o=t[r]();W(o)&&n.push(o)}this._donePromise=Promise.all(n).then(function(){e._done=!0}),0===n.length&&(this._done=!0)}return Object.defineProperty(t.prototype,"done",{get:function(){return this._done},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"donePromise",{get:function(){return this._donePromise},enumerable:!0,configurable:!0}),t}();Ro.decorators=[{type:eo}],Ro.ctorParameters=function(){return[{type:Array,decorators:[{type:$r,args:[Do]},{type:to}]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Mo=new Ar("AppId"),Vo={provide:Mo,useFactory:K,deps:[]},No=new Ar("Platform Initializer"),jo=new Ar("Platform ID"),Io=new Ar("appBootstrapListener"),Fo=(new Ar("Application Packages Root URL"),function(){function t(){}return t.prototype.log=function(t){console.log(t)},t.prototype.warn=function(t){console.warn(t)},t}());Fo.decorators=[{type:eo}],Fo.ctorParameters=function(){return[]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Ho=(function(){function t(t,e){this.ngModuleFactory=t,this.componentFactories=e}}(),function(){function t(){}return t.prototype.compileModuleSync=function(t){throw Z()},t.prototype.compileModuleAsync=function(t){throw Z()},t.prototype.compileModuleAndAllComponentsSync=function(t){throw Z()},t.prototype.compileModuleAndAllComponentsAsync=function(t){throw Z()},t.prototype.getNgContentSelectors=function(t){throw Z()},t.prototype.clearCache=function(){},t.prototype.clearCacheFor=function(t){},t}());Ho.decorators=[{type:eo}],Ho.ctorParameters=function(){return[]};var Lo=(new Ar("compilerOptions"),function(){function t(){}return t.prototype.createCompiler=function(t){},t}()),Uo=function(){function t(){}return t.prototype.location=function(){},t.prototype.injector=function(){},t.prototype.instance=function(){},t.prototype.hostView=function(){},t.prototype.changeDetectorRef=function(){},t.prototype.componentType=function(){},t.prototype.destroy=function(){},t.prototype.onDestroy=function(t){},t}(),zo=function(){function t(){}return t.prototype.selector=function(){},t.prototype.componentType=function(){},t.prototype.ngContentSelectors=function(){},t.prototype.inputs=function(){},t.prototype.outputs=function(){},t.prototype.create=function(t,e,n,r){},t}(),Bo="ngComponent",Xo=function(){function t(){}return t.prototype.resolveComponentFactory=function(t){throw Q(t)},t}(),Wo=function(){function t(){}return t.prototype.resolveComponentFactory=function(t){},t}();Wo.NULL=new Xo;var Go,Ko,qo=function(){function t(t,e,n){this._parent=e,this._ngModule=n,this._factories=new Map;for(var r=0;r<t.length;r++){var o=t[r];this._factories.set(o.componentType,o)}}return t.prototype.resolveComponentFactory=function(t){var e=this._factories.get(t)||this._parent.resolveComponentFactory(t);return new Zo(e,this._ngModule)},t}(),Zo=function(t){function e(e,n){var r=t.call(this)||this;return r.factory=e,r.ngModule=n,r}return Sr(e,t),Object.defineProperty(e.prototype,"selector",{get:function(){return this.factory.selector},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"componentType",{get:function(){return this.factory.componentType},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ngContentSelectors",{get:function(){return this.factory.ngContentSelectors},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"inputs",{get:function(){return this.factory.inputs},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){return this.factory.outputs},enumerable:!0,configurable:!0}),e.prototype.create=function(t,e,n,r){return this.factory.create(t,e,n,r||this.ngModule)},e}(zo),Qo=function(){function t(){}return t.prototype.injector=function(){},t.prototype.componentFactoryResolver=function(){},t.prototype.instance=function(){},t.prototype.destroy=function(){},t.prototype.onDestroy=function(t){},t}(),Jo=function(){function t(t,e){this._injectorClass=t,this._moduleType=e}return Object.defineProperty(t.prototype,"moduleType",{get:function(){return this._moduleType},enumerable:!0,configurable:!0}),t.prototype.create=function(t){var e=new this._injectorClass(t||uo.NULL);return e.create(),e},t}(),Yo=new Object,$o=function(){function t(t,e,n){var r=this;this.parent=t,this._destroyListeners=[],this._destroyed=!1,this.bootstrapFactories=n.map(function(t){return new Zo(t,r)}),this._cmpFactoryResolver=new qo(e,t.get(Wo,Wo.NULL),this)}return t.prototype.create=function(){this.instance=this.createInternal()},t.prototype.createInternal=function(){},t.prototype.get=function(t,e){if(void 0===e&&(e=so),t===uo||t===Qo)return this;if(t===Wo)return this._cmpFactoryResolver;var n=this.getInternal(t,Yo);return n===Yo?this.parent.get(t,e):n},t.prototype.getInternal=function(t,e){},Object.defineProperty(t.prototype,"injector",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentFactoryResolver",{get:function(){return this._cmpFactoryResolver},enumerable:!0,configurable:!0}),t.prototype.destroy=function(){if(this._destroyed)throw new Error("The ng module "+s(this.instance.constructor)+" has already been destroyed.");this._destroyed=!0,this.destroyInternal(),this._destroyListeners.forEach(function(t){return t()})},t.prototype.onDestroy=function(t){this._destroyListeners.push(t)},t.prototype.destroyInternal=function(){},t}(),ti=J(),ei=ti?Y:function(t,e){return tt},ni=ti?$:function(t,e){return e},ri=function(t){function e(e){void 0===e&&(e=!1);var n=t.call(this)||this;return n.__isAsync=e,n}return Sr(e,t),e.prototype.emit=function(e){t.prototype.next.call(this,e)},e.prototype.subscribe=function(e,n,r){var o,i=function(t){return null},s=function(){return null};return e&&"object"==typeof e?(o=this.__isAsync?function(t){setTimeout(function(){return e.next(t)})}:function(t){e.next(t)},e.error&&(i=this.__isAsync?function(t){setTimeout(function(){return e.error(t)})}:function(t){e.error(t)}),e.complete&&(s=this.__isAsync?function(){setTimeout(function(){return e.complete()})}:function(){e.complete()})):(o=this.__isAsync?function(t){setTimeout(function(){return e(t)})}:function(t){e(t)},n&&(i=this.__isAsync?function(t){setTimeout(function(){return n(t)})}:function(t){n(t)}),r&&(s=this.__isAsync?function(){setTimeout(function(){return r()})}:function(){r()})),t.prototype.subscribe.call(this,o,i,s)},e}(kr.Subject),oi=function(){function t(t){var e=t.enableLongStackTrace,n=void 0!==e&&e;if(this._hasPendingMicrotasks=!1,this._hasPendingMacrotasks=!1,this._isStable=!0,this._nesting=0,this._onUnstable=new ri(!1),this._onMicrotaskEmpty=new ri(!1),this._onStable=new ri(!1),this._onErrorEvents=new ri(!1),"undefined"==typeof Zone)throw new Error("Angular requires Zone.js prolyfill.");Zone.assertZonePatched(),this.outer=this.inner=Zone.current,Zone.wtfZoneSpec&&(this.inner=this.inner.fork(Zone.wtfZoneSpec)),n&&Zone.longStackTraceZoneSpec&&(this.inner=this.inner.fork(Zone.longStackTraceZoneSpec)),this.forkInnerZoneWithAngularBehavior()}return t.isInAngularZone=function(){return!0===Zone.current.get("isAngularZone")},t.assertInAngularZone=function(){if(!t.isInAngularZone())throw new Error("Expected to be in Angular Zone, but it is not!")},t.assertNotInAngularZone=function(){if(t.isInAngularZone())throw new Error("Expected to not be in Angular Zone, but it is!")},t.prototype.run=function(t){return this.inner.run(t)},t.prototype.runGuarded=function(t){return this.inner.runGuarded(t)},t.prototype.runOutsideAngular=function(t){return this.outer.run(t)},Object.defineProperty(t.prototype,"onUnstable",{get:function(){return this._onUnstable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onMicrotaskEmpty",{get:function(){return this._onMicrotaskEmpty},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onStable",{get:function(){return this._onStable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"onError",{get:function(){return this._onErrorEvents},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isStable",{get:function(){return this._isStable},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasPendingMicrotasks",{get:function(){return this._hasPendingMicrotasks},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hasPendingMacrotasks",{get:function(){return this._hasPendingMacrotasks},enumerable:!0,configurable:!0}),t.prototype.checkStable=function(){var t=this;if(0==this._nesting&&!this._hasPendingMicrotasks&&!this._isStable)try{this._nesting++,this._onMicrotaskEmpty.emit(null)}finally{if(this._nesting--,!this._hasPendingMicrotasks)try{this.runOutsideAngular(function(){return t._onStable.emit(null)})}finally{this._isStable=!0}}},t.prototype.forkInnerZoneWithAngularBehavior=function(){var t=this;this.inner=this.inner.fork({name:"angular",properties:{isAngularZone:!0},onInvokeTask:function(e,n,r,o,i,s){try{return t.onEnter(),e.invokeTask(r,o,i,s)}finally{t.onLeave()}},onInvoke:function(e,n,r,o,i,s,a){try{return t.onEnter(),e.invoke(r,o,i,s,a)}finally{t.onLeave()}},onHasTask:function(e,n,r,o){e.hasTask(r,o),n===r&&("microTask"==o.change?t.setHasMicrotask(o.microTask):"macroTask"==o.change&&t.setHasMacrotask(o.macroTask))},onHandleError:function(e,n,r,o){return e.handleError(r,o),t.triggerError(o),!1}})},t.prototype.onEnter=function(){this._nesting++,this._isStable&&(this._isStable=!1,this._onUnstable.emit(null))},t.prototype.onLeave=function(){this._nesting--,this.checkStable()},t.prototype.setHasMicrotask=function(t){this._hasPendingMicrotasks=t,this.checkStable()},t.prototype.setHasMacrotask=function(t){this._hasPendingMacrotasks=t},t.prototype.triggerError=function(t){this._onErrorEvents.emit(t)},t}(),ii=function(){function t(t){this._ngZone=t,this._pendingCount=0,this._isZoneStable=!0,this._didWork=!1,this._callbacks=[],this._watchAngularEvents()}return t.prototype._watchAngularEvents=function(){var t=this;this._ngZone.onUnstable.subscribe({next:function(){t._didWork=!0,t._isZoneStable=!1}}),this._ngZone.runOutsideAngular(function(){t._ngZone.onStable.subscribe({next:function(){oi.assertNotInAngularZone(),o(function(){t._isZoneStable=!0,t._runCallbacksIfReady()})}})})},t.prototype.increasePendingRequestCount=function(){return this._pendingCount+=1,this._didWork=!0,this._pendingCount},t.prototype.decreasePendingRequestCount=function(){if(this._pendingCount-=1,this._pendingCount<0)throw new Error("pending async requests below zero");return this._runCallbacksIfReady(),this._pendingCount},t.prototype.isStable=function(){return this._isZoneStable&&0==this._pendingCount&&!this._ngZone.hasPendingMacrotasks},t.prototype._runCallbacksIfReady=function(){var t=this;this.isStable()?o(function(){for(;0!==t._callbacks.length;)t._callbacks.pop()(t._didWork);t._didWork=!1}):this._didWork=!0},t.prototype.whenStable=function(t){this._callbacks.push(t),this._runCallbacksIfReady()},t.prototype.getPendingRequestCount=function(){return this._pendingCount},t.prototype.findBindings=function(t,e,n){return[]},t.prototype.findProviders=function(t,e,n){return[]},t}();ii.decorators=[{type:eo}],ii.ctorParameters=function(){return[{type:oi}]};var si=function(){function t(){this._applications=new Map,ci.addToWindow(this)}return t.prototype.registerApplication=function(t,e){this._applications.set(t,e)},t.prototype.getTestability=function(t){return this._applications.get(t)||null},t.prototype.getAllTestabilities=function(){return Array.from(this._applications.values())},t.prototype.getAllRootElements=function(){return Array.from(this._applications.keys())},t.prototype.findTestabilityInTree=function(t,e){return void 0===e&&(e=!0),ci.findTestabilityInTree(this,t,e)},t}();si.decorators=[{type:eo}],si.ctorParameters=function(){return[]};var ai,ui=function(){function t(){}return t.prototype.addToWindow=function(t){},t.prototype.findTestabilityInTree=function(t,e,n){return null},t}(),ci=new ui,li=!0,pi=!1,fi=new Ar("AllowMultipleToken"),hi=function(){function t(t,e){this.name=t,this.token=e}return t}(),di=function(){function t(){}return t.prototype.bootstrapModuleFactory=function(t){},t.prototype.bootstrapModule=function(t,e){},t.prototype.onDestroy=function(t){},t.prototype.injector=function(){},t.prototype.destroy=function(){},t.prototype.destroyed=function(){},t}(),yi=function(t){function e(e){var n=t.call(this)||this;return n._injector=e,n._modules=[],n._destroyListeners=[],n._destroyed=!1,n}return Sr(e,t),e.prototype.onDestroy=function(t){this._destroyListeners.push(t)},Object.defineProperty(e.prototype,"injector",{get:function(){return this._injector},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"destroyed",{get:function(){return this._destroyed},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(t){return t.destroy()}),this._destroyListeners.forEach(function(t){return t()}),this._destroyed=!0},e.prototype.bootstrapModuleFactory=function(t){return this._bootstrapModuleFactoryWithZone(t)},e.prototype._bootstrapModuleFactoryWithZone=function(t,e){var n=this;return e||(e=new oi({enableLongStackTrace:rt()})),e.run(function(){var r=So.resolveAndCreate([{provide:oi,useValue:e}],n.injector),o=t.create(r),i=o.injector.get(fo,null);if(!i)throw new Error("No ErrorHandler. Is platform module (BrowserModule) included?");return o.onDestroy(function(){return ct(n._modules,o)}),e.onError.subscribe({next:function(t){i.handleError(t)}}),ut(i,function(){return o.injector.get(Ro).donePromise.then(function(){return n._moduleDoBootstrap(o),o})})})},e.prototype.bootstrapModule=function(t,e){return void 0===e&&(e=[]),this._bootstrapModuleWithZone(t,e)},e.prototype._bootstrapModuleWithZone=function(t,e,n){var r=this;return void 0===e&&(e=[]),this.injector.get(Lo).createCompiler(Array.isArray(e)?e:[e]).compileModuleAsync(t).then(function(t){return r._bootstrapModuleFactoryWithZone(t,n)})},e.prototype._moduleDoBootstrap=function(t){var e=t.injector.get(mi);if(t.bootstrapFactories.length>0)t.bootstrapFactories.forEach(function(t){return e.bootstrap(t)});else{if(!t.instance.ngDoBootstrap)throw new Error("The module "+s(t.instance.constructor)+' was bootstrapped, but it does not declare "@NgModule.bootstrap" components nor a "ngDoBootstrap" method. Please define one of these.');t.instance.ngDoBootstrap(e)}this._modules.push(t)},e}(di);yi.decorators=[{type:eo}],yi.ctorParameters=function(){return[{type:uo}]};var mi=function(){function t(){}return t.prototype.bootstrap=function(t){},t.prototype.tick=function(){},t.prototype.componentTypes=function(){},t.prototype.components=function(){},t.prototype.attachView=function(t){},t.prototype.detachView=function(t){},t.prototype.viewCount=function(){},t.prototype.isStable=function(){},t}(),gi=function(t){function e(e,r,i,s,a,u){var c=t.call(this)||this;c._zone=e,c._console=r,c._injector=i,c._exceptionHandler=s,c._componentFactoryResolver=a,c._initStatus=u,c._bootstrapListeners=[],c._rootComponents=[],c._rootComponentTypes=[],c._views=[],c._runningTick=!1,c._enforceNoNewChanges=!1,c._stable=!0,c._enforceNoNewChanges=rt(),c._zone.onMicrotaskEmpty.subscribe({next:function(){c._zone.run(function(){c.tick()})}});var l=new Or.Observable(function(t){c._stable=c._zone.isStable&&!c._zone.hasPendingMacrotasks&&!c._zone.hasPendingMicrotasks,c._zone.runOutsideAngular(function(){t.next(c._stable),t.complete()})}),p=new Or.Observable(function(t){var e=c._zone.onStable.subscribe(function(){oi.assertNotInAngularZone(),o(function(){c._stable||c._zone.hasPendingMacrotasks||c._zone.hasPendingMicrotasks||(c._stable=!0,t.next(!0))})}),n=c._zone.onUnstable.subscribe(function(){oi.assertInAngularZone(),c._stable&&(c._stable=!1,c._zone.runOutsideAngular(function(){t.next(!1)}))});return function(){e.unsubscribe(),n.unsubscribe()}});return c._isStable=n.i(xr.merge)(l,Pr.share.call(p)),c}return Sr(e,t),e.prototype.attachView=function(t){var e=t;this._views.push(e),e.attachToAppRef(this)},e.prototype.detachView=function(t){var e=t;ct(this._views,e),e.detachFromAppRef()},e.prototype.bootstrap=function(t){var e=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.");var n;n=t instanceof zo?t:this._componentFactoryResolver.resolveComponentFactory(t),this._rootComponentTypes.push(n.componentType);var r=n instanceof Zo?null:this._injector.get(Qo),o=n.create(uo.NULL,[],n.selector,r);o.onDestroy(function(){e._unloadComponent(o)});var i=o.injector.get(ii,null);return i&&o.injector.get(si).registerApplication(o.location.nativeElement,i),this._loadComponent(o),rt()&&this._console.log("Angular is running in the development mode. Call enableProdMode() to enable the production mode."),o},e.prototype._loadComponent=function(t){this.attachView(t.hostView),this.tick(),this._rootComponents.push(t),this._injector.get(Io,[]).concat(this._bootstrapListeners).forEach(function(e){return e(t)})},e.prototype._unloadComponent=function(t){this.detachView(t.hostView),ct(this._rootComponents,t)},e.prototype.tick=function(){if(this._runningTick)throw new Error("ApplicationRef.tick is called recursively");var t=e._tickScope();try{this._runningTick=!0,this._views.forEach(function(t){return t.detectChanges()}),this._enforceNoNewChanges&&this._views.forEach(function(t){return t.checkNoChanges()})}catch(t){this._exceptionHandler.handleError(t)}finally{this._runningTick=!1,ni(t)}},e.prototype.ngOnDestroy=function(){this._views.slice().forEach(function(t){return t.destroy()})},Object.defineProperty(e.prototype,"viewCount",{get:function(){return this._views.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"componentTypes",{get:function(){return this._rootComponentTypes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"components",{get:function(){return this._rootComponents},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isStable",{get:function(){return this._isStable},enumerable:!0,configurable:!0}),e}(mi);gi._tickScope=ei("ApplicationRef#tick()"),gi.decorators=[{type:eo}],gi.ctorParameters=function(){return[{type:oi},{type:Fo},{type:uo},{type:fo},{type:Wo},{type:Ro}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var vi=(function(){function t(t,e,n,r,o,i){this.id=t,this.templateUrl=e,this.slotCount=n,this.encapsulation=r,this.styles=o,this.animations=i}}(),function(){function t(){}t.prototype.injector=function(){},t.prototype.component=function(){},t.prototype.providerTokens=function(){},t.prototype.references=function(){},t.prototype.context=function(){},t.prototype.source=function(){}}(),function(){function t(){}return t.prototype.selectRootElement=function(t,e){},t.prototype.createElement=function(t,e,n){},t.prototype.createViewRoot=function(t){},t.prototype.createTemplateAnchor=function(t,e){},t.prototype.createText=function(t,e,n){},t.prototype.projectNodes=function(t,e){},t.prototype.attachViewAfter=function(t,e){},t.prototype.detachView=function(t){},t.prototype.destroyView=function(t,e){},t.prototype.listen=function(t,e,n){},t.prototype.listenGlobal=function(t,e,n){},t.prototype.setElementProperty=function(t,e,n){},t.prototype.setElementAttribute=function(t,e,n){},t.prototype.setBindingDebugInfo=function(t,e,n){},t.prototype.setElementClass=function(t,e,n){},t.prototype.setElementStyle=function(t,e,n){},t.prototype.invokeElementMethod=function(t,e,n){},t.prototype.setText=function(t,e){},t.prototype.animate=function(t,e,n,r,o,i,s){},t}()),bi=(new Ar("Renderer2Interceptor"),function(){function t(){}t.prototype.renderComponent=function(t){}}(),function(){function t(){}return t.prototype.createRenderer=function(t,e){},t}()),_i={};_i.Important=1,_i.DashCase=2,_i[_i.Important]="Important",_i[_i.DashCase]="DashCase";var wi=function(){function t(){}return t.prototype.data=function(){},t.prototype.destroy=function(){},t.prototype.createElement=function(t,e){},t.prototype.createComment=function(t){},t.prototype.createText=function(t){},t.prototype.appendChild=function(t,e){},t.prototype.insertBefore=function(t,e,n){},t.prototype.removeChild=function(t,e){},t.prototype.selectRootElement=function(t){},t.prototype.parentNode=function(t){},t.prototype.nextSibling=function(t){},t.prototype.setAttribute=function(t,e,n,r){},t.prototype.removeAttribute=function(t,e,n){},t.prototype.addClass=function(t,e){},t.prototype.removeClass=function(t,e){},t.prototype.setStyle=function(t,e,n,r){},t.prototype.removeStyle=function(t,e,n){},t.prototype.setProperty=function(t,e,n){},t.prototype.setValue=function(t,e){},t.prototype.listen=function(t,e,n){},t}(),Ci=function(){function t(t){this.nativeElement=t}return t}(),Ei=(function(){function t(){}t.prototype.load=function(t){}}(),new Map,function(){function t(){this._dirty=!0,this._results=[],this._emitter=new ri}return Object.defineProperty(t.prototype,"changes",{get:function(){return this._emitter},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._results.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"first",{get:function(){return this._results[0]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"last",{get:function(){return this._results[this.length-1]},enumerable:!0,configurable:!0}),t.prototype.map=function(t){return this._results.map(t)},t.prototype.filter=function(t){return this._results.filter(t)},t.prototype.find=function(t){return this._results.find(t)},t.prototype.reduce=function(t,e){return this._results.reduce(t,e)},t.prototype.forEach=function(t){this._results.forEach(t)},t.prototype.some=function(t){return this._results.some(t)},t.prototype.toArray=function(){return this._results.slice()},t.prototype[r()]=function(){return this._results[r()]()},t.prototype.toString=function(){return this._results.toString()},t.prototype.reset=function(t){this._results=lt(t),this._dirty=!1},t.prototype.notifyOnChanges=function(){this._emitter.emit(this)},t.prototype.setDirty=function(){this._dirty=!0},Object.defineProperty(t.prototype,"dirty",{get:function(){return this._dirty},enumerable:!0,configurable:!0}),t}()),Oi="#",xi="NgFactory",Pi=function(){function t(){}return t}(),ki={factoryPathPrefix:"",factoryPathSuffix:".ngfactory"},Si=function(){function t(t,e){this._compiler=t,this._config=e||ki}return t.prototype.load=function(t){return this._compiler instanceof Ho?this.loadFactory(t):this.loadAndCompile(t)},t.prototype.loadAndCompile=function(t){var e=this,r=t.split(Oi),o=r[0],i=r[1];return void 0===i&&(i="default"),n("/fcW")(o).then(function(t){return t[i]}).then(function(t){return pt(t,o,i)}).then(function(t){return e._compiler.compileModuleAsync(t)})},t.prototype.loadFactory=function(t){var e=t.split(Oi),r=e[0],o=e[1],i=xi;return void 0===o&&(o="default",i=""),n("/fcW")(this._config.factoryPathPrefix+r+this._config.factoryPathSuffix).then(function(t){return t[o+i]}).then(function(t){return pt(t,r,o)})},t}();Si.decorators=[{type:eo}],Si.ctorParameters=function(){return[{type:Ho},{type:Pi,decorators:[{type:to}]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Ti=function(){function t(){}return t.prototype.elementRef=function(){},t.prototype.createEmbeddedView=function(t){},t}(),Ai=function(){function t(){}return t.prototype.element=function(){},t.prototype.injector=function(){},t.prototype.parentInjector=function(){},t.prototype.clear=function(){},t.prototype.get=function(t){},t.prototype.length=function(){},t.prototype.createEmbeddedView=function(t,e,n){},t.prototype.createComponent=function(t,e,n,r,o){},t.prototype.insert=function(t,e){},t.prototype.move=function(t,e){},t.prototype.indexOf=function(t){},t.prototype.remove=function(t){},t.prototype.detach=function(t){},t}(),Di=function(){function t(){}return t.prototype.markForCheck=function(){},t.prototype.detach=function(){},t.prototype.detectChanges=function(){},t.prototype.checkNoChanges=function(){},t.prototype.reattach=function(){},t}(),Ri=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Sr(e,t),e.prototype.destroy=function(){},e.prototype.destroyed=function(){},e.prototype.onDestroy=function(t){},e}(Di),Mi=(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}Sr(e,t),e.prototype.context=function(){},e.prototype.rootNodes=function(){}}(Ri),function(){function t(t,e){this.name=t,this.callback=e}return t}()),Vi=function(){function t(t,e,n){this._debugContext=n,this.nativeNode=t,e&&e instanceof Ni?e.addChild(this):this.parent=null,this.listeners=[]}return Object.defineProperty(t.prototype,"injector",{get:function(){return this._debugContext.injector},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentInstance",{get:function(){return this._debugContext.component},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{get:function(){return this._debugContext.context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"references",{get:function(){return this._debugContext.references},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"providerTokens",{get:function(){return this._debugContext.providerTokens},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"source",{get:function(){return"Deprecated since v4"},enumerable:!0,configurable:!0}),t}(),Ni=function(t){function e(e,n,r){var o=t.call(this,e,n,r)||this;return o.properties={},o.attributes={},o.classes={},o.styles={},o.childNodes=[],o.nativeElement=e,o}return Sr(e,t),e.prototype.addChild=function(t){t&&(this.childNodes.push(t),t.parent=this)},e.prototype.removeChild=function(t){var e=this.childNodes.indexOf(t);-1!==e&&(t.parent=null,this.childNodes.splice(e,1))},e.prototype.insertChildrenAfter=function(t,e){var n=this,r=this.childNodes.indexOf(t);-1!==r&&((o=this.childNodes).splice.apply(o,[r+1,0].concat(e)),e.forEach(function(t){t.parent&&t.parent.removeChild(t),t.parent=n}));var o},e.prototype.insertBefore=function(t,e){var n=this.childNodes.indexOf(t);-1===n?this.addChild(e):(e.parent&&e.parent.removeChild(e),e.parent=this,this.childNodes.splice(n,0,e))},e.prototype.query=function(t){return this.queryAll(t)[0]||null},e.prototype.queryAll=function(t){var e=[];return ft(this,t,e),e},e.prototype.queryAllNodes=function(t){var e=[];return ht(this,t,e),e},Object.defineProperty(e.prototype,"children",{get:function(){return this.childNodes.filter(function(t){return t instanceof e})},enumerable:!0,configurable:!0}),e.prototype.triggerEventHandler=function(t,e){this.listeners.forEach(function(n){n.name==t&&n.callback(e)})},e}(Vi),ji=new Map,Ii=function(){function t(t){this.wrapped=t}return t.wrap=function(e){return new t(e)},t}(),Fi=(function(){function t(){this.hasWrappedValue=!1}t.prototype.unwrap=function(t){return t instanceof Ii?(this.hasWrappedValue=!0,t.wrapped):t},t.prototype.reset=function(){this.hasWrappedValue=!1}}(),function(){function t(t,e,n){this.previousValue=t,this.currentValue=e,this.firstChange=n}return t.prototype.isFirstChange=function(){return this.firstChange},t}()),Hi=function(){function t(){}return t.prototype.supports=function(t){return vt(t)},t.prototype.create=function(t,e){return new Ui(e||t)},t}(),Li=function(t,e){return e},Ui=function(){function t(t){this._length=0,this._collection=null,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=t||Li}return Object.defineProperty(t.prototype,"collection",{get:function(){return this._collection},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),t.prototype.forEachItem=function(t){var e;for(e=this._itHead;null!==e;e=e._next)t(e)},t.prototype.forEachOperation=function(t){for(var e=this._itHead,n=this._removalsHead,r=0,o=null;e||n;){var i=!n||e&&e.currentIndex<Ct(n,r,o)?e:n,s=Ct(i,r,o),a=i.currentIndex;if(i===n)r--,n=n._nextRemoved;else if(e=e._next,null==i.previousIndex)r++;else{o||(o=[]);var u=s-r,c=a-r;if(u!=c){for(var l=0;l<u;l++){var p=l<o.length?o[l]:o[l]=0,f=p+l;c<=f&&f<u&&(o[l]=p+1)}var h=i.previousIndex;o[h]=c-u}}s!==a&&t(i,s,a)}},t.prototype.forEachPreviousItem=function(t){var e;for(e=this._previousItHead;null!==e;e=e._nextPrevious)t(e)},t.prototype.forEachAddedItem=function(t){var e;for(e=this._additionsHead;null!==e;e=e._nextAdded)t(e)},t.prototype.forEachMovedItem=function(t){var e;for(e=this._movesHead;null!==e;e=e._nextMoved)t(e)},t.prototype.forEachRemovedItem=function(t){var e;for(e=this._removalsHead;null!==e;e=e._nextRemoved)t(e)},t.prototype.forEachIdentityChange=function(t){var e;for(e=this._identityChangesHead;null!==e;e=e._nextIdentityChange)t(e)},t.prototype.diff=function(t){if(null==t&&(t=[]),!vt(t))throw new Error("Error trying to diff '"+s(t)+"'. Only arrays and iterables are allowed");return this.check(t)?this:null},t.prototype.onDestroy=function(){},t.prototype.check=function(t){var e=this;this._reset();var n,r,o,s=this._itHead,a=!1;if(Array.isArray(t)){this._length=t.length;for(var u=0;u<this._length;u++)r=t[u],o=this._trackByFn(u,r),null!==s&&i(s.trackById,o)?(a&&(s=this._verifyReinsertion(s,r,o,u)),i(s.item,r)||this._addIdentityChange(s,r)):(s=this._mismatch(s,r,o,u),a=!0),s=s._next}else n=0,_t(t,function(t){o=e._trackByFn(n,t),null!==s&&i(s.trackById,o)?(a&&(s=e._verifyReinsertion(s,t,o,n)),i(s.item,t)||e._addIdentityChange(s,t)):(s=e._mismatch(s,t,o,n),a=!0),s=s._next,n++}),this._length=n;return this._truncate(s),this._collection=t,this.isDirty},Object.defineProperty(t.prototype,"isDirty",{get:function(){return null!==this._additionsHead||null!==this._movesHead||null!==this._removalsHead||null!==this._identityChangesHead},enumerable:!0,configurable:!0}),t.prototype._reset=function(){if(this.isDirty){var t=void 0,e=void 0;for(t=this._previousItHead=this._itHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._additionsHead;null!==t;t=t._nextAdded)t.previousIndex=t.currentIndex;for(this._additionsHead=this._additionsTail=null,t=this._movesHead;null!==t;t=e)t.previousIndex=t.currentIndex,e=t._nextMoved;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}},t.prototype._mismatch=function(t,e,n,r){var o;return null===t?o=this._itTail:(o=t._prev,this._remove(t)),t=null===this._linkedRecords?null:this._linkedRecords.get(n,r),null!==t?(i(t.item,e)||this._addIdentityChange(t,e),this._moveAfter(t,o,r)):(t=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null),null!==t?(i(t.item,e)||this._addIdentityChange(t,e),this._reinsertAfter(t,o,r)):t=this._addAfter(new zi(e,n),o,r)),t},t.prototype._verifyReinsertion=function(t,e,n,r){var o=null===this._unlinkedRecords?null:this._unlinkedRecords.get(n,null);return null!==o?t=this._reinsertAfter(o,t._prev,r):t.currentIndex!=r&&(t.currentIndex=r,this._addToMoves(t,r)),t},t.prototype._truncate=function(t){for(;null!==t;){var e=t._next;this._addToRemovals(this._unlink(t)),t=e}null!==this._unlinkedRecords&&this._unlinkedRecords.clear(),null!==this._additionsTail&&(this._additionsTail._nextAdded=null),null!==this._movesTail&&(this._movesTail._nextMoved=null),null!==this._itTail&&(this._itTail._next=null),null!==this._removalsTail&&(this._removalsTail._nextRemoved=null),null!==this._identityChangesTail&&(this._identityChangesTail._nextIdentityChange=null)},t.prototype._reinsertAfter=function(t,e,n){null!==this._unlinkedRecords&&this._unlinkedRecords.remove(t);var r=t._prevRemoved,o=t._nextRemoved;return null===r?this._removalsHead=o:r._nextRemoved=o,null===o?this._removalsTail=r:o._prevRemoved=r,this._insertAfter(t,e,n),this._addToMoves(t,n),t},t.prototype._moveAfter=function(t,e,n){return this._unlink(t),this._insertAfter(t,e,n),this._addToMoves(t,n),t},t.prototype._addAfter=function(t,e,n){return this._insertAfter(t,e,n),null===this._additionsTail?this._additionsTail=this._additionsHead=t:this._additionsTail=this._additionsTail._nextAdded=t,t},t.prototype._insertAfter=function(t,e,n){var r=null===e?this._itHead:e._next;return t._next=r,t._prev=e,null===r?this._itTail=t:r._prev=t,null===e?this._itHead=t:e._next=t,null===this._linkedRecords&&(this._linkedRecords=new Xi),this._linkedRecords.put(t),t.currentIndex=n,t},t.prototype._remove=function(t){return this._addToRemovals(this._unlink(t))},t.prototype._unlink=function(t){null!==this._linkedRecords&&this._linkedRecords.remove(t);var e=t._prev,n=t._next;return null===e?this._itHead=n:e._next=n,null===n?this._itTail=e:n._prev=e,t},t.prototype._addToMoves=function(t,e){return t.previousIndex===e?t:(null===this._movesTail?this._movesTail=this._movesHead=t:this._movesTail=this._movesTail._nextMoved=t,t)},t.prototype._addToRemovals=function(t){return null===this._unlinkedRecords&&(this._unlinkedRecords=new Xi),this._unlinkedRecords.put(t),t.currentIndex=null,t._nextRemoved=null,null===this._removalsTail?(this._removalsTail=this._removalsHead=t,t._prevRemoved=null):(t._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=t),t},t.prototype._addIdentityChange=function(t,e){return t.item=e,null===this._identityChangesTail?this._identityChangesTail=this._identityChangesHead=t:this._identityChangesTail=this._identityChangesTail._nextIdentityChange=t,t},t.prototype.toString=function(){var t=[];this.forEachItem(function(e){return t.push(e)});var e=[];this.forEachPreviousItem(function(t){return e.push(t)});var n=[];this.forEachAddedItem(function(t){return n.push(t)});var r=[];this.forEachMovedItem(function(t){return r.push(t)});var o=[];this.forEachRemovedItem(function(t){return o.push(t)});var i=[];return this.forEachIdentityChange(function(t){return i.push(t)}),"collection: "+t.join(", ")+"\nprevious: "+e.join(", ")+"\nadditions: "+n.join(", ")+"\nmoves: "+r.join(", ")+"\nremovals: "+o.join(", ")+"\nidentityChanges: "+i.join(", ")+"\n"},t}(),zi=function(){function t(t,e){this.item=t,this.trackById=e,this.currentIndex=null,this.previousIndex=null,this._nextPrevious=null,this._prev=null,this._next=null,this._prevDup=null,this._nextDup=null,this._prevRemoved=null,this._nextRemoved=null,this._nextAdded=null,this._nextMoved=null,this._nextIdentityChange=null}return t.prototype.toString=function(){return this.previousIndex===this.currentIndex?s(this.item):s(this.item)+"["+s(this.previousIndex)+"->"+s(this.currentIndex)+"]"},t}(),Bi=function(){function t(){this._head=null,this._tail=null}return t.prototype.add=function(t){null===this._head?(this._head=this._tail=t,t._nextDup=null,t._prevDup=null):(this._tail._nextDup=t,t._prevDup=this._tail,t._nextDup=null,this._tail=t)},t.prototype.get=function(t,e){var n;for(n=this._head;null!==n;n=n._nextDup)if((null===e||e<n.currentIndex)&&i(n.trackById,t))return n;return null},t.prototype.remove=function(t){var e=t._prevDup,n=t._nextDup;return null===e?this._head=n:e._nextDup=n,null===n?this._tail=e:n._prevDup=e,null===this._head},t}(),Xi=function(){function t(){this.map=new Map}return t.prototype.put=function(t){var e=t.trackById,n=this.map.get(e);n||(n=new Bi,this.map.set(e,n)),n.add(t)},t.prototype.get=function(t,e){var n=t,r=this.map.get(n);return r?r.get(t,e):null},t.prototype.remove=function(t){var e=t.trackById;return this.map.get(e).remove(t)&&this.map.delete(e),t},Object.defineProperty(t.prototype,"isEmpty",{get:function(){return 0===this.map.size},enumerable:!0,configurable:!0}),t.prototype.clear=function(){this.map.clear()},t.prototype.toString=function(){return"_DuplicateMap("+s(this.map)+")"},t}(),Wi=function(){function t(){}return t.prototype.supports=function(t){return t instanceof Map||wt(t)},t.prototype.create=function(t){return new Gi},t}(),Gi=function(){function t(){this._records=new Map,this._mapHead=null,this._appendAfter=null,this._previousMapHead=null,this._changesHead=null,this._changesTail=null,this._additionsHead=null,this._additionsTail=null,this._removalsHead=null,this._removalsTail=null}return Object.defineProperty(t.prototype,"isDirty",{get:function(){return null!==this._additionsHead||null!==this._changesHead||null!==this._removalsHead},enumerable:!0,configurable:!0}),t.prototype.forEachItem=function(t){var e;for(e=this._mapHead;null!==e;e=e._next)t(e)},t.prototype.forEachPreviousItem=function(t){var e;for(e=this._previousMapHead;null!==e;e=e._nextPrevious)t(e)},t.prototype.forEachChangedItem=function(t){var e;for(e=this._changesHead;null!==e;e=e._nextChanged)t(e)},t.prototype.forEachAddedItem=function(t){var e;for(e=this._additionsHead;null!==e;e=e._nextAdded)t(e)},t.prototype.forEachRemovedItem=function(t){var e;for(e=this._removalsHead;null!==e;e=e._nextRemoved)t(e)},t.prototype.diff=function(t){if(t){if(!(t instanceof Map||wt(t)))throw new Error("Error trying to diff '"+s(t)+"'. Only maps and objects are allowed")}else t=new Map;return this.check(t)?this:null},t.prototype.onDestroy=function(){},t.prototype.check=function(t){var e=this;this._reset();var n=this._mapHead;if(this._appendAfter=null,this._forEach(t,function(t,r){if(n&&n.key===r)e._maybeAddToChanges(n,t),e._appendAfter=n,n=n._next;else{var o=e._getOrCreateRecordForKey(r,t);n=e._insertBeforeOrAppend(n,o)}}),n){n._prev&&(n._prev._next=null),this._removalsHead=n;for(var r=n;null!==r;r=r._nextRemoved)r===this._mapHead&&(this._mapHead=null),this._records.delete(r.key),r._nextRemoved=r._next,r.previousValue=r.currentValue,r.currentValue=null,r._prev=null,r._next=null}return this._changesTail&&(this._changesTail._nextChanged=null),this._additionsTail&&(this._additionsTail._nextAdded=null),this.isDirty},t.prototype._insertBeforeOrAppend=function(t,e){if(t){var n=t._prev;return e._next=t,e._prev=n,t._prev=e,n&&(n._next=e),t===this._mapHead&&(this._mapHead=e),this._appendAfter=t,t}return this._appendAfter?(this._appendAfter._next=e,e._prev=this._appendAfter):this._mapHead=e,this._appendAfter=e,null},t.prototype._getOrCreateRecordForKey=function(t,e){if(this._records.has(t)){var n=this._records.get(t);this._maybeAddToChanges(n,e);var r=n._prev,o=n._next;return r&&(r._next=o),o&&(o._prev=r),n._next=null,n._prev=null,n}var i=new Ki(t);return this._records.set(t,i),i.currentValue=e,this._addToAdditions(i),i},t.prototype._reset=function(){if(this.isDirty){var t=void 0;for(this._previousMapHead=this._mapHead,t=this._previousMapHead;null!==t;t=t._next)t._nextPrevious=t._next;for(t=this._changesHead;null!==t;t=t._nextChanged)t.previousValue=t.currentValue;for(t=this._additionsHead;null!=t;t=t._nextAdded)t.previousValue=t.currentValue;this._changesHead=this._changesTail=null,this._additionsHead=this._additionsTail=null,this._removalsHead=null}},t.prototype._maybeAddToChanges=function(t,e){i(e,t.currentValue)||(t.previousValue=t.currentValue,t.currentValue=e,this._addToChanges(t))},t.prototype._addToAdditions=function(t){null===this._additionsHead?this._additionsHead=this._additionsTail=t:(this._additionsTail._nextAdded=t,this._additionsTail=t)},t.prototype._addToChanges=function(t){null===this._changesHead?this._changesHead=this._changesTail=t:(this._changesTail._nextChanged=t,this._changesTail=t)},t.prototype.toString=function(){var t=[],e=[],n=[],r=[],o=[];return this.forEachItem(function(e){return t.push(s(e))}),this.forEachPreviousItem(function(t){return e.push(s(t))}),this.forEachChangedItem(function(t){return n.push(s(t))}),this.forEachAddedItem(function(t){return r.push(s(t))}),this.forEachRemovedItem(function(t){return o.push(s(t))}),"map: "+t.join(", ")+"\nprevious: "+e.join(", ")+"\nadditions: "+r.join(", ")+"\nchanges: "+n.join(", ")+"\nremovals: "+o.join(", ")+"\n"},t.prototype._forEach=function(t,e){t instanceof Map?t.forEach(e):Object.keys(t).forEach(function(n){return e(t[n],n)})},t}(),Ki=function(){function t(t){this.key=t,this.previousValue=null,this.currentValue=null,this._nextPrevious=null,this._next=null,this._prev=null,this._nextAdded=null,this._nextRemoved=null,this._nextChanged=null}return t.prototype.toString=function(){return i(this.previousValue,this.currentValue)?s(this.key):s(this.key)+"["+s(this.previousValue)+"->"+s(this.currentValue)+"]"},t}(),qi=function(){function t(t){this.factories=t}return t.create=function(e,n){if(null!=n){var r=n.factories.slice();return e=e.concat(r),new t(e)}return new t(e)},t.extend=function(e){return{provide:t,useFactory:function(n){if(!n)throw new Error("Cannot extend IterableDiffers without a parent injector");return t.create(e,n)},deps:[[t,new ro,new to]]}},t.prototype.find=function(t){var e=this.factories.find(function(e){return e.supports(t)});if(null!=e)return e;throw new Error("Cannot find a differ supporting object '"+t+"' of type '"+Et(t)+"'")},t}(),Zi=function(){function t(t){this.factories=t}return t.create=function(e,n){if(n){var r=n.factories.slice();e=e.concat(r)}return new t(e)},t.extend=function(e){return{provide:t,useFactory:function(n){if(!n)throw new Error("Cannot extend KeyValueDiffers without a parent injector");return t.create(e,n)},deps:[[t,new ro,new to]]}},t.prototype.find=function(t){var e=this.factories.find(function(e){return e.supports(t)});if(e)return e;throw new Error("Cannot find a differ supporting object '"+t+"'")},t}(),Qi=[new Wi],Ji=[new Hi],Yi=new qi(Ji),$i=new Zi(Qi),ts=[{provide:jo,useValue:"unknown"},yi,{provide:di,useExisting:yi},{provide:wo,useFactory:Ot,deps:[]},{provide:_o,useExisting:wo},si,Fo],es=it(null,"core",ts),ns=new Ar("LocaleId"),rs=(new Ar("Translations"),new Ar("TranslationsFormat"),{});rs.Error=0,rs.Warning=1,rs.Ignore=2,rs[rs.Error]="Error",rs[rs.Warning]="Warning",rs[rs.Ignore]="Ignore";var os={};os.NONE=0,os.HTML=1,os.STYLE=2,os.SCRIPT=3,os.URL=4,os.RESOURCE_URL=5,os[os.NONE]="NONE",os[os.HTML]="HTML",os[os.STYLE]="STYLE",os[os.SCRIPT]="SCRIPT",os[os.URL]="URL",os[os.RESOURCE_URL]="RESOURCE_URL";var is=function(){function t(){}return t.prototype.sanitize=function(t,e){},t}(),ss=(function(){function t(){}t.prototype.view=function(){},t.prototype.nodeIndex=function(){},t.prototype.injector=function(){},t.prototype.component=function(){},t.prototype.providerTokens=function(){},t.prototype.references=function(){},t.prototype.context=function(){},t.prototype.componentRenderElement=function(){},t.prototype.renderNode=function(){},t.prototype.logError=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n]}}(),{setCurrentNode:void 0,createRootView:void 0,createEmbeddedView: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}),as=function(){},us=new Map,cs="$$undefined",ls="$$empty",ps=0,fs=new WeakMap,hs=/^:([^:]+):(.+)$/,ds=new Object,ys=function(t){function e(e,n,r,o,i,s){var a=t.call(this)||this;return a.selector=e,a.componentType=n,a._inputs=o,a._outputs=i,a.ngContentSelectors=s,a.viewDefFactory=r,a}return Sr(e,t),Object.defineProperty(e.prototype,"inputs",{get:function(){var t=[],e=this._inputs;for(var n in e){var r=e[n];t.push({propName:n,templateName:r})}return t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"outputs",{get:function(){var t=[];for(var e in this._outputs){var n=this._outputs[e];t.push({propName:e,templateName:n})}return t},enumerable:!0,configurable:!0}),e.prototype.create=function(t,e,n,r){if(!r)throw new Error("ngModule should be provided");var o=te(this.viewDefFactory),i=o.nodes[0].element.componentProvider.index,s=ss.createRootView(t,e||[],n,o,r,ds),a=kt(s,i).instance;return n&&s.renderer.setAttribute(Pt(s,0).renderElement,"ng-version",Yr.full),new ms(s,new vs(s),a)},e}(zo),ms=function(t){function e(e,n,r){var o=t.call(this)||this;return o._view=e,o._viewRef=n,o._component=r,o._elDef=o._view.def.nodes[0],o}return Sr(e,t),Object.defineProperty(e.prototype,"location",{get:function(){return new Ci(Pt(this._view,this._elDef.index).renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"injector",{get:function(){return new _s(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"instance",{get:function(){return this._component},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hostView",{get:function(){return this._viewRef},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"changeDetectorRef",{get:function(){return this._viewRef},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"componentType",{get:function(){return this._component.constructor},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this._viewRef.destroy()},e.prototype.onDestroy=function(t){this._viewRef.onDestroy(t)},e}(Uo),gs=function(){function t(t,e,n){this._view=t,this._elDef=e,this._data=n,this._embeddedViews=[]}return Object.defineProperty(t.prototype,"element",{get:function(){return new Ci(this._data.renderElement)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"injector",{get:function(){return new _s(this._view,this._elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parentInjector",{get:function(){for(var t=this._view,e=this._elDef.parent;!e&&t;)e=Gt(t),t=t.parent;return t?new _s(t,e):new _s(this._view,null)},enumerable:!0,configurable:!0}),t.prototype.clear=function(){for(var t=this._embeddedViews.length,e=t-1;e>=0;e--){var n=Se(this._data,e);ss.destroyView(n)}},t.prototype.get=function(t){var e=this._embeddedViews[t];if(e){var n=new vs(e);return n.attachToViewContainerRef(this),n}return null},Object.defineProperty(t.prototype,"length",{get:function(){return this._embeddedViews.length},enumerable:!0,configurable:!0}),t.prototype.createEmbeddedView=function(t,e,n){var r=t.createEmbeddedView(e||{});return this.insert(r,n),r},t.prototype.createComponent=function(t,e,n,r,o){var i=n||this.parentInjector;o||t instanceof Zo||(o=i.get(Qo));var s=t.create(i,r,void 0,o);return this.insert(s.hostView,e),s},t.prototype.insert=function(t,e){var n=t,r=n._view;return xe(this._view,this._data,e,r),n.attachToViewContainerRef(this),t},t.prototype.move=function(t,e){var n=this._embeddedViews.indexOf(t._view);return Ae(this._data,n,e),t},t.prototype.indexOf=function(t){return this._embeddedViews.indexOf(t._view)},t.prototype.remove=function(t){var e=Se(this._data,t);e&&ss.destroyView(e)},t.prototype.detach=function(t){var e=Se(this._data,t);return e?new vs(e):null},t}(),vs=function(){function t(t){this._view=t,this._viewContainerRef=null,this._appRef=null}return Object.defineProperty(t.prototype,"rootNodes",{get:function(){return ee(this._view)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{get:function(){return this._view.context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"destroyed",{get:function(){return 0!=(128&this._view.state)},enumerable:!0,configurable:!0}),t.prototype.markForCheck=function(){zt(this._view)},t.prototype.detach=function(){this._view.state&=-5},t.prototype.detectChanges=function(){ss.checkAndUpdateView(this._view)},t.prototype.checkNoChanges=function(){ss.checkNoChangesView(this._view)},t.prototype.reattach=function(){this._view.state|=4},t.prototype.onDestroy=function(t){this._view.disposables||(this._view.disposables=[]),this._view.disposables.push(t)},t.prototype.destroy=function(){this._appRef?this._appRef.detachView(this):this._viewContainerRef&&this._viewContainerRef.detach(this._viewContainerRef.indexOf(this)),ss.destroyView(this._view)},t.prototype.detachFromAppRef=function(){this._appRef=null,Re(this._view),ss.dirtyParentQueries(this._view)},t.prototype.attachToAppRef=function(t){if(this._viewContainerRef)throw new Error("This view is already attached to a ViewContainer!");this._appRef=t},t.prototype.attachToViewContainerRef=function(t){if(this._appRef)throw new Error("This view is already attached directly to the ApplicationRef!");this._viewContainerRef=t},t}(),bs=function(t){function e(e,n){var r=t.call(this)||this;return r._parentView=e,r._def=n,r}return Sr(e,t),e.prototype.createEmbeddedView=function(t){return new vs(ss.createEmbeddedView(this._parentView,this._def,t))},Object.defineProperty(e.prototype,"elementRef",{get:function(){return new Ci(Pt(this._parentView,this._def.index).renderElement)},enumerable:!0,configurable:!0}),e}(Ti),_s=function(){function t(t,e){this.view=t,this.elDef=e}return t.prototype.get=function(t,e){void 0===e&&(e=uo.THROW_IF_NOT_FOUND);var n=!!this.elDef&&0!=(33554432&this.elDef.flags);return ss.resolveDep(this.view,this.elDef,n,{flags:0,token:t,tokenKey:jt(t)},e)},t}(),ws=function(){function t(t){this.delegate=t}return t.prototype.selectRootElement=function(t){return this.delegate.selectRootElement(t)},t.prototype.createElement=function(t,e){var n=ae(e),r=n[0],o=n[1],i=this.delegate.createElement(o,r);return t&&this.delegate.appendChild(t,i),i},t.prototype.createViewRoot=function(t){return t},t.prototype.createTemplateAnchor=function(t){var e=this.delegate.createComment("");return t&&this.delegate.appendChild(t,e),e},t.prototype.createText=function(t,e){var n=this.delegate.createText(e);return t&&this.delegate.appendChild(t,n),n},t.prototype.projectNodes=function(t,e){for(var n=0;n<e.length;n++)this.delegate.appendChild(t,e[n])},t.prototype.attachViewAfter=function(t,e){for(var n=this.delegate.parentNode(t),r=this.delegate.nextSibling(t),o=0;o<e.length;o++)this.delegate.insertBefore(n,e[o],r)},t.prototype.detachView=function(t){for(var e=0;e<t.length;e++){var n=t[e],r=this.delegate.parentNode(n);this.delegate.removeChild(r,n)}},t.prototype.destroyView=function(t,e){for(var n=0;n<e.length;n++)this.delegate.destroyNode(e[n])},t.prototype.listen=function(t,e,n){return this.delegate.listen(t,e,n)},t.prototype.listenGlobal=function(t,e,n){return this.delegate.listen(t,e,n)},t.prototype.setElementProperty=function(t,e,n){this.delegate.setProperty(t,e,n)},t.prototype.setElementAttribute=function(t,e,n){var r=ae(e),o=r[0],i=r[1];null!=n?this.delegate.setAttribute(t,i,n,o):this.delegate.removeAttribute(t,i,o)},t.prototype.setBindingDebugInfo=function(t,e,n){},t.prototype.setElementClass=function(t,e,n){n?this.delegate.addClass(t,e):this.delegate.removeClass(t,e)},t.prototype.setElementStyle=function(t,e,n){null!=n?this.delegate.setStyle(t,e,n):this.delegate.removeStyle(t,e)},t.prototype.invokeElementMethod=function(t,e,n){t[e].apply(t,n)},t.prototype.setText=function(t,e){this.delegate.setValue(t,e)},t.prototype.animate=function(){throw new Error("Renderer.animate is no longer supported!")},t}(),Cs=jt(vi),Es=jt(wi),Os=jt(Ci),xs=jt(Ai),Ps=jt(Ti),ks=jt(Di),Ss=jt(uo),Ts=new Object,As={},Ds={};Ds.CreateViewNodes=0,Ds.CheckNoChanges=1,Ds.CheckNoChangesProjectedViews=2,Ds.CheckAndUpdate=3,Ds.CheckAndUpdateProjectedViews=4,Ds.Destroy=5,Ds[Ds.CreateViewNodes]="CreateViewNodes",Ds[Ds.CheckNoChanges]="CheckNoChanges",Ds[Ds.CheckNoChangesProjectedViews]="CheckNoChangesProjectedViews",Ds[Ds.CheckAndUpdate]="CheckAndUpdate",Ds[Ds.CheckAndUpdateProjectedViews]="CheckAndUpdateProjectedViews",Ds[Ds.Destroy]="Destroy";/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Rs=!1,Ms={};Ms.create=0,Ms.detectChanges=1,Ms.checkNoChanges=2,Ms.destroy=3,Ms.handleEvent=4,Ms[Ms.create]="create",Ms[Ms.detectChanges]="detectChanges",Ms[Ms.checkNoChanges]="checkNoChanges",Ms[Ms.destroy]="destroy",Ms[Ms.handleEvent]="handleEvent";var Vs,Ns,js,Is=/([A-Z])/g,Fs=function(){function t(t,e){this.view=t,this.nodeIndex=e,null==e&&(this.nodeIndex=e=0),this.nodeDef=t.def.nodes[e];for(var n=this.nodeDef,r=t;n&&0==(1&n.flags);)n=n.parent;if(!n)for(;!n&&r;)n=Gt(r),r=r.parent;this.elDef=n,this.elView=r}return Object.defineProperty(t.prototype,"elOrCompView",{get:function(){return Pt(this.elView,this.elDef.index).componentView||this.view},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"injector",{get:function(){return He(this.elView,this.elDef)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"component",{get:function(){return this.elOrCompView.component},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"context",{get:function(){return this.elOrCompView.context},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"providerTokens",{get:function(){var t=[];if(this.elDef)for(var e=this.elDef.index+1;e<=this.elDef.index+this.elDef.childCount;e++){var n=this.elView.def.nodes[e];20224&n.flags&&t.push(n.provider.token),e+=n.childCount}return t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"references",{get:function(){var t={};if(this.elDef){gr(this.elView,this.elDef,t);for(var e=this.elDef.index+1;e<=this.elDef.index+this.elDef.childCount;e++){var n=this.elView.def.nodes[e];20224&n.flags&&gr(this.elView,n,t),e+=n.childCount}}return t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"componentRenderElement",{get:function(){var t=mr(this.elOrCompView);return t?t.renderElement:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"renderNode",{get:function(){return 2&this.nodeDef.flags?Kt(this.view,this.nodeDef):Kt(this.elView,this.elDef)},enumerable:!0,configurable:!0}),t.prototype.logError=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r,o;2&this.nodeDef.flags?(r=this.view.def,o=this.nodeDef.index):(r=this.elView.def,o=this.elDef.index);var i=yr(r,o),s=-1,a=function(){return s++,s===i?(n=t.error).bind.apply(n,[t].concat(e)):as;var n};r.factory(a),s<i&&(t.error("Illegal state: the ViewDefinitionFactory did not call the logger!"),t.error.apply(t,e))},t}(),Hs=function(){function t(t){this.delegate=t}return t.prototype.createRenderer=function(t,e){return new Ls(this.delegate.createRenderer(t,e))},t}(),Ls=function(){function t(t){this.delegate=t}return Object.defineProperty(t.prototype,"data",{get:function(){return this.delegate.data},enumerable:!0,configurable:!0}),t.prototype.destroyNode=function(t){mt(dt(t)),this.delegate.destroyNode&&this.delegate.destroyNode(t)},t.prototype.destroy=function(){this.delegate.destroy()},t.prototype.createElement=function(t,e){var n=this.delegate.createElement(t,e),r=br();if(r){var o=new Ni(n,null,r);o.name=t,yt(o)}return n},t.prototype.createComment=function(t){var e=this.delegate.createComment(t),n=br();return n&&yt(new Vi(e,null,n)),e},t.prototype.createText=function(t){var e=this.delegate.createText(t),n=br();return n&&yt(new Vi(e,null,n)),e},t.prototype.appendChild=function(t,e){var n=dt(t),r=dt(e);n&&r&&n instanceof Ni&&n.addChild(r),this.delegate.appendChild(t,e)},t.prototype.insertBefore=function(t,e,n){var r=dt(t),o=dt(e),i=dt(n);r&&o&&r instanceof Ni&&r.insertBefore(i,o),this.delegate.insertBefore(t,e,n)},t.prototype.removeChild=function(t,e){var n=dt(t),r=dt(e);n&&r&&n instanceof Ni&&n.removeChild(r),this.delegate.removeChild(t,e)},t.prototype.selectRootElement=function(t){var e=this.delegate.selectRootElement(t),n=br();return n&&yt(new Ni(e,null,n)),e},t.prototype.setAttribute=function(t,e,n,r){var o=dt(t);if(o&&o instanceof Ni){var i=r?r+":"+e:e;o.attributes[i]=n}this.delegate.setAttribute(t,e,n,r)},t.prototype.removeAttribute=function(t,e,n){var r=dt(t);if(r&&r instanceof Ni){var o=n?n+":"+e:e;r.attributes[o]=null}this.delegate.removeAttribute(t,e,n)},t.prototype.addClass=function(t,e){var n=dt(t);n&&n instanceof Ni&&(n.classes[e]=!0),this.delegate.addClass(t,e)},t.prototype.removeClass=function(t,e){var n=dt(t);n&&n instanceof Ni&&(n.classes[e]=!1),this.delegate.removeClass(t,e)},t.prototype.setStyle=function(t,e,n,r){var o=dt(t);o&&o instanceof Ni&&(o.styles[e]=n),this.delegate.setStyle(t,e,n,r)},t.prototype.removeStyle=function(t,e,n){var r=dt(t);r&&r instanceof Ni&&(r.styles[e]=null),this.delegate.removeStyle(t,e,n)},t.prototype.setProperty=function(t,e,n){var r=dt(t);r&&r instanceof Ni&&(r.properties[e]=n),this.delegate.setProperty(t,e,n)},t.prototype.listen=function(t,e,n){if("string"!=typeof t){var r=dt(t);r&&r.listeners.push(new Mi(e,n))}return this.delegate.listen(t,e,n)},t.prototype.parentNode=function(t){return this.delegate.parentNode(t)},t.prototype.nextSibling=function(t){return this.delegate.nextSibling(t)},t.prototype.setValue=function(t,e){return this.delegate.setValue(t,e)},t}(),Us=function(){function t(t){}return t}();Us.decorators=[{type:Zr,args:[{providers:[gi,{provide:mi,useExisting:gi},Ro,Ho,Vo,{provide:qi,useFactory:_r},{provide:Zi,useFactory:wr},{provide:ns,useFactory:Cr,deps:[[new $r(ns),new to,new ro]]},{provide:Do,useValue:Er,multi:!0}]}]}],Us.ctorParameters=function(){return[{type:mi}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var zs={};zs.OnInit=0,zs.OnDestroy=1,zs.DoCheck=2,zs.OnChanges=3,zs.AfterContentInit=4,zs.AfterContentChecked=5,zs.AfterViewInit=6,zs.AfterViewChecked=7,zs[zs.OnInit]="OnInit",zs[zs.OnDestroy]="OnDestroy",zs[zs.DoCheck]="DoCheck",zs[zs.OnChanges]="OnChanges",zs[zs.AfterContentInit]="AfterContentInit",zs[zs.AfterContentChecked]="AfterContentChecked",zs[zs.AfterViewInit]="AfterViewInit",zs[zs.AfterViewChecked]="AfterViewChecked";zs.OnInit,zs.OnDestroy,zs.DoCheck,zs.OnChanges,zs.AfterContentInit,zs.AfterContentChecked,zs.AfterViewInit,zs.AfterViewChecked}).call(e,n("DuR2"))},"3kwk":function(t,e,n){"use strict";var r=n("3j3K"),o=n("CXHW");n.d(e,"a",function(){return i});var i=function(){function t(t,e,n){this._moduleCFR=t,this._injector=e,this._modalStack=n}return t.prototype.open=function(t,e){return void 0===e&&(e={}),this._modalStack.open(this._moduleCFR,this._injector,t,e)},t}();i.decorators=[{type:r.z}],i.ctorParameters=function(){return[{type:r.Z},{type:r._11},{type:o.a}]}},"5ZV5":function(t,e,n){"use strict";var r=n("3j3K"),o=n("hlt1"),i=n("gEbu");n.d(e,"a",function(){return s});var s=function(){function t(t){this.i18n=t,this.select=new r.R}return t.prototype.doSelect=function(t){this.isDisabled(t)||this.isHidden(t)||this.select.emit(o.a.from(t.date))},t.prototype.isDisabled=function(t){return this.disabled||t.disabled},t.prototype.isSelected=function(t){return this.selectedDate&&this.selectedDate.equals(t)},t.prototype.isCollapsed=function(t){return"collapsed"===this.outsideDays&&t.days[0].date.month!==this.month.number&&t.days[t.days.length-1].date.month!==this.month.number},t.prototype.isHidden=function(t){return("hidden"===this.outsideDays||"collapsed"===this.outsideDays)&&this.month.number!==t.date.month},t}();s.decorators=[{type:r._10,args:[{selector:"ngb-datepicker-month-view",host:{class:"d-block"},styles:["\n .ngb-dp-weekday, .ngb-dp-week-number {\n line-height: 2rem;\n }\n .ngb-dp-day, .ngb-dp-weekday, .ngb-dp-week-number {\n width: 2rem;\n height: 2rem; \n }\n .ngb-dp-day {\n cursor: pointer;\n }\n .ngb-dp-day.disabled, .ngb-dp-day.hidden {\n cursor: default;\n }\n "],template:'\n <div *ngIf="showWeekdays" class="ngb-dp-week d-flex">\n <div *ngIf="showWeekNumbers" class="ngb-dp-weekday"></div>\n <div *ngFor="let w of month.weekdays" class="ngb-dp-weekday small text-center text-info font-italic">\n {{ i18n.getWeekdayShortName(w) }}\n </div>\n </div>\n <ng-template ngFor let-week [ngForOf]="month.weeks">\n <div *ngIf="!isCollapsed(week)" class="ngb-dp-week d-flex">\n <div *ngIf="showWeekNumbers" class="ngb-dp-week-number small text-center font-italic text-muted">{{ week.number }}</div>\n <div *ngFor="let day of week.days" (click)="doSelect(day)" class="ngb-dp-day" [class.disabled]="isDisabled(day)"\n [class.hidden]="isHidden(day)">\n <ng-template [ngIf]="!isHidden(day)">\n <ng-template [ngTemplateOutlet]="dayTemplate"\n [ngOutletContext]="{date: {year: day.date.year, month: day.date.month, day: day.date.day},\n currentMonth: month.number,\n disabled: isDisabled(day),\n selected: isSelected(day.date)}">\n </ng-template>\n </ng-template>\n </div>\n </div>\n </ng-template>\n '}]}],s.ctorParameters=function(){return[{type:i.b}]},s.propDecorators={dayTemplate:[{type:r.X}],disabled:[{type:r.X}],month:[{type:r.X}],outsideDays:[{type:r.X}],selectedDate:[{type:r.X}],showWeekdays:[{type:r.X}],showWeekNumbers:[{type:r.X}],select:[{type:r._14}]}},"62nT":function(t,e,n){"use strict";var r=n("3j3K"),o=n("2Je8"),i=n("OEcN"),s=n("tyH+");n.d(e,"a",function(){return a});var a=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[s.a]}},t}();a.decorators=[{type:r.A,args:[{declarations:[i.a],exports:[i.a],imports:[o.b]}]}],a.ctorParameters=function(){return[]}},"6uCv":function(t,e,n){"use strict";var r=n("3j3K"),o=n("c7mC");n.d(e,"b",function(){return i}),n.d(e,"a",function(){return s});var i=function(){function t(t){this._open=!1,this.openChange=new r.R,this.up=t.up,this.autoClose=t.autoClose}return t.prototype.isOpen=function(){return this._open},t.prototype.open=function(){this._open||(this._open=!0,this.openChange.emit(!0))},t.prototype.close=function(){this._open&&(this._open=!1,this.openChange.emit(!1))},t.prototype.toggle=function(){this.isOpen()?this.close():this.open()},t.prototype.closeFromOutsideClick=function(t){this.autoClose&&2!==t.button&&!this._isEventFromToggle(t)&&this.close()},t.prototype.closeFromOutsideEsc=function(){this.autoClose&&this.close()},Object.defineProperty(t.prototype,"toggleElement",{set:function(t){this._toggleElement=t},enumerable:!0,configurable:!0}),t.prototype._isEventFromToggle=function(t){return!!this._toggleElement&&this._toggleElement.contains(t.target)},t}();i.decorators=[{type:r.U,args:[{selector:"[ngbDropdown]",exportAs:"ngbDropdown",host:{"[class.dropdown]":"!up","[class.dropup]":"up","[class.show]":"isOpen()","(keyup.esc)":"closeFromOutsideEsc()","(document:click)":"closeFromOutsideClick($event)"}}]}],i.ctorParameters=function(){return[{type:o.a}]},i.propDecorators={up:[{type:r.X}],autoClose:[{type:r.X}],_open:[{type:r.X,args:["open"]}],openChange:[{type:r._14}]};var s=function(){function t(t,e){this.dropdown=t,t.toggleElement=e.nativeElement}return t.prototype.toggleOpen=function(){this.dropdown.toggle()},t}();s.decorators=[{type:r.U,args:[{selector:"[ngbDropdownToggle]",host:{class:"dropdown-toggle","aria-haspopup":"true","[attr.aria-expanded]":"dropdown.isOpen()","(click)":"toggleOpen()"}}]}],s.ctorParameters=function(){return[{type:i},{type:r.V}]}},"7DGp":function(t,e,n){"use strict";var r=n("2yGx");n.d(e,"b",function(){return i}),n.d(e,"a",function(){return s});var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=function(){function t(){}return t}(),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.parse=function(t){if(t){var e=t.trim().split("-");if(1===e.length&&n.i(r.a)(e[0]))return{year:n.i(r.b)(e[0]),month:null,day:null};if(2===e.length&&n.i(r.a)(e[0])&&n.i(r.a)(e[1]))return{year:n.i(r.b)(e[0]),month:n.i(r.b)(e[1]),day:null};if(3===e.length&&n.i(r.a)(e[0])&&n.i(r.a)(e[1])&&n.i(r.a)(e[2]))return{year:n.i(r.b)(e[0]),month:n.i(r.b)(e[1]),day:n.i(r.b)(e[2])}}return null},e.prototype.format=function(t){return t?t.year+"-"+(n.i(r.a)(t.month)?n.i(r.c)(t.month):"")+"-"+(n.i(r.a)(t.day)?n.i(r.c)(t.day):""):""},e}(i)},"7rB9":function(t,e,n){"use strict";var r=n("t2qv");e.forkJoin=r.ForkJoinObservable.create},"9XFw":function(t,e,n){"use strict";var r=n("3j3K");n.d(e,"a",function(){return o});var o=function(){function t(){}return t}();o.decorators=[{type:r._10,args:[{selector:"ngb-modal-backdrop",template:"",host:{class:"modal-backdrop fade show"}}]}],o.ctorParameters=function(){return[]}},A8b0:function(t,e,n){"use strict";var r=n("3j3K"),o=n("2Je8"),i=n("aKiW"),s=n("qQ/N");n.d(e,"a",function(){return a});var a=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[i.a]}},t}();a.decorators=[{type:r.A,args:[{declarations:[s.a],exports:[s.a],imports:[o.b]}]}],a.ctorParameters=function(){return[]}},B00U:function(t,e,n){"use strict";function r(t){return t.reduce(function(t,e){return t.concat(e instanceof c.UnsubscriptionError?e.errors:e)},[])}var o=n("Xajo"),i=n("ICpg"),s=n("SKH6"),a=n("+3eL"),u=n("WhVc"),c=n("GIjk"),l=function(){function t(t){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var t,e=!1;if(!this.closed){var n=this,l=n._parent,p=n._parents,f=n._unsubscribe,h=n._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var d=-1,y=p?p.length:0;l;)l.remove(this),l=++d<y&&p[d]||null;if(s.isFunction(f)){var m=a.tryCatch(f).call(this);m===u.errorObject&&(e=!0,t=t||(u.errorObject.e instanceof c.UnsubscriptionError?r(u.errorObject.e.errors):[u.errorObject.e]))}if(o.isArray(h))for(d=-1,y=h.length;++d<y;){var g=h[d];if(i.isObject(g)){var m=a.tryCatch(g.unsubscribe).call(g);if(m===u.errorObject){e=!0,t=t||[];var v=u.errorObject.e;v instanceof c.UnsubscriptionError?t=t.concat(r(v.errors)):t.push(v)}}}if(e)throw new c.UnsubscriptionError(t)}},t.prototype.add=function(e){if(!e||e===t.EMPTY)return t.EMPTY;if(e===this)return this;var n=e;switch(typeof e){case"function":n=new t(e);case"object":if(n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;if("function"!=typeof n._addParent){var r=n;n=new t,n._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}return(this._subscriptions||(this._subscriptions=[])).push(n),n._addParent(this),n},t.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},t.prototype._addParent=function(t){var e=this,n=e._parent,r=e._parents;n&&n!==t?r?-1===r.indexOf(t)&&r.push(t):this._parents=[t]:this._parent=t},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}();e.Subscription=l},CO0D:function(t,e,n){"use strict";var r=n("lcaH"),o=n("3j3K"),i=n("2yGx");n.d(e,"a",function(){return a});var s=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.getDaysPerWeek=function(){return 7},e.prototype.getMonths=function(){return[1,2,3,4,5,6,7,8,9,10,11,12]},e.prototype.getWeeksPerMonth=function(){return 6},e.prototype.isValid=function(t){return t&&n.i(i.a)(t.year)&&n.i(i.a)(t.month)&&n.i(i.a)(t.day)&&!isNaN(this.toGregorian(t).getTime())},e.prototype.setDay=function(t,e){e=+e;var n=this.getDaysInIslamicMonth(t.month,t.year);if(e<=0)for(;e<=0;)t=this.setMonth(t,t.month-1),n=this.getDaysInIslamicMonth(t.month,t.year),e+=n;else if(e>n)for(;e>n;)e-=n,t=this.setMonth(t,t.month+1),n=this.getDaysInIslamicMonth(t.month,t.year);return t.day=e,t},e.prototype.setMonth=function(t,e){return e=+e,t.year=t.year+Math.floor((e-1)/12),t.month=Math.floor(((e-1)%12+12)%12)+1,t},e.prototype.setYear=function(t,e){return t.year=+e,t},e.prototype._isIslamicLeapYear=function(t){return(14+11*t)%30<11},e.prototype._getMonthStart=function(t,e){return Math.ceil(29.5*e)+354*(t-1)+Math.floor((3+11*t)/30)},e.prototype._getYearStart=function(t){return 354*(t-1)+Math.floor((3+11*t)/30)},e}(r.b);a.decorators=[{type:o.z}],a.ctorParameters=function(){return[]}},CURp:function(t,e,n){"use strict";function r(t,e,n,r){var f=new l.InnerSubscriber(t,n,r);if(f.closed)return null;if(e instanceof u.Observable)return e._isScalar?(f.next(e.value),f.complete(),null):e.subscribe(f);if(i.isArrayLike(e)){for(var h=0,d=e.length;h<d&&!f.closed;h++)f.next(e[h]);f.closed||f.complete()}else{if(s.isPromise(e))return e.then(function(t){f.closed||(f.next(t),f.complete())},function(t){return f.error(t)}).then(null,function(t){o.root.setTimeout(function(){throw t})}),f;if(e&&"function"==typeof e[c.iterator])for(var y=e[c.iterator]();;){var m=y.next();if(m.done){f.complete();break}if(f.next(m.value),f.closed)break}else if(e&&"function"==typeof e[p.observable]){var g=e[p.observable]();if("function"==typeof g.subscribe)return g.subscribe(new l.InnerSubscriber(t,n,r));f.error(new TypeError("Provided object does not correctly implement Symbol.observable"))}else{var v=a.isObject(e)?"an invalid object":"'"+e+"'",b="You provided "+v+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";f.error(new TypeError(b))}}return null}var o=n("VOfZ"),i=n("1r8+"),s=n("aQl7"),a=n("ICpg"),u=n("rCTf"),c=n("cdmN"),l=n("QqRK"),p=n("mbVC");e.subscribeToResult=r},CXHW:function(t,e,n){"use strict";var r=n("3j3K"),o=n("/PMa"),i=n("2yGx"),s=n("9XFw"),a=n("xOmt"),u=n("WtdY");n.d(e,"a",function(){return c});var c=function(){function t(t,e,n){this._applicationRef=t,this._injector=e,this._componentFactoryResolver=n,this._backdropFactory=n.resolveComponentFactory(s.a),this._windowFactory=n.resolveComponentFactory(a.a)}return t.prototype.open=function(t,e,n,r){var o=r.container||"body",i=document.querySelector(o);if(!i)throw new Error('The specified modal container "'+o+'" was not found in the DOM.');var s,a,c,l=new u.a,p=this._getContentRef(t,e,n,l);return!1!==r.backdrop&&(a=this._backdropFactory.create(this._injector),this._applicationRef.attachView(a.hostView),i.appendChild(a.location.nativeElement)),s=this._windowFactory.create(this._injector,p.nodes),this._applicationRef.attachView(s.hostView),i.appendChild(s.location.nativeElement),c=new u.b(s,p,a),l.close=function(t){c.close(t)},l.dismiss=function(t){c.dismiss(t)},this._applyWindowOptions(s.instance,r),c},t.prototype._applyWindowOptions=function(t,e){["backdrop","keyboard","size","windowClass"].forEach(function(r){n.i(i.i)(e[r])&&(t[r]=e[r])})},t.prototype._getContentRef=function(t,e,s,a){if(s){if(s instanceof r._1){var c=s.createEmbeddedView(a);return this._applicationRef.attachView(c),new o.b([c.rootNodes],c)}if(n.i(i.g)(s))return new o.b([[document.createTextNode(""+s)]]);var l=t.resolveComponentFactory(s),p=r._19.resolveAndCreate([{provide:u.a,useValue:a}],e),f=l.create(p);return this._applicationRef.attachView(f.hostView),new o.b([[f.location.nativeElement]],f.hostView,f)}return new o.b([])},t}();c.decorators=[{type:r.z}],c.ctorParameters=function(){return[{type:r.r},{type:r._11},{type:r.Z}]}},DDfv:function(t,e,n){"use strict";var r=n("3j3K");n.d(e,"a",function(){return o});var o=function(){function t(){this.interval=5e3,this.wrap=!0,this.keyboard=!0}return t}();o.decorators=[{type:r.z}],o.ctorParameters=function(){return[]}},DuR2:function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},EEr4:function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n("rCTf"),i=n("mmVS"),s=n("B00U"),a=n("IZVw"),u=n("ZJf8"),c=n("r8ZY"),l=function(t){function e(e){t.call(this,e),this.destination=e}return r(e,t),e}(i.Subscriber);e.SubjectSubscriber=l;var p=function(t){function e(){t.call(this),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}return r(e,t),e.prototype[c.rxSubscriber]=function(){return new l(this)},e.prototype.lift=function(t){var e=new f(this,this);return e.operator=t,e},e.prototype.next=function(t){if(this.closed)throw new a.ObjectUnsubscribedError;if(!this.isStopped)for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].next(t)},e.prototype.error=function(t){if(this.closed)throw new a.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,n=e.length,r=e.slice(),o=0;o<n;o++)r[o].error(t);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new a.ObjectUnsubscribedError;this.isStopped=!0;for(var t=this.observers,e=t.length,n=t.slice(),r=0;r<e;r++)n[r].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new a.ObjectUnsubscribedError;return t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){if(this.closed)throw new a.ObjectUnsubscribedError;return this.hasError?(t.error(this.thrownError),s.Subscription.EMPTY):this.isStopped?(t.complete(),s.Subscription.EMPTY):(this.observers.push(t),new u.SubjectSubscription(this,t))},e.prototype.asObservable=function(){var t=new o.Observable;return t.source=this,t},e.create=function(t,e){return new f(t,e)},e}(o.Observable);e.Subject=p;var f=function(t){function e(e,n){t.call(this),this.destination=e,this.source=n}return r(e,t),e.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},e.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},e.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},e.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):s.Subscription.EMPTY},e}(p);e.AnonymousSubject=f},ETCP:function(t,e,n){"use strict";var r=n("3j3K");n.d(e,"a",function(){return o});var o=function(){function t(){this.placement="top",this.triggers="click"}return t}();o.decorators=[{type:r.z}],o.ctorParameters=function(){return[]}},Ep2y:function(t,e,n){"use strict";var r=n("3j3K"),o=n("2Je8"),i=n("/i+G"),s=n("K0TW");n.d(e,"a",function(){return a});var a=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[s.a]}},t}();a.decorators=[{type:r.A,args:[{declarations:[i.a],exports:[i.a],imports:[o.b]}]}],a.ctorParameters=function(){return[]}},EzwU:function(t,e,n){"use strict";var r=n("3j3K"),o=n("2yGx");n.d(e,"a",function(){return i});var i=function(){function t(){this.highlightClass="ngb-highlight"}return t.prototype.ngOnChanges=function(t){var e=n.i(o.e)(this.result),r=e.toLowerCase(),i=n.i(o.e)(this.term).toLowerCase(),s=0;i.length>0?this.parts=r.split(new RegExp("("+n.i(o.h)(i)+")")).map(function(t){var n=e.substr(s,t.length);return s+=t.length,n}):this.parts=[e]},t}();i.decorators=[{type:r._10,args:[{selector:"ngb-highlight",changeDetection:r._17.OnPush,template:'<ng-template ngFor [ngForOf]="parts" let-part let-isOdd="odd"><span *ngIf="isOdd" class="{{highlightClass}}">{{part}}</span><ng-template [ngIf]="!isOdd">{{part}}</ng-template></ng-template>',styles:["\n .ngb-highlight {\n font-weight: bold;\n }\n "]}]}],i.ctorParameters=function(){return[]},i.propDecorators={highlightClass:[{type:r.X}],result:[{type:r.X}],term:[{type:r.X}]}},Fzro:function(t,e,n){"use strict";/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function r(t){if("string"!=typeof t)return t;switch(t.toUpperCase()){case"GET":return _.Get;case"POST":return _.Post;case"PUT":return _.Put;case"DELETE":return _.Delete;case"OPTIONS":return _.Options;case"HEAD":return _.Head;case"PATCH":return _.Patch}throw new Error('Invalid request method. The method "'+t+'" is not supported.')}function o(t){return"responseURL"in t?t.responseURL:/^X-Request-URL:/m.test(t.getAllResponseHeaders())?t.getResponseHeader("X-Request-URL"):null}function i(t){for(var e=new Uint16Array(t.length),n=0,r=t.length;n<r;n++)e[n]=t.charCodeAt(n);return e.buffer}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license * @param {?=} rawParams * @return {?} */ function s(t){void 0===t&&(t="");var e=new Map;if(t.length>0){t.split("&").forEach(function(t){var n=t.indexOf("="),r=-1==n?[t,""]:[t.slice(0,n),t.slice(n+1)],o=r[0],i=r[1],s=e.get(o)||[];s.push(i),e.set(o,s)})}return e}function a(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/gi,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%2B/gi,"+").replace(/%3D/gi,"=").replace(/%3F/gi,"?").replace(/%2F/gi,"/")}function u(){var t="object"==typeof window?window:{};return null===I&&(I=t[j]={}),I}function c(t){var e=new R;return Object.keys(t).forEach(function(n){var r=t[n];r&&Array.isArray(r)?r.forEach(function(t){return e.append(n,t.toString())}):e.append(n,r.toString())}),e}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function l(t,e){return t.createConnection(e).response}function p(t,e,n,r){var o=t;return e?o.merge(new Z({method:e.method||n,url:e.url||r,search:e.search,params:e.params,headers:e.headers,body:e.body,withCredentials:e.withCredentials,responseType:e.responseType})):o.merge(new Z({method:n,url:r}))}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function f(){return new K}function h(t,e){return new rt(t,e)}function d(t,e){return new ot(t,e)}var y=n("3j3K"),m=n("rCTf"),g=(n.n(m),n("Qbdm"));n.d(e,"a",function(){return b}),n.d(e,"d",function(){return q}),n.d(e,"e",function(){return Q}),n.d(e,"j",function(){return Z}),n.d(e,"b",function(){return k}),n.d(e,"h",function(){return P}),n.d(e,"l",function(){return x}),n.d(e,"k",function(){return rt}),n.d(e,"g",function(){return it}),n.d(e,"i",function(){return T}),n.d(e,"c",function(){return f}),n.d(e,"f",function(){return h});var v=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},b=function(){function t(){}return t.prototype.build=function(){return new XMLHttpRequest},t}();b.decorators=[{type:y.z}],b.ctorParameters=function(){return[]};var _={};_.Get=0,_.Post=1,_.Put=2,_.Delete=3,_.Options=4,_.Head=5,_.Patch=6,_[_.Get]="Get",_[_.Post]="Post",_[_.Put]="Put",_[_.Delete]="Delete",_[_.Options]="Options",_[_.Head]="Head",_[_.Patch]="Patch";var w={};w.Unsent=0,w.Open=1,w.HeadersReceived=2,w.Loading=3,w.Done=4,w.Cancelled=5,w[w.Unsent]="Unsent",w[w.Open]="Open",w[w.HeadersReceived]="HeadersReceived",w[w.Loading]="Loading",w[w.Done]="Done",w[w.Cancelled]="Cancelled";var C={};C.Basic=0,C.Cors=1,C.Default=2,C.Error=3,C.Opaque=4,C[C.Basic]="Basic",C[C.Cors]="Cors",C[C.Default]="Default",C[C.Error]="Error",C[C.Opaque]="Opaque";var E={};E.NONE=0,E.JSON=1,E.FORM=2,E.FORM_DATA=3,E.TEXT=4,E.BLOB=5,E.ARRAY_BUFFER=6,E[E.NONE]="NONE",E[E.JSON]="JSON",E[E.FORM]="FORM",E[E.FORM_DATA]="FORM_DATA",E[E.TEXT]="TEXT",E[E.BLOB]="BLOB",E[E.ARRAY_BUFFER]="ARRAY_BUFFER";var O={};O.Text=0,O.Json=1,O.ArrayBuffer=2,O.Blob=3,O[O.Text]="Text",O[O.Json]="Json",O[O.ArrayBuffer]="ArrayBuffer",O[O.Blob]="Blob";var x=function(){function t(e){var n=this;if(this._headers=new Map,this._normalizedNames=new Map,e)return e instanceof t?void e.forEach(function(t,e){t.forEach(function(t){return n.append(e,t)})}):void Object.keys(e).forEach(function(t){var r=Array.isArray(e[t])?e[t]:[e[t]];n.delete(t),r.forEach(function(e){return n.append(t,e)})})}return t.fromResponseHeaderString=function(e){var n=new t;return e.split("\n").forEach(function(t){var e=t.indexOf(":");if(e>0){var r=t.slice(0,e),o=t.slice(e+1).trim();n.set(r,o)}}),n},t.prototype.append=function(t,e){var n=this.getAll(t);null===n?this.set(t,e):n.push(e)},t.prototype.delete=function(t){var e=t.toLowerCase();this._normalizedNames.delete(e),this._headers.delete(e)},t.prototype.forEach=function(t){var e=this;this._headers.forEach(function(n,r){return t(n,e._normalizedNames.get(r),e._headers)})},t.prototype.get=function(t){var e=this.getAll(t);return null===e?null:e.length>0?e[0]:null},t.prototype.has=function(t){return this._headers.has(t.toLowerCase())},t.prototype.keys=function(){return Array.from(this._normalizedNames.values())},t.prototype.set=function(t,e){Array.isArray(e)?e.length&&this._headers.set(t.toLowerCase(),[e.join(",")]):this._headers.set(t.toLowerCase(),[e]),this.mayBeSetNormalizedName(t)},t.prototype.values=function(){return Array.from(this._headers.values())},t.prototype.toJSON=function(){var t=this,e={};return this._headers.forEach(function(n,r){var o=[];n.forEach(function(t){return o.push.apply(o,t.split(","))}),e[t._normalizedNames.get(r)]=o}),e},t.prototype.getAll=function(t){return this.has(t)?this._headers.get(t.toLowerCase())||null:null},t.prototype.entries=function(){throw new Error('"entries" method is not implemented on Headers class')},t.prototype.mayBeSetNormalizedName=function(t){var e=t.toLowerCase();this._normalizedNames.has(e)||this._normalizedNames.set(e,t)},t}(),P=function(){function t(t){var e=void 0===t?{}:t,n=e.body,r=e.status,o=e.headers,i=e.statusText,s=e.type,a=e.url;this.body=null!=n?n:null,this.status=null!=r?r:null,this.headers=null!=o?o:null,this.statusText=null!=i?i:null,this.type=null!=s?s:null,this.url=null!=a?a:null}return t.prototype.merge=function(e){return new t({body:e&&null!=e.body?e.body:this.body,status:e&&null!=e.status?e.status:this.status,headers:e&&null!=e.headers?e.headers:this.headers,statusText:e&&null!=e.statusText?e.statusText:this.statusText,type:e&&null!=e.type?e.type:this.type,url:e&&null!=e.url?e.url:this.url})},t}(),k=function(t){function e(){return t.call(this,{status:200,statusText:"Ok",type:C.Default,headers:new x})||this}return v(e,t),e}(P);k.decorators=[{type:y.z}],k.ctorParameters=function(){return[]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var S=function(){function t(){}return t.prototype.createConnection=function(t){},t}(),T=(function(){function t(){}}(),function(){function t(){}return t.prototype.configureRequest=function(t){},t}()),A=function(t){return t>=200&&t<300},D=function(){function t(){}return t.prototype.encodeKey=function(t){return a(t)},t.prototype.encodeValue=function(t){return a(t)},t}(),R=function(){function t(t,e){void 0===t&&(t=""),void 0===e&&(e=new D),this.rawParams=t,this.queryEncoder=e,this.paramsMap=s(t)}return t.prototype.clone=function(){var e=new t("",this.queryEncoder);return e.appendAll(this),e},t.prototype.has=function(t){return this.paramsMap.has(t)},t.prototype.get=function(t){var e=this.paramsMap.get(t);return Array.isArray(e)?e[0]:null},t.prototype.getAll=function(t){return this.paramsMap.get(t)||[]},t.prototype.set=function(t,e){if(void 0===e||null===e)return void this.delete(t);var n=this.paramsMap.get(t)||[];n.length=0,n.push(e),this.paramsMap.set(t,n)},t.prototype.setAll=function(t){var e=this;t.paramsMap.forEach(function(t,n){var r=e.paramsMap.get(n)||[];r.length=0,r.push(t[0]),e.paramsMap.set(n,r)})},t.prototype.append=function(t,e){if(void 0!==e&&null!==e){var n=this.paramsMap.get(t)||[];n.push(e),this.paramsMap.set(t,n)}},t.prototype.appendAll=function(t){var e=this;t.paramsMap.forEach(function(t,n){for(var r=e.paramsMap.get(n)||[],o=0;o<t.length;++o)r.push(t[o]);e.paramsMap.set(n,r)})},t.prototype.replaceAll=function(t){var e=this;t.paramsMap.forEach(function(t,n){var r=e.paramsMap.get(n)||[];r.length=0;for(var o=0;o<t.length;++o)r.push(t[o]);e.paramsMap.set(n,r)})},t.prototype.toString=function(){var t=this,e=[];return this.paramsMap.forEach(function(n,r){n.forEach(function(n){return e.push(t.queryEncoder.encodeKey(r)+"="+t.queryEncoder.encodeValue(n))})}),e.join("&")},t.prototype.delete=function(t){this.paramsMap.delete(t)},t}(),M=function(){function t(){}return t.prototype.json=function(){return"string"==typeof this._body?JSON.parse(this._body):this._body instanceof ArrayBuffer?JSON.parse(this.text()):this._body},t.prototype.text=function(t){if(void 0===t&&(t="legacy"),this._body instanceof R)return this._body.toString();if(this._body instanceof ArrayBuffer)switch(t){case"legacy":return String.fromCharCode.apply(null,new Uint16Array(this._body));case"iso-8859":return String.fromCharCode.apply(null,new Uint8Array(this._body));default:throw new Error("Invalid value for encodingHint: "+t)}return null==this._body?"":"object"==typeof this._body?JSON.stringify(this._body,null,2):this._body.toString()},t.prototype.arrayBuffer=function(){return this._body instanceof ArrayBuffer?this._body:i(this.text())},t.prototype.blob=function(){if(this._body instanceof Blob)return this._body;if(this._body instanceof ArrayBuffer)return new Blob([this._body]);throw new Error("The request body isn't either a blob or an array buffer")},t}(),V=function(t){function e(e){var n=t.call(this)||this;return n._body=e.body,n.status=e.status,n.ok=n.status>=200&&n.status<=299,n.statusText=e.statusText,n.headers=e.headers,n.type=e.type,n.url=e.url,n}return v(e,t),e.prototype.toString=function(){return"Response with status: "+this.status+" "+this.statusText+" for URL: "+this.url},e}(M),N=0,j="__ng_jsonp__",I=null,F=function(){function t(){}return t.prototype.build=function(t){var e=document.createElement("script");return e.src=t,e},t.prototype.nextRequestID=function(){return"__req"+N++},t.prototype.requestCallback=function(t){return j+"."+t+".finished"},t.prototype.exposeConnection=function(t,e){u()[t]=e},t.prototype.removeConnection=function(t){u()[t]=null},t.prototype.send=function(t){document.body.appendChild(t)},t.prototype.cleanup=function(t){t.parentNode&&t.parentNode.removeChild(t)},t}();F.decorators=[{type:y.z}],F.ctorParameters=function(){return[]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var H="JSONP injected script did not invoke callback.",L="JSONP requests must use GET request method.",U=function(){function t(){}return t.prototype.finished=function(t){},t}(),z=function(t){function e(e,n,r){var o=t.call(this)||this;if(o._dom=n,o.baseResponseOptions=r,o._finished=!1,e.method!==_.Get)throw new TypeError(L);return o.request=e,o.response=new m.Observable(function(t){o.readyState=w.Loading;var i=o._id=n.nextRequestID();n.exposeConnection(i,o);var s=n.requestCallback(o._id),a=e.url;a.indexOf("=JSONP_CALLBACK&")>-1?a=a.replace("=JSONP_CALLBACK&","="+s+"&"):a.lastIndexOf("=JSONP_CALLBACK")===a.length-"=JSONP_CALLBACK".length&&(a=a.substring(0,a.length-"=JSONP_CALLBACK".length)+"="+s);var u=o._script=n.build(a),c=function(e){if(o.readyState!==w.Cancelled){if(o.readyState=w.Done,n.cleanup(u),!o._finished){var i=new P({body:H,type:C.Error,url:a});return r&&(i=r.merge(i)),void t.error(new V(i))}var s=new P({body:o._responseData,url:a});o.baseResponseOptions&&(s=o.baseResponseOptions.merge(s)),t.next(new V(s)),t.complete()}},l=function(e){if(o.readyState!==w.Cancelled){o.readyState=w.Done,n.cleanup(u);var i=new P({body:e.message,type:C.Error});r&&(i=r.merge(i)),t.error(new V(i))}};return u.addEventListener("load",c),u.addEventListener("error",l),n.send(u),function(){o.readyState=w.Cancelled,u.removeEventListener("load",c),u.removeEventListener("error",l),o._dom.cleanup(u)}}),o}return v(e,t),e.prototype.finished=function(t){this._finished=!0,this._dom.removeConnection(this._id),this.readyState!==w.Cancelled&&(this._responseData=t)},e}(U),B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e}(S),X=function(t){function e(e,n){var r=t.call(this)||this;return r._browserJSONP=e,r._baseResponseOptions=n,r}return v(e,t),e.prototype.createConnection=function(t){return new z(t,this._browserJSONP,this._baseResponseOptions)},e}(B);X.decorators=[{type:y.z}],X.ctorParameters=function(){return[{type:F},{type:P}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var W=/^\)\]\}',?\n/,G=function(){function t(t,e,n){var r=this;this.request=t,this.response=new m.Observable(function(i){var s=e.build();s.open(_[t.method].toUpperCase(),t.url),null!=t.withCredentials&&(s.withCredentials=t.withCredentials);var a=function(){var e=1223===s.status?204:s.status,r=null;204!==e&&"string"==typeof(r=void 0===s.response?s.responseText:s.response)&&(r=r.replace(W,"")),0===e&&(e=r?200:0);var a=x.fromResponseHeaderString(s.getAllResponseHeaders()),u=o(s)||t.url,c=s.statusText||"OK",l=new P({body:r,status:e,headers:a,statusText:c,url:u});null!=n&&(l=n.merge(l));var p=new V(l);if(p.ok=A(e),p.ok)return i.next(p),void i.complete();i.error(p)},u=function(t){var e=new P({body:t,type:C.Error,status:s.status,statusText:s.statusText});null!=n&&(e=n.merge(e)),i.error(new V(e))};if(r.setDetectedContentType(t,s),null==t.headers&&(t.headers=new x),t.headers.has("Accept")||t.headers.append("Accept","application/json, text/plain, */*"),t.headers.forEach(function(t,e){return s.setRequestHeader(e,t.join(","))}),null!=t.responseType&&null!=s.responseType)switch(t.responseType){case O.ArrayBuffer:s.responseType="arraybuffer";break;case O.Json:s.responseType="json";break;case O.Text:s.responseType="text";break;case O.Blob:s.responseType="blob";break;default:throw new Error("The selected responseType is not supported")}return s.addEventListener("load",a),s.addEventListener("error",u),s.send(r.request.getBody()),function(){s.removeEventListener("load",a),s.removeEventListener("error",u),s.abort()}})}return t.prototype.setDetectedContentType=function(t,e){if(null==t.headers||null==t.headers.get("Content-Type"))switch(t.contentType){case E.NONE:break;case E.JSON:e.setRequestHeader("content-type","application/json");break;case E.FORM:e.setRequestHeader("content-type","application/x-www-form-urlencoded;charset=UTF-8");break;case E.TEXT:e.setRequestHeader("content-type","text/plain");break;case E.BLOB:var n=t.blob();n.type&&e.setRequestHeader("content-type",n.type)}},t}(),K=function(){function t(t,e){void 0===t&&(t="XSRF-TOKEN"),void 0===e&&(e="X-XSRF-TOKEN"),this._cookieName=t,this._headerName=e}return t.prototype.configureRequest=function(t){var e=n.i(g.u)().getCookie(this._cookieName);e&&t.headers.set(this._headerName,e)},t}(),q=function(){function t(t,e,n){this._browserXHR=t,this._baseResponseOptions=e,this._xsrfStrategy=n}return t.prototype.createConnection=function(t){return this._xsrfStrategy.configureRequest(t),new G(t,this._browserXHR,this._baseResponseOptions)},t}();q.decorators=[{type:y.z}],q.ctorParameters=function(){return[{type:b},{type:P},{type:T}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Z=function(){function t(t){var e=void 0===t?{}:t,n=e.method,o=e.headers,i=e.body,s=e.url,a=e.search,u=e.params,c=e.withCredentials,l=e.responseType;this.method=null!=n?r(n):null,this.headers=null!=o?o:null,this.body=null!=i?i:null,this.url=null!=s?s:null,this.params=this._mergeSearchParams(u||a),this.withCredentials=null!=c?c:null,this.responseType=null!=l?l:null}return Object.defineProperty(t.prototype,"search",{get:function(){return this.params},set:function(t){this.params=t},enumerable:!0,configurable:!0}),t.prototype.merge=function(e){return new t({method:e&&null!=e.method?e.method:this.method,headers:e&&null!=e.headers?e.headers:new x(this.headers),body:e&&null!=e.body?e.body:this.body,url:e&&null!=e.url?e.url:this.url,params:e&&this._mergeSearchParams(e.params||e.search),withCredentials:e&&null!=e.withCredentials?e.withCredentials:this.withCredentials,responseType:e&&null!=e.responseType?e.responseType:this.responseType})},t.prototype._mergeSearchParams=function(t){return t?t instanceof R?t.clone():"string"==typeof t?new R(t):this._parseParams(t):this.params},t.prototype._parseParams=function(t){var e=this;void 0===t&&(t={});var n=new R;return Object.keys(t).forEach(function(r){var o=t[r];Array.isArray(o)?o.forEach(function(t){return e._appendParam(r,t,n)}):e._appendParam(r,o,n)}),n},t.prototype._appendParam=function(t,e,n){"string"!=typeof e&&(e=JSON.stringify(e)),n.append(t,e)},t}(),Q=function(t){function e(){return t.call(this,{method:_.Get,headers:new x})||this}return v(e,t),e}(Z);Q.decorators=[{type:y.z}],Q.ctorParameters=function(){return[]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var J=function(t){function e(e){var n=t.call(this)||this,o=e.url;n.url=e.url;var i=e.params||e.search;if(i){var s=void 0;if(s="object"!=typeof i||i instanceof R?i.toString():c(i).toString(),s.length>0){var a="?";-1!=n.url.indexOf("?")&&(a="&"==n.url[n.url.length-1]?"":"&"),n.url=o+a+s}}return n._body=e.body,n.method=r(e.method),n.headers=new x(e.headers),n.contentType=n.detectContentType(),n.withCredentials=e.withCredentials,n.responseType=e.responseType,n}return v(e,t),e.prototype.detectContentType=function(){switch(this.headers.get("content-type")){case"application/json":return E.JSON;case"application/x-www-form-urlencoded":return E.FORM;case"multipart/form-data":return E.FORM_DATA;case"text/plain":case"text/html":return E.TEXT;case"application/octet-stream":return this._body instanceof nt?E.ARRAY_BUFFER:E.BLOB;default:return this.detectContentTypeFromBody()}},e.prototype.detectContentTypeFromBody=function(){return null==this._body?E.NONE:this._body instanceof R?E.FORM:this._body instanceof tt?E.FORM_DATA:this._body instanceof et?E.BLOB:this._body instanceof nt?E.ARRAY_BUFFER:this._body&&"object"==typeof this._body?E.JSON:E.TEXT},e.prototype.getBody=function(){switch(this.contentType){case E.JSON:case E.FORM:return this.text();case E.FORM_DATA:return this._body;case E.TEXT:return this.text();case E.BLOB:return this.blob();case E.ARRAY_BUFFER:return this.arrayBuffer();default:return null}},e}(M),Y=function(){},$="object"==typeof window?window:Y,tt=$.FormData||Y,et=$.Blob||Y,nt=$.ArrayBuffer||Y,rt=function(){function t(t,e){this._backend=t,this._defaultOptions=e}return t.prototype.request=function(t,e){var n;if("string"==typeof t)n=l(this._backend,new J(p(this._defaultOptions,e,_.Get,t)));else{if(!(t instanceof J))throw new Error("First argument must be a url string or Request instance.");n=l(this._backend,t)}return n},t.prototype.get=function(t,e){return this.request(new J(p(this._defaultOptions,e,_.Get,t)))},t.prototype.post=function(t,e,n){return this.request(new J(p(this._defaultOptions.merge(new Z({body:e})),n,_.Post,t)))},t.prototype.put=function(t,e,n){return this.request(new J(p(this._defaultOptions.merge(new Z({body:e})),n,_.Put,t)))},t.prototype.delete=function(t,e){return this.request(new J(p(this._defaultOptions,e,_.Delete,t)))},t.prototype.patch=function(t,e,n){return this.request(new J(p(this._defaultOptions.merge(new Z({body:e})),n,_.Patch,t)))},t.prototype.head=function(t,e){return this.request(new J(p(this._defaultOptions,e,_.Head,t)))},t.prototype.options=function(t,e){return this.request(new J(p(this._defaultOptions,e,_.Options,t)))},t}();rt.decorators=[{type:y.z}],rt.ctorParameters=function(){return[{type:S},{type:Z}]};var ot=function(t){function e(e,n){return t.call(this,e,n)||this}return v(e,t),e.prototype.request=function(t,e){if("string"==typeof t&&(t=new J(p(this._defaultOptions,e,_.Get,t))),!(t instanceof J))throw new Error("First argument must be a url string or Request instance.");if(t.method!==_.Get)throw new Error("JSONP requests must use GET request method.");return l(this._backend,t)},e}(rt);ot.decorators=[{type:y.z}],ot.ctorParameters=function(){return[{type:S},{type:Z}]};var it=function(){function t(){}return t}();it.decorators=[{type:y.A,args:[{providers:[{provide:rt,useFactory:h,deps:[q,Z]},b,{provide:Z,useClass:Q},{provide:P,useClass:k},q,{provide:T,useFactory:f}]}]}],it.ctorParameters=function(){return[]};var st=function(){function t(){}return t}();st.decorators=[{type:y.A,args:[{providers:[{provide:ot,useFactory:d,deps:[B,Z]},F,{provide:Z,useClass:Q},{provide:P,useClass:k},{provide:B,useClass:X}]}]}],st.ctorParameters=function(){return[]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ new y.B("4.1.2")},GIjk:function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=function(t){function e(e){t.call(this),this.errors=e;var n=Error.call(this,e?e.length+" errors occurred during unsubscription:\n "+e.map(function(t,e){return e+1+") "+t.toString()}).join("\n "):"");this.name=n.name="UnsubscriptionError",this.stack=n.stack,this.message=n.message}return r(e,t),e}(Error);e.UnsubscriptionError=o},ICpg:function(t,e,n){"use strict";function r(t){return null!=t&&"object"==typeof t}e.isObject=r},IZVw:function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=function(t){function e(){var e=t.call(this,"object unsubscribed");this.name=e.name="ObjectUnsubscribedError",this.stack=e.stack,this.message=e.message}return r(e,t),e}(Error);e.ObjectUnsubscribedError=o},"K/oD":function(t,e,n){"use strict";var r=n("3j3K"),o=n("2Je8"),i=n("EzwU"),s=n("2BXm"),a=n("qoi6"),u=n("cG9e");n.d(e,"a",function(){return c});var c=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[u.a]}},t}();c.decorators=[{type:r.A,args:[{declarations:[a.a,i.a,s.a],exports:[a.a],imports:[o.b],entryComponents:[s.a]}]}],c.ctorParameters=function(){return[]}},K0TW:function(t,e,n){"use strict";var r=n("3j3K");n.d(e,"a",function(){return o});var o=function(){function t(){this.disabled=!1,this.boundaryLinks=!1,this.directionLinks=!0,this.ellipses=!0,this.maxSize=0,this.pageSize=10,this.rotate=!1}return t}();o.decorators=[{type:r.z}],o.ctorParameters=function(){return[]}},M0cT:function(t,e,n){"use strict";var r=n("3j3K"),o=n("+dDw");n.d(e,"a",function(){return s});var i=[o.a,o.b,o.c],s=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[]}},t}();s.decorators=[{type:r.A,args:[{declarations:i,exports:i}]}],s.ctorParameters=function(){return[]}},MSQt:function(t,e,n){"use strict";var r=n("3j3K"),o=n("6uCv"),i=n("c7mC");n.d(e,"a",function(){return a});var s=[o.a,o.b],a=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[i.a]}},t}();a.decorators=[{type:r.A,args:[{declarations:s,exports:s}]}],a.ctorParameters=function(){return[]}},NVOs:function(t,e,n){"use strict";function r(t){return null==t||0===t.length}function o(t){return null!=t}function i(t){var e=n.i(M._5)(t)?n.i(N.fromPromise)(t):t;if(!n.i(M._6)(e))throw new Error("Expected validator to return Promise or Observable.");return e}function s(t,e){return e.map(function(e){return e(t)})}function a(t,e){return e.map(function(e){return e(t)})}function u(t){var e=t.reduce(function(t,e){return null!=e?U({},t,e):t},{});return 0===Object.keys(e).length?null:e}function c(){return/android (\d+)/.test((n.i(I.u)()?n.i(I.u)().getUserAgent():"").toLowerCase())}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function l(t){return t.validate?function(e){return t.validate(e)}:t}function p(t){return t.validate?function(e){return t.validate(e)}:t}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function f(){throw new Error("unimplemented")}function h(t,e){return null==t?""+e:(e&&"object"==typeof e&&(e="Object"),(t+": "+e).slice(0,50))}function d(t){return t.split(":")[0]}function y(t,e){return null==t?""+e:("string"==typeof e&&(e="'"+e+"'"),e&&"object"==typeof e&&(e="Object"),(t+": "+e).slice(0,50))}function m(t){return t.split(":")[0]}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ function g(t,e){return e.path.concat([t])}function v(t,e){t||C(e,"Cannot find control with"),e.valueAccessor||C(e,"No value accessor for form control with"),t.validator=W.compose([t.validator,e.validator]),t.asyncValidator=W.composeAsync([t.asyncValidator,e.asyncValidator]),e.valueAccessor.writeValue(t.value),e.valueAccessor.registerOnChange(function(n){e.viewToModelUpdate(n),t.markAsDirty(),t.setValue(n,{emitModelToViewChange:!1})}),e.valueAccessor.registerOnTouched(function(){return t.markAsTouched()}),t.registerOnChange(function(t,n){e.valueAccessor.writeValue(t),n&&e.viewToModelUpdate(t)}),e.valueAccessor.setDisabledState&&t.registerOnDisabledChange(function(t){e.valueAccessor.setDisabledState(t)}),e._rawValidators.forEach(function(e){e.registerOnValidatorChange&&e.registerOnValidatorChange(function(){return t.updateValueAndValidity()})}),e._rawAsyncValidators.forEach(function(e){e.registerOnValidatorChange&&e.registerOnValidatorChange(function(){return t.updateValueAndValidity()})})}function b(t,e){e.valueAccessor.registerOnChange(function(){return w(e)}),e.valueAccessor.registerOnTouched(function(){return w(e)}),e._rawValidators.forEach(function(t){t.registerOnValidatorChange&&t.registerOnValidatorChange(null)}),e._rawAsyncValidators.forEach(function(t){t.registerOnValidatorChange&&t.registerOnValidatorChange(null)}),t&&t._clearChangeFns()}function _(t,e){null==t&&C(e,"Cannot find control with"),t.validator=W.compose([t.validator,e.validator]),t.asyncValidator=W.composeAsync([t.asyncValidator,e.asyncValidator])}function w(t){return C(t,"There is no FormControl instance attached to form control element with")}function C(t,e){var n;throw n=t.path.length>1?"path: '"+t.path.join(" -> ")+"'":t.path[0]?"name: '"+t.path+"'":"unspecified name attribute",new Error(e+" "+n)}function E(t){return null!=t?W.compose(t.map(l)):null}function O(t){return null!=t?W.composeAsync(t.map(p)):null}function x(t,e){if(!t.hasOwnProperty("model"))return!1;var r=t.model;return!!r.isFirstChange()||!n.i(M._12)(e,r.currentValue)}function P(t){return ft.some(function(e){return t.constructor===e})}function k(t,e){if(!e)return null;var n=void 0,r=void 0,o=void 0;return e.forEach(function(e){e.constructor===J?n=e:P(e)?(r&&C(t,"More than one built-in value accessor matches form control with"),r=e):(o&&C(t,"More than one custom value accessor matches form control with"),o=e)}),o||(r||(n||(C(t,"No valid value accessor for form control with"),null)))}function S(t,e,n){return null==e?null:(e instanceof Array||(e=e.split(n)),e instanceof Array&&0===e.length?null:e.reduce(function(t,e){return t instanceof Ot?t.controls[e]||null:t instanceof xt?t.at(e)||null:null},t))}function T(t){return Array.isArray(t)?E(t):t||null}function A(t){return Array.isArray(t)?O(t):t||null}function D(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)}function R(t){return!(t instanceof zt||t instanceof Lt||t instanceof Xt)}var M=n("3j3K"),V=n("7rB9"),N=(n.n(V),n("ioK+")),j=(n.n(N),n("xAJs")),I=(n.n(j),n("Qbdm"));n.d(e,"k",function(){return L}),n.d(e,"e",function(){return G}),n.d(e,"i",function(){return Q}),n.d(e,"h",function(){return J}),n.d(e,"l",function(){return tt}),n.d(e,"m",function(){return mt}),n.d(e,"p",function(){return gt}),n.d(e,"o",function(){return St}),n.d(e,"j",function(){return Nt}),n.d(e,"q",function(){return ut}),n.d(e,"b",function(){return ie}),n.d(e,"g",function(){return Et}),n.d(e,"f",function(){return z}),n.d(e,"d",function(){return pe}),n.d(e,"c",function(){return le}),n.d(e,"n",function(){return se}),n.d(e,"a",function(){return nt}),n.d(e,"r",function(){return pt});var F=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},H=function(){function t(){}return t.prototype.control=function(){},Object.defineProperty(t.prototype,"value",{get:function(){return this.control?this.control.value:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return this.control?this.control.valid:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"invalid",{get:function(){return this.control?this.control.invalid:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pending",{get:function(){return this.control?this.control.pending:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"errors",{get:function(){return this.control?this.control.errors:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pristine",{get:function(){return this.control?this.control.pristine:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dirty",{get:function(){return this.control?this.control.dirty:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"touched",{get:function(){return this.control?this.control.touched:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"untouched",{get:function(){return this.control?this.control.untouched:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this.control?this.control.disabled:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enabled",{get:function(){return this.control?this.control.enabled:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"statusChanges",{get:function(){return this.control?this.control.statusChanges:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valueChanges",{get:function(){return this.control?this.control.valueChanges:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"path",{get:function(){return null},enumerable:!0,configurable:!0}),t.prototype.reset=function(t){void 0===t&&(t=void 0),this.control&&this.control.reset(t)},t.prototype.hasError=function(t,e){return!!this.control&&this.control.hasError(t,e)},t.prototype.getError=function(t,e){return this.control?this.control.getError(t,e):null},t}(),L=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return F(e,t),Object.defineProperty(e.prototype,"formDirective",{get:function(){return null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return null},enumerable:!0,configurable:!0}),e}(H),U=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},z=new M.D("NgValidators"),B=new M.D("NgAsyncValidators"),X=/^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+\/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/,W=function(){function t(){}return t.required=function(t){return r(t.value)?{required:!0}:null},t.requiredTrue=function(t){return!0===t.value?null:{required:!0}},t.email=function(t){return X.test(t.value)?null:{email:!0}},t.minLength=function(t){return function(e){if(r(e.value))return null;var n=e.value?e.value.length:0;return n<t?{minlength:{requiredLength:t,actualLength:n}}:null}},t.maxLength=function(t){return function(e){var n=e.value?e.value.length:0;return n>t?{maxlength:{requiredLength:t,actualLength:n}}:null}},t.pattern=function(e){if(!e)return t.nullValidator;var n,o;return"string"==typeof e?(o="^"+e+"$",n=new RegExp(o)):(o=e.toString(),n=e),function(t){if(r(t.value))return null;var e=t.value;return n.test(e)?null:{pattern:{requiredPattern:o,actualValue:e}}}},t.nullValidator=function(t){return null},t.compose=function(t){if(!t)return null;var e=t.filter(o);return 0==e.length?null:function(t){return u(s(t,e))}},t.composeAsync=function(t){if(!t)return null;var e=t.filter(o);return 0==e.length?null:function(t){var r=a(t,e).map(i);return j.map.call(n.i(V.forkJoin)(r),u)}},t}(),G=new M.D("NgValueAccessor"),K={provide:G,useExisting:n.i(M._9)(function(){return q}),multi:!0},q=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"checked",t)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t}();q.decorators=[{type:M.U,args:[{selector:"input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]",host:{"(change)":"onChange($event.target.checked)","(blur)":"onTouched()"},providers:[K]}]}],q.ctorParameters=function(){return[{type:M.W},{type:M.V}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Z={provide:G,useExisting:n.i(M._9)(function(){return J}),multi:!0},Q=new M.D("CompositionEventMode"),J=function(){function t(t,e,n){this._renderer=t,this._elementRef=e,this._compositionMode=n,this.onChange=function(t){},this.onTouched=function(){},this._composing=!1,null==this._compositionMode&&(this._compositionMode=!c())}return t.prototype.writeValue=function(t){var e=null==t?"":t;this._renderer.setElementProperty(this._elementRef.nativeElement,"value",e)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._handleInput=function(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)},t.prototype._compositionStart=function(){this._composing=!0},t.prototype._compositionEnd=function(t){this._composing=!1,this._compositionMode&&this.onChange(t)},t}();J.decorators=[{type:M.U,args:[{selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]",host:{"(input)":"_handleInput($event.target.value)","(blur)":"onTouched()","(compositionstart)":"_compositionStart()","(compositionend)":"_compositionEnd($event.target.value)"},providers:[Z]}]}],J.ctorParameters=function(){return[{type:M.W},{type:M.V},{type:void 0,decorators:[{type:M.H},{type:M.E,args:[Q]}]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Y={provide:G,useExisting:n.i(M._9)(function(){return $}),multi:!0},$=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){var e=null==t?"":t;this._renderer.setElementProperty(this._elementRef.nativeElement,"value",e)},t.prototype.registerOnChange=function(t){this.onChange=function(e){t(""==e?null:parseFloat(e))}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t}();$.decorators=[{type:M.U,args:[{selector:"input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]",host:{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[Y]}]}],$.ctorParameters=function(){return[{type:M.W},{type:M.V}]};var tt=function(t){function e(){var e=t.apply(this,arguments)||this;return e._parent=null,e.name=null,e.valueAccessor=null,e._rawValidators=[],e._rawAsyncValidators=[],e}return F(e,t),Object.defineProperty(e.prototype,"validator",{get:function(){return f()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return f()},enumerable:!0,configurable:!0}),e.prototype.viewToModelUpdate=function(t){},e}(H),et={provide:G,useExisting:n.i(M._9)(function(){return rt}),multi:!0},nt=function(){function t(){this._accessors=[]}return t.prototype.add=function(t,e){this._accessors.push([t,e])},t.prototype.remove=function(t){for(var e=this._accessors.length-1;e>=0;--e)if(this._accessors[e][1]===t)return void this._accessors.splice(e,1)},t.prototype.select=function(t){var e=this;this._accessors.forEach(function(n){e._isSameGroup(n,t)&&n[1]!==t&&n[1].fireUncheck(t.value)})},t.prototype._isSameGroup=function(t,e){return!!t[0].control&&(t[0]._parent===e._control._parent&&t[1].name===e.name)},t}();nt.decorators=[{type:M.z}],nt.ctorParameters=function(){return[]};var rt=function(){function t(t,e,n,r){this._renderer=t,this._elementRef=e,this._registry=n,this._injector=r,this.onChange=function(){},this.onTouched=function(){}}return t.prototype.ngOnInit=function(){this._control=this._injector.get(tt),this._checkName(),this._registry.add(this._control,this)},t.prototype.ngOnDestroy=function(){this._registry.remove(this)},t.prototype.writeValue=function(t){this._state=t===this.value,this._renderer.setElementProperty(this._elementRef.nativeElement,"checked",this._state)},t.prototype.registerOnChange=function(t){var e=this;this._fn=t,this.onChange=function(){t(e.value),e._registry.select(e)}},t.prototype.fireUncheck=function(t){this.writeValue(t)},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._checkName=function(){this.name&&this.formControlName&&this.name!==this.formControlName&&this._throwNameError(),!this.name&&this.formControlName&&(this.name=this.formControlName)},t.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: <input type="radio" formControlName="food" name="food">\n ')},t}();rt.decorators=[{type:M.U,args:[{selector:"input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]",host:{"(change)":"onChange()","(blur)":"onTouched()"},providers:[et]}]}],rt.ctorParameters=function(){return[{type:M.W},{type:M.V},{type:nt},{type:M._11}]},rt.propDecorators={name:[{type:M.X}],formControlName:[{type:M.X}],value:[{type:M.X}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var ot={provide:G,useExisting:n.i(M._9)(function(){return it}),multi:!0},it=function(){function t(t,e){this._renderer=t,this._elementRef=e,this.onChange=function(t){},this.onTouched=function(){}}return t.prototype.writeValue=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"value",parseFloat(t))},t.prototype.registerOnChange=function(t){this.onChange=function(e){t(""==e?null:parseFloat(e))}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t}();it.decorators=[{type:M.U,args:[{selector:"input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]",host:{"(change)":"onChange($event.target.value)","(input)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[ot]}]}],it.ctorParameters=function(){return[{type:M.W},{type:M.V}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var st={provide:G,useExisting:n.i(M._9)(function(){return at}),multi:!0},at=function(){function t(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=function(t){},this.onTouched=function(){},this._compareWith=M._12}return Object.defineProperty(t.prototype,"compareWith",{set:function(t){if("function"!=typeof t)throw new Error("compareWith must be a function, but received "+JSON.stringify(t));this._compareWith=t},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){this.value=t;var e=this._getOptionId(t);null==e&&this._renderer.setElementProperty(this._elementRef.nativeElement,"selectedIndex",-1);var n=h(e,t);this._renderer.setElementProperty(this._elementRef.nativeElement,"value",n)},t.prototype.registerOnChange=function(t){var e=this;this.onChange=function(n){e.value=n,t(e._getOptionValue(n))}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._registerOption=function(){return(this._idCounter++).toString()},t.prototype._getOptionId=function(t){for(var e=0,n=Array.from(this._optionMap.keys());e<n.length;e++){var r=n[e];if(this._compareWith(this._optionMap.get(r),t))return r}return null},t.prototype._getOptionValue=function(t){var e=d(t);return this._optionMap.has(e)?this._optionMap.get(e):t},t}();at.decorators=[{type:M.U,args:[{selector:"select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]",host:{"(change)":"onChange($event.target.value)","(blur)":"onTouched()"},providers:[st]}]}],at.ctorParameters=function(){return[{type:M.W},{type:M.V}]},at.propDecorators={compareWith:[{type:M.X}]};var ut=function(){function t(t,e,n){this._element=t,this._renderer=e,this._select=n,this._select&&(this.id=this._select._registerOption())}return Object.defineProperty(t.prototype,"ngValue",{set:function(t){null!=this._select&&(this._select._optionMap.set(this.id,t),this._setElementValue(h(this.id,t)),this._select.writeValue(this._select.value))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{set:function(t){this._setElementValue(t),this._select&&this._select.writeValue(this._select.value)},enumerable:!0,configurable:!0}),t.prototype._setElementValue=function(t){this._renderer.setElementProperty(this._element.nativeElement,"value",t)},t.prototype.ngOnDestroy=function(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))},t}();ut.decorators=[{type:M.U,args:[{selector:"option"}]}],ut.ctorParameters=function(){return[{type:M.V},{type:M.W},{type:at,decorators:[{type:M.H},{type:M._2}]}]},ut.propDecorators={ngValue:[{type:M.X,args:["ngValue"]}],value:[{type:M.X,args:["value"]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var ct={provide:G,useExisting:n.i(M._9)(function(){return lt}),multi:!0},lt=function(){function t(t,e){this._renderer=t,this._elementRef=e,this._optionMap=new Map,this._idCounter=0,this.onChange=function(t){},this.onTouched=function(){},this._compareWith=M._12}return Object.defineProperty(t.prototype,"compareWith",{set:function(t){if("function"!=typeof t)throw new Error("compareWith must be a function, but received "+JSON.stringify(t));this._compareWith=t},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){var e=this;this.value=t;var n;if(Array.isArray(t)){var r=t.map(function(t){return e._getOptionId(t)});n=function(t,e){t._setSelected(r.indexOf(e.toString())>-1)}}else n=function(t,e){t._setSelected(!1)};this._optionMap.forEach(n)},t.prototype.registerOnChange=function(t){var e=this;this.onChange=function(n){var r=[];if(n.hasOwnProperty("selectedOptions"))for(var o=n.selectedOptions,i=0;i<o.length;i++){var s=o.item(i),a=e._getOptionValue(s.value);r.push(a)}else for(var o=n.options,i=0;i<o.length;i++){var s=o.item(i);if(s.selected){var a=e._getOptionValue(s.value);r.push(a)}}e.value=r,t(r)}},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype._registerOption=function(t){var e=(this._idCounter++).toString();return this._optionMap.set(e,t),e},t.prototype._getOptionId=function(t){for(var e=0,n=Array.from(this._optionMap.keys());e<n.length;e++){var r=n[e];if(this._compareWith(this._optionMap.get(r)._value,t))return r}return null},t.prototype._getOptionValue=function(t){var e=m(t);return this._optionMap.has(e)?this._optionMap.get(e)._value:t},t}();lt.decorators=[{type:M.U,args:[{selector:"select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]",host:{"(change)":"onChange($event.target)","(blur)":"onTouched()"},providers:[ct]}]}],lt.ctorParameters=function(){return[{type:M.W},{type:M.V}]},lt.propDecorators={compareWith:[{type:M.X}]};var pt=function(){function t(t,e,n){this._element=t,this._renderer=e,this._select=n,this._select&&(this.id=this._select._registerOption(this))}return Object.defineProperty(t.prototype,"ngValue",{set:function(t){null!=this._select&&(this._value=t,this._setElementValue(y(this.id,t)),this._select.writeValue(this._select.value))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{set:function(t){this._select?(this._value=t,this._setElementValue(y(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)},enumerable:!0,configurable:!0}),t.prototype._setElementValue=function(t){this._renderer.setElementProperty(this._element.nativeElement,"value",t)},t.prototype._setSelected=function(t){this._renderer.setElementProperty(this._element.nativeElement,"selected",t)},t.prototype.ngOnDestroy=function(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))},t}();pt.decorators=[{type:M.U,args:[{selector:"option"}]}],pt.ctorParameters=function(){return[{type:M.V},{type:M.W},{type:lt,decorators:[{type:M.H},{type:M._2}]}]},pt.propDecorators={ngValue:[{type:M.X,args:["ngValue"]}],value:[{type:M.X,args:["value"]}]};var ft=[q,it,$,at,lt,rt],ht=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return F(e,t),e.prototype.ngOnInit=function(){this._checkParentType(),this.formDirective.addFormGroup(this)},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeFormGroup(this)},Object.defineProperty(e.prototype,"control",{get:function(){return this.formDirective.getFormGroup(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return g(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return E(this._validators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return O(this._asyncValidators)},enumerable:!0,configurable:!0}),e.prototype._checkParentType=function(){},e}(L),dt=function(){function t(t){this._cd=t}return Object.defineProperty(t.prototype,"ngClassUntouched",{get:function(){return!!this._cd.control&&this._cd.control.untouched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassTouched",{get:function(){return!!this._cd.control&&this._cd.control.touched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassPristine",{get:function(){return!!this._cd.control&&this._cd.control.pristine},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassDirty",{get:function(){return!!this._cd.control&&this._cd.control.dirty},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassValid",{get:function(){return!!this._cd.control&&this._cd.control.valid},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassInvalid",{get:function(){return!!this._cd.control&&this._cd.control.invalid},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ngClassPending",{get:function(){return!!this._cd.control&&this._cd.control.pending},enumerable:!0,configurable:!0}),t}(),yt={"[class.ng-untouched]":"ngClassUntouched","[class.ng-touched]":"ngClassTouched","[class.ng-pristine]":"ngClassPristine","[class.ng-dirty]":"ngClassDirty","[class.ng-valid]":"ngClassValid","[class.ng-invalid]":"ngClassInvalid","[class.ng-pending]":"ngClassPending"},mt=function(t){function e(e){return t.call(this,e)||this}return F(e,t),e}(dt);mt.decorators=[{type:M.U,args:[{selector:"[formControlName],[ngModel],[formControl]",host:yt}]}],mt.ctorParameters=function(){return[{type:tt,decorators:[{type:M._13}]}]};var gt=function(t){function e(e){return t.call(this,e)||this}return F(e,t),e}(dt);gt.decorators=[{type:M.U,args:[{selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]",host:yt}]}],gt.ctorParameters=function(){return[{type:L,decorators:[{type:M._13}]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var vt="VALID",bt="INVALID",_t="PENDING",wt="DISABLED",Ct=function(){function t(t,e){this.validator=t,this.asyncValidator=e,this._onCollectionChange=function(){},this._pristine=!0,this._touched=!1,this._onDisabledChange=[]}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this._parent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"status",{get:function(){return this._status},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valid",{get:function(){return this._status===vt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"invalid",{get:function(){return this._status===bt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pending",{get:function(){return this._status==_t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._status===wt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"enabled",{get:function(){return this._status!==wt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"errors",{get:function(){return this._errors},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pristine",{get:function(){return this._pristine},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dirty",{get:function(){return!this.pristine},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"touched",{get:function(){return this._touched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"untouched",{get:function(){return!this._touched},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"valueChanges",{get:function(){return this._valueChanges},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"statusChanges",{get:function(){return this._statusChanges},enumerable:!0,configurable:!0}),t.prototype.setValidators=function(t){this.validator=T(t)},t.prototype.setAsyncValidators=function(t){this.asyncValidator=A(t)},t.prototype.clearValidators=function(){this.validator=null},t.prototype.clearAsyncValidators=function(){this.asyncValidator=null},t.prototype.markAsTouched=function(t){var e=(void 0===t?{}:t).onlySelf;this._touched=!0,this._parent&&!e&&this._parent.markAsTouched({onlySelf:e})},t.prototype.markAsUntouched=function(t){var e=(void 0===t?{}:t).onlySelf;this._touched=!1,this._forEachChild(function(t){t.markAsUntouched({onlySelf:!0})}),this._parent&&!e&&this._parent._updateTouched({onlySelf:e})},t.prototype.markAsDirty=function(t){var e=(void 0===t?{}:t).onlySelf;this._pristine=!1,this._parent&&!e&&this._parent.markAsDirty({onlySelf:e})},t.prototype.markAsPristine=function(t){var e=(void 0===t?{}:t).onlySelf;this._pristine=!0,this._forEachChild(function(t){t.markAsPristine({onlySelf:!0})}),this._parent&&!e&&this._parent._updatePristine({onlySelf:e})},t.prototype.markAsPending=function(t){var e=(void 0===t?{}:t).onlySelf;this._status=_t,this._parent&&!e&&this._parent.markAsPending({onlySelf:e})},t.prototype.disable=function(t){var e=void 0===t?{}:t,n=e.onlySelf,r=e.emitEvent;this._status=wt,this._errors=null,this._forEachChild(function(t){t.disable({onlySelf:!0})}),this._updateValue(),!1!==r&&(this._valueChanges.emit(this._value),this._statusChanges.emit(this._status)),this._updateAncestors(!!n),this._onDisabledChange.forEach(function(t){return t(!0)})},t.prototype.enable=function(t){var e=void 0===t?{}:t,n=e.onlySelf,r=e.emitEvent;this._status=vt,this._forEachChild(function(t){t.enable({onlySelf:!0})}),this.updateValueAndValidity({onlySelf:!0,emitEvent:r}),this._updateAncestors(!!n),this._onDisabledChange.forEach(function(t){return t(!1)})},t.prototype._updateAncestors=function(t){this._parent&&!t&&(this._parent.updateValueAndValidity(),this._parent._updatePristine(),this._parent._updateTouched())},t.prototype.setParent=function(t){this._parent=t},t.prototype.setValue=function(t,e){},t.prototype.patchValue=function(t,e){},t.prototype.reset=function(t,e){},t.prototype.updateValueAndValidity=function(t){var e=void 0===t?{}:t,n=e.onlySelf,r=e.emitEvent;this._setInitialStatus(),this._updateValue(),this.enabled&&(this._cancelExistingSubscription(),this._errors=this._runValidator(),this._status=this._calculateStatus(),this._status!==vt&&this._status!==_t||this._runAsyncValidator(r)),!1!==r&&(this._valueChanges.emit(this._value),this._statusChanges.emit(this._status)),this._parent&&!n&&this._parent.updateValueAndValidity({onlySelf:n,emitEvent:r})},t.prototype._updateTreeValidity=function(t){var e=(void 0===t?{emitEvent:!0}:t).emitEvent;this._forEachChild(function(t){return t._updateTreeValidity({emitEvent:e})}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e})},t.prototype._setInitialStatus=function(){this._status=this._allControlsDisabled()?wt:vt},t.prototype._runValidator=function(){return this.validator?this.validator(this):null},t.prototype._runAsyncValidator=function(t){var e=this;if(this.asyncValidator){this._status=_t;var n=i(this.asyncValidator(this));this._asyncValidationSubscription=n.subscribe(function(n){return e.setErrors(n,{emitEvent:t})})}},t.prototype._cancelExistingSubscription=function(){this._asyncValidationSubscription&&this._asyncValidationSubscription.unsubscribe()},t.prototype.setErrors=function(t,e){var n=(void 0===e?{}:e).emitEvent;this._errors=t,this._updateControlsErrors(!1!==n)},t.prototype.get=function(t){return S(this,t,".")},t.prototype.getError=function(t,e){var n=e?this.get(e):this;return n&&n._errors?n._errors[t]:null},t.prototype.hasError=function(t,e){return!!this.getError(t,e)},Object.defineProperty(t.prototype,"root",{get:function(){for(var t=this;t._parent;)t=t._parent;return t},enumerable:!0,configurable:!0}),t.prototype._updateControlsErrors=function(t){this._status=this._calculateStatus(),t&&this._statusChanges.emit(this._status),this._parent&&this._parent._updateControlsErrors(t)},t.prototype._initObservables=function(){this._valueChanges=new M.R,this._statusChanges=new M.R},t.prototype._calculateStatus=function(){return this._allControlsDisabled()?wt:this._errors?bt:this._anyControlsHaveStatus(_t)?_t:this._anyControlsHaveStatus(bt)?bt:vt},t.prototype._updateValue=function(){},t.prototype._forEachChild=function(t){},t.prototype._anyControls=function(t){},t.prototype._allControlsDisabled=function(){},t.prototype._anyControlsHaveStatus=function(t){return this._anyControls(function(e){return e.status===t})},t.prototype._anyControlsDirty=function(){return this._anyControls(function(t){return t.dirty})},t.prototype._anyControlsTouched=function(){return this._anyControls(function(t){return t.touched})},t.prototype._updatePristine=function(t){var e=(void 0===t?{}:t).onlySelf;this._pristine=!this._anyControlsDirty(),this._parent&&!e&&this._parent._updatePristine({onlySelf:e})},t.prototype._updateTouched=function(t){var e=(void 0===t?{}:t).onlySelf;this._touched=this._anyControlsTouched(),this._parent&&!e&&this._parent._updateTouched({onlySelf:e})},t.prototype._isBoxedValue=function(t){return"object"==typeof t&&null!==t&&2===Object.keys(t).length&&"value"in t&&"disabled"in t},t.prototype._registerOnCollectionChange=function(t){this._onCollectionChange=t},t}(),Et=function(t){function e(e,n,r){void 0===e&&(e=null);var o=t.call(this,T(n),A(r))||this;return o._onChange=[],o._applyFormState(e),o.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),o._initObservables(),o}return F(e,t),e.prototype.setValue=function(t,e){var n=this;void 0===e&&(e={}),this._value=t,this._onChange.length&&!1!==e.emitModelToViewChange&&this._onChange.forEach(function(t){return t(n._value,!1!==e.emitViewToModelChange)}),this.updateValueAndValidity(e)},e.prototype.patchValue=function(t,e){void 0===e&&(e={}),this.setValue(t,e)},e.prototype.reset=function(t,e){void 0===t&&(t=null),void 0===e&&(e={}),this._applyFormState(t),this.markAsPristine(e),this.markAsUntouched(e),this.setValue(this._value,e)},e.prototype._updateValue=function(){},e.prototype._anyControls=function(t){return!1},e.prototype._allControlsDisabled=function(){return this.disabled},e.prototype.registerOnChange=function(t){this._onChange.push(t)},e.prototype._clearChangeFns=function(){this._onChange=[],this._onDisabledChange=[],this._onCollectionChange=function(){}},e.prototype.registerOnDisabledChange=function(t){this._onDisabledChange.push(t)},e.prototype._forEachChild=function(t){},e.prototype._applyFormState=function(t){this._isBoxedValue(t)?(this._value=t.value,t.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this._value=t},e}(Ct),Ot=function(t){function e(e,n,r){var o=t.call(this,n||null,r||null)||this;return o.controls=e,o._initObservables(),o._setUpControls(),o.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),o}return F(e,t),e.prototype.registerControl=function(t,e){return this.controls[t]?this.controls[t]:(this.controls[t]=e,e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange),e)},e.prototype.addControl=function(t,e){this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.removeControl=function(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),delete this.controls[t],this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.setControl=function(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),delete this.controls[t],e&&this.registerControl(t,e),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.contains=function(t){return this.controls.hasOwnProperty(t)&&this.controls[t].enabled},e.prototype.setValue=function(t,e){var n=this;void 0===e&&(e={}),this._checkAllValuesPresent(t),Object.keys(t).forEach(function(r){n._throwIfControlMissing(r),n.controls[r].setValue(t[r],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)},e.prototype.patchValue=function(t,e){var n=this;void 0===e&&(e={}),Object.keys(t).forEach(function(r){n.controls[r]&&n.controls[r].patchValue(t[r],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)},e.prototype.reset=function(t,e){void 0===t&&(t={}),void 0===e&&(e={}),this._forEachChild(function(n,r){n.reset(t[r],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e),this._updatePristine(e),this._updateTouched(e)},e.prototype.getRawValue=function(){return this._reduceChildren({},function(t,e,n){return t[n]=e instanceof Et?e.value:e.getRawValue(),t})},e.prototype._throwIfControlMissing=function(t){if(!Object.keys(this.controls).length)throw new Error("\n There are no form controls registered with this group yet. If you're using ngModel,\n you may want to check next tick (e.g. use setTimeout).\n ");if(!this.controls[t])throw new Error("Cannot find form control with name: "+t+".")},e.prototype._forEachChild=function(t){var e=this;Object.keys(this.controls).forEach(function(n){return t(e.controls[n],n)})},e.prototype._setUpControls=function(){var t=this;this._forEachChild(function(e){e.setParent(t),e._registerOnCollectionChange(t._onCollectionChange)})},e.prototype._updateValue=function(){this._value=this._reduceValue()},e.prototype._anyControls=function(t){var e=this,n=!1;return this._forEachChild(function(r,o){n=n||e.contains(o)&&t(r)}),n},e.prototype._reduceValue=function(){var t=this;return this._reduceChildren({},function(e,n,r){return(n.enabled||t.disabled)&&(e[r]=n.value),e})},e.prototype._reduceChildren=function(t,e){var n=t;return this._forEachChild(function(t,r){n=e(n,t,r)}),n},e.prototype._allControlsDisabled=function(){for(var t=0,e=Object.keys(this.controls);t<e.length;t++){var n=e[t];if(this.controls[n].enabled)return!1}return Object.keys(this.controls).length>0||this.disabled},e.prototype._checkAllValuesPresent=function(t){this._forEachChild(function(e,n){if(void 0===t[n])throw new Error("Must supply a value for form control with name: '"+n+"'.")})},e}(Ct),xt=function(t){function e(e,n,r){var o=t.call(this,n||null,r||null)||this;return o.controls=e,o._initObservables(),o._setUpControls(),o.updateValueAndValidity({onlySelf:!0,emitEvent:!1}),o}return F(e,t),e.prototype.at=function(t){return this.controls[t]},e.prototype.push=function(t){this.controls.push(t),this._registerControl(t),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.insert=function(t,e){this.controls.splice(t,0,e),this._registerControl(e),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.removeAt=function(t){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),this.controls.splice(t,1),this.updateValueAndValidity(),this._onCollectionChange()},e.prototype.setControl=function(t,e){this.controls[t]&&this.controls[t]._registerOnCollectionChange(function(){}),this.controls.splice(t,1),e&&(this.controls.splice(t,0,e),this._registerControl(e)),this.updateValueAndValidity(),this._onCollectionChange()},Object.defineProperty(e.prototype,"length",{get:function(){return this.controls.length},enumerable:!0,configurable:!0}),e.prototype.setValue=function(t,e){var n=this;void 0===e&&(e={}),this._checkAllValuesPresent(t),t.forEach(function(t,r){n._throwIfControlMissing(r),n.at(r).setValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)},e.prototype.patchValue=function(t,e){var n=this;void 0===e&&(e={}),t.forEach(function(t,r){n.at(r)&&n.at(r).patchValue(t,{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e)},e.prototype.reset=function(t,e){void 0===t&&(t=[]),void 0===e&&(e={}),this._forEachChild(function(n,r){n.reset(t[r],{onlySelf:!0,emitEvent:e.emitEvent})}),this.updateValueAndValidity(e),this._updatePristine(e),this._updateTouched(e)},e.prototype.getRawValue=function(){return this.controls.map(function(t){return t instanceof Et?t.value:t.getRawValue()})},e.prototype._throwIfControlMissing=function(t){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(t))throw new Error("Cannot find form control at index "+t)},e.prototype._forEachChild=function(t){this.controls.forEach(function(e,n){t(e,n)})},e.prototype._updateValue=function(){var t=this;this._value=this.controls.filter(function(e){return e.enabled||t.disabled}).map(function(t){return t.value})},e.prototype._anyControls=function(t){return this.controls.some(function(e){return e.enabled&&t(e)})},e.prototype._setUpControls=function(){var t=this;this._forEachChild(function(e){return t._registerControl(e)})},e.prototype._checkAllValuesPresent=function(t){this._forEachChild(function(e,n){if(void 0===t[n])throw new Error("Must supply a value for form control at index: "+n+".")})},e.prototype._allControlsDisabled=function(){for(var t=0,e=this.controls;t<e.length;t++){if(e[t].enabled)return!1}return this.controls.length>0||this.disabled},e.prototype._registerControl=function(t){t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange)},e}(Ct),Pt={provide:L,useExisting:n.i(M._9)(function(){return St})},kt=Promise.resolve(null),St=function(t){function e(e,n){var r=t.call(this)||this;return r._submitted=!1,r.ngSubmit=new M.R,r.form=new Ot({},E(e),O(n)),r}return F(e,t),Object.defineProperty(e.prototype,"submitted",{get:function(){return this._submitted},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"controls",{get:function(){return this.form.controls},enumerable:!0,configurable:!0}),e.prototype.addControl=function(t){var e=this;kt.then(function(){var n=e._findContainer(t.path);t._control=n.registerControl(t.name,t.control),v(t.control,t),t.control.updateValueAndValidity({emitEvent:!1})})},e.prototype.getControl=function(t){return this.form.get(t.path)},e.prototype.removeControl=function(t){var e=this;kt.then(function(){var n=e._findContainer(t.path);n&&n.removeControl(t.name)})},e.prototype.addFormGroup=function(t){var e=this;kt.then(function(){var n=e._findContainer(t.path),r=new Ot({});_(r,t),n.registerControl(t.name,r),r.updateValueAndValidity({emitEvent:!1})})},e.prototype.removeFormGroup=function(t){var e=this;kt.then(function(){var n=e._findContainer(t.path);n&&n.removeControl(t.name)})},e.prototype.getFormGroup=function(t){return this.form.get(t.path)},e.prototype.updateModel=function(t,e){var n=this;kt.then(function(){n.form.get(t.path).setValue(e)})},e.prototype.setValue=function(t){this.control.setValue(t)},e.prototype.onSubmit=function(t){return this._submitted=!0,this.ngSubmit.emit(t),!1},e.prototype.onReset=function(){this.resetForm()},e.prototype.resetForm=function(t){void 0===t&&(t=void 0),this.form.reset(t),this._submitted=!1},e.prototype._findContainer=function(t){return t.pop(),t.length?this.form.get(t):this.form},e}(L);St.decorators=[{type:M.U,args:[{selector:"form:not([ngNoForm]):not([formGroup]),ngForm,[ngForm]",providers:[Pt],host:{"(submit)":"onSubmit($event)","(reset)":"onReset()"},outputs:["ngSubmit"],exportAs:"ngForm"}]}],St.ctorParameters=function(){return[{type:Array,decorators:[{type:M.H},{type:M._13},{type:M.E,args:[z]}]},{type:Array,decorators:[{type:M.H},{type:M._13},{type:M.E,args:[B]}]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Tt={formControlName:'\n <div [formGroup]="myGroup">\n <input formControlName="firstName">\n </div>\n\n In your class:\n\n this.myGroup = new FormGroup({\n firstName: new FormControl()\n });',formGroupName:'\n <div [formGroup]="myGroup">\n <div formGroupName="person">\n <input formControlName="firstName">\n </div>\n </div>\n\n In your class:\n\n this.myGroup = new FormGroup({\n person: new FormGroup({ firstName: new FormControl() })\n });',formArrayName:'\n <div [formGroup]="myGroup">\n <div formArrayName="cities">\n <div *ngFor="let city of cityArray.controls; index as i">\n <input [formControlName]="i">\n </div>\n </div>\n </div>\n\n In your class:\n\n this.cityArray = new FormArray([new FormControl(\'SF\')]);\n this.myGroup = new FormGroup({\n cities: this.cityArray\n });',ngModelGroup:'\n <form>\n <div ngModelGroup="person">\n <input [(ngModel)]="person.name" name="firstName">\n </div>\n </form>',ngModelWithFormGroup:'\n <div [formGroup]="myGroup">\n <input formControlName="firstName">\n <input [(ngModel)]="showMoreControls" [ngModelOptions]="{standalone: true}">\n </div>\n '},At=function(){function t(){}return t.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 '+Tt.formControlName+"\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 "+Tt.ngModelWithFormGroup)},t.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 "+Tt.formGroupName+"\n\n Option 2: Update ngModel's parent be ngModelGroup (template-driven strategy):\n\n "+Tt.ngModelGroup)},t.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: <input [(ngModel)]="person.firstName" name="first">\n Example 2: <input [(ngModel)]="person.firstName" [ngModelOptions]="{standalone: true}">')},t.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 "+Tt.formGroupName+"\n\n Option 2: Use a regular form tag instead of the formGroup directive (template-driven strategy):\n\n "+Tt.ngModelGroup)},t}(),Dt={provide:L,useExisting:n.i(M._9)(function(){return Rt})},Rt=function(t){function e(e,n,r){var o=t.call(this)||this;return o._parent=e,o._validators=n,o._asyncValidators=r,o}return F(e,t),e.prototype._checkParentType=function(){this._parent instanceof e||this._parent instanceof St||At.modelGroupParentException()},e}(ht);Rt.decorators=[{type:M.U,args:[{selector:"[ngModelGroup]",providers:[Dt],exportAs:"ngModelGroup"}]}],Rt.ctorParameters=function(){return[{type:L,decorators:[{type:M._2},{type:M.Q}]},{type:Array,decorators:[{type:M.H},{type:M._13},{type:M.E,args:[z]}]},{type:Array,decorators:[{type:M.H},{type:M._13},{type:M.E,args:[B]}]}]},Rt.propDecorators={name:[{type:M.X,args:["ngModelGroup"]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Mt={provide:tt,useExisting:n.i(M._9)(function(){return Nt})},Vt=Promise.resolve(null),Nt=function(t){function e(e,n,r,o){var i=t.call(this)||this;return i._control=new Et,i._registered=!1,i.update=new M.R,i._parent=e,i._rawValidators=n||[],i._rawAsyncValidators=r||[],i.valueAccessor=k(i,o),i}return F(e,t),e.prototype.ngOnChanges=function(t){this._checkForErrors(),this._registered||this._setUpControl(),"isDisabled"in t&&this._updateDisabled(t),x(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeControl(this)},Object.defineProperty(e.prototype,"control",{get:function(){return this._control},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return this._parent?g(this.name,this._parent):[this.name]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return E(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return O(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),e.prototype.viewToModelUpdate=function(t){this.viewModel=t,this.update.emit(t)},e.prototype._setUpControl=function(){this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0},e.prototype._isStandalone=function(){return!this._parent||!(!this.options||!this.options.standalone)},e.prototype._setUpStandalone=function(){v(this._control,this),this._control.updateValueAndValidity({emitEvent:!1})},e.prototype._checkForErrors=function(){this._isStandalone()||this._checkParentType(),this._checkName()},e.prototype._checkParentType=function(){!(this._parent instanceof Rt)&&this._parent instanceof ht?At.formGroupNameException():this._parent instanceof Rt||this._parent instanceof St||At.modelParentException()},e.prototype._checkName=function(){this.options&&this.options.name&&(this.name=this.options.name),this._isStandalone()||this.name||At.missingNameException()},e.prototype._updateValue=function(t){var e=this;Vt.then(function(){e.control.setValue(t,{emitViewToModelChange:!1})})},e.prototype._updateDisabled=function(t){var e=this,n=t.isDisabled.currentValue,r=""===n||n&&"false"!==n;Vt.then(function(){r&&!e.control.disabled?e.control.disable():!r&&e.control.disabled&&e.control.enable()})},e}(tt);Nt.decorators=[{type:M.U,args:[{selector:"[ngModel]:not([formControlName]):not([formControl])",providers:[Mt],exportAs:"ngModel"}]}],Nt.ctorParameters=function(){return[{type:L,decorators:[{type:M.H},{type:M._2}]},{type:Array,decorators:[{type:M.H},{type:M._13},{type:M.E,args:[z]}]},{type:Array,decorators:[{type:M.H},{type:M._13},{type:M.E,args:[B]}]},{type:Array,decorators:[{type:M.H},{type:M._13},{type:M.E,args:[G]}]}]},Nt.propDecorators={name:[{type:M.X}],isDisabled:[{type:M.X,args:["disabled"]}],model:[{type:M.X,args:["ngModel"]}],options:[{type:M.X,args:["ngModelOptions"]}],update:[{type:M._14,args:["ngModelChange"]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var jt=function(){function t(){}return t.controlParentException=function(){throw new Error("formControlName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n "+Tt.formControlName)},t.ngModelGroupException=function(){throw new Error('formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents\n that also have a "form" prefix: formGroupName, formArrayName, or formGroup.\n\n Option 1: Update the parent to be formGroupName (reactive form strategy)\n\n '+Tt.formGroupName+"\n\n Option 2: Use ngModel instead of formControlName (template-driven strategy)\n\n "+Tt.ngModelGroup)},t.missingFormException=function(){throw new Error("formGroup expects a FormGroup instance. Please pass one in.\n\n Example:\n\n "+Tt.formControlName)},t.groupParentException=function(){throw new Error("formGroupName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n "+Tt.formGroupName)},t.arrayParentException=function(){throw new Error("formArrayName must be used with a parent formGroup directive. You'll want to add a formGroup\n directive and pass it an existing FormGroup instance (you can create one in your class).\n\n Example:\n\n "+Tt.formArrayName)},t.disabledAttrWarning=function(){console.warn("\n It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true\n when you set up this control in your component class, the disabled attribute will actually be set in the DOM for\n you. We recommend using this approach to avoid 'changed after checked' errors.\n \n Example: \n form = new FormGroup({\n first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),\n last: new FormControl('Drew', Validators.required)\n });\n ")},t}(),It={provide:tt,useExisting:n.i(M._9)(function(){return Ft})},Ft=function(t){function e(e,n,r){var o=t.call(this)||this;return o.update=new M.R,o._rawValidators=e||[],o._rawAsyncValidators=n||[],o.valueAccessor=k(o,r),o}return F(e,t),Object.defineProperty(e.prototype,"isDisabled",{set:function(t){jt.disabledAttrWarning()},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(t){this._isControlChanged(t)&&(v(this.form,this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this.form.updateValueAndValidity({emitEvent:!1})),x(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)},Object.defineProperty(e.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return E(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return O(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),e.prototype.viewToModelUpdate=function(t){this.viewModel=t,this.update.emit(t)},e.prototype._isControlChanged=function(t){return t.hasOwnProperty("form")},e}(tt);Ft.decorators=[{type:M.U,args:[{selector:"[formControl]",providers:[It],exportAs:"ngForm"}]}],Ft.ctorParameters=function(){return[{type:Array,decorators:[{type:M.H},{type:M._13},{type:M.E,args:[z]}]},{type:Array,decorators:[{type:M.H},{type:M._13},{type:M.E,args:[B]}]},{type:Array,decorators:[{type:M.H},{type:M._13},{type:M.E,args:[G]}]}]},Ft.propDecorators={form:[{type:M.X,args:["formControl"]}],model:[{type:M.X,args:["ngModel"]}],update:[{type:M._14,args:["ngModelChange"]}],isDisabled:[{type:M.X,args:["disabled"]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Ht={provide:L,useExisting:n.i(M._9)(function(){return Lt})},Lt=function(t){function e(e,n){var r=t.call(this)||this;return r._validators=e,r._asyncValidators=n,r._submitted=!1,r.directives=[],r.form=null,r.ngSubmit=new M.R,r}return F(e,t),e.prototype.ngOnChanges=function(t){this._checkFormPresent(),t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations())},Object.defineProperty(e.prototype,"submitted",{get:function(){return this._submitted},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this.form},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return[]},enumerable:!0,configurable:!0}),e.prototype.addControl=function(t){var e=this.form.get(t.path);return v(e,t),e.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),e},e.prototype.getControl=function(t){return this.form.get(t.path)},e.prototype.removeControl=function(t){D(this.directives,t)},e.prototype.addFormGroup=function(t){var e=this.form.get(t.path);_(e,t),e.updateValueAndValidity({emitEvent:!1})},e.prototype.removeFormGroup=function(t){},e.prototype.getFormGroup=function(t){return this.form.get(t.path)},e.prototype.addFormArray=function(t){var e=this.form.get(t.path);_(e,t),e.updateValueAndValidity({emitEvent:!1})},e.prototype.removeFormArray=function(t){},e.prototype.getFormArray=function(t){return this.form.get(t.path)},e.prototype.updateModel=function(t,e){this.form.get(t.path).setValue(e)},e.prototype.onSubmit=function(t){return this._submitted=!0,this.ngSubmit.emit(t),!1},e.prototype.onReset=function(){this.resetForm()},e.prototype.resetForm=function(t){void 0===t&&(t=void 0),this.form.reset(t),this._submitted=!1},e.prototype._updateDomValue=function(){var t=this;this.directives.forEach(function(e){var n=t.form.get(e.path);e._control!==n&&(b(e._control,e),n&&v(n,e),e._control=n)}),this.form._updateTreeValidity({emitEvent:!1})},e.prototype._updateRegistrations=function(){var t=this;this.form._registerOnCollectionChange(function(){return t._updateDomValue()}),this._oldForm&&this._oldForm._registerOnCollectionChange(function(){}),this._oldForm=this.form},e.prototype._updateValidators=function(){var t=E(this._validators);this.form.validator=W.compose([this.form.validator,t]);var e=O(this._asyncValidators);this.form.asyncValidator=W.composeAsync([this.form.asyncValidator,e])},e.prototype._checkFormPresent=function(){this.form||jt.missingFormException()},e}(L);Lt.decorators=[{type:M.U,args:[{selector:"[formGroup]",providers:[Ht],host:{"(submit)":"onSubmit($event)","(reset)":"onReset()"},exportAs:"ngForm"}]}],Lt.ctorParameters=function(){return[{type:Array,decorators:[{type:M.H},{type:M._13},{type:M.E,args:[z]}]},{type:Array,decorators:[{type:M.H},{type:M._13},{type:M.E,args:[B]}]}]},Lt.propDecorators={form:[{type:M.X,args:["formGroup"]}],ngSubmit:[{type:M._14}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Ut={provide:L,useExisting:n.i(M._9)(function(){return zt})},zt=function(t){function e(e,n,r){var o=t.call(this)||this;return o._parent=e,o._validators=n,o._asyncValidators=r,o}return F(e,t),e.prototype._checkParentType=function(){R(this._parent)&&jt.groupParentException()},e}(ht);zt.decorators=[{type:M.U,args:[{selector:"[formGroupName]",providers:[Ut]}]}],zt.ctorParameters=function(){return[{type:L,decorators:[{type:M.H},{type:M._2},{type:M.Q}]},{type:Array,decorators:[{type:M.H},{type:M._13},{type:M.E,args:[z]}]},{type:Array,decorators:[{type:M.H},{type:M._13},{type:M.E,args:[B]}]}]},zt.propDecorators={name:[{type:M.X,args:["formGroupName"]}]};var Bt={provide:L,useExisting:n.i(M._9)(function(){return Xt})},Xt=function(t){function e(e,n,r){var o=t.call(this)||this;return o._parent=e,o._validators=n,o._asyncValidators=r,o}return F(e,t),e.prototype.ngOnInit=function(){this._checkParentType(),this.formDirective.addFormArray(this)},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeFormArray(this)},Object.defineProperty(e.prototype,"control",{get:function(){return this.formDirective.getFormArray(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"path",{get:function(){return g(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return E(this._validators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return O(this._asyncValidators)},enumerable:!0,configurable:!0}),e.prototype._checkParentType=function(){R(this._parent)&&jt.arrayParentException()},e}(L);Xt.decorators=[{type:M.U,args:[{selector:"[formArrayName]",providers:[Bt]}]}],Xt.ctorParameters=function(){return[{type:L,decorators:[{type:M.H},{type:M._2},{type:M.Q}]},{type:Array,decorators:[{type:M.H},{type:M._13},{type:M.E,args:[z]}]},{type:Array,decorators:[{type:M.H},{type:M._13},{type:M.E,args:[B]}]}]},Xt.propDecorators={name:[{type:M.X,args:["formArrayName"]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Wt={provide:tt,useExisting:n.i(M._9)(function(){return Gt})},Gt=function(t){function e(e,n,r,o){var i=t.call(this)||this;return i._added=!1,i.update=new M.R,i._parent=e,i._rawValidators=n||[],i._rawAsyncValidators=r||[],i.valueAccessor=k(i,o),i}return F(e,t),Object.defineProperty(e.prototype,"isDisabled",{set:function(t){jt.disabledAttrWarning()},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(t){this._added||this._setUpControl(),x(t,this.viewModel)&&(this.viewModel=this.model,this.formDirective.updateModel(this,this.model))},e.prototype.ngOnDestroy=function(){this.formDirective&&this.formDirective.removeControl(this)},e.prototype.viewToModelUpdate=function(t){this.viewModel=t,this.update.emit(t)},Object.defineProperty(e.prototype,"path",{get:function(){return g(this.name,this._parent)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"formDirective",{get:function(){return this._parent?this._parent.formDirective:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"validator",{get:function(){return E(this._rawValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"asyncValidator",{get:function(){return O(this._rawAsyncValidators)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"control",{get:function(){return this._control},enumerable:!0,configurable:!0}),e.prototype._checkParentType=function(){!(this._parent instanceof zt)&&this._parent instanceof ht?jt.ngModelGroupException():this._parent instanceof zt||this._parent instanceof Lt||this._parent instanceof Xt||jt.controlParentException()},e.prototype._setUpControl=function(){this._checkParentType(),this._control=this.formDirective.addControl(this),this.control.disabled&&this.valueAccessor.setDisabledState&&this.valueAccessor.setDisabledState(!0),this._added=!0},e}(tt);Gt.decorators=[{type:M.U,args:[{selector:"[formControlName]",providers:[Wt]}]}],Gt.ctorParameters=function(){return[{type:L,decorators:[{type:M.H},{type:M._2},{type:M.Q}]},{type:Array,decorators:[{type:M.H},{type:M._13},{type:M.E,args:[z]}]},{type:Array,decorators:[{type:M.H},{type:M._13},{type:M.E,args:[B]}]},{type:Array,decorators:[{type:M.H},{type:M._13},{type:M.E,args:[G]}]}]},Gt.propDecorators={name:[{type:M.X,args:["formControlName"]}],model:[{type:M.X,args:["ngModel"]}],update:[{type:M._14,args:["ngModelChange"]}],isDisabled:[{type:M.X,args:["disabled"]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Kt={provide:z,useExisting:n.i(M._9)(function(){return Zt}),multi:!0},qt={provide:z,useExisting:n.i(M._9)(function(){return Qt}),multi:!0},Zt=function(){function t(){}return Object.defineProperty(t.prototype,"required",{get:function(){return this._required},set:function(t){this._required=null!=t&&!1!==t&&""+t!="false",this._onChange&&this._onChange()},enumerable:!0,configurable:!0}),t.prototype.validate=function(t){return this.required?W.required(t):null},t.prototype.registerOnValidatorChange=function(t){this._onChange=t},t}();Zt.decorators=[{type:M.U,args:[{selector:":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]",providers:[Kt],host:{"[attr.required]":'required ? "" : null'}}]}],Zt.ctorParameters=function(){return[]},Zt.propDecorators={required:[{type:M.X}]};var Qt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return F(e,t),e.prototype.validate=function(t){return this.required?W.requiredTrue(t):null},e}(Zt);Qt.decorators=[{type:M.U,args:[{selector:"input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]",providers:[qt],host:{"[attr.required]":'required ? "" : null'}}]}],Qt.ctorParameters=function(){return[]};var Jt={provide:z,useExisting:n.i(M._9)(function(){return Yt}),multi:!0},Yt=function(){function t(){}return Object.defineProperty(t.prototype,"email",{set:function(t){this._enabled=""===t||!0===t||"true"===t,this._onChange&&this._onChange()},enumerable:!0,configurable:!0}),t.prototype.validate=function(t){return this._enabled?W.email(t):null},t.prototype.registerOnValidatorChange=function(t){this._onChange=t},t}();Yt.decorators=[{type:M.U,args:[{selector:"[email][formControlName],[email][formControl],[email][ngModel]",providers:[Jt]}]}],Yt.ctorParameters=function(){return[]},Yt.propDecorators={email:[{type:M.X}]};var $t={provide:z,useExisting:n.i(M._9)(function(){return te}),multi:!0},te=function(){function t(){}return t.prototype.ngOnChanges=function(t){"minlength"in t&&(this._createValidator(),this._onChange&&this._onChange())},t.prototype.validate=function(t){return null==this.minlength?null:this._validator(t)},t.prototype.registerOnValidatorChange=function(t){this._onChange=t},t.prototype._createValidator=function(){this._validator=W.minLength(parseInt(this.minlength,10))},t}();te.decorators=[{type:M.U,args:[{selector:"[minlength][formControlName],[minlength][formControl],[minlength][ngModel]",providers:[$t],host:{"[attr.minlength]":"minlength ? minlength : null"}}]}],te.ctorParameters=function(){return[]},te.propDecorators={minlength:[{type:M.X}]};var ee={provide:z,useExisting:n.i(M._9)(function(){return ne}),multi:!0},ne=function(){function t(){}return t.prototype.ngOnChanges=function(t){"maxlength"in t&&(this._createValidator(),this._onChange&&this._onChange())},t.prototype.validate=function(t){return null!=this.maxlength?this._validator(t):null},t.prototype.registerOnValidatorChange=function(t){this._onChange=t},t.prototype._createValidator=function(){this._validator=W.maxLength(parseInt(this.maxlength,10))},t}();ne.decorators=[{type:M.U,args:[{selector:"[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]",providers:[ee],host:{"[attr.maxlength]":"maxlength ? maxlength : null"}}]}],ne.ctorParameters=function(){return[]},ne.propDecorators={maxlength:[{type:M.X}]};var re={provide:z,useExisting:n.i(M._9)(function(){return oe}),multi:!0},oe=function(){function t(){}return t.prototype.ngOnChanges=function(t){"pattern"in t&&(this._createValidator(),this._onChange&&this._onChange())},t.prototype.validate=function(t){return this._validator(t)},t.prototype.registerOnValidatorChange=function(t){this._onChange=t},t.prototype._createValidator=function(){this._validator=W.pattern(this.pattern)},t}();oe.decorators=[{type:M.U,args:[{selector:"[pattern][formControlName],[pattern][formControl],[pattern][ngModel]",providers:[re],host:{"[attr.pattern]":"pattern ? pattern : null"}}]}],oe.ctorParameters=function(){return[]},oe.propDecorators={pattern:[{type:M.X}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var ie=function(){function t(){}return t.prototype.group=function(t,e){void 0===e&&(e=null);var n=this._reduceControls(t),r=null!=e?e.validator:null,o=null!=e?e.asyncValidator:null;return new Ot(n,r,o)},t.prototype.control=function(t,e,n){return new Et(t,e,n)},t.prototype.array=function(t,e,n){var r=this,o=t.map(function(t){return r._createControl(t)});return new xt(o,e,n)},t.prototype._reduceControls=function(t){var e=this,n={};return Object.keys(t).forEach(function(r){n[r]=e._createControl(t[r])}),n},t.prototype._createControl=function(t){if(t instanceof Et||t instanceof Ot||t instanceof xt)return t;if(Array.isArray(t)){var e=t[0],n=t.length>1?t[1]:null,r=t.length>2?t[2]:null;return this.control(e,n,r)}return this.control(t)},t}();ie.decorators=[{type:M.z}],ie.ctorParameters=function(){return[]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var se=(new M.B("4.1.2"),function(){function t(){}return t}());se.decorators=[{type:M.U,args:[{selector:"form:not([ngNoForm]):not([ngNativeValidate])",host:{novalidate:""}}]}],se.ctorParameters=function(){return[]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var ae=[se,ut,pt,J,$,it,q,at,lt,rt,mt,gt,Zt,te,ne,oe,Qt,Yt],ue=[Nt,Rt,St],ce=[Ft,Lt,Gt,zt,Xt],le=function(){function t(){}return t}();le.decorators=[{type:M.A,args:[{declarations:ae,exports:ae}]}],le.ctorParameters=function(){return[]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var pe=function(){function t(){}return t}();pe.decorators=[{type:M.A,args:[{declarations:ue,providers:[nt],exports:[le,ue]}]}],pe.ctorParameters=function(){return[]};var fe=function(){function t(){}return t}();fe.decorators=[{type:M.A,args:[{declarations:[ce],providers:[ie,nt],exports:[le,ce]}]}],fe.ctorParameters=function(){return[]}},OEcN:function(t,e,n){"use strict";var r=n("3j3K"),o=n("NVOs"),i=n("2yGx"),s=n("hUSH"),a=n("tyH+");n.d(e,"a",function(){return c});var u={provide:o.e,useExisting:n.i(r._9)(function(){return c}),multi:!0},c=function(){function t(t){this.onChange=function(t){},this.onTouched=function(){},this.meridian=t.meridian,this.spinners=t.spinners,this.seconds=t.seconds,this.hourStep=t.hourStep,this.minuteStep=t.minuteStep,this.secondStep=t.secondStep,this.disabled=t.disabled,this.readonlyInputs=t.readonlyInputs,this.size=t.size}return t.prototype.writeValue=function(t){this.model=t?new s.a(t.hour,t.minute,t.second):new s.a,this.seconds||t&&n.i(i.a)(t.second)||(this.model.second=0)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.setDisabledState=function(t){this.disabled=t},t.prototype.changeHour=function(t){this.model.changeHour(t),this.propagateModelChange()},t.prototype.changeMinute=function(t){this.model.changeMinute(t),this.propagateModelChange()},t.prototype.changeSecond=function(t){this.model.changeSecond(t),this.propagateModelChange()},t.prototype.updateHour=function(t){this.model.updateHour(n.i(i.b)(t)),this.propagateModelChange()},t.prototype.updateMinute=function(t){this.model.updateMinute(n.i(i.b)(t)),this.propagateModelChange()},t.prototype.updateSecond=function(t){this.model.updateSecond(n.i(i.b)(t)),this.propagateModelChange()},t.prototype.toggleMeridian=function(){this.meridian&&this.changeHour(12)},t.prototype.formatHour=function(t){return n.i(i.a)(t)?this.meridian?n.i(i.c)(t%12==0?12:t%12):n.i(i.c)(t%24):n.i(i.c)(NaN)},t.prototype.formatMinSec=function(t){return n.i(i.c)(t)},t.prototype.setFormControlSize=function(){return{"form-control-sm":"small"===this.size,"form-control-lg":"large"===this.size}},t.prototype.setButtonSize=function(){return{"btn-sm":"small"===this.size,"btn-lg":"large"===this.size}},t.prototype.ngOnChanges=function(t){t.seconds&&!this.seconds&&this.model&&!n.i(i.a)(this.model.second)&&(this.model.second=0,this.propagateModelChange(!1))},t.prototype.propagateModelChange=function(t){void 0===t&&(t=!0),t&&this.onTouched(),this.model.isValid(this.seconds)?this.onChange({hour:this.model.hour,minute:this.model.minute,second:this.model.second}):this.onChange(null)},t}();c.decorators=[{type:r._10,args:[{selector:"ngb-timepicker",styles:["\n .ngb-tp {\n display: flex;\n align-items: center;\n }\n\n .ngb-tp-hour, .ngb-tp-minute, .ngb-tp-second, .ngb-tp-meridian {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: space-around;\n }\n\n .ngb-tp-spacer {\n width: 1em;\n text-align: center;\n }\n\n .chevron::before {\n border-style: solid;\n border-width: 0.29em 0.29em 0 0;\n content: '';\n display: inline-block;\n height: 0.69em;\n left: 0.05em;\n position: relative;\n top: 0.15em;\n transform: rotate(-45deg);\n -webkit-transform: rotate(-45deg);\n -ms-transform: rotate(-45deg);\n vertical-align: middle;\n width: 0.71em;\n }\n\n .chevron.bottom:before {\n top: -.3em;\n -webkit-transform: rotate(135deg);\n -ms-transform: rotate(135deg);\n transform: rotate(135deg);\n }\n\n .btn-link {\n outline: 0;\n }\n\n .btn-link.disabled {\n cursor: not-allowed;\n opacity: .65;\n }\n\n input {\n text-align: center;\n display: inline-block;\n width: auto;\n }\n "],template:'\n <fieldset [disabled]="disabled" [class.disabled]="disabled">\n <div class="ngb-tp">\n <div class="ngb-tp-hour">\n <button *ngIf="spinners" type="button" class="btn-link" [ngClass]="setButtonSize()" (click)="changeHour(hourStep)"\n [disabled]="disabled" [class.disabled]="disabled">\n <span class="chevron"></span>\n <span class="sr-only">Increment hours</span>\n </button>\n <input type="text" class="form-control" [ngClass]="setFormControlSize()" maxlength="2" size="2" placeholder="HH"\n [value]="formatHour(model?.hour)" (change)="updateHour($event.target.value)"\n [readonly]="readonlyInputs" [disabled]="disabled" aria-label="Hours">\n <button *ngIf="spinners" type="button" class="btn-link" [ngClass]="setButtonSize()" (click)="changeHour(-hourStep)"\n [disabled]="disabled" [class.disabled]="disabled">\n <span class="chevron bottom"></span>\n <span class="sr-only">Decrement hours</span>\n </button>\n </div>\n <div class="ngb-tp-spacer">:</div>\n <div class="ngb-tp-minute">\n <button *ngIf="spinners" type="button" class="btn-link" [ngClass]="setButtonSize()" (click)="changeMinute(minuteStep)"\n [disabled]="disabled" [class.disabled]="disabled">\n <span class="chevron"></span>\n <span class="sr-only">Increment minutes</span>\n </button>\n <input type="text" class="form-control" [ngClass]="setFormControlSize()" maxlength="2" size="2" placeholder="MM"\n [value]="formatMinSec(model?.minute)" (change)="updateMinute($event.target.value)"\n [readonly]="readonlyInputs" [disabled]="disabled" aria-label="Minutes">\n <button *ngIf="spinners" type="button" class="btn-link" [ngClass]="setButtonSize()" (click)="changeMinute(-minuteStep)"\n [disabled]="disabled" [class.disabled]="disabled">\n <span class="chevron bottom"></span>\n <span class="sr-only">Decrement minutes</span>\n </button>\n </div>\n <div *ngIf="seconds" class="ngb-tp-spacer">:</div>\n <div *ngIf="seconds" class="ngb-tp-second">\n <button *ngIf="spinners" type="button" class="btn-link" [ngClass]="setButtonSize()" (click)="changeSecond(secondStep)"\n [disabled]="disabled" [class.disabled]="disabled">\n <span class="chevron"></span>\n <span class="sr-only">Increment seconds</span>\n </button>\n <input type="text" class="form-control" [ngClass]="setFormControlSize()" maxlength="2" size="2" placeholder="SS"\n [value]="formatMinSec(model?.second)" (change)="updateSecond($event.target.value)"\n [readonly]="readonlyInputs" [disabled]="disabled" aria-label="Seconds">\n <button *ngIf="spinners" type="button" class="btn-link" [ngClass]="setButtonSize()" (click)="changeSecond(-secondStep)"\n [disabled]="disabled" [class.disabled]="disabled">\n <span class="chevron bottom"></span>\n <span class="sr-only">Decrement seconds</span>\n </button>\n </div>\n <div *ngIf="meridian" class="ngb-tp-spacer"></div>\n <div *ngIf="meridian" class="ngb-tp-meridian">\n <button type="button" class="btn btn-outline-primary" [ngClass]="setButtonSize()"\n [disabled]="disabled" [class.disabled]="disabled"\n (click)="toggleMeridian()">{{model.hour >= 12 ? \'PM\' : \'AM\'}}</button>\n </div>\n </div>\n </fieldset>\n ',providers:[u]}]}],c.ctorParameters=function(){return[{type:a.a}]},c.propDecorators={meridian:[{type:r.X}],spinners:[{type:r.X}],seconds:[{type:r.X}],hourStep:[{type:r.X}],minuteStep:[{type:r.X}],secondStep:[{type:r.X}],readonlyInputs:[{type:r.X}],size:[{type:r.X}]}},Qbdm:function(t,e,n){"use strict";function r(){return I}function o(t){I||(I=t)}function i(){return G||(G=document.querySelector("base"))?G.getAttribute("href"):null}function s(t){return X||(X=document.createElement("a")),X.setAttribute("href",t),"/"===X.pathname.charAt(0)?X.pathname:"/"+X.pathname}function a(t,e){e=encodeURIComponent(e);for(var n=0,r=t.split(";");n<r.length;n++){var o=r[n],i=o.indexOf("="),s=-1==i?[o,""]:[o.slice(0,i),o.slice(i+1)],a=s[0],u=s[1];if(a.trim()===e)return decodeURIComponent(u)}return null}function u(t,e,n){for(var r=e.split("."),o=t;r.length>1;){var i=r.shift();o=o.hasOwnProperty(i)&&null!=o[i]?o[i]:o[i]={}}void 0!==o&&null!==o||(o={}),o[r.shift()]=n}/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license * @return {?} */ function c(){return!!window.history.pushState}function l(t,e){return function(){var n=r();Array.prototype.slice.apply(n.querySelectorAll(e,"style[ng-transition]")).filter(function(e){return n.getAttribute(e,"ng-transition")===t}).forEach(function(t){return n.remove(t)})}}function p(t){return n.i(V.G)(t)}function f(t,e){var n=(t||[]).concat(e||[]);return r().setGlobalVar(nt,p),r().setGlobalVar(rt,tt({},et,h(n||[]))),function(){return p}}function h(t){return t.reduce(function(t,e){return t[e.name]=e.token,t},{})}function d(t){return yt.replace(ft,t)}function y(t){return dt.replace(ft,t)}function m(t,e,n){for(var r=0;r<e.length;r++){var o=e[r];Array.isArray(o)?m(t,o,n):(o=o.replace(ft,t),n.push(o))}return n}function g(t){return function(e){!1===t(e)&&(e.preventDefault(),e.returnValue=!1)}}function v(t,e){if(t.charCodeAt(0)===vt)throw new Error("Found the synthetic "+e+" "+t+'. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.')}function b(t){return t=String(t),t.match(Tt)||t.match(At)?t:(n.i(V.K)()&&r().log("WARNING: sanitizing unsafe URL value "+t+" (see http://g.co/ng/security#xss)"),"unsafe:"+t)}function _(t){return t=String(t),t.split(",").map(function(t){return b(t.trim())}).join(", ")}function w(){if(Dt)return Dt;Rt=r();var t=Rt.createElement("template");if("content"in t)return t;var e=Rt.createHtmlDocument();if(null==(Dt=Rt.querySelector(e,"body"))){var n=Rt.createElement("html",e);Dt=Rt.createElement("body",e),Rt.appendChild(n,Dt),Rt.appendChild(e,n)}return Dt}function C(t){for(var e={},n=0,r=t.split(",");n<r.length;n++){e[r[n]]=!0}return e}function E(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n={},r=0,o=t;r<o.length;r++){var i=o[r];for(var s in i)i.hasOwnProperty(s)&&(n[s]=!0)}return n}function O(t,e){if(e&&Rt.contains(t,e))throw new Error("Failed to sanitize html because the element is clobbered: "+Rt.getOuterHTML(t));return e}function x(t){return t.replace(/&/g,"&amp;").replace(Wt,function(t){return"&#"+(1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320)+65536)+";"}).replace(Gt,function(t){return"&#"+t.charCodeAt(0)+";"}).replace(/</g,"&lt;").replace(/>/g,"&gt;")}function P(t){Rt.attributeMap(t).forEach(function(e,n){"xmlns:ns1"!==n&&0!==n.indexOf("ns1:")||Rt.removeAttribute(t,n)});for(var e=0,n=Rt.childNodesAsList(t);e<n.length;e++){var r=n[e];Rt.isElementNode(r)&&P(r)}}function k(t,e){try{var r=w(),o=e?String(e):"",i=5,s=o;do{if(0===i)throw new Error("Failed to sanitize html because the input is unstable");i--,o=s,Rt.setInnerHTML(r,o),t.documentMode&&P(r),s=Rt.getInnerHTML(r)}while(o!==s);for(var a=new Xt,u=a.sanitizeChildren(Rt.getTemplateContent(r)||r),c=Rt.getTemplateContent(r)||r,l=0,p=Rt.childNodesAsList(c);l<p.length;l++){var f=p[l];Rt.removeChild(c,f)}return n.i(V.K)()&&a.sanitizedSomething&&Rt.log("WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss)."),u}catch(t){throw Dt=null,t}}function S(t){for(var e=!0,n=!0,r=0;r<t.length;r++){var o=t.charAt(r);"'"===o&&n?e=!e:'"'===o&&e&&(n=!n)}return e&&n}function T(t){if(!(t=String(t).trim()))return"";var e=t.match(te);return e&&b(e[1])===e[1]||t.match($t)&&S(t)?t:(n.i(V.K)()&&r().log("WARNING: sanitizing unsafe style value "+t+" (see http://g.co/ng/security#xss)."),"unsafe")}function A(){W.makeCurrent(),Y.init()}function D(){return new V.p}function R(){return document}var M=n("2Je8"),V=n("3j3K");n.d(e,"p",function(){return fe}),n.d(e,"a",function(){return pe}),n.d(e,"k",function(){return Z}),n.d(e,"l",function(){return $}),n.d(e,"o",function(){return ot}),n.d(e,"c",function(){return K}),n.d(e,"s",function(){return st}),n.d(e,"h",function(){return at}),n.d(e,"r",function(){return Et}),n.d(e,"d",function(){return Ot}),n.d(e,"q",function(){return ee}),n.d(e,"u",function(){return r}),n.d(e,"j",function(){return mt}),n.d(e,"e",function(){return wt}),n.d(e,"g",function(){return xt}),n.d(e,"f",function(){return St}),n.d(e,"i",function(){return lt}),n.d(e,"t",function(){return ct}),n.d(e,"m",function(){return D}),n.d(e,"n",function(){return f}),n.d(e,"b",function(){return ne});var N,j=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},I=null,F=function(){function t(){this.resourceLoaderType=null}return t.prototype.hasProperty=function(t,e){},t.prototype.setProperty=function(t,e,n){},t.prototype.getProperty=function(t,e){},t.prototype.invoke=function(t,e,n){},t.prototype.logError=function(t){},t.prototype.log=function(t){},t.prototype.logGroup=function(t){},t.prototype.logGroupEnd=function(){},Object.defineProperty(t.prototype,"attrToPropMap",{get:function(){return this._attrToPropMap},set:function(t){this._attrToPropMap=t},enumerable:!0,configurable:!0}),t.prototype.contains=function(t,e){},t.prototype.parse=function(t){},t.prototype.querySelector=function(t,e){},t.prototype.querySelectorAll=function(t,e){},t.prototype.on=function(t,e,n){},t.prototype.onAndCancel=function(t,e,n){},t.prototype.dispatchEvent=function(t,e){},t.prototype.createMouseEvent=function(t){},t.prototype.createEvent=function(t){},t.prototype.preventDefault=function(t){},t.prototype.isPrevented=function(t){},t.prototype.getInnerHTML=function(t){},t.prototype.getTemplateContent=function(t){},t.prototype.getOuterHTML=function(t){},t.prototype.nodeName=function(t){},t.prototype.nodeValue=function(t){},t.prototype.type=function(t){},t.prototype.content=function(t){},t.prototype.firstChild=function(t){},t.prototype.nextSibling=function(t){},t.prototype.parentElement=function(t){},t.prototype.childNodes=function(t){},t.prototype.childNodesAsList=function(t){},t.prototype.clearNodes=function(t){},t.prototype.appendChild=function(t,e){},t.prototype.removeChild=function(t,e){},t.prototype.replaceChild=function(t,e,n){},t.prototype.remove=function(t){},t.prototype.insertBefore=function(t,e,n){},t.prototype.insertAllBefore=function(t,e,n){},t.prototype.insertAfter=function(t,e,n){},t.prototype.setInnerHTML=function(t,e){},t.prototype.getText=function(t){},t.prototype.setText=function(t,e){},t.prototype.getValue=function(t){},t.prototype.setValue=function(t,e){},t.prototype.getChecked=function(t){},t.prototype.setChecked=function(t,e){},t.prototype.createComment=function(t){},t.prototype.createTemplate=function(t){},t.prototype.createElement=function(t,e){},t.prototype.createElementNS=function(t,e,n){},t.prototype.createTextNode=function(t,e){},t.prototype.createScriptTag=function(t,e,n){},t.prototype.createStyleElement=function(t,e){},t.prototype.createShadowRoot=function(t){},t.prototype.getShadowRoot=function(t){},t.prototype.getHost=function(t){},t.prototype.getDistributedNodes=function(t){},t.prototype.clone=function(t){},t.prototype.getElementsByClassName=function(t,e){},t.prototype.getElementsByTagName=function(t,e){},t.prototype.classList=function(t){},t.prototype.addClass=function(t,e){},t.prototype.removeClass=function(t,e){},t.prototype.hasClass=function(t,e){},t.prototype.setStyle=function(t,e,n){},t.prototype.removeStyle=function(t,e){},t.prototype.getStyle=function(t,e){},t.prototype.hasStyle=function(t,e,n){},t.prototype.tagName=function(t){},t.prototype.attributeMap=function(t){},t.prototype.hasAttribute=function(t,e){},t.prototype.hasAttributeNS=function(t,e,n){},t.prototype.getAttribute=function(t,e){},t.prototype.getAttributeNS=function(t,e,n){},t.prototype.setAttribute=function(t,e,n){},t.prototype.setAttributeNS=function(t,e,n,r){},t.prototype.removeAttribute=function(t,e){},t.prototype.removeAttributeNS=function(t,e,n){},t.prototype.templateAwareRoot=function(t){},t.prototype.createHtmlDocument=function(){},t.prototype.getBoundingClientRect=function(t){},t.prototype.getTitle=function(t){},t.prototype.setTitle=function(t,e){},t.prototype.elementMatches=function(t,e){},t.prototype.isTemplateElement=function(t){},t.prototype.isTextNode=function(t){},t.prototype.isCommentNode=function(t){},t.prototype.isElementNode=function(t){},t.prototype.hasShadowRoot=function(t){},t.prototype.isShadowRoot=function(t){},t.prototype.importIntoDoc=function(t){},t.prototype.adoptNode=function(t){},t.prototype.getHref=function(t){},t.prototype.getEventKey=function(t){},t.prototype.resolveAndSetHref=function(t,e,n){},t.prototype.supportsDOMEvents=function(){},t.prototype.supportsNativeShadowDOM=function(){},t.prototype.getGlobalEventTarget=function(t,e){},t.prototype.getHistory=function(){},t.prototype.getLocation=function(){},t.prototype.getBaseHref=function(t){},t.prototype.resetBaseElement=function(){},t.prototype.getUserAgent=function(){},t.prototype.setData=function(t,e,n){},t.prototype.getComputedStyle=function(t){},t.prototype.getData=function(t,e){},t.prototype.setGlobalVar=function(t,e){},t.prototype.supportsWebAnimation=function(){},t.prototype.performanceNow=function(){},t.prototype.getAnimationPrefix=function(){},t.prototype.getTransitionEnd=function(){},t.prototype.supportsAnimation=function(){},t.prototype.supportsCookies=function(){},t.prototype.getCookie=function(t){},t.prototype.setCookie=function(t,e){},t}(),H=function(t){function e(){var e=t.call(this)||this;e._animationPrefix=null,e._transitionEnd=null;try{var n=e.createElement("div",document);if(null!=e.getStyle(n,"animationName"))e._animationPrefix="";else for(var r=["Webkit","Moz","O","ms"],o=0;o<r.length;o++)if(null!=e.getStyle(n,r[o]+"AnimationName")){e._animationPrefix="-"+r[o].toLowerCase()+"-";break}var i={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};Object.keys(i).forEach(function(t){null!=e.getStyle(n,t)&&(e._transitionEnd=i[t])})}catch(t){e._animationPrefix=null,e._transitionEnd=null}return e}return j(e,t),e.prototype.getDistributedNodes=function(t){return t.getDistributedNodes()},e.prototype.resolveAndSetHref=function(t,e,n){t.href=null==n?e:e+"/../"+n},e.prototype.supportsDOMEvents=function(){return!0},e.prototype.supportsNativeShadowDOM=function(){return"function"==typeof document.body.createShadowRoot},e.prototype.getAnimationPrefix=function(){return this._animationPrefix?this._animationPrefix:""},e.prototype.getTransitionEnd=function(){return this._transitionEnd?this._transitionEnd:""},e.prototype.supportsAnimation=function(){return null!=this._animationPrefix&&null!=this._transitionEnd},e}(F),L={class:"className",innerHtml:"innerHTML",readonly:"readOnly",tabindex:"tabIndex"},U=3,z={"\b":"Backspace","\t":"Tab","":"Delete","":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},B={A:"1",B:"2",C:"3",D:"4",E:"5",F:"6",G:"7",H:"8",I:"9",J:"*",K:"+",M:"-",N:".",O:"/","`":"0","":"NumLock"};V.C.Node&&(N=V.C.Node.prototype.contains||function(t){return!!(16&this.compareDocumentPosition(t))});var X,W=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return j(e,t),e.prototype.parse=function(t){throw new Error("parse not implemented")},e.makeCurrent=function(){o(new e)},e.prototype.hasProperty=function(t,e){return e in t},e.prototype.setProperty=function(t,e,n){t[e]=n},e.prototype.getProperty=function(t,e){return t[e]},e.prototype.invoke=function(t,e,n){t[e].apply(t,n)},e.prototype.logError=function(t){window.console&&(console.error?console.error(t):console.log(t))},e.prototype.log=function(t){window.console&&window.console.log&&window.console.log(t)},e.prototype.logGroup=function(t){window.console&&window.console.group&&window.console.group(t)},e.prototype.logGroupEnd=function(){window.console&&window.console.groupEnd&&window.console.groupEnd()},Object.defineProperty(e.prototype,"attrToPropMap",{get:function(){return L},enumerable:!0,configurable:!0}),e.prototype.contains=function(t,e){return N.call(t,e)},e.prototype.querySelector=function(t,e){return t.querySelector(e)},e.prototype.querySelectorAll=function(t,e){return t.querySelectorAll(e)},e.prototype.on=function(t,e,n){t.addEventListener(e,n,!1)},e.prototype.onAndCancel=function(t,e,n){return t.addEventListener(e,n,!1),function(){t.removeEventListener(e,n,!1)}},e.prototype.dispatchEvent=function(t,e){t.dispatchEvent(e)},e.prototype.createMouseEvent=function(t){var e=document.createEvent("MouseEvent");return e.initEvent(t,!0,!0),e},e.prototype.createEvent=function(t){var e=document.createEvent("Event");return e.initEvent(t,!0,!0),e},e.prototype.preventDefault=function(t){t.preventDefault(),t.returnValue=!1},e.prototype.isPrevented=function(t){return t.defaultPrevented||null!=t.returnValue&&!t.returnValue},e.prototype.getInnerHTML=function(t){return t.innerHTML},e.prototype.getTemplateContent=function(t){return"content"in t&&t instanceof HTMLTemplateElement?t.content:null},e.prototype.getOuterHTML=function(t){return t.outerHTML},e.prototype.nodeName=function(t){return t.nodeName},e.prototype.nodeValue=function(t){return t.nodeValue},e.prototype.type=function(t){return t.type},e.prototype.content=function(t){return this.hasProperty(t,"content")?t.content:t},e.prototype.firstChild=function(t){return t.firstChild},e.prototype.nextSibling=function(t){return t.nextSibling},e.prototype.parentElement=function(t){return t.parentNode},e.prototype.childNodes=function(t){return t.childNodes},e.prototype.childNodesAsList=function(t){for(var e=t.childNodes,n=new Array(e.length),r=0;r<e.length;r++)n[r]=e[r];return n},e.prototype.clearNodes=function(t){for(;t.firstChild;)t.removeChild(t.firstChild)},e.prototype.appendChild=function(t,e){t.appendChild(e)},e.prototype.removeChild=function(t,e){t.removeChild(e)},e.prototype.replaceChild=function(t,e,n){t.replaceChild(e,n)},e.prototype.remove=function(t){return t.parentNode&&t.parentNode.removeChild(t),t},e.prototype.insertBefore=function(t,e,n){t.insertBefore(n,e)},e.prototype.insertAllBefore=function(t,e,n){n.forEach(function(n){return t.insertBefore(n,e)})},e.prototype.insertAfter=function(t,e,n){t.insertBefore(n,e.nextSibling)},e.prototype.setInnerHTML=function(t,e){t.innerHTML=e},e.prototype.getText=function(t){return t.textContent},e.prototype.setText=function(t,e){t.textContent=e},e.prototype.getValue=function(t){return t.value},e.prototype.setValue=function(t,e){t.value=e},e.prototype.getChecked=function(t){return t.checked},e.prototype.setChecked=function(t,e){t.checked=e},e.prototype.createComment=function(t){return document.createComment(t)},e.prototype.createTemplate=function(t){var e=document.createElement("template");return e.innerHTML=t,e},e.prototype.createElement=function(t,e){return void 0===e&&(e=document),e.createElement(t)},e.prototype.createElementNS=function(t,e,n){return void 0===n&&(n=document),n.createElementNS(t,e)},e.prototype.createTextNode=function(t,e){return void 0===e&&(e=document),e.createTextNode(t)},e.prototype.createScriptTag=function(t,e,n){void 0===n&&(n=document);var r=n.createElement("SCRIPT");return r.setAttribute(t,e),r},e.prototype.createStyleElement=function(t,e){void 0===e&&(e=document);var n=e.createElement("style");return this.appendChild(n,this.createTextNode(t)),n},e.prototype.createShadowRoot=function(t){return t.createShadowRoot()},e.prototype.getShadowRoot=function(t){return t.shadowRoot},e.prototype.getHost=function(t){return t.host},e.prototype.clone=function(t){return t.cloneNode(!0)},e.prototype.getElementsByClassName=function(t,e){return t.getElementsByClassName(e)},e.prototype.getElementsByTagName=function(t,e){return t.getElementsByTagName(e)},e.prototype.classList=function(t){return Array.prototype.slice.call(t.classList,0)},e.prototype.addClass=function(t,e){t.classList.add(e)},e.prototype.removeClass=function(t,e){t.classList.remove(e)},e.prototype.hasClass=function(t,e){return t.classList.contains(e)},e.prototype.setStyle=function(t,e,n){t.style[e]=n},e.prototype.removeStyle=function(t,e){t.style[e]=""},e.prototype.getStyle=function(t,e){return t.style[e]},e.prototype.hasStyle=function(t,e,n){var r=this.getStyle(t,e)||"";return n?r==n:r.length>0},e.prototype.tagName=function(t){return t.tagName},e.prototype.attributeMap=function(t){for(var e=new Map,n=t.attributes,r=0;r<n.length;r++){var o=n[r];e.set(o.name,o.value)}return e},e.prototype.hasAttribute=function(t,e){return t.hasAttribute(e)},e.prototype.hasAttributeNS=function(t,e,n){return t.hasAttributeNS(e,n)},e.prototype.getAttribute=function(t,e){return t.getAttribute(e)},e.prototype.getAttributeNS=function(t,e,n){return t.getAttributeNS(e,n)},e.prototype.setAttribute=function(t,e,n){t.setAttribute(e,n)},e.prototype.setAttributeNS=function(t,e,n,r){t.setAttributeNS(e,n,r)},e.prototype.removeAttribute=function(t,e){t.removeAttribute(e)},e.prototype.removeAttributeNS=function(t,e,n){t.removeAttributeNS(e,n)},e.prototype.templateAwareRoot=function(t){return this.isTemplateElement(t)?this.content(t):t},e.prototype.createHtmlDocument=function(){return document.implementation.createHTMLDocument("fakeTitle")},e.prototype.getBoundingClientRect=function(t){try{return t.getBoundingClientRect()}catch(t){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}},e.prototype.getTitle=function(t){return document.title},e.prototype.setTitle=function(t,e){document.title=e||""},e.prototype.elementMatches=function(t,e){return t instanceof HTMLElement&&(t.matches&&t.matches(e)||t.msMatchesSelector&&t.msMatchesSelector(e)||t.webkitMatchesSelector&&t.webkitMatchesSelector(e))},e.prototype.isTemplateElement=function(t){return t instanceof HTMLElement&&"TEMPLATE"==t.nodeName},e.prototype.isTextNode=function(t){return t.nodeType===Node.TEXT_NODE},e.prototype.isCommentNode=function(t){return t.nodeType===Node.COMMENT_NODE},e.prototype.isElementNode=function(t){return t.nodeType===Node.ELEMENT_NODE},e.prototype.hasShadowRoot=function(t){return null!=t.shadowRoot&&t instanceof HTMLElement},e.prototype.isShadowRoot=function(t){return t instanceof DocumentFragment},e.prototype.importIntoDoc=function(t){return document.importNode(this.templateAwareRoot(t),!0)},e.prototype.adoptNode=function(t){return document.adoptNode(t)},e.prototype.getHref=function(t){return t.href},e.prototype.getEventKey=function(t){var e=t.key;if(null==e){if(null==(e=t.keyIdentifier))return"Unidentified";e.startsWith("U+")&&(e=String.fromCharCode(parseInt(e.substring(2),16)),t.location===U&&B.hasOwnProperty(e)&&(e=B[e]))}return z[e]||e},e.prototype.getGlobalEventTarget=function(t,e){return"window"===e?window:"document"===e?document:"body"===e?document.body:null},e.prototype.getHistory=function(){return window.history},e.prototype.getLocation=function(){return window.location},e.prototype.getBaseHref=function(t){var e=i();return null==e?null:s(e)},e.prototype.resetBaseElement=function(){G=null},e.prototype.getUserAgent=function(){return window.navigator.userAgent},e.prototype.setData=function(t,e,n){this.setAttribute(t,"data-"+e,n)},e.prototype.getData=function(t,e){return this.getAttribute(t,"data-"+e)},e.prototype.getComputedStyle=function(t){return getComputedStyle(t)},e.prototype.setGlobalVar=function(t,e){u(V.C,t,e)},e.prototype.supportsWebAnimation=function(){return"function"==typeof Element.prototype.animate},e.prototype.performanceNow=function(){return window.performance&&window.performance.now?window.performance.now():(new Date).getTime()},e.prototype.supportsCookies=function(){return!0},e.prototype.getCookie=function(t){return a(document.cookie,t)},e.prototype.setCookie=function(t,e){document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(e)},e}(H),G=null,K=new V.D("DocumentToken"),q=function(t){function e(e){var n=t.call(this)||this;return n._doc=e,n._init(),n}return j(e,t),e.prototype._init=function(){this._location=r().getLocation(),this._history=r().getHistory()},Object.defineProperty(e.prototype,"location",{get:function(){return this._location},enumerable:!0,configurable:!0}),e.prototype.getBaseHrefFromDOM=function(){return r().getBaseHref(this._doc)},e.prototype.onPopState=function(t){r().getGlobalEventTarget(this._doc,"window").addEventListener("popstate",t,!1)},e.prototype.onHashChange=function(t){r().getGlobalEventTarget(this._doc,"window").addEventListener("hashchange",t,!1)},Object.defineProperty(e.prototype,"pathname",{get:function(){return this._location.pathname},set:function(t){this._location.pathname=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"search",{get:function(){return this._location.search},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hash",{get:function(){return this._location.hash},enumerable:!0,configurable:!0}),e.prototype.pushState=function(t,e,n){c()?this._history.pushState(t,e,n):this._location.hash=n},e.prototype.replaceState=function(t,e,n){c()?this._history.replaceState(t,e,n):this._location.hash=n},e.prototype.forward=function(){this._history.forward()},e.prototype.back=function(){this._history.back()},e}(M.d);q.decorators=[{type:V.z}],q.ctorParameters=function(){return[{type:void 0,decorators:[{type:V.E,args:[K]}]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Z=function(){function t(t){this._doc=t,this._dom=r()}return t.prototype.addTag=function(t,e){return void 0===e&&(e=!1),t?this._getOrCreateElement(t,e):null},t.prototype.addTags=function(t,e){var n=this;return void 0===e&&(e=!1),t?t.reduce(function(t,r){return r&&t.push(n._getOrCreateElement(r,e)),t},[]):[]},t.prototype.getTag=function(t){return t?this._dom.querySelector(this._doc,"meta["+t+"]"):null},t.prototype.getTags=function(t){if(!t)return[];var e=this._dom.querySelectorAll(this._doc,"meta["+t+"]");return e?[].slice.call(e):[]},t.prototype.updateTag=function(t,e){if(!t)return null;e=e||this._parseSelector(t);var n=this.getTag(e);return n?this._setMetaElementAttributes(t,n):this._getOrCreateElement(t,!0)},t.prototype.removeTag=function(t){this.removeTagElement(this.getTag(t))},t.prototype.removeTagElement=function(t){t&&this._dom.remove(t)},t.prototype._getOrCreateElement=function(t,e){if(void 0===e&&(e=!1),!e){var n=this._parseSelector(t),r=this.getTag(n);if(r&&this._containsAttributes(t,r))return r}var o=this._dom.createElement("meta");this._setMetaElementAttributes(t,o);var i=this._dom.getElementsByTagName(this._doc,"head")[0];return this._dom.appendChild(i,o),o},t.prototype._setMetaElementAttributes=function(t,e){var n=this;return Object.keys(t).forEach(function(r){return n._dom.setAttribute(e,r,t[r])}),e},t.prototype._parseSelector=function(t){var e=t.name?"name":"property";return e+'="'+t[e]+'"'},t.prototype._containsAttributes=function(t,e){var n=this;return Object.keys(t).every(function(r){return n._dom.getAttribute(e,r)===t[r]})},t}();Z.decorators=[{type:V.z}],Z.ctorParameters=function(){return[{type:void 0,decorators:[{type:V.E,args:[K]}]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Q=new V.D("TRANSITION_ID"),J=[{provide:V.q,useFactory:l,deps:[Q,K],multi:!0}],Y=function(){function t(){}return t.init=function(){n.i(V.F)(new t)},t.prototype.addToWindow=function(t){V.C.getAngularTestability=function(e,n){void 0===n&&(n=!0);var r=t.findTestabilityInTree(e,n);if(null==r)throw new Error("Could not find testability for element.");return r},V.C.getAllAngularTestabilities=function(){return t.getAllTestabilities()},V.C.getAllAngularRootElements=function(){return t.getAllRootElements()};var e=function(t){var e=V.C.getAllAngularTestabilities(),n=e.length,r=!1,o=function(e){r=r||e,0==--n&&t(r)};e.forEach(function(t){t.whenStable(o)})};V.C.frameworkStabilizers||(V.C.frameworkStabilizers=[]),V.C.frameworkStabilizers.push(e)},t.prototype.findTestabilityInTree=function(t,e,n){if(null==e)return null;var o=t.getTestability(e);return null!=o?o:n?r().isShadowRoot(e)?this.findTestabilityInTree(t,r().getHost(e),!0):this.findTestabilityInTree(t,r().parentElement(e),!0):null},t}(),$=function(){function t(t){this._doc=t}return t.prototype.getTitle=function(){return r().getTitle(this._doc)},t.prototype.setTitle=function(t){r().setTitle(this._doc,t)},t}();$.decorators=[{type:V.z}],$.ctorParameters=function(){return[{type:void 0,decorators:[{type:V.E,args:[K]}]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var tt=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},et={ApplicationRef:V.r,NgZone:V.h},nt="ng.probe",rt="ng.coreTokens",ot=function(){function t(t,e){this.name=t,this.token=e}return t}(),it=[{provide:V.q,useFactory:f,deps:[[ot,new V.H],[V.k,new V.H]],multi:!0}],st=new V.D("EventManagerPlugins"),at=function(){function t(t,e){var n=this;this._zone=e,this._eventNameToPlugin=new Map,t.forEach(function(t){return t.manager=n}),this._plugins=t.slice().reverse()}return t.prototype.addEventListener=function(t,e,n){return this._findPluginFor(e).addEventListener(t,e,n)},t.prototype.addGlobalEventListener=function(t,e,n){return this._findPluginFor(e).addGlobalEventListener(t,e,n)},t.prototype.getZone=function(){return this._zone},t.prototype._findPluginFor=function(t){var e=this._eventNameToPlugin.get(t);if(e)return e;for(var n=this._plugins,r=0;r<n.length;r++){var o=n[r];if(o.supports(t))return this._eventNameToPlugin.set(t,o),o}throw new Error("No event manager plugin found for event "+t)},t}();at.decorators=[{type:V.z}],at.ctorParameters=function(){return[{type:Array,decorators:[{type:V.E,args:[st]}]},{type:V.h}]};var ut=function(){function t(t){this._doc=t}return t.prototype.supports=function(t){},t.prototype.addEventListener=function(t,e,n){},t.prototype.addGlobalEventListener=function(t,e,n){var o=r().getGlobalEventTarget(this._doc,t);if(!o)throw new Error("Unsupported event target "+o+" for event "+e);return this.addEventListener(o,e,n)},t}(),ct=function(){function t(){this._stylesSet=new Set}return t.prototype.addStyles=function(t){var e=this,n=new Set;t.forEach(function(t){e._stylesSet.has(t)||(e._stylesSet.add(t),n.add(t))}),this.onStylesAdded(n)},t.prototype.onStylesAdded=function(t){},t.prototype.getAllStyles=function(){return Array.from(this._stylesSet)},t}();ct.decorators=[{type:V.z}],ct.ctorParameters=function(){return[]};var lt=function(t){function e(e){var n=t.call(this)||this;return n._doc=e,n._hostNodes=new Set,n._styleNodes=new Set,n._hostNodes.add(e.head),n}return j(e,t),e.prototype._addStylesToHost=function(t,e){var n=this;t.forEach(function(t){var r=n._doc.createElement("style");r.textContent=t,n._styleNodes.add(e.appendChild(r))})},e.prototype.addHost=function(t){this._addStylesToHost(this._stylesSet,t),this._hostNodes.add(t)},e.prototype.removeHost=function(t){this._hostNodes.delete(t)},e.prototype.onStylesAdded=function(t){var e=this;this._hostNodes.forEach(function(n){return e._addStylesToHost(t,n)})},e.prototype.ngOnDestroy=function(){this._styleNodes.forEach(function(t){return r().remove(t)})},e}(ct);lt.decorators=[{type:V.z}],lt.ctorParameters=function(){return[{type:void 0,decorators:[{type:V.E,args:[K]}]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var pt={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},ft=/%COMP%/g,ht="%COMP%",dt="_nghost-"+ht,yt="_ngcontent-"+ht,mt=function(){function t(t,e){this.eventManager=t,this.sharedStylesHost=e,this.rendererByCompId=new Map,this.defaultRenderer=new gt(t)}return t.prototype.createRenderer=function(t,e){if(!t||!e)return this.defaultRenderer;switch(e.encapsulation){case V.I.Emulated:var n=this.rendererByCompId.get(e.id);return n||(n=new bt(this.eventManager,this.sharedStylesHost,e),this.rendererByCompId.set(e.id,n)),n.applyToHost(t),n;case V.I.Native:return new _t(this.eventManager,this.sharedStylesHost,t,e);default:if(!this.rendererByCompId.has(e.id)){var r=m(e.id,e.styles,[]);this.sharedStylesHost.addStyles(r),this.rendererByCompId.set(e.id,this.defaultRenderer)}return this.defaultRenderer}},t}();mt.decorators=[{type:V.z}],mt.ctorParameters=function(){return[{type:at},{type:lt}]};var gt=function(){function t(t){this.eventManager=t,this.data=Object.create(null)}return t.prototype.destroy=function(){},t.prototype.createElement=function(t,e){return e?document.createElementNS(pt[e],t):document.createElement(t)},t.prototype.createComment=function(t){return document.createComment(t)},t.prototype.createText=function(t){return document.createTextNode(t)},t.prototype.appendChild=function(t,e){t.appendChild(e)},t.prototype.insertBefore=function(t,e,n){t&&t.insertBefore(e,n)},t.prototype.removeChild=function(t,e){t&&t.removeChild(e)},t.prototype.selectRootElement=function(t){var e="string"==typeof t?document.querySelector(t):t;if(!e)throw new Error('The selector "'+t+'" did not match any elements');return e.textContent="",e},t.prototype.parentNode=function(t){return t.parentNode},t.prototype.nextSibling=function(t){return t.nextSibling},t.prototype.setAttribute=function(t,e,n,r){if(r){e=r+":"+e;var o=pt[r];o?t.setAttributeNS(o,e,n):t.setAttribute(e,n)}else t.setAttribute(e,n)},t.prototype.removeAttribute=function(t,e,n){if(n){var r=pt[n];r?t.removeAttributeNS(r,e):t.removeAttribute(n+":"+e)}else t.removeAttribute(e)},t.prototype.addClass=function(t,e){t.classList.add(e)},t.prototype.removeClass=function(t,e){t.classList.remove(e)},t.prototype.setStyle=function(t,e,n,r){r&V.J.DashCase?t.style.setProperty(e,n,r&V.J.Important?"important":""):t.style[e]=n},t.prototype.removeStyle=function(t,e,n){n&V.J.DashCase?t.style.removeProperty(e):t.style[e]=""},t.prototype.setProperty=function(t,e,n){v(e,"property"),t[e]=n},t.prototype.setValue=function(t,e){t.nodeValue=e},t.prototype.listen=function(t,e,n){return v(e,"listener"),"string"==typeof t?this.eventManager.addGlobalEventListener(t,e,g(n)):this.eventManager.addEventListener(t,e,g(n))},t}(),vt="@".charCodeAt(0),bt=function(t){function e(e,n,r){var o=t.call(this,e)||this;o.component=r;var i=m(r.id,r.styles,[]);return n.addStyles(i),o.contentAttr=d(r.id),o.hostAttr=y(r.id),o}return j(e,t),e.prototype.applyToHost=function(e){t.prototype.setAttribute.call(this,e,this.hostAttr,"")},e.prototype.createElement=function(e,n){var r=t.prototype.createElement.call(this,e,n);return t.prototype.setAttribute.call(this,r,this.contentAttr,""),r},e}(gt),_t=function(t){function e(e,n,r,o){var i=t.call(this,e)||this;i.sharedStylesHost=n,i.hostEl=r,i.component=o,i.shadowRoot=r.createShadowRoot(),i.sharedStylesHost.addHost(i.shadowRoot);for(var s=m(o.id,o.styles,[]),a=0;a<s.length;a++){var u=document.createElement("style");u.textContent=s[a],i.shadowRoot.appendChild(u)}return i}return j(e,t),e.prototype.nodeOrShadowRoot=function(t){return t===this.hostEl?this.shadowRoot:t},e.prototype.destroy=function(){this.sharedStylesHost.removeHost(this.shadowRoot)},e.prototype.appendChild=function(e,n){return t.prototype.appendChild.call(this,this.nodeOrShadowRoot(e),n)},e.prototype.insertBefore=function(e,n,r){return t.prototype.insertBefore.call(this,this.nodeOrShadowRoot(e),n,r)},e.prototype.removeChild=function(e,n){return t.prototype.removeChild.call(this,this.nodeOrShadowRoot(e),n)},e.prototype.parentNode=function(e){return this.nodeOrShadowRoot(t.prototype.parentNode.call(this,this.nodeOrShadowRoot(e)))},e}(gt),wt=function(t){function e(e){return t.call(this,e)||this}return j(e,t),e.prototype.supports=function(t){return!0},e.prototype.addEventListener=function(t,e,n){return t.addEventListener(e,n,!1),function(){return t.removeEventListener(e,n,!1)}},e}(ut);wt.decorators=[{type:V.z}],wt.ctorParameters=function(){return[{type:void 0,decorators:[{type:V.E,args:[K]}]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Ct={pan:!0,panstart:!0,panmove:!0,panend:!0,pancancel:!0,panleft:!0,panright:!0,panup:!0,pandown:!0,pinch:!0,pinchstart:!0,pinchmove:!0,pinchend:!0,pinchcancel:!0,pinchin:!0,pinchout:!0,press:!0,pressup:!0,rotate:!0,rotatestart:!0,rotatemove:!0,rotateend:!0,rotatecancel:!0,swipe:!0,swipeleft:!0,swiperight:!0,swipeup:!0,swipedown:!0,tap:!0},Et=new V.D("HammerGestureConfig"),Ot=function(){function t(){this.events=[],this.overrides={}}return t.prototype.buildHammer=function(t){var e=new Hammer(t);e.get("pinch").set({enable:!0}),e.get("rotate").set({enable:!0});for(var n in this.overrides)e.get(n).set(this.overrides[n]);return e},t}();Ot.decorators=[{type:V.z}],Ot.ctorParameters=function(){return[]};var xt=function(t){function e(e,n){var r=t.call(this,e)||this;return r._config=n,r}return j(e,t),e.prototype.supports=function(t){if(!Ct.hasOwnProperty(t.toLowerCase())&&!this.isCustomEvent(t))return!1;if(!window.Hammer)throw new Error("Hammer.js is not loaded, can not bind "+t+" event");return!0},e.prototype.addEventListener=function(t,e,n){var r=this,o=this.manager.getZone();return e=e.toLowerCase(),o.runOutsideAngular(function(){var i=r._config.buildHammer(t),s=function(t){o.runGuarded(function(){n(t)})};return i.on(e,s),function(){return i.off(e,s)}})},e.prototype.isCustomEvent=function(t){return this._config.events.indexOf(t)>-1},e}(ut);xt.decorators=[{type:V.z}],xt.ctorParameters=function(){return[{type:void 0,decorators:[{type:V.E,args:[K]}]},{type:Ot,decorators:[{type:V.E,args:[Et]}]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Pt=["alt","control","meta","shift"],kt={alt:function(t){return t.altKey},control:function(t){return t.ctrlKey},meta:function(t){return t.metaKey},shift:function(t){return t.shiftKey}},St=function(t){function e(e){return t.call(this,e)||this}return j(e,t),e.prototype.supports=function(t){return null!=e.parseEventName(t)},e.prototype.addEventListener=function(t,n,o){var i=e.parseEventName(n),s=e.eventCallback(i.fullKey,o,this.manager.getZone());return this.manager.getZone().runOutsideAngular(function(){return r().onAndCancel(t,i.domEventName,s)})},e.parseEventName=function(t){var n=t.toLowerCase().split("."),r=n.shift();if(0===n.length||"keydown"!==r&&"keyup"!==r)return null;var o=e._normalizeKey(n.pop()),i="";if(Pt.forEach(function(t){var e=n.indexOf(t);e>-1&&(n.splice(e,1),i+=t+".")}),i+=o,0!=n.length||0===o.length)return null;var s={};return s.domEventName=r,s.fullKey=i,s},e.getEventFullKey=function(t){var e="",n=r().getEventKey(t);return n=n.toLowerCase()," "===n?n="space":"."===n&&(n="dot"),Pt.forEach(function(r){if(r!=n){(0,kt[r])(t)&&(e+=r+".")}}),e+=n},e.eventCallback=function(t,n,r){return function(o){e.getEventFullKey(o)===t&&r.runGuarded(function(){return n(o)})}},e._normalizeKey=function(t){switch(t){case"esc":return"escape";default:return t}},e}(ut);St.decorators=[{type:V.z}],St.ctorParameters=function(){return[{type:void 0,decorators:[{type:V.E,args:[K]}]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var Tt=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:\/?#]*(?:[\/?#]|$))/gi,At=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+\/]+=*$/i,Dt=null,Rt=null,Mt=C("area,br,col,hr,img,wbr"),Vt=C("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),Nt=C("rp,rt"),jt=E(Nt,Vt),It=E(Vt,C("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),Ft=E(Nt,C("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Ht=E(Mt,It,Ft,jt),Lt=C("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),Ut=C("srcset"),zt=C("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),Bt=E(Lt,Ut,zt),Xt=function(){function t(){this.sanitizedSomething=!1,this.buf=[]}return t.prototype.sanitizeChildren=function(t){for(var e=t.firstChild;e;)if(Rt.isElementNode(e)?this.startElement(e):Rt.isTextNode(e)?this.chars(Rt.nodeValue(e)):this.sanitizedSomething=!0,Rt.firstChild(e))e=Rt.firstChild(e);else for(;e;){Rt.isElementNode(e)&&this.endElement(e);var n=O(e,Rt.nextSibling(e));if(n){e=n;break}e=O(e,Rt.parentElement(e))}return this.buf.join("")},t.prototype.startElement=function(t){var e=this,n=Rt.nodeName(t).toLowerCase();if(!Ht.hasOwnProperty(n))return void(this.sanitizedSomething=!0);this.buf.push("<"),this.buf.push(n),Rt.attributeMap(t).forEach(function(t,n){var r=n.toLowerCase();if(!Bt.hasOwnProperty(r))return void(e.sanitizedSomething=!0);Lt[r]&&(t=b(t)),Ut[r]&&(t=_(t)),e.buf.push(" "),e.buf.push(n),e.buf.push('="'),e.buf.push(x(t)),e.buf.push('"')}),this.buf.push(">")},t.prototype.endElement=function(t){var e=Rt.nodeName(t).toLowerCase();Ht.hasOwnProperty(e)&&!Mt.hasOwnProperty(e)&&(this.buf.push("</"),this.buf.push(e),this.buf.push(">"))},t.prototype.chars=function(t){this.buf.push(x(t))},t}(),Wt=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Gt=/([^\#-~ |!])/g,Kt="[-,.\"'%_!# a-zA-Z0-9]+",qt="(?:matrix|translate|scale|rotate|skew|perspective)(?:X|Y|3d)?",Zt="(?:rgb|hsl)a?",Qt="(?:repeating-)?(?:linear|radial)-gradient",Jt="(?:calc|attr)",Yt="\\([-0-9.%, #a-zA-Z]+\\)",$t=new RegExp("^("+Kt+"|(?:"+qt+"|"+Zt+"|"+Qt+"|"+Jt+")"+Yt+")$","g"),te=/^url\(([^)]+)\)$/,ee=function(){function t(){}return t.prototype.sanitize=function(t,e){},t.prototype.bypassSecurityTrustHtml=function(t){},t.prototype.bypassSecurityTrustStyle=function(t){},t.prototype.bypassSecurityTrustScript=function(t){},t.prototype.bypassSecurityTrustUrl=function(t){},t.prototype.bypassSecurityTrustResourceUrl=function(t){},t}(),ne=function(t){function e(e){var n=t.call(this)||this;return n._doc=e,n}return j(e,t),e.prototype.sanitize=function(t,e){if(null==e)return null;switch(t){case V.L.NONE:return e;case V.L.HTML:return e instanceof oe?e.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(e,"HTML"),k(this._doc,String(e)));case V.L.STYLE:return e instanceof ie?e.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(e,"Style"),T(e));case V.L.SCRIPT:if(e instanceof se)return e.changingThisBreaksApplicationSecurity;throw this.checkNotSafeValue(e,"Script"),new Error("unsafe value used in a script context");case V.L.URL:return e instanceof ue||e instanceof ae?e.changingThisBreaksApplicationSecurity:(this.checkNotSafeValue(e,"URL"),b(String(e)));case V.L.RESOURCE_URL:if(e instanceof ue)return e.changingThisBreaksApplicationSecurity;throw this.checkNotSafeValue(e,"ResourceURL"),new Error("unsafe value used in a resource URL context (see http://g.co/ng/security#xss)");default:throw new Error("Unexpected SecurityContext "+t+" (see http://g.co/ng/security#xss)")}},e.prototype.checkNotSafeValue=function(t,e){if(t instanceof re)throw new Error("Required a safe "+e+", got a "+t.getTypeName()+" (see http://g.co/ng/security#xss)")},e.prototype.bypassSecurityTrustHtml=function(t){return new oe(t)},e.prototype.bypassSecurityTrustStyle=function(t){return new ie(t)},e.prototype.bypassSecurityTrustScript=function(t){return new se(t)},e.prototype.bypassSecurityTrustUrl=function(t){return new ae(t)},e.prototype.bypassSecurityTrustResourceUrl=function(t){return new ue(t)},e}(ee);ne.decorators=[{type:V.z}],ne.ctorParameters=function(){return[{type:void 0,decorators:[{type:V.E,args:[K]}]}]};var re=function(){function t(t){this.changingThisBreaksApplicationSecurity=t}return t.prototype.getTypeName=function(){},t.prototype.toString=function(){return"SafeValue must use [property]=binding: "+this.changingThisBreaksApplicationSecurity+" (see http://g.co/ng/security#xss)"},t}(),oe=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return j(e,t),e.prototype.getTypeName=function(){return"HTML"},e}(re),ie=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return j(e,t),e.prototype.getTypeName=function(){return"Style"},e}(re),se=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return j(e,t),e.prototype.getTypeName=function(){return"Script"},e}(re),ae=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return j(e,t),e.prototype.getTypeName=function(){return"URL"},e}(re),ue=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return j(e,t),e.prototype.getTypeName=function(){return"ResourceURL"},e}(re),ce=[{provide:V.M,useValue:M.e},{provide:V.N,useValue:A,multi:!0},{provide:M.d,useClass:q},{provide:K,useFactory:R,deps:[]}],le=[{provide:V.v,useExisting:ee},{provide:ee,useClass:ne}],pe=n.i(V.O)(V.P,"browser",ce),fe=function(){function t(t){if(t)throw new Error("BrowserModule has already been loaded. If you need access to common directives such as NgIf and NgFor from a lazy loaded module, import CommonModule instead.")}return t.withServerTransition=function(e){return{ngModule:t,providers:[{provide:V.s,useValue:e.appId},{provide:Q,useExisting:V.s},J]}},t}();fe.decorators=[{type:V.A,args:[{providers:[le,{provide:V.p,useFactory:D,deps:[]},{provide:st,useClass:wt,multi:!0},{provide:st,useClass:St,multi:!0},{provide:st,useClass:xt,multi:!0},{provide:Et,useClass:Ot},mt,{provide:V.w,useExisting:mt},{provide:ct,useExisting:lt},lt,V.i,at,it,Z,$],exports:[M.b,V.o]}]}],fe.ctorParameters=function(){return[{type:fe,decorators:[{type:V.H},{type:V.Q}]}]};/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ var he="undefined"!=typeof window&&window||{},de=function(){function t(t,e){this.msPerTick=t,this.numTicks=e}return t}();(function(){function t(t){this.appRef=t.injector.get(V.r)}t.prototype.timeChangeDetection=function(t){var e=t&&t.record,n="Change Detection",o=null!=he.console.profile;e&&o&&he.console.profile(n);for(var i=r().performanceNow(),s=0;s<5||r().performanceNow()-i<500;)this.appRef.tick(),s++;var a=r().performanceNow();e&&o&&he.console.profileEnd(n);var u=(a-i)/s;return he.console.log("ran "+s+" change detection cycles"),he.console.log(u.toFixed(2)+" ms per check"),new de(u,s)}})(),function(){function t(){}t.all=function(){return function(t){return!0}},t.css=function(t){return function(e){return null!=e.nativeElement&&r().elementMatches(e.nativeElement,t)}},t.directive=function(t){return function(e){return-1!==e.providerTokens.indexOf(t)}}}(),new V.B("4.1.2")},QqRK:function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n("mmVS"),i=function(t){function e(e,n,r){t.call(this),this.parent=e,this.outerValue=n,this.outerIndex=r,this.index=0}return r(e,t),e.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},e.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(o.Subscriber);e.InnerSubscriber=i},RRVv:function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n("rCTf"),i=function(t){function e(e,n){t.call(this),this.value=e,this.scheduler=n,this._isScalar=!0,n&&(this._isScalar=!1)}return r(e,t),e.create=function(t,n){return new e(t,n)},e.dispatch=function(t){var e=t.done,n=t.value,r=t.subscriber;if(e)return void r.complete();r.next(n),r.closed||(t.done=!0,this.schedule(t))},e.prototype._subscribe=function(t){var n=this.value,r=this.scheduler;if(r)return r.schedule(e.dispatch,0,{done:!1,value:n,subscriber:t});t.next(n),t.closed||t.complete()},e}(o.Observable);e.ScalarObservable=i},RX2M:function(t,e,n){"use strict";var r=n("3j3K"),o=n("2Je8"),i=n("s28n"),s=n("gFLb");n.d(e,"a",function(){return a});var a=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[s.a]}},t}();a.decorators=[{type:r.A,args:[{declarations:[i.a],exports:[i.a],imports:[o.b],entryComponents:[i.a]}]}],a.ctorParameters=function(){return[]}},Rewd:function(t,e,n){"use strict";function r(t,e,n){return this.lift(new s(t,e,n))}var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n("mmVS");e._do=r;var s=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.nextOrObserver,this.error,this.complete))},t}(),a=function(t){function e(e,n,r,o){t.call(this,e);var s=new i.Subscriber(n,r,o);s.syncErrorThrowable=!0,this.add(s),this.safeSubscriber=s}return o(e,t),e.prototype._next=function(t){var e=this.safeSubscriber;e.next(t),e.syncErrorThrown?this.destination.error(e.syncErrorValue):this.destination.next(t)},e.prototype._error=function(t){var e=this.safeSubscriber;e.error(t),e.syncErrorThrown?this.destination.error(e.syncErrorValue):this.destination.error(t)},e.prototype._complete=function(){var t=this.safeSubscriber;t.complete(),t.syncErrorThrown?this.destination.error(t.syncErrorValue):this.destination.complete()},e}(i.Subscriber)},SKH6:function(t,e,n){"use strict";function r(t){return"function"==typeof t}e.isFunction=r},"TIy+":function(t,e,n){"use strict";var r=n("/J7H");e.fromEvent=r.FromEventObservable.create},U6gI:function(t,e,n){"use strict";var r=n("3j3K");n.d(e,"a",function(){return o});var o=function(){function t(){}return t.prototype.isMuted=function(){return!this.selected&&(this.date.month!==this.currentMonth||this.disabled)},t}();o.decorators=[{type:r._10,args:[{selector:"[ngbDatepickerDayView]",styles:["\n :host {\n text-align: center;\n width: 2rem;\n height: 2rem;\n line-height: 2rem; \n border-radius: 0.25rem;\n }\n :host.outside {\n opacity: 0.5;\n }\n "],host:{"[class.bg-primary]":"selected","[class.text-white]":"selected","[class.text-muted]":"isMuted()","[class.outside]":"isMuted()","[class.btn-secondary]":"!disabled"},template:"{{ date.day }}"}]}],o.ctorParameters=function(){return[]},o.propDecorators={currentMonth:[{type:r.X}],date:[{type:r.X}],disabled:[{type:r.X}],selected:[{type:r.X}]}},UyZi:function(t,e,n){"use strict";var r=n("3j3K"),o=n("9XFw"),i=n("xOmt"),s=n("CXHW"),a=n("3kwk");n("WtdY"),n("nxqe");n.d(e,"a",function(){return u});var u=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[a.a,s.a]}},t}();u.decorators=[{type:r.A,args:[{declarations:[o.a,i.a],entryComponents:[o.a,i.a],providers:[a.a]}]}],u.ctorParameters=function(){return[]}},VOfZ:function(t,e,n){"use strict";(function(t){var n="undefined"!=typeof window&&window,r="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,o=void 0!==t&&t,i=n||o||r;e.root=i,function(){if(!i)throw new Error("RxJS could not find any global context (window, self, global)")}()}).call(e,n("DuR2"))},W5jB:function(t,e,n){"use strict";var r=n("3j3K"),o=n("2yGx"),i=n("nCuf");n.d(e,"a",function(){return s});var s=function(){function t(t){this.value=0,this.max=t.max,this.animated=t.animated,this.striped=t.striped,this.type=t.type,this.showValue=t.showValue}return t.prototype.getValue=function(){return n.i(o.f)(this.value,this.max)},t.prototype.getPercentValue=function(){return 100*this.getValue()/this.max},t}();s.decorators=[{type:r._10,args:[{selector:"ngb-progressbar",changeDetection:r._17.OnPush,template:'\n <div class="progress">\n <div class="progress-bar{{type ? \' bg-\' + type : \'\'}}{{animated ? \' progress-bar-animated\' : \'\'}}{{striped ?\n \' progress-bar-striped\' : \'\'}}" role="progressbar" [style.width.%]="getPercentValue()"\n [attr.aria-valuenow]="getValue()" aria-valuemin="0" [attr.aria-valuemax]="max">\n <span *ngIf="showValue">{{getPercentValue()}}%</span><ng-content></ng-content>\n </div>\n </div>\n '}]}],s.ctorParameters=function(){return[{type:i.a}]},s.propDecorators={max:[{type:r.X}],animated:[{type:r.X}],striped:[{type:r.X}],showValue:[{type:r.X}],type:[{type:r.X}],value:[{type:r.X}]}},WKBe:function(t,e,n){"use strict";var r=n("3j3K"),o=n("WtNX"),i=n("ETCP");n.d(e,"a",function(){return s});var s=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[i.a]}},t}();s.decorators=[{type:r.A,args:[{declarations:[o.a,o.b],exports:[o.a],entryComponents:[o.b]}]}],s.ctorParameters=function(){return[]}},WhVc:function(t,e,n){"use strict";e.errorObject={e:{}}},WtNX:function(t,e,n){"use strict";var r=n("3j3K"),o=n("aalB"),i=n("jRSa"),s=n("/PMa"),a=n("ETCP");n.d(e,"b",function(){return c}),n.d(e,"a",function(){return l});var u=0,c=function(){function t(){this.placement="top"}return t}();c.decorators=[{type:r._10,args:[{selector:"ngb-popover-window",changeDetection:r._17.OnPush,host:{"[class]":'"popover show popover-" + placement',role:"tooltip","[id]":"id"},template:'\n <h3 class="popover-title">{{title}}</h3><div class="popover-content"><ng-content></ng-content></div>\n '}]}],c.ctorParameters=function(){return[]},c.propDecorators={placement:[{type:r.X}],title:[{type:r.X}],id:[{type:r.X}]};var l=function(){function t(t,e,o,a,l,p,f){var h=this;this._elementRef=t,this._renderer=e,this.shown=new r.R,this.hidden=new r.R,this._ngbPopoverWindowId="ngb-popover-"+u++,this.placement=p.placement,this.triggers=p.triggers,this.container=p.container,this._popupService=new s.a(c,o,l,e,a),this._zoneSubscription=f.onStable.subscribe(function(){h._windowRef&&n.i(i.a)(h._elementRef.nativeElement,h._windowRef.location.nativeElement,h.placement,"body"===h.container)})}return t.prototype.open=function(t){this._windowRef||(this._windowRef=this._popupService.open(this.ngbPopover,t),this._windowRef.instance.placement=this.placement,this._windowRef.instance.title=this.popoverTitle,this._windowRef.instance.id=this._ngbPopoverWindowId,this._renderer.setElementAttribute(this._elementRef.nativeElement,"aria-describedby",this._ngbPopoverWindowId),"body"===this.container&&window.document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement),this._windowRef.changeDetectorRef.markForCheck(),this.shown.emit())},t.prototype.close=function(){this._windowRef&&(this._renderer.setElementAttribute(this._elementRef.nativeElement,"aria-describedby",null),this._popupService.close(),this._windowRef=null,this.hidden.emit())},t.prototype.toggle=function(){this._windowRef?this.close():this.open()},t.prototype.isOpen=function(){return null!=this._windowRef},t.prototype.ngOnInit=function(){this._unregisterListenersFn=n.i(o.a)(this._renderer,this._elementRef.nativeElement,this.triggers,this.open.bind(this),this.close.bind(this),this.toggle.bind(this))},t.prototype.ngOnDestroy=function(){this.close(),this._unregisterListenersFn(),this._zoneSubscription.unsubscribe()},t}();l.decorators=[{type:r.U,args:[{selector:"[ngbPopover]",exportAs:"ngbPopover"}]}],l.ctorParameters=function(){return[{type:r.V},{type:r.W},{type:r._11},{type:r.Z},{type:r._0},{type:a.a},{type:r.h}]},l.propDecorators={ngbPopover:[{type:r.X}],popoverTitle:[{type:r.X}],placement:[{type:r.X}],triggers:[{type:r.X}],container:[{type:r.X}],shown:[{type:r._14}],hidden:[{type:r._14}]}},WtdY:function(t,e,n){"use strict";var r=n("3j3K"),o=n("/PMa");n.d(e,"a",function(){return i}),n.d(e,"b",function(){return s});var i=function(){function t(){}return t.prototype.close=function(t){},t.prototype.dismiss=function(t){},t}();i.decorators=[{type:r.z}],i.ctorParameters=function(){return[]};var s=function(){function t(t,e,n){var r=this;this._windowCmptRef=t,this._contentRef=e,this._backdropCmptRef=n,t.instance.dismissEvent.subscribe(function(t){r.dismiss(t)}),this.result=new Promise(function(t,e){r._resolve=t,r._reject=e}),this.result.then(null,function(){})}return Object.defineProperty(t.prototype,"componentInstance",{get:function(){if(this._contentRef.componentRef)return this._contentRef.componentRef.instance},set:function(t){},enumerable:!0,configurable:!0}),t.prototype.close=function(t){this._windowCmptRef&&(this._resolve(t),this._removeModalElements())},t.prototype.dismiss=function(t){this._windowCmptRef&&(this._reject(t),this._removeModalElements())},t.prototype._removeModalElements=function(){var t=this._windowCmptRef.location.nativeElement;if(t.parentNode.removeChild(t),this._windowCmptRef.destroy(),this._backdropCmptRef){var e=this._backdropCmptRef.location.nativeElement;e.parentNode.removeChild(e),this._backdropCmptRef.destroy()}this._contentRef&&this._contentRef.viewRef&&this._contentRef.viewRef.destroy(),this._windowCmptRef=null,this._backdropCmptRef=null,this._contentRef=null},t}();s.decorators=[{type:r.z}],s.ctorParameters=function(){return[{type:r._18},{type:o.b},{type:r._18}]}},Xajo:function(t,e,n){"use strict";e.isArray=Array.isArray||function(t){return t&&"number"==typeof t.length}},Yh8Q:function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n("rCTf"),i=n("RRVv"),s=n("jBEF"),a=n("fWbP"),u=function(t){function e(e,n){t.call(this),this.array=e,this.scheduler=n,n||1!==e.length||(this._isScalar=!0,this.value=e[0])}return r(e,t),e.create=function(t,n){return new e(t,n)},e.of=function(){for(var t=[],n=0;n<arguments.length;n++)t[n-0]=arguments[n];var r=t[t.length-1];a.isScheduler(r)?t.pop():r=null;var o=t.length;return o>1?new e(t,r):1===o?new i.ScalarObservable(t[0],r):new s.EmptyObservable(r)},e.dispatch=function(t){var e=t.array,n=t.index,r=t.count,o=t.subscriber;if(n>=r)return void o.complete();o.next(e[n]),o.closed||(t.index=n+1,this.schedule(t))},e.prototype._subscribe=function(t){var n=this.array,r=n.length,o=this.scheduler;if(o)return o.schedule(e.dispatch,0,{array:n,index:0,count:r,subscriber:t});for(var i=0;i<r&&!t.closed;i++)t.next(n[i]);t.complete()},e}(o.Observable);e.ArrayObservable=u},ZJf8:function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n("B00U"),i=function(t){function e(e,n){t.call(this),this.subject=e,this.subscriber=n,this.closed=!1}return r(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(o.Subscription);e.SubjectSubscription=i},ZwZs:function(t,e,n){"use strict";var r=n("3j3K");n.d(e,"a",function(){return o});var o=function(){function t(){this.closeOthers=!1}return t}();o.decorators=[{type:r.z}],o.ctorParameters=function(){return[]}},aKiW:function(t,e,n){"use strict";var r=n("3j3K");n.d(e,"a",function(){return o});var o=function(){function t(){this.max=10,this.readonly=!1}return t}();o.decorators=[{type:r.z}],o.ctorParameters=function(){return[]}},aQl7:function(t,e,n){"use strict";function r(t){return t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}e.isPromise=r},aalB:function(t,e,n){"use strict";function r(t,e){void 0===e&&(e=s);var n=(t||"").trim();if(0===n.length)return[];var r=n.split(/\s+/).map(function(t){return t.split(":")}).map(function(t){var n=e[t[0]]||t;return new i(n[0],n[1])}),o=r.filter(function(t){return t.isManual()});if(o.length>1)throw"Triggers parse error: only one manual trigger is allowed";if(1===o.length&&r.length>1)throw"Triggers parse error: manual trigger can't be mixed with other triggers";return r}function o(t,e,n,o,i,s){var u=r(n),c=[];return 1===u.length&&u[0].isManual()?a:(u.forEach(function(n){n.open===n.close?c.push(t.listen(e,n.open,s)):c.push(t.listen(e,n.open,o),t.listen(e,n.close,i))}),function(){c.forEach(function(t){return t()})})}e.a=o;var i=function(){function t(t,e){this.open=t,this.close=e,e||(this.close=t)}return t.prototype.isManual=function(){return"manual"===this.open||"manual"===this.close},t}(),s={hover:["mouseenter","mouseleave"]},a=function(){}},"as+d":function(t,e,n){"use strict";var r=n("3j3K"),o=n("2Je8"),i=n("edM1"),s=n("v4DA");n.d(e,"a",function(){return u});var a=[i.a,i.b,i.c,i.d],u=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[s.a]}},t}();u.decorators=[{type:r.A,args:[{declarations:a,exports:a,imports:[o.b]}]}],u.ctorParameters=function(){return[]}},c7mC:function(t,e,n){"use strict";var r=n("3j3K");n.d(e,"a",function(){return o});var o=function(){function t(){this.up=!1,this.autoClose=!0}return t}();o.decorators=[{type:r.z}],o.ctorParameters=function(){return[]}},cG9e:function(t,e,n){"use strict";var r=n("3j3K");n.d(e,"a",function(){return o});var o=function(){function t(){this.editable=!0,this.focusFirst=!0,this.showHint=!1}return t}();o.decorators=[{type:r.z}],o.ctorParameters=function(){return[]}},cbuX:function(t,e,n){"use strict";function r(t){return void 0===t&&(t=Number.POSITIVE_INFINITY),this.lift(new a(t))}var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n("wAkD"),s=n("CURp");e.mergeAll=r;var a=function(){function t(t){this.concurrent=t}return t.prototype.call=function(t,e){return e.subscribe(new u(t,this.concurrent))},t}();e.MergeAllOperator=a;var u=function(t){function e(e,n){t.call(this,e),this.concurrent=n,this.hasCompleted=!1,this.buffer=[],this.active=0}return o(e,t),e.prototype._next=function(t){this.active<this.concurrent?(this.active++,this.add(s.subscribeToResult(this,t))):this.buffer.push(t)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete()},e.prototype.notifyComplete=function(t){var e=this.buffer;this.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(i.OuterSubscriber);e.MergeAllSubscriber=u},cdmN:function(t,e,n){"use strict";function r(t){var e=t.Symbol;if("function"==typeof e)return e.iterator||(e.iterator=e("iterator polyfill")),e.iterator;var n=t.Set;if(n&&"function"==typeof(new n)["@@iterator"])return"@@iterator";var r=t.Map;if(r)for(var o=Object.getOwnPropertyNames(r.prototype),i=0;i<o.length;++i){var s=o[i];if("entries"!==s&&"size"!==s&&r.prototype[s]===r.prototype.entries)return s}return"@@iterator"}var o=n("VOfZ");e.symbolIteratorPonyfill=r,e.iterator=r(o.root),e.$$iterator=e.iterator},eCJc:function(t,e,n){"use strict";var r=n("3j3K"),o=n("2Je8"),i=n("hApb"),s=n("ZwZs");n.d(e,"a",function(){return u});var a=[i.a,i.b,i.c,i.d],u=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[s.a]}},t}();u.decorators=[{type:r.A,args:[{declarations:a,exports:a,imports:[o.b]}]}],u.ctorParameters=function(){return[]}},edM1:function(t,e,n){"use strict";var r=n("3j3K"),o=n("v4DA");n.d(e,"d",function(){return s}),n.d(e,"c",function(){return a}),n.d(e,"b",function(){return u}),n.d(e,"a",function(){return c});var i=0,s=function(){function t(t){this.templateRef=t}return t}();s.decorators=[{type:r.U,args:[{selector:"ng-template[ngbTabTitle]"}]}],s.ctorParameters=function(){return[{type:r._1}]};var a=function(){function t(t){this.templateRef=t}return t}();a.decorators=[{type:r.U,args:[{selector:"ng-template[ngbTabContent]"}]}],a.ctorParameters=function(){return[{type:r._1}]};var u=function(){function t(){this.id="ngb-tab-"+i++,this.disabled=!1}return t}();u.decorators=[{type:r.U,args:[{selector:"ngb-tab"}]}],u.ctorParameters=function(){return[]},u.propDecorators={id:[{type:r.X}],title:[{type:r.X}],disabled:[{type:r.X}],contentTpl:[{type:r._15,args:[a]}],titleTpl:[{type:r._15,args:[s]}]};var c=function(){function t(t){this.destroyOnHide=!0,this.tabChange=new r.R,this.type=t.type,this.justify=t.justify}return t.prototype.select=function(t){var e=this._getTabById(t);if(e&&!e.disabled&&this.activeId!==e.id){var n=!1;this.tabChange.emit({activeId:this.activeId,nextId:e.id,preventDefault:function(){n=!0}}),n||(this.activeId=e.id)}},t.prototype.ngAfterContentChecked=function(){var t=this._getTabById(this.activeId);this.activeId=t?t.id:this.tabs.length?this.tabs.first.id:null},t.prototype._getTabById=function(t){var e=this.tabs.filter(function(e){return e.id===t});return e.length?e[0]:null},t}();c.decorators=[{type:r._10,args:[{selector:"ngb-tabset",exportAs:"ngbTabset",template:'\n <ul [class]="\'nav nav-\' + type + \' justify-content-\' + justify" role="tablist">\n <li class="nav-item" *ngFor="let tab of tabs">\n <a [id]="tab.id" class="nav-link" [class.active]="tab.id === activeId" [class.disabled]="tab.disabled"\n href (click)="!!select(tab.id)" role="tab" [attr.tabindex]="(tab.disabled ? \'-1\': undefined)"\n [attr.aria-controls]="(!destroyOnHide || tab.id === activeId ? tab.id + \'-panel\' : null)"\n [attr.aria-expanded]="tab.id === activeId" [attr.aria-disabled]="tab.disabled">\n {{tab.title}}<ng-template [ngTemplateOutlet]="tab.titleTpl?.templateRef"></ng-template>\n </a>\n </li>\n </ul>\n <div class="tab-content">\n <ng-template ngFor let-tab [ngForOf]="tabs">\n <div\n class="tab-pane {{tab.id === activeId ? \'active\' : null}}"\n *ngIf="!destroyOnHide || tab.id === activeId"\n role="tabpanel"\n [attr.aria-labelledby]="tab.id" id="{{tab.id}}-panel"\n [attr.aria-expanded]="tab.id === activeId">\n <ng-template [ngTemplateOutlet]="tab.contentTpl.templateRef"></ng-template>\n </div>\n </ng-template>\n </div>\n '}]}],c.ctorParameters=function(){return[{type:o.a}]},c.propDecorators={tabs:[{type:r._16,args:[u]}],activeId:[{type:r.X}],destroyOnHide:[{type:r.X}],justify:[{type:r.X}],type:[{type:r.X}],tabChange:[{type:r._14}]}},emOw:function(t,e,n){"use strict";function r(t,e){var n;if(n="function"==typeof t?t:function(){return t},"function"==typeof e)return this.lift(new i(n,e));var r=Object.create(this,o.connectableObservableDescriptor);return r.source=this,r.subjectFactory=n,r}var o=n("sIYO");e.multicast=r;var i=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var n=this.selector,r=this.subjectFactory(),o=n(r).subscribe(t);return o.add(e.subscribe(r)),o},t}();e.MulticastOperator=i},fAHw:function(t,e,n){"use strict";var r=n("lcaH"),o=n("hlt1"),i=n("3j3K");n.d(e,"a",function(){return s});var s=function(){function t(t){this._calendar=t}return t.prototype.generateMonthViewModel=function(t,e,n,r,i){var s={firstDate:null,number:t.month,year:t.year,weeks:[],weekdays:[]};t=this._getFirstViewDate(t,r);for(var a=0;a<this._calendar.getWeeksPerMonth();a++){for(var u=[],c=0;c<this._calendar.getDaysPerWeek();c++){0===a&&s.weekdays.push(this._calendar.getWeekday(t));var l=new o.a(t.year,t.month,t.day),p=e&&l.before(e)||n&&l.after(n);!p&&i&&(p=i(l,{month:s.number,year:s.year})),null===s.firstDate&&t.month===s.number&&(s.firstDate=l),u.push({date:l,disabled:p}),t=this._calendar.getNext(t)}s.weeks.push({number:this._calendar.getWeekNumber(u.map(function(t){return o.a.from(t.date)}),r),days:u})}return s},t.prototype.toValidDate=function(t,e){var n=o.a.from(t);return void 0===e&&(e=this._calendar.getToday()),this._calendar.isValid(n)?n:e},t.prototype._getFirstViewDate=function(t,e){for(var n=this,r=t.month,i=new o.a(t.year,t.month,t.day),s=this._calendar.getPrev(i),a=function(){return i.month!==s.month&&e===n._calendar.getWeekday(i)},u=function(){return i.month!==r&&e===n._calendar.getWeekday(i)};!u()&&!a();)i=new o.a(s.year,s.month,s.day),s=this._calendar.getPrev(s);return i},t}();s.decorators=[{type:i.z}],s.ctorParameters=function(){return[{type:r.b}]}},fWbP:function(t,e,n){"use strict";function r(t){return t&&"function"==typeof t.schedule}e.isScheduler=r},gEbu:function(t,e,n){"use strict";var r=n("3j3K");n.d(e,"b",function(){return u}),n.d(e,"a",function(){return c});var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=["Mo","Tu","We","Th","Fr","Sa","Su"],s=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],a=["January","February","March","April","May","June","July","August","September","October","November","December"],u=function(){function t(){}return t}();u.decorators=[{type:r.z}],u.ctorParameters=function(){return[]};var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.getWeekdayShortName=function(t){return i[t-1]},e.prototype.getMonthShortName=function(t){return s[t-1]},e.prototype.getMonthFullName=function(t){return a[t-1]},e}(u);c.decorators=[{type:r.z}],c.ctorParameters=function(){return[]}},gFLb:function(t,e,n){"use strict";var r=n("3j3K");n.d(e,"a",function(){return o});var o=function(){function t(){this.dismissible=!0,this.type="warning"}return t}();o.decorators=[{type:r.z}],o.ctorParameters=function(){return[]}},hApb:function(t,e,n){"use strict";var r=n("3j3K"),o=n("2yGx"),i=n("ZwZs");n.d(e,"c",function(){return a}),n.d(e,"d",function(){return u}),n.d(e,"b",function(){return c}),n.d(e,"a",function(){return l});var s=0,a=function(){function t(t){this.templateRef=t}return t}();a.decorators=[{type:r.U,args:[{selector:"ng-template[ngbPanelTitle]"}]}],a.ctorParameters=function(){return[{type:r._1}]};var u=function(){function t(t){this.templateRef=t}return t}();u.decorators=[{type:r.U,args:[{selector:"ng-template[ngbPanelContent]"}]}],u.ctorParameters=function(){return[{type:r._1}]};var c=function(){function t(){this.disabled=!1,this.id="ngb-panel-"+s++}return t}();c.decorators=[{type:r.U,args:[{selector:"ngb-panel"}]}],c.ctorParameters=function(){return[]},c.propDecorators={disabled:[{type:r.X}],id:[{type:r.X}],title:[{type:r.X}],type:[{type:r.X}],contentTpl:[{type:r._15,args:[u]}],titleTpl:[{type:r._15,args:[a]}]};var l=function(){function t(t){this._states=new Map,this._panelRefs=new Map,this.activeIds=[],this.panelChange=new r.R,this.type=t.type,this.closeOtherPanels=t.closeOthers}return t.prototype.toggle=function(t){var e=this._panelRefs.get(t);if(e&&!e.disabled){var n=!this._states.get(t),r=!1;this.panelChange.emit({panelId:t,nextState:n,preventDefault:function(){r=!0}}),r||(this._states.set(t,n),this.closeOtherPanels&&this._closeOthers(t),this._updateActiveIds())}},t.prototype.ngAfterContentChecked=function(){n.i(o.g)(this.activeIds)&&(this.activeIds=this.activeIds.split(/\s*,\s*/)),this._updateStates(),this.activeIds.length>1&&this.closeOtherPanels&&(this._closeOthers(this.activeIds[0]),this._updateActiveIds())},t.prototype.isOpen=function(t){return this._states.get(t)},t.prototype._closeOthers=function(t){var e=this;this._states.forEach(function(n,r){r!==t&&e._states.set(r,!1)})},t.prototype._updateActiveIds=function(){var t=this;this.activeIds=this.panels.toArray().filter(function(e){return t.isOpen(e.id)&&!e.disabled}).map(function(t){return t.id})},t.prototype._updateStates=function(){var t=this;this._states.clear(),this._panelRefs.clear(),this.panels.toArray().forEach(function(e){t._states.set(e.id,t.activeIds.indexOf(e.id)>-1&&!e.disabled),t._panelRefs.set(e.id,e)})},t}();l.decorators=[{type:r._10,args:[{selector:"ngb-accordion",exportAs:"ngbAccordion",host:{role:"tablist","[attr.aria-multiselectable]":"!closeOtherPanels"},template:'\n <div class="card">\n <ng-template ngFor let-panel [ngForOf]="panels">\n <div role="tab" id="{{panel.id}}-header"\n [class]="\'card-header \' + (panel.type ? \'card-\'+panel.type: type ? \'card-\'+type : \'\')" [class.active]="isOpen(panel.id)">\n <a href (click)="!!toggle(panel.id)" [class.text-muted]="panel.disabled" [attr.tabindex]="(panel.disabled ? \'-1\' : null)"\n [attr.aria-expanded]="isOpen(panel.id)" [attr.aria-controls]="(isOpen(panel.id) ? panel.id : null)"\n [attr.aria-disabled]="panel.disabled">\n {{panel.title}}<ng-template [ngTemplateOutlet]="panel.titleTpl?.templateRef"></ng-template>\n </a>\n </div>\n <div id="{{panel.id}}" role="tabpanel" [attr.aria-labelledby]="panel.id + \'-header\'" class="card-block" *ngIf="isOpen(panel.id)">\n <ng-template [ngTemplateOutlet]="panel.contentTpl.templateRef"></ng-template>\n </div>\n </ng-template>\n </div>\n'}]}],l.ctorParameters=function(){return[{type:i.a}]},l.propDecorators={panels:[{type:r._16,args:[c]}],activeIds:[{type:r.X}],closeOtherPanels:[{type:r.X,args:["closeOthers"]}],type:[{type:r.X}],panelChange:[{type:r._14}]}},hUSH:function(t,e,n){"use strict";var r=n("2yGx");n.d(e,"a",function(){return o});var o=function(){function t(t,e,o){this.hour=n.i(r.b)(t),this.minute=n.i(r.b)(e),this.second=n.i(r.b)(o)}return t.prototype.changeHour=function(t){void 0===t&&(t=1),this.updateHour((isNaN(this.hour)?0:this.hour)+t)},t.prototype.updateHour=function(t){n.i(r.a)(t)?this.hour=(t<0?24+t:t)%24:this.hour=NaN},t.prototype.changeMinute=function(t){void 0===t&&(t=1),this.updateMinute((isNaN(this.minute)?0:this.minute)+t)},t.prototype.updateMinute=function(t){n.i(r.a)(t)?(this.minute=t%60<0?60+t%60:t%60,this.changeHour(Math.floor(t/60))):this.minute=NaN},t.prototype.changeSecond=function(t){void 0===t&&(t=1),this.updateSecond((isNaN(this.second)?0:this.second)+t)},t.prototype.updateSecond=function(t){n.i(r.a)(t)?(this.second=t<0?60+t%60:t%60,this.changeMinute(Math.floor(t/60))):this.second=NaN},t.prototype.isValid=function(t){return void 0===t&&(t=!0),n.i(r.a)(this.hour)&&n.i(r.a)(this.minute)&&(!t||n.i(r.a)(this.second))},t.prototype.toString=function(){return(this.hour||0)+":"+(this.minute||0)+":"+(this.second||0)},t}()},hY6I:function(t,e,n){"use strict";var r=n("3j3K"),o=n("NVOs"),i=n("hlt1"),s=n("/KGk"),a=n("7DGp"),u=n("jRSa"),c=n("lcaH"),l=n("fAHw");n.d(e,"a",function(){return h});var p={provide:o.e,useExisting:n.i(r._9)(function(){return h}),multi:!0},f={provide:o.f,useExisting:n.i(r._9)(function(){return h}),multi:!0},h=function(){function t(t,e,o,i,s,a,c,l){var p=this;this._parserFormatter=t,this._elRef=e,this._vcRef=o,this._renderer=i,this._cfr=s,this._service=c,this._calendar=l,this._cRef=null,this.navigate=new r.R,this._onChange=function(t){},this._onTouched=function(){},this._validatorChange=function(){},this._zoneSubscription=a.onStable.subscribe(function(){p._cRef&&n.i(u.a)(p._elRef.nativeElement,p._cRef.location.nativeElement,"bottom-left")})}return t.prototype.registerOnChange=function(t){this._onChange=t},t.prototype.registerOnTouched=function(t){this._onTouched=t},t.prototype.registerOnValidatorChange=function(t){this._validatorChange=t},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elRef.nativeElement,"disabled",t),this.isOpen()&&this._cRef.instance.setDisabledState(t)},t.prototype.validate=function(t){var e=t.value;return null===e||void 0===e?null:this._calendar.isValid(e)?this.minDate&&i.a.from(e).before(i.a.from(this.minDate))?{ngbDate:{requiredBefore:this.minDate}}:this.maxDate&&i.a.from(e).after(i.a.from(this.maxDate))?{ngbDate:{requiredAfter:this.maxDate}}:void 0:{ngbDate:{invalid:t.value}}},t.prototype.writeValue=function(t){var e=t?new i.a(t.year,t.month,t.day):null;this._model=this._calendar.isValid(t)?e:null,this._writeModelValue(this._model)},t.prototype.manualDateChange=function(t){this._model=this._service.toValidDate(this._parserFormatter.parse(t),null),this._onChange(this._model?{year:this._model.year,month:this._model.month,day:this._model.day}:t),this._writeModelValue(this._model)},t.prototype.isOpen=function(){return!!this._cRef},t.prototype.open=function(){var t=this;if(!this.isOpen()){var e=this._cfr.resolveComponentFactory(s.a);this._cRef=this._vcRef.createComponent(e),this._applyPopupStyling(this._cRef.location.nativeElement),this._cRef.instance.writeValue(this._model),this._applyDatepickerInputs(this._cRef.instance),this._subscribeForDatepickerOutputs(this._cRef.instance),this._cRef.instance.ngOnInit(),this._cRef.instance.registerOnChange(function(e){t.writeValue(e),t._onChange(e),t.close()})}},t.prototype.close=function(){this.isOpen()&&(this._vcRef.remove(this._vcRef.indexOf(this._cRef.hostView)),this._cRef=null)},t.prototype.toggle=function(){this.isOpen()?this.close():this.open()},t.prototype.navigateTo=function(t){this.isOpen()&&this._cRef.instance.navigateTo(t)},t.prototype.onBlur=function(){this._onTouched()},t.prototype.ngOnChanges=function(t){(t.minDate||t.maxDate)&&this._validatorChange()},t.prototype._applyDatepickerInputs=function(t){var e=this;["dayTemplate","displayMonths","firstDayOfWeek","markDisabled","minDate","maxDate","navigation","outsideDays","showNavigation","showWeekdays","showWeekNumbers"].forEach(function(n){void 0!==e[n]&&(t[n]=e[n])}),t.startDate=this.startDate||this._model},t.prototype._applyPopupStyling=function(t){this._renderer.setElementClass(t,"dropdown-menu",!0),this._renderer.setElementStyle(t,"padding","0")},t.prototype._subscribeForDatepickerOutputs=function(t){var e=this;t.navigate.subscribe(function(t){return e.navigate.emit(t)})},t.prototype._writeModelValue=function(t){this._renderer.setElementProperty(this._elRef.nativeElement,"value",this._parserFormatter.format(t)),this.isOpen()&&(this._cRef.instance.writeValue(t),this._onTouched())},t}();h.decorators=[{type:r.U,args:[{selector:"input[ngbDatepicker]",exportAs:"ngbDatepicker",host:{"(change)":"manualDateChange($event.target.value)","(keyup.esc)":"close()","(blur)":"onBlur()"},providers:[p,f,l.a]}]}],h.ctorParameters=function(){return[{type:a.b},{type:r.V},{type:r._0},{type:r.W},{type:r.Z},{type:r.h},{type:l.a},{type:c.b}]},h.propDecorators={dayTemplate:[{type:r.X}],displayMonths:[{type:r.X}],firstDayOfWeek:[{type:r.X}],markDisabled:[{type:r.X}],minDate:[{type:r.X}],maxDate:[{type:r.X}],navigation:[{type:r.X}],outsideDays:[{type:r.X}],showWeekdays:[{type:r.X}],showWeekNumbers:[{type:r.X}],startDate:[{type:r.X}],navigate:[{type:r._14}]}},hYBY:function(t,e,n){"use strict";function r(t){var e=t.value,n=t.subscriber;n.closed||(n.next(e),n.complete())}function o(t){var e=t.err,n=t.subscriber;n.closed||n.error(e)}var i=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},s=n("VOfZ"),a=n("rCTf"),u=function(t){function e(e,n){t.call(this),this.promise=e,this.scheduler=n}return i(e,t),e.create=function(t,n){return new e(t,n)},e.prototype._subscribe=function(t){var e=this,n=this.promise,i=this.scheduler;if(null==i)this._isScalar?t.closed||(t.next(this.value),t.complete()):n.then(function(n){e.value=n,e._isScalar=!0,t.closed||(t.next(n),t.complete())},function(e){t.closed||t.error(e)}).then(null,function(t){s.root.setTimeout(function(){throw t})});else if(this._isScalar){if(!t.closed)return i.schedule(r,0,{value:this.value,subscriber:t})}else n.then(function(n){e.value=n,e._isScalar=!0,t.closed||t.add(i.schedule(r,0,{value:n,subscriber:t}))},function(e){t.closed||t.add(i.schedule(o,0,{err:e,subscriber:t}))}).then(null,function(t){s.root.setTimeout(function(){throw t})})},e}(a.Observable);e.PromiseObservable=u},hlt1:function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(){function t(t,e,n){this.year=t,this.month=e,this.day=n}return t.from=function(e){return e?new t(e.year,e.month,e.day?e.day:1):null},t.prototype.equals=function(t){return t&&this.year===t.year&&this.month===t.month&&this.day===t.day},t.prototype.before=function(t){return!!t&&(this.year===t.year?this.month===t.month?this.day!==t.day&&this.day<t.day:this.month<t.month:this.year<t.year)},t.prototype.after=function(t){return!!t&&(this.year===t.year?this.month===t.month?this.day!==t.day&&this.day>t.day:this.month>t.month:this.year>t.year)},t.prototype.toString=function(){return this.year+"-"+this.month+"-"+this.day},t}()},hwnt:function(t,e,n){"use strict";var r=n("3j3K");n.d(e,"a",function(){return o});var o=function(){function t(){this.displayMonths=1,this.firstDayOfWeek=1,this.navigation="select",this.outsideDays="visible",this.showWeekdays=!0,this.showWeekNumbers=!1}return t}();o.decorators=[{type:r.z}],o.ctorParameters=function(){return[]}},"ioK+":function(t,e,n){"use strict";var r=n("hYBY");e.fromPromise=r.PromiseObservable.create},jBEF:function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n("rCTf"),i=function(t){function e(e){t.call(this),this.scheduler=e}return r(e,t),e.create=function(t){return new e(t)},e.dispatch=function(t){t.subscriber.complete()},e.prototype._subscribe=function(t){var n=this.scheduler;if(n)return n.schedule(e.dispatch,0,{subscriber:t});t.complete()},e}(o.Observable);e.EmptyObservable=i},jRSa:function(t,e,n){"use strict";function r(t,e,n,r){var o=i.positionElements(t,e,n,r);e.style.top=o.top+"px",e.style.left=o.left+"px"}e.a=r;var o=function(){function t(){}return t.prototype.getStyle=function(t,e){return window.getComputedStyle(t)[e]},t.prototype.isStaticPositioned=function(t){return"static"===(this.getStyle(t,"position")||"static")},t.prototype.offsetParent=function(t){for(var e=t.offsetParent||document.documentElement;e&&e!==document.documentElement&&this.isStaticPositioned(e);)e=e.offsetParent;return e||document.documentElement},t.prototype.position=function(t,e){void 0===e&&(e=!0);var n,r={width:0,height:0,top:0,bottom:0,left:0,right:0};if("fixed"===this.getStyle(t,"position"))n=t.getBoundingClientRect();else{var o=this.offsetParent(t);n=this.offset(t,!1),o!==document.documentElement&&(r=this.offset(o,!1)),r.top+=o.clientTop,r.left+=o.clientLeft}return n.top-=r.top,n.bottom-=r.top,n.left-=r.left,n.right-=r.left,e&&(n.top=Math.round(n.top),n.bottom=Math.round(n.bottom),n.left=Math.round(n.left),n.right=Math.round(n.right)),n},t.prototype.offset=function(t,e){void 0===e&&(e=!0);var n=t.getBoundingClientRect(),r={top:window.pageYOffset-document.documentElement.clientTop,left:window.pageXOffset-document.documentElement.clientLeft},o={height:n.height||t.offsetHeight,width:n.width||t.offsetWidth,top:n.top+r.top,bottom:n.bottom+r.top,left:n.left+r.left,right:n.right+r.left};return e&&(o.height=Math.round(o.height),o.width=Math.round(o.width),o.top=Math.round(o.top),o.bottom=Math.round(o.bottom),o.left=Math.round(o.left),o.right=Math.round(o.right)),o},t.prototype.positionElements=function(t,e,n,r){var o=r?this.offset(t,!1):this.position(t,!1),i={left:o.left,center:o.left+o.width/2-e.offsetWidth/2,right:o.left+o.width},s={top:o.top,center:o.top+o.height/2-e.offsetHeight/2,bottom:o.top+o.height},a=e.getBoundingClientRect(),u=n.split("-")[0]||"top",c=n.split("-")[1]||"center",l={height:a.height||e.offsetHeight,width:a.width||e.offsetWidth,top:0,bottom:a.height||e.offsetHeight,left:0,right:a.width||e.offsetWidth};switch(u){case"top":l.top=o.top-e.offsetHeight,l.bottom+=o.top-e.offsetHeight,l.left=i[c],l.right+=i[c];break;case"bottom":l.top=s[u],l.bottom+=s[u],l.left=i[c],l.right+=i[c];break;case"left":l.top=s[c],l.bottom+=s[c],l.left=o.left-e.offsetWidth,l.right+=o.left-e.offsetWidth;break;case"right":l.top=s[c],l.bottom+=s[c],l.left=i[u],l.right+=i[u]}return l.top=Math.round(l.top),l.bottom=Math.round(l.bottom),l.left=Math.round(l.left),l.right=Math.round(l.right),l},t}(),i=new o},kgIC:function(t,e,n){"use strict";var r=n("3j3K");n.d(e,"a",function(){return o});var o=function(){function t(){this.collapsed=!1}return t}();o.decorators=[{type:r.U,args:[{selector:"[ngbCollapse]",exportAs:"ngbCollapse",host:{"[class.collapse]":"true","[class.show]":"!collapsed"}}]}],o.ctorParameters=function(){return[]},o.propDecorators={collapsed:[{type:r.X,args:["ngbCollapse"]}]}},kkb0:function(t,e,n){"use strict";function r(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return this.lift.call(o.apply(void 0,[this].concat(t)))}function o(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];var n=Number.POSITIVE_INFINITY,r=null,o=t[t.length-1];return u.isScheduler(o)?(r=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof o&&(n=t.pop()),null===r&&1===t.length&&t[0]instanceof i.Observable?t[0]:new s.ArrayObservable(t,r).lift(new a.MergeAllOperator(n))}var i=n("rCTf"),s=n("Yh8Q"),a=n("cbuX"),u=n("fWbP");e.merge=r,e.mergeStatic=o},kzcK:function(t,e,n){"use strict";var r=n("3j3K"),o=n("eCJc"),i=n("RX2M"),s=n("M0cT"),a=n("/I96"),u=n("vfkA"),c=n("qsK9"),l=n("MSQt"),p=n("UyZi"),f=n("Ep2y"),h=n("WKBe"),d=n("1Z2I"),y=n("A8b0"),m=n("as+d"),g=n("62nT"),v=n("yDyO"),b=n("K/oD");n.d(e,"a",function(){return w});var _=[o.a,i.a,s.a,a.a,u.a,c.a,l.a,p.a,f.a,h.a,d.a,y.a,m.a,g.a,v.a,b.a],w=function(){function t(){}return t}();w.decorators=[{type:r.A,args:[{imports:[i.a.forRoot(),s.a.forRoot(),u.a.forRoot(),d.a.forRoot(),v.a.forRoot(),b.a.forRoot(),o.a.forRoot(),a.a.forRoot(),c.a.forRoot(),l.a.forRoot(),p.a.forRoot(),f.a.forRoot(),h.a.forRoot(),d.a.forRoot(),y.a.forRoot(),m.a.forRoot(),g.a.forRoot(),v.a.forRoot()],exports:_}]}],w.ctorParameters=function(){return[]};var C=function(){function t(){}return t.forRoot=function(){return{ngModule:w}},t}();C.decorators=[{type:r.A,args:[{imports:_,exports:_}]}],C.ctorParameters=function(){return[]}},l5HU:function(t,e,n){"use strict";var r=n("3j3K"),o=n("DDfv");n.d(e,"a",function(){return u});var i=0,s=function(){function t(t){this.tplRef=t,this.id="ngb-slide-"+i++}return t}();s.decorators=[{type:r.U,args:[{selector:"ng-template[ngbSlide]"}]}],s.ctorParameters=function(){return[{type:r._1}]},s.propDecorators={id:[{type:r.X}]};var a=function(){function t(t){this.interval=t.interval,this.wrap=t.wrap,this.keyboard=t.keyboard}return t.prototype.ngAfterContentChecked=function(){var t=this._getSlideById(this.activeId);this.activeId=t?t.id:this.slides.length?this.slides.first.id:null},t.prototype.ngOnInit=function(){this._startTimer()},t.prototype.ngOnDestroy=function(){clearInterval(this._slideChangeInterval)},t.prototype.select=function(t){this.cycleToSelected(t),this._restartTimer()},t.prototype.prev=function(){this.cycleToPrev(),this._restartTimer()},t.prototype.next=function(){this.cycleToNext(),this._restartTimer()},t.prototype.pause=function(){this._stopTimer()},t.prototype.cycle=function(){this._startTimer()},t.prototype.cycleToNext=function(){this.cycleToSelected(this._getNextSlide(this.activeId))},t.prototype.cycleToPrev=function(){this.cycleToSelected(this._getPrevSlide(this.activeId))},t.prototype.cycleToSelected=function(t){var e=this._getSlideById(t);e&&(this.activeId=e.id)},t.prototype.keyPrev=function(){this.keyboard&&this.prev()},t.prototype.keyNext=function(){this.keyboard&&this.next()},t.prototype._restartTimer=function(){this._stopTimer(),this._startTimer()},t.prototype._startTimer=function(){var t=this;this.interval>0&&(this._slideChangeInterval=setInterval(function(){t.cycleToNext()},this.interval))},t.prototype._stopTimer=function(){clearInterval(this._slideChangeInterval)},t.prototype._getSlideById=function(t){var e=this.slides.filter(function(e){return e.id===t});return e.length?e[0]:null},t.prototype._getSlideIdxById=function(t){return this.slides.toArray().indexOf(this._getSlideById(t))},t.prototype._getNextSlide=function(t){var e=this.slides.toArray(),n=this._getSlideIdxById(t);return n===e.length-1?this.wrap?e[0].id:e[e.length-1].id:e[n+1].id},t.prototype._getPrevSlide=function(t){var e=this.slides.toArray(),n=this._getSlideIdxById(t);return 0===n?this.wrap?e[e.length-1].id:e[0].id:e[n-1].id},t}();a.decorators=[{type:r._10,args:[{selector:"ngb-carousel",exportAs:"ngbCarousel",host:{class:"carousel slide","[style.display]":'"block"',tabIndex:"0","(mouseenter)":"pause()","(mouseleave)":"cycle()","(keydown.arrowLeft)":"keyPrev()","(keydown.arrowRight)":"keyNext()"},template:'\n <ol class="carousel-indicators">\n <li *ngFor="let slide of slides" [id]="slide.id" [class.active]="slide.id === activeId" (click)="cycleToSelected(slide.id)"></li>\n </ol>\n <div class="carousel-inner">\n <div *ngFor="let slide of slides" class="carousel-item" [class.active]="slide.id === activeId">\n <ng-template [ngTemplateOutlet]="slide.tplRef"></ng-template>\n </div>\n </div>\n <a class="left carousel-control-prev" role="button" (click)="cycleToPrev()">\n <span class="carousel-control-prev-icon" aria-hidden="true"></span>\n <span class="sr-only">Previous</span>\n </a>\n <a class="right carousel-control-next" role="button" (click)="cycleToNext()">\n <span class="carousel-control-next-icon" aria-hidden="true"></span>\n <span class="sr-only">Next</span>\n </a>\n '}]}],a.ctorParameters=function(){return[{type:o.a}]},a.propDecorators={slides:[{type:r._16,args:[s]}],interval:[{type:r.X}],wrap:[{type:r.X}],keyboard:[{type:r.X}],activeId:[{type:r.X}]};var u=[a,s]},lHsB:function(t,e,n){"use strict";function r(t,e,n){if(t){if(t instanceof o.Subscriber)return t;if(t[i.rxSubscriber])return t[i.rxSubscriber]()}return t||e||n?new o.Subscriber(t,e,n):new o.Subscriber(s.empty)}var o=n("mmVS"),i=n("r8ZY"),s=n("yrou");e.toSubscriber=r},lcaH:function(t,e,n){"use strict";function r(t){return new i.a(t.getFullYear(),t.getMonth()+1,t.getDate())}function o(t){var e=new Date(t.year,t.month-1,t.day);return isNaN(e.getTime())||e.setFullYear(t.year),e}var i=n("hlt1"),s=n("3j3K"),a=n("2yGx");n.d(e,"b",function(){return c}),n.d(e,"a",function(){return l});var u=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},c=function(){function t(){}return t}();c.decorators=[{type:s.z}],c.ctorParameters=function(){return[]};var l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e.prototype.getDaysPerWeek=function(){return 7},e.prototype.getMonths=function(){return[1,2,3,4,5,6,7,8,9,10,11,12]},e.prototype.getWeeksPerMonth=function(){return 6},e.prototype.getNext=function(t,e,n){void 0===e&&(e="d"),void 0===n&&(n=1);var s=o(t);switch(e){case"y":return new i.a(t.year+n,1,1);case"m":s=new Date(t.year,t.month+n-1,1);break;case"d":s.setDate(s.getDate()+n);break;default:return t}return r(s)},e.prototype.getPrev=function(t,e,n){return void 0===e&&(e="d"),void 0===n&&(n=1),this.getNext(t,e,-n)},e.prototype.getWeekday=function(t){var e=o(t),n=e.getDay();return 0===n?7:n},e.prototype.getWeekNumber=function(t,e){7===e&&(e=0);var n=(11-e)%7,r=t[n],i=o(r);i.setDate(i.getDate()+4-(i.getDay()||7));var s=i.getTime();return i.setMonth(0),i.setDate(1),Math.floor(Math.round((s-i.getTime())/864e5)/7)+1},e.prototype.getToday=function(){return r(new Date)},e.prototype.isValid=function(t){if(!(t&&n.i(a.d)(t.year)&&n.i(a.d)(t.month)&&n.i(a.d)(t.day)))return!1;var e=o(t);return!isNaN(e.getTime())&&e.getFullYear()===t.year&&e.getMonth()+1===t.month&&e.getDate()===t.day},e}(c);l.decorators=[{type:s.z}],l.ctorParameters=function(){return[]}},mbVC:function(t,e,n){"use strict";function r(t){var e,n=t.Symbol;return"function"==typeof n?n.observable?e=n.observable:(e=n("observable"),n.observable=e):e="@@observable",e}var o=n("VOfZ");e.getSymbolObservable=r,e.observable=r(o.root),e.$$observable=e.observable},mmVS:function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n("SKH6"),i=n("B00U"),s=n("yrou"),a=n("r8ZY"),u=function(t){function e(n,r,o){switch(t.call(this),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=s.empty;break;case 1:if(!n){this.destination=s.empty;break}if("object"==typeof n){n instanceof e?(this.destination=n,this.destination.add(this)):(this.syncErrorThrowable=!0,this.destination=new c(this,n));break}default:this.syncErrorThrowable=!0,this.destination=new c(this,n,r,o)}}return r(e,t),e.prototype[a.rxSubscriber]=function(){return this},e.create=function(t,n,r){var o=new e(t,n,r);return o.syncErrorThrowable=!1,o},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var t=this,e=t._parent,n=t._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=e,this._parents=n,this},e}(i.Subscription);e.Subscriber=u;var c=function(t){function e(e,n,r,i){t.call(this),this._parentSubscriber=e;var a,u=this;o.isFunction(n)?a=n:n&&(a=n.next,r=n.error,i=n.complete,n!==s.empty&&(u=Object.create(n),o.isFunction(u.unsubscribe)&&this.add(u.unsubscribe.bind(u)),u.unsubscribe=this.unsubscribe.bind(this))),this._context=u,this._next=a,this._error=r,this._complete=i}return r(e,t),e.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},e.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber;if(this._error)e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else{if(!e.syncErrorThrowable)throw this.unsubscribe(),t;e.syncErrorValue=t,e.syncErrorThrown=!0,this.unsubscribe()}}},e.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var n=function(){return t._complete.call(t._context)};e.syncErrorThrowable?(this.__tryOrSetError(e,n),this.unsubscribe()):(this.__tryOrUnsub(n),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){throw this.unsubscribe(),t}},e.prototype.__tryOrSetError=function(t,e,n){try{e.call(this._context,n)}catch(e){return t.syncErrorValue=e,t.syncErrorThrown=!0,!0}return!1},e.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},e}(u)},nCuf:function(t,e,n){"use strict";var r=n("3j3K");n.d(e,"a",function(){return o});var o=function(){function t(){this.max=100,this.animated=!1,this.striped=!1,this.showValue=!1}return t}();o.decorators=[{type:r.z}],o.ctorParameters=function(){return[]}},nxqe:function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r;!function(t){t[t.BACKDROP_CLICK=0]="BACKDROP_CLICK",t[t.ESC=1]="ESC"}(r||(r={}))},qBUJ:function(t,e,n){"use strict";var r=n("3j3K"),o=n("hlt1"),i=n("2yGx"),s=n("gEbu"),a=n("lcaH");n.d(e,"a",function(){return u});var u=function(){function t(t,e){this.i18n=t,this.calendar=e,this.years=[],this.select=new r.R,this.months=e.getMonths()}return t.prototype.ngOnChanges=function(t){(t.maxDate||t.minDate||t.date)&&(this._generateYears(),this._generateMonths())},t.prototype.changeMonth=function(t){this.select.emit(new o.a(this.date.year,n.i(i.b)(t),1))},t.prototype.changeYear=function(t){this.select.emit(new o.a(n.i(i.b)(t),this.date.month,1))},t.prototype._generateMonths=function(){var t=this;if(this.months=this.calendar.getMonths(),this.date&&this.date.year===this.minDate.year){var e=this.months.findIndex(function(e){return e===t.minDate.month});this.months=this.months.slice(e)}if(this.date&&this.date.year===this.maxDate.year){var e=this.months.findIndex(function(e){return e===t.maxDate.month});this.months=this.months.slice(0,e+1)}},t.prototype._generateYears=function(){var t=this;this.years=Array.from({length:this.maxDate.year-this.minDate.year+1},function(e,n){return t.minDate.year+n})},t}();u.decorators=[{type:r._10,args:[{selector:"ngb-datepicker-navigation-select",styles:["\n select {\n /* to align with btn-sm */\n padding: 0.25rem 0.5rem;\n font-size: 0.875rem; \n line-height: 1.25;\n /* to cancel the custom height set by custom-select */\n height: inherit;\n width: 50%;\n }\n "],template:'\n <select [disabled]="disabled" class="custom-select d-inline-block" [value]="date?.month" (change)="changeMonth($event.target.value)">\n <option *ngFor="let m of months" [value]="m">{{ i18n.getMonthShortName(m) }}</option>\n </select><select [disabled]="disabled" class="custom-select d-inline-block" [value]="date?.year" (change)="changeYear($event.target.value)">\n <option *ngFor="let y of years" [value]="y">{{ y }}</option>\n </select> \n '}]}],u.ctorParameters=function(){return[{type:s.b},{type:a.b}]},u.propDecorators={date:[{type:r.X}],disabled:[{type:r.X}],maxDate:[{type:r.X}],minDate:[{type:r.X}],select:[{type:r._14}]}},qKow:function(t,e,n){"use strict";var r=n("3j3K");n.d(e,"a",function(){return o});var o=function(){function t(){this.placement="top",this.triggers="hover"}return t}();o.decorators=[{type:r.z}],o.ctorParameters=function(){return[]}},"qQ/N":function(t,e,n){"use strict";var r=n("3j3K"),o=n("aKiW"),i=n("2yGx"),s=n("NVOs");n.d(e,"a",function(){return c});var a;!function(t){t[t.End=35]="End",t[t.Home=36]="Home",t[t.ArrowLeft=37]="ArrowLeft",t[t.ArrowUp=38]="ArrowUp",t[t.ArrowRight=39]="ArrowRight",t[t.ArrowDown=40]="ArrowDown"}(a||(a={}));var u={provide:s.e,useExisting:n.i(r._9)(function(){return c}),multi:!0},c=function(){function t(t,e){this._changeDetectorRef=e,this.contexts=[],this.disabled=!1,this.hover=new r.R,this.leave=new r.R,this.rateChange=new r.R(!0),this.onChange=function(t){},this.onTouched=function(){},this.max=t.max,this.readonly=t.readonly}return t.prototype.ariaValueText=function(){return this.nextRate+" out of "+this.max},t.prototype.enter=function(t){this.readonly||this.disabled||this._updateState(t),this.hover.emit(t)},t.prototype.handleKeyDown=function(t){if(a[n.i(i.e)(t.which)])switch(t.preventDefault(),t.which){case a.ArrowDown:case a.ArrowLeft:this.update(this.rate-1);break;case a.ArrowUp:case a.ArrowRight:this.update(this.rate+1);break;case a.Home:this.update(0);break;case a.End:this.update(this.max)}},t.prototype.ngOnChanges=function(t){t.rate&&this.update(this.rate)},t.prototype.ngOnInit=function(){this.contexts=Array.from({length:this.max},function(){return{fill:0}}),this._updateState(this.rate)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.reset=function(){this.leave.emit(this.nextRate),this._updateState(this.rate)},t.prototype.setDisabledState=function(t){this.disabled=t},t.prototype.update=function(t,e){void 0===e&&(e=!0);var r=n.i(i.f)(t,this.max,0);this.readonly||this.disabled||this.rate===r||(this.rate=r,this.rateChange.emit(this.rate)),e&&this.onChange(this.rate),this._updateState(this.rate)},t.prototype.writeValue=function(t){this.update(t,!1),this._changeDetectorRef.markForCheck()},t.prototype._getFillValue=function(t){var e=this.nextRate-t;return e>=1?100:e<1&&e>0?Number.parseInt((100*e).toFixed(2)):0},t.prototype._updateState=function(t){var e=this;this.nextRate=t,this.contexts.forEach(function(t,n){return t.fill=e._getFillValue(n)})},t}();c.decorators=[{type:r._10,args:[{selector:"ngb-rating",changeDetection:r._17.OnPush,host:{class:"d-inline-flex",tabindex:"0",role:"slider","aria-valuemin":"0","[attr.aria-valuemax]":"max","[attr.aria-valuenow]":"nextRate","[attr.aria-valuetext]":"ariaValueText()","[attr.aria-disabled]":"readonly ? true : null","(mouseleave)":"reset()","(keydown)":"handleKeyDown($event)"},template:'\n <ng-template #t let-fill="fill">{{ fill === 100 ? \'&#9733;\' : \'&#9734;\' }}</ng-template>\n <ng-template ngFor [ngForOf]="contexts" let-index="index">\n <span class="sr-only">({{ index < nextRate ? \'*\' : \' \' }})</span>\n <span (mouseenter)="enter(index + 1)" (click)="update(index + 1)" [style.cursor]="readonly || disabled ? \'default\' : \'pointer\'">\n <ng-template [ngTemplateOutlet]="starTemplate || t" [ngOutletContext]="contexts[index]"></ng-template>\n </span>\n </ng-template>\n ',providers:[u]}]}],c.ctorParameters=function(){return[{type:o.a},{type:r._8}]},c.propDecorators={max:[{type:r.X}],rate:[{type:r.X}],readonly:[{type:r.X}],starTemplate:[{type:r.X},{type:r._15,args:[r._1]}],hover:[{type:r._14}],leave:[{type:r._14}],rateChange:[{type:r._14}]}},qoi6:function(t,e,n){"use strict";var r=n("3j3K"),o=n("NVOs"),i=n("sb+e"),s=(n.n(i),n("Rewd")),a=(n.n(s),n("TIy+")),u=(n.n(a),n("jRSa")),c=n("2BXm"),l=n("/PMa"),p=n("2yGx"),f=n("cG9e");n.d(e,"a",function(){return m});var h;!function(t){t[t.Tab=9]="Tab",t[t.Enter=13]="Enter",t[t.Escape=27]="Escape",t[t.ArrowUp=38]="ArrowUp",t[t.ArrowDown=40]="ArrowDown"}(h||(h={}));var d={provide:o.e,useExisting:n.i(r._9)(function(){return m}),multi:!0},y=0,m=function(){function t(t,e,o,i,s,p,f){var h=this;this._elementRef=t,this._viewContainerRef=e,this._renderer=o,this._injector=i,this.selectItem=new r.R,this.popupId="ngb-typeahead-"+y++,this._onTouched=function(){},this._onChange=function(t){},this.editable=p.editable,this.focusFirst=p.focusFirst,this.showHint=p.showHint,this._valueChanges=n.i(a.fromEvent)(t.nativeElement,"input",function(t){return t.target.value}),this._popupService=new l.a(c.a,i,e,o,s),this._zoneSubscription=f.onStable.subscribe(function(){h.isPopupOpen()&&n.i(u.a)(h._elementRef.nativeElement,h._windowRef.location.nativeElement,"bottom-left")})}return t.prototype.ngOnInit=function(){var t=this,e=s._do.call(this._valueChanges,function(e){t._userInput=e,t.editable&&t._onChange(e)}),n=i.letProto.call(e,this.ngbTypeahead),r=s._do.call(n,function(){t.editable||t._onChange(void 0)});this._subscription=this._subscribeToUserInput(r)},t.prototype.ngOnDestroy=function(){this._unsubscribeFromUserInput(),this._zoneSubscription.unsubscribe()},t.prototype.registerOnChange=function(t){this._onChange=t},t.prototype.registerOnTouched=function(t){this._onTouched=t},t.prototype.writeValue=function(t){this._writeInputValue(this._formatItemForInput(t))},t.prototype.setDisabledState=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"disabled",t)},t.prototype.dismissPopup=function(){this.isPopupOpen()&&(this._closePopup(),this._writeInputValue(this._userInput))},t.prototype.isPopupOpen=function(){return null!=this._windowRef},t.prototype.handleBlur=function(){this._onTouched()},t.prototype.handleKeyDown=function(t){if(this.isPopupOpen()&&h[n.i(p.e)(t.which)])switch(t.which){case h.ArrowDown:t.preventDefault(),this._windowRef.instance.next(),this._showHint();break;case h.ArrowUp:t.preventDefault(),this._windowRef.instance.prev(),this._showHint();break;case h.Enter:case h.Tab:var e=this._windowRef.instance.getActive();n.i(p.i)(e)&&(t.preventDefault(),t.stopPropagation(),this._selectResult(e)),this._closePopup();break;case h.Escape:t.preventDefault(),this.dismissPopup()}},t.prototype._openPopup=function(){var t=this;this.isPopupOpen()||(this._windowRef=this._popupService.open(),this._windowRef.instance.id=this.popupId,this._windowRef.instance.selectEvent.subscribe(function(e){return t._selectResultClosePopup(e)}),this._windowRef.instance.activeChangeEvent.subscribe(function(e){return t.activeDescendant=e}))},t.prototype._closePopup=function(){this._popupService.close(),this._windowRef=null,this.activeDescendant=void 0},t.prototype._selectResult=function(t){var e=!1;this.selectItem.emit({item:t,preventDefault:function(){e=!0}}),e||(this.writeValue(t),this._onChange(t))},t.prototype._selectResultClosePopup=function(t){this._selectResult(t),this._closePopup()},t.prototype._showHint=function(){if(this.showHint){var t=this._userInput.toLowerCase(),e=this._formatItemForInput(this._windowRef.instance.getActive());t===e.substr(0,this._userInput.length).toLowerCase()?(this._writeInputValue(this._userInput+e.substr(this._userInput.length)),this._renderer.invokeElementMethod(this._elementRef.nativeElement,"setSelectionRange",[this._userInput.length,e.length])):this.writeValue(this._windowRef.instance.getActive())}},t.prototype._formatItemForInput=function(t){return t&&this.inputFormatter?this.inputFormatter(t):n.i(p.e)(t)},t.prototype._writeInputValue=function(t){this._renderer.setElementProperty(this._elementRef.nativeElement,"value",t)},t.prototype._subscribeToUserInput=function(t){var e=this;return t.subscribe(function(t){t&&0!==t.length?(e._openPopup(),e._windowRef.instance.focusFirst=e.focusFirst,e._windowRef.instance.results=t,e._windowRef.instance.term=e._elementRef.nativeElement.value,e.resultFormatter&&(e._windowRef.instance.formatter=e.resultFormatter),e.resultTemplate&&(e._windowRef.instance.resultTemplate=e.resultTemplate),e._showHint(),e._windowRef.changeDetectorRef.detectChanges()):e._closePopup()})},t.prototype._unsubscribeFromUserInput=function(){this._subscription&&this._subscription.unsubscribe(),this._subscription=null},t}();m.decorators=[{type:r.U,args:[{selector:"input[ngbTypeahead]",host:{"(blur)":"handleBlur()","[class.open]":"isPopupOpen()","(document:click)":"dismissPopup()","(keydown)":"handleKeyDown($event)",autocomplete:"off",autocapitalize:"off",autocorrect:"off",role:"combobox","aria-multiline":"false","[attr.aria-autocomplete]":'showHint ? "both" : "list"',"[attr.aria-activedescendant]":"activeDescendant","[attr.aria-owns]":"isPopupOpen() ? popupId : null","[attr.aria-expanded]":"isPopupOpen()"},providers:[d]}]}],m.ctorParameters=function(){return[{type:r.V},{type:r._0},{type:r.W},{type:r._11},{type:r.Z},{type:f.a},{type:r.h}]},m.propDecorators={editable:[{type:r.X}],focusFirst:[{type:r.X}],inputFormatter:[{type:r.X}],ngbTypeahead:[{type:r.X}],resultFormatter:[{type:r.X}],resultTemplate:[{type:r.X}],showHint:[{type:r.X}],selectItem:[{type:r._14}]}},qsK9:function(t,e,n){"use strict";var r=n("3j3K"),o=n("2Je8"),i=n("/KGk"),s=n("5ZV5"),a=n("3fcS"),u=n("hY6I"),c=n("NVOs"),l=n("U6gI"),p=n("gEbu"),f=n("lcaH"),h=n("7DGp"),d=n("qBUJ"),y=n("hwnt");n("/FbB");n.d(e,"a",function(){return m});var m=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[{provide:f.b,useClass:f.a},{provide:p.b,useClass:p.a},{provide:h.b,useClass:h.a},y.a]}},t}();m.decorators=[{type:r.A,args:[{declarations:[i.a,s.a,a.a,d.a,l.a,u.a],exports:[i.a,u.a],imports:[o.b,c.d],entryComponents:[i.a]}]}],m.ctorParameters=function(){return[]}},r8ZY:function(t,e,n){"use strict";var r=n("VOfZ"),o=r.root.Symbol;e.rxSubscriber="function"==typeof o&&"function"==typeof o.for?o.for("rxSubscriber"):"@@rxSubscriber",e.$$rxSubscriber=e.rxSubscriber},rCTf:function(t,e,n){"use strict";var r=n("VOfZ"),o=n("lHsB"),i=n("mbVC"),s=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r=this.operator,i=o.toSubscriber(t,e,n);if(r?r.call(i,this.source):i.add(this._trySubscribe(i)),i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.syncErrorThrown=!0,t.syncErrorValue=e,t.error(e)}},t.prototype.forEach=function(t,e){var n=this;if(e||(r.root.Rx&&r.root.Rx.config&&r.root.Rx.config.Promise?e=r.root.Rx.config.Promise:r.root.Promise&&(e=r.root.Promise)),!e)throw new Error("no Promise impl found");return new e(function(e,r){var o;o=n.subscribe(function(e){if(o)try{t(e)}catch(t){r(t),o.unsubscribe()}else t(e)},r,e)})},t.prototype._subscribe=function(t){return this.source.subscribe(t)},t.prototype[i.observable]=function(){return this},t.create=function(e){return new t(e)},t}();e.Observable=s},s28n:function(t,e,n){"use strict";var r=n("3j3K"),o=n("gFLb");n.d(e,"a",function(){return i});var i=function(){function t(t){this.close=new r.R,this.dismissible=t.dismissible,this.type=t.type}return t.prototype.closeHandler=function(){this.close.emit(null)},t}();i.decorators=[{type:r._10,args:[{selector:"ngb-alert",changeDetection:r._17.OnPush,template:'\n <div [class]="\'alert alert-\' + type + (dismissible ? \' alert-dismissible\' : \'\')" role="alert">\n <button *ngIf="dismissible" type="button" class="close" aria-label="Close" (click)="closeHandler()">\n <span aria-hidden="true">&times;</span>\n </button>\n <ng-content></ng-content>\n </div>\n '}]}],i.ctorParameters=function(){return[{type:o.a}]},i.propDecorators={dismissible:[{type:r.X}],type:[{type:r.X}],close:[{type:r._14}]}},sIYO:function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n("EEr4"),i=n("rCTf"),s=n("mmVS"),a=n("B00U"),u=function(t){function e(e,n){t.call(this),this.source=e,this.subjectFactory=n,this._refCount=0,this._isComplete=!1}return r(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,t=this._connection=new a.Subscription,t.add(this.source.subscribe(new l(this.getSubject(),this))),t.closed?(this._connection=null,t=a.Subscription.EMPTY):this._connection=t),t},e.prototype.refCount=function(){return this.lift(new p(this))},e}(i.Observable);e.ConnectableObservable=u;var c=u.prototype;e.connectableObservableDescriptor={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:c._subscribe},_isComplete:{value:c._isComplete,writable:!0},getSubject:{value:c.getSubject},connect:{value:c.connect},refCount:{value:c.refCount}};var l=function(t){function e(e,n){t.call(this,e),this.connectable=n}return r(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(o.SubjectSubscriber),p=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var n=this.connectable;n._refCount++;var r=new f(t,n),o=e.subscribe(r);return r.closed||(r.connection=n.connect()),o},t}(),f=function(t){function e(e,n){t.call(this,e),this.connectable=n}return r(e,t),e.prototype._unsubscribe=function(){var t=this.connectable;if(!t)return void(this.connection=null);this.connectable=null;var e=t._refCount;if(e<=0)return void(this.connection=null);if(t._refCount=e-1,e>1)return void(this.connection=null);var n=this.connection,r=t._connection;this.connection=null,!r||n&&r!==n||r.unsubscribe()},e}(s.Subscriber)},"sb+e":function(t,e,n){"use strict";function r(t){return t(this)}e.letProto=r},sgnN:function(t,e,n){"use strict";var r=n("3j3K"),o=n("aalB"),i=n("jRSa"),s=n("/PMa"),a=n("qKow");n.d(e,"b",function(){return c}),n.d(e,"a",function(){return l});var u=0,c=function(){function t(){this.placement="top"}return t}();c.decorators=[{type:r._10,args:[{selector:"ngb-tooltip-window",changeDetection:r._17.OnPush,host:{"[class]":'"tooltip show tooltip-" + placement',role:"tooltip","[id]":"id"},template:'\n <div class="tooltip-inner"><ng-content></ng-content></div>\n '}]}],c.ctorParameters=function(){return[]},c.propDecorators={placement:[{type:r.X}],id:[{type:r.X}]};var l=function(){function t(t,e,o,a,l,p,f){var h=this;this._elementRef=t,this._renderer=e,this.shown=new r.R,this.hidden=new r.R,this._ngbTooltipWindowId="ngb-tooltip-"+u++,this.placement=p.placement,this.triggers=p.triggers,this.container=p.container,this._popupService=new s.a(c,o,l,e,a),this._zoneSubscription=f.onStable.subscribe(function(){h._windowRef&&n.i(i.a)(h._elementRef.nativeElement,h._windowRef.location.nativeElement,h.placement,"body"===h.container)})}return Object.defineProperty(t.prototype,"ngbTooltip",{get:function(){return this._ngbTooltip},set:function(t){this._ngbTooltip=t,!t&&this._windowRef&&this.close()},enumerable:!0,configurable:!0}),t.prototype.open=function(t){!this._windowRef&&this._ngbTooltip&&(this._windowRef=this._popupService.open(this._ngbTooltip,t),this._windowRef.instance.placement=this.placement,this._windowRef.instance.id=this._ngbTooltipWindowId,this._renderer.setElementAttribute(this._elementRef.nativeElement,"aria-describedby",this._ngbTooltipWindowId),"body"===this.container&&window.document.querySelector(this.container).appendChild(this._windowRef.location.nativeElement),this._windowRef.changeDetectorRef.markForCheck(),this.shown.emit())},t.prototype.close=function(){null!=this._windowRef&&(this._renderer.setElementAttribute(this._elementRef.nativeElement,"aria-describedby",null),this._popupService.close(),this._windowRef=null,this.hidden.emit())},t.prototype.toggle=function(){this._windowRef?this.close():this.open()},t.prototype.isOpen=function(){return null!=this._windowRef},t.prototype.ngOnInit=function(){this._unregisterListenersFn=n.i(o.a)(this._renderer,this._elementRef.nativeElement,this.triggers,this.open.bind(this),this.close.bind(this),this.toggle.bind(this))},t.prototype.ngOnDestroy=function(){this.close(),this._unregisterListenersFn(),this._zoneSubscription.unsubscribe()},t}();l.decorators=[{type:r.U,args:[{selector:"[ngbTooltip]",exportAs:"ngbTooltip"}]}],l.ctorParameters=function(){return[{type:r.V},{type:r.W},{type:r._11},{type:r.Z},{type:r._0},{type:a.a},{type:r.h}]},l.propDecorators={placement:[{type:r.X}],triggers:[{type:r.X}],container:[{type:r.X}],shown:[{type:r._14}],hidden:[{type:r._14}],ngbTooltip:[{type:r.X}]}},t2qv:function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n("rCTf"),i=n("jBEF"),s=n("Xajo"),a=n("CURp"),u=n("wAkD"),c=function(t){function e(e,n){t.call(this),this.sources=e,this.resultSelector=n}return r(e,t),e.create=function(){for(var t=[],n=0;n<arguments.length;n++)t[n-0]=arguments[n];if(null===t||0===arguments.length)return new i.EmptyObservable;var r=null;return"function"==typeof t[t.length-1]&&(r=t.pop()),1===t.length&&s.isArray(t[0])&&(t=t[0]),0===t.length?new i.EmptyObservable:new e(t,r)},e.prototype._subscribe=function(t){return new l(t,this.sources,this.resultSelector)},e}(o.Observable);e.ForkJoinObservable=c;var l=function(t){function e(e,n,r){t.call(this,e),this.sources=n,this.resultSelector=r,this.completed=0,this.haveValues=0;var o=n.length;this.total=o,this.values=new Array(o);for(var i=0;i<o;i++){var s=n[i],u=a.subscribeToResult(this,s,null,i);u&&(u.outerIndex=i,this.add(u))}}return r(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.values[n]=e,o._hasValue||(o._hasValue=!0,this.haveValues++)},e.prototype.notifyComplete=function(t){var e=this.destination,n=this,r=n.haveValues,o=n.resultSelector,i=n.values,s=i.length;if(!t._hasValue)return void e.complete();if(++this.completed===s){if(r===s){var a=o?o.apply(this,i):i;e.next(a)}e.complete()}},e}(u.OuterSubscriber)},"tyH+":function(t,e,n){"use strict";var r=n("3j3K");n.d(e,"a",function(){return o});var o=function(){function t(){this.meridian=!1,this.spinners=!0,this.seconds=!1,this.hourStep=1,this.minuteStep=1,this.secondStep=1,this.disabled=!1,this.readonlyInputs=!1,this.size="medium"}return t}();o.decorators=[{type:r.z}],o.ctorParameters=function(){return[]}},v4DA:function(t,e,n){"use strict";var r=n("3j3K");n.d(e,"a",function(){return o});var o=function(){function t(){this.justify="start",this.type="tabs"}return t}();o.decorators=[{type:r.z}],o.ctorParameters=function(){return[]}},vfkA:function(t,e,n){"use strict";var r=n("3j3K"),o=n("kgIC");n.d(e,"a",function(){return i});var i=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[]}},t}();i.decorators=[{type:r.A,args:[{declarations:[o.a],exports:[o.a]}]}],i.ctorParameters=function(){return[]}},wAkD:function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n("mmVS"),i=function(t){function e(){t.apply(this,arguments)}return r(e,t),e.prototype.notifyNext=function(t,e,n,r,o){this.destination.next(e)},e.prototype.notifyError=function(t,e){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.complete()},e}(o.Subscriber);e.OuterSubscriber=i},xAJs:function(t,e,n){"use strict";function r(t,e){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return this.lift(new s(t,e))}var o=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n("mmVS");e.map=r;var s=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.project,this.thisArg))},t}();e.MapOperator=s;var a=function(t){function e(e,n,r){t.call(this,e),this.project=n,this.count=0,this.thisArg=r||this}return o(e,t),e.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(i.Subscriber)},xOmt:function(t,e,n){"use strict";var r=n("3j3K"),o=n("nxqe");n.d(e,"a",function(){return i});var i=function(){function t(t,e){this._elRef=t,this._renderer=e,this.backdrop=!0,this.keyboard=!0,this.dismissEvent=new r.R}return t.prototype.backdropClick=function(t){!0===this.backdrop&&this._elRef.nativeElement===t.target&&this.dismiss(o.a.BACKDROP_CLICK)},t.prototype.escKey=function(t){this.keyboard&&!t.defaultPrevented&&this.dismiss(o.a.ESC)},t.prototype.dismiss=function(t){this.dismissEvent.emit(t)},t.prototype.ngOnInit=function(){this._elWithFocus=document.activeElement,this._renderer.setElementClass(document.body,"modal-open",!0)},t.prototype.ngAfterViewInit=function(){this._elRef.nativeElement.contains(document.activeElement)||this._renderer.invokeElementMethod(this._elRef.nativeElement,"focus",[])},t.prototype.ngOnDestroy=function(){this._elWithFocus&&document.body.contains(this._elWithFocus)?this._renderer.invokeElementMethod(this._elWithFocus,"focus",[]):this._renderer.invokeElementMethod(document.body,"focus",[]),this._elWithFocus=null,this._renderer.setElementClass(document.body,"modal-open",!1)},t}();i.decorators=[{type:r._10,args:[{selector:"ngb-modal-window",host:{"[class]":'"modal fade show" + (windowClass ? " " + windowClass : "")',role:"dialog",tabindex:"-1",style:"display: block;","(keyup.esc)":"escKey($event)","(click)":"backdropClick($event)"},template:"\n <div [class]=\"'modal-dialog' + (size ? ' modal-' + size : '')\" role=\"document\">\n <div class=\"modal-content\"><ng-content></ng-content></div>\n </div>\n "}]}],i.ctorParameters=function(){return[{type:r.V},{type:r.W}]},i.propDecorators={backdrop:[{type:r.X}],keyboard:[{type:r.X}],size:[{type:r.X}],windowClass:[{type:r.X}],dismissEvent:[{type:r._14,args:["dismiss"]}]}},yDyO:function(t,e,n){"use strict";var r=n("3j3K"),o=n("sgnN"),i=n("qKow");n.d(e,"a",function(){return s});var s=function(){function t(){}return t.forRoot=function(){return{ngModule:t,providers:[i.a]}},t}();s.decorators=[{type:r.A,args:[{declarations:[o.a,o.b],exports:[o.a],entryComponents:[o.b]}]}],s.ctorParameters=function(){return[]}},yrou:function(t,e,n){"use strict";e.empty={closed:!0,next:function(t){},error:function(t){throw t},complete:function(){}}}});
# -*- coding: utf-8 -*- import unittest from add_to_numbers import add_lists, ListNode class TestAddTwoNumbers(unittest.TestCase): def test_solution(self): a = ListNode(val=2, next=ListNode(val=4, next=ListNode(val=3, next=None))) b = ListNode(val=7, next=ListNode(val=0, next=ListNode(val=8, next=None))) c = ListNode(val=9, next=ListNode(val=9, next=ListNode(val=9, next=None))) zero = ListNode(val=0, next=None) a_plus_b = ListNode(val=9, next=ListNode(val=4, next=ListNode(val=1, next=ListNode(val=1, next=None)))) b_plus_c = ListNode(val=6, next=ListNode(val=0, next=ListNode(val=8, next=ListNode(val=1, next=None)))) c_plus_c = ListNode(val=8, next=ListNode(val=9, next=ListNode(val=9, next=ListNode(val=1, next=None)))) tests = [ (a, b, a_plus_b), (b, c, b_plus_c), (c, c, c_plus_c), (a, zero, a), ] for test in tests: actual = add_lists(test[0], test[1], 0) expected = test[2] self.assertEqual(actual.to_list(), expected.to_list(), \ 'failed {} + {} expected {}, got {}'.format( \ test[0].to_list(), test[1].to_list(), \ expected.to_list(), actual.to_list()))
import React from 'react'; import IconBase from '@suitejs/icon-base'; function MdFormatSize(props) { return ( <IconBase viewBox="0 0 48 48" {...props}> <path d="M17 9v6h10v24h6V15h10V9H17zM5 25h6v14h6V25h6v-6H5v6z" /> </IconBase> ); } export default MdFormatSize;
/* Copyright 2020 The caver-js Authors This file is part of the caver-js library. The caver-js library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. The caver-js library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the caver-js. If not, see <http://www.gnu.org/licenses/>. */ const _ = require('lodash') const RLP = require('eth-lib/lib/rlp') const Bytes = require('eth-lib/lib/bytes') const AbstractFeeDelegatedTransaction = require('../abstractFeeDelegatedTransaction') const { TX_TYPE_STRING, TX_TYPE_TAG, CODE_FORMAT, getCodeFormatTag } = require('../../transactionHelper/transactionHelper') const utils = require('../../../../caver-utils/src') function _decode(rlpEncoded) { rlpEncoded = utils.addHexPrefix(rlpEncoded) if (!rlpEncoded.startsWith(TX_TYPE_TAG.TxTypeFeeDelegatedSmartContractDeploy)) throw new Error( `Cannot decode to FeeDelegatedSmartContractDeploy. The prefix must be ${TX_TYPE_TAG.TxTypeFeeDelegatedSmartContractDeploy}: ${rlpEncoded}` ) const typeDettached = `0x${rlpEncoded.slice(4)}` const [nonce, gasPrice, gas, to, value, from, input, humanReadable, codeFormat, signatures, feePayer, feePayerSignatures] = RLP.decode( typeDettached ) return { nonce: utils.trimLeadingZero(nonce), gasPrice: utils.trimLeadingZero(gasPrice), gas: utils.trimLeadingZero(gas), to, value: utils.trimLeadingZero(value), from, input, humanReadable: humanReadable === '0x1', codeFormat, signatures, feePayer, feePayerSignatures, } } /** * Represents a fee delegated smart contract deploy transaction. * Please refer to https://docs.klaytn.com/klaytn/design/transactions/fee-delegation#txtypefeedelegatedsmartcontractdeploy to see more detail. * @class */ class FeeDelegatedSmartContractDeploy extends AbstractFeeDelegatedTransaction { /** * decodes the RLP-encoded string and returns a FeeDelegatedSmartContractDeploy transaction instance. * * @param {string} rlpEncoded The RLP-encoded fee delegated smart contract deploy transaction. * @return {FeeDelegatedSmartContractDeploy} */ static decode(rlpEncoded) { return new FeeDelegatedSmartContractDeploy(_decode(rlpEncoded)) } /** * Creates a fee delegated smart contract deploy transaction. * @constructor * @param {object|string} createTxObj - The parameters to create a FeeDelegatedSmartContractDeploy transaction. This can be an object defining transaction information, or it can be an RLP-encoded string. * If it is an RLP-encoded string, decode it to create a transaction instance. * The object can define `from`, `to`, `value`, `input`, `humanReadable`, `codeForamt`, * `nonce`, `gas`, `gasPrice`, `signatures`, `feePayer`, `feePayerSignatures` and `chainId`. */ constructor(createTxObj) { if (_.isString(createTxObj)) createTxObj = _decode(createTxObj) super(TX_TYPE_STRING.TxTypeFeeDelegatedSmartContractDeploy, createTxObj) this.to = createTxObj.to || '0x' this.value = createTxObj.value || '0x0' if (createTxObj.input && createTxObj.data) throw new Error(`'input' and 'data' properties cannot be defined at the same time, please use either 'input' or 'data'.`) this.input = createTxObj.input || createTxObj.data this.humanReadable = createTxObj.humanReadable !== undefined ? createTxObj.humanReadable : false this.codeFormat = createTxObj.codeFormat !== undefined ? createTxObj.codeFormat : CODE_FORMAT.EVM } /** * @type {string} */ get to() { return this._to } set to(address) { if (address !== '0x') throw new Error(`Invalid address of to: 'to' should be '0x' with smart contract deploy transaction.`) this._to = address.toLowerCase() } /** * @type {string} */ get value() { return this._value } set value(val) { this._value = utils.numberToHex(val) } /** * @type {string} */ get input() { return this._input } set input(input) { if (!input || !utils.isHex(input)) throw new Error(`Invalid input data ${input}`) this._input = utils.addHexPrefix(input) } /** * @type {string} */ get data() { return this._input } set data(data) { this._input = data } /** * @type {boolean} */ get humanReadable() { return this._humanReadable } set humanReadable(hr) { if (!_.isBoolean(hr)) throw new Error(`Invalid humanReadable ${hr}`) this._humanReadable = hr } /** * @type {string} */ get codeFormat() { return this._codeFormat } set codeFormat(cf) { this._codeFormat = getCodeFormatTag(cf) } /** * Returns the RLP-encoded string of this transaction (i.e., rawTransaction). * @return {string} */ getRLPEncoding() { this.validateOptionalValues() const signatures = this.signatures.map(sig => sig.encode()) const feePayerSignatures = this.feePayerSignatures.map(sig => sig.encode()) return ( TX_TYPE_TAG.TxTypeFeeDelegatedSmartContractDeploy + RLP.encode([ Bytes.fromNat(this.nonce), Bytes.fromNat(this.gasPrice), Bytes.fromNat(this.gas), this.to.toLowerCase(), Bytes.fromNat(this.value), this.from.toLowerCase(), this.input, Bytes.fromNat(this.humanReadable === true ? '0x1' : '0x0'), Bytes.fromNat(this.codeFormat), signatures, this.feePayer.toLowerCase(), feePayerSignatures, ]).slice(2) ) } /** * Returns the RLP-encoded string to make the signature of this transaction. * @return {string} */ getCommonRLPEncodingForSignature() { this.validateOptionalValues() return RLP.encode([ TX_TYPE_TAG.TxTypeFeeDelegatedSmartContractDeploy, Bytes.fromNat(this.nonce), Bytes.fromNat(this.gasPrice), Bytes.fromNat(this.gas), this.to.toLowerCase(), Bytes.fromNat(this.value), this.from.toLowerCase(), this.input, Bytes.fromNat(this.humanReadable === true ? '0x1' : '0x0'), Bytes.fromNat(this.codeFormat), ]) } } module.exports = FeeDelegatedSmartContractDeploy
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ var App = require('app'); var testHelpers = require('test/helpers'); describe('App.MainAdminServiceAutoStartController', function() { var controller; beforeEach(function() { controller = App.MainAdminServiceAutoStartController.create({ clusterConfigs: {} }); }); describe('#parseComponentConfigs', function() { var components = [ { ServiceComponentInfo: { service_name: 'S1', component_name: 'C1', recovery_enabled: 'true', category: 'SLAVE', total_count: 1 } }, { ServiceComponentInfo: { service_name: 'S1', component_name: 'C2', recovery_enabled: 'false', total_count: 2, category: 'SLAVE', } }, { ServiceComponentInfo: { category: 'SLAVE', service_name: 'S2', component_name: 'C1', recovery_enabled: 'false', total_count: 0 } } ]; it('should return parsed components, filter out not installed components', function() { expect(controller.parseComponentConfigs(components)).to.be.eql([ Em.Object.create({ "componentName": "C1", "displayName": "C1", "isFirst": true, "recoveryEnabled": true, "serviceDisplayName": "S1" }), Em.Object.create({ "componentName": "C2", "displayName": "C2", "isFirst": false, "recoveryEnabled": false, "serviceDisplayName": "S1" }) ]); }); }); describe('#load', function() { beforeEach(function() { sinon.stub(App.router.get('configurationController'), 'getCurrentConfigsBySites').returns({ done: function(callback) { callback([ { properties: { recovery_enabled: 'true' } } ]); } }); sinon.stub(controller, 'loadComponentsConfigs').returns({ then: Em.clb }); controller.load(); }); afterEach(function() { App.router.get('configurationController').getCurrentConfigsBySites.restore(); controller.loadComponentsConfigs.restore(); }); it('clusterConfigs should be set', function() { expect(controller.get('clusterConfigs')).to.be.eql({ recovery_enabled: 'true' }); }); it('isGeneralRecoveryEnabled should be true', function() { expect(controller.get('isGeneralRecoveryEnabled')).to.be.true; }); it('isGeneralRecoveryEnabledCached should be true', function() { expect(controller.get('isGeneralRecoveryEnabledCached')).to.be.true; }); it('isLoaded should be true', function() { expect(controller.get('isLoaded')).to.be.true; }); }); describe('#loadComponentsConfigs()', function() { it('App.ajax.send should be called', function() { controller.loadComponentsConfigs(); var args = testHelpers.findAjaxRequest('name', 'components.get_category'); expect(args[0]).to.be.eql({ name: 'components.get_category', sender: controller, success: 'loadComponentsConfigsSuccess' }); }); }); describe('#loadComponentsConfigsSuccess()', function() { beforeEach(function() { sinon.stub(controller, 'parseComponentConfigs').returns({}); }); afterEach(function() { controller.parseComponentConfigs.restore(); }); it('componentsConfigsCached should be set', function() { controller.loadComponentsConfigsSuccess({items: [{prop1: 'val1'}]}); expect(controller.get('componentsConfigsCached')).to.be.eql([{prop1: 'val1'}]); }); it('componentsConfigsGrouped should be set', function() { controller.loadComponentsConfigsSuccess({items: {prop1: 'val1'}}); expect(controller.get('componentsConfigsGrouped')).to.be.eql({}); }); }); describe('#saveClusterConfigs()', function() { it('App.ajax.send should be called', function() { controller.saveClusterConfigs({recovery_enabled: 'false'}, true); var args = testHelpers.findAjaxRequest('name', 'admin.save_configs'); expect(args[0]).to.be.eql({ name: 'admin.save_configs', sender: controller, data: { siteName: 'cluster-env', properties: { recovery_enabled: "true" } } }); }); }); describe('#saveComponentSettingsCall()', function() { it('App.ajax.send should be called', function() { controller.saveComponentSettingsCall(true, ['c1', 'c2']); var args = testHelpers.findAjaxRequest('name', 'components.update'); expect(args[0]).to.be.eql({ name: 'components.update', sender: controller, data: { ServiceComponentInfo: { recovery_enabled: true }, query: 'ServiceComponentInfo/component_name.in(c1,c2)' } }); }); }); describe('#syncStatus', function() { beforeEach(function() { sinon.stub(controller, 'propertyDidChange'); }); afterEach(function() { controller.propertyDidChange.restore(); }); it('should apply new values', function() { controller.set('isGeneralRecoveryEnabled', true); controller.set('componentsConfigsCached', [ { ServiceComponentInfo: { component_name: 'C1', recovery_enabled: 'false' } } ]); controller.set('componentsConfigsGrouped', [ Em.Object.create({ componentName: 'C1', recoveryEnabled: true }) ]); controller.syncStatus(); expect(controller.get('componentsConfigsCached')[0].ServiceComponentInfo.recovery_enabled).to.be.equal('true'); expect(controller.get('isGeneralRecoveryEnabledCached')).to.be.true; }); }); describe('#restoreCachedValues', function() { beforeEach(function() { sinon.stub(controller, 'parseComponentConfigs').returns([]); controller.set('isGeneralRecoveryEnabledCached', true); controller.restoreCachedValues(); }); afterEach(function() { controller.parseComponentConfigs.restore(); }); it('isGeneralRecoveryEnabled should be true', function() { expect(controller.get('isGeneralRecoveryEnabled')).to.be.true; }); it('componentsConfigsGrouped should be set', function() { expect(controller.get('componentsConfigsGrouped')).to.be.eql([]); }); }); describe('#filterComponentsByChange', function() { it('should return checked components', function() { var components = [ Em.Object.create({ recoveryEnabled: true, componentName: 'C1' }) ]; controller.set('componentsConfigsCachedMap', {'C1': false}); expect(controller.filterComponentsByChange(components, true)).to.be.eql(['C1']); }); it('should return unchecked components', function() { var components = [ Em.Object.create({ recoveryEnabled: false, componentName: 'C1' }) ]; controller.set('componentsConfigsCachedMap', {'C1': true}); expect(controller.filterComponentsByChange(components, false)).to.be.eql(['C1']); }); }); });
import React from 'react'; import Logo from 'images/logo.png'; import Logoo from 'images/logoo.png'; export const Nav00DataSource = { wrapper: { className: 'header0 home-page-wrapper' }, page: { className: 'home-page' }, logo: { className: 'header0-logo', children: Logo, }, Menu: { className: 'header0-menu', children: [ { name: 'item0', a: { children: 'Home', href: '' } }, { name: 'item1', a: { children: 'About', href: '' } }, { name: 'item2', a: { children: 'Divisions', href: '' } }, { name: 'item3', a: { children: 'Management', href: '' } }, ], }, mobileMenu: { className: 'header0-mobile-menu' }, }; export const Banner00DataSource = { wrapper: { className: 'banner0' }, textWrapper: { className: 'banner0-text-wrapper' }, title: { className: 'banner0-title', children: Logoo, }, content: { className: 'banner0-content', children: 'infinite Possibilities', }, button: { className: 'banner0-button', children: 'Learn More' }, }; export const Content00DataSource = { wrapper: { className: 'home-page-wrapper content0-wrapper' }, page: { className: 'home-page content0' }, OverPack: { playScale: 0.3, className: '' }, titleWrapper: { className: 'title-wrapper', children: [{ name: 'title', children: 'Divisions' }], }, block: { className: 'block-wrapper', children: [ { name: 'block0', className: 'block', md: 8, xs: 24, children: { icon: { className: 'icon', children: 'https://zos.alipayobjects.com/rmsportal/WBnVOjtIlGWbzyQivuyq.png', }, title: { className: 'content0-title', children: '一站式业务接入' }, content: { children: '支付、结算、核算接入产品效率翻四倍' }, }, }, { name: 'block1', className: 'block', md: 8, xs: 24, children: { icon: { className: 'icon', children: 'https://zos.alipayobjects.com/rmsportal/YPMsLQuCEXtuEkmXTTdk.png', }, title: { className: 'content0-title', children: '一站式事中风险监控', }, content: { children: '在所有需求配置环节事前风险控制和质量控制能力' }, }, }, { name: 'block2', className: 'block', md: 8, xs: 24, children: { icon: { className: 'icon', children: 'https://zos.alipayobjects.com/rmsportal/EkXWVvAaFJKCzhMmQYiX.png', }, title: { className: 'content0-title', children: '一站式数据运营' }, content: { children: '沉淀产品接入效率和运营小二工作效率数据' }, }, }, ], }, }; export const Content50DataSource = { wrapper: { className: 'home-page-wrapper content5-wrapper' }, page: { className: 'home-page content5' }, OverPack: { playScale: 0.3, className: '' }, titleWrapper: { className: 'title-wrapper', children: [ { name: 'title', children: 'Products & Services', className: 'title-h1' }, { name: 'content', className: 'title-content', children: '在这里用一段话介绍服务的案例情况', }, ], }, block: { className: 'content5-img-wrapper', gutter: 16, children: [ { name: 'block0', className: 'block', md: 6, xs: 24, children: { wrapper: { className: 'content5-block-content' }, img: { children: 'https://t.alipayobjects.com/images/rmsweb/T11aVgXc4eXXXXXXXX.svg', }, content: { children: 'Ant Design' }, }, }, { name: 'block1', className: 'block', md: 6, xs: 24, children: { wrapper: { className: 'content5-block-content' }, img: { children: 'https://zos.alipayobjects.com/rmsportal/faKjZtrmIbwJvVR.svg', }, content: { children: 'Ant Motion' }, }, }, { name: 'block2', className: 'block', md: 6, xs: 24, children: { wrapper: { className: 'content5-block-content' }, img: { children: 'https://t.alipayobjects.com/images/rmsweb/T11aVgXc4eXXXXXXXX.svg', }, content: { children: 'Ant Design' }, }, }, { name: 'block3', className: 'block', md: 6, xs: 24, children: { wrapper: { className: 'content5-block-content' }, img: { children: 'https://zos.alipayobjects.com/rmsportal/faKjZtrmIbwJvVR.svg', }, content: { children: 'Ant Motion' }, }, }, { name: 'block4', className: 'block', md: 6, xs: 24, children: { wrapper: { className: 'content5-block-content' }, img: { children: 'https://t.alipayobjects.com/images/rmsweb/T11aVgXc4eXXXXXXXX.svg', }, content: { children: 'Ant Design' }, }, }, { name: 'block5', className: 'block', md: 6, xs: 24, children: { wrapper: { className: 'content5-block-content' }, img: { children: 'https://zos.alipayobjects.com/rmsportal/faKjZtrmIbwJvVR.svg', }, content: { children: 'Ant Motion' }, }, }, { name: 'block6', className: 'block', md: 6, xs: 24, children: { wrapper: { className: 'content5-block-content' }, img: { children: 'https://t.alipayobjects.com/images/rmsweb/T11aVgXc4eXXXXXXXX.svg', }, content: { children: 'Ant Design' }, }, }, { name: 'block7', className: 'block', md: 6, xs: 24, children: { wrapper: { className: 'content5-block-content' }, img: { children: 'https://zos.alipayobjects.com/rmsportal/faKjZtrmIbwJvVR.svg', }, content: { children: 'Ant Motion' }, }, }, ], }, }; export const Content30DataSource = { wrapper: { className: 'home-page-wrapper content3-wrapper' }, page: { className: 'home-page content3' }, OverPack: { playScale: 0.3 }, titleWrapper: { className: 'title-wrapper', children: [ { name: 'title', children: 'Values', className: 'title-h1', }, { name: 'content', className: 'title-content', children: '基于阿里云强大的基础资源', }, ], }, block: { className: 'content3-block-wrapper', children: [ { name: 'block0', className: 'content3-block', md: 8, xs: 24, children: { icon: { className: 'content3-icon', children: 'https://zos.alipayobjects.com/rmsportal/ScHBSdwpTkAHZkJ.png', }, textWrapper: { className: 'content3-text' }, title: { className: 'content3-title', children: '企业资源管理' }, content: { className: 'content3-content', children: '云资源集中编排、弹性伸缩、持续发布和部署,高可用及容灾。', }, }, }, { name: 'block1', className: 'content3-block', md: 8, xs: 24, children: { icon: { className: 'content3-icon', children: 'https://zos.alipayobjects.com/rmsportal/NKBELAOuuKbofDD.png', }, textWrapper: { className: 'content3-text' }, title: { className: 'content3-title', children: '云安全' }, content: { className: 'content3-content', children: '按金融企业安全要求打造的完整云上安全体系,全方位保障金融应用及数据安全。', }, }, }, { name: 'block2', className: 'content3-block', md: 8, xs: 24, children: { icon: { className: 'content3-icon', children: 'https://zos.alipayobjects.com/rmsportal/xMSBjgxBhKfyMWX.png', }, textWrapper: { className: 'content3-text' }, title: { className: 'content3-title', children: '云监控' }, content: { className: 'content3-content', children: '分布式云环境集中监控,统一资源及应用状态视图,智能分析及故障定位。', }, }, }, { name: 'block3', className: 'content3-block', md: 8, xs: 24, children: { icon: { className: 'content3-icon', children: 'https://zos.alipayobjects.com/rmsportal/MNdlBNhmDBLuzqp.png', }, textWrapper: { className: 'content3-text' }, title: { className: 'content3-title', children: '移动' }, content: { className: 'content3-content', children: '一站式移动金融APP开发及全面监控;丰富可用组件,动态发布和故障热修复。', }, }, }, { name: 'block4', className: 'content3-block', md: 8, xs: 24, children: { icon: { className: 'content3-icon', children: 'https://zos.alipayobjects.com/rmsportal/UsUmoBRyLvkIQeO.png', }, textWrapper: { className: 'content3-text' }, title: { className: 'content3-title', children: '分布式中间件' }, content: { className: 'content3-content', children: '金融级联机交易处理中间件,大规模分布式计算机,数万笔/秒级并发能力,严格保证交易数据统一性。', }, }, }, { name: 'block5', className: 'content3-block', md: 8, xs: 24, children: { icon: { className: 'content3-icon', children: 'https://zos.alipayobjects.com/rmsportal/ipwaQLBLflRfUrg.png', }, textWrapper: { className: 'content3-text' }, title: { className: 'content3-title', children: '大数据' }, content: { className: 'content3-content', children: '一站式、全周期大数据协同工作平台,PB级数据处理、毫秒级数据分析工具。', }, }, }, ], }, }; export const Content80DataSource = { wrapper: { className: 'home-page-wrapper content8-wrapper' }, page: { className: 'home-page content8' }, OverPack: { playScale: 0.3 }, titleWrapper: { className: 'title-wrapper', children: [ { name: 'image', children: 'https://gw.alipayobjects.com/zos/rmsportal/PiqyziYmvbgAudYfhuBr.svg', className: 'title-image', }, { name: 'title', children: '特邀嘉宾', className: 'title-h1' }, ], }, block: { className: 'content-wrapper', children: [ { name: 'block0', md: 6, xs: 24, className: 'content8-block-wrapper', children: { className: 'content8-block', img: { className: 'content8-img', children: 'https://gw.alipayobjects.com/zos/rmsportal/JahzbVrdHdJlkJjkNsBJ.png', }, title: { className: 'content8-title', children: 'Jack' }, content: { className: 'content8-content', children: '公司+职位 信息暂缺', }, }, }, { name: 'block1', md: 6, xs: 24, className: 'content8-block-wrapper', children: { className: 'content8-block', img: { className: 'content8-img', children: 'https://gw.alipayobjects.com/zos/rmsportal/JahzbVrdHdJlkJjkNsBJ.png', }, title: { className: 'content8-title', children: 'Jack' }, content: { className: 'content8-content', children: '公司+职位 信息暂缺', }, }, }, { name: 'block2', md: 6, xs: 24, className: 'content8-block-wrapper', children: { className: 'content8-block', img: { className: 'content8-img', children: 'https://gw.alipayobjects.com/zos/rmsportal/JahzbVrdHdJlkJjkNsBJ.png', }, title: { className: 'content8-title', children: 'Jack' }, content: { className: 'content8-content', children: '公司+职位 信息暂缺', }, }, }, { name: 'block3', md: 6, xs: 24, className: 'content8-block-wrapper', children: { className: 'content8-block', img: { className: 'content8-img', children: 'https://gw.alipayobjects.com/zos/rmsportal/JahzbVrdHdJlkJjkNsBJ.png', }, title: { className: 'content8-title', children: 'Jack' }, content: { className: 'content8-content', children: '公司+职位 信息暂缺', }, }, }, { name: 'block4', md: 6, xs: 24, className: 'content8-block-wrapper', children: { className: 'content8-block', img: { className: 'content8-img', children: 'https://gw.alipayobjects.com/zos/rmsportal/JahzbVrdHdJlkJjkNsBJ.png', }, title: { className: 'content8-title', children: 'Jack' }, content: { className: 'content8-content', children: '公司+职位 信息暂缺', }, }, }, { name: 'block5', md: 6, xs: 24, className: 'content8-block-wrapper', children: { className: 'content8-block', img: { className: 'content8-img', children: 'https://gw.alipayobjects.com/zos/rmsportal/JahzbVrdHdJlkJjkNsBJ.png', }, title: { className: 'content8-title', children: 'Jack' }, content: { className: 'content8-content', children: '公司+职位 信息暂缺', }, }, }, { name: 'block6', md: 6, xs: 24, className: 'content8-block-wrapper', children: { className: 'content8-block', img: { className: 'content8-img', children: 'https://gw.alipayobjects.com/zos/rmsportal/JahzbVrdHdJlkJjkNsBJ.png', }, title: { className: 'content8-title', children: 'Jack' }, content: { className: 'content8-content', children: '公司+职位 信息暂缺', }, }, }, { name: 'block7', md: 6, xs: 24, className: 'content8-block-wrapper', children: { className: 'content8-block', img: { className: 'content8-img', children: 'https://gw.alipayobjects.com/zos/rmsportal/JahzbVrdHdJlkJjkNsBJ.png', }, title: { className: 'content8-title', children: 'Jack' }, content: { className: 'content8-content', children: '公司+职位 信息暂缺', }, }, }, ], }, }; export const Footer10DataSource = { wrapper: { className: 'home-page-wrapper footer1-wrapper' }, OverPack: { className: 'footer1', playScale: 0.2 }, block: { className: 'home-page', children: [ { name: 'block0', xs: 24, md: 6, className: 'block', title: { className: 'logo', children: 'https://zos.alipayobjects.com/rmsportal/qqaimmXZVSwAhpL.svg', }, content: { className: 'slogan', children: 'Animation specification and components of Ant Design.', }, }, { name: 'block1', xs: 24, md: 6, className: 'block', title: { children: '产品' }, content: { children: ( <span> <p> {' '} <a href="#">产品更新记录</a>{' '} </p>{' '} <p> {' '} <a href="#">API文档</a>{' '} </p>{' '} <p> {' '} <a href="#">快速入门</a>{' '} </p>{' '} <p> {' '} <a href="#">参考指南</a>{' '} </p> </span> ), }, }, { name: 'block2', xs: 24, md: 6, className: 'block', title: { children: '关于' }, content: { children: ( <span> <p> {' '} <a href="#">FAQ</a>{' '} </p>{' '} <p> {' '} <a href="#">联系我们</a>{' '} </p> </span> ), }, }, { name: 'block3', xs: 24, md: 6, className: 'block', title: { children: '资源' }, content: { children: ( <span> <p> {' '} <a href="#">Ant Design</a>{' '} </p>{' '} <p> {' '} <a href="#">Ant Design</a>{' '} </p>{' '} <p> {' '} <a href="#">Ant Design</a>{' '} </p>{' '} <p> {' '} <a href="#">Ant Design</a>{' '} </p> </span> ), }, }, ], }, copyrightWrapper: { className: 'copyright-wrapper' }, copyrightPage: { className: 'home-page' }, copyright: { className: 'copyright', children: ( <span> ©2018 by <a href="https://motion.ant.design">Ant Motion</a> All Rights Reserved </span> ), }, };
import sys def fibonacci_recursivo(n): if n == 0 or n == 1: return 1 return fibonacci_recursivo(n - 1) + fibonacci_recursivo(n - 2) def fibonacci_dinamico(n, memo = {}): if n == 0 or n == 1: return 1 try: return memo[n] except KeyError: resultado = fibonacci_dinamico(n - 1, memo) + fibonacci_dinamico(n - 2, memo) memo[n] = resultado return resultado if __name__ == '__main__': sys.setrecursionlimit(10002) n = int(input('Escoge un numero: ')) resultado = fibonacci_dinamico(n) print(resultado)
const mongoose = require('mongoose'); module.exports = () => { mongoose.connect('mongodb+srv://movie_user:[email protected]/myFirstDatabase?retryWrites=true&w=majority'); mongoose.connection.on('open', () => { console.log('MongoDB connected successful.'); }); mongoose.connection.on('error', () => { console.log('MongoDB connected failed!'); }); mongoose.Promise = global.Promise; };
/* Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang("a11yhelp","et",{title:"Accessibility Instructions",contents:"Abi sisu. Selle dialoogi sulgemiseks vajuta ESC klahvi.",legend:[{name:"Üldine",items:[{name:"Editor Toolbar",legend:"Press ${toolbarFocus} to navigate to the toolbar. Move to the next and previous toolbar group with TAB and SHIFT-TAB. Move to the next and previous toolbar button with RIGHT ARROW or LEFT ARROW. Press SPACE or ENTER to activate the toolbar button."},{name:"Editor Dialog",legend:"Inside a dialog, press TAB to navigate to next dialog field, press SHIFT + TAB to move to previous field, press ENTER to submit dialog, press ESC to cancel dialog. For dialogs that have multiple tab pages, press ALT + F10 to navigate to tab-list. Then move to next tab with TAB OR RIGTH ARROW. Move to previous tab with SHIFT + TAB or LEFT ARROW. Press SPACE or ENTER to select the tab page."}, {name:"Editor Context Menu",legend:"Press ${contextMenu} or APPLICATION KEY to open context-menu. Then move to next menu option with TAB or DOWN ARROW. Move to previous option with SHIFT+TAB or UP ARROW. Press SPACE or ENTER to select the menu option. Open sub-menu of current option with SPACE or ENTER or RIGHT ARROW. Go back to parent menu item with ESC or LEFT ARROW. Close context menu with ESC."},{name:"Editor List Box",legend:"Inside a list-box, move to next list item with TAB OR DOWN ARROW. Move to previous list item with SHIFT + TAB or UP ARROW. Press SPACE or ENTER to select the list option. Press ESC to close the list-box."}, {name:"Editor Element Path Bar",legend:"Press ${elementsPathFocus} to navigate to the elements path bar. Move to next element button with TAB or RIGHT ARROW. Move to previous button with SHIFT+TAB or LEFT ARROW. Press SPACE or ENTER to select the element in editor."}]},{name:"Commands",items:[{name:" Undo command",legend:"Press ${undo}"},{name:" Redo command",legend:"Press ${redo}"},{name:" Bold command",legend:"Press ${bold}"},{name:" Italic command",legend:"Press ${italic}"},{name:" Underline command", legend:"Press ${underline}"},{name:" Link command",legend:"Press ${link}"},{name:" Toolbar Collapse command",legend:"Press ${toolbarCollapse}"},{name:" Access previous focus space command",legend:"Press ${accessPreviousSpace} to access the closest unreachable focus space before the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces."},{name:" Access next focus space command",legend:"Press ${accessNextSpace} to access the closest unreachable focus space after the caret, for example: two adjacent HR elements. Repeat the key combination to reach distant focus spaces."}, {name:" Accessibility Help",legend:"Press ${a11yHelp}"}]}]});
module.exports = { globals: { 'currentURL': true, 'pauseTest': true, 'percySnapshot': true, 'selectChoose': true, 'selectSearch': true, } };
import React from 'react'; import ReactDOM from 'react-dom'; import './index.css'; import App from './App'; import * as serviceWorker from './serviceWorker'; import './_helpers/i18n'; ReactDOM.render(<App />, document.getElementById('root')); // If you want your app to work offline and load faster, you can change // unregister() to register() below. Note this comes with some pitfalls. // Learn more about service workers: https://bit.ly/CRA-PWA serviceWorker.unregister();
function createSnippetChooser(id, contentType) { var chooserElement = $('#' + id + '-chooser'); var docTitle = chooserElement.find('.title'); var input = $('#' + id); $('.action-choose', chooserElement).click(function() { ModalWorkflow({ 'url': window.chooserUrls.snippetChooser + contentType + '/', 'responses': { 'snippetChosen': function(snippetData) { input.val(snippetData.id); docTitle.text(snippetData.string); chooserElement.removeClass('blank'); } } }); }); $('.action-clear', chooserElement).click(function() { input.val(''); chooserElement.addClass('blank'); }); }
frappe.provide("ifitwala_ed.setup"); frappe.pages['setup-wizard'].on_page_load = function(wrapper) { if(frappe.sys_defaults.organization) { frappe.set_route("desk"); return; } }; frappe.setup.on("before_load", function () { ifitwala_ed.setup.slides_settings.map(frappe.setup.add_slide); }); ifitwala_ed.setup.slides_settings = [ { // Brand name: 'brand', icon: "fa fa-bookmark", title: __("The Brand"), // help: __('Upload your letter head and logo. (you can edit them later).'), fields: [ { fieldtype: "Attach Image", fieldname: "attach_logo", label: __("Attach Logo"), description: __("100px by 100px"), is_private: 0, align: 'center' }, { fieldname: 'organization_name', label: __('Organization Name'), fieldtype: 'Data', reqd: 1 }, { fieldname: 'organization_abbr', label: __('Organization Abbreviation'), fieldtype: 'Data' } ], onload: function(slide) { this.bind_events(slide); }, bind_events: function (slide) { slide.get_input("organization_name").on("change", function () { var parts = slide.get_input("organization_name").val().split(" "); var abbr = $.map(parts, function (p) { return p ? p.substr(0, 1) : null }).join(""); slide.get_field("organization_abbr").set_value(abbr.slice(0, 5).toUpperCase()); }).val(frappe.boot.sysdefaults.organization_name || "").trigger("change"); slide.get_input("organization_abbr").on("change", function () { if (slide.get_input("organization_abbr").val().length > 5) { frappe.msgprint(__("Organisation Abbreviation cannot have more than 5 characters")); slide.get_field("organization_abbr").set_value(""); } }); }, validate: function() { if ((this.values.organization_name || "").toLowerCase() == "organization") { frappe.msgprint(__("Organisation Name cannot be Organisation")); return false; } if (!this.values.organization_abbr) { return false; } if (this.values.organization_abbr.length > 5) { return false; } return true; } }, { // Organisation name: 'organization', title: __("Your Organization"), icon: "fa fa-building", // help: frappe.setup.domains.includes('Education') ? // __('The name of the institute for which you are setting up this system.') : // __('The name of your organization for which you are setting up this system.')), fields: [ { fieldname: 'organization_tagline', label: __('What does it do?'), fieldtype: 'Data', placeholder: __('e.g. "Inspire Learners to build a better future"'), reqd: 1 }, { fieldname: 'bank_account', label: __('Bank Name'), fieldtype: 'Data', reqd: 1 }, { fieldname: 'chart_of_accounts', label: __('Chart of Accounts'), options: "", fieldtype: 'Select' }, { fieldname: 'view_coa', label: __('View Chart of Accounts'), fieldtype: 'Button' }, { fieldname: 'fy_start_date', label: __('Financial Year Begins On'), fieldtype: 'Date', reqd: 1 }, // end date should be hidden (auto calculated) { fieldname: 'fy_end_date', label: __('End Date'), fieldtype: 'Date', reqd: 1, hidden: 1 }, ], onload: function (slide) { this.load_chart_of_accounts(slide); this.bind_events(slide); this.set_fy_dates(slide); }, validate: function () { let me = this; let exist; if (!this.validate_fy_dates()) { return false; } // Validate bank name if(me.values.bank_account){ frappe.call({ async: false, method: "ifitwala_ed.accounting.doctype.account.chart_of_accounts.chart_of_accounts.validate_bank_account", args: { "coa": me.values.chart_of_accounts, "bank_account": me.values.bank_account }, callback: function (r) { if(r.message){ exist = r.message; me.get_field("bank_account").set_value(""); let message = __('Account {0} already exists. Please enter a different name for your bank account.', [me.values.bank_account] ); frappe.msgprint(message); } } }); return !exist; // Return False if exist = true } return true; }, validate_fy_dates: function() { // validate fiscal year start and end dates const invalid = this.values.fy_start_date == 'Invalid date' || this.values.fy_end_date == 'Invalid date'; const start_greater_than_end = this.values.fy_start_date > this.values.fy_end_date; if (invalid || start_greater_than_end) { frappe.msgprint(__("Please enter valid Financial Year Start and End Dates")); return false; } return true; }, set_fy_dates: function (slide) { var country = frappe.wizard.values.country; if (country) { var fy = ifitwala_ed.setup.fiscal_years[country]; var current_year = moment(new Date()).year(); var next_year = current_year + 1; if (!fy) { fy = ["01-01", "12-31"]; next_year = current_year; } var year_start_date = current_year + "-" + fy[0]; if (year_start_date > frappe.datetime.get_today()) { next_year = current_year; current_year -= 1; } slide.get_field("fy_start_date").set_value(current_year + '-' + fy[0]); slide.get_field("fy_end_date").set_value(next_year + '-' + fy[1]); } }, load_chart_of_accounts: function (slide) { var country = frappe.wizard.values.country; if (country) { frappe.call({ method: "ifitwala_ed.accounting.doctype.account.chart_of_accounts.chart_of_accounts.get_charts_for_country", args: { "country": country, with_standard: true }, callback: function (r) { if (r.message) { slide.get_input("chart_of_accounts").empty() .add_options(r.message); } } }) } }, bind_events: function (slide) { let me = this; slide.get_input("fy_start_date").on("change", function () { var start_date = slide.form.fields_dict.fy_start_date.get_value(); var year_end_date = frappe.datetime.add_days(frappe.datetime.add_months(start_date, 12), -1); slide.form.fields_dict.fy_end_date.set_value(year_end_date); }); slide.get_input("view_coa").on("click", function() { let chart_template = slide.form.fields_dict.chart_of_accounts.get_value(); if(!chart_template) return; me.charts_modal(slide, chart_template); }); }, charts_modal: function(slide, chart_template) { let parent = __('All Accounts'); var dialog = new frappe.ui.Dialog({ title: chart_template, fields: [ {'fieldname': 'expand_all', 'label': __('Expand All'), 'fieldtype': 'Button', click: function() { // expand all nodes on button click coa_tree.load_children(coa_tree.root_node, true); } }, {'fieldname': 'collapse_all', 'label': __('Collapse All'), 'fieldtype': 'Button', click: function() { // collapse all nodes coa_tree.get_all_nodes(coa_tree.root_node.data.value, coa_tree.root_node.is_root) .then(data_list => { data_list.map(d => { coa_tree.toggle_node(coa_tree.nodes[d.parent]); }); }); } } ] }); // render tree structure in the dialog modal let coa_tree = new frappe.ui.Tree({ parent: $(dialog.body), label: parent, expandable: true, method: 'ifitwala_ed.accounting.utils.get_coa', args: { chart: chart_template, parent: parent, doctype: 'Account' }, onclick: function(node) { parent = node.value; } }); // add class to show buttons side by side const form_container = $(dialog.body).find('form'); const buttons = $(form_container).find('.frappe-control'); form_container.addClass('flex'); buttons.map((index, button) => { $(button).css({"margin-right": "1em"}); }) dialog.show(); coa_tree.load_children(coa_tree.root_node, true); // expand all node trigger } } ]; // Source: https://en.wikipedia.org/wiki/Fiscal_year // default 1st Jan - 31st Dec ifitwala_ed.setup.fiscal_years = { "Afghanistan": ["12-21", "12-20"], "Australia": ["07-01", "06-30"], "Bangladesh": ["07-01", "06-30"], "Canada": ["04-01", "03-31"], "Costa Rica": ["10-01", "09-30"], "Egypt": ["07-01", "06-30"], "Hong Kong": ["04-01", "03-31"], "India": ["04-01", "03-31"], "Iran": ["06-23", "06-22"], "Myanmar": ["04-01", "03-31"], "New Zealand": ["04-01", "03-31"], "Pakistan": ["07-01", "06-30"], "Singapore": ["04-01", "03-31"], "South Africa": ["03-01", "02-28"], "Thailand": ["10-01", "09-30"], "United Kingdom": ["04-01", "03-31"], };
"""configapp URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.2/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.urls import include, path 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin from django.urls import path, include from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path('admin/', admin.site.urls), path('', include('home.urls', namespace='home')), path('auth/', include('accounts.urls', namespace='accounts')), ] urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
const formLogin = document.getElementById('login'); const formRegister = document.getElementById('register'); let regexPass = new RegExp(/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/gm); let regexName = new RegExp(/^(?=.{8,20}$)(?![_.])(?!.*[_.]{2})[a-zA-Z0-9._]+(?<![_.])$/gm); let regexEmail = new RegExp(/^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$/gm); // Cookies function setCookie(cookieName, cookieValue, hoursToExpire, path, domain) { let date = new Date(); date.setTime(date.getTime() + hoursToExpire * 60 * 60 * 1000); document.cookie = cookieName + '=' + cookieValue + '; expires=' + date.toGMTString() + 'path=' + path + 'domain=' + domain; } function getCookie(cookieName) { var cookieValue = document.cookie.match('(^|;)\\s*' + cookieName + '\\s*=\\s*([^;]+)'); return cookieValue ? cookieValue.pop() : ''; } function deleteCookie(cookieName) { document.cookie = cookieName + '=; max-age=0; expires=0'; } // Functions function setFormMessage(formElement, type, message) { const messageElement = formElement.querySelector('.form__message'); messageElement.textContent = message; messageElement.classList.remove(`form__message-success`, `form__message-error`); messageElement.classList.add(`form__message-${type}`); } function clearFormMessage(formElement) { const messageElement = formElement.querySelector('.form__message'); messageElement.textContent = ``; messageElement.classList.remove(`form__message-success`, `form__message-error`); } function setInputError(inputElement, message) { inputElement.classList.add(`form__input-error`); inputElement.parentElement.querySelector('.form__input-error-message').textContent = message; } function clearInputElement(inputElement) { inputElement.classList.remove(`form__input-error`); inputElement.parentElement.querySelector('.form__input-error-message').textContent = ``; } // Login async function login() { try { let data = {}; data.username = document.getElementById('username').value; data.password = document.getElementById('password').value; let res = await axios.post('/api/auth/login', data); res = res.data.details[0]; if (res.message === 'pass') { setCookie('perm', res.permissions, '4320', '/'); window.location.href = '../index.html'; } else { throw res.message; } } catch (err) { setFormMessage(formLogin, `error`, err); } } // Register async function register() { let data = {}; data.username = document.getElementById('registerUsername').value; data.email = document.getElementById('registerEmail').value; data.password = document.getElementById('registerPassword').value; data.password2 = document.getElementById('confirmPassword').value; let fails = validateRegister(data); console.log(fails.length); if (fails.length === 0) { console.log('send'); sendRegister(data); } else { setFormMessage(formRegister, `error`, `form validation error`); } sendRegister(data); } function validateRegister(data) { let failures = []; if (!data.username) { failures.push({ input: 'username', msg: 'required' }); data.username = null; } else if (!regexName.test(data.username)) { failures.push({ input: 'username', msg: 'invalid' }); data.username = null; } if (!data.email) { failures.push({ input: 'email', msg: 'required' }); data.email = null; } else if (!regexEmail.test(data.email)) { failures.push({ input: 'email', msg: 'invalid' }); data.email = null; } if (!data.password) { failures.push({ input: 'password', msg: 'required' }); data.password = null; } else if (!regexPass.test(data.password)) { failures.push({ input: 'password', msg: 'invalid' }); data.password = null; } if (!data.password2) { failures.push({ input: 'confirm password', msg: 'required' }); data.password2 = null; } else if (data.password != data.password2) { console.log(data.password, `\n`, data.password2); failures.push({ input: 'passwords', msg: 'do not match' }); data.password = null; data.password2 = null; } return failures; } async function sendRegister(data) { try { let res = await axios.post('/api/auth/register', data); if (res.data.detail) { throw res.data.detail; } res = res.data.details[0]; if (res.message === 'pass') { setCookie(`perm`, res.permissions, `4320`, `/`); window.location.href = '../index.html'; } else { throw `form validation error`; } } catch (err) { setFormMessage(formRegister, `error`, err); } } // DOM loaded document.addEventListener('DOMContentLoaded', (ev) => { document.getElementById(`linkRegister`).addEventListener(`click`, (ev) => { ev.preventDefault(); formLogin.classList.add(`form--hidden`); formRegister.classList.remove(`form--hidden`); }); document.getElementById(`linkLogin`).addEventListener(`click`, (ev) => { ev.preventDefault(); formLogin.classList.remove(`form--hidden`); formRegister.classList.add(`form--hidden`); }); //Login formLogin.addEventListener('submit', (ev) => { ev.preventDefault(); deleteCookie('perm'); login(); }); // Register formRegister.addEventListener('submit', async (ev) => { ev.preventDefault(); register(); }); // form validation document.querySelectorAll('.form__input').forEach((inputElement) => { // Clear All Form Errors And Specific Input Errors On Input inputElement.addEventListener('input', (ev) => { clearInputElement(inputElement); clearFormMessage(formRegister); clearFormMessage(formLogin); }); // Register From //Username inputElement.addEventListener('blur', async (ev) => { if (ev.target.id === `registerUsername` && ev.target.value.length > 0 && !regexName.test(ev.target.value)) { setInputError(inputElement, `8-20 Characters No Special Characters`); } else if (ev.target.id === `registerUsername` && ev.target.value.length > 0) { try { let res = await axios.post('/api/auth/register/get/user', { username: ev.target.value }); if (res.data.details.length > 0) { res = res.data.details[0]; } else { return; } if (res.username === ev.target.value) { setInputError(inputElement, `Username Taken`); } else if (res.message) { let err = res.message; throw err; } } catch (err) { setInputError(inputElement, err); } } }); // Email inputElement.addEventListener('blur', async (ev) => { if (ev.target.id === `registerEmail` && ev.target.value.length > 0 && !regexEmail.test(ev.target.value)) { setInputError(inputElement, `Enter A Valid Email.`); } else if (ev.target.id === `registerEmail` && ev.target.value.length > 0) { try { let res = await axios.post('/api/auth/register/get/email', { email: ev.target.value }); if (res.data.details.length > 0) { res = res.data.details[0]; } else { return; } if (res.email === ev.target.value) { setInputError(inputElement, `Email Taken`); } else if (res.message) { let err = res.message; throw err; } } catch (err) { setInputError(inputElement, err); } } }); //Password inputElement.addEventListener('blur', (ev) => { if (ev.target.id === `registerPassword` && ev.target.value.length > 0 && !regexPass.test(ev.target.value)) { setInputError(inputElement, `Uppercase; Lowercase; Number; Special; Minimum 8 Characters`); } }); inputElement.addEventListener('blur', (ev) => { let confirmPassword = document.getElementById('confirmPassword'); if (ev.target.id === `registerPassword` && ev.target.value.length > 0 && confirmPassword.value.length > 0 && ev.target.value != confirmPassword) { setInputError(confirmPassword, `Passwords Do Not Match`); } }); inputElement.addEventListener('input', (ev) => { let confirmPassword = document.getElementById('confirmPassword'); if (ev.target.id === `registerPassword` && confirmPassword.value.length > 0) { clearInputElement(confirmPassword); } }); // Confirm Password inputElement.addEventListener('blur', (ev) => { let pass = document.getElementById('registerPassword').value; if (ev.target.id === `confirmPassword` && ev.target.value.length > 0 && ev.target.value != pass) { setInputError(inputElement, `Passwords Do Not Match`); } }); }); });
import React, { Component } from 'react'; import Button from 'material-ui/Button'; import { render } from 'react-dom'; import { Link } from 'react-router-dom'; import TextField from 'material-ui/TextField'; const style = { margin: 12, backgroundColor: 'teal', color: 'black' }; class UserAnswers extends Component { constructor(props) { super(props); this.state = { }; // binding here } render() { return ( <div> <h1> Thanks for your solution! Please find other user solutions below: </h1> </div> ) } } export default UserAnswers;
import argparse import cdm import resources from bq_utils import create_dataset, list_all_table_ids, query, wait_on_jobs, BigQueryJobWaitError, \ create_standard_table from utils import bq BIGQUERY_DATA_TYPES = { 'integer': 'INT64', 'float': 'FLOAT64', 'string': 'STRING', 'date': 'DATE', 'timestamp': 'TIMESTAMP', 'bool': 'BOOLEAN' } def create_empty_dataset(project_id, dataset_id, snapshot_dataset_id): """ Create the empty tables in the new snapshot dataset :param project_id: :param dataset_id: :param snapshot_dataset_id: :return: """ create_dataset( project_id=project_id, dataset_id=snapshot_dataset_id, description='Snapshot of {dataset_id}'.format(dataset_id=dataset_id), overwrite_existing=True) def create_empty_cdm_tables(snapshot_dataset_id): """ Copy the table content from the current dataset to the snapshot dataset :param snapshot_dataset_id: :return: """ for table in resources.CDM_TABLES: table_id = table table_name = table create_standard_table(table_name, table_id, drop_existing=True, dataset_id=snapshot_dataset_id) cdm.create_vocabulary_tables(snapshot_dataset_id) def get_field_cast_expr(dest_field, source_fields): """ generates cast expression based on data_type for the field :param dest_field: field dictionary object :param source_fields: list of field names in source table :return: col string """ dest_field_name = dest_field['name'] dest_field_mode = dest_field['mode'] dest_field_type = dest_field['type'] if dest_field_name in source_fields: col = f'CAST({dest_field_name} AS {BIGQUERY_DATA_TYPES[dest_field_type.lower()]}) AS {dest_field_name}' else: if dest_field_mode == 'required': raise RuntimeError( f'Unable to load the field "{dest_field_name}" which is required in the destination table \ and missing from the source table') elif dest_field_mode == 'nullable': col = f'CAST(NULL AS {BIGQUERY_DATA_TYPES[dest_field_type.lower()]}) AS {dest_field_name}' else: raise RuntimeError( f'Unable to determine the mode for "{dest_field_name}".') return col def get_source_fields(client, source_table): """ Gets column names of a table in bigquery :param client: BigQuery client :param source_table: fully qualified table name. returns as a list of column names. """ return [f'{field.name}' for field in client.get_table(source_table).schema] def get_copy_table_query(project_id, dataset_id, table_id, client): try: source_table = f'{project_id}.{dataset_id}.{table_id}' source_fields = get_source_fields(client, source_table) dst_fields = resources.fields_for(table_id) col_cast_exprs = [ get_field_cast_expr(field, source_fields) for field in dst_fields ] col_expr = ', '.join(col_cast_exprs) except (OSError, IOError, RuntimeError): # default to select * col_expr = '*' select_all_query = 'SELECT {col_expr} FROM `{project_id}.{dataset_id}.{table_id}`' return select_all_query.format(col_expr=col_expr, project_id=project_id, dataset_id=dataset_id, table_id=table_id) def copy_tables_to_new_dataset(project_id, dataset_id, snapshot_dataset_id): """ lists the tables in the dataset and copies each table to a new dataset. :param dataset_id: :param project_id: :param snapshot_dataset_id: :return: """ copy_table_job_ids = [] client = bq.get_client(project_id) for table_id in list_all_table_ids(dataset_id): q = get_copy_table_query(project_id, dataset_id, table_id, client) results = query(q, use_legacy_sql=False, destination_table_id=table_id, destination_dataset_id=snapshot_dataset_id, batch=True) copy_table_job_ids.append(results['jobReference']['jobId']) incomplete_jobs = wait_on_jobs(copy_table_job_ids) if len(incomplete_jobs) > 0: raise BigQueryJobWaitError(incomplete_jobs) def create_schemaed_snapshot_dataset(project_id, dataset_id, snapshot_dataset_id, overwrite_existing=True): """ :param project_id: :param dataset_id: :param snapshot_dataset_id: :param overwrite_existing: Default is True, False if a dataset is already created. :return: """ if overwrite_existing: create_empty_dataset(project_id, dataset_id, snapshot_dataset_id) create_empty_cdm_tables(snapshot_dataset_id) copy_tables_to_new_dataset(project_id, dataset_id, snapshot_dataset_id) if __name__ == '__main__': parser = argparse.ArgumentParser( description='Parse project_id and dataset_id', formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument( '-p', '--project_id', action='store', dest='project_id', help='Project associated with the input and output datasets', required=True) parser.add_argument('-d', '--dataset_id', action='store', dest='dataset_id', help='Dataset where cleaning rules are to be applied', required=True) parser.add_argument('-n', '--snapshot_dataset_id', action='store', dest='snapshot_dataset_id', help='Name of the new dataset that needs to be created', required=True) args = parser.parse_args() create_schemaed_snapshot_dataset(args.project_id, args.dataset_id, args.snapshot_dataset_id)
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-vendors"],{"0273":function(t,n,r){var e=r("c1b2"),o=r("4180"),i=r("2c6c");t.exports=e?function(t,n,r){return o.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},"0363":function(t,n,r){var e=r("3ac6"),o=r("d659"),i=r("3e80"),c=r("1e63"),u=e.Symbol,a=o("wks");t.exports=function(t){return a[t]||(a[t]=c&&u[t]||(c?u:i)("Symbol."+t))}},"06cf":function(t,n,r){var e=r("83ab"),o=r("d1e7"),i=r("5c6c"),c=r("fc6a"),u=r("c04e"),a=r("5135"),f=r("0cfb"),s=Object.getOwnPropertyDescriptor;n.f=e?s:function(t,n){if(t=c(t),n=u(n,!0),f)try{return s(t,n)}catch(r){}if(a(t,n))return i(!o.f.call(t,n),t[n])}},"06fa":function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},"0b7b":function(t,n,r){var e=r("8f95"),o=r("7463"),i=r("0363"),c=i("iterator");t.exports=function(t){if(void 0!=t)return t[c]||t["@@iterator"]||o[e(t)]}},"0cfb":function(t,n,r){var e=r("83ab"),o=r("d039"),i=r("cc12");t.exports=!e&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},1316:function(t,n,r){t.exports=r("9cd3")},1561:function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},"16f1":function(t,n,r){r("5145"),r("3e47"),t.exports=r("d9f3")},1875:function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},"194a":function(t,n,r){var e=r("cc94");t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 0:return function(){return t.call(n)};case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,o){return t.call(n,r,e,o)}}return function(){return t.apply(n,arguments)}}},"19aa":function(t,n){t.exports=function(t,n,r){if(!(t instanceof n))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return t}},"1be4":function(t,n,r){var e=r("d066");t.exports=e("document","documentElement")},"1c0a":function(t,n,r){"use strict";var e=r("8f95"),o=r("0363"),i=o("toStringTag"),c={};c[i]="z",t.exports="[object z]"!==String(c)?function(){return"[object "+e(this)+"]"}:c.toString},"1c0b":function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},"1c7e":function(t,n,r){var e=r("b622"),o=e("iterator"),i=!1;try{var c=0,u={next:function(){return{done:!!c++}},return:function(){i=!0}};u[o]=function(){return this},Array.from(u,(function(){throw 2}))}catch(a){}t.exports=function(t,n){if(!n&&!i)return!1;var r=!1;try{var e={};e[o]=function(){return{next:function(){return{done:r=!0}}}},t(e)}catch(a){}return r}},"1d80":function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},"1e63":function(t,n,r){var e=r("06fa");t.exports=!!Object.getOwnPropertySymbols&&!e((function(){return!String(Symbol())}))},2266:function(t,n,r){var e=r("825a"),o=r("e95a"),i=r("50c4"),c=r("f8c2"),u=r("35a1"),a=r("9bdd"),f=function(t,n){this.stopped=t,this.result=n},s=t.exports=function(t,n,r,s,p){var l,v,d,h,y,b,g,x=c(n,r,s?2:1);if(p)l=t;else{if(v=u(t),"function"!=typeof v)throw TypeError("Target is not iterable");if(o(v)){for(d=0,h=i(t.length);h>d;d++)if(y=s?x(e(g=t[d])[0],g[1]):x(t[d]),y&&y instanceof f)return y;return new f(!1)}l=v.call(t)}b=l.next;while(!(g=b.call(l)).done)if(y=a(l,x,g.value,s),"object"==typeof y&&y&&y instanceof f)return y;return new f(!1)};s.stop=function(t){return new f(!0,t)}},"23cb":function(t,n,r){var e=r("a691"),o=Math.max,i=Math.min;t.exports=function(t,n){var r=e(t);return r<0?o(r+n,0):i(r,n)}},"23e7":function(t,n,r){var e=r("da84"),o=r("06cf").f,i=r("9112"),c=r("6eeb"),u=r("ce4e"),a=r("e893"),f=r("94ca");t.exports=function(t,n){var r,s,p,l,v,d,h=t.target,y=t.global,b=t.stat;if(s=y?e:b?e[h]||u(h,{}):(e[h]||{}).prototype,s)for(p in n){if(v=n[p],t.noTargetGet?(d=o(s,p),l=d&&d.value):l=s[p],r=f(y?p:h+(b?".":"#")+p,t.forced),!r&&void 0!==l){if(typeof v===typeof l)continue;a(v,l)}(t.sham||l&&l.sham)&&i(v,"sham",!0),c(s,p,v,t)}}},"241c":function(t,n,r){var e=r("ca84"),o=r("7839"),i=o.concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return e(t,i)}},2626:function(t,n,r){"use strict";var e=r("d066"),o=r("9bf2"),i=r("b622"),c=r("83ab"),u=i("species");t.exports=function(t){var n=e(t),r=o.f;c&&n&&!n[u]&&r(n,u,{configurable:!0,get:function(){return this}})}},2874:function(t,n,r){var e=r("4180").f,o=r("0273"),i=r("78e7"),c=r("1c0a"),u=r("0363"),a=u("toStringTag"),f=c!=={}.toString;t.exports=function(t,n,r,u){if(t){var s=r?t:t.prototype;i(s,a)||e(s,a,{configurable:!0,value:n}),u&&f&&o(s,"toString",c)}}},"2c6c":function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},"2cf4":function(t,n,r){var e,o,i,c=r("da84"),u=r("d039"),a=r("c6b6"),f=r("f8c2"),s=r("1be4"),p=r("cc12"),l=r("b629"),v=c.location,d=c.setImmediate,h=c.clearImmediate,y=c.process,b=c.MessageChannel,g=c.Dispatch,x=0,m={},w="onreadystatechange",S=function(t){if(m.hasOwnProperty(t)){var n=m[t];delete m[t],n()}},O=function(t){return function(){S(t)}},j=function(t){S(t.data)},L=function(t){c.postMessage(t+"",v.protocol+"//"+v.host)};d&&h||(d=function(t){var n=[],r=1;while(arguments.length>r)n.push(arguments[r++]);return m[++x]=function(){("function"==typeof t?t:Function(t)).apply(void 0,n)},e(x),x},h=function(t){delete m[t]},"process"==a(y)?e=function(t){y.nextTick(O(t))}:g&&g.now?e=function(t){g.now(O(t))}:b&&!l?(o=new b,i=o.port2,o.port1.onmessage=j,e=f(i.postMessage,i,1)):!c.addEventListener||"function"!=typeof postMessage||c.importScripts||u(L)?e=w in p("script")?function(t){s.appendChild(p("script"))[w]=function(){s.removeChild(this),S(t)}}:function(t){setTimeout(O(t),0)}:(e=L,c.addEventListener("message",j,!1))),t.exports={set:d,clear:h}},"2dc0":function(t,n,r){t.exports=r("588c")},"2f5a":function(t,n,r){var e,o,i,c=r("96e9"),u=r("3ac6"),a=r("dfdb"),f=r("0273"),s=r("78e7"),p=r("b2ed"),l=r("6e9a"),v=u.WeakMap,d=function(t){return i(t)?o(t):e(t,{})},h=function(t){return function(n){var r;if(!a(n)||(r=o(n)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}};if(c){var y=new v,b=y.get,g=y.has,x=y.set;e=function(t,n){return x.call(y,t,n),n},o=function(t){return b.call(y,t)||{}},i=function(t){return g.call(y,t)}}else{var m=p("state");l[m]=!0,e=function(t,n){return f(t,m,n),n},o=function(t){return s(t,m)?t[m]:{}},i=function(t){return s(t,m)}}t.exports={set:e,get:o,has:i,enforce:d,getterFor:h}},"2f97":function(t,n,r){var e=r("dfdb");t.exports=function(t){if(!e(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},"35a1":function(t,n,r){var e=r("f5df"),o=r("3f8c"),i=r("b622"),c=i("iterator");t.exports=function(t){if(void 0!=t)return t[c]||t["@@iterator"]||o[e(t)]}},"37e8":function(t,n,r){var e=r("83ab"),o=r("9bf2"),i=r("825a"),c=r("df75");t.exports=e?Object.defineProperties:function(t,n){i(t);var r,e=c(n),u=e.length,a=0;while(u>a)o.f(t,r=e[a++],n[r]);return t}},"3ac6":function(t,n,r){(function(n){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n&&n)||Function("return this")()}).call(this,r("c8ba"))},"3bbe":function(t,n,r){var e=r("861d");t.exports=function(t){if(!e(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},"3ca3":function(t,n,r){"use strict";var e=r("6547").charAt,o=r("69f3"),i=r("7dd0"),c="String Iterator",u=o.set,a=o.getterFor(c);i(String,"String",(function(t){u(this,{type:c,string:String(t),index:0})}),(function(){var t,n=a(this),r=n.string,o=n.index;return o>=r.length?{value:void 0,done:!0}:(t=e(r,o),n.index+=t.length,{value:t,done:!1})}))},"3e47":function(t,n,r){"use strict";var e=r("cbd0").charAt,o=r("2f5a"),i=r("4056"),c="String Iterator",u=o.set,a=o.getterFor(c);i(String,"String",(function(t){u(this,{type:c,string:String(t),index:0})}),(function(){var t,n=a(this),r=n.string,o=n.index;return o>=r.length?{value:void 0,done:!0}:(t=e(r,o),n.index+=t.length,{value:t,done:!1})}))},"3e80":function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++r+e).toString(36)}},"3f8c":function(t,n){t.exports={}},4056:function(t,n,r){"use strict";var e=r("a5eb"),o=r("f575"),i=r("5779"),c=r("ec62"),u=r("2874"),a=r("0273"),f=r("d666"),s=r("0363"),p=r("7042"),l=r("7463"),v=r("bb83"),d=v.IteratorPrototype,h=v.BUGGY_SAFARI_ITERATORS,y=s("iterator"),b="keys",g="values",x="entries",m=function(){return this};t.exports=function(t,n,r,s,v,w,S){o(r,n,s);var O,j,L,T=function(t){if(t===v&&k)return k;if(!h&&t in A)return A[t];switch(t){case b:return function(){return new r(this,t)};case g:return function(){return new r(this,t)};case x:return function(){return new r(this,t)}}return function(){return new r(this)}},E=n+" Iterator",P=!1,A=t.prototype,_=A[y]||A["@@iterator"]||v&&A[v],k=!h&&_||T(v),I="Array"==n&&A.entries||_;if(I&&(O=i(I.call(new t)),d!==Object.prototype&&O.next&&(p||i(O)===d||(c?c(O,d):"function"!=typeof O[y]&&a(O,y,m)),u(O,E,!0,!0),p&&(l[E]=m))),v==g&&_&&_.name!==g&&(P=!0,k=function(){return _.call(this)}),p&&!S||A[y]===k||a(A,y,k),l[n]=k,v)if(j={values:T(g),keys:w?k:T(b),entries:T(x)},S)for(L in j)!h&&!P&&L in A||f(A,L,j[L]);else e({target:n,proto:!0,forced:h||P},j);return j}},4180:function(t,n,r){var e=r("c1b2"),o=r("77b2"),i=r("6f8d"),c=r("7168"),u=Object.defineProperty;n.f=e?u:function(t,n,r){if(i(t),n=c(n,!0),i(r),o)try{return u(t,n,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[n]=r.value),t}},"428f":function(t,n,r){t.exports=r("da84")},"44ad":function(t,n,r){var e=r("d039"),o=r("c6b6"),i="".split;t.exports=e((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},"44ba":function(t,n,r){var e=r("c1b2"),o=r("7043"),i=r("2c6c"),c=r("a421"),u=r("7168"),a=r("78e7"),f=r("77b2"),s=Object.getOwnPropertyDescriptor;n.f=e?s:function(t,n){if(t=c(t),n=u(n,!0),f)try{return s(t,n)}catch(r){}if(a(t,n))return i(!o.f.call(t,n),t[n])}},"44d2":function(t,n,r){var e=r("b622"),o=r("7c73"),i=r("9112"),c=e("unscopables"),u=Array.prototype;void 0==u[c]&&i(u,c,o(null)),t.exports=function(t){u[c][t]=!0}},"44de":function(t,n,r){var e=r("da84");t.exports=function(t,n){var r=e.console;r&&r.error&&(1===arguments.length?r.error(t):r.error(t,n))}},4508:function(t,n,r){var e=r("1561"),o=Math.max,i=Math.min;t.exports=function(t,n){var r=e(t);return r<0?o(r+n,0):i(r,n)}},4840:function(t,n,r){var e=r("825a"),o=r("1c0b"),i=r("b622"),c=i("species");t.exports=function(t,n){var r,i=e(t).constructor;return void 0===i||void 0==(r=e(i)[c])?n:o(r)}},4896:function(t,n,r){var e=r("6f8d"),o=r("c230"),i=r("9e57"),c=r("6e9a"),u=r("edbd"),a=r("7a37"),f=r("b2ed"),s=f("IE_PROTO"),p="prototype",l=function(){},v=function(){var t,n=a("iframe"),r=i.length,e="<",o="script",c=">",f="java"+o+":";n.style.display="none",u.appendChild(n),n.src=String(f),t=n.contentWindow.document,t.open(),t.write(e+o+c+"document.F=Object"+e+"/"+o+c),t.close(),v=t.F;while(r--)delete v[p][i[r]];return v()};t.exports=Object.create||function(t,n){var r;return null!==t?(l[p]=e(t),r=new l,l[p]=null,r[s]=t):r=v(),void 0===n?r:o(r,n)},c[s]=!0},4930:function(t,n,r){var e=r("d039");t.exports=!!Object.getOwnPropertySymbols&&!e((function(){return!String(Symbol())}))},"4d64":function(t,n,r){var e=r("fc6a"),o=r("50c4"),i=r("23cb"),c=function(t){return function(n,r,c){var u,a=e(n),f=o(a.length),s=i(c,f);if(t&&r!=r){while(f>s)if(u=a[s++],u!=u)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===r)return t||s||0;return!t&&-1}};t.exports={includes:c(!0),indexOf:c(!1)}},"4fff":function(t,n,r){var e=r("1875");t.exports=function(t){return Object(e(t))}},"50c4":function(t,n,r){var e=r("a691"),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},5135:function(t,n){var r={}.hasOwnProperty;t.exports=function(t,n){return r.call(t,n)}},5145:function(t,n,r){r("9103");var e=r("78a2"),o=r("3ac6"),i=r("0273"),c=r("7463"),u=r("0363"),a=u("toStringTag");for(var f in e){var s=o[f],p=s&&s.prototype;p&&!p[a]&&i(p,a,f),c[f]=c.Array}},5692:function(t,n,r){var e=r("c430"),o=r("c6cd");(t.exports=function(t,n){return o[t]||(o[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.4.1",mode:e?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},"56ef":function(t,n,r){var e=r("d066"),o=r("241c"),i=r("7418"),c=r("825a");t.exports=e("Reflect","ownKeys")||function(t){var n=o.f(c(t)),r=i.f;return r?n.concat(r(t)):n}},5779:function(t,n,r){var e=r("78e7"),o=r("4fff"),i=r("b2ed"),c=r("f5fb"),u=i("IE_PROTO"),a=Object.prototype;t.exports=c?Object.getPrototypeOf:function(t){return t=o(t),e(t,u)?t[u]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},"588c":function(t,n,r){r("5145"),r("3e47"),t.exports=r("59d7")},"59d7":function(t,n,r){var e=r("8f95"),o=r("0363"),i=r("7463"),c=o("iterator");t.exports=function(t){var n=Object(t);return void 0!==n[c]||"@@iterator"in n||i.hasOwnProperty(e(n))}},"5ab9":function(t,n,r){r("e519");var e=r("764b");t.exports=e.Array.isArray},"5c6c":function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},"60ae":function(t,n,r){var e,o,i=r("da84"),c=r("b39a"),u=i.process,a=u&&u.versions,f=a&&a.v8;f?(e=f.split("."),o=e[0]+e[1]):c&&(e=c.match(/Edge\/(\d+)/),(!e||e[1]>=74)&&(e=c.match(/Chrome\/(\d+)/),e&&(o=e[1]))),t.exports=o&&+o},"60da":function(t,n,r){"use strict";var e=r("83ab"),o=r("d039"),i=r("df75"),c=r("7418"),u=r("d1e7"),a=r("7b0b"),f=r("44ad"),s=Object.assign;t.exports=!s||o((function(){var t={},n={},r=Symbol(),e="abcdefghijklmnopqrst";return t[r]=7,e.split("").forEach((function(t){n[t]=t})),7!=s({},t)[r]||i(s({},n)).join("")!=e}))?function(t,n){var r=a(t),o=arguments.length,s=1,p=c.f,l=u.f;while(o>s){var v,d=f(arguments[s++]),h=p?i(d).concat(p(d)):i(d),y=h.length,b=0;while(y>b)v=h[b++],e&&!l.call(d,v)||(r[v]=d[v])}return r}:s},6220:function(t,n,r){var e=r("fc48");t.exports=Array.isArray||function(t){return"Array"==e(t)}},6386:function(t,n,r){var e=r("a421"),o=r("6725"),i=r("4508"),c=function(t){return function(n,r,c){var u,a=e(n),f=o(a.length),s=i(c,f);if(t&&r!=r){while(f>s)if(u=a[s++],u!=u)return!0}else for(;f>s;s++)if((t||s in a)&&a[s]===r)return t||s||0;return!t&&-1}};t.exports={includes:c(!0),indexOf:c(!1)}},"638c":function(t,n,r){var e=r("06fa"),o=r("fc48"),i="".split;t.exports=e((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},6547:function(t,n,r){var e=r("a691"),o=r("1d80"),i=function(t){return function(n,r){var i,c,u=String(o(n)),a=e(r),f=u.length;return a<0||a>=f?t?"":void 0:(i=u.charCodeAt(a),i<55296||i>56319||a+1===f||(c=u.charCodeAt(a+1))<56320||c>57343?t?u.charAt(a):i:t?u.slice(a,a+2):c-56320+(i-55296<<10)+65536)}};t.exports={codeAt:i(!1),charAt:i(!0)}},6725:function(t,n,r){var e=r("1561"),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},"69f3":function(t,n,r){var e,o,i,c=r("7f9a"),u=r("da84"),a=r("861d"),f=r("9112"),s=r("5135"),p=r("f772"),l=r("d012"),v=u.WeakMap,d=function(t){return i(t)?o(t):e(t,{})},h=function(t){return function(n){var r;if(!a(n)||(r=o(n)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}};if(c){var y=new v,b=y.get,g=y.has,x=y.set;e=function(t,n){return x.call(y,t,n),n},o=function(t){return b.call(y,t)||{}},i=function(t){return g.call(y,t)}}else{var m=p("state");l[m]=!0,e=function(t,n){return f(t,m,n),n},o=function(t){return s(t,m)?t[m]:{}},i=function(t){return s(t,m)}}t.exports={set:e,get:o,has:i,enforce:d,getterFor:h}},"6e9a":function(t,n){t.exports={}},"6eeb":function(t,n,r){var e=r("da84"),o=r("5692"),i=r("9112"),c=r("5135"),u=r("ce4e"),a=r("9e81"),f=r("69f3"),s=f.get,p=f.enforce,l=String(a).split("toString");o("inspectSource",(function(t){return a.call(t)})),(t.exports=function(t,n,r,o){var a=!!o&&!!o.unsafe,f=!!o&&!!o.enumerable,s=!!o&&!!o.noTargetGet;"function"==typeof r&&("string"!=typeof n||c(r,"name")||i(r,"name",n),p(r).source=l.join("string"==typeof n?n:"")),t!==e?(a?!s&&t[n]&&(f=!0):delete t[n],f?t[n]=r:i(t,n,r)):f?t[n]=r:u(n,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&s(this).source||a.call(this)}))},"6f8d":function(t,n,r){var e=r("dfdb");t.exports=function(t){if(!e(t))throw TypeError(String(t)+" is not an object");return t}},7042:function(t,n){t.exports=!0},7043:function(t,n,r){"use strict";var e={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!e.call({1:2},1);n.f=i?function(t){var n=o(this,t);return!!n&&n.enumerable}:e},7168:function(t,n,r){var e=r("dfdb");t.exports=function(t,n){if(!e(t))return t;var r,o;if(n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;if("function"==typeof(r=t.valueOf)&&!e(o=r.call(t)))return o;if(!n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},7418:function(t,n){n.f=Object.getOwnPropertySymbols},7463:function(t,n){t.exports={}},"764b":function(t,n){t.exports={}},7685:function(t,n,r){var e=r("3ac6"),o=r("8fad"),i="__core-js_shared__",c=e[i]||o(i,{});t.exports=c},"77b2":function(t,n,r){var e=r("c1b2"),o=r("06fa"),i=r("7a37");t.exports=!e&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},7839:function(t,n){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"78a2":function(t,n){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},"78e7":function(t,n){var r={}.hasOwnProperty;t.exports=function(t,n){return r.call(t,n)}},"7a37":function(t,n,r){var e=r("3ac6"),o=r("dfdb"),i=e.document,c=o(i)&&o(i.createElement);t.exports=function(t){return c?i.createElement(t):{}}},"7b0b":function(t,n,r){var e=r("1d80");t.exports=function(t){return Object(e(t))}},"7c73":function(t,n,r){var e=r("825a"),o=r("37e8"),i=r("7839"),c=r("d012"),u=r("1be4"),a=r("cc12"),f=r("f772"),s=f("IE_PROTO"),p="prototype",l=function(){},v=function(){var t,n=a("iframe"),r=i.length,e="<",o="script",c=">",f="java"+o+":";n.style.display="none",u.appendChild(n),n.src=String(f),t=n.contentWindow.document,t.open(),t.write(e+o+c+"document.F=Object"+e+"/"+o+c),t.close(),v=t.F;while(r--)delete v[p][i[r]];return v()};t.exports=Object.create||function(t,n){var r;return null!==t?(l[p]=e(t),r=new l,l[p]=null,r[s]=t):r=v(),void 0===n?r:o(r,n)},c[s]=!0},"7dd0":function(t,n,r){"use strict";var e=r("23e7"),o=r("9ed3"),i=r("e163"),c=r("d2bb"),u=r("d44e"),a=r("9112"),f=r("6eeb"),s=r("b622"),p=r("c430"),l=r("3f8c"),v=r("ae93"),d=v.IteratorPrototype,h=v.BUGGY_SAFARI_ITERATORS,y=s("iterator"),b="keys",g="values",x="entries",m=function(){return this};t.exports=function(t,n,r,s,v,w,S){o(r,n,s);var O,j,L,T=function(t){if(t===v&&k)return k;if(!h&&t in A)return A[t];switch(t){case b:return function(){return new r(this,t)};case g:return function(){return new r(this,t)};case x:return function(){return new r(this,t)}}return function(){return new r(this)}},E=n+" Iterator",P=!1,A=t.prototype,_=A[y]||A["@@iterator"]||v&&A[v],k=!h&&_||T(v),I="Array"==n&&A.entries||_;if(I&&(O=i(I.call(new t)),d!==Object.prototype&&O.next&&(p||i(O)===d||(c?c(O,d):"function"!=typeof O[y]&&a(O,y,m)),u(O,E,!0,!0),p&&(l[E]=m))),v==g&&_&&_.name!==g&&(P=!0,k=function(){return _.call(this)}),p&&!S||A[y]===k||a(A,y,k),l[n]=k,v)if(j={values:T(g),keys:w?k:T(b),entries:T(x)},S)for(L in j)!h&&!P&&L in A||f(A,L,j[L]);else e({target:n,proto:!0,forced:h||P},j);return j}},"7f9a":function(t,n,r){var e=r("da84"),o=r("9e81"),i=e.WeakMap;t.exports="function"===typeof i&&/native code/.test(o.call(i))},"825a":function(t,n,r){var e=r("861d");t.exports=function(t){if(!e(t))throw TypeError(String(t)+" is not an object");return t}},"83ab":function(t,n,r){var e=r("d039");t.exports=!e((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},"861d":function(t,n){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},"898c":function(t,n,r){t.exports=r("16f1")},"8f95":function(t,n,r){var e=r("fc48"),o=r("0363"),i=o("toStringTag"),c="Arguments"==e(function(){return arguments}()),u=function(t,n){try{return t[n]}catch(r){}};t.exports=function(t){var n,r,o;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=u(n=Object(t),i))?r:c?e(n):"Object"==(o=e(n))&&"function"==typeof n.callee?"Arguments":o}},"8fad":function(t,n,r){var e=r("3ac6"),o=r("0273");t.exports=function(t,n){try{o(e,t,n)}catch(r){e[t]=n}return n}},"90e3":function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++r+e).toString(36)}},9103:function(t,n,r){"use strict";var e=r("a421"),o=r("c44e"),i=r("7463"),c=r("2f5a"),u=r("4056"),a="Array Iterator",f=c.set,s=c.getterFor(a);t.exports=u(Array,"Array",(function(t,n){f(this,{type:a,target:e(t),index:0,kind:n})}),(function(){var t=s(this),n=t.target,r=t.kind,e=t.index++;return!n||e>=n.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:e,done:!1}:"values"==r?{value:n[e],done:!1}:{value:[e,n[e]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},9112:function(t,n,r){var e=r("83ab"),o=r("9bf2"),i=r("5c6c");t.exports=e?function(t,n,r){return o.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},"94ca":function(t,n,r){var e=r("d039"),o=/#|\.prototype\./,i=function(t,n){var r=u[c(t)];return r==f||r!=a&&("function"==typeof n?e(n):!!n)},c=i.normalize=function(t){return String(t).replace(o,".").toLowerCase()},u=i.data={},a=i.NATIVE="N",f=i.POLYFILL="P";t.exports=i},"96cf":function(t,n,r){var e=function(t){"use strict";var n,r=Object.prototype,e=r.hasOwnProperty,o="function"===typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function a(t,n,r,e){var o=n&&n.prototype instanceof h?n:h,i=Object.create(o.prototype),c=new P(e||[]);return i._invoke=j(t,r,c),i}function f(t,n,r){try{return{type:"normal",arg:t.call(n,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=a;var s="suspendedStart",p="suspendedYield",l="executing",v="completed",d={};function h(){}function y(){}function b(){}var g={};g[i]=function(){return this};var x=Object.getPrototypeOf,m=x&&x(x(A([])));m&&m!==r&&e.call(m,i)&&(g=m);var w=b.prototype=h.prototype=Object.create(g);function S(t){["next","throw","return"].forEach((function(n){t[n]=function(t){return this._invoke(n,t)}}))}function O(t){function n(r,o,i,c){var u=f(t[r],t,o);if("throw"!==u.type){var a=u.arg,s=a.value;return s&&"object"===typeof s&&e.call(s,"__await")?Promise.resolve(s.__await).then((function(t){n("next",t,i,c)}),(function(t){n("throw",t,i,c)})):Promise.resolve(s).then((function(t){a.value=t,i(a)}),(function(t){return n("throw",t,i,c)}))}c(u.arg)}var r;function o(t,e){function o(){return new Promise((function(r,o){n(t,e,r,o)}))}return r=r?r.then(o,o):o()}this._invoke=o}function j(t,n,r){var e=s;return function(o,i){if(e===l)throw new Error("Generator is already running");if(e===v){if("throw"===o)throw i;return _()}r.method=o,r.arg=i;while(1){var c=r.delegate;if(c){var u=L(c,r);if(u){if(u===d)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(e===s)throw e=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);e=l;var a=f(t,n,r);if("normal"===a.type){if(e=r.done?v:p,a.arg===d)continue;return{value:a.arg,done:r.done}}"throw"===a.type&&(e=v,r.method="throw",r.arg=a.arg)}}}function L(t,r){var e=t.iterator[r.method];if(e===n){if(r.delegate=null,"throw"===r.method){if(t.iterator["return"]&&(r.method="return",r.arg=n,L(t,r),"throw"===r.method))return d;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=f(e,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var i=o.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=n),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function T(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function E(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function A(t){if(t){var r=t[i];if(r)return r.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var o=-1,c=function r(){while(++o<t.length)if(e.call(t,o))return r.value=t[o],r.done=!1,r;return r.value=n,r.done=!0,r};return c.next=c}}return{next:_}}function _(){return{value:n,done:!0}}return y.prototype=w.constructor=b,b.constructor=y,b[u]=y.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var n="function"===typeof t&&t.constructor;return!!n&&(n===y||"GeneratorFunction"===(n.displayName||n.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,u in t||(t[u]="GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},S(O.prototype),O.prototype[c]=function(){return this},t.AsyncIterator=O,t.async=function(n,r,e,o){var i=new O(a(n,r,e,o));return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},S(w),w[u]="Generator",w[i]=function(){return this},w.toString=function(){return"[object Generator]"},t.keys=function(t){var n=[];for(var r in t)n.push(r);return n.reverse(),function r(){while(n.length){var e=n.pop();if(e in t)return r.value=e,r.done=!1,r}return r.done=!0,r}},t.values=A,P.prototype={constructor:P,reset:function(t){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(E),!t)for(var r in this)"t"===r.charAt(0)&&e.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0],n=t.completion;if("throw"===n.type)throw n.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function o(e,o){return u.type="throw",u.arg=t,r.next=e,o&&(r.method="next",r.arg=n),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var c=this.tryEntries[i],u=c.completion;if("root"===c.tryLoc)return o("end");if(c.tryLoc<=this.prev){var a=e.call(c,"catchLoc"),f=e.call(c,"finallyLoc");if(a&&f){if(this.prev<c.catchLoc)return o(c.catchLoc,!0);if(this.prev<c.finallyLoc)return o(c.finallyLoc)}else if(a){if(this.prev<c.catchLoc)return o(c.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<c.finallyLoc)return o(c.finallyLoc)}}}},abrupt:function(t,n){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&e.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=n&&n<=i.finallyLoc&&(i=null);var c=i?i.completion:{};return c.type=t,c.arg=n,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(c)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),d},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),d}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var e=r.completion;if("throw"===e.type){var o=e.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,e){return this.delegate={iterator:A(t),resultName:r,nextLoc:e},"next"===this.method&&(this.arg=n),d}},t}(t.exports);try{regeneratorRuntime=e}catch(o){Function("r","regeneratorRuntime = r")(e)}},"96e9":function(t,n,r){var e=r("3ac6"),o=r("ab85"),i=e.WeakMap;t.exports="function"===typeof i&&/native code/.test(o.call(i))},9883:function(t,n,r){var e=r("764b"),o=r("3ac6"),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,n){return arguments.length<2?i(e[t])||i(o[t]):e[t]&&e[t][n]||o[t]&&o[t][n]}},"9bdd":function(t,n,r){var e=r("825a");t.exports=function(t,n,r,o){try{return o?n(e(r)[0],r[1]):n(r)}catch(c){var i=t["return"];throw void 0!==i&&e(i.call(t)),c}}},"9bf2":function(t,n,r){var e=r("83ab"),o=r("0cfb"),i=r("825a"),c=r("c04e"),u=Object.defineProperty;n.f=e?u:function(t,n,r){if(i(t),n=c(n,!0),i(r),o)try{return u(t,n,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[n]=r.value),t}},"9cd3":function(t,n,r){t.exports=r("5ab9")},"9e57":function(t,n){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"9e81":function(t,n,r){var e=r("5692");t.exports=e("native-function-to-string",Function.toString)},"9ed3":function(t,n,r){"use strict";var e=r("ae93").IteratorPrototype,o=r("7c73"),i=r("5c6c"),c=r("d44e"),u=r("3f8c"),a=function(){return this};t.exports=function(t,n,r){var f=n+" Iterator";return t.prototype=o(e,{next:i(1,r)}),c(t,f,!1,!0),u[f]=a,t}},a016:function(t,n,r){var e=r("b323"),o=r("9e57");t.exports=Object.keys||function(t){return e(t,o)}},a0e5:function(t,n,r){var e=r("06fa"),o=/#|\.prototype\./,i=function(t,n){var r=u[c(t)];return r==f||r!=a&&("function"==typeof n?e(n):!!n)},c=i.normalize=function(t){return String(t).replace(o,".").toLowerCase()},u=i.data={},a=i.NATIVE="N",f=i.POLYFILL="P";t.exports=i},a421:function(t,n,r){var e=r("638c"),o=r("1875");t.exports=function(t){return e(o(t))}},a5eb:function(t,n,r){"use strict";var e=r("3ac6"),o=r("44ba").f,i=r("a0e5"),c=r("764b"),u=r("194a"),a=r("0273"),f=r("78e7"),s=function(t){var n=function(n,r,e){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(n);case 2:return new t(n,r)}return new t(n,r,e)}return t.apply(this,arguments)};return n.prototype=t.prototype,n};t.exports=function(t,n){var r,p,l,v,d,h,y,b,g,x=t.target,m=t.global,w=t.stat,S=t.proto,O=m?e:w?e[x]:(e[x]||{}).prototype,j=m?c:c[x]||(c[x]={}),L=j.prototype;for(v in n)r=i(m?v:x+(w?".":"#")+v,t.forced),p=!r&&O&&f(O,v),h=j[v],p&&(t.noTargetGet?(g=o(O,v),y=g&&g.value):y=O[v]),d=p&&y?y:n[v],p&&typeof h===typeof d||(b=t.bind&&p?u(d,e):t.wrap&&p?s(d):S&&"function"==typeof d?u(Function.call,d):d,(t.sham||d&&d.sham||h&&h.sham)&&a(b,"sham",!0),j[v]=b,S&&(l=x+"Prototype",f(c,l)||a(c,l,{}),c[l][v]=d,t.real&&L&&!L[v]&&a(L,v,d)))}},a691:function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},a79d:function(t,n,r){"use strict";var e=r("23e7"),o=r("c430"),i=r("fea9"),c=r("d066"),u=r("4840"),a=r("cdf9"),f=r("6eeb");e({target:"Promise",proto:!0,real:!0},{finally:function(t){var n=u(this,c("Promise")),r="function"==typeof t;return this.then(r?function(r){return a(n,t()).then((function(){return r}))}:t,r?function(r){return a(n,t()).then((function(){throw r}))}:t)}}),o||"function"!=typeof i||i.prototype["finally"]||f(i.prototype,"finally",c("Promise").prototype["finally"])},ab85:function(t,n,r){var e=r("d659");t.exports=e("native-function-to-string",Function.toString)},ae93:function(t,n,r){"use strict";var e,o,i,c=r("e163"),u=r("9112"),a=r("5135"),f=r("b622"),s=r("c430"),p=f("iterator"),l=!1,v=function(){return this};[].keys&&(i=[].keys(),"next"in i?(o=c(c(i)),o!==Object.prototype&&(e=o)):l=!0),void 0==e&&(e={}),s||a(e,p)||u(e,p,v),t.exports={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:l}},b041:function(t,n,r){"use strict";var e=r("f5df"),o=r("b622"),i=o("toStringTag"),c={};c[i]="z",t.exports="[object z]"!==String(c)?function(){return"[object "+e(this)+"]"}:c.toString},b2ed:function(t,n,r){var e=r("d659"),o=r("3e80"),i=e("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},b323:function(t,n,r){var e=r("78e7"),o=r("a421"),i=r("6386").indexOf,c=r("6e9a");t.exports=function(t,n){var r,u=o(t),a=0,f=[];for(r in u)!e(c,r)&&e(u,r)&&f.push(r);while(n.length>a)e(u,r=n[a++])&&(~i(f,r)||f.push(r));return f}},b39a:function(t,n,r){var e=r("d066");t.exports=e("navigator","userAgent")||""},b575:function(t,n,r){var e,o,i,c,u,a,f,s,p=r("da84"),l=r("06cf").f,v=r("c6b6"),d=r("2cf4").set,h=r("b629"),y=p.MutationObserver||p.WebKitMutationObserver,b=p.process,g=p.Promise,x="process"==v(b),m=l(p,"queueMicrotask"),w=m&&m.value;w||(e=function(){var t,n;x&&(t=b.domain)&&t.exit();while(o){n=o.fn,o=o.next;try{n()}catch(r){throw o?c():i=void 0,r}}i=void 0,t&&t.enter()},x?c=function(){b.nextTick(e)}:y&&!h?(u=!0,a=document.createTextNode(""),new y(e).observe(a,{characterData:!0}),c=function(){a.data=u=!u}):g&&g.resolve?(f=g.resolve(void 0),s=f.then,c=function(){s.call(f,e)}):c=function(){d.call(p,e)}),t.exports=w||function(t){var n={fn:t,next:void 0};i&&(i.next=n),o||(o=n,c()),i=n}},b622:function(t,n,r){var e=r("da84"),o=r("5692"),i=r("90e3"),c=r("4930"),u=e.Symbol,a=o("wks");t.exports=function(t){return a[t]||(a[t]=c&&u[t]||(c?u:i)("Symbol."+t))}},b629:function(t,n,r){var e=r("b39a");t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(e)},bb83:function(t,n,r){"use strict";var e,o,i,c=r("5779"),u=r("0273"),a=r("78e7"),f=r("0363"),s=r("7042"),p=f("iterator"),l=!1,v=function(){return this};[].keys&&(i=[].keys(),"next"in i?(o=c(c(i)),o!==Object.prototype&&(e=o)):l=!0),void 0==e&&(e={}),s||a(e,p)||u(e,p,v),t.exports={IteratorPrototype:e,BUGGY_SAFARI_ITERATORS:l}},c04e:function(t,n,r){var e=r("861d");t.exports=function(t,n){if(!e(t))return t;var r,o;if(n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;if("function"==typeof(r=t.valueOf)&&!e(o=r.call(t)))return o;if(!n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},c1b2:function(t,n,r){var e=r("06fa");t.exports=!e((function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}))},c230:function(t,n,r){var e=r("c1b2"),o=r("4180"),i=r("6f8d"),c=r("a016");t.exports=e?Object.defineProperties:function(t,n){i(t);var r,e=c(n),u=e.length,a=0;while(u>a)o.f(t,r=e[a++],n[r]);return t}},c430:function(t,n){t.exports=!1},c44e:function(t,n){t.exports=function(){}},c6b6:function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},c6cd:function(t,n,r){var e=r("da84"),o=r("ce4e"),i="__core-js_shared__",c=e[i]||o(i,{});t.exports=c},c8ba:function(t,n){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"===typeof window&&(r=window)}t.exports=r},ca84:function(t,n,r){var e=r("5135"),o=r("fc6a"),i=r("4d64").indexOf,c=r("d012");t.exports=function(t,n){var r,u=o(t),a=0,f=[];for(r in u)!e(c,r)&&e(u,r)&&f.push(r);while(n.length>a)e(u,r=n[a++])&&(~i(f,r)||f.push(r));return f}},cbd0:function(t,n,r){var e=r("1561"),o=r("1875"),i=function(t){return function(n,r){var i,c,u=String(o(n)),a=e(r),f=u.length;return a<0||a>=f?t?"":void 0:(i=u.charCodeAt(a),i<55296||i>56319||a+1===f||(c=u.charCodeAt(a+1))<56320||c>57343?t?u.charAt(a):i:t?u.slice(a,a+2):c-56320+(i-55296<<10)+65536)}};t.exports={codeAt:i(!1),charAt:i(!0)}},cc12:function(t,n,r){var e=r("da84"),o=r("861d"),i=e.document,c=o(i)&&o(i.createElement);t.exports=function(t){return c?i.createElement(t):{}}},cc94:function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},cca6:function(t,n,r){var e=r("23e7"),o=r("60da");e({target:"Object",stat:!0,forced:Object.assign!==o},{assign:o})},cdf9:function(t,n,r){var e=r("825a"),o=r("861d"),i=r("f069");t.exports=function(t,n){if(e(t),o(n)&&n.constructor===t)return n;var r=i.f(t),c=r.resolve;return c(n),r.promise}},ce4e:function(t,n,r){var e=r("da84"),o=r("9112");t.exports=function(t,n){try{o(e,t,n)}catch(r){e[t]=n}return n}},d012:function(t,n){t.exports={}},d039:function(t,n){t.exports=function(t){try{return!!t()}catch(n){return!0}}},d066:function(t,n,r){var e=r("428f"),o=r("da84"),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,n){return arguments.length<2?i(e[t])||i(o[t]):e[t]&&e[t][n]||o[t]&&o[t][n]}},d1e7:function(t,n,r){"use strict";var e={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!e.call({1:2},1);n.f=i?function(t){var n=o(this,t);return!!n&&n.enumerable}:e},d2bb:function(t,n,r){var e=r("825a"),o=r("3bbe");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,n=!1,r={};try{t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,t.call(r,[]),n=r instanceof Array}catch(i){}return function(r,i){return e(r),o(i),n?t.call(r,i):r.__proto__=i,r}}():void 0)},d3b7:function(t,n,r){var e=r("6eeb"),o=r("b041"),i=Object.prototype;o!==i.toString&&e(i,"toString",o,{unsafe:!0})},d44e:function(t,n,r){var e=r("9bf2").f,o=r("5135"),i=r("b622"),c=i("toStringTag");t.exports=function(t,n,r){t&&!o(t=r?t:t.prototype,c)&&e(t,c,{configurable:!0,value:n})}},d659:function(t,n,r){var e=r("7042"),o=r("7685");(t.exports=function(t,n){return o[t]||(o[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.4.1",mode:e?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},d666:function(t,n,r){var e=r("0273");t.exports=function(t,n,r,o){o&&o.enumerable?t[n]=r:e(t,n,r)}},d9f3:function(t,n,r){var e=r("6f8d"),o=r("0b7b");t.exports=function(t){var n=o(t);if("function"!=typeof n)throw TypeError(String(t)+" is not iterable");return e(n.call(t))}},da84:function(t,n,r){(function(n){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n&&n)||Function("return this")()}).call(this,r("c8ba"))},ddb0:function(t,n,r){var e=r("da84"),o=r("fdbc"),i=r("e260"),c=r("9112"),u=r("b622"),a=u("iterator"),f=u("toStringTag"),s=i.values;for(var p in o){var l=e[p],v=l&&l.prototype;if(v){if(v[a]!==s)try{c(v,a,s)}catch(h){v[a]=s}if(v[f]||c(v,f,p),o[p])for(var d in i)if(v[d]!==i[d])try{c(v,d,i[d])}catch(h){v[d]=i[d]}}}},df75:function(t,n,r){var e=r("ca84"),o=r("7839");t.exports=Object.keys||function(t){return e(t,o)}},dfdb:function(t,n){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},e163:function(t,n,r){var e=r("5135"),o=r("7b0b"),i=r("f772"),c=r("e177"),u=i("IE_PROTO"),a=Object.prototype;t.exports=c?Object.getPrototypeOf:function(t){return t=o(t),e(t,u)?t[u]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},e177:function(t,n,r){var e=r("d039");t.exports=!e((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},e260:function(t,n,r){"use strict";var e=r("fc6a"),o=r("44d2"),i=r("3f8c"),c=r("69f3"),u=r("7dd0"),a="Array Iterator",f=c.set,s=c.getterFor(a);t.exports=u(Array,"Array",(function(t,n){f(this,{type:a,target:e(t),index:0,kind:n})}),(function(){var t=s(this),n=t.target,r=t.kind,e=t.index++;return!n||e>=n.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:e,done:!1}:"values"==r?{value:n[e],done:!1}:{value:[e,n[e]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},e2cc:function(t,n,r){var e=r("6eeb");t.exports=function(t,n,r){for(var o in n)e(t,o,n[o],r);return t}},e519:function(t,n,r){var e=r("a5eb"),o=r("6220");e({target:"Array",stat:!0},{isArray:o})},e587:function(t,n,r){"use strict";var e=r("1316"),o=r.n(e);function i(t){if(o()(t))return t}var c=r("898c"),u=r.n(c),a=r("2dc0"),f=r.n(a);function s(t,n){if(f()(Object(t))||"[object Arguments]"===Object.prototype.toString.call(t)){var r=[],e=!0,o=!1,i=void 0;try{for(var c,a=u()(t);!(e=(c=a.next()).done);e=!0)if(r.push(c.value),n&&r.length===n)break}catch(s){o=!0,i=s}finally{try{e||null==a["return"]||a["return"]()}finally{if(o)throw i}}return r}}function p(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function l(t,n){return i(t)||s(t,n)||p()}r.d(n,"a",(function(){return l}))},e667:function(t,n){t.exports=function(t){try{return{error:!1,value:t()}}catch(n){return{error:!0,value:n}}}},e6cf:function(t,n,r){"use strict";var e,o,i,c,u=r("23e7"),a=r("c430"),f=r("da84"),s=r("d066"),p=r("fea9"),l=r("6eeb"),v=r("e2cc"),d=r("5692"),h=r("d44e"),y=r("2626"),b=r("861d"),g=r("1c0b"),x=r("19aa"),m=r("c6b6"),w=r("2266"),S=r("1c7e"),O=r("4840"),j=r("2cf4").set,L=r("b575"),T=r("cdf9"),E=r("44de"),P=r("f069"),A=r("e667"),_=r("69f3"),k=r("94ca"),I=r("b622"),M=r("60ae"),F=I("species"),C="Promise",G=_.get,R=_.set,N=_.getterFor(C),D=p,V=f.TypeError,z=f.document,H=f.process,Y=d("inspectSource"),B=s("fetch"),U=P.f,W=U,q="process"==m(H),J=!!(z&&z.createEvent&&f.dispatchEvent),K="unhandledrejection",Q="rejectionhandled",X=0,Z=1,$=2,tt=1,nt=2,rt=k(C,(function(){var t=Y(D)!==String(D);if(66===M)return!0;if(!t&&!q&&"function"!=typeof PromiseRejectionEvent)return!0;if(a&&!D.prototype["finally"])return!0;if(M>=51&&/native code/.test(D))return!1;var n=D.resolve(1),r=function(t){t((function(){}),(function(){}))},e=n.constructor={};return e[F]=r,!(n.then((function(){}))instanceof r)})),et=rt||!S((function(t){D.all(t)["catch"]((function(){}))})),ot=function(t){var n;return!(!b(t)||"function"!=typeof(n=t.then))&&n},it=function(t,n,r){if(!n.notified){n.notified=!0;var e=n.reactions;L((function(){var o=n.value,i=n.state==Z,c=0;while(e.length>c){var u,a,f,s=e[c++],p=i?s.ok:s.fail,l=s.resolve,v=s.reject,d=s.domain;try{p?(i||(n.rejection===nt&&ft(t,n),n.rejection=tt),!0===p?u=o:(d&&d.enter(),u=p(o),d&&(d.exit(),f=!0)),u===s.promise?v(V("Promise-chain cycle")):(a=ot(u))?a.call(u,l,v):l(u)):v(o)}catch(h){d&&!f&&d.exit(),v(h)}}n.reactions=[],n.notified=!1,r&&!n.rejection&&ut(t,n)}))}},ct=function(t,n,r){var e,o;J?(e=z.createEvent("Event"),e.promise=n,e.reason=r,e.initEvent(t,!1,!0),f.dispatchEvent(e)):e={promise:n,reason:r},(o=f["on"+t])?o(e):t===K&&E("Unhandled promise rejection",r)},ut=function(t,n){j.call(f,(function(){var r,e=n.value,o=at(n);if(o&&(r=A((function(){q?H.emit("unhandledRejection",e,t):ct(K,t,e)})),n.rejection=q||at(n)?nt:tt,r.error))throw r.value}))},at=function(t){return t.rejection!==tt&&!t.parent},ft=function(t,n){j.call(f,(function(){q?H.emit("rejectionHandled",t):ct(Q,t,n.value)}))},st=function(t,n,r,e){return function(o){t(n,r,o,e)}},pt=function(t,n,r,e){n.done||(n.done=!0,e&&(n=e),n.value=r,n.state=$,it(t,n,!0))},lt=function(t,n,r,e){if(!n.done){n.done=!0,e&&(n=e);try{if(t===r)throw V("Promise can't be resolved itself");var o=ot(r);o?L((function(){var e={done:!1};try{o.call(r,st(lt,t,e,n),st(pt,t,e,n))}catch(i){pt(t,e,i,n)}})):(n.value=r,n.state=Z,it(t,n,!1))}catch(i){pt(t,{done:!1},i,n)}}};rt&&(D=function(t){x(this,D,C),g(t),e.call(this);var n=G(this);try{t(st(lt,this,n),st(pt,this,n))}catch(r){pt(this,n,r)}},e=function(t){R(this,{type:C,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:X,value:void 0})},e.prototype=v(D.prototype,{then:function(t,n){var r=N(this),e=U(O(this,D));return e.ok="function"!=typeof t||t,e.fail="function"==typeof n&&n,e.domain=q?H.domain:void 0,r.parent=!0,r.reactions.push(e),r.state!=X&&it(this,r,!1),e.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new e,n=G(t);this.promise=t,this.resolve=st(lt,t,n),this.reject=st(pt,t,n)},P.f=U=function(t){return t===D||t===i?new o(t):W(t)},a||"function"!=typeof p||(c=p.prototype.then,l(p.prototype,"then",(function(t,n){var r=this;return new D((function(t,n){c.call(r,t,n)})).then(t,n)}),{unsafe:!0}),"function"==typeof B&&u({global:!0,enumerable:!0,forced:!0},{fetch:function(t){return T(D,B.apply(f,arguments))}}))),u({global:!0,wrap:!0,forced:rt},{Promise:D}),h(D,C,!1,!0),y(C),i=s(C),u({target:C,stat:!0,forced:rt},{reject:function(t){var n=U(this);return n.reject.call(void 0,t),n.promise}}),u({target:C,stat:!0,forced:a||rt},{resolve:function(t){return T(a&&this===i?D:this,t)}}),u({target:C,stat:!0,forced:et},{all:function(t){var n=this,r=U(n),e=r.resolve,o=r.reject,i=A((function(){var r=g(n.resolve),i=[],c=0,u=1;w(t,(function(t){var a=c++,f=!1;i.push(void 0),u++,r.call(n,t).then((function(t){f||(f=!0,i[a]=t,--u||e(i))}),o)})),--u||e(i)}));return i.error&&o(i.value),r.promise},race:function(t){var n=this,r=U(n),e=r.reject,o=A((function(){var o=g(n.resolve);w(t,(function(t){o.call(n,t).then(r.resolve,e)}))}));return o.error&&e(o.value),r.promise}})},e893:function(t,n,r){var e=r("5135"),o=r("56ef"),i=r("06cf"),c=r("9bf2");t.exports=function(t,n){for(var r=o(n),u=c.f,a=i.f,f=0;f<r.length;f++){var s=r[f];e(t,s)||u(t,s,a(n,s))}}},e95a:function(t,n,r){var e=r("b622"),o=r("3f8c"),i=e("iterator"),c=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||c[i]===t)}},ec62:function(t,n,r){var e=r("6f8d"),o=r("2f97");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,n=!1,r={};try{t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,t.call(r,[]),n=r instanceof Array}catch(i){}return function(r,i){return e(r),o(i),n?t.call(r,i):r.__proto__=i,r}}():void 0)},edbd:function(t,n,r){var e=r("9883");t.exports=e("document","documentElement")},f069:function(t,n,r){"use strict";var e=r("1c0b"),o=function(t){var n,r;this.promise=new t((function(t,e){if(void 0!==n||void 0!==r)throw TypeError("Bad Promise constructor");n=t,r=e})),this.resolve=e(n),this.reject=e(r)};t.exports.f=function(t){return new o(t)}},f575:function(t,n,r){"use strict";var e=r("bb83").IteratorPrototype,o=r("4896"),i=r("2c6c"),c=r("2874"),u=r("7463"),a=function(){return this};t.exports=function(t,n,r){var f=n+" Iterator";return t.prototype=o(e,{next:i(1,r)}),c(t,f,!1,!0),u[f]=a,t}},f5df:function(t,n,r){var e=r("c6b6"),o=r("b622"),i=o("toStringTag"),c="Arguments"==e(function(){return arguments}()),u=function(t,n){try{return t[n]}catch(r){}};t.exports=function(t){var n,r,o;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=u(n=Object(t),i))?r:c?e(n):"Object"==(o=e(n))&&"function"==typeof n.callee?"Arguments":o}},f5fb:function(t,n,r){var e=r("06fa");t.exports=!e((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},f772:function(t,n,r){var e=r("5692"),o=r("90e3"),i=e("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},f8c2:function(t,n,r){var e=r("1c0b");t.exports=function(t,n,r){if(e(t),void 0===n)return t;switch(r){case 0:return function(){return t.call(n)};case 1:return function(r){return t.call(n,r)};case 2:return function(r,e){return t.call(n,r,e)};case 3:return function(r,e,o){return t.call(n,r,e,o)}}return function(){return t.apply(n,arguments)}}},fc48:function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},fc6a:function(t,n,r){var e=r("44ad"),o=r("1d80");t.exports=function(t){return e(o(t))}},fdbc:function(t,n){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},fea9:function(t,n,r){var e=r("da84");t.exports=e.Promise}}]); //# sourceMappingURL=chunk-vendors.cdeb33ba.js.map
//这里是三个中间件为例子 composeReturn = function(...args){ return (function(...args){ return (function(next){ return /* function(action){ * console.log('中间件1') * return setTimeout(function(){ * next(action) * },2000) * } */ function(action){ console.log('中间件1') return setTimeout(function(){ (function(action){ console.log('中间件2') return ( function (action) { console.log('中间件3'); return dispatch(action); } )(action) })(action) },2000) } })( /**(function(next) { * return function (action) { * console.log('中间件2'); //这里是异步中间件 * return next(action); * } * })(...args) */ function(action){ console.log('中间件2') return ( function (action) { console.log('中间件3'); return dispatch(action); } )(action) } ) })( /** * (function(next) { * return function (action) { * console.log('中间件3'); * return next(action); * } * })(...args)//最外层args是dispatch */ function (action) { console.log('中间件3'); return dispatch(action); } ) } composeReturn(store.dispatch)
# -*- coding: utf-8 -*- """ Created on Mon Aug 16 16:13:48 2021 @author: 20210595 """ from gama.genetic_programming.components.individual import Individual from gama.genetic_programming.compilers.scikitlearn import compile_individual from gama.genetic_programming.components.primitive_node import PrimitiveNode from gama.genetic_programming.components.primitive import Primitive from gama.genetic_programming.components.terminal import Terminal from sklearn.naive_bayes import MultinomialNB # Pipeline: MultinomialNB(data, alpha=10.0, fit_prior=False) primitiveClassification = Primitive(['MultinomialNB.alpha', # Primitive.input 'MultinomialNB.fit_prior'], "prediction", # Primitive.output MultinomialNB # Primitive.identifier ) terminal1 = Terminal(10.0, 'alpha', 'alpha') terminal2 = Terminal(False, 'fit_prior', 'fit_prior') terminalClassification = [terminal1, terminal2] primitiveNodeClassification = PrimitiveNode(primitiveClassification, "data", terminalClassification) #print(primitiveNodeClassification) #Ahora crearemos un Individual ind = Individual(primitiveNodeClassification, compile_individual) import logging from functools import partial from typing import Optional, Any, Tuple, Dict, List, Callable import pandas as pd from gama.genetic_programming.components import Individual from gama.genetic_programming.operator_set import OperatorSet from gama.logging.evaluation_logger import EvaluationLogger from gama.search_methods.base_search import BaseSearch from gama.utilities.generic.async_evaluator import AsyncEvaluator log = logging.getLogger(__name__) class RandomForestTry(BaseSearch): """ Perform asynchronous evolutionary optimization. Parameters ---------- population_size: int, optional (default=50) Maximum number of individuals in the population at any time. max_n_evaluations: int, optional (default=None) If specified, only a maximum of `max_n_evaluations` individuals are evaluated. If None, the algorithm will be run until interrupted by the user or a timeout. restart_callback: Callable[[], bool], optional (default=None) Function which takes no arguments and returns True if search restart. """ def __init__( self, population_size: Optional[int] = None, max_n_evaluations: Optional[int] = None, restart_callback: Optional[Callable[[], bool]] = None, ): print("Entré a la clase RandomForestTry") super().__init__() # maps hyperparameter -> (set value, default) self._hyperparameters: Dict[str, Tuple[Any, Any]] = dict( population_size=(population_size, 50), restart_callback=(restart_callback, None), max_n_evaluations=(max_n_evaluations, None), ) self.output = [] def get_parent(evaluation, n) -> str: """ retrieves the nth parent if it exists, '' otherwise. """ if len(evaluation.individual.meta.get("parents", [])) > n: return evaluation.individual.meta["parents"][n] return "" self.logger = partial( EvaluationLogger, extra_fields=dict( parent0=partial(get_parent, n=0), parent1=partial(get_parent, n=1), origin=lambda e: e.individual.meta.get("origin", "unknown"), ), ) def dynamic_defaults(self, x: pd.DataFrame, y: pd.DataFrame, time_limit: float): pass def search(self, operations: OperatorSet, start_candidates: List[Individual]): self.output = randomForestSearch( operations, self.output, start_candidates, **self.hyperparameters ) #print("self.output, aync_ea", self.output) def randomForestSearch( ops: OperatorSet, output: List[Individual], start_candidates: List[Individual], restart_callback: Optional[Callable[[], bool]] = None, max_n_evaluations: Optional[int] = None, population_size: int = 50, ) -> List[Individual]: """ Perform asynchronous evolutionary optimization with given operators. Parameters ---------- ops: OperatorSet Operator set with `evaluate`, `create`, `individual` and `eliminate` functions. output: List[Individual] A list which contains the set of best found individuals during search. start_candidates: List[Individual] A list with candidate individuals which should be used to start search from. restart_callback: Callable[[], bool], optional (default=None) Function which takes no arguments and returns True if search restart. max_n_evaluations: int, optional (default=None) If specified, only a maximum of `max_n_evaluations` individuals are evaluated. If None, the algorithm will be run indefinitely. population_size: int (default=50) Maximum number of individuals in the population at any time. Returns ------- List[Individual] The individuals currently in the population. """ if max_n_evaluations is not None and max_n_evaluations <= 0: raise ValueError( f"n_evaluations must be non-negative or None, is {max_n_evaluations}." ) start_candidates = [ind] max_pop_size = population_size current_population = output n_evaluated_individuals = 0 with AsyncEvaluator() as async_: current_population[:] = [] log.info("Starting Random Forest Try with new population.") for individual in start_candidates: async_.submit(ops.evaluate, individual) while (max_n_evaluations is None) or ( n_evaluated_individuals < max_n_evaluations ): future = ops.wait_next(async_) if future.exception is None: individual = future.result.individual # print("individual RandomForest try", individual) current_population.append(individual) if len(current_population) > max_pop_size: to_remove = ops.eliminate(current_population, 1) current_population.remove(to_remove[0]) new_individual = ind # print("new_individual", new_individual) async_.submit(ops.evaluate, new_individual) return current_population
""" WSGI config for studentstudyportal project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'studentstudyportal.settings') application = get_wsgi_application()
import { expect, fixture, html, assert, elementUpdated, fixtureCleanup, } from "@open-wc/testing"; import { setViewport } from "@web/test-runner-commands"; import "../lrnsys-button.js"; /* * Instantiation test * create element and see if an attribute binds to the element */ describe("Instantiation Test", () => { it("lrnsys-button instantiates", async () => { const el = await fixture( html` <lrnsys-button title="test-title"></lrnsys-button> ` ); await expect(el.getAttribute("title")).to.equal("test-title"); }); }); /* * A11y Accessibility tests */ describe("A11y/chai axe tests", () => { it("lrnsys-button passes accessibility test", async () => { const el = await fixture(html` <lrnsys-button></lrnsys-button> `); await expect(el).to.be.accessible(); }); it("lrnsys-button passes accessibility negation", async () => { const el = await fixture( html`<lrnsys-button aria-labelledby="lrnsys-button"></lrnsys-button>` ); await assert.isNotAccessible(el); }); }); /* // Custom properties test describe("Custom Property Test", () => { it("lrnsys-button can instantiate a element with custom properties", async () => { const el = await fixture(html`<lrnsys-button .foo=${'bar'}></lrnsys-button>`); expect(el.foo).to.equal('bar'); }) }) */ /* // Test if element is mobile responsive describe('Test Mobile Responsiveness', () => { before(async () => {z await setViewport({width: 375, height: 750}); }) it('sizes down to 360px', async () => { const el = await fixture(html`<lrnsys-button ></lrnsys-button>`); const width = getComputedStyle(el).width; expect(width).to.equal('360px'); }) }) */ /* // Test if element sizes up for desktop behavior describe('Test Desktop Responsiveness', () => { before(async () => { await setViewport({width: 1000, height: 1000}); }) it('sizes up to 410px', async () => { const el = await fixture(html`<lrnsys-button></lrnsys-button>`); const width = getComputedStyle(el).width; expect(width).to.equal('410px'); }) it('hides mobile menu', async () => { const el await fixture(html`<lrnsys-button></lrnsys-button>`); const hidden = el.getAttribute('hidden'); expect(hidden).to.equal(true); }) }) */ // clean up fixtures after all tests are complete afterEach(() => { fixtureCleanup(); });
/* * Copyright (c) 2006-2012 Erin Catto http://www.box2d.org * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. */ System.register(["Box2D", "Testbed"], function (exports_1, context_1) { "use strict"; var box2d, testbed, Tumbler; var __moduleName = context_1 && context_1.id; return { setters: [ function (box2d_1) { box2d = box2d_1; }, function (testbed_1) { testbed = testbed_1; } ], execute: function () { Tumbler = class Tumbler extends testbed.Test { constructor() { super(); this.m_count = 0; const ground = this.m_world.CreateBody(new box2d.b2BodyDef()); { const bd = new box2d.b2BodyDef(); bd.type = box2d.b2BodyType.b2_dynamicBody; bd.allowSleep = false; bd.position.Set(0.0, 10.0); const body = this.m_world.CreateBody(bd); const shape = new box2d.b2PolygonShape(); shape.SetAsBox(0.5, 10.0, new box2d.b2Vec2(10.0, 0.0), 0.0); body.CreateFixture(shape, 5.0); shape.SetAsBox(0.5, 10.0, new box2d.b2Vec2(-10.0, 0.0), 0.0); body.CreateFixture(shape, 5.0); shape.SetAsBox(10.0, 0.5, new box2d.b2Vec2(0.0, 10.0), 0.0); body.CreateFixture(shape, 5.0); shape.SetAsBox(10.0, 0.5, new box2d.b2Vec2(0.0, -10.0), 0.0); body.CreateFixture(shape, 5.0); const jd = new box2d.b2RevoluteJointDef(); jd.bodyA = ground; jd.bodyB = body; jd.localAnchorA.Set(0.0, 10.0); jd.localAnchorB.Set(0.0, 0.0); jd.referenceAngle = 0.0; jd.motorSpeed = 0.05 * box2d.b2_pi; jd.maxMotorTorque = 1e8; jd.enableMotor = true; this.m_joint = this.m_world.CreateJoint(jd); } this.m_count = 0; } Step(settings) { super.Step(settings); if (this.m_count < Tumbler.e_count) { const bd = new box2d.b2BodyDef(); bd.type = box2d.b2BodyType.b2_dynamicBody; bd.position.Set(0.0, 10.0); const body = this.m_world.CreateBody(bd); const shape = new box2d.b2PolygonShape(); shape.SetAsBox(0.125, 0.125); body.CreateFixture(shape, 1.0); ++this.m_count; } } static Create() { return new Tumbler(); } }; Tumbler.e_count = 800; exports_1("Tumbler", Tumbler); } }; }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVHVtYmxlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL1Rlc3RiZWQvVGVzdHMvVHVtYmxlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7OztFQWdCRTs7Ozs7Ozs7Ozs7Ozs7O1lBS0YsVUFBQSxNQUFhLE9BQVEsU0FBUSxPQUFPLENBQUMsSUFBSTtnQkFNdkM7b0JBQ0UsS0FBSyxFQUFFLENBQUM7b0JBSEgsWUFBTyxHQUFHLENBQUMsQ0FBQztvQkFLakIsTUFBTSxNQUFNLEdBQUcsSUFBSSxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsSUFBSSxLQUFLLENBQUMsU0FBUyxFQUFFLENBQUMsQ0FBQztvQkFFOUQ7d0JBQ0UsTUFBTSxFQUFFLEdBQUcsSUFBSSxLQUFLLENBQUMsU0FBUyxFQUFFLENBQUM7d0JBQ2pDLEVBQUUsQ0FBQyxJQUFJLEdBQUcsS0FBSyxDQUFDLFVBQVUsQ0FBQyxjQUFjLENBQUM7d0JBQzFDLEVBQUUsQ0FBQyxVQUFVLEdBQUcsS0FBSyxDQUFDO3dCQUN0QixFQUFFLENBQUMsUUFBUSxDQUFDLEdBQUcsQ0FBQyxHQUFHLEVBQUUsSUFBSSxDQUFDLENBQUM7d0JBQzNCLE1BQU0sSUFBSSxHQUFHLElBQUksQ0FBQyxPQUFPLENBQUMsVUFBVSxDQUFDLEVBQUUsQ0FBQyxDQUFDO3dCQUV6QyxNQUFNLEtBQUssR0FBRyxJQUFJLEtBQUssQ0FBQyxjQUFjLEVBQUUsQ0FBQzt3QkFDekMsS0FBSyxDQUFDLFFBQVEsQ0FBQyxHQUFHLEVBQUUsSUFBSSxFQUFFLElBQUksS0FBSyxDQUFDLE1BQU0sQ0FBQyxJQUFJLEVBQUUsR0FBRyxDQUFDLEVBQUUsR0FBRyxDQUFDLENBQUM7d0JBQzVELElBQUksQ0FBQyxhQUFhLENBQUMsS0FBSyxFQUFFLEdBQUcsQ0FBQyxDQUFDO3dCQUMvQixLQUFLLENBQUMsUUFBUSxDQUFDLEdBQUcsRUFBRSxJQUFJLEVBQUUsSUFBSSxLQUFLLENBQUMsTUFBTSxDQUFDLENBQUMsSUFBSSxFQUFFLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQyxDQUFDO3dCQUM3RCxJQUFJLENBQUMsYUFBYSxDQUFDLEtBQUssRUFBRSxHQUFHLENBQUMsQ0FBQzt3QkFDL0IsS0FBSyxDQUFDLFFBQVEsQ0FBQyxJQUFJLEVBQUUsR0FBRyxFQUFFLElBQUksS0FBSyxDQUFDLE1BQU0sQ0FBQyxHQUFHLEVBQUUsSUFBSSxDQUFDLEVBQUUsR0FBRyxDQUFDLENBQUM7d0JBQzVELElBQUksQ0FBQyxhQUFhLENBQUMsS0FBSyxFQUFFLEdBQUcsQ0FBQyxDQUFDO3dCQUMvQixLQUFLLENBQUMsUUFBUSxDQUFDLElBQUksRUFBRSxHQUFHLEVBQUUsSUFBSSxLQUFLLENBQUMsTUFBTSxDQUFDLEdBQUcsRUFBRSxDQUFDLElBQUksQ0FBQyxFQUFFLEdBQUcsQ0FBQyxDQUFDO3dCQUM3RCxJQUFJLENBQUMsYUFBYSxDQUFDLEtBQUssRUFBRSxHQUFHLENBQUMsQ0FBQzt3QkFFL0IsTUFBTSxFQUFFLEdBQUcsSUFBSSxLQUFLLENBQUMsa0JBQWtCLEVBQUUsQ0FBQzt3QkFDMUMsRUFBRSxDQUFDLEtBQUssR0FBRyxNQUFNLENBQUM7d0JBQ2xCLEVBQUUsQ0FBQyxLQUFLLEdBQUcsSUFBSSxDQUFDO3dCQUNoQixFQUFFLENBQUMsWUFBWSxDQUFDLEdBQUcsQ0FBQyxHQUFHLEVBQUUsSUFBSSxDQUFDLENBQUM7d0JBQy9CLEVBQUUsQ0FBQyxZQUFZLENBQUMsR0FBRyxDQUFDLEdBQUcsRUFBRSxHQUFHLENBQUMsQ0FBQzt3QkFDOUIsRUFBRSxDQUFDLGNBQWMsR0FBRyxHQUFHLENBQUM7d0JBQ3hCLEVBQUUsQ0FBQyxVQUFVLEdBQUcsSUFBSSxHQUFHLEtBQUssQ0FBQyxLQUFLLENBQUM7d0JBQ25DLEVBQUUsQ0FBQyxjQUFjLEdBQUcsR0FBRyxDQUFDO3dCQUN4QixFQUFFLENBQUMsV0FBVyxHQUFHLElBQUksQ0FBQzt3QkFDdEIsSUFBSSxDQUFDLE9BQU8sR0FBRyxJQUFJLENBQUMsT0FBTyxDQUFDLFdBQVcsQ0FBQyxFQUFFLENBQUMsQ0FBQztxQkFDN0M7b0JBRUQsSUFBSSxDQUFDLE9BQU8sR0FBRyxDQUFDLENBQUM7Z0JBQ25CLENBQUM7Z0JBRU0sSUFBSSxDQUFDLFFBQTBCO29CQUNwQyxLQUFLLENBQUMsSUFBSSxDQUFDLFFBQVEsQ0FBQyxDQUFDO29CQUVyQixJQUFJLElBQUksQ0FBQyxPQUFPLEdBQUcsT0FBTyxDQUFDLE9BQU8sRUFBRTt3QkFDbEMsTUFBTSxFQUFFLEdBQUcsSUFBSSxLQUFLLENBQUMsU0FBUyxFQUFFLENBQUM7d0JBQ2pDLEVBQUUsQ0FBQyxJQUFJLEdBQUcsS0FBSyxDQUFDLFVBQVUsQ0FBQyxjQUFjLENBQUM7d0JBQzFDLEVBQUUsQ0FBQyxRQUFRLENBQUMsR0FBRyxDQUFDLEdBQUcsRUFBRSxJQUFJLENBQUMsQ0FBQzt3QkFDM0IsTUFBTSxJQUFJLEdBQUcsSUFBSSxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsRUFBRSxDQUFDLENBQUM7d0JBRXpDLE1BQU0sS0FBSyxHQUFHLElBQUksS0FBSyxDQUFDLGNBQWMsRUFBRSxDQUFDO3dCQUN6QyxLQUFLLENBQUMsUUFBUSxDQUFDLEtBQUssRUFBRSxLQUFLLENBQUMsQ0FBQzt3QkFDN0IsSUFBSSxDQUFDLGFBQWEsQ0FBQyxLQUFLLEVBQUUsR0FBRyxDQUFDLENBQUM7d0JBRS9CLEVBQUUsSUFBSSxDQUFDLE9BQU8sQ0FBQztxQkFDaEI7Z0JBQ0gsQ0FBQztnQkFFTSxNQUFNLENBQUMsTUFBTTtvQkFDbEIsT0FBTyxJQUFJLE9BQU8sRUFBRSxDQUFDO2dCQUN2QixDQUFDO2FBQ0YsQ0FBQTtZQTlEd0IsZUFBTyxHQUFHLEdBQUcsQ0FBQyJ9
(this["webpackJsonphotkeys-js"]=this["webpackJsonphotkeys-js"]||[]).push([[69],{106:function(e,n,t){(function(n){var t=function(e){var n=/\blang(?:uage)?-([\w-]+)\b/i,t=0,r={manual:e.Prism&&e.Prism.manual,disableWorkerMessageHandler:e.Prism&&e.Prism.disableWorkerMessageHandler,util:{encode:function e(n){return n instanceof a?new a(n.type,e(n.content),n.alias):Array.isArray(n)?n.map(e):n.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++t}),e.__id},clone:function e(n,t){var a,i;switch(t=t||{},r.util.type(n)){case"Object":if(i=r.util.objId(n),t[i])return t[i];for(var l in a={},t[i]=a,n)n.hasOwnProperty(l)&&(a[l]=e(n[l],t));return a;case"Array":return i=r.util.objId(n),t[i]?t[i]:(a=[],t[i]=a,n.forEach((function(n,r){a[r]=e(n,t)})),a);default:return n}},getLanguage:function(e){for(;e&&!n.test(e.className);)e=e.parentElement;return e?(e.className.match(n)||[,"none"])[1].toLowerCase():"none"},currentScript:function(){if("undefined"==typeof document)return null;if("currentScript"in document)return document.currentScript;try{throw new Error}catch(s){var e=(/at [^(\r\n]*\((.*):.+:.+\)$/i.exec(s.stack)||[])[1];if(e){var n=document.getElementsByTagName("script");for(var t in n)if(n[t].src==e)return n[t]}return null}},isActive:function(e,n,t){for(var r="no-"+n;e;){var a=e.classList;if(a.contains(n))return!0;if(a.contains(r))return!1;e=e.parentElement}return!!t}},languages:{extend:function(e,n){var t=r.util.clone(r.languages[e]);for(var a in n)t[a]=n[a];return t},insertBefore:function(e,n,t,a){var i=(a=a||r.languages)[e],l={};for(var o in i)if(i.hasOwnProperty(o)){if(o==n)for(var s in t)t.hasOwnProperty(s)&&(l[s]=t[s]);t.hasOwnProperty(o)||(l[o]=i[o])}var u=a[e];return a[e]=l,r.languages.DFS(r.languages,(function(n,t){t===u&&n!=e&&(this[n]=l)})),l},DFS:function e(n,t,a,i){i=i||{};var l=r.util.objId;for(var o in n)if(n.hasOwnProperty(o)){t.call(n,o,n[o],a||o);var s=n[o],u=r.util.type(s);"Object"!==u||i[l(s)]?"Array"!==u||i[l(s)]||(i[l(s)]=!0,e(s,t,o,i)):(i[l(s)]=!0,e(s,t,null,i))}}},plugins:{},highlightAll:function(e,n){r.highlightAllUnder(document,e,n)},highlightAllUnder:function(e,n,t){var a={callback:t,container:e,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",a),a.elements=Array.prototype.slice.apply(a.container.querySelectorAll(a.selector)),r.hooks.run("before-all-elements-highlight",a);for(var i,l=0;i=a.elements[l++];)r.highlightElement(i,!0===n,a.callback)},highlightElement:function(t,a,i){var l=r.util.getLanguage(t),o=r.languages[l];t.className=t.className.replace(n,"").replace(/\s+/g," ")+" language-"+l;var s=t.parentElement;s&&"pre"===s.nodeName.toLowerCase()&&(s.className=s.className.replace(n,"").replace(/\s+/g," ")+" language-"+l);var u={element:t,language:l,grammar:o,code:t.textContent};function c(e){u.highlightedCode=e,r.hooks.run("before-insert",u),u.element.innerHTML=u.highlightedCode,r.hooks.run("after-highlight",u),r.hooks.run("complete",u),i&&i.call(u.element)}if(r.hooks.run("before-sanity-check",u),!u.code)return r.hooks.run("complete",u),void(i&&i.call(u.element));if(r.hooks.run("before-highlight",u),u.grammar)if(a&&e.Worker){var g=new Worker(r.filename);g.onmessage=function(e){c(e.data)},g.postMessage(JSON.stringify({language:u.language,code:u.code,immediateClose:!0}))}else c(r.highlight(u.code,u.grammar,u.language));else c(r.util.encode(u.code))},highlight:function(e,n,t){var i={code:e,grammar:n,language:t};return r.hooks.run("before-tokenize",i),i.tokens=r.tokenize(i.code,i.grammar),r.hooks.run("after-tokenize",i),a.stringify(r.util.encode(i.tokens),i.language)},tokenize:function(e,n){var t=n.rest;if(t){for(var s in t)n[s]=t[s];delete n.rest}var u=new i;return l(u,u.head,e),function e(n,t,i,s,u,c){for(var g in i)if(i.hasOwnProperty(g)&&i[g]){var h=i[g];h=Array.isArray(h)?h:[h];for(var f=0;f<h.length;++f){if(c&&c.cause==g+","+f)return;var d=h[f],p=d.inside,v=!!d.lookbehind,m=!!d.greedy,y=0,k=d.alias;if(m&&!d.pattern.global){var b=d.pattern.toString().match(/[imsuy]*$/)[0];d.pattern=RegExp(d.pattern.source,b+"g")}for(var w=d.pattern||d,x=s.next,A=u;x!==t.tail&&!(c&&A>=c.reach);A+=x.value.length,x=x.next){var S=x.value;if(t.length>n.length)return;if(!(S instanceof a)){var E=1;if(m&&x!=t.tail.prev){if(w.lastIndex=A,!(N=w.exec(n)))break;var O=N.index+(v&&N[1]?N[1].length:0),P=N.index+N[0].length,j=A;for(j+=x.value.length;j<=O;)j+=(x=x.next).value.length;if(A=j-=x.value.length,x.value instanceof a)continue;for(var L=x;L!==t.tail&&(j<P||"string"==typeof L.value);L=L.next)E++,j+=L.value.length;E--,S=n.slice(A,j),N.index-=A}else{w.lastIndex=0;var N=w.exec(S)}if(N){v&&(y=N[1]?N[1].length:0);O=N.index+y;var C=N[0].slice(y),M=(P=O+C.length,S.slice(0,O)),W=S.slice(P),I=A+S.length;c&&I>c.reach&&(c.reach=I);var _=x.prev;M&&(_=l(t,_,M),A+=M.length),o(t,_,E),x=l(t,_,new a(g,p?r.tokenize(C,p):C,k,C)),W&&l(t,x,W),1<E&&e(n,t,i,x.prev,A,{cause:g+","+f,reach:I})}}}}}}(e,u,n,u.head,0),function(e){for(var n=[],t=e.head.next;t!==e.tail;)n.push(t.value),t=t.next;return n}(u)},hooks:{all:{},add:function(e,n){var t=r.hooks.all;t[e]=t[e]||[],t[e].push(n)},run:function(e,n){var t=r.hooks.all[e];if(t&&t.length)for(var a,i=0;a=t[i++];)a(n)}},Token:a};function a(e,n,t,r){this.type=e,this.content=n,this.alias=t,this.length=0|(r||"").length}function i(){var e={value:null,prev:null,next:null},n={value:null,prev:e,next:null};e.next=n,this.head=e,this.tail=n,this.length=0}function l(e,n,t){var r=n.next,a={value:t,prev:n,next:r};return n.next=a,r.prev=a,e.length++,a}function o(e,n,t){for(var r=n.next,a=0;a<t&&r!==e.tail;a++)r=r.next;(n.next=r).prev=n,e.length-=a}if(e.Prism=r,a.stringify=function e(n,t){if("string"==typeof n)return n;if(Array.isArray(n)){var a="";return n.forEach((function(n){a+=e(n,t)})),a}var i={type:n.type,content:e(n.content,t),tag:"span",classes:["token",n.type],attributes:{},language:t},l=n.alias;l&&(Array.isArray(l)?Array.prototype.push.apply(i.classes,l):i.classes.push(l)),r.hooks.run("wrap",i);var o="";for(var s in i.attributes)o+=" "+s+'="'+(i.attributes[s]||"").replace(/"/g,"&quot;")+'"';return"<"+i.tag+' class="'+i.classes.join(" ")+'"'+o+">"+i.content+"</"+i.tag+">"},!e.document)return e.addEventListener&&(r.disableWorkerMessageHandler||e.addEventListener("message",(function(n){var t=JSON.parse(n.data),a=t.language,i=t.code,l=t.immediateClose;e.postMessage(r.highlight(i,r.languages[a],a)),l&&e.close()}),!1)),r;var s=r.util.currentScript();function u(){r.manual||r.highlightAll()}if(s&&(r.filename=s.src,s.hasAttribute("data-manual")&&(r.manual=!0)),!r.manual){var c=document.readyState;"loading"===c||"interactive"===c&&s&&s.defer?document.addEventListener("DOMContentLoaded",u):window.requestAnimationFrame?window.requestAnimationFrame(u):window.setTimeout(u,16)}return r}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});e.exports&&(e.exports=t),"undefined"!=typeof n&&(n.Prism=t)}).call(this,t(36))}}]); //# sourceMappingURL=69.29176d9b.chunk.js.map
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _xeUtils = _interopRequireDefault(require("xe-utils")); var _conf = _interopRequireDefault(require("../../conf")); var _cell = _interopRequireDefault(require("../../cell")); var _vXETable = require("../../v-x-e-table"); var _tools = require("../../tools"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } var rowUniqueId = 0; var browse = _tools.DomTools.browse; var isWebkit = browse['-webkit'] && !browse['-ms']; var debounceScrollYDuration = browse.msie ? 40 : 20; var Rule = /*#__PURE__*/ function () { function Rule(rule) { _classCallCheck(this, Rule); Object.assign(this, { $options: rule, required: rule.required, min: rule.min, max: rule.min, type: rule.type, pattern: rule.pattern, validator: rule.validator, trigger: rule.trigger, maxWidth: rule.maxWidth }); } _createClass(Rule, [{ key: "message", get: function get() { return _tools.UtilTools.getFuncText(this.$options.message); } }]); return Rule; }(); function getRowUniqueId() { return "row_".concat(++rowUniqueId); } /** * 渲染浮固定列 */ function renderFixed(h, $table, fixedType) { var tableData = $table.tableData, tableColumn = $table.tableColumn, visibleColumn = $table.visibleColumn, collectColumn = $table.collectColumn, isGroup = $table.isGroup, vSize = $table.vSize, showHeader = $table.showHeader, showFooter = $table.showFooter, columnStore = $table.columnStore, footerData = $table.footerData; var fixedColumn = columnStore["".concat(fixedType, "List")]; return h('div', { class: "vxe-table--fixed-".concat(fixedType, "-wrapper"), ref: "".concat(fixedType, "Container") }, [showHeader ? h('vxe-table-header', { props: { fixedType: fixedType, tableData: tableData, tableColumn: tableColumn, visibleColumn: visibleColumn, collectColumn: collectColumn, size: vSize, fixedColumn: fixedColumn, isGroup: isGroup }, ref: "".concat(fixedType, "Header") }) : null, h('vxe-table-body', { props: { fixedType: fixedType, tableData: tableData, tableColumn: tableColumn, visibleColumn: visibleColumn, collectColumn: collectColumn, fixedColumn: fixedColumn, size: vSize, isGroup: isGroup }, ref: "".concat(fixedType, "Body") }), showFooter ? h('vxe-table-footer', { props: { fixedType: fixedType, footerData: footerData, tableColumn: tableColumn, visibleColumn: visibleColumn, size: vSize, fixedColumn: fixedColumn }, ref: "".concat(fixedType, "Footer") }) : null]); } // 分组表头的属性 var headerProps = { children: 'children' }; var _default2 = { name: 'VxeTable', props: { /** 基本属性 */ // 数据 data: Array, // 初始化绑定动态列 customs: Array, // 表格的高度 height: [Number, String], // 表格的最大高度 maxHeight: [Number, String], // 所有列是否允许拖动列宽调整大小 resizable: { type: Boolean, default: function _default() { return _conf.default.resizable; } }, // 是否带有斑马纹 stripe: { type: Boolean, default: function _default() { return _conf.default.stripe; } }, // 是否带有纵向边框 border: { type: Boolean, default: function _default() { return _conf.default.border; } }, // 表格的尺寸 size: { type: String, default: function _default() { return _conf.default.size; } }, // 列的宽度是否自撑开 fit: { type: Boolean, default: function _default() { return _conf.default.fit; } }, // 表格是否加载中 loading: Boolean, // 所有的列对其方式 align: { type: String, default: function _default() { return _conf.default.align; } }, // 所有的表头列的对齐方式 headerAlign: { type: String, default: function _default() { return _conf.default.headerAlign; } }, // 是否显示表头 showHeader: { type: Boolean, default: function _default() { return _conf.default.showHeader; } }, // 只对 type=index 时有效,自定义序号的起始值 startIndex: { type: Number, default: 0 }, // 是否要高亮当前选中行 highlightCurrentRow: { type: Boolean, default: function _default() { return _conf.default.highlightCurrentRow; } }, // 鼠标移到行是否要高亮显示 highlightHoverRow: { type: Boolean, default: function _default() { return _conf.default.highlightHoverRow; } }, // 是否要高亮当前选中列 highlightCurrentColumn: { type: Boolean, default: function _default() { return _conf.default.highlightCurrentColumn; } }, // 鼠标移到列是否要高亮显示 highlightHoverColumn: { type: Boolean, default: function _default() { return _conf.default.highlightHoverColumn; } }, // 激活单元格编辑时是否高亮显示 highlightCell: Boolean, // 是否显示表尾合计 showFooter: Boolean, // 表尾合计的计算方法 footerMethod: Function, // 给行附加 className rowClassName: [String, Function], // 给单元格附加 className cellClassName: [String, Function], // 给表头的行附加 className headerRowClassName: [String, Function], // 给表头的单元格附加 className headerCellClassName: [String, Function], // 给表尾的行附加 className footerRowClassName: [String, Function], // 给表尾的单元格附加 className footerCellClassName: [String, Function], // 合并行或列 spanMethod: Function, // 设置所有内容过长时显示为省略号 showOverflow: { type: [Boolean, String], default: function _default() { return _conf.default.showOverflow; } }, // 设置表头所有内容过长时显示为省略号 showHeaderOverflow: { type: [Boolean, String], default: function _default() { return _conf.default.showHeaderOverflow; } }, // 是否服务端筛选 remoteFilter: Boolean, // 是否服务端排序 remoteSort: Boolean, /** 高级属性 */ // 主键配置 columnKey: Boolean, rowKey: Boolean, rowId: { type: String, default: function _default() { return _conf.default.rowId; } }, // 是否自动根据父容器响应式调整表格宽高 autoResize: Boolean, // 排序配置项 sortConfig: Object, // 单选配置 radioConfig: Object, // 多选配置项 selectConfig: Object, // tooltip 配置项 tooltipConfig: Object, // 展开行配置项 expandConfig: Object, // 树形结构配置项 treeConfig: Object, // 快捷菜单配置项 contextMenu: Object, // 鼠标配置项 mouseConfig: Object, // 按键配置项 keyboardConfig: Object, // 编辑配置项 editConfig: Object, // 校验配置项 validConfig: Object, // 校验规则配置项 editRules: Object, // 优化配置项 optimization: Object }, provide: function provide() { return { $table: this }; }, data: function data() { return { id: _xeUtils.default.uniqueId(), // 列分组配置 collectColumn: [], // 完整所有列 tableFullColumn: [], // 渲染的列 tableColumn: [], // 渲染中的数据 tableData: [], // 是否启用了横向 X 可视渲染方式加载 scrollXLoad: false, // 是否启用了纵向 Y 可视渲染方式加载 scrollYLoad: false, // 是否存在纵向滚动条 overflowY: true, // 是否存在横向滚动条 overflowX: false, // 纵向滚动条的宽度 scrollbarWidth: 0, // 横向滚动条的高度 scrollbarHeight: 0, // 是否全选 isAllSelected: false, // 多选属性,有选中且非全选状态 isIndeterminate: false, // 多选属性,已选中的列 selection: [], // 当前行 currentRow: null, // 单选属性,选中行 selectRow: null, // 表尾合计数据 footerData: [], // 已展开的行 expandeds: [], // 已展开树节点 treeExpandeds: [], // 树节点不确定状态的列表 treeIndeterminates: [], // 当前选中的筛选列 filterStore: { isAllSelected: false, isIndeterminate: false, style: null, options: [], column: null, multiple: false, visible: false }, // 存放列相关的信息 columnStore: { leftList: [], centerList: [], rightList: [], resizeList: [], pxList: [], pxMinList: [], scaleList: [], scaleMinList: [], autoList: [] }, // 存放快捷菜单的信息 ctxMenuStore: { selected: null, visible: false, showChild: false, selectChild: null, list: [], style: null }, // 存放可编辑相关信息 editStore: { indexs: { columns: [] }, titles: { columns: [] }, // 所有选中 checked: { rows: [], columns: [], tRows: [], tColumns: [] }, // 选中源 selected: { row: null, column: null }, // 已复制源 copyed: { cut: false, rows: [], columns: [] }, // 激活 actived: { row: null, column: null }, insertList: [], removeList: [] }, // 存放数据校验相关信息 validStore: { visible: false, row: null, column: null, content: '', rule: null, isArrow: false } }; }, computed: { vSize: function vSize() { return this.size || this.$parent.size || this.$parent.vSize; }, validOpts: function validOpts() { return Object.assign({ message: 'default' }, _conf.default.validConfig, this.validConfig); }, optimizeOpts: function optimizeOpts() { return Object.assign({}, _conf.default.optimization, this.optimization); }, vaildTipOpts: function vaildTipOpts() { return Object.assign({ isArrow: false }, this.tooltipConfig); }, sortOpts: function sortOpts() { return Object.assign({}, _conf.default.sortConfig, this.sortConfig); }, // 是否使用了分组表头 isGroup: function isGroup() { return this.collectColumn.some(function (column) { return _tools.UtilTools.hasChildrenList(column); }); }, hasTip: function hasTip() { return _conf.default._tip; }, visibleColumn: function visibleColumn() { return this.tableFullColumn ? this.tableFullColumn.filter(function (column) { return column.visible; }) : []; }, isResizable: function isResizable() { return this.resizable || this.tableFullColumn.some(function (column) { return column.resizable; }); }, hasFilter: function hasFilter() { return this.tableColumn.some(function (column) { return column.filters && column.filters.length; }); }, headerCtxMenu: function headerCtxMenu() { return this.ctxMenuOpts.header && this.ctxMenuOpts.header.options ? this.ctxMenuOpts.header.options : []; }, bodyCtxMenu: function bodyCtxMenu() { return this.ctxMenuOpts.body && this.ctxMenuOpts.body.options ? this.ctxMenuOpts.body.options : []; }, isCtxMenu: function isCtxMenu() { return this.headerCtxMenu.length || this.bodyCtxMenu.length; }, ctxMenuOpts: function ctxMenuOpts() { return Object.assign({}, _conf.default.menu, this.contextMenu); }, ctxMenuList: function ctxMenuList() { var rest = []; this.ctxMenuStore.list.forEach(function (list) { list.forEach(function (item) { rest.push(item); }); }); return rest; } }, watch: { data: function data(value) { if (!this._isUpdateData) { this.loadData(value, true).then(this.handleDefault); } this._isUpdateData = false; }, customs: function customs(value) { if (!this.isUpdateCustoms) { this.mergeCustomColumn(value); } this.isUpdateCustoms = false; }, collectColumn: function collectColumn(value) { var tableFullColumn = _tools.UtilTools.getColumnList(value); this.tableFullColumn = tableFullColumn; this.cacheColumnMap(); if (this.customs) { this.mergeCustomColumn(this.customs); } this.refreshColumn(); this.tableData = this.getTableData(true).tableData; if (this._toolbar) { this._toolbar.updateColumn(tableFullColumn); } // 在 v3.0 中废弃 prop、label if (tableFullColumn.length) { var cIndex = Math.floor((tableFullColumn.length - 1) / 2); if (tableFullColumn[cIndex].prop) { console.warn('[vxe-table] The property prop is deprecated, please use field'); } if (tableFullColumn[cIndex].label) { console.warn('[vxe-table] The property label is deprecated, please use title'); } } }, tableColumn: function tableColumn() { this.analyColumnWidth(); }, height: function height() { this.$nextTick(this.recalculate); }, loading: function loading() { if (!this._isLoading) { this._isLoading = true; } } }, created: function created() { var _this = this; var _Object$assign = Object.assign(this, { elemStore: {}, // 存放横向 X 虚拟滚动相关的信息 scrollXStore: {}, // 存放纵向 Y 虚拟滚动相关信息 scrollYStore: {}, // 存放 tooltip 相关信息 tooltipStore: {}, // 表格父容器的高度 parentHeight: 0, // 表格宽度 tableWidth: 0, // 表格高度 tableHeight: 0, // 表头高度 headerHeight: 0, // 表尾高度 footerHeight: 0, // 单选属性,选中列 // currentColumn: null, // 当前 hover 行 // hoverRow: null, // 最后滚动位置 lastScrollLeft: 0, lastScrollTop: 0, // 完整数据、条件处理后 tableFullData: [], afterFullData: [], // 缓存数据集 fullAllDataRowMap: new Map(), fullAllDataRowIdData: {}, fullDataRowMap: new Map(), fullDataRowIdData: {}, fullColumnMap: new Map(), fullColumnIdData: {} }), scrollYStore = _Object$assign.scrollYStore, optimizeOpts = _Object$assign.optimizeOpts, data = _Object$assign.data, loading = _Object$assign.loading; var scrollY = optimizeOpts.scrollY; // 是否加载过 Loading 模块 this._isLoading = loading; if (scrollY) { Object.assign(scrollYStore, { startIndex: 0, visibleIndex: 0, adaptive: _xeUtils.default.isBoolean(scrollY.adaptive) ? scrollY.adaptive : true, renderSize: scrollY.rSize, offsetSize: scrollY.oSize }); } if (!_tools.UtilTools.getRowkey(this)) { console.error('[vxe-table] The property row-id is not allowed to be empty'); } this.loadData(data, true).then(function () { _this.handleDefault(); _this.updateStyle(); }); _tools.GlobalEvent.on(this, 'mousedown', this.handleGlobalMousedownEvent); _tools.GlobalEvent.on(this, 'blur', this.handleGlobalBlurEvent); _tools.GlobalEvent.on(this, 'contextmenu', this.handleGlobalContextmenuEvent); _tools.GlobalEvent.on(this, 'mousewheel', this.handleGlobalMousewheelEvent); _tools.GlobalEvent.on(this, 'keydown', this.handleGlobalKeydownEvent); _tools.GlobalEvent.on(this, 'resize', this.handleGlobalResizeEvent); }, mounted: function mounted() { if (this.autoResize) { _tools.ResizeEvent.on(this, this.$el.parentNode, this.recalculate); } document.body.appendChild(this.$refs.tableWrapper); }, activated: function activated() { this.scrollTo(this.lastScrollLeft, this.lastScrollTop); }, beforeDestroy: function beforeDestroy() { var tableWrapper = this.$refs.tableWrapper; if (tableWrapper && tableWrapper.parentNode) { tableWrapper.parentNode.removeChild(tableWrapper); } if (_tools.ResizeEvent.off) { _tools.ResizeEvent.off(this, this.$el.parentNode); } this.afterFullData.length = 0; this.fullAllDataRowMap.clear(); this.fullDataRowMap.clear(); this.fullColumnMap.clear(); this.closeFilter(); this.closeMenu(); }, destroyed: function destroyed() { _tools.GlobalEvent.off(this, 'mousedown'); _tools.GlobalEvent.off(this, 'blur'); _tools.GlobalEvent.off(this, 'contextmenu'); _tools.GlobalEvent.off(this, 'mousewheel'); _tools.GlobalEvent.off(this, 'keydown'); _tools.GlobalEvent.off(this, 'resize'); }, render: function render(h) { var _class; var _e = this._e, id = this.id, tableData = this.tableData, tableColumn = this.tableColumn, visibleColumn = this.visibleColumn, collectColumn = this.collectColumn, isGroup = this.isGroup, hasFilter = this.hasFilter, isResizable = this.isResizable, isCtxMenu = this.isCtxMenu, loading = this.loading, _isLoading = this._isLoading, showHeader = this.showHeader, border = this.border, stripe = this.stripe, height = this.height, highlightHoverRow = this.highlightHoverRow, highlightHoverColumn = this.highlightHoverColumn, highlightCell = this.highlightCell, vSize = this.vSize, showOverflow = this.showOverflow, showHeaderOverflow = this.showHeaderOverflow, editConfig = this.editConfig, validOpts = this.validOpts, _this$mouseConfig = this.mouseConfig, mouseConfig = _this$mouseConfig === void 0 ? {} : _this$mouseConfig, editRules = this.editRules, showFooter = this.showFooter, footerMethod = this.footerMethod, overflowX = this.overflowX, overflowY = this.overflowY, scrollbarHeight = this.scrollbarHeight, optimizeOpts = this.optimizeOpts, vaildTipOpts = this.vaildTipOpts, tooltipConfig = this.tooltipConfig, columnStore = this.columnStore, filterStore = this.filterStore, ctxMenuStore = this.ctxMenuStore, footerData = this.footerData, hasTip = this.hasTip; var leftList = columnStore.leftList, rightList = columnStore.rightList; return h('div', { class: (_class = { 'vxe-table': 1 }, _defineProperty(_class, "size--".concat(vSize), vSize), _defineProperty(_class, 'vxe-editable', editConfig), _defineProperty(_class, 'show--head', showHeader), _defineProperty(_class, 'show--foot', showFooter), _defineProperty(_class, 'scroll--y', overflowY), _defineProperty(_class, 'scroll--x', overflowX), _defineProperty(_class, 'fixed--left', leftList.length), _defineProperty(_class, 'fixed--right', rightList.length), _defineProperty(_class, 'all-overflow', showOverflow), _defineProperty(_class, 'all-head-overflow', showHeaderOverflow), _defineProperty(_class, 'c--highlight', highlightCell), _defineProperty(_class, 't--animat', optimizeOpts.animat), _defineProperty(_class, 't--stripe', stripe), _defineProperty(_class, 't--border', border), _defineProperty(_class, 't--checked', mouseConfig.checked), _defineProperty(_class, 'is--loading', loading), _defineProperty(_class, 'row--highlight', highlightHoverRow), _defineProperty(_class, 'column--highlight', highlightHoverColumn), _class) }, [ /** * 隐藏列 */ h('div', { class: 'vxe-table-hidden-column', ref: 'hideColumn' }, this.$slots.default), /** * 主头部 */ showHeader ? h('vxe-table-header', { ref: 'tableHeader', props: { tableData: tableData, tableColumn: tableColumn, visibleColumn: visibleColumn, collectColumn: collectColumn, size: vSize, isGroup: isGroup } }) : _e(), /** * 主内容 */ h('vxe-table-body', { ref: 'tableBody', props: { tableData: tableData, tableColumn: tableColumn, visibleColumn: visibleColumn, collectColumn: collectColumn, size: vSize, isGroup: isGroup } }), /** * 底部汇总 */ showFooter ? h('vxe-table-footer', { props: { footerData: footerData, footerMethod: footerMethod, tableColumn: tableColumn, visibleColumn: visibleColumn, size: vSize }, ref: 'tableFooter' }) : _e(), /** * 左侧固定列 */ leftList && leftList.length && overflowX ? renderFixed(h, this, 'left') : _e(), /** * 右侧固定列 */ rightList && rightList.length && overflowX ? renderFixed(h, this, 'right') : _e(), /** * 列宽线 */ isResizable ? h('div', { class: 'vxe-table--resizable-bar', style: overflowX ? { 'padding-bottom': "".concat(scrollbarHeight, "px") } : null, ref: 'resizeBar' }) : _e(), /** * 加载中 */ _isLoading ? h('vxe-table-loading', { props: { visible: loading } }) : _e(), h('div', { class: "vxe-table".concat(id, "-wrapper ").concat(this.$vnode.data.staticClass || ''), ref: 'tableWrapper' }, [ /** * 筛选 */ hasFilter ? h('vxe-table-filter', { props: { optimizeOpts: optimizeOpts, filterStore: filterStore }, ref: 'filterWrapper' }) : _e(), /** * 快捷菜单 */ isCtxMenu ? h('vxe-table-context-menu', { props: { ctxMenuStore: ctxMenuStore }, ref: 'ctxWrapper' }) : _e(), /** * Ellipsis tooltip */ hasTip ? h('vxe-tooltip', { ref: 'tooltip', props: tooltipConfig }) : _e(), /** * valid error tooltip */ hasTip && editRules && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip') ? h('vxe-tooltip', { class: 'vxe-table--valid-error', props: validOpts.message === 'tooltip' || tableData.length === 1 ? vaildTipOpts : null, ref: 'validTip' }) : _e()])]); }, methods: { clearAll: function clearAll() { this.clearScroll(); this.clearSort(); this.clearFilter(); this.clearCurrentRow(); this.clearCurrentColumn(); this.clearSelection(); this.clearRowExpand(); this.clearTreeExpand(); this.clearIndexChecked(); this.clearHeaderChecked(); this.clearChecked(); this.clearSelected(); this.clearCopyed(); return this.clearActived(); }, refreshData: function refreshData() { var _this2 = this; return this.$nextTick().then(function () { _this2.tableData = []; return _this2.$nextTick().then(function () { return _this2.loadData(_this2.tableFullData); }); }); }, updateData: function updateData() { return this.handleData(true).then(this.recalculate); }, handleData: function handleData(force) { this.tableData = this.getTableData(force).tableData; return this.$nextTick(); }, loadData: function loadData(datas, notRefresh) { var _this3 = this; var height = this.height, maxHeight = this.maxHeight, editStore = this.editStore, optimizeOpts = this.optimizeOpts, recalculate = this.recalculate; var scrollY = optimizeOpts.scrollY; var tableFullData = datas ? datas.slice(0) : []; var scrollYLoad = scrollY && scrollY.gt && scrollY.gt < tableFullData.length; editStore.insertList = []; editStore.removeList = []; // 全量数据 this.tableFullData = tableFullData; // 缓存数据 this.updateCache(true); // 原始数据 this.tableSourceData = _xeUtils.default.clone(tableFullData, true); this.scrollYLoad = scrollYLoad; if (scrollYLoad && !(height || maxHeight)) { throw new Error('[vxe-table] The height/max-height must be set for the scroll load.'); } this.handleData(true); this.reserveCheckSelection(); this.checkSelectionStatus(); var rest = this.$nextTick(); if (!notRefresh) { rest = rest.then(recalculate); } return rest.then(function () { // 如果启用虚拟滚动,重新加载数据需要重置滚动条 if (_this3.scrollXLoad || _this3.scrollYLoad) { _this3.clearScroll(); } }); }, reloadData: function reloadData(datas) { this.clearAll(); return this.loadData(datas).then(this.handleDefault); }, loadColumn: function loadColumn(columns) { var _this4 = this; this.collectColumn = _xeUtils.default.mapTree(columns, function (column) { return _cell.default.createColumn(_this4, column); }, headerProps); return this.$nextTick(); }, reloadColumn: function reloadColumn(columns) { this.clearAll(); return this.loadColumn(columns); }, // 更新数据的 Map updateCache: function updateCache(source) { var _this5 = this; var treeConfig = this.treeConfig, tableFullData = this.tableFullData, fullDataRowIdData = this.fullDataRowIdData, fullDataRowMap = this.fullDataRowMap, fullAllDataRowMap = this.fullAllDataRowMap, fullAllDataRowIdData = this.fullAllDataRowIdData; var rowkey = _tools.UtilTools.getRowkey(this); var handleCache = function handleCache(row, index) { var rowid = _tools.UtilTools.getRowid(_this5, row); if (!rowid) { rowid = getRowUniqueId(); _xeUtils.default.set(row, rowkey, rowid); } var rest = { row: row, rowid: rowid, index: index }; if (source) { fullDataRowIdData[rowid] = rest; fullDataRowMap.set(row, rest); } fullAllDataRowIdData[rowid] = rest; fullAllDataRowMap.set(row, rest); }; if (source) { fullDataRowIdData = this.fullDataRowIdData = {}; fullDataRowMap.clear(); } fullAllDataRowIdData = this.fullAllDataRowIdData = {}; fullAllDataRowMap.clear(); if (treeConfig) { _xeUtils.default.eachTree(tableFullData, handleCache, treeConfig); } else { tableFullData.forEach(handleCache); } }, // 更新列的 Map cacheColumnMap: function cacheColumnMap() { var tableFullColumn = this.tableFullColumn, fullColumnMap = this.fullColumnMap; var fullColumnIdData = this.fullColumnIdData = {}; fullColumnMap.clear(); tableFullColumn.forEach(function (column, index) { var rest = { column: column, colid: column.id, index: index }; fullColumnIdData[column.id] = rest; fullColumnMap.set(column, rest); }); }, getRowNode: function getRowNode(tr) { var _this6 = this; if (tr) { var treeConfig = this.treeConfig, tableFullData = this.tableFullData, fullAllDataRowIdData = this.fullAllDataRowIdData; var rowid = tr.getAttribute('data-rowid'); if (treeConfig) { var matchObj = _xeUtils.default.findTree(tableFullData, function (row) { return _tools.UtilTools.getRowid(_this6, row) === rowid; }, treeConfig); if (matchObj) { return matchObj; } } else { if (fullAllDataRowIdData[rowid]) { var rest = fullAllDataRowIdData[rowid]; return { item: rest.row, index: rest.index, items: tableFullData }; } } } return null; }, getColumnNode: function getColumnNode(cell) { if (cell) { var isGroup = this.isGroup, fullColumnIdData = this.fullColumnIdData, tableFullColumn = this.tableFullColumn; var colid = cell.getAttribute('data-colid'); if (isGroup) { var matchObj = _xeUtils.default.findTree(tableFullColumn, function (column) { return column.id === colid; }, headerProps); if (matchObj) { return matchObj; } } else { var _fullColumnIdData$col = fullColumnIdData[colid], column = _fullColumnIdData$col.column, index = _fullColumnIdData$col.index; return { item: column, index: index, items: tableFullColumn }; } } return null; }, getRowIndex: function getRowIndex(row) { return this.fullDataRowMap.has(row) ? this.fullDataRowMap.get(row).index : -1; }, getColumnIndex: function getColumnIndex(column) { return this.fullColumnMap.has(column) ? this.fullColumnMap.get(column).index : -1; }, hasIndexColumn: function hasIndexColumn(column) { return column && column.type === 'index'; }, insert: function insert(records) { return this.insertAt(records); }, /** * 从指定行插入数据 */ insertAt: function insertAt(records, row) { var _this7 = this; var tableData = this.tableData, editStore = this.editStore, scrollYLoad = this.scrollYLoad, tableFullData = this.tableFullData, treeConfig = this.treeConfig; var args = arguments; if (!_xeUtils.default.isArray(records)) { records = [records]; } var newRecords = records.map(this.createRow); return new Promise(function (resolve) { if (args.length === 1) { tableData.unshift.apply(tableData, newRecords); tableFullData.unshift.apply(tableFullData, newRecords); if (scrollYLoad) { _this7.updateAfterFullData(); } } else { if (scrollYLoad) { throw new Error('[vxe-table] Virtual scroller does not support this operation.'); } if (!row || row === -1) { tableData.push.apply(tableData, newRecords); tableFullData.push.apply(tableFullData, newRecords); } else { if (treeConfig) { throw new Error('[vxe-table] The tree table does not support this operation.'); } tableData.splice.apply(tableData, [tableData.indexOf(row), 0].concat(newRecords)); tableFullData.splice.apply(tableFullData, [tableFullData.indexOf(row), 0].concat(newRecords)); } } [].unshift.apply(editStore.insertList, newRecords); _this7.updateCache(); _this7.checkSelectionStatus(); _this7.$nextTick(function () { _this7.recalculate(); resolve({ row: newRecords.length ? newRecords[newRecords.length - 1] : null, rows: newRecords }); }); }); }, defineField: function defineField(row) { var rowkey = _tools.UtilTools.getRowkey(this); this.visibleColumn.forEach(function (column) { if (column.property && !_xeUtils.default.has(row, column.property)) { _xeUtils.default.set(row, column.property, null); } }); // 必须有行数据的唯一主键,可以自行设置;也可以默认生成一个随机数 if (!_xeUtils.default.get(row, rowkey)) { _xeUtils.default.set(row, rowkey, getRowUniqueId()); } return row; }, createData: function createData(records) { var _this8 = this; return this.$nextTick().then(function () { return records.map(_this8.defineField); }); }, createRow: function createRow(records) { var _this9 = this; var isArr = _xeUtils.default.isArray(records); if (!isArr) { records = [records]; } return this.$nextTick().then(function () { var rows = records.map(function (record) { return _this9.defineField(Object.assign({}, record)); }); return isArr ? rows : rows[0]; }); }, /** * 删除指定行数据 * 如果传 row 则删除一行 * 如果传 rows 则删除多行 */ remove: function remove(rows) { var _this10 = this; var tableData = this.tableData, tableFullData = this.tableFullData, editStore = this.editStore, treeConfig = this.treeConfig, _this$selectConfig = this.selectConfig, selectConfig = _this$selectConfig === void 0 ? {} : _this$selectConfig, selection = this.selection, hasRowInsert = this.hasRowInsert; var removeList = editStore.removeList, insertList = editStore.insertList; var property = selectConfig.checkField; var rest = []; if (rows) { if (!_xeUtils.default.isArray(rows)) { rows = [rows]; } if (treeConfig) { rows.forEach(function (row) { var matchObj = _xeUtils.default.findTree(tableFullData, function (item) { return item === row; }, treeConfig); if (matchObj) { var item = matchObj.item, items = matchObj.items, index = matchObj.index; // 如果是新增,则保存记录 if (!hasRowInsert(item)) { removeList.push(item); } // 从树节点中移除 var restRow = items.splice(index, 1)[0]; // 如果绑定了多选属性,则更新状态 if (!property) { _xeUtils.default.remove(selection, function (row) { return rows.indexOf(row) > -1; }); } rest.push(restRow); } }); } else { // 如果是新增,则保存记录 rows.forEach(function (row) { if (!hasRowInsert(row)) { removeList.push(row); } }); // 从数据源中移除 rest = _xeUtils.default.remove(tableFullData, function (row) { return rows.indexOf(row) > -1; }); // 如果绑定了多选属性,则更新状态 if (!property) { _xeUtils.default.remove(selection, function (row) { return rows.indexOf(row) > -1; }); } // 从列表中移除 _xeUtils.default.remove(tableData, function (row) { return rows.indexOf(row) > -1; }); } _xeUtils.default.remove(insertList, function (row) { return rows.indexOf(row) > -1; }); } this.updateCache(); this.checkSelectionStatus(); return this.$nextTick().then(function () { _this10.recalculate(); return { row: rows && rows.length ? rows[rows.length - 1] : null, rows: rest }; }); }, /** * 删除选中数据 */ removeSelecteds: function removeSelecteds() { var _this11 = this; return this.remove(this.getSelectRecords()).then(function (params) { _this11.clearSelection(); return params; }); }, /** * 还原数据 * 如果不传任何参数,则还原整个表格 * 如果传 row 则还原一行 * 如果传 rows 则还原多行 * 如果还额外传了 field 则还原指定单元格 */ revert: function revert(rows, field) { var tableSourceData = this.tableSourceData, getRowIndex = this.getRowIndex; if (arguments.length) { if (rows && !_xeUtils.default.isArray(rows)) { rows = [rows]; } rows.forEach(function (row) { var rowIndex = getRowIndex(row); var oRow = tableSourceData[rowIndex]; if (oRow && row) { if (field) { _xeUtils.default.set(row, field, _xeUtils.default.get(oRow, field)); } else { _xeUtils.default.destructuring(row, oRow); } } }); return this.$nextTick(); } return this.reloadData(tableSourceData); }, /** * 清空单元格内容 * 如果不创参数,则清空整个表格内容 * 如果传 row 则清空一行内容 * 如果传 rows 则清空多行内容 * 如果还额外传了 field 则清空指定单元格内容 */ clearData: function clearData(rows, field) { var tableFullData = this.tableFullData, visibleColumn = this.visibleColumn; if (!arguments.length) { rows = tableFullData; } else if (rows && !_xeUtils.default.isArray(rows)) { rows = [rows]; } if (field) { rows.forEach(function (row) { return _xeUtils.default.set(row, field, null); }); } else { rows.forEach(function (row) { visibleColumn.forEach(function (column) { if (column.property) { _tools.UtilTools.setCellValue(row, column, null); } }); }); } return this.$nextTick(); }, hasRowInsert: function hasRowInsert(row) { return this.editStore.insertList.indexOf(row) > -1; }, hasRowChange: function hasRowChange(row, field) { var _this12 = this; var oRow, property; var visibleColumn = this.visibleColumn, treeConfig = this.treeConfig, tableSourceData = this.tableSourceData, fullDataRowIdData = this.fullDataRowIdData; var rowid = _tools.UtilTools.getRowid(this, row); // 新增的数据不需要检测 if (!fullDataRowIdData[rowid]) { return false; } if (treeConfig) { var children = treeConfig.children; var matchObj = _xeUtils.default.findTree(tableSourceData, function (item) { return rowid === _tools.UtilTools.getRowid(_this12, item); }, treeConfig); row = Object.assign({}, row, _defineProperty({}, children, null)); if (matchObj) { oRow = Object.assign({}, matchObj.item, _defineProperty({}, children, null)); } } else { var oRowIndex = fullDataRowIdData[rowid].index; oRow = tableSourceData[oRowIndex]; } if (oRow) { if (arguments.length > 1) { return !_xeUtils.default.isEqual(_xeUtils.default.get(oRow, field), _xeUtils.default.get(row, field)); } for (var index = 0, len = visibleColumn.length; index < len; index++) { property = visibleColumn[index].property; if (property && !_xeUtils.default.isEqual(_xeUtils.default.get(oRow, property), _xeUtils.default.get(row, property))) { return true; } } } return false; }, /** * 获取表格所有列 */ getColumns: function getColumns(columnIndex) { var columns = this.visibleColumn; return arguments.length ? columns[columnIndex] : columns.slice(0); }, getColumnById: function getColumnById(colid) { var fullColumnIdData = this.fullColumnIdData; return fullColumnIdData[colid] ? fullColumnIdData[colid].column : null; }, getColumnByField: function getColumnByField(field) { return this.visibleColumn.find(function (column) { return column.property === field; }); }, /** * 获取表格可视列 */ getTableColumn: function getTableColumn() { return { fullColumn: this.tableFullColumn.slice(0), visibleColumn: this.visibleColumn.slice(0), tableColumn: this.tableColumn.slice(0) }; }, // 在 v3.0 中废弃 getRecords getRecords: function getRecords() { console.warn('[vxe-table] The function getRecords is deprecated, please use getData'); return this.getData.apply(this, arguments); }, /** * 获取表格所有数据 */ getData: function getData(rowIndex) { var tableFullData = this.tableFullData; return arguments.length ? tableFullData[rowIndex] : tableFullData.slice(0); }, // 在 v3.0 中废弃 getAllRecords getAllRecords: function getAllRecords() { console.warn('[vxe-table] The function getAllRecords is deprecated, please use getRecordset'); return this.getRecordset(); }, /** * 获取表格数据集 */ getRecordset: function getRecordset() { return { insertRecords: this.getInsertRecords(), removeRecords: this.getRemoveRecords(), updateRecords: this.getUpdateRecords() }; }, /** * 获取新增数据 */ getInsertRecords: function getInsertRecords() { return this.editStore.insertList; }, /** * 获取删除数据 */ getRemoveRecords: function getRemoveRecords() { return this.editStore.removeList; }, /** * 获取选中数据 */ getSelectRecords: function getSelectRecords() { var tableFullData = this.tableFullData, editStore = this.editStore, treeConfig = this.treeConfig, _this$selectConfig2 = this.selectConfig, selectConfig = _this$selectConfig2 === void 0 ? {} : _this$selectConfig2; var property = selectConfig.checkField; var rowList = []; var insList = []; if (property) { if (treeConfig) { rowList = _xeUtils.default.filterTree(tableFullData, function (row) { return _xeUtils.default.get(row, property); }, treeConfig); } else { rowList = tableFullData.filter(function (row) { return _xeUtils.default.get(row, property); }); } insList = editStore.insertList.filter(function (row) { return _xeUtils.default.get(row, property); }); } else { var selection = this.selection; if (treeConfig) { rowList = _xeUtils.default.filterTree(tableFullData, function (row) { return selection.indexOf(row) > -1; }, treeConfig); } else { rowList = tableFullData.filter(function (row) { return selection.indexOf(row) > -1; }); } insList = editStore.insertList.filter(function (row) { return selection.indexOf(row) > -1; }); } return rowList.concat(insList); }, /** * 获取更新数据 * 只精准匹配 row 的更改 * 如果是树表格,子节点更改状态不会影响父节点的更新状态 */ getUpdateRecords: function getUpdateRecords() { var tableFullData = this.tableFullData, hasRowChange = this.hasRowChange, treeConfig = this.treeConfig; if (treeConfig) { return _xeUtils.default.filterTree(tableFullData, function (row) { return hasRowChange(row); }, treeConfig); } return tableFullData.filter(function (row) { return hasRowChange(row); }); }, /** * 获取处理后全量的表格数据 * 如果存在筛选条件,继续处理 */ updateAfterFullData: function updateAfterFullData() { var visibleColumn = this.visibleColumn, tableFullData = this.tableFullData, remoteSort = this.remoteSort, remoteFilter = this.remoteFilter; var column = visibleColumn.find(function (column) { return column.order; }); var tableData = tableFullData; var filterColumn = visibleColumn.filter(function (_ref) { var filters = _ref.filters; return filters && filters.length; }); tableData = tableData.filter(function (row) { return filterColumn.every(function (column) { var filters = column.filters, filterRender = column.filterRender; var compConf = filterRender ? _vXETable.Renderer.get(filterRender.name) : null; var valueList = []; var itemList = []; if (filters && filters.length) { filters.forEach(function (item) { if (item.checked) { itemList.push(item); valueList.push(item.value); } }); if (valueList.length && !remoteFilter) { var property = column.property, filterMethod = column.filterMethod; if (!filterMethod && compConf && compConf.renderFilter) { filterMethod = compConf.filterMethod; } return filterMethod ? itemList.some(function (item) { return filterMethod({ value: item.value, option: item, row: row, column: column }); }) : valueList.indexOf(_xeUtils.default.get(row, property)) > -1; } } return true; }); }); if (column && column.order) { var isRemote = _xeUtils.default.isBoolean(column.remoteSort) ? column.remoteSort : remoteSort; if (!isRemote) { var rest = _xeUtils.default.sortBy(tableData, column.property); tableData = column.order === 'desc' ? rest.reverse() : rest; } } this.afterFullData = tableData; return tableData; }, getRowById: function getRowById(rowid) { var fullDataRowIdData = this.fullDataRowIdData; return fullDataRowIdData[rowid] ? fullDataRowIdData[rowid].row : null; }, /** * 获取处理后的表格数据 * 如果存在筛选条件,继续处理 * 如果存在排序,继续处理 */ getTableData: function getTableData(force) { var tableFullData = this.tableFullData, scrollYLoad = this.scrollYLoad, scrollYStore = this.scrollYStore; var fullData = force ? this.updateAfterFullData() : this.afterFullData; return { fullData: tableFullData.slice(0), visibleData: fullData, tableData: scrollYLoad ? fullData.slice(scrollYStore.startIndex, scrollYStore.startIndex + scrollYStore.renderSize) : fullData.slice(0) }; }, handleDefault: function handleDefault() { if (this.selectConfig) { this.handleSelectionDefChecked(); } if (this.radioConfig) { this.handleRadioDefChecked(); } if (this.expandConfig) { this.handleDefaultRowExpand(); } if (this.treeConfig) { this.handleDefaultTreeExpand(); } this.updateFooter(); this.$nextTick(this.recalculate); }, /** * 动态列处理 */ mergeCustomColumn: function mergeCustomColumn(customColumns) { var tableFullColumn = this.tableFullColumn; this.isUpdateCustoms = true; if (customColumns.length) { tableFullColumn.forEach(function (column) { // 在 v3.0 中废弃 prop var item = customColumns.find(function (item) { return column.property && (item.field || item.prop) === column.property; }); if (item) { if (_xeUtils.default.isNumber(item.resizeWidth)) { column.resizeWidth = item.resizeWidth; } if (_xeUtils.default.isBoolean(item.visible)) { column.visible = item.visible; } } }); } this.$emit('update:customs', tableFullColumn); }, resetAll: function resetAll() { this.resetCustoms(); this.resetResizable(); }, hideColumn: function hideColumn(column) { return this.handleVisibleColumn(column, false); }, showColumn: function showColumn(column) { return this.handleVisibleColumn(column, true); }, resetCustoms: function resetCustoms() { return this.handleVisibleColumn(); }, handleVisibleColumn: function handleVisibleColumn(column, visible) { if (arguments.length) { column.visible = visible; } else { this.tableFullColumn.forEach(function (column) { column.visible = true; }); } if (this._toolbar) { this._toolbar.updateSetting(); } return this.$nextTick(); }, /** * 初始化加载动态列 */ reloadCustoms: function reloadCustoms(customColumns) { var _this13 = this; return this.$nextTick().then(function () { _this13.mergeCustomColumn(customColumns); return _this13.refreshColumn().then(function () { return _this13.tableFullColumn; }); }); }, /** * 刷新列信息 * 将固定的列左边、右边分别靠边 * 如果使用了分组表头,固定列必须在左侧或者右侧 */ refreshColumn: function refreshColumn() { var _this14 = this; var isColspan; var letIndex = 0; var leftList = []; var leftStartIndex = null; var rightEndIndex = null; var centerList = []; var rightList = []; var tableFullColumn = this.tableFullColumn, isGroup = this.isGroup, columnStore = this.columnStore, scrollXStore = this.scrollXStore, optimizeOpts = this.optimizeOpts; var scrollX = optimizeOpts.scrollX; // 如果是分组表头,如果子列全部被隐藏,则根列也隐藏 if (isGroup) { _xeUtils.default.eachTree(this.collectColumn, function (column) { if (column.children && column.children.length) { column.visible = !!_xeUtils.default.findTree(column.children, function (subColumn) { return subColumn.children && subColumn.children.length ? 0 : subColumn.visible; }, headerProps); } }, headerProps); } // 重新分配列 tableFullColumn.filter(function (column) { return column.visible; }).forEach(function (column, columnIndex) { if (column.fixed === 'left') { if (leftStartIndex === null) { leftStartIndex = letIndex; } if (!isColspan) { if (columnIndex - letIndex !== 0) { isColspan = true; } else { letIndex++; } } leftList.push(column); } else if (column.fixed === 'right') { if (!isColspan) { if (rightEndIndex === null) { rightEndIndex = columnIndex; } if (columnIndex - rightEndIndex !== 0) { isColspan = true; } else { rightEndIndex++; } } rightList.push(column); } else { centerList.push(column); } }); var visibleColumn = leftList.concat(centerList).concat(rightList); var scrollXLoad = scrollX && scrollX.gt && scrollX.gt < tableFullColumn.length; Object.assign(columnStore, { leftList: leftList, centerList: centerList, rightList: rightList }); if (isGroup && (isColspan || leftStartIndex || rightEndIndex !== null && rightEndIndex !== visibleColumn.length)) { throw new Error('[vxe-table] Fixed column must to the left and right sides.'); } if (scrollXLoad) { Object.assign(scrollXStore, { startIndex: 0, visibleIndex: 0, adaptive: _xeUtils.default.isBoolean(scrollX.adaptive) ? scrollX.adaptive : true, renderSize: scrollX.rSize, offsetSize: scrollX.oSize }); visibleColumn = visibleColumn.slice(scrollXStore.startIndex, scrollXStore.startIndex + scrollXStore.renderSize); } this.scrollXLoad = scrollXLoad; this.tableColumn = visibleColumn; return this.$nextTick().then(function () { _this14.updateFooter(); _this14.recalculate(true); }); }, /** * 指定列宽的列进行拆分 */ analyColumnWidth: function analyColumnWidth() { var resizeList = []; var pxList = []; var pxMinList = []; var scaleList = []; var scaleMinList = []; var autoList = []; this.tableFullColumn.forEach(function (column) { if (column.visible) { if (column.resizeWidth) { resizeList.push(column); } else if (_tools.DomTools.isPx(column.width)) { pxList.push(column); } else if (_tools.DomTools.isScale(column.width)) { scaleList.push(column); } else if (_tools.DomTools.isPx(column.minWidth)) { pxMinList.push(column); } else if (_tools.DomTools.isScale(column.minWidth)) { scaleMinList.push(column); } else { autoList.push(column); } } }); Object.assign(this.columnStore, { resizeList: resizeList, pxList: pxList, pxMinList: pxMinList, scaleList: scaleList, scaleMinList: scaleMinList, autoList: autoList }); }, /** * 计算单元格列宽,动态分配可用剩余空间 * 支持 width=? width=?px width=?% min-width=? min-width=?px min-width=?% */ recalculate: function recalculate(refull) { var _this15 = this; var _this$$refs = this.$refs, tableBody = _this$$refs.tableBody, tableHeader = _this$$refs.tableHeader, tableFooter = _this$$refs.tableFooter; var bodyElem = tableBody ? tableBody.$el : null; var headerElem = tableHeader ? tableHeader.$el : null; var footerElem = tableFooter ? tableFooter.$el : null; if (bodyElem) { this.autoCellWidth(headerElem, bodyElem, footerElem); if (refull === true) { // 初始化时需要在列计算之后再执行优化运算,达到最优显示效果 return this.computeScrollLoad().then(function () { _this15.autoCellWidth(headerElem, bodyElem, footerElem); _this15.computeScrollLoad(); }); } } return this.computeScrollLoad(); }, // 列宽计算 autoCellWidth: function autoCellWidth(headerElem, bodyElem, footerElem) { var meanWidth; var tableWidth = 0; var minCellWidth = 40; // 列宽最少限制 40px var bodyWidth = bodyElem.clientWidth; var remainWidth = bodyWidth; var $el = this.$el, fit = this.fit, columnStore = this.columnStore; var resizeList = columnStore.resizeList, pxMinList = columnStore.pxMinList, pxList = columnStore.pxList, scaleList = columnStore.scaleList, scaleMinList = columnStore.scaleMinList, autoList = columnStore.autoList; // 最小宽 pxMinList.forEach(function (column) { var minWidth = parseInt(column.minWidth); tableWidth += minWidth; column.renderWidth = minWidth; }); // 最小百分比 meanWidth = remainWidth / 100; scaleMinList.forEach(function (column) { var scaleWidth = Math.floor(parseInt(column.minWidth) * meanWidth); tableWidth += scaleWidth; column.renderWidth = scaleWidth; }); // 固定百分比 scaleList.forEach(function (column) { var scaleWidth = Math.floor(parseInt(column.width) * meanWidth); tableWidth += scaleWidth; column.renderWidth = scaleWidth; }); // 固定宽 pxList.forEach(function (column) { var width = parseInt(column.width); tableWidth += width; column.renderWidth = width; }); // 调整了列宽 resizeList.forEach(function (column) { var width = parseInt(column.resizeWidth); tableWidth += width; column.renderWidth = width; }); remainWidth -= tableWidth; meanWidth = remainWidth > 0 ? Math.floor(remainWidth / (scaleMinList.length + pxMinList.length + autoList.length)) : 0; if (fit) { if (remainWidth > 0) { scaleMinList.concat(pxMinList).forEach(function (column) { tableWidth += meanWidth; column.renderWidth += meanWidth; }); } } else { meanWidth = minCellWidth; } // 自适应 autoList.forEach(function (column, index) { var width = Math.max(meanWidth, minCellWidth); column.renderWidth = width; tableWidth += width; if (fit && index === autoList.length - 1) { // 如果所有列足够放的情况下,修补列之间的误差 var odiffer = bodyWidth - tableWidth; if (odiffer > 0) { column.renderWidth += odiffer; tableWidth = bodyWidth; } } }); var tableHeight = bodyElem.offsetHeight; var overflowY = bodyElem.scrollHeight > bodyElem.clientHeight; this.scrollbarWidth = overflowY ? bodyElem.offsetWidth - bodyWidth : 0; this.overflowY = overflowY; this.tableWidth = tableWidth; this.tableHeight = tableHeight; this.parentHeight = $el.parentNode.clientHeight; if (headerElem) { this.headerHeight = headerElem.offsetHeight; } if (footerElem) { var footerHeight = footerElem.offsetHeight; this.scrollbarHeight = Math.max(footerHeight - footerElem.clientHeight, 0); this.overflowX = tableWidth > footerElem.clientWidth; this.footerHeight = footerHeight; } else { this.scrollbarHeight = Math.max(tableHeight - bodyElem.clientHeight, 0); this.overflowX = tableWidth > bodyWidth; } if (this.overflowX) { this.checkScrolling(); } }, resetResizable: function resetResizable() { this.visibleColumn.forEach(function (column) { column.resizeWidth = 0; }); if (this._toolbar) { this._toolbar.resetResizable(); } this.analyColumnWidth(); return this.recalculate(true); }, updateStyle: function updateStyle() { var $refs = this.$refs, fullColumnIdData = this.fullColumnIdData, maxHeight = this.maxHeight, height = this.height, parentHeight = this.parentHeight, border = this.border, tableColumn = this.tableColumn, headerHeight = this.headerHeight, allColumnHeaderOverflow = this.showHeaderOverflow, showFooter = this.showFooter, allColumnOverflow = this.showOverflow, footerHeight = this.footerHeight, tableHeight = this.tableHeight, tableWidth = this.tableWidth, overflowY = this.overflowY, scrollbarHeight = this.scrollbarHeight, scrollbarWidth = this.scrollbarWidth, scrollXLoad = this.scrollXLoad, columnStore = this.columnStore, elemStore = this.elemStore, currentRow = this.currentRow; var containerList = ['main', 'left', 'right']; var customHeight = height === 'auto' ? parentHeight : _tools.DomTools.isScale(height) ? Math.floor(parseInt(height) / 100 * parentHeight) : _xeUtils.default.toNumber(height); containerList.forEach(function (name, index) { var fixedType = index > 0 ? name : ''; var layoutList = ['header', 'body', 'footer']; var fixedColumn = columnStore["".concat(fixedType, "List")]; var fixedWrapperElem = $refs["".concat(fixedType, "Container")]; layoutList.forEach(function (layout) { var wrapperElem = elemStore["".concat(name, "-").concat(layout, "-wrapper")]; var tableElem = elemStore["".concat(name, "-").concat(layout, "-table")]; if (layout === 'header') { // 表头体样式处理 // 横向滚动渲染 var tWidth = tableWidth; if (scrollXLoad) { if (fixedType) { tableColumn = fixedColumn; } tWidth = tableColumn.reduce(function (previous, column) { return previous + column.renderWidth; }, 0); } if (tableElem) { tableElem.style.width = tWidth === null ? tWidth : "".concat(tWidth + scrollbarWidth, "px"); } var repairElem = elemStore["".concat(name, "-").concat(layout, "-repair")]; if (repairElem) { repairElem.style.width = "".concat(tableWidth, "px"); } var listElem = elemStore["".concat(name, "-").concat(layout, "-list")]; if (listElem) { _xeUtils.default.arrayEach(listElem.querySelectorAll(".col--gutter"), function (thElem) { thElem.style.width = "".concat(scrollbarWidth, "px"); }); } } else if (layout === 'body') { var emptyBlockElem = elemStore["".concat(name, "-").concat(layout, "-emptyBlock")]; if (wrapperElem) { if (customHeight > 0) { wrapperElem.style.height = "".concat(fixedType ? (customHeight > 0 ? customHeight - headerHeight - footerHeight : tableHeight) - (showFooter ? 0 : scrollbarHeight) : customHeight - headerHeight - footerHeight, "px"); } else if (maxHeight) { maxHeight = _tools.DomTools.isScale(maxHeight) ? Math.floor(parseInt(maxHeight) / 100 * parentHeight) : _xeUtils.default.toNumber(maxHeight); wrapperElem.style.maxHeight = "".concat(fixedType ? maxHeight - headerHeight - (showFooter ? 0 : scrollbarHeight) : maxHeight - headerHeight, "px"); } } // 如果是固定列 if (fixedWrapperElem) { var isRightFixed = fixedType === 'right'; var _fixedColumn = columnStore["".concat(fixedType, "List")]; wrapperElem.style.top = "".concat(headerHeight, "px"); fixedWrapperElem.style.height = "".concat((customHeight > 0 ? customHeight - headerHeight - footerHeight : tableHeight) + headerHeight + footerHeight - scrollbarHeight * (showFooter ? 2 : 1), "px"); fixedWrapperElem.style.width = "".concat(_fixedColumn.reduce(function (previous, column) { return previous + column.renderWidth; }, isRightFixed ? scrollbarWidth : 0), "px"); } var _tWidth = tableWidth; // 如果是固定列与设置了超出隐藏 if (fixedType && allColumnOverflow) { tableColumn = fixedColumn; _tWidth = tableColumn.reduce(function (previous, column) { return previous + column.renderWidth; }, 0); } else if (scrollXLoad) { if (fixedType) { tableColumn = fixedColumn; } _tWidth = tableColumn.reduce(function (previous, column) { return previous + column.renderWidth; }, 0); } if (tableElem) { tableElem.style.width = _tWidth ? "".concat(_tWidth, "px") : _tWidth; // 兼容性处理 if (overflowY && fixedType && (browse['-moz'] || browse['safari'])) { tableElem.style.paddingRight = "".concat(scrollbarWidth, "px"); } } if (emptyBlockElem) { emptyBlockElem.style.width = _tWidth ? "".concat(_tWidth, "px") : _tWidth; } } else if (layout === 'footer') { // 如果是使用优化模式 var _tWidth2 = tableWidth; if (fixedType && allColumnOverflow) { tableColumn = fixedColumn; _tWidth2 = tableColumn.reduce(function (previous, column) { return previous + column.renderWidth; }, 0); } else if (scrollXLoad) { if (fixedType) { tableColumn = fixedColumn; } _tWidth2 = tableColumn.reduce(function (previous, column) { return previous + column.renderWidth; }, 0); } if (wrapperElem) { // 如果是固定列 if (fixedWrapperElem) { wrapperElem.style.top = "".concat(customHeight ? customHeight - footerHeight : tableHeight + headerHeight, "px"); } wrapperElem.style.marginTop = "".concat(-scrollbarHeight - 1, "px"); } if (tableElem) { tableElem.style.width = _tWidth2 === null ? _tWidth2 : "".concat(_tWidth2 + scrollbarWidth, "px"); } } var colgroupElem = elemStore["".concat(name, "-").concat(layout, "-colgroup")]; if (colgroupElem) { _xeUtils.default.arrayEach(colgroupElem.children, function (colElem) { var colid = colElem.getAttribute('name'); if (colid === 'col-gutter') { colElem.width = "".concat(scrollbarWidth || ''); } if (fullColumnIdData[colid]) { var column = fullColumnIdData[colid].column; var showHeaderOverflow = column.showHeaderOverflow, showOverflow = column.showOverflow, renderWidth = column.renderWidth; var cellOverflow; colElem.width = "".concat(column.renderWidth || ''); if (layout === 'header') { cellOverflow = _xeUtils.default.isUndefined(showHeaderOverflow) || _xeUtils.default.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow; } else { cellOverflow = _xeUtils.default.isUndefined(showOverflow) || _xeUtils.default.isNull(showOverflow) ? allColumnOverflow : showOverflow; } var showEllipsis = cellOverflow === 'ellipsis'; var showTitle = cellOverflow === 'title'; var showTooltip = cellOverflow === true || cellOverflow === 'tooltip'; var hasEllipsis = showTitle || showTooltip || showEllipsis; var _listElem = elemStore["".concat(name, "-").concat(layout, "-list")]; if (_listElem && hasEllipsis) { _xeUtils.default.arrayEach(_listElem.querySelectorAll(".".concat(column.id)), function (thElem) { var cellElem = thElem.querySelector('.vxe-cell'); if (cellElem) { cellElem.style.width = "".concat(border ? renderWidth - 1 : renderWidth, "px"); } }); } } }); } }); }); if (currentRow) { this.setCurrentRow(currentRow); } return this.$nextTick(); }, /** * 处理固定列的显示状态 */ checkScrolling: function checkScrolling() { var _this$$refs2 = this.$refs, tableBody = _this$$refs2.tableBody, leftContainer = _this$$refs2.leftContainer, rightContainer = _this$$refs2.rightContainer; var bodyElem = tableBody ? tableBody.$el : null; if (bodyElem) { if (leftContainer) { _tools.DomTools[bodyElem.scrollLeft > 0 ? 'addClass' : 'removeClass'](leftContainer, 'scrolling--middle'); } if (rightContainer) { _tools.DomTools[bodyElem.clientWidth < bodyElem.scrollWidth - bodyElem.scrollLeft ? 'addClass' : 'removeClass'](rightContainer, 'scrolling--middle'); } } }, preventEvent: function preventEvent(evnt, type, args, callback) { var _this16 = this; var evntList = _vXETable.Interceptor.get(type); if (!evntList.some(function (func) { return func(args, evnt, _this16) === false; })) { callback(); } }, /** * 全局按下事件处理 */ handleGlobalMousedownEvent: function handleGlobalMousedownEvent(evnt) { var _this17 = this; var $el = this.$el, $refs = this.$refs, editStore = this.editStore, ctxMenuStore = this.ctxMenuStore, _this$editConfig = this.editConfig, editConfig = _this$editConfig === void 0 ? {} : _this$editConfig, filterStore = this.filterStore; var actived = editStore.actived; var filterWrapper = $refs.filterWrapper, validTip = $refs.validTip; if (filterWrapper) { if (this.getEventTargetNode(evnt, $el, 'vxe-filter-wrapper').flag) {// 如果点击了筛选按钮 } else if (this.getEventTargetNode(evnt, filterWrapper.$el).flag) {// 如果点击筛选容器 } else { this.preventEvent(evnt, 'event.clear_filter', filterStore.args, this.closeFilter); } } // 如果已激活了编辑状态 if (actived.row) { if (!(editConfig.autoClear === false)) { if (validTip && this.getEventTargetNode(evnt, validTip.$el).flag) {// 如果是激活状态,且点击了校验提示框 } else if (!this.lastCallTime || this.lastCallTime + 50 < Date.now()) { // 如果手动调用了激活单元格,避免触发源被移除后导致重复关闭 this.preventEvent(evnt, 'event.clear_actived', actived.args, function () { var isClear; var isReadonlyCol = !_this17.getEventTargetNode(evnt, $el, 'col--edit').flag; // row 方式 if (editConfig.mode === 'row') { var rowNode = _this17.getEventTargetNode(evnt, $el, 'vxe-body--row'); var isOtherRow = rowNode.flag ? rowNode.targetElem !== actived.args.cell.parentNode : 0; if (editConfig.trigger === 'manual') { // manual 触发,如果点击了不同行 isClear = isOtherRow; } else { // click,dblclick 触发,如果点击了不同行的非编辑列 isClear = isOtherRow && isReadonlyCol; } } else { // cell 方式,如果是非编辑列 isClear = isReadonlyCol; } if (isClear || // 如果点击了当前表格之外 !_this17.getEventTargetNode(evnt, $el).flag) { setTimeout(function () { return _this17.clearActived(evnt); }); } }); } } } // 如果配置了快捷菜单且,点击了其他地方则关闭 if (ctxMenuStore.visible && this.$refs.ctxWrapper && !this.getEventTargetNode(evnt, this.$refs.ctxWrapper.$el).flag) { this.closeMenu(); } }, /** * 窗口失焦事件处理 */ handleGlobalBlurEvent: function handleGlobalBlurEvent(evnt) { this.closeFilter(); this.closeMenu(); }, /** * 全局滚动事件 */ handleGlobalMousewheelEvent: function handleGlobalMousewheelEvent(evnt) { this.clostTooltip(); this.closeMenu(); }, /** * 全局键盘事件 */ handleGlobalKeydownEvent: function handleGlobalKeydownEvent(evnt) { var _this18 = this; var isCtxMenu = this.isCtxMenu, ctxMenuStore = this.ctxMenuStore, editStore = this.editStore, _this$mouseConfig2 = this.mouseConfig, mouseConfig = _this$mouseConfig2 === void 0 ? {} : _this$mouseConfig2, _this$keyboardConfig = this.keyboardConfig, keyboardConfig = _this$keyboardConfig === void 0 ? {} : _this$keyboardConfig, treeConfig = this.treeConfig, highlightCurrentRow = this.highlightCurrentRow, currentRow = this.currentRow; var selected = editStore.selected, actived = editStore.actived; var keyCode = evnt.keyCode; var isBack = keyCode === 8; var isTab = keyCode === 9; var isEnter = keyCode === 13; var isEsc = keyCode === 27; var isSpacebar = keyCode === 32; var isLeftArrow = keyCode === 37; var isUpArrow = keyCode === 38; var isRightArrow = keyCode === 39; var isDwArrow = keyCode === 40; var isDel = keyCode === 46; var isA = keyCode === 65; var isC = keyCode === 67; var isV = keyCode === 86; var isX = keyCode === 88; var isF2 = keyCode === 113; var isCtrlKey = evnt.ctrlKey; var operArrow = isLeftArrow || isUpArrow || isRightArrow || isDwArrow; var operCtxMenu = isCtxMenu && ctxMenuStore.visible && (isEnter || isSpacebar || operArrow); var params; if (isEsc) { // 如果按下了 Esc 键,关闭快捷菜单、筛选 this.closeMenu(); this.closeFilter(); // 如果是激活编辑状态,则取消编辑 if (actived.row) { params = actived.args; this.clearActived(evnt); // 如果配置了选中功能,则为选中状态 if (mouseConfig.selected) { this.handleSelected(params, evnt); } } } else if (isEnter && (keyboardConfig.isArrow || keyboardConfig.isTab) && (selected.row || actived.row || treeConfig && highlightCurrentRow && currentRow)) { // 如果是激活状态,退则出到下一行 if (selected.row || actived.row) { this.moveSelected(selected.row ? selected.args : actived.args, isLeftArrow, isUpArrow, isRightArrow, true, evnt); } else if (treeConfig && highlightCurrentRow && currentRow) { // 如果是树形表格当前行回车移动到子节点 var childrens = currentRow[treeConfig.children]; if (childrens && childrens.length) { evnt.preventDefault(); var targetRow = childrens[0]; params = { $table: this, row: targetRow }; this.setTreeExpansion(currentRow, true).then(function () { return _this18.scrollToRow(targetRow); }).then(function () { return _this18.triggerCurrentRowEvent(evnt, params); }); } } } else if (operCtxMenu) { // 如果配置了右键菜单; 支持方向键操作、回车 evnt.preventDefault(); if (ctxMenuStore.showChild && _tools.UtilTools.hasChildrenList(ctxMenuStore.selected)) { this.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selectChild', 37, false, ctxMenuStore.selected.children); } else { this.moveCtxMenu(evnt, keyCode, ctxMenuStore, 'selected', 39, true, this.ctxMenuList); } } else if (isF2) { // 如果按下了 F2 键 if (selected.row && selected.column) { evnt.preventDefault(); this.handleActived(selected.args, evnt); } } else if (operArrow && keyboardConfig.isArrow) { // 如果按下了方向键 if (selected.row && selected.column) { this.moveSelected(selected.args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt); } else if ((isUpArrow || isDwArrow) && highlightCurrentRow && currentRow) { // 当前行按键上下移动 this.moveCurrentRow(isUpArrow, isDwArrow, evnt); } } else if (isTab && keyboardConfig.isTab) { // 如果按下了 Tab 键切换 if (selected.row || selected.column) { this.moveTabSelected(selected.args, evnt); } else if (actived.row || actived.column) { this.moveTabSelected(actived.args, evnt); } } else if (isDel || (treeConfig && highlightCurrentRow && currentRow ? isBack && keyboardConfig.isArrow : isBack)) { // 如果是删除键 if (keyboardConfig.isDel && (selected.row || selected.column)) { _tools.UtilTools.setCellValue(selected.row, selected.column, null); if (isBack) { this.handleActived(selected.args, evnt); } } else if (isBack && keyboardConfig.isArrow && treeConfig && highlightCurrentRow && currentRow) { // 如果树形表格回退键关闭当前行返回父节点 var _XEUtils$findTree = _xeUtils.default.findTree(this.afterFullData, function (item) { return item === currentRow; }, treeConfig), parentRow = _XEUtils$findTree.parent; if (parentRow) { evnt.preventDefault(); params = { $table: this, row: parentRow }; this.setTreeExpansion(parentRow, false).then(function () { return _this18.scrollToRow(parentRow); }).then(function () { return _this18.triggerCurrentRowEvent(evnt, params); }); } } } else if (keyboardConfig.isCut && isCtrlKey && (isA || isX || isC || isV)) { // 如果开启复制功能 if (isA) { this.handleAllChecked(evnt); } else if (isX || isC) { this.handleCopyed(isX, evnt); } else { this.handlePaste(evnt); } } else if (keyboardConfig.isEdit && !isCtrlKey && (keyCode >= 48 && keyCode <= 57 || keyCode >= 65 && keyCode <= 90 || keyCode >= 96 && keyCode <= 111 || keyCode >= 186 && keyCode <= 192 || keyCode >= 219 && keyCode <= 222 || keyCode === 32)) { // 如果是按下非功能键之外允许直接编辑 if (selected.column && selected.row && selected.column.editRender) { if (!keyboardConfig.editMethod || !(keyboardConfig.editMethod(selected.args, evnt) === false)) { _tools.UtilTools.setCellValue(selected.row, selected.column, null); this.handleActived(selected.args, evnt); } } } }, // 处理 Tab 键移动 moveTabSelected: function moveTabSelected(args, evnt) { var tableData = this.tableData, visibleColumn = this.visibleColumn, editConfig = this.editConfig, hasIndexColumn = this.hasIndexColumn; var targetRow; var targetRowIndex; var targetColumn; var targetColumnIndex; var isShiftKey = evnt.shiftKey; var params = Object.assign({}, args); var rowIndex = tableData.indexOf(params.row); var columnIndex = visibleColumn.indexOf(params.column); evnt.preventDefault(); if (isShiftKey) { // 向左 for (var len = columnIndex - 1; len >= 0; len--) { if (!hasIndexColumn(visibleColumn[len])) { targetColumnIndex = len; targetColumn = visibleColumn[len]; break; } } if (!targetColumn && rowIndex > 0) { // 如果找不到从上一行开始找,如果一行都找不到就不需要继续找了,可能不存在可编辑的列 targetRowIndex = rowIndex - 1; targetRow = tableData[targetRowIndex]; for (var _len = visibleColumn.length - 1; _len >= 0; _len--) { if (!hasIndexColumn(visibleColumn[_len])) { targetColumnIndex = _len; targetColumn = visibleColumn[_len]; break; } } } } else { // 向右 for (var index = columnIndex + 1; index < visibleColumn.length; index++) { if (!hasIndexColumn(visibleColumn[index])) { targetColumnIndex = index; targetColumn = visibleColumn[index]; break; } } if (!targetColumn && rowIndex < tableData.length - 1) { // 如果找不到从下一行开始找,如果一行都找不到就不需要继续找了,可能不存在可编辑的列 targetRowIndex = rowIndex + 1; targetRow = tableData[targetRowIndex]; for (var _index = 0; _index < visibleColumn.length; _index++) { if (!hasIndexColumn(visibleColumn[_index])) { targetColumnIndex = _index; targetColumn = visibleColumn[_index]; break; } } } } if (targetColumn) { if (targetRow) { params.rowIndex = targetRowIndex; params.row = targetRow; } else { params.rowIndex = rowIndex; } params.columnIndex = targetColumnIndex; params.column = targetColumn; params.cell = _tools.DomTools.getCell(this, params); if (editConfig) { if (editConfig.trigger === 'click' || editConfig.trigger === 'dblclick') { if (editConfig.mode === 'row') { this.handleActived(params, evnt); } else { this.handleSelected(params, evnt); this.scrollToRow(params.row, params.column); } } } } }, // 处理当前行方向键移动 moveCurrentRow: function moveCurrentRow(isUpArrow, isDwArrow, evnt) { var _this19 = this; var currentRow = this.currentRow, treeConfig = this.treeConfig, afterFullData = this.afterFullData; var targetRow; evnt.preventDefault(); if (treeConfig) { var _XEUtils$findTree2 = _xeUtils.default.findTree(afterFullData, function (item) { return item === currentRow; }, treeConfig), index = _XEUtils$findTree2.index, items = _XEUtils$findTree2.items; if (isUpArrow && index > 0) { targetRow = items[index - 1]; } else if (isDwArrow && index < items.length - 1) { targetRow = items[index + 1]; } } else { var rowIndex = afterFullData.indexOf(currentRow); if (isUpArrow && rowIndex > 0) { targetRow = afterFullData[rowIndex - 1]; } else if (isDwArrow && rowIndex < afterFullData.length - 1) { targetRow = afterFullData[rowIndex + 1]; } } if (targetRow) { var params = { $table: this, row: targetRow }; this.scrollToRow(targetRow).then(function () { return _this19.triggerCurrentRowEvent(evnt, params); }); } }, // 处理可编辑方向键移动 moveSelected: function moveSelected(args, isLeftArrow, isUpArrow, isRightArrow, isDwArrow, evnt) { var tableData = this.tableData, visibleColumn = this.visibleColumn, hasIndexColumn = this.hasIndexColumn; var params = Object.assign({}, args); evnt.preventDefault(); if (isUpArrow && params.rowIndex) { params.rowIndex -= 1; params.row = tableData[params.rowIndex]; } else if (isDwArrow && params.rowIndex < tableData.length - 1) { params.rowIndex += 1; params.row = tableData[params.rowIndex]; } else if (isLeftArrow && params.columnIndex) { for (var len = params.columnIndex - 1; len >= 0; len--) { if (!hasIndexColumn(visibleColumn[len])) { params.columnIndex = len; params.column = visibleColumn[len]; break; } } } else if (isRightArrow) { for (var index = params.columnIndex + 1; index < visibleColumn.length; index++) { if (!hasIndexColumn(visibleColumn[index])) { params.columnIndex = index; params.column = visibleColumn[index]; break; } } } params.cell = _tools.DomTools.getCell(this, params); this.handleSelected(params, evnt); this.scrollToRow(params.row, params.column); }, // 处理菜单的移动 moveCtxMenu: function moveCtxMenu(evnt, keyCode, ctxMenuStore, property, operKey, operRest, menuList) { var selectItem; var selectIndex = _xeUtils.default.findIndexOf(menuList, function (item) { return ctxMenuStore[property] === item; }); if (keyCode === operKey) { if (operRest && _tools.UtilTools.hasChildrenList(ctxMenuStore.selected)) { ctxMenuStore.showChild = true; } else { ctxMenuStore.showChild = false; ctxMenuStore.selectChild = null; } } else if (keyCode === 38) { for (var len = selectIndex - 1; len >= 0; len--) { if (menuList[len].visible !== false) { selectItem = menuList[len]; break; } } ctxMenuStore[property] = selectItem || menuList[menuList.length - 1]; } else if (keyCode === 40) { for (var index = selectIndex + 1; index < menuList.length; index++) { if (menuList[index].visible !== false) { selectItem = menuList[index]; break; } } ctxMenuStore[property] = selectItem || menuList[0]; } else if (ctxMenuStore[property] && (keyCode === 13 || keyCode === 32)) { this.ctxMenuLinkEvent(evnt, ctxMenuStore[property]); } }, handleGlobalResizeEvent: function handleGlobalResizeEvent() { this.recalculate(); }, /** * 快捷菜单事件处理 */ handleGlobalContextmenuEvent: function handleGlobalContextmenuEvent(evnt) { var isCtxMenu = this.isCtxMenu, ctxMenuStore = this.ctxMenuStore, ctxMenuOpts = this.ctxMenuOpts; var layoutList = ['header', 'body', 'footer']; if (isCtxMenu) { if (ctxMenuStore.visible) { if (ctxMenuStore.visible && this.$refs.ctxWrapper && this.getEventTargetNode(evnt, this.$refs.ctxWrapper.$el).flag) { evnt.preventDefault(); return; } } for (var index = 0; index < layoutList.length; index++) { var layout = layoutList[index]; var columnTargetNode = this.getEventTargetNode(evnt, this.$el, "vxe-".concat(layout, "--column")); var params = { type: layout, $table: this }; if (columnTargetNode.flag) { var cell = columnTargetNode.targetElem; var column = this.getColumnNode(cell).item; var typePrefix = "".concat(layout, "-"); Object.assign(params, { column: column, columnIndex: this.getColumnIndex(column), cell: cell }); if (layout === 'body') { var row = this.getRowNode(cell.parentNode).item; typePrefix = ''; params.row = row; params.rowIndex = this.getRowIndex(row); } this.openContextMenu(evnt, layout, params); _tools.UtilTools.emitEvent(this, "".concat(typePrefix, "cell-context-menu"), [params, evnt]); return; } else if (this.getEventTargetNode(evnt, this.$el, "vxe-table--".concat(layout, "-wrapper")).flag) { if (ctxMenuOpts.trigger === 'cell') { evnt.preventDefault(); } else { this.openContextMenu(evnt, layout, params); } return; } } } this.closeMenu(); this.closeFilter(); }, /** * 显示快捷菜单 */ openContextMenu: function openContextMenu(evnt, type, params) { var _this20 = this; var ctxMenuStore = this.ctxMenuStore, ctxMenuOpts = this.ctxMenuOpts; var config = ctxMenuOpts[type]; var visibleMethod = ctxMenuOpts.visibleMethod; if (config) { var options = config.options, disabled = config.disabled; if (disabled) { evnt.preventDefault(); } else if (options && options.length) { if (!visibleMethod || visibleMethod(params, evnt)) { evnt.preventDefault(); var _DomTools$getDomNode = _tools.DomTools.getDomNode(), scrollTop = _DomTools$getDomNode.scrollTop, scrollLeft = _DomTools$getDomNode.scrollLeft, visibleHeight = _DomTools$getDomNode.visibleHeight, visibleWidth = _DomTools$getDomNode.visibleWidth; var top = evnt.clientY + scrollTop; var left = evnt.clientX + scrollLeft; Object.assign(ctxMenuStore, { args: params, visible: true, list: options, selected: null, selectChild: null, showChild: false, style: { top: "".concat(top, "px"), left: "".concat(left, "px") } }); this.$nextTick(function () { var ctxElem = _this20.$refs.ctxWrapper.$el; var clientHeight = ctxElem.clientHeight; var clientWidth = ctxElem.clientWidth; var offsetTop = evnt.clientY + clientHeight - visibleHeight; var offsetLeft = evnt.clientX + clientWidth - visibleWidth; if (offsetTop > -10) { ctxMenuStore.style.top = "".concat(top - clientHeight, "px"); } if (offsetLeft > -10) { ctxMenuStore.style.left = "".concat(left - clientWidth, "px"); } }); } else { this.closeMenu(); } } } this.closeFilter(); }, /** * 关闭快捷菜单 */ closeMenu: function closeMenu() { Object.assign(this.ctxMenuStore, { visible: false, selected: null, selectChild: null, showChild: false }); return this.$nextTick(); }, ctxMenuMouseoverEvent: function ctxMenuMouseoverEvent(evnt, item, child) { var ctxMenuStore = this.ctxMenuStore; evnt.preventDefault(); evnt.stopPropagation(); ctxMenuStore.selected = item; ctxMenuStore.selectChild = child; if (!child) { ctxMenuStore.showChild = _tools.UtilTools.hasChildrenList(item); } }, ctxMenuMouseoutEvent: function ctxMenuMouseoutEvent(evnt, item, child) { var ctxMenuStore = this.ctxMenuStore; if (!item.children) { ctxMenuStore.selected = null; } ctxMenuStore.selectChild = null; }, /** * 快捷菜单点击事件 */ ctxMenuLinkEvent: function ctxMenuLinkEvent(evnt, menu) { if (!menu.disabled && (!menu.children || !menu.children.length)) { _tools.UtilTools.emitEvent(this, 'context-menu-click', [Object.assign({ menu: menu }, this.ctxMenuStore.args), evnt]); this.closeMenu(); } }, /** * 触发表头 tooltip 事件 */ triggerHeaderTooltipEvent: function triggerHeaderTooltipEvent(evnt, params) { var tooltipStore = this.tooltipStore; var column = params.column; if (tooltipStore.column !== column || !tooltipStore.visible) { // 在 v3.0 中废弃 label this.showTooltip(evnt, column); } }, /** * 触发表尾 tooltip 事件 */ triggerFooterTooltipEvent: function triggerFooterTooltipEvent(evnt, params) { var column = params.column; var tooltipStore = this.tooltipStore; if (tooltipStore.column !== column || !tooltipStore.visible) { this.showTooltip(evnt, column); } }, /** * 触发 tooltip 事件 */ triggerTooltipEvent: function triggerTooltipEvent(evnt, params) { var editConfig = this.editConfig, editStore = this.editStore, tooltipStore = this.tooltipStore; var actived = editStore.actived; var row = params.row, column = params.column; if (editConfig) { if (editConfig.mode === 'row' && actived.row === row || actived.row === row && actived.column === column) { return; } } if (tooltipStore.column !== column || tooltipStore.row !== row || !tooltipStore.visible) { this.showTooltip(evnt, column, row); } }, // 显示 tooltip showTooltip: function showTooltip(evnt, column, row) { var cell = evnt.currentTarget; var tooltip = this.$refs.tooltip; var wrapperElem = cell.children[0]; var content = cell.innerText; if (content && wrapperElem.scrollWidth > wrapperElem.clientWidth) { Object.assign(this.tooltipStore, { row: row, column: column, visible: true }); if (tooltip) { tooltip.toVisible(cell, _tools.UtilTools.formatText(content)); } } return this.$nextTick(); }, // 关闭 tooltip clostTooltip: function clostTooltip() { var tooltip = this.$refs.tooltip; Object.assign(this.tooltipStore, { row: null, column: null, content: null, visible: false }); if (tooltip) { tooltip.close(); } return this.$nextTick(); }, /** * 处理默认勾选 */ handleSelectionDefChecked: function handleSelectionDefChecked() { var _this$selectConfig3 = this.selectConfig, selectConfig = _this$selectConfig3 === void 0 ? {} : _this$selectConfig3, fullDataRowIdData = this.fullDataRowIdData; var checkAll = selectConfig.checkAll, checkRowKeys = selectConfig.checkRowKeys; if (checkAll) { this.setAllSelection(true); } else if (checkRowKeys) { var defSelection = []; checkRowKeys.forEach(function (rowid) { if (fullDataRowIdData[rowid]) { defSelection.push(fullDataRowIdData[rowid].row); } }); this.setSelection(defSelection, true); } }, setSelection: function setSelection(rows, value) { var _this21 = this; if (rows && !_xeUtils.default.isArray(rows)) { rows = [rows]; } rows.forEach(function (row) { return _this21.handleSelectRow({ row: row }, !!value); }); return this.$nextTick(); }, /** * 多选,行选中事件 * value 选中true 不选false 不确定-1 */ handleSelectRow: function handleSelectRow(_ref2, value) { var row = _ref2.row; var selection = this.selection, tableFullData = this.tableFullData, _this$selectConfig4 = this.selectConfig, selectConfig = _this$selectConfig4 === void 0 ? {} : _this$selectConfig4, treeConfig = this.treeConfig, treeIndeterminates = this.treeIndeterminates; var property = selectConfig.checkField, checkStrictly = selectConfig.checkStrictly, checkMethod = selectConfig.checkMethod; if (property) { if (treeConfig && !checkStrictly) { if (value === -1) { treeIndeterminates.push(row); _xeUtils.default.set(row, property, false); } else { // 更新子节点状态 _xeUtils.default.eachTree([row], function (item, $rowIndex) { if (row === item || !checkMethod || checkMethod({ row: item, $rowIndex: $rowIndex })) { _xeUtils.default.set(item, property, value); } }, treeConfig); _xeUtils.default.remove(treeIndeterminates, function (item) { return item === row; }); } // 如果存在父节点,更新父节点状态 var matchObj = _xeUtils.default.findTree(tableFullData, function (item) { return item === row; }, treeConfig); if (matchObj && matchObj.parent) { var parentStatus; var vItems = checkMethod ? matchObj.items.filter(function (item, $rowIndex) { return checkMethod({ row: item, $rowIndex: $rowIndex }); }) : matchObj.items; var indeterminatesItem = matchObj.items.find(function (item) { return treeIndeterminates.indexOf(item) > -1; }); if (indeterminatesItem) { parentStatus = -1; } else { var selectItems = matchObj.items.filter(function (item) { return _xeUtils.default.get(item, property); }); parentStatus = selectItems.filter(function (item) { return vItems.indexOf(item) > -1; }).length === vItems.length ? true : selectItems.length || value === -1 ? -1 : false; } return this.handleSelectRow({ row: matchObj.parent }, parentStatus); } } else { _xeUtils.default.set(row, property, value); } } else { if (treeConfig && !checkStrictly) { if (value === -1) { treeIndeterminates.push(row); _xeUtils.default.remove(selection, function (item) { return item === row; }); } else { // 更新子节点状态 _xeUtils.default.eachTree([row], function (item, $rowIndex) { if (row === item || !checkMethod || checkMethod({ row: item, $rowIndex: $rowIndex })) { if (value) { selection.push(item); } else { _xeUtils.default.remove(selection, function (select) { return select === item; }); } } }, treeConfig); _xeUtils.default.remove(treeIndeterminates, function (item) { return item === row; }); } // 如果存在父节点,更新父节点状态 var _matchObj = _xeUtils.default.findTree(tableFullData, function (item) { return item === row; }, treeConfig); if (_matchObj && _matchObj.parent) { var _parentStatus; var _vItems = checkMethod ? _matchObj.items.filter(function (item, $rowIndex) { return checkMethod({ row: item, $rowIndex: $rowIndex }); }) : _matchObj.items; var _indeterminatesItem = _matchObj.items.find(function (item) { return treeIndeterminates.indexOf(item) > -1; }); if (_indeterminatesItem) { _parentStatus = -1; } else { var _selectItems = _matchObj.items.filter(function (item) { return selection.indexOf(item) > -1; }); _parentStatus = _selectItems.filter(function (item) { return _vItems.indexOf(item) > -1; }).length === _vItems.length ? true : _selectItems.length || value === -1 ? -1 : false; } return this.handleSelectRow({ row: _matchObj.parent }, _parentStatus); } } else { if (value) { if (selection.indexOf(row) === -1) { selection.push(row); } } else { _xeUtils.default.remove(selection, function (item) { return item === row; }); } } } this.checkSelectionStatus(); }, handleToggleCheckRowEvent: function handleToggleCheckRowEvent(params, evnt) { var _this$selectConfig5 = this.selectConfig, selectConfig = _this$selectConfig5 === void 0 ? {} : _this$selectConfig5, selection = this.selection; var property = selectConfig.checkField; var row = params.row; var value = property ? !_xeUtils.default.get(row, property) : selection.indexOf(row) === -1; if (evnt) { this.triggerCheckRowEvent(evnt, params, value); } else { this.handleSelectRow(params, value); } }, triggerCheckRowEvent: function triggerCheckRowEvent(evnt, params, value) { this.handleSelectRow(params, value); _tools.UtilTools.emitEvent(this, 'select-change', [Object.assign({ selection: this.getSelectRecords(), checked: value }, params), evnt]); }, /** * 多选,切换某一行的选中状态 */ toggleRowSelection: function toggleRowSelection(row) { this.handleToggleCheckRowEvent({ row: row }); return this.$nextTick(); }, setAllSelection: function setAllSelection(value) { var tableFullData = this.tableFullData, editStore = this.editStore, _this$selectConfig6 = this.selectConfig, selectConfig = _this$selectConfig6 === void 0 ? {} : _this$selectConfig6, treeConfig = this.treeConfig, selection = this.selection; var property = selectConfig.checkField, reserve = selectConfig.reserve, checkStrictly = selectConfig.checkStrictly, checkMethod = selectConfig.checkMethod; var insertList = editStore.insertList; var selectRows = []; // 包含新增的数据 if (insertList.length) { tableFullData = tableFullData.concat(insertList); } if (!checkStrictly) { if (property) { var indexKey = "".concat(treeConfig ? '$' : '', "rowIndex"); var setValFn = function setValFn(row, rowIndex) { if (!checkMethod || checkMethod(_defineProperty({ row: row }, indexKey, rowIndex))) { _xeUtils.default.set(row, property, value); } }; var clearValFn = function clearValFn(row, rowIndex) { if (!checkMethod || (checkMethod(_defineProperty({ row: row }, indexKey, rowIndex)) ? 0 : selection.indexOf(row) > -1)) { _xeUtils.default.set(row, property, value); } }; if (treeConfig) { _xeUtils.default.eachTree(tableFullData, value ? setValFn : clearValFn, treeConfig); } else { tableFullData.forEach(value ? setValFn : clearValFn); } } else { if (treeConfig) { if (value) { _xeUtils.default.eachTree(tableFullData, function (row, $rowIndex) { if (!checkMethod || checkMethod({ row: row, $rowIndex: $rowIndex })) { selectRows.push(row); } }, treeConfig); } else { if (checkMethod) { _xeUtils.default.eachTree(tableFullData, function (row, $rowIndex) { if (checkMethod({ row: row, $rowIndex: $rowIndex }) ? 0 : selection.indexOf(row) > -1) { selectRows.push(row); } }, treeConfig); } } } else { if (value) { if (checkMethod) { selectRows = tableFullData.filter(function (row, rowIndex) { return selection.indexOf(row) > -1 || checkMethod({ row: row, rowIndex: rowIndex }); }); } else { selectRows = tableFullData.slice(0); } } else { if (checkMethod) { selectRows = tableFullData.filter(function (row, rowIndex) { return checkMethod({ row: row, rowIndex: rowIndex }) ? 0 : selection.indexOf(row) > -1; }); } } } } this.selection = value && reserve ? selection.concat(selectRows.filter(function (row) { return selection.indexOf(row) === -1; })) : selectRows; } this.treeIndeterminates = []; this.checkSelectionStatus(); }, checkSelectionStatus: function checkSelectionStatus() { var tableFullData = this.tableFullData, editStore = this.editStore, _this$selectConfig7 = this.selectConfig, selectConfig = _this$selectConfig7 === void 0 ? {} : _this$selectConfig7, selection = this.selection, treeIndeterminates = this.treeIndeterminates; var property = selectConfig.checkField, checkStrictly = selectConfig.checkStrictly, checkMethod = selectConfig.checkMethod; var insertList = editStore.insertList; // 包含新增的数据 if (insertList.length) { tableFullData = tableFullData.concat(insertList); } if (!checkStrictly) { if (property) { this.isAllSelected = tableFullData.length && tableFullData.every(checkMethod ? function (row, rowIndex) { return !checkMethod({ row: row, rowIndex: rowIndex }) || _xeUtils.default.get(row, property); } : function (row) { return _xeUtils.default.get(row, property); }); this.isIndeterminate = !this.isAllSelected && tableFullData.some(function (row) { return _xeUtils.default.get(row, property) || treeIndeterminates.indexOf(row) > -1; }); } else { this.isAllSelected = tableFullData.length && tableFullData.every(checkMethod ? function (row, rowIndex) { return !checkMethod({ row: row, rowIndex: rowIndex }) || selection.indexOf(row) > -1; } : function (row) { return selection.indexOf(row) > -1; }); this.isIndeterminate = !this.isAllSelected && tableFullData.some(function (row) { return treeIndeterminates.indexOf(row) > -1 || selection.indexOf(row) > -1; }); } } }, // 保留选中状态 reserveCheckSelection: function reserveCheckSelection() { var _this$selectConfig8 = this.selectConfig, selectConfig = _this$selectConfig8 === void 0 ? {} : _this$selectConfig8, selection = this.selection, fullDataRowIdData = this.fullDataRowIdData; var reserve = selectConfig.reserve; var rowkey = _tools.UtilTools.getRowkey(this); if (reserve && selection.length) { this.selection = selection.map(function (row) { var rowid = '' + _xeUtils.default.get(row, rowkey); return fullDataRowIdData[rowid] ? fullDataRowIdData[rowid].row : row; }); } }, /** * 多选,选中所有事件 */ triggerCheckAllEvent: function triggerCheckAllEvent(evnt, value) { this.setAllSelection(value); _tools.UtilTools.emitEvent(this, 'select-all', [{ selection: this.getSelectRecords(), checked: value }, evnt]); }, /** * 多选,切换所有行的选中状态 */ toggleAllSelection: function toggleAllSelection() { this.triggerCheckAllEvent(null, !this.isAllSelected); return this.$nextTick(); }, clearSelection: function clearSelection() { var tableFullData = this.tableFullData, _this$selectConfig9 = this.selectConfig, selectConfig = _this$selectConfig9 === void 0 ? {} : _this$selectConfig9, treeConfig = this.treeConfig; var property = selectConfig.checkField; if (property) { if (treeConfig) { _xeUtils.default.eachTree(tableFullData, function (item) { return _xeUtils.default.set(item, property, false); }, treeConfig); } else { tableFullData.forEach(function (item) { return _xeUtils.default.set(item, property, false); }); } } this.isAllSelected = false; this.isIndeterminate = false; this.selection = []; this.treeIndeterminates = []; return this.$nextTick(); }, /** * 处理单选框默认勾选 */ handleRadioDefChecked: function handleRadioDefChecked() { var _this$radioConfig = this.radioConfig, radioConfig = _this$radioConfig === void 0 ? {} : _this$radioConfig, fullDataRowIdData = this.fullDataRowIdData; var rowid = radioConfig.checkRowKey; if (rowid && fullDataRowIdData[rowid]) { this.setRadioRow(fullDataRowIdData[rowid].row); } }, /** * 单选,行选中事件 */ triggerRadioRowEvent: function triggerRadioRowEvent(evnt, params) { var isChange = this.selectRow !== params.row; this.setRadioRow(params.row); if (isChange) { _tools.UtilTools.emitEvent(this, 'radio-change', [params, evnt]); } }, triggerCurrentRowEvent: function triggerCurrentRowEvent(evnt, params) { var isChange = this.currentRow !== params.row; this.setCurrentRow(params.row); if (isChange) { _tools.UtilTools.emitEvent(this, 'current-change', [params, evnt]); } }, /** * 高亮行,设置某一行为高亮状态,如果调不加参数,则会取消目前高亮行的选中状态 */ setCurrentRow: function setCurrentRow(row) { this.clearCurrentRow(); this.clearCurrentColumn(); this.currentRow = row; if (this.highlightCurrentRow) { _xeUtils.default.arrayEach(this.$el.querySelectorAll("[data-rowid=\"".concat(_tools.UtilTools.getRowid(this, row), "\"]")), function (elem) { return _tools.DomTools.addClass(elem, 'row--current'); }); } return this.$nextTick(); }, setRadioRow: function setRadioRow(row) { if (this.selectRow !== row) { this.clearRadioRow(); } this.selectRow = row; return this.$nextTick(); }, clearCurrentRow: function clearCurrentRow() { this.currentRow = null; this.hoverRow = null; _xeUtils.default.arrayEach(this.$el.querySelectorAll('.row--current'), function (elem) { return _tools.DomTools.removeClass(elem, 'row--current'); }); return this.$nextTick(); }, clearRadioRow: function clearRadioRow() { this.selectRow = null; return this.$nextTick(); }, getCurrentRow: function getCurrentRow() { return this.currentRow; }, getRadioRow: function getRadioRow() { return this.selectRow; }, /** * 行 hover 事件 */ triggerHoverEvent: function triggerHoverEvent(evnt, _ref3) { var row = _ref3.row; this.setHoverRow(row); }, setHoverRow: function setHoverRow(row) { var rowid = _tools.UtilTools.getRowid(this, row); this.clearHoverRow(); _xeUtils.default.arrayEach(this.$el.querySelectorAll("[data-rowid=\"".concat(rowid, "\"]")), function (elem) { return _tools.DomTools.addClass(elem, 'row--hover'); }); this.hoverRow = row; }, clearHoverRow: function clearHoverRow() { _xeUtils.default.arrayEach(this.$el.querySelectorAll('.vxe-body--row.row--hover'), function (elem) { return _tools.DomTools.removeClass(elem, 'row--hover'); }); this.hoverRow = null; }, /** * 表头按下事件 */ triggerHeaderCellMousedownEvent: function triggerHeaderCellMousedownEvent(evnt, params) { var $el = this.$el, tableData = this.tableData, _this$mouseConfig3 = this.mouseConfig, mouseConfig = _this$mouseConfig3 === void 0 ? {} : _this$mouseConfig3, elemStore = this.elemStore, handleChecked = this.handleChecked, handleHeaderChecked = this.handleHeaderChecked; var button = evnt.button; var column = params.column, cell = params.cell; var isLeftBtn = button === 0; var isIndex = column.type === 'index'; if (isLeftBtn && mouseConfig.checked) { var headerList = elemStore['main-header-list'].children; var bodyList = elemStore['main-body-list'].children; if (isIndex) { this.handleAllChecked(evnt); } else { evnt.preventDefault(); evnt.stopPropagation(); this.clearSelected(evnt); this.clearHeaderChecked(); this.clearIndexChecked(); var domMousemove = document.onmousemove; var domMouseup = document.onmouseup; var startCell = bodyList[0].querySelector(".".concat(column.id)); var updateEvent = _xeUtils.default.throttle(function (evnt) { evnt.preventDefault(); var _DomTools$getEventTar = _tools.DomTools.getEventTargetNode(evnt, $el, 'vxe-header--column'), flag = _DomTools$getEventTar.flag, targetElem = _DomTools$getEventTar.targetElem; if (!flag) { var a = _tools.DomTools.getEventTargetNode(evnt, $el, 'vxe-body--column'); flag = a.flag; targetElem = a.targetElem; } if (flag && !_tools.DomTools.hasClass(targetElem, 'col--index')) { var colIndex = [].indexOf.call(targetElem.parentNode.children, targetElem); var endCell = bodyList[bodyList.length - 1].children[colIndex]; var head = headerList[0].children[colIndex]; handleHeaderChecked(_tools.DomTools.getRowNodes(headerList, _tools.DomTools.getCellNodeIndex(head), _tools.DomTools.getCellNodeIndex(cell))); handleChecked(_tools.DomTools.getRowNodes(bodyList, _tools.DomTools.getCellNodeIndex(startCell), _tools.DomTools.getCellNodeIndex(endCell))); } }, 80, { leading: true, trailing: true }); _tools.DomTools.addClass($el, 'c--checked'); document.onmousemove = updateEvent; document.onmouseup = function () { _tools.DomTools.removeClass($el, 'c--checked'); document.onmousemove = domMousemove; document.onmouseup = domMouseup; }; handleHeaderChecked([[cell]]); if (bodyList.length) { var endCell = bodyList[bodyList.length - 1].querySelector(".".concat(column.id)); var firstTrElem = bodyList[0]; var lastTrElem = bodyList[bodyList.length - 1]; var firstCell = firstTrElem.querySelector(".col--index"); params.rowIndex = 0; params.row = tableData[0]; params.cell = _tools.DomTools.getCell(this, params); this.handleSelected(params, evnt); this.handleIndexChecked(_tools.DomTools.getRowNodes(bodyList, _tools.DomTools.getCellNodeIndex(firstCell), _tools.DomTools.getCellNodeIndex(lastTrElem.querySelector(".col--index")))); this.handleChecked(_tools.DomTools.getRowNodes(bodyList, _tools.DomTools.getCellNodeIndex(startCell), _tools.DomTools.getCellNodeIndex(endCell))); } } this.closeMenu(); } }, /** * 单元格按下事件 */ triggerCellMousedownEvent: function triggerCellMousedownEvent(evnt, params) { var $el = this.$el, tableData = this.tableData, visibleColumn = this.visibleColumn, editStore = this.editStore, editConfig = this.editConfig, handleSelected = this.handleSelected, _this$mouseConfig4 = this.mouseConfig, mouseConfig = _this$mouseConfig4 === void 0 ? {} : _this$mouseConfig4, handleChecked = this.handleChecked, handleIndexChecked = this.handleIndexChecked, handleHeaderChecked = this.handleHeaderChecked, elemStore = this.elemStore; var checked = editStore.checked, actived = editStore.actived; var row = params.row, column = params.column, cell = params.cell; var button = evnt.button; var isLeftBtn = button === 0; if (editConfig) { if (actived.row !== row || !(editConfig.mode === 'cell' && actived.column === column)) { if (isLeftBtn && mouseConfig.checked) { evnt.preventDefault(); evnt.stopPropagation(); this.clearHeaderChecked(); this.clearIndexChecked(); var domMousemove = document.onmousemove; var domMouseup = document.onmouseup; var startCellNode = _tools.DomTools.getCellNodeIndex(cell); var isIndex = column.type === 'index'; var bodyList = elemStore['main-body-list'].children; var headerList = elemStore['main-header-list'].children; var cellLastElementChild = cell.parentNode.lastElementChild; var cellFirstElementChild = cell.parentNode.firstElementChild; var colIndex = [].indexOf.call(cell.parentNode.children, cell); var headStart = headerList[0].children[colIndex]; var updateEvent = _xeUtils.default.throttle(function (evnt) { evnt.preventDefault(); var _DomTools$getEventTar2 = _tools.DomTools.getEventTargetNode(evnt, $el, 'vxe-body--column'), flag = _DomTools$getEventTar2.flag, targetElem = _DomTools$getEventTar2.targetElem; if (flag) { if (isIndex) { var firstCell = targetElem.parentNode.firstElementChild; handleChecked(_tools.DomTools.getRowNodes(bodyList, _tools.DomTools.getCellNodeIndex(firstCell.nextElementSibling), _tools.DomTools.getCellNodeIndex(cellLastElementChild))); handleIndexChecked(_tools.DomTools.getRowNodes(bodyList, _tools.DomTools.getCellNodeIndex(firstCell), _tools.DomTools.getCellNodeIndex(cell))); } else if (!_tools.DomTools.hasClass(targetElem, 'col--index')) { var _firstCell = targetElem.parentNode.firstElementChild; var _colIndex = [].indexOf.call(targetElem.parentNode.children, targetElem); var head = headerList[0].children[_colIndex]; handleHeaderChecked(_tools.DomTools.getRowNodes(headerList, _tools.DomTools.getCellNodeIndex(head), _tools.DomTools.getCellNodeIndex(headStart))); handleIndexChecked(_tools.DomTools.getRowNodes(bodyList, _tools.DomTools.getCellNodeIndex(_firstCell), _tools.DomTools.getCellNodeIndex(cellFirstElementChild))); handleChecked(_tools.DomTools.getRowNodes(bodyList, startCellNode, _tools.DomTools.getCellNodeIndex(targetElem))); } } }, 80, { leading: true, trailing: true }); document.onmousemove = updateEvent; document.onmouseup = function (evnt) { document.onmousemove = domMousemove; document.onmouseup = domMouseup; }; if (isIndex) { var firstCell = cell.parentNode.firstElementChild; params.columnIndex++; params.column = visibleColumn[params.columnIndex]; params.cell = cell.nextElementSibling; handleSelected(params, evnt); handleChecked(_tools.DomTools.getRowNodes(bodyList, _tools.DomTools.getCellNodeIndex(firstCell.nextElementSibling), _tools.DomTools.getCellNodeIndex(cellLastElementChild))); handleHeaderChecked([headerList[0].querySelectorAll('.vxe-header--column:not(.col--index)')]); handleIndexChecked(_tools.DomTools.getRowNodes(bodyList, _tools.DomTools.getCellNodeIndex(firstCell), _tools.DomTools.getCellNodeIndex(cell))); } else { handleSelected(params, evnt); } this.closeFilter(); this.closeMenu(); } else if (mouseConfig.selected) { // 除了双击其他都没有选中状态 if (editConfig.trigger === 'dblclick') { // 如果不在所有选中的范围之内则重新选中 var select = _tools.DomTools.getCellIndexs(cell); if (checked.rows.indexOf(tableData[select.rowIndex]) === -1 || checked.columns.indexOf(visibleColumn[select.columnIndex]) === -1) { handleSelected(params, evnt); } } } } } else if (mouseConfig.selected) { handleSelected(params, evnt); } }, /** * 边角事件 */ // triggerCornerMousedownEvent (params, evnt) { // evnt.preventDefault() // evnt.stopPropagation() // let { $el, tableData, visibleColumn, editStore, editConfig, handleTempChecked } = this // let { checked } = editStore // let { button } = evnt // let isLeftBtn = button === 0 // let isRightBtn = button === 2 // if (isLeftBtn || isRightBtn) { // if (editConfig && checked.rows.length && editConfig.trigger === 'dblclick') { // let domMousemove = document.onmousemove // let domMouseup = document.onmouseup // let start = { // rowIndex: tableData.indexOf(checked.rows[0]), // columnIndex: visibleColumn.indexOf(checked.columns[0]) // } // let updateEvent = XEUtils.throttle(function (evnt) { // evnt.preventDefault() // let { flag, targetElem } = DomTools.getEventTargetNode(evnt, $el, 'vxe-body--column') // if (flag) { // handleTempChecked(start, DomTools.getCellIndexs(targetElem), evnt) // } // }, browse.msie ? 80 : 40, { leading: true, trailing: true }) // document.onmousemove = updateEvent // document.onmouseup = function (evnt) { // document.onmousemove = domMousemove // document.onmouseup = domMouseup // checked.rows = checked.tRows // checked.columns = checked.tColumns // } // } // } // }, triggerHeaderCellClickEvent: function triggerHeaderCellClickEvent(evnt, params) { var _lastResizeTime = this._lastResizeTime, sortOpts = this.sortOpts; var column = params.column, cell = params.cell; var triggerResizable = _lastResizeTime && _lastResizeTime > Date.now() - 300; var triggerSort = this.getEventTargetNode(evnt, cell, 'vxe-sort-wrapper').flag; var triggerFilter = this.getEventTargetNode(evnt, cell, 'vxe-filter-wrapper').flag; if (sortOpts.trigger === 'cell' && !(triggerResizable || triggerSort || triggerFilter)) { this.sort(column.property); } _tools.UtilTools.emitEvent(this, 'header-cell-click', [Object.assign({ triggerResizable: triggerResizable, triggerSort: triggerSort, triggerFilter: triggerFilter }, params), evnt]); if (this.highlightCurrentColumn) { return this.setCurrentColumn(column, true); } return this.$nextTick(); }, setCurrentColumn: function setCurrentColumn(column) { this.clearCurrentRow(); this.clearCurrentColumn(); this.currentColumn = column; _xeUtils.default.arrayEach(this.$el.querySelectorAll(".".concat(column.id)), function (elem) { return _tools.DomTools.addClass(elem, 'col--current'); }); return this.$nextTick(); }, clearCurrentColumn: function clearCurrentColumn() { this.currentColumn = null; _xeUtils.default.arrayEach(this.$el.querySelectorAll('.col--current'), function (elem) { return _tools.DomTools.removeClass(elem, 'col--current'); }); return this.$nextTick(); }, /** * 列点击事件 * 如果是单击模式,则激活为编辑状态 * 如果是双击模式,则单击后选中状态 */ triggerCellClickEvent: function triggerCellClickEvent(evnt, params) { var _this22 = this; var $el = this.$el, highlightCurrentRow = this.highlightCurrentRow, editStore = this.editStore, _this$radioConfig2 = this.radioConfig, radioConfig = _this$radioConfig2 === void 0 ? {} : _this$radioConfig2, _this$selectConfig10 = this.selectConfig, selectConfig = _this$selectConfig10 === void 0 ? {} : _this$selectConfig10, _this$treeConfig = this.treeConfig, treeConfig = _this$treeConfig === void 0 ? {} : _this$treeConfig, editConfig = this.editConfig, _this$mouseConfig5 = this.mouseConfig, mouseConfig = _this$mouseConfig5 === void 0 ? {} : _this$mouseConfig5; var actived = editStore.actived; var column = params.column, cell = params.cell; // 如果是树形表格 if (treeConfig.trigger === 'row' || column.treeNode && treeConfig.trigger === 'cell') { this.triggerTreeExpandEvent(evnt, params); } if (!column.treeNode || !this.getEventTargetNode(evnt, $el, 'vxe-tree-wrapper').flag) { // 如果是高亮行 if (highlightCurrentRow) { if (radioConfig.trigger === 'row' || !this.getEventTargetNode(evnt, $el, 'vxe-checkbox').flag && !this.getEventTargetNode(evnt, $el, 'vxe-radio').flag) { this.triggerCurrentRowEvent(evnt, params); } } // 如果是单选 if ((radioConfig.trigger === 'row' || column.type === 'radio' && radioConfig.trigger === 'cell') && !this.getEventTargetNode(evnt, $el, 'vxe-radio').flag) { this.triggerRadioRowEvent(evnt, params); } // 如果是多选 if ((selectConfig.trigger === 'row' || column.type === 'selection' && selectConfig.trigger === 'cell') && !this.getEventTargetNode(evnt, params.cell, 'vxe-checkbox').flag) { this.handleToggleCheckRowEvent(params, evnt); } // 如果设置了单元格选中功能,则不会使用点击事件去处理(只能支持双击模式) if (!mouseConfig.checked) { if (editConfig) { if (!actived.args || cell !== actived.args.cell) { if (editConfig.trigger === 'click') { this.triggerValidate('blur').catch(function (e) { return e; }).then(function () { _this22.handleActived(params, evnt).then(function () { return _this22.triggerValidate('change'); }).catch(function (e) { return e; }); }); } else if (editConfig.trigger === 'dblclick') { if (editConfig.mode === 'row' && actived.row === params.row) { this.triggerValidate('blur').catch(function (e) { return e; }).then(function () { _this22.handleActived(params, evnt).then(function () { return _this22.triggerValidate('change'); }).catch(function (e) { return e; }); }); } else { this.handleSelected(params, evnt); } } } } } } _tools.UtilTools.emitEvent(this, 'cell-click', [params, evnt]); }, /** * 列双击点击事件 * 如果是双击模式,则激活为编辑状态 */ triggerCellDBLClickEvent: function triggerCellDBLClickEvent(evnt, params) { var _this23 = this; var editStore = this.editStore, editConfig = this.editConfig; var actived = editStore.actived; if (editConfig && editConfig.trigger === 'dblclick') { if (!actived.args || evnt.currentTarget !== actived.args.cell) { if (editConfig.mode === 'row') { this.triggerValidate('blur').catch(function (e) { return e; }).then(function () { _this23.handleActived(params, evnt).then(function () { return _this23.triggerValidate('change'); }).catch(function (e) { return e; }); }); } else if (editConfig.mode === 'cell') { this.handleActived(params, evnt).then(function () { return _this23.triggerValidate('change'); }).catch(function (e) { return e; }); } } } _tools.UtilTools.emitEvent(this, 'cell-dblclick', [params, evnt]); }, /** * 处理激活编辑 */ handleActived: function handleActived(params, evnt) { var _this24 = this; var editStore = this.editStore, editConfig = this.editConfig, tableColumn = this.tableColumn; var activeMethod = editConfig.activeMethod; var actived = editStore.actived; var row = params.row, column = params.column, cell = params.cell; var model = column.model, editRender = column.editRender; if (editRender && cell) { if (actived.row !== row || (editConfig.mode === 'cell' ? actived.column !== column : false)) { // 判断是否禁用编辑 var type = 'edit-disabled'; if (!activeMethod || activeMethod(params)) { this.clostTooltip(); this.clearCopyed(evnt); this.clearChecked(); this.clearSelected(evnt); this.clearActived(evnt); type = 'edit-actived'; column.renderHeight = cell.offsetHeight; actived.args = params; actived.row = row; actived.column = column; if (editConfig.mode === 'row') { tableColumn.forEach(function (column) { if (column.editRender) { column.model.value = _tools.UtilTools.getCellValue(row, column); column.model.update = false; } }); } else { model.value = _tools.UtilTools.getCellValue(row, column); model.update = false; } this.$nextTick(function () { _this24.handleFocus(params, evnt); }); } _tools.UtilTools.emitEvent(this, type, [params, evnt]); } else { var oldColumn = actived.column; if (oldColumn !== column) { var oldModel = oldColumn.model; if (oldModel.update) { _tools.UtilTools.setCellValue(row, oldColumn, oldModel.value); } this.clearValidate(); } column.renderHeight = cell.offsetHeight; actived.args = params; actived.column = column; setTimeout(function () { _this24.handleFocus(params, evnt); }); } } return this.$nextTick(); }, /** * 清除激活的编辑 */ clearActived: function clearActived(evnt) { var editStore = this.editStore; var actived = editStore.actived; var args = actived.args, row = actived.row, column = actived.column; if (row || column) { var model = column.model; if (model.update) { _tools.UtilTools.setCellValue(row, column, model.value); model.update = false; model.value = null; this.updateFooter(); } _tools.UtilTools.emitEvent(this, 'edit-closed', [args, evnt]); } actived.args = null; actived.row = null; actived.column = null; return this.clearValidate().then(this.recalculate); }, getActiveRow: function getActiveRow() { var $el = this.$el, editStore = this.editStore, tableData = this.tableData; var _editStore$actived = editStore.actived, args = _editStore$actived.args, row = _editStore$actived.row; if (args && tableData.indexOf(row) > -1 && $el.querySelectorAll('.vxe-body--column.col--actived').length) { return Object.assign({}, args); } return null; }, hasActiveRow: function hasActiveRow(row) { return this.editStore.actived.row === row; }, /** * 清除所选中源状态 */ clearSelected: function clearSelected(evnt) { var editStore = this.editStore, elemStore = this.elemStore; var selected = editStore.selected; selected.row = null; selected.column = null; var headerElem = elemStore['main-header-list']; var bodyElem = elemStore['main-body-list']; _xeUtils.default.arrayEach(headerElem.querySelectorAll('.col--title-selected'), function (elem) { return _tools.DomTools.removeClass(elem, 'col--title-selected'); }); _xeUtils.default.arrayEach([bodyElem.querySelector('.col--selected')], function (elem) { return _tools.DomTools.removeClass(elem, 'col--selected'); }); return this.$nextTick(); }, /** * 处理选中源 */ handleSelected: function handleSelected(params, evnt) { var _this25 = this; var _this$mouseConfig6 = this.mouseConfig, mouseConfig = _this$mouseConfig6 === void 0 ? {} : _this$mouseConfig6, editConfig = this.editConfig, editStore = this.editStore, elemStore = this.elemStore; var actived = editStore.actived, selected = editStore.selected; var row = params.row, column = params.column, cell = params.cell; var selectMethod = function selectMethod() { if (selected.row !== row || selected.column !== column) { if (actived.row !== row || (editConfig.mode === 'cell' ? actived.column !== column : false)) { _this25.clearChecked(evnt); _this25.clearIndexChecked(); _this25.clearHeaderChecked(); _this25.clearSelected(evnt); _this25.clearActived(evnt); selected.args = params; selected.row = row; selected.column = column; if (mouseConfig.selected) { var listElem = elemStore['main-body-list']; var rowid = _tools.UtilTools.getRowid(_this25, row); var trElem = listElem.querySelector("[data-rowid=\"".concat(rowid, "\"]")); var tdElem = trElem.querySelector(".".concat(column.id)); _tools.DomTools.addClass(tdElem, 'col--selected'); } // 如果配置了批量选中功能,则为批量选中状态 if (mouseConfig.checked) { var headerElem = elemStore['main-header-list']; _this25.handleChecked([[cell]]); _this25.handleHeaderChecked([[headerElem.querySelector(".".concat(column.id))]]); _this25.handleIndexChecked([[cell.parentNode.querySelector('.col--index')]]); } } } return _this25.$nextTick(); }; return selectMethod(); }, /** * 清除所有选中状态 */ clearChecked: function clearChecked(evnt) { var $refs = this.$refs, editStore = this.editStore, mouseConfig = this.mouseConfig; var checked = editStore.checked; if (mouseConfig && mouseConfig.checked) { var tableBody = $refs.tableBody; checked.rows = []; checked.columns = []; checked.tRows = []; checked.tColumns = []; var checkBorders = tableBody.$refs.checkBorders; checkBorders.style.display = 'none'; _xeUtils.default.arrayEach(tableBody.$el.querySelectorAll('.col--checked'), function (elem) { return _tools.DomTools.removeClass(elem, 'col--checked'); }); } return this.$nextTick(); }, /** * 处理所有选中 */ handleChecked: function handleChecked(rowNodes) { var checked = this.editStore.checked; this.clearChecked(); var cWidth = -2; var cHeight = -2; var offsetTop = 0; var offsetLeft = 0; _xeUtils.default.arrayEach(rowNodes, function (rows, rowIndex) { var isTop = rowIndex === 0; _xeUtils.default.arrayEach(rows, function (elem, colIndex) { var isLeft = colIndex === 0; if (isLeft && isTop) { offsetTop = elem.offsetTop; offsetLeft = elem.offsetLeft; } if (isTop) { cWidth += elem.offsetWidth; } if (isLeft) { cHeight += elem.offsetHeight; } _tools.DomTools.addClass(elem, 'col--checked'); }); }); var _this$$refs$tableBody = this.$refs.tableBody.$refs, checkBorders = _this$$refs$tableBody.checkBorders, checkTop = _this$$refs$tableBody.checkTop, checkRight = _this$$refs$tableBody.checkRight, checkBottom = _this$$refs$tableBody.checkBottom, checkLeft = _this$$refs$tableBody.checkLeft; checkBorders.style.display = 'block'; Object.assign(checkTop.style, { top: "".concat(offsetTop, "px"), left: "".concat(offsetLeft, "px"), width: "".concat(cWidth, "px") }); Object.assign(checkRight.style, { top: "".concat(offsetTop, "px"), left: "".concat(offsetLeft + cWidth, "px"), height: "".concat(cHeight, "px") }); Object.assign(checkBottom.style, { top: "".concat(offsetTop + cHeight, "px"), left: "".concat(offsetLeft, "px"), width: "".concat(cWidth, "px") }); Object.assign(checkLeft.style, { top: "".concat(offsetTop, "px"), left: "".concat(offsetLeft, "px"), height: "".concat(cHeight, "px") }); checked.rowNodes = rowNodes; }, handleAllChecked: function handleAllChecked(evnt) { var tableData = this.tableData, visibleColumn = this.visibleColumn, _this$mouseConfig7 = this.mouseConfig, mouseConfig = _this$mouseConfig7 === void 0 ? {} : _this$mouseConfig7, elemStore = this.elemStore; if (mouseConfig.checked) { evnt.preventDefault(); var headerListElem = elemStore['main-header-list']; var headerList = headerListElem.children; var bodyList = elemStore['main-body-list'].children; var column = visibleColumn.find(function (column) { return column.type === 'index'; }) || visibleColumn[0]; var cell = headerListElem.querySelector(".".concat(column.id)); var firstTrElem = bodyList[0]; var lastTrElem = bodyList[bodyList.length - 1]; var firstCell = firstTrElem.querySelector(".".concat(column.id)); var params = { $table: this, rowIndex: 0, row: tableData[0], column: visibleColumn.find(function (column) { return column.property; }) }; params.columnIndex = this.getColumnIndex(params.column); params.cell = _tools.DomTools.getCell(this, params); this.handleSelected(params, evnt); this.handleHeaderChecked(_tools.DomTools.getRowNodes(headerList, _tools.DomTools.getCellNodeIndex(cell.nextElementSibling), _tools.DomTools.getCellNodeIndex(cell.parentNode.lastElementChild))); this.handleIndexChecked(_tools.DomTools.getRowNodes(bodyList, _tools.DomTools.getCellNodeIndex(firstCell), _tools.DomTools.getCellNodeIndex(lastTrElem.querySelector(".".concat(column.id))))); this.handleChecked(_tools.DomTools.getRowNodes(bodyList, _tools.DomTools.getCellNodeIndex(firstCell.nextElementSibling), _tools.DomTools.getCellNodeIndex(lastTrElem.lastElementChild))); } }, handleIndexChecked: function handleIndexChecked(rowNodes) { var indexs = this.editStore.indexs; this.clearIndexChecked(); _xeUtils.default.arrayEach(rowNodes, function (rows) { _xeUtils.default.arrayEach(rows, function (elem) { _tools.DomTools.addClass(elem, 'col--index-checked'); }); }); indexs.rowNodes = rowNodes; }, clearIndexChecked: function clearIndexChecked() { var elemStore = this.elemStore; var bodyElem = elemStore['main-body-list']; _xeUtils.default.arrayEach(bodyElem.querySelectorAll('.col--index-checked'), function (elem) { return _tools.DomTools.removeClass(elem, 'col--index-checked'); }); return this.$nextTick(); }, handleHeaderChecked: function handleHeaderChecked(rowNodes) { var titles = this.editStore.titles; this.clearHeaderChecked(); _xeUtils.default.arrayEach(rowNodes, function (rows) { _xeUtils.default.arrayEach(rows, function (elem) { _tools.DomTools.addClass(elem, 'col--title-checked'); }); }); titles.rowNodes = rowNodes; }, clearHeaderChecked: function clearHeaderChecked() { var elemStore = this.elemStore; var headerElem = elemStore['main-header-list']; _xeUtils.default.arrayEach(headerElem.querySelectorAll('.col--title-checked'), function (elem) { return _tools.DomTools.removeClass(elem, 'col--title-checked'); }); return this.$nextTick(); }, /** * 处理所有选中的临时选中 */ // handleTempChecked (start, end, evnt) { // let { tableData, visibleColumn, editStore } = this // let { checked } = editStore // let { rows, tRows, columns, tColumns } = checked // let { rowIndex: sRowIndex, columnIndex: sColumnIndex } = start // let { rowIndex: eRowIndex, columnIndex: eColumnIndex } = end // if (tRows.length > rows.length) { // eColumnIndex = visibleColumn.indexOf(columns[columns.length - 1]) // } else if (tColumns.length > columns.length) { // eRowIndex = tableData.indexOf(rows[rows.length - 1]) // } // if (sRowIndex < eRowIndex) { // // 向下 // checked.tRows = tableData.slice(sRowIndex, eRowIndex + 1) // } else { // // 向上 // sRowIndex += rows.length // checked.tRows = tableData.slice(eRowIndex, sRowIndex) // } // if (sColumnIndex < eColumnIndex) { // // 向右 // checked.tColumns = visibleColumn.slice(Math.max(sColumnIndex, 1), eColumnIndex + 1) // } else { // // 向左 // sColumnIndex += columns.length // checked.tColumns = visibleColumn.slice(Math.max(eColumnIndex, 1), sColumnIndex) // } // }, /** * 清空已复制的内容 */ clearCopyed: function clearCopyed() { var $refs = this.$refs, editStore = this.editStore, keyboardConfig = this.keyboardConfig; var copyed = editStore.copyed; if (keyboardConfig && keyboardConfig.isCut) { var tableBody = $refs.tableBody; var copyBorders = $refs.tableBody.$refs.copyBorders; copyed.cut = false; copyed.rows = []; copyed.columns = []; copyBorders.style.display = 'none'; _xeUtils.default.arrayEach(tableBody.$el.querySelectorAll('.col--copyed'), function (elem) { return _tools.DomTools.removeClass(elem, 'col--copyed'); }); } return this.$nextTick(); }, /** * 处理复制 */ handleCopyed: function handleCopyed(cut, evnt) { var tableData = this.tableData, tableColumn = this.tableColumn, editStore = this.editStore; var copyed = editStore.copyed, checked = editStore.checked; var rowNodes = checked.rowNodes; this.clearCopyed(); var cWidth = -3; var cHeight = -3; var offsetTop = 0; var offsetLeft = 0; var columns = []; var rows = []; if (rowNodes.length) { var firstRows = rowNodes[0]; var _DomTools$getCellNode = _tools.DomTools.getCellNodeIndex(firstRows[0]), rowIndex = _DomTools$getCellNode.rowIndex, columnIndex = _DomTools$getCellNode.columnIndex; columns = tableColumn.slice(columnIndex, columnIndex + firstRows.length); rows = tableData.slice(rowIndex, rowIndex + rowNodes.length); } _xeUtils.default.arrayEach(rowNodes, function (rows, rowIndex) { var isTop = rowIndex === 0; _xeUtils.default.arrayEach(rows, function (elem, colIndex) { var isLeft = colIndex === 0; if (isLeft && isTop) { offsetTop = elem.offsetTop; offsetLeft = elem.offsetLeft; } if (isTop) { cWidth += elem.offsetWidth; } if (isLeft) { cHeight += elem.offsetHeight; } _tools.DomTools.addClass(elem, 'col--copyed'); }); }); var _this$$refs$tableBody2 = this.$refs.tableBody.$refs, copyBorders = _this$$refs$tableBody2.copyBorders, copyTop = _this$$refs$tableBody2.copyTop, copyRight = _this$$refs$tableBody2.copyRight, copyBottom = _this$$refs$tableBody2.copyBottom, copyLeft = _this$$refs$tableBody2.copyLeft; copyBorders.style.display = 'block'; Object.assign(copyTop.style, { top: "".concat(offsetTop, "px"), left: "".concat(offsetLeft, "px"), width: "".concat(cWidth, "px") }); Object.assign(copyRight.style, { top: "".concat(offsetTop, "px"), left: "".concat(offsetLeft + cWidth, "px"), height: "".concat(cHeight, "px") }); Object.assign(copyBottom.style, { top: "".concat(offsetTop + cHeight, "px"), left: "".concat(offsetLeft, "px"), width: "".concat(cWidth, "px") }); Object.assign(copyLeft.style, { top: "".concat(offsetTop, "px"), left: "".concat(offsetLeft, "px"), height: "".concat(cHeight, "px") }); copyed.cut = cut; copyed.rows = rows; copyed.columns = columns; copyed.rowNodes = rowNodes; }, /** * 处理粘贴 */ handlePaste: function handlePaste(evnt) { var tableData = this.tableData, visibleColumn = this.visibleColumn, editStore = this.editStore, elemStore = this.elemStore; var copyed = editStore.copyed, selected = editStore.selected; var cut = copyed.cut, rows = copyed.rows, columns = copyed.columns; if (rows.length && columns.length && selected.row && selected.column) { var _selected$args = selected.args, rowIndex = _selected$args.rowIndex, columnIndex = _selected$args.columnIndex; _xeUtils.default.arrayEach(rows, function (row, rIndex) { var offsetRow = tableData[rowIndex + rIndex]; if (offsetRow) { _xeUtils.default.arrayEach(columns, function (column, cIndex) { var offsetColumn = visibleColumn[columnIndex + cIndex]; if (offsetColumn) { _tools.UtilTools.setCellValue(offsetRow, offsetColumn, _tools.UtilTools.getCellValue(row, column)); } if (cut) { _tools.UtilTools.setCellValue(row, column, null); } }); } }); if (cut) { this.clearCopyed(); } var bodyList = elemStore['main-body-list'].children; var cell = selected.args.cell; var trElem = cell.parentNode; var colIndex = _xeUtils.default.arrayIndexOf(trElem.children, cell); var rIndex = _xeUtils.default.arrayIndexOf(bodyList, trElem); var targetTrElem = bodyList[rIndex + rows.length - 1]; var targetCell = targetTrElem.children[colIndex + columns.length - 1]; this.handleChecked(_tools.DomTools.getRowNodes(bodyList, _tools.DomTools.getCellNodeIndex(cell), _tools.DomTools.getCellNodeIndex(targetCell))); } }, /** * 处理聚焦 */ handleFocus: function handleFocus(params, evnt) { var column = params.column, cell = params.cell; var editRender = column.editRender; if (editRender) { var compRender = _vXETable.Renderer.get(editRender.name); var autofocus = editRender.autofocus, autoselect = editRender.autoselect; var inputElem; // 如果指定了聚焦 class if (autofocus) { inputElem = cell.querySelector(autofocus); } // 渲染器的聚焦处理 if (!inputElem && compRender && compRender.autofocus) { inputElem = cell.querySelector(compRender.autofocus); } if (inputElem) { inputElem[autoselect ? 'select' : 'focus'](); if (browse.msie) { var textRange = inputElem.createTextRange(); textRange.collapse(false); textRange.select(); } } } }, /** * 激活行编辑 */ setActiveRow: function setActiveRow(row) { return this.setActiveCell(row, this.visibleColumn.find(function (column) { return column.editRender; }).property); }, /** * 激活单元格编辑 */ setActiveCell: function setActiveCell(row, field) { var _this26 = this; return new Promise(function (resolve) { setTimeout(function () { if (row && field) { var column = _this26.visibleColumn.find(function (column) { return column.property === field; }); if (column && column.editRender) { var cell = _tools.DomTools.getCell(_this26, { row: row, column: column }); if (cell) { _this26.handleActived({ row: row, column: column, cell: cell }); _this26.lastCallTime = Date.now(); } } } resolve(_this26.$nextTick()); }); }); }, /** * 只对 trigger=dblclick 有效,选中单元格 */ setSelectCell: function setSelectCell(row, field) { var tableData = this.tableData, editConfig = this.editConfig, visibleColumn = this.visibleColumn; if (row && field && editConfig.trigger !== 'manual') { var column = visibleColumn.find(function (column) { return column.property === field; }); var rowIndex = tableData.indexOf(row); if (rowIndex > -1 && column) { var cell = _tools.DomTools.getCell(this, { row: row, rowIndex: rowIndex, column: column }); var params = { row: row, rowIndex: rowIndex, column: column, columnIndex: visibleColumn.indexOf(column), cell: cell }; this.handleSelected(params, {}); } } return this.$nextTick(); }, /** * 点击排序事件 */ triggerSortEvent: function triggerSortEvent(evnt, column, params, order) { this.sort(column.property, order); }, sort: function sort(field, order) { var visibleColumn = this.visibleColumn, tableFullColumn = this.tableFullColumn, remoteSort = this.remoteSort; var column = visibleColumn.find(function (item) { return item.property === field; }); var isRemote = _xeUtils.default.isBoolean(column.remoteSort) ? column.remoteSort : remoteSort; if (column.sortable || column.remoteSort) { if (!order) { order = column.order === 'desc' ? 'asc' : 'desc'; } if (column.order !== order) { tableFullColumn.forEach(function (column) { column.order = null; }); column.order = order; // 如果是服务端排序,则跳过本地排序处理 if (!isRemote) { this.handleData(true); } // 在 v3.0 中废弃 prop _tools.UtilTools.emitEvent(this, 'sort-change', [{ column: column, property: field, prop: field, field: field, order: order }]); } return this.$nextTick().then(this.updateStyle); } return this.$nextTick(); }, clearSort: function clearSort() { this.tableFullColumn.forEach(function (column) { column.order = null; }); this.tableFullData = this.data ? this.data.slice(0) : []; return this.handleData(true); }, filter: function filter(field) { return Promise.resolve(this.getColumnByField(field).filters); }, /** * 点击筛选事件 */ triggerFilterEvent: function triggerFilterEvent(evnt, column, params) { var $refs = this.$refs, filterStore = this.filterStore, overflowX = this.overflowX; if (filterStore.column === column && filterStore.visible) { filterStore.visible = false; } else { var targetElem = evnt.target; var bodyElem = $refs.tableBody.$el; var filterWrapper = $refs.filterWrapper; var _DomTools$getOffsetPo = _tools.DomTools.getOffsetPos(targetElem), top = _DomTools$getOffsetPo.top, left = _DomTools$getOffsetPo.left; if (overflowX) { left -= bodyElem.scrollLeft; } Object.assign(filterStore, { args: params, multiple: column.filterMultiple, options: column.filters, column: column, style: { zIndex: _conf.default.tooltip.zIndex, top: "".concat(top + targetElem.clientHeight + 6, "px"), left: "".concat(left, "px") }, visible: true }); filterStore.isAllSelected = filterStore.options.every(function (item) { return item.checked; }); filterStore.isIndeterminate = !filterStore.isAllSelected && filterStore.options.some(function (item) { return item.checked; }); this.$nextTick(function () { var filterWrapperElem = filterWrapper.$el; filterStore.style.top = "".concat(top + targetElem.clientHeight + 6, "px"); filterStore.style.left = "".concat(left - filterWrapperElem.clientWidth / 2 + 10, "px"); }); } }, // 确认筛选 confirmFilterEvent: function confirmFilterEvent(evnt) { var visibleColumn = this.visibleColumn, filterStore = this.filterStore, remoteFilter = this.remoteFilter, scrollXLoad = this.scrollXLoad, scrollYLoad = this.scrollYLoad; var column = filterStore.column; var property = column.property; var values = []; var datas = []; column.filters.forEach(function (item) { if (item.checked) { values.push(item.value); datas.push(item.data); } }); filterStore.visible = false; // 如果是服务端筛选,则跳过本地筛选处理 if (!remoteFilter) { this.handleData(true); } var filterList = []; visibleColumn.filter(function (column) { var property = column.property, filters = column.filters; var valueList = []; var dataList = []; if (filters && filters.length) { filters.forEach(function (item) { if (item.checked) { valueList.push(item.value); dataList.push(item.data); } }); // 在 v3.0 中废弃 prop filterList.push({ column: column, property: property, field: property, prop: property, values: valueList, datas: dataList }); } }); // 在 v3.0 中废弃 prop _tools.UtilTools.emitEvent(this, 'filter-change', [{ column: column, property: property, field: property, prop: property, values: values, datas: datas, filters: filterList }]); if (scrollXLoad || scrollYLoad) { this.clearScroll(); if (scrollYLoad) { this.updateScrollYSpace(); } } this.closeFilter(); this.$nextTick(this.recalculate); }, // 关闭筛选 closeFilter: function closeFilter(evnt) { Object.assign(this.filterStore, { isAllSelected: false, isIndeterminate: false, options: [], visible: false }); return this.$nextTick(); }, // 重置筛选 resetFilterEvent: function resetFilterEvent(evnt) { this.filterStore.options.forEach(function (item) { item.checked = false; item.data = item._data; }); this.confirmFilterEvent(evnt); }, clearFilter: function clearFilter(field) { var column = arguments.length ? this.getColumnByField(field) : null; var filterStore = this.filterStore; var handleClear = function handleClear(column) { var filters = column.filters; if (filters && filters.length) { filters.forEach(function (item) { item.checked = false; item.data = item._data; }); } }; if (column) { handleClear(column); } else { this.visibleColumn.forEach(handleClear); } if (!column || column !== filterStore.column) { Object.assign(filterStore, { isAllSelected: false, isIndeterminate: false, style: null, options: [], column: null, multiple: false, visible: false }); } return this.handleData(true).then(this.recalculate); }, /** * 展开行事件 */ triggerRowExpandEvent: function triggerRowExpandEvent(evnt, _ref4) { var row = _ref4.row; var rest = this.toggleRowExpansion(row); _tools.UtilTools.emitEvent(this, 'toggle-expand-change', [{ row: row, rowIndex: this.getRowIndex(row), $table: this }, evnt]); return rest; }, /** * 切换展开行 */ toggleRowExpansion: function toggleRowExpansion(row) { return this.setRowExpansion(row); }, /** * 处理默认展开行 */ handleDefaultRowExpand: function handleDefaultRowExpand() { var _this$expandConfig = this.expandConfig, expandConfig = _this$expandConfig === void 0 ? {} : _this$expandConfig, tableFullData = this.tableFullData, fullDataRowIdData = this.fullDataRowIdData; var expandAll = expandConfig.expandAll, expandRowKeys = expandConfig.expandRowKeys; if (expandAll) { this.expandeds = tableFullData.slice(0); } else if (expandRowKeys) { var defExpandeds = []; expandRowKeys.forEach(function (rowid) { if (fullDataRowIdData[rowid]) { defExpandeds.push(fullDataRowIdData[rowid].row); } }); this.expandeds = defExpandeds; } }, setAllRowExpansion: function setAllRowExpansion(expanded) { this.expandeds = expanded ? this.tableFullData.slice(0) : []; return this.$nextTick(); }, /** * 设置展开行,二个参数设置这一行展开与否 * 支持单行 * 支持多行 */ setRowExpansion: function setRowExpansion(rows, expanded) { var expandeds = this.expandeds, _this$expandConfig2 = this.expandConfig, expandConfig = _this$expandConfig2 === void 0 ? {} : _this$expandConfig2; var isToggle = arguments.length === 1; if (rows) { if (!_xeUtils.default.isArray(rows)) { rows = [rows]; } if (expandConfig.accordion) { // 只能同时展开一个 expandeds.length = 0; rows = rows.slice(rows.length - 1, rows.length); } rows.forEach(function (row) { var index = expandeds.indexOf(row); if (index > -1) { if (isToggle || !expanded) { expandeds.splice(index, 1); } } else { if (isToggle || expanded) { expandeds.push(row); } } }); } return this.$nextTick(); }, hasRowExpand: function hasRowExpand(row) { return this.expandeds.indexOf(row) > -1; }, clearRowExpand: function clearRowExpand() { this.expandeds = []; return this.$nextTick(); }, /** * 展开树节点事件 */ triggerTreeExpandEvent: function triggerTreeExpandEvent(evnt, _ref5) { var _this27 = this; var row = _ref5.row; var currentRow = this.currentRow, currentColumn = this.currentColumn; var rest = this.toggleTreeExpansion(row); _tools.UtilTools.emitEvent(this, 'toggle-tree-change', [{ row: row, rowIndex: this.getRowIndex(row), $table: this }, evnt]); if (currentRow) { this.$nextTick(function () { return _this27.setCurrentRow(currentRow); }); } else if (currentColumn) { this.$nextTick(function () { return _this27.setCurrentColumn(currentColumn); }); } return rest; }, /** * 切换/展开树节点 */ toggleTreeExpansion: function toggleTreeExpansion(row) { return this.setTreeExpansion(row); }, /** * 处理默认展开树节点 */ handleDefaultTreeExpand: function handleDefaultTreeExpand() { var treeConfig = this.treeConfig, tableFullData = this.tableFullData; if (treeConfig) { var expandAll = treeConfig.expandAll, expandRowKeys = treeConfig.expandRowKeys; var children = treeConfig.children; var treeExpandeds = []; if (expandAll) { _xeUtils.default.filterTree(tableFullData, function (row) { var rowChildren = row[children]; if (rowChildren && rowChildren.length) { treeExpandeds.push(row); } }, treeConfig); this.treeExpandeds = treeExpandeds; } else if (expandRowKeys) { var rowkey = _tools.UtilTools.getRowkey(this); expandRowKeys.forEach(function (rowid) { var matchObj = _xeUtils.default.findTree(tableFullData, function (item) { return rowid === _xeUtils.default.get(item, rowkey); }, treeConfig); var rowChildren = matchObj ? matchObj.item[children] : 0; if (rowChildren && rowChildren.length) { treeExpandeds.push(matchObj.item); } }); this.treeExpandeds = treeExpandeds; } } }, setAllTreeExpansion: function setAllTreeExpansion(expanded) { var tableFullData = this.tableFullData, treeConfig = this.treeConfig; var children = treeConfig.children; var treeExpandeds = []; if (expanded) { _xeUtils.default.eachTree(tableFullData, function (row) { var rowChildren = row[children]; if (rowChildren && rowChildren.length) { treeExpandeds.push(row); } }, treeConfig); } this.treeExpandeds = treeExpandeds; return this.$nextTick(); }, /** * 设置展开树形节点,二个参数设置这一行展开与否 * 支持单行 * 支持多行 */ setTreeExpansion: function setTreeExpansion(rows, expanded) { var tableFullData = this.tableFullData, treeExpandeds = this.treeExpandeds, treeConfig = this.treeConfig; var children = treeConfig.children; var isToggle = arguments.length === 1; if (rows) { if (!_xeUtils.default.isArray(rows)) { rows = [rows]; } if (treeConfig.accordion) { rows = rows.slice(rows.length - 1, rows.length); } rows.forEach(function (row) { var rowChildren = row[children]; if (rowChildren && rowChildren.length) { var index = treeExpandeds.indexOf(row); if (treeConfig.accordion) { // 同一级只能展开一个 var matchObj = _xeUtils.default.findTree(tableFullData, function (item) { return item === row; }, treeConfig); _xeUtils.default.remove(treeExpandeds, function (item) { return matchObj.items.indexOf(item) > -1; }); } if (index > -1) { if (isToggle || !expanded) { treeExpandeds.splice(index, 1); } } else { if (isToggle || expanded) { treeExpandeds.push(row); } } } }); } return this.$nextTick(); }, hasTreeExpand: function hasTreeExpand(row) { return this.treeExpandeds.indexOf(row) > -1; }, clearTreeExpand: function clearTreeExpand() { this.treeExpandeds = []; return this.$nextTick(); }, /** * 获取虚拟滚动状态 */ getVirtualScroller: function getVirtualScroller() { var $refs = this.$refs, scrollXLoad = this.scrollXLoad, scrollYLoad = this.scrollYLoad; var bodyElem = $refs.tableBody.$el; return { scrollX: scrollXLoad, scrollY: scrollYLoad, scrollTop: bodyElem.scrollTop, scrollLeft: bodyElem.scrollLeft }; }, /** * 横向 X 可视渲染事件处理 */ triggerScrollXEvent: function triggerScrollXEvent(evnt) { var _this28 = this; var $refs = this.$refs, visibleColumn = this.visibleColumn, scrollXStore = this.scrollXStore; var startIndex = scrollXStore.startIndex, renderSize = scrollXStore.renderSize, offsetSize = scrollXStore.offsetSize, visibleSize = scrollXStore.visibleSize; var scrollBodyElem = $refs.tableBody.$el; var scrollLeft = scrollBodyElem.scrollLeft; var toVisibleIndex = 0; var width = 0; for (var index = 0; index < visibleColumn.length; index++) { width += visibleColumn[index].renderWidth; if (scrollLeft < width) { toVisibleIndex = index; break; } } if (scrollXStore.visibleIndex !== toVisibleIndex) { var isReload; var preloadSize = 0; var isLeft = scrollXStore.visibleIndex > toVisibleIndex; // 如果渲染数量不充足 var isTooLow = renderSize < visibleSize * 3; // 除去可视条数剩余数量 var residueSize = renderSize - visibleSize; if (isLeft) { preloadSize = residueSize - (isTooLow ? Math.floor(residueSize / 2) : Math.floor(renderSize > visibleSize * 6 ? visibleSize * 3 : visibleSize * 1.5)); isReload = toVisibleIndex - offsetSize <= startIndex; } else { preloadSize = isTooLow ? Math.floor(residueSize / 2) : Math.floor(renderSize > visibleSize * 6 ? visibleSize * 3 : visibleSize * 1.5); isReload = toVisibleIndex + visibleSize + offsetSize >= startIndex + renderSize; } if (isReload) { scrollXStore.visibleIndex = toVisibleIndex; scrollXStore.startIndex = Math.min(Math.max(toVisibleIndex - preloadSize, 0), visibleColumn.length - renderSize); this.updateScrollXData(); this.$nextTick(function () { // scrollBodyElem.scrollLeft = scrollLeft _this28.updateStyle(); }); } } this.clostTooltip(); }, /** * 纵向 Y 可视渲染事件处理 */ triggerScrollYEvent: function triggerScrollYEvent(evnt) { var scrollYStore = this.scrollYStore; // webkit 浏览器使用最佳的渲染方式 if (isWebkit && scrollYStore.adaptive) { this.loadScrollYData(evnt); } else { this.debounceScrollY(evnt); } }, debounceScrollY: _xeUtils.default.debounce(function (evnt) { this.loadScrollYData(evnt); }, debounceScrollYDuration, { leading: false, trailing: true }), /** * 纵向 Y 可视渲染处理 */ loadScrollYData: function loadScrollYData(evnt) { var _this29 = this; var tableFullData = this.tableFullData, scrollYStore = this.scrollYStore; var startIndex = scrollYStore.startIndex, renderSize = scrollYStore.renderSize, offsetSize = scrollYStore.offsetSize, visibleSize = scrollYStore.visibleSize, rowHeight = scrollYStore.rowHeight; var scrollBodyElem = evnt.target; var scrollTop = scrollBodyElem.scrollTop; var toVisibleIndex = Math.ceil(scrollTop / rowHeight); if (scrollYStore.visibleIndex !== toVisibleIndex) { var isReload; var preloadSize = 0; var isTop = scrollYStore.visibleIndex > toVisibleIndex; // 如果渲染数量不充足 var isTooLow = renderSize < visibleSize * 3; // 除去可视条数剩余数量 var residueSize = renderSize - visibleSize; if (isTop) { preloadSize = residueSize - (isTooLow ? Math.floor(residueSize / 2) : Math.floor(renderSize > visibleSize * 6 ? visibleSize * 3 : visibleSize * 1.5)); isReload = toVisibleIndex - offsetSize <= startIndex; } else { preloadSize = isTooLow ? Math.floor(residueSize / 2) : Math.floor(renderSize > visibleSize * 6 ? visibleSize * 3 : visibleSize * 1.5); isReload = toVisibleIndex + visibleSize + offsetSize >= startIndex + renderSize; } if (isReload) { scrollYStore.visibleIndex = toVisibleIndex; scrollYStore.startIndex = Math.min(Math.max(toVisibleIndex - preloadSize, 0), tableFullData.length - renderSize); this.updateScrollYData(); this.$nextTick(function () { // scrollBodyElem.scrollTop = scrollTop _this29.clearHoverRow(); _this29.updateStyle(); }); } } }, // 计算可视渲染相关数据 computeScrollLoad: function computeScrollLoad() { var _this30 = this; return this.$nextTick().then(function () { var scrollXLoad = _this30.scrollXLoad, scrollYLoad = _this30.scrollYLoad, scrollYStore = _this30.scrollYStore, scrollXStore = _this30.scrollXStore, visibleColumn = _this30.visibleColumn, optimizeOpts = _this30.optimizeOpts; var scrollX = optimizeOpts.scrollX, scrollY = optimizeOpts.scrollY; var tableBody = _this30.$refs.tableBody; var tableBodyElem = tableBody ? tableBody.$el : null; var tableHeader = _this30.$refs.tableHeader; if (tableBodyElem) { // 计算 X 逻辑 if (scrollXLoad) { // 无法预知,默认取前 10 条平均宽度进行运算 var visibleSize = scrollX.vSize || Math.ceil(tableBodyElem.clientWidth / (visibleColumn.slice(0, 10).reduce(function (previous, column) { return previous + column.renderWidth; }, 0) / 10)); scrollXStore.visibleSize = visibleSize; if (scrollXStore.adaptive) { scrollXStore.offsetSize = visibleSize; scrollXStore.renderSize = visibleSize + 2; } _this30.updateScrollXData(); } else { _this30.updateScrollXSpace(); } // 计算 Y 逻辑 if (scrollYLoad) { if (scrollY.rHeight) { scrollYStore.rowHeight = scrollY.rHeight; } else { var firstTrElem = tableBodyElem.querySelector('tbody>tr'); if (!firstTrElem && tableHeader) { firstTrElem = tableHeader.$el.querySelector('thead>tr'); } if (firstTrElem) { scrollYStore.rowHeight = firstTrElem.clientHeight; } } var _visibleSize = scrollY.vSize || Math.ceil(tableBodyElem.clientHeight / scrollYStore.rowHeight); scrollYStore.visibleSize = _visibleSize; if (isWebkit && scrollYStore.adaptive) { scrollYStore.offsetSize = _visibleSize; scrollYStore.renderSize = _visibleSize + 2; } _this30.updateScrollYData(); } else { _this30.updateScrollYSpace(); } } _this30.$nextTick(_this30.updateStyle); }); }, updateScrollXData: function updateScrollXData() { var visibleColumn = this.visibleColumn, scrollXStore = this.scrollXStore; this.tableColumn = visibleColumn.slice(scrollXStore.startIndex, scrollXStore.startIndex + scrollXStore.renderSize); this.updateScrollXSpace(); }, // 更新横向 X 可视渲染上下剩余空间大小 updateScrollXSpace: function updateScrollXSpace() { var $refs = this.$refs, elemStore = this.elemStore, visibleColumn = this.visibleColumn, scrollXStore = this.scrollXStore, scrollXLoad = this.scrollXLoad, tableWidth = this.tableWidth, scrollbarWidth = this.scrollbarWidth; var tableHeader = $refs.tableHeader, tableBody = $refs.tableBody, tableFooter = $refs.tableFooter; var headerElem = tableHeader ? tableHeader.$el.querySelector('.vxe-table--header') : null; var bodyElem = tableBody.$el.querySelector('.vxe-table--body'); var footerElem = tableFooter ? tableFooter.$el.querySelector('.vxe-table--footer') : null; var leftSpaceWidth = visibleColumn.slice(0, scrollXStore.startIndex).reduce(function (previous, column) { return previous + column.renderWidth; }, 0); var marginLeft = ''; if (scrollXLoad) { marginLeft = "".concat(leftSpaceWidth, "px"); } if (headerElem) { headerElem.style.marginLeft = marginLeft; } bodyElem.style.marginLeft = marginLeft; if (footerElem) { footerElem.style.marginLeft = marginLeft; } var containerList = ['main']; containerList.forEach(function (name) { var layoutList = ['header', 'body', 'footer']; layoutList.forEach(function (layout) { var xSpaceElem = elemStore["".concat(name, "-").concat(layout, "-xSpace")]; if (xSpaceElem) { xSpaceElem.style.width = scrollXLoad ? "".concat(tableWidth + (layout === 'header' ? scrollbarWidth : 0), "px") : ''; } }); }); }, updateScrollYData: function updateScrollYData() { this.handleData(); this.updateScrollYSpace(); }, // 更新纵向 Y 可视渲染上下剩余空间大小 updateScrollYSpace: function updateScrollYSpace() { var elemStore = this.elemStore, scrollYStore = this.scrollYStore, scrollYLoad = this.scrollYLoad, afterFullData = this.afterFullData; var bodyHeight = afterFullData.length * scrollYStore.rowHeight; var topSpaceHeight = Math.max(scrollYStore.startIndex * scrollYStore.rowHeight, 0); var containerList = ['main', 'left', 'right']; var marginTop = ''; var ySpaceHeight = ''; if (scrollYLoad) { marginTop = "".concat(topSpaceHeight, "px"); ySpaceHeight = "".concat(bodyHeight, "px"); } containerList.forEach(function (name) { var layoutList = ['header', 'body', 'footer']; var tableElem = elemStore["".concat(name, "-body-table")]; if (tableElem) { tableElem.style.marginTop = marginTop; } layoutList.forEach(function (layout) { var ySpaceElem = elemStore["".concat(name, "-").concat(layout, "-ySpace")]; if (ySpaceElem) { ySpaceElem.style.height = ySpaceHeight; } }); }); }, scrollTo: function scrollTo(scrollLeft, scrollTop) { var bodyElem = this.$refs.tableBody.$el; if (_xeUtils.default.isNumber(scrollLeft)) { var tableFooter = this.$refs.tableFooter; if (tableFooter) { tableFooter.$el.scrollLeft = scrollLeft; } else { bodyElem.scrollLeft = scrollLeft; } } if (_xeUtils.default.isNumber(scrollTop)) { var rightBody = this.$refs.rightBody; if (rightBody) { rightBody.$el.scrollTop = scrollTop; } bodyElem.scrollTop = scrollTop; } return this.$nextTick(); }, scrollToRow: function scrollToRow(row, column) { if (row && this.fullDataRowMap.has(row)) { _tools.DomTools.rowToVisible(this, row); } return this.scrollToColumn(column); }, scrollToColumn: function scrollToColumn(column) { if (column && this.fullColumnMap.has(column)) { _tools.DomTools.colToVisible(this, column); } return this.$nextTick(); }, clearScroll: function clearScroll() { var _this31 = this; Object.assign(this.scrollXStore, { startIndex: 0 }); Object.assign(this.scrollYStore, { startIndex: 0 }); this.$nextTick(function () { var tableBody = _this31.$refs.tableBody; var tableBodyElem = tableBody ? tableBody.$el : null; var tableFooter = _this31.$refs.tableFooter; var tableFooterElem = tableFooter ? tableFooter.$el : null; if (tableBodyElem) { tableBodyElem.scrollTop = 0; tableBodyElem.scrollLeft = 0; } if (tableFooterElem) { tableFooterElem.scrollLeft = 0; } }); return this.$nextTick(); }, /** * 更新表尾合计 */ updateFooter: function updateFooter() { var showFooter = this.showFooter, tableColumn = this.tableColumn, footerMethod = this.footerMethod; if (showFooter && footerMethod) { this.footerData = tableColumn.length ? footerMethod({ columns: tableColumn, data: this.tableFullData }) : []; } return this.$nextTick(); }, /** * 更新列状态 * 如果组件值 v-model 发生 change 时,调用改函数用于更新某一列编辑状态 * 如果单元格配置了校验规则,则会进行校验 */ updateStatus: function updateStatus(scope, cellValue) { var _this32 = this; var customVal = !_xeUtils.default.isUndefined(cellValue); return this.$nextTick().then(function () { var $refs = _this32.$refs, tableData = _this32.tableData, editRules = _this32.editRules, validStore = _this32.validStore; if (scope && $refs.tableBody && editRules) { var row = scope.row, column = scope.column; var type = 'change'; if (_this32.hasCellRules(type, row, column)) { var rowIndex = tableData.indexOf(row); var cell = _tools.DomTools.getCell(_this32, { row: row, rowIndex: rowIndex, column: column }); if (cell) { return _this32.validCellRules(type, row, column, cellValue).then(function () { if (customVal && validStore.visible) { _tools.UtilTools.setCellValue(row, column, cellValue); } _this32.clearValidate(); }).catch(function (_ref6) { var rule = _ref6.rule; if (customVal) { _tools.UtilTools.setCellValue(row, column, cellValue); } _this32.showValidTooltip({ rule: rule, row: row, column: column, cell: cell }); }); } } } }); }, triggerValidate: function triggerValidate(type) { var _this33 = this; var editConfig = this.editConfig, editStore = this.editStore, editRules = this.editRules, validStore = this.validStore; var actived = editStore.actived; if (actived.row && editRules) { var _actived$args = actived.args, row = _actived$args.row, column = _actived$args.column, cell = _actived$args.cell; if (this.hasCellRules(type, row, column)) { return this.validCellRules(type, row, column).then(function () { if (editConfig.mode === 'row') { if (validStore.visible && validStore.row === row && validStore.column === column) { _this33.clearValidate(); } } }).catch(function (_ref7) { var rule = _ref7.rule; // 如果校验不通过与触发方式一致,则聚焦提示错误,否则跳过并不作任何处理 if (!rule.trigger || type === rule.trigger) { var rest = { rule: rule, row: row, column: column, cell: cell }; _this33.showValidTooltip(rest); return Promise.reject(rest); } return Promise.resolve(); }); } } return Promise.resolve(); }, /** * 与 validate 一致行为,区别就是会校验所有并返回所有不通过的所有列 */ fullValidate: function fullValidate(rows, cb) { return this.beginValidate(rows, cb, true); }, /** * 对表格数据进行校验 */ validate: function validate(rows, cb) { return this.beginValidate(rows, cb); }, /** * 对表格数据进行校验 * 如果传 row 指定行记录,则只验证传入的行 * 如果传 rows 为多行记录,则只验证传入的行 * 如果只传 callback 否则默认验证整个表格数据 * 返回 Promise 对象,或者使用回调方式 */ beginValidate: function beginValidate(rows, cb, isAll) { var _this34 = this; var validRest = {}; var status = true; var editRules = this.editRules, tableData = this.tableData, tableFullData = this.tableFullData, scrollYLoad = this.scrollYLoad, scrollYStore = this.scrollYStore; var vaildDatas = scrollYLoad ? tableFullData : tableData; if (rows) { if (_xeUtils.default.isFunction(rows)) { cb = rows; } else { vaildDatas = _xeUtils.default.isArray(rows) ? rows : [rows]; } } var rowValids = []; this.lastCallTime = Date.now(); this.clearValidate(); if (editRules) { var columns = this.getColumns(); vaildDatas.forEach(function (row) { var colVailds = []; columns.forEach(function (column, columnIndex) { if (_xeUtils.default.has(editRules, column.property)) { colVailds.push(new Promise(function (resolve, reject) { _this34.validCellRules('all', row, column).then(resolve).catch(function (_ref8) { var rule = _ref8.rule, rules = _ref8.rules; var rest = { rule: rule, rules: rules, rowIndex: _this34.getRowIndex(row), row: row, columnIndex: columnIndex, column: column }; if (isAll) { if (!validRest[column.property]) { validRest[column.property] = []; } validRest[column.property].push(rest); return resolve(); } return reject(rest); }); })); } }); rowValids.push(Promise.all(colVailds)); }); return Promise.all(rowValids).then(function () { var ruleProps = Object.keys(validRest); if (ruleProps.length) { return Promise.reject(validRest[ruleProps[0]][0]); } if (cb) { cb(status); } }).catch(function (params) { var args = isAll ? validRest : _defineProperty({}, params.column.property, params); return new Promise(function (resolve, reject) { var rowIndex = params.rowIndex; var finish = function finish() { params.cell = _tools.DomTools.getCell(_this34, params); _this34.handleValidError(params); if (cb) { status = false; resolve(cb(status, args)); } else { reject(args); } }; if (scrollYLoad) { var startIndex = scrollYStore.startIndex, renderSize = scrollYStore.renderSize, rowHeight = scrollYStore.rowHeight; if (rowIndex < startIndex || rowIndex > startIndex + renderSize) { var bodyElem = _this34.$refs.tableBody.$el; bodyElem.scrollTop = (rowIndex - 1) * rowHeight; return setTimeout(finish, debounceScrollYDuration * 2); } } finish(); }); }); } else { if (cb) { cb(status); } } return Promise.resolve(true); }, hasCellRules: function hasCellRules(type, row, column) { var editRules = this.editRules; var property = column.property; if (property && editRules) { var rules = _xeUtils.default.get(editRules, property); return rules && rules.find(function (rule) { return type === 'all' || !rule.trigger || type === rule.trigger; }); } return false; }, /** * 校验数据 * 按表格行、列顺序依次校验(同步或异步) * 校验规则根据索引顺序依次校验,如果是异步则会等待校验完成才会继续校验下一列 * 如果校验失败则,触发回调或者Promise,结果返回一个 Boolean 值 * 如果是传回调方式这返回一个 Boolean 值和校验不通过列的错误消息 * * rule 配置: * required=Boolean 是否必填 * min=Number 最小长度 * max=Number 最大长度 * validator=Function(rule, value, callback, {rules, row, column, rowIndex, columnIndex}) 自定义校验 * trigger=blur|change 触发方式(除非特殊场景,否则默认为空就行) */ validCellRules: function validCellRules(type, row, column, val) { var _this35 = this; var editRules = this.editRules; var property = column.property; var errorRules = []; var cellVailds = []; if (property && editRules) { var rules = _xeUtils.default.get(editRules, property); var cellValue = _xeUtils.default.isUndefined(val) ? _xeUtils.default.get(row, property) : val; if (rules) { rules.forEach(function (rule) { cellVailds.push(new Promise(function (resolve) { var isRequired = rule.required === true; if (type === 'all' || !rule.trigger || type === rule.trigger) { if (_xeUtils.default.isFunction(rule.validator)) { rule.validator(rule, cellValue, function (e) { if (_xeUtils.default.isError(e)) { var cusRule = { type: 'custom', trigger: rule.trigger, message: e.message, rule: new Rule(rule) }; errorRules.push(new Rule(cusRule)); } return resolve(); }, { rules: rules, row: row, column: column, rowIndex: _this35.getRowIndex(row), columnIndex: _this35.getColumnIndex(column) }); } else { var len; var restVal = cellValue; var isNumber = rule.type === 'number'; var isEmpty = cellValue === null || cellValue === undefined || cellValue === ''; if (isNumber) { restVal = _xeUtils.default.toNumber(cellValue); } else { len = _xeUtils.default.getSize(restVal); } if (isRequired && isEmpty) { errorRules.push(new Rule(rule)); } else if (isNumber && isNaN(cellValue) || _xeUtils.default.isRegExp(rule.pattern) && !rule.pattern.test(cellValue) || _xeUtils.default.isNumber(rule.min) && (isNumber ? restVal < rule.min : len < rule.min) || _xeUtils.default.isNumber(rule.max) && (isNumber ? restVal > rule.max : len > rule.max)) { errorRules.push(new Rule(rule)); } resolve(); } } else { resolve(); } })); }); } } return Promise.all(cellVailds).then(function () { if (errorRules.length) { var rest = { rules: errorRules, rule: errorRules[0] }; return Promise.reject(rest); } }); }, clearValidate: function clearValidate() { var validTip = this.$refs.validTip; Object.assign(this.validStore, { visible: false, row: null, column: null, content: '', rule: null }); if (validTip && validTip.visible) { validTip.close(); } return this.$nextTick(); }, /** * 聚焦到校验通过的单元格并弹出校验错误提示 */ handleValidError: function handleValidError(params) { var _this36 = this; this.handleActived(params, { type: 'valid-error', trigger: 'call' }).then(function () { return _this36.showValidTooltip(params); }); }, /** * 弹出校验错误提示 */ showValidTooltip: function showValidTooltip(params) { var _this37 = this; var $refs = this.$refs, height = this.height, tableData = this.tableData, validOpts = this.validOpts; var rule = params.rule, row = params.row, column = params.column, cell = params.cell; var validTip = $refs.validTip; var content = rule.message; this.$nextTick(function () { Object.assign(_this37.validStore, { row: row, column: column, rule: rule, content: content, visible: true }); if (validTip && (validOpts.message === 'tooltip' || validOpts.message === 'default' && !height && tableData.length < 2)) { validTip.toVisible(cell, content); } _tools.UtilTools.emitEvent(_this37, 'valid-error', [params]); }); }, /** * 导出 csv 文件 * 如果是树表格,则默认是导出所有节点 * 如果是启用了可视渲染,则只能导出数据源,可以配合 dataFilterMethod 函数自行转换数据 */ exportCsv: function exportCsv(options) { var visibleColumn = this.visibleColumn, scrollXLoad = this.scrollXLoad, scrollYLoad = this.scrollYLoad, treeConfig = this.treeConfig; var opts = Object.assign({ filename: 'table.csv', original: !!treeConfig, isHeader: true, isFooter: true, download: true, data: null, columns: null, columnFilterMethod: function columnFilterMethod(column) { return ['index', 'selection', 'radio'].indexOf(column.type) === -1 && column.property; }, dataFilterMethod: null }, options); if (opts.filename.indexOf('.csv') === -1) { opts.filename += '.csv'; } if (!opts.original) { if (scrollXLoad || scrollYLoad) { opts.original = true; console.warn('[vxe-table] Virtual scrolling can only export source data, please set original=true.'); } } var columns = visibleColumn; var oData = this.tableFullData; if (treeConfig) { oData = _xeUtils.default.toTreeArray(oData, treeConfig); } return _tools.ExportTools.downloadCsc(opts, _tools.ExportTools.getCsvContent(this, opts, columns, oData)); }, /************************* * Publish methods *************************/ // 与工具栏对接 connect: function connect(_ref10) { var toolbar = _ref10.toolbar; this._toolbar = toolbar; }, // 检查触发源是否属于目标节点 getEventTargetNode: _tools.DomTools.getEventTargetNode /************************* * Publish methods *************************/ } }; exports.default = _default2;
const getenv = require('getenv') const packages = require('../../package.json') require("dotenv").config() const getVersion = () => { const packageVersion = packages.version const lastDotIndex = packageVersion.lastIndexOf('.') const version = packageVersion.slice(0, lastDotIndex) return `${version}.${getenv('BUILD_NUMBER')}` } // const debug = getenv('NODE_ENV') === 'development' const debug = false module.exports = { VERSION: getVersion(), APP_NAME: packages.name, NODE_ENV: getenv('NODE_ENV'), DEBUG: debug, LOG_LEVEL: getenv('LOG_LEVEL'), }
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-09-14 16:00 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('osf', '0058_merge_20170913_2232'), ('osf', '0055_update_metaschema_active'), ] operations = [ ]
// Generated by CoffeeScript 2.5.1 // # `nikita.lxd.network.delete` // Delete an existing lxd network. // ## Options // * `network` (required, string) // The network name. // ## Callback parameters // * `err` // Error object if any. // * `status` // True if the network was deleted. // ## Example // ```js // require('nikita') // .lxd.network.delete({ // network: 'network0' // }, function(err, {status}){ // console.log( err ? err.message : 'Network deleted: ' + status); // }) // ``` // ## Source Code module.exports = function({options}) { this.log({ message: "Entering lxd.network.delete", level: "DEBUG", module: "@nikitajs/lxd/lib/network/delete" }); if (!options.network) { //Check args throw Error("Invalid Option: network is required"); } //Execute return this.system.execute({ cmd: `lxc network list --format csv | grep ${options.network} || exit 42 ${['lxc', 'network', 'delete', options.network].join(' ')}`, code_skipped: 42 }); };
import argparse import sys import numpy as np import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data import unsupervised_learning.tensorflow.models as models def get_mnist(): mnist = input_data.read_data_sets(FLAGS.data_dir, one_hot=False) Xtrain, Ytrain = mnist.train.images, mnist.train.labels Xtest, Ytest = mnist.test.images, mnist.test.labels Xtrain = Xtrain.astype(np.float32) Xtest = Xtest.astype(np.float32) return Xtest, Xtrain, Ytest, Ytrain def main(_): Xtest, Xtrain, Ytest, Ytrain = get_mnist() input_size = Xtrain.shape[-1] num_classes = Ytrain.shape[-1] if FLAGS.pretrain_model.upper() == 'AUTOENCODER': pretrain_model = models.AutoEncoder elif FLAGS.pretrain_model.upper() == 'RBM': pretrain_model = models.RBM else: raise Exception("Unknown pre-training model selected!") model = models.DNN(input_size, [256, 128, 64], num_classes, learning_rate=FLAGS.lr, unsupervised_model_fn=pretrain_model) with tf.Session() as session: session.run(tf.global_variables_initializer()) model.set_session(session) model.fit(Xtrain, Ytrain, Xtest, Ytest, epochs=FLAGS.epochs, batch_size=FLAGS.batch_size, pretrain=FLAGS.pretrain, show_fig=FLAGS.show_fig) if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--data_dir', type=str, default='../../data/tmp/mnist', help='Directory for storing input data') parser.add_argument('--lr', type=float, default=1e-2, help='The learning rate') parser.add_argument('--batch_size', type=int, default=100, help='The batch size while training') parser.add_argument('--epochs', type=int, default=1, help='The number of training epochs') parser.add_argument('--pretrain', type=bool, default=True, help='Whether to use unsupervised layer-wise pre-training') parser.add_argument('--pretrain_model', type=str, default='RBM', help='Either "RBM" or "Autoencoder" as the model used for unsupervised layer-wise pre-training') parser.add_argument('--show_fig', type=bool, default=True, help='Whether to show the learning-curve or not') FLAGS, unparsed = parser.parse_known_args() tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
import tensorflow as tf class grade_dec_drone_net: def __init__(self, state_size, action_size, learning_rate, name='dNet'): self.state_size = state_size self.action_size = int(action_size) self.learning_rate = float(learning_rate) with tf.variable_scope(name): with tf.name_scope("inputs"): self.inputs_ = tf.placeholder(tf.float32, [None, 1, 4, 4], name="inputs_") self.actions = tf.placeholder(tf.int32, [None, action_size], name="actions") self.discounted_episode_rewards_ = tf.placeholder(tf.float32, [None, ], name="discounted_episode_rewards_") # Add this placeholder for having this variable in tensorboard self.mean_reward_ = tf.placeholder(tf.float32, name="mean_reward") with tf.name_scope("flatten"): self.flatten = tf.layers.flatten(self.inputs_) with tf.name_scope("fc1"): self.fc1 = tf.layers.dense(inputs=self.flatten, units=32, activation = tf.nn.relu, kernel_initializer=tf.contrib.layers.xavier_initializer(), name="fc1") with tf.name_scope("logits"): self.logits = tf.layers.dense(inputs=self.fc1, units=self.action_size, activation=None) with tf.name_scope("softmax"): self.action_distribution = tf.nn.softmax(self.logits) # Not sure if I need to use V2, if we want to update labels, we should use tf.variables with tf.name_scope("loss"): self.neg_log_prob = tf.nn.softmax_cross_entropy_with_logits_v2(logits=self.logits, labels=self.actions) self.loss = tf.reduce_mean(self.neg_log_prob * self.discounted_episode_rewards_) with tf.name_scope("train"): self.train_opt = tf.train.RMSPropOptimizer(self.learning_rate).minimize(self.loss)
"""tests the pyNastran solver""" from __future__ import print_function, unicode_literals import os import unittest import pyNastran from pyNastran.bdf.test.test_bdf import run_and_compare_fems from pyNastran.dev.bdf_vectorized.bdf import read_bdf as read_bdfv from pyNastran.bdf.bdf import read_bdf #from pyNastran.utils.log import SimpleLogger #from pyNastran.dev.bdf_vectorized.solver.solver import Solver pkg_path = pyNastran.__path__[0] test_path = os.path.join(pkg_path, '..', 'models') #log = SimpleLogger('warning', encoding='utf8') def read_write_compare(bdf_filename, bdf_filename_out): """runs checks on the two bdfs""" vmodel = read_bdfv(bdf_filename) vmodel.write_bdf(bdf_filename_out) run_and_compare_fems( bdf_filename, bdf_filename_out, debug=False, xref=True, check=True, punch=False, cid=None, mesh_form=None, print_stats=False, encoding=None, sum_load=True, size=8, is_double=False, stop=False, nastran='', post=-1, dynamic_vars=None, quiet=False, dumplines=False, dictsort=False, nerrors=0, dev=False, crash_cards=None, run_extract_bodies=False, ) class TestReadWriteVectorized(unittest.TestCase): """tests the vectorized bdf read/write against the non-vectorized version""" @staticmethod def test_solid_bending(): """vectorized vs. standard test on solid_bending.bdf""" bdf_filename = os.path.join(test_path, 'solid_bending', 'solid_bending.bdf') bdf_filename_out = os.path.join(test_path, 'solid_bending', 'solid_bending2.bdf') read_write_compare(bdf_filename, bdf_filename_out) os.remove(bdf_filename_out) @staticmethod def test_static_solid_shell_bar(): """vectorized vs. standard test on static_solid_shell_bar.bdf""" bdf_filename = os.path.join(test_path, 'sol_101_elements', 'static_solid_shell_bar.bdf') bdf_filename_out = os.path.join(test_path, 'sol_101_elements', 'static_solid_shell_bar2.bdf') read_write_compare(bdf_filename, bdf_filename_out) os.remove(bdf_filename_out) @staticmethod def test_mode_solid_shell_bar(): """vectorized vs. standard test on mode_solid_shell_bar.bdf""" bdf_filename = os.path.join(test_path, 'sol_101_elements', 'mode_solid_shell_bar.bdf') bdf_filename_out = os.path.join(test_path, 'sol_101_elements', 'mode_solid_shell_bar2.bdf') read_write_compare(bdf_filename, bdf_filename_out) os.remove(bdf_filename_out) @staticmethod def test_freq_solid_shell_bar(): """vectorized vs. standard test on freq_solid_shell_bar.bdf""" bdf_filename = os.path.join(test_path, 'sol_101_elements', 'freq_solid_shell_bar.bdf') bdf_filename_out = os.path.join(test_path, 'sol_101_elements', 'freq_solid_shell_bar2.bdf') read_write_compare(bdf_filename, bdf_filename_out) os.remove(bdf_filename_out) @staticmethod def test_bwb(): """vectorized vs. standard test on bwb_saero.bdf""" bdf_filename = os.path.join(test_path, 'bwb', 'bwb_saero.bdf') bdf_filename_out = os.path.join(test_path, 'bwb', 'bwb_saero2.bdf') read_write_compare(bdf_filename, bdf_filename_out) os.remove(bdf_filename_out) @staticmethod def test_isat_01(): """vectorized vs. standard test on ISat_Dploy_Sm.dat""" bdf_filename = os.path.join(test_path, 'iSat', 'ISat_Dploy_Sm.dat') bdf_filename_out = os.path.join(test_path, 'iSat', 'ISat_Dploy_Sm2.dat') read_write_compare(bdf_filename, bdf_filename_out) os.remove(bdf_filename_out) @staticmethod def test_isat_02(): """vectorized vs. standard test on ISat_Launch_Sm_4pt.dat""" bdf_filename = os.path.join(test_path, 'iSat', 'ISat_Launch_Sm_4pt.dat') bdf_filename_outv = os.path.join(test_path, 'iSat', 'ISat_Launch_Sm_4ptv.dat') bdf_filename_out = os.path.join(test_path, 'iSat', 'ISat_Launch_Sm_4pt2.dat') vmodel = read_bdfv(bdf_filename) vmodel.write_bdf(bdf_filename_outv) model = read_bdf(bdf_filename) model.write_bdf(bdf_filename_out) run_and_compare_fems( bdf_filename, bdf_filename_outv, debug=False, xref=True, check=True, punch=False, cid=None, mesh_form=None, print_stats=False, encoding=None, sum_load=False, size=8, is_double=False, stop=False, nastran='', post=-1, dynamic_vars=None, quiet=False, dumplines=False, dictsort=False, nerrors=0, dev=False, crash_cards=None, ) os.remove(bdf_filename_out) @staticmethod def test_isat_03(): """vectorized vs. standard test on ISat_Launch_Sm_Rgd.dat""" bdf_filename = os.path.join(test_path, 'iSat', 'ISat_Launch_Sm_Rgd.dat') #bdf_filename_outv = os.path.join(test_path, 'iSat', 'ISat_Launch_Sm_Rgdv.dat') bdf_filename_out = os.path.join(test_path, 'iSat', 'ISat_Launch_Sm_Rgd2.dat') read_write_compare(bdf_filename, bdf_filename_out) os.remove(bdf_filename_out) def test_isat_04(self): """vectorized vs. standard test on iSat_launch_100Hz.dat""" bdf_filename = os.path.join(test_path, 'iSat', 'iSat_launch_100Hz.dat') #bdf_filename_outv = os.path.join(test_path, 'iSat', 'ISat_Launch_Sm_Rgdv.dat') bdf_filename_out = os.path.join(test_path, 'iSat', 'iSat_launch_100Hz2.dat') read_write_compare(bdf_filename, bdf_filename_out) os.remove(bdf_filename_out) if __name__ == '__main__': # pragma: no cover unittest.main()
############################################################### # NATS-Bench (https://arxiv.org/pdf/2009.00437.pdf) # # The code to draw Figure 6 in our paper. # ############################################################### # Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2020.06 # ############################################################### # Usage: python exps/NATS-Bench/draw-fig8.py # ############################################################### import os, gc, sys, time, torch, argparse import numpy as np from typing import List, Text, Dict, Any from shutil import copyfile from collections import defaultdict, OrderedDict from copy import deepcopy from pathlib import Path import matplotlib import seaborn as sns matplotlib.use('agg') import matplotlib.pyplot as plt import matplotlib.ticker as ticker lib_dir = (Path(__file__).parent / '..' / '..' / 'lib').resolve() if str(lib_dir) not in sys.path: sys.path.insert(0, str(lib_dir)) from config_utils import dict2config, load_config from nats_bench import create from log_utils import time_string plt.rcParams.update({ "text.usetex": True, "font.family": "sans-serif", "font.sans-serif": ["Helvetica"]}) ## for Palatino and other serif fonts use: plt.rcParams.update({ "text.usetex": True, "font.family": "serif", "font.serif": ["Palatino"], }) def fetch_data(root_dir='./output/search', search_space='tss', dataset=None): ss_dir = '{:}-{:}'.format(root_dir, search_space) alg2all = OrderedDict() # alg2name['REINFORCE'] = 'REINFORCE-0.01' # alg2name['RANDOM'] = 'RANDOM' # alg2name['BOHB'] = 'BOHB' if search_space == 'tss': hp = '$\mathcal{H}^{1}$' if dataset == 'cifar10': suffixes = ['-T1200000', '-T1200000-FULL'] elif search_space == 'sss': hp = '$\mathcal{H}^{2}$' if dataset == 'cifar10': suffixes = ['-T200000', '-T200000-FULL'] else: raise ValueError('Unkonwn search space: {:}'.format(search_space)) alg2all[r'REA ($\mathcal{H}^{0}$)'] = dict( path=os.path.join(ss_dir, dataset + suffixes[0], 'R-EA-SS3', 'results.pth'), color='b', linestyle='-') alg2all[r'REA ({:})'.format(hp)] = dict( path=os.path.join(ss_dir, dataset + suffixes[1], 'R-EA-SS3', 'results.pth'), color='b', linestyle='--') for alg, xdata in alg2all.items(): data = torch.load(xdata['path']) for index, info in data.items(): info['time_w_arch'] = [(x, y) for x, y in zip(info['all_total_times'], info['all_archs'])] for j, arch in enumerate(info['all_archs']): assert arch != -1, 'invalid arch from {:} {:} {:} ({:}, {:})'.format(alg, search_space, dataset, index, j) xdata['data'] = data return alg2all def query_performance(api, data, dataset, ticket): results, is_size_space = [], api.search_space_name == 'size' for i, info in data.items(): time_w_arch = sorted(info['time_w_arch'], key=lambda x: abs(x[0]-ticket)) time_a, arch_a = time_w_arch[0] time_b, arch_b = time_w_arch[1] info_a = api.get_more_info(arch_a, dataset=dataset, hp=90 if is_size_space else 200, is_random=False) info_b = api.get_more_info(arch_b, dataset=dataset, hp=90 if is_size_space else 200, is_random=False) accuracy_a, accuracy_b = info_a['test-accuracy'], info_b['test-accuracy'] interplate = (time_b-ticket) / (time_b-time_a) * accuracy_a + (ticket-time_a) / (time_b-time_a) * accuracy_b results.append(interplate) # return sum(results) / len(results) return np.mean(results), np.std(results) y_min_s = {('cifar10', 'tss'): 91, ('cifar10', 'sss'): 91, ('cifar100', 'tss'): 65, ('cifar100', 'sss'): 65, ('ImageNet16-120', 'tss'): 36, ('ImageNet16-120', 'sss'): 40} y_max_s = {('cifar10', 'tss'): 94.5, ('cifar10', 'sss'): 93.5, ('cifar100', 'tss'): 72.5, ('cifar100', 'sss'): 70.5, ('ImageNet16-120', 'tss'): 46, ('ImageNet16-120', 'sss'): 46} x_axis_s = {('cifar10', 'tss'): 1200000, ('cifar10', 'sss'): 200000, ('cifar100', 'tss'): 400, ('cifar100', 'sss'): 400, ('ImageNet16-120', 'tss'): 1200, ('ImageNet16-120', 'sss'): 600} name2label = {'cifar10': 'CIFAR-10', 'cifar100': 'CIFAR-100', 'ImageNet16-120': 'ImageNet-16-120'} spaces2latex = {'tss': r'$\mathcal{S}_{t}$', 'sss': r'$\mathcal{S}_{s}$',} # FuncFormatter can be used as a decorator @ticker.FuncFormatter def major_formatter(x, pos): if x == 0: return '0' else: return "{:.2f}e5".format(x/1e5) def visualize_curve(api_dict, vis_save_dir): vis_save_dir = vis_save_dir.resolve() vis_save_dir.mkdir(parents=True, exist_ok=True) dpi, width, height = 250, 5000, 2000 figsize = width / float(dpi), height / float(dpi) LabelSize, LegendFontsize = 28, 28 def sub_plot_fn(ax, search_space, dataset): max_time = x_axis_s[(dataset, search_space)] alg2data = fetch_data(search_space=search_space, dataset=dataset) alg2accuracies = OrderedDict() total_tickets = 200 time_tickets = [float(i) / total_tickets * int(max_time) for i in range(total_tickets)] ax.set_xlim(0, x_axis_s[(dataset, search_space)]) ax.set_ylim(y_min_s[(dataset, search_space)], y_max_s[(dataset, search_space)]) for tick in ax.get_xticklabels(): tick.set_rotation(25) tick.set_fontsize(LabelSize - 6) for tick in ax.get_yticklabels(): tick.set_fontsize(LabelSize - 6) ax.xaxis.set_major_formatter(major_formatter) for idx, (alg, xdata) in enumerate(alg2data.items()): accuracies = [] for ticket in time_tickets: # import pdb; pdb.set_trace() accuracy, accuracy_std = query_performance( api_dict[search_space], xdata['data'], dataset, ticket) accuracies.append(accuracy) # print('{:} plot alg : {:10s}, final accuracy = {:.2f}$\pm${:.2f}'.format(time_string(), alg, accuracy, accuracy_std)) print('{:} plot alg : {:10s} on {:}'.format(time_string(), alg, search_space)) alg2accuracies[alg] = accuracies ax.plot(time_tickets, accuracies, c=xdata['color'], linestyle=xdata['linestyle'], label='{:}'.format(alg)) ax.set_xlabel('Estimated wall-clock time', fontsize=LabelSize) ax.set_ylabel('Test accuracy', fontsize=LabelSize) ax.set_title(r'Results on {:} over {:}'.format(name2label[dataset], spaces2latex[search_space]), fontsize=LabelSize) ax.legend(loc=4, fontsize=LegendFontsize) fig, axs = plt.subplots(1, 2, figsize=figsize) sub_plot_fn(axs[0], 'tss', 'cifar10') sub_plot_fn(axs[1], 'sss', 'cifar10') save_path = (vis_save_dir / 'full-curve.png').resolve() fig.savefig(save_path, dpi=dpi, bbox_inches='tight', format='png') print ('{:} save into {:}'.format(time_string(), save_path)) plt.close('all') if __name__ == '__main__': parser = argparse.ArgumentParser(description='NATS-Bench: Benchmarking NAS algorithms for Architecture Topology and Size', formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('--save_dir', type=str, default='output/vis-nas-bench/nas-algos-vs-h', help='Folder to save checkpoints and log.') args = parser.parse_args() save_dir = Path(args.save_dir) api_tss = create(None, 'tss', fast_mode=True, verbose=False) api_sss = create(None, 'sss', fast_mode=True, verbose=False) visualize_curve(dict(tss=api_tss, sss=api_sss), save_dir)
from chalicelib.utils import helper from chalicelib.ee.utils import ch_client from chalicelib.utils.TimeUTC import TimeUTC def get_by_session_id(session_id): with ch_client.ClickHouseClient() as ch: ch_query = """\ SELECT datetime,url,type,duration,ttfb,header_size,encoded_body_size,decoded_body_size,success FROM resources WHERE session_id = toUInt64(%(session_id)s);""" params = {"session_id": session_id} rows = ch.execute(query=ch_query, params=params) results = [] for r in rows: r["datetime"] = TimeUTC.datetime_to_timestamp(r["datetime"]) # TODO: remove this once the tracker is fixed if isinstance(r["url"], bytes): try: r["url"] = r["url"].decode("utf-8") except UnicodeDecodeError: continue results.append(r) return helper.list_to_camel_case(results)
module.exports = function(RED) { var ui = require('../ui')(RED); function validateSwitchValue(node,property,type,payload) { if (payloadType === 'flow' || payloadType === 'global') { try { var parts = RED.util.normalisePropertyExpression(payload); if (parts.length === '') { throw new Error(); } } catch(err) { node.warn("Invalid payload property expression - defaulting to node id") payload = node.id; payloadType = 'str'; } } else { payload = payload || node.id; } } function SwitchNode(config) { RED.nodes.createNode(this, config); this.pt = config.passthru; this.state = ["off"," "]; this.decouple = (config.decouple === "true") ? false : true; var node = this; node.status({}); var group = RED.nodes.getNode(config.group); if (!group) { return; } var tab = RED.nodes.getNode(group.config.tab); if (!tab) { return; } var parts; var onvalue = config.onvalue; var onvalueType = config.onvalueType; if (onvalueType === 'flow' || onvalueType === 'global') { try { parts = RED.util.normalisePropertyExpression(onvalue); if (parts.length === 0) { throw new Error(); } } catch(err) { node.warn("Invalid onvalue property expression - defaulting to true") onvalue = true; onvalueType = 'bool'; } } var offvalue = config.offvalue; var offvalueType = config.offvalueType; if (offvalueType === 'flow' || offvalueType === 'global') { try { parts = RED.util.normalisePropertyExpression(offvalue); if (parts.length === 0) { throw new Error(); } } catch(err) { node.warn("Invalid offvalue property expression - defaulting to false") offvalue = false; offvalueType = 'bool'; } } var done = ui.add({ node: node, tab: tab, group: group, emitOnlyNewValues: false, forwardInputMessages: config.passthru, storeFrontEndInputAsState: (config.decouple === "true") ? false : true, //config.passthru, state: false, control: { type: 'switch' + (config.style ? '-' + config.style : ''), label: config.label, tooltip: config.tooltip, order: config.order, value: false, onicon: config.onicon, officon: config.officon, oncolor: config.oncolor, offcolor: config.offcolor, width: config.width || group.config.width || 6, height: config.height || 1 }, convert: function (payload, oldval, msg) { var myOnValue,myOffValue; if (onvalueType === "date") { myOnValue = Date.now(); } else { myOnValue = RED.util.evaluateNodeProperty(onvalue,onvalueType,node); } if (offvalueType === "date") { myOffValue = Date.now(); } else { myOffValue = RED.util.evaluateNodeProperty(offvalue,offvalueType,node); } if (!this.forwardInputMessages && this.storeFrontEndInputAsState) { if (myOnValue === oldval) { return true; } if (oldval === true) { return true; } else { return false; } } if (RED.util.compareObjects(myOnValue,msg.payload)) { node.state[0] = "on"; return true; } else if (RED.util.compareObjects(myOffValue,msg.payload)) { node.state[0] = "off"; return false; } else { return oldval; } }, convertBack: function (value) { node.state[1] = value?"on":"off"; if (node.pt) { node.status({fill:(value?"green":"red"),shape:(value?"dot":"ring"),text:value?"on":"off"}); } else { var col = (node.decouple) ? ((node.state[1]=="on")?"green":"red") : ((node.state[0]=="on")?"green":"red"); var shp = (node.decouple) ? ((node.state[1]=="on")?"dot":"ring") : ((node.state[0]=="on")?"dot":"ring"); var txt = (node.decouple) ? (node.state[0] +" | "+node.state[1].toUpperCase()) : (node.state[0].toUpperCase() +" | "+node.state[1]) node.status({fill:col, shape:shp, text:txt}); } var payload = value ? onvalue : offvalue; var payloadType = value ? onvalueType : offvalueType; if (payloadType === "date") { value = Date.now(); } else { value = RED.util.evaluateNodeProperty(payload,payloadType,node); } return value; }, beforeSend: function (msg) { msg.topic = config.topic || msg.topic; } }); if (!node.pt) { node.on("input", function(msg) { var col = (node.state[0]=="on") ? "green" : "red"; var shp = (node.state[0]=="on") ? "dot" : "ring"; var txt = (node.decouple) ? (node.state[0] +" | "+node.state[1].toUpperCase()) : (node.state[0].toUpperCase() +" | "+node.state[1]) node.status({fill:col, shape:shp, text:txt}); }); } node.on("close", done); } RED.nodes.registerType("ui_switch", SwitchNode); };
const User = require('../models/user.js'); const jwt = require('jsonwebtoken'); const config = require('../config'); const bcrypt = require('bcrypt'); const api = require('../util').api; const Summoner = require('../models/summoner'); const uuid = require('uuid'); const secret = config.secret; // Validates that a password matches its hash async function isValidPassword(passwordHash, password) { return bcrypt.compare(password, passwordHash); } // Creates a flattened user object function createUserResponse(user) { return { username: user.username, email: user.email, summonerName: user.summoner.summonerName, profileIconId: user.summoner.profileIconId, level: user.summoner.level, verified: user.verified, verificationId: user.verificationId, roles: { assassin: user.assassin, mage: user.mage, support: user.support, fighter: user.fighter, marksman: user.marksman, tank: user.tank, }, }; } // Creates stats for an array of users function createStatsResponse(users) { return users.map(user => ({ summonerName: user.summoner.summonerName, level: user.summoner.level, points: user.quests .reduce((acc, quest) => acc + (quest.completed ? quest.quest.points : 0), 0), })); } // Routes module.exports = { getUser: async (ctx) => { ctx.body = await User.query().eager('summoner') .findById(ctx.user.id) .then(user => createUserResponse(user)); }, patchUser: async (ctx) => { const body = ctx.request.body; ctx.body = await User .query() .patchAndFetchById(ctx.user.id, body.roles) .eager('summoner') .then(user => createUserResponse(user)); }, createUser: async (ctx) => { const user = ctx.request.body; if (user && user.username && user.email && user.password && user.summonerName) { const summoner = await api.Summoner.gettingByName(user.summonerName) .catch(err => console.error(err)); try { const s = await Summoner.query().insertAndFetch({ id: summoner.id, summonerName: summoner.name, profileIconId: summoner.profileIconId, level: summoner.summonerLevel, }); const u = await User.query().insertAndFetch({ username: user.username, password: user.password, email: user.email, summonerId: summoner.id, accountId: summoner.accountId, verificationId: uuid.v4(), }); const token = jwt.sign({ id: u.id }, secret); u.summoner = s; ctx.body = { user: createUserResponse(u), token, }; } catch (err) { ctx.status = 403; if (err.code === '23505') { ctx.body = { message: 'A user is already registered with that Summoner name / Username' }; } else { ctx.body = { message: 'An error occured creating your account' }; } } } else { ctx.body = { message: 'Missing user details' }; ctx.status = 400; } }, authenticate: async (ctx) => { try { const users = await User.query() .eager('summoner') .where(User.raw('lower("username")'), 'like', `${ctx.request.body.username}`); const user = users[0]; if (user && await isValidPassword(user.password, ctx.request.body.password)) { const payload = { id: user.id }; const token = jwt.sign(payload, secret); ctx.body = { message: 'ok', token, user: createUserResponse(user) }; } else { ctx.body = { message: 'Invalid username or password' }; ctx.status = 401; } } catch (err) { ctx.status = 500; } }, getStats: async (ctx, limit) => { ctx.body = createStatsResponse(await User.query() .eager('[quests.quest, summoner]')) .sort((u1, u2) => u1.points < u2.points).slice(0, limit); }, verify: async (ctx) => { try { const user = await User.query().findById(ctx.user.id); if (user) { if (!user.verified) { const runes = await api.Runes.gettingBySummoner(user.summonerId); if (runes && !runes.pages.some(rune => rune.name === user.verificationId)) { user.verified = true; User.query() .patch({ verified: true }) .where('id', user.id).execute(); ctx.status = 200; ctx.body = createUserResponse(user); } else { ctx.status = 400; ctx.body = { message: 'No valid rune page found' }; } } else { ctx.status = 200; ctx.body = { message: 'Already verified' }; } } else { ctx.status = 401; } } catch (err) { ctx.status = 500; } }, };
'use strict'; /* global Connector */ var nowPlayingSelector = '#now-playing .playlister'; Connector.playerSelector = '.programme-details-wrapper'; Connector.artistSelector = nowPlayingSelector + ' .track .artist'; Connector.trackSelector = nowPlayingSelector + ' .track .title'; Connector.getUniqueID = function() { return $('#data-uid').text(); }; // Data provided rounds duration UP to next minute... Is usually longer than the last.fm version data. Connector.getDuration = function () { return $('#data-end').text() - $('#data-start').text(); }; Connector.isPlaying = function() { return $(nowPlayingSelector).length; }; // In preparation for merge of PR#607 (https://github.com/david-sabata/web-scrobbler/pull/607) Connector.getTrackArt = function() { var url = $('.radioplayer .playlister.playlister-expanded > img').attr('src'); return url.indexOf('generictrack') === -1 ? url : null; // Don't use the generic, 'unknown' tract art };
/** * Layout component that queries for data * with Gatsby's useStaticQuery component * * See: https://www.gatsbyjs.com/docs/use-static-query/ */ import * as React from "react" import PropTypes from "prop-types" import { useStaticQuery, graphql } from "gatsby" import Header from "./header" import "./layout.css" import Navbar from "./Navbar" const Layout = ({ children }) => { const data = useStaticQuery(graphql` query SiteTitleQuery { site { siteMetadata { title } } } `) return ( <> {/* <Header siteTitle={data.site.siteMetadata?.title || `Title`} /> */} <Navbar /> <div style={{ margin: `0 auto`, }} > <main>{children}</main> </div> </> ) } Layout.propTypes = { children: PropTypes.node.isRequired, } export default Layout
""" Создать программно файл в текстовом формате, записать в него построчно данные, вводимые пользователем. Об окончании ввода данных свидетельствует пустая строка. """ def main(): run_program = True with open("task1_data.txt", "w") as f: while run_program: user_str = input("введите строку для записи: ") if user_str == "": run_program = False else: f.write(user_str + "\n") print("Программа завершена") if __name__ == "__main__": main()
import { StyleSheet } from 'react-native' import { colors } from '../../../theme' export default StyleSheet.create({ scrollViewContent: { alignItems: 'flex-start', flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'flex-start', paddingVertical: 5, width: '100%', }, emptyListText: { color: colors.mutedText, fontSize: 15, lineHeight: 50, }, itemView: { alignItems: 'center', borderColor: colors.gray, borderRadius: 4, borderWidth: 1, flexDirection: 'row', justifyContent: 'center', paddingLeft: 8, margin: 4, }, itemText: { color: colors.mutedText, fontSize: 15, lineHeight: 18, }, itemRemoveButton: { alignItems: 'center', justifyContent: 'center', padding: 7, }, itemRemoveIcon: { height: 10, resizeMode: 'contain', width: 10, }, })
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Test the conversion to/from astropy.table """ import io import os import pathlib import pytest import numpy as np from astropy.config import set_temp_config, reload_config from astropy.utils.data import get_pkg_data_filename, get_pkg_data_fileobj from astropy.io.votable.table import parse, writeto from astropy.io.votable import tree, conf, validate from astropy.io.votable.exceptions import VOWarning, W39, E25 from astropy.table import Column, Table from astropy.table.table_helpers import simple_table from astropy.units import Unit from astropy.utils.exceptions import AstropyDeprecationWarning from astropy.utils.misc import _NOT_OVERWRITING_MSG_MATCH def test_table(tmpdir): # Read the VOTABLE votable = parse(get_pkg_data_filename('data/regression.xml')) table = votable.get_first_table() astropy_table = table.to_table() for name in table.array.dtype.names: assert np.all(astropy_table.mask[name] == table.array.mask[name]) votable2 = tree.VOTableFile.from_table(astropy_table) t = votable2.get_first_table() field_types = [ ('string_test', {'datatype': 'char', 'arraysize': '*'}), ('string_test_2', {'datatype': 'char', 'arraysize': '10'}), ('unicode_test', {'datatype': 'unicodeChar', 'arraysize': '*'}), ('fixed_unicode_test', {'datatype': 'unicodeChar', 'arraysize': '10'}), ('string_array_test', {'datatype': 'char', 'arraysize': '4'}), ('unsignedByte', {'datatype': 'unsignedByte'}), ('short', {'datatype': 'short'}), ('int', {'datatype': 'int'}), ('long', {'datatype': 'long'}), ('double', {'datatype': 'double'}), ('float', {'datatype': 'float'}), ('array', {'datatype': 'long', 'arraysize': '2*'}), ('bit', {'datatype': 'bit'}), ('bitarray', {'datatype': 'bit', 'arraysize': '3x2'}), ('bitvararray', {'datatype': 'bit', 'arraysize': '*'}), ('bitvararray2', {'datatype': 'bit', 'arraysize': '3x2*'}), ('floatComplex', {'datatype': 'floatComplex'}), ('doubleComplex', {'datatype': 'doubleComplex'}), ('doubleComplexArray', {'datatype': 'doubleComplex', 'arraysize': '*'}), ('doubleComplexArrayFixed', {'datatype': 'doubleComplex', 'arraysize': '2'}), ('boolean', {'datatype': 'bit'}), ('booleanArray', {'datatype': 'bit', 'arraysize': '4'}), ('nulls', {'datatype': 'int'}), ('nulls_array', {'datatype': 'int', 'arraysize': '2x2'}), ('precision1', {'datatype': 'double'}), ('precision2', {'datatype': 'double'}), ('doublearray', {'datatype': 'double', 'arraysize': '*'}), ('bitarray2', {'datatype': 'bit', 'arraysize': '16'})] for field, type in zip(t.fields, field_types): name, d = type assert field.ID == name assert field.datatype == d['datatype'], f'{name} expected {d["datatype"]} but get {field.datatype}' # noqa if 'arraysize' in d: assert field.arraysize == d['arraysize'] # W39: Bit values can not be masked with pytest.warns(W39): writeto(votable2, os.path.join(str(tmpdir), "through_table.xml")) def test_read_through_table_interface(tmpdir): with get_pkg_data_fileobj('data/regression.xml', encoding='binary') as fd: t = Table.read(fd, format='votable', table_id='main_table') assert len(t) == 5 # Issue 8354 assert t['float'].format is None fn = os.path.join(str(tmpdir), "table_interface.xml") # W39: Bit values can not be masked with pytest.warns(W39): t.write(fn, table_id='FOO', format='votable') with open(fn, 'rb') as fd: t2 = Table.read(fd, format='votable', table_id='FOO') assert len(t2) == 5 def test_read_through_table_interface2(): with get_pkg_data_fileobj('data/regression.xml', encoding='binary') as fd: t = Table.read(fd, format='votable', table_id='last_table') assert len(t) == 0 def test_pass_kwargs_through_table_interface(): # Table.read() should pass on keyword arguments meant for parse() filename = get_pkg_data_filename('data/nonstandard_units.xml') t = Table.read(filename, format='votable', unit_format='generic') assert t['Flux1'].unit == Unit("erg / (Angstrom cm2 s)") def test_names_over_ids(): with get_pkg_data_fileobj('data/names.xml', encoding='binary') as fd: votable = parse(fd) table = votable.get_first_table().to_table(use_names_over_ids=True) assert table.colnames == [ 'Name', 'GLON', 'GLAT', 'RAdeg', 'DEdeg', 'Jmag', 'Hmag', 'Kmag', 'G3.6mag', 'G4.5mag', 'G5.8mag', 'G8.0mag', '4.5mag', '8.0mag', 'Emag', '24mag', 'f_Name'] def test_explicit_ids(): with get_pkg_data_fileobj('data/names.xml', encoding='binary') as fd: votable = parse(fd) table = votable.get_first_table().to_table(use_names_over_ids=False) assert table.colnames == [ 'col1', 'col2', 'col3', 'col4', 'col5', 'col6', 'col7', 'col8', 'col9', 'col10', 'col11', 'col12', 'col13', 'col14', 'col15', 'col16', 'col17'] def test_table_read_with_unnamed_tables(): """ Issue #927 """ with get_pkg_data_fileobj('data/names.xml', encoding='binary') as fd: t = Table.read(fd, format='votable') assert len(t) == 1 def test_votable_path_object(): """ Testing when votable is passed as pathlib.Path object #4412. """ fpath = pathlib.Path(get_pkg_data_filename('data/names.xml')) table = parse(fpath).get_first_table().to_table() assert len(table) == 1 assert int(table[0][3]) == 266 def test_from_table_without_mask(): t = Table() c = Column(data=[1, 2, 3], name='a') t.add_column(c) output = io.BytesIO() t.write(output, format='votable') def test_write_with_format(): t = Table() c = Column(data=[1, 2, 3], name='a') t.add_column(c) output = io.BytesIO() t.write(output, format='votable', tabledata_format="binary") obuff = output.getvalue() assert b'VOTABLE version="1.4"' in obuff assert b'BINARY' in obuff assert b'TABLEDATA' not in obuff output = io.BytesIO() t.write(output, format='votable', tabledata_format="binary2") obuff = output.getvalue() assert b'VOTABLE version="1.4"' in obuff assert b'BINARY2' in obuff assert b'TABLEDATA' not in obuff def test_write_overwrite(tmpdir): t = simple_table(3, 3) filename = os.path.join(tmpdir, 'overwrite_test.vot') t.write(filename, format='votable') with pytest.raises(OSError, match=_NOT_OVERWRITING_MSG_MATCH): t.write(filename, format='votable') t.write(filename, format='votable', overwrite=True) def test_empty_table(): votable = parse(get_pkg_data_filename('data/empty_table.xml')) table = votable.get_first_table() astropy_table = table.to_table() # noqa def test_no_field_not_empty_table(): votable = parse(get_pkg_data_filename('data/no_field_not_empty_table.xml')) table = votable.get_first_table() assert len(table.fields) == 0 assert len(table.infos) == 1 def test_no_field_not_empty_table_exception(): with pytest.raises(E25): parse(get_pkg_data_filename('data/no_field_not_empty_table.xml'), verify='exception') def test_binary2_masked_strings(): """ Issue #8995 """ # Read a VOTable which sets the null mask bit for each empty string value. votable = parse(get_pkg_data_filename('data/binary2_masked_strings.xml')) table = votable.get_first_table() astropy_table = table.to_table() # Ensure string columns have no masked values and can be written out assert not np.any(table.array.mask['epoch_photometry_url']) output = io.BytesIO() astropy_table.write(output, format='votable') def test_validate_output_invalid(): """ Issue #12603. Test that we get the correct output from votable.validate with an invalid votable. """ # A votable with errors invalid_votable_filepath = get_pkg_data_filename('data/regression.xml') # When output is None, check that validate returns validation output as a string validate_out = validate(invalid_votable_filepath, output=None) assert isinstance(validate_out, str) # Check for known error string assert "E02: Incorrect number of elements in array." in validate_out # When output is not set, check that validate returns a bool validate_out = validate(invalid_votable_filepath) assert isinstance(validate_out, bool) # Check that validation output is correct (votable is not valid) assert validate_out is False def test_validate_output_valid(): """ Issue #12603. Test that we get the correct output from votable.validate with a valid votable """ # A valid votable. (Example from the votable standard: # https://www.ivoa.net/documents/VOTable/20191021/REC-VOTable-1.4-20191021.html ) valid_votable_filepath = get_pkg_data_filename('data/valid_votable.xml') # When output is None, check that validate returns validation output as a string validate_out = validate(valid_votable_filepath, output=None) assert isinstance(validate_out, str) # Check for known good output string assert "astropy.io.votable found no violations" in validate_out # When output is not set, check that validate returns a bool validate_out = validate(valid_votable_filepath) assert isinstance(validate_out, bool) # Check that validation output is correct (votable is valid) assert validate_out is True class TestVerifyOptions: # Start off by checking the default (ignore) def test_default(self): parse(get_pkg_data_filename('data/gemini.xml')) # Then try the various explicit options def test_verify_ignore(self): parse(get_pkg_data_filename('data/gemini.xml'), verify='ignore') def test_verify_warn(self): with pytest.warns(VOWarning) as w: parse(get_pkg_data_filename('data/gemini.xml'), verify='warn') assert len(w) == 24 def test_verify_exception(self): with pytest.raises(VOWarning): parse(get_pkg_data_filename('data/gemini.xml'), verify='exception') # Make sure the deprecated pedantic option still works for now def test_pedantic_false(self): with pytest.warns(VOWarning) as w: parse(get_pkg_data_filename('data/gemini.xml'), pedantic=False) assert len(w) == 25 def test_pedantic_true(self): with pytest.warns(AstropyDeprecationWarning): with pytest.raises(VOWarning): parse(get_pkg_data_filename('data/gemini.xml'), pedantic=True) # Make sure that the default behavior can be set via configuration items def test_conf_verify_ignore(self): with conf.set_temp('verify', 'ignore'): parse(get_pkg_data_filename('data/gemini.xml')) def test_conf_verify_warn(self): with conf.set_temp('verify', 'warn'): with pytest.warns(VOWarning) as w: parse(get_pkg_data_filename('data/gemini.xml')) assert len(w) == 24 def test_conf_verify_exception(self): with conf.set_temp('verify', 'exception'): with pytest.raises(VOWarning): parse(get_pkg_data_filename('data/gemini.xml')) # And make sure the old configuration item will keep working def test_conf_pedantic_false(self, tmpdir): with set_temp_config(tmpdir.strpath): with open(tmpdir.join('astropy').join('astropy.cfg').strpath, 'w') as f: f.write('[io.votable]\npedantic = False') reload_config('astropy.io.votable') with pytest.warns(VOWarning) as w: parse(get_pkg_data_filename('data/gemini.xml')) assert len(w) == 25 def test_conf_pedantic_true(self, tmpdir): with set_temp_config(tmpdir.strpath): with open(tmpdir.join('astropy').join('astropy.cfg').strpath, 'w') as f: f.write('[io.votable]\npedantic = True') reload_config('astropy.io.votable') with pytest.warns(AstropyDeprecationWarning): with pytest.raises(VOWarning): parse(get_pkg_data_filename('data/gemini.xml'))
//// [compoundArithmeticAssignmentWithInvalidOperands.ts] enum E { a, b } var a: any; var b: void; var x1: boolean; x1 *= a; x1 *= b; x1 *= true; x1 *= 0; x1 *= '' x1 *= E.a; x1 *= {}; x1 *= null; x1 *= undefined; var x2: string; x2 *= a; x2 *= b; x2 *= true; x2 *= 0; x2 *= '' x2 *= E.a; x2 *= {}; x2 *= null; x2 *= undefined; var x3: {}; x3 *= a; x3 *= b; x3 *= true; x3 *= 0; x3 *= '' x3 *= E.a; x3 *= {}; x3 *= null; x3 *= undefined; var x4: void; x4 *= a; x4 *= b; x4 *= true; x4 *= 0; x4 *= '' x4 *= E.a; x4 *= {}; x4 *= null; x4 *= undefined; var x5: number; x5 *= b; x5 *= true; x5 *= '' x5 *= {}; var x6: E; x6 *= b; x6 *= true; x6 *= '' x6 *= {}; //// [compoundArithmeticAssignmentWithInvalidOperands.js] var E; (function (E) { E[E["a"] = 0] = "a"; E[E["b"] = 1] = "b"; })(E || (E = {})); var a; var b; var x1; x1 *= a; x1 *= b; x1 *= true; x1 *= 0; x1 *= ''; x1 *= E.a; x1 *= {}; x1 *= null; x1 *= undefined; var x2; x2 *= a; x2 *= b; x2 *= true; x2 *= 0; x2 *= ''; x2 *= E.a; x2 *= {}; x2 *= null; x2 *= undefined; var x3; x3 *= a; x3 *= b; x3 *= true; x3 *= 0; x3 *= ''; x3 *= E.a; x3 *= {}; x3 *= null; x3 *= undefined; var x4; x4 *= a; x4 *= b; x4 *= true; x4 *= 0; x4 *= ''; x4 *= E.a; x4 *= {}; x4 *= null; x4 *= undefined; var x5; x5 *= b; x5 *= true; x5 *= ''; x5 *= {}; var x6; x6 *= b; x6 *= true; x6 *= ''; x6 *= {};
import HomeComponent from './components/HomeComponent'; import loginComponent from './components/loginComponent'; import dashboardComponent from './components/dashboardComponent'; export const routes =[ {path:"/",name:"index",component:HomeComponent}, {path:"/home",name:"home",component:HomeComponent}, {path:"/login",name:"login",component:loginComponent}, {path:"/dashboard",name:"dashboard",component:dashboardComponent, meta:{ //يعني ما يدخل غير ليs requiresAuth:true} }, ];
// // Magic Wand Control for Openlayers 2.13 // // The MIT License (MIT) // // Copyright (c) 2014, Ryasnoy Paul ([email protected]) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. /** * Class: OpenLayers.Tile.Mask * Tile for displaying binary mask * * Inherits from: * - <OpenLayers.Tile> */ OpenLayers.Tile.Mask = OpenLayers.Class(OpenLayers.Tile, { /** * Property: cvsDiv * {HTMLCanvasElement} The canvas for this tile. */ cvsDiv: null, /** * Property: canvasContext * {CanvasRenderingContext2D} A canvas context associated with * the tile mask. */ canvasContext: null, /** * Property: image * {Object} Binary mask is contains {Uint8Array} data, {int} width, {int} height, {Object} bounds */ image: null, // private border: null, //private hatchInterval: null, //private hatchOffset: 0, initialize: function (layer, position, size, options) { OpenLayers.Tile.prototype.initialize.call(this, layer, position, null, null, size, options); this.createCanvas(); if (position) this.setPosition(position); if (size) this.setCanvasSize(size); var me = this; if (this.layer.hatchTimeout && this.layer.hatchTimeout > 0) this.hatchInterval = setInterval(function () { me.hatchTick(); }, this.layer.hatchTimeout); }, /** * APIMethod: destroy * Nullify references to prevent circular references and memory leaks */ destroy: function () { if (this.hatchInterval) clearInterval(this.hatchInterval); // stop hatching animation if (this.cvsDiv) { this.clear(); } OpenLayers.Tile.prototype.destroy.call(this); }, // override setBounds: function (bounds) { // stub }, // override shouldDraw: function () { return true; }, // override draw: function () { return this.drawBorder(); }, // private hatchTick: function() { this.hatchOffset = (this.hatchOffset + 1) % (this.layer.hatchLength * 2); return this.drawBorder(true); }, /** * Method: setPosition */ setPosition: function (position) { var style = this.cvsDiv.style; style.left = position.x + "px"; style.top = position.y + "px"; this.position = position; }, /** * Method: setCanvasSize */ setCanvasSize: function (size) { this.canvasContext.canvas.width = size.w; this.canvasContext.canvas.height = size.h; this.size = size; }, // override clear: function () { OpenLayers.Tile.prototype.clear.call(this); if (this.cvsDiv) { if (this.cvsDiv.parentNode === this.layer.div) { this.layer.div.removeChild(this.cvsDiv); } this.cvsDiv = null; } this.canvasContext = null; }, /** * Method: createCanvas * Creates and returns the tile canvas. */ createCanvas: function () { this.cvsDiv = document.createElement("canvas"); this.layer.div.appendChild(this.cvsDiv); this.canvasContext = this.cvsDiv.getContext("2d"); this.className = "olTileMask"; var style = this.cvsDiv.style; if (this.layer.opacity < 1) { style.filter = 'alpha(opacity=' + (this.layer.opacity * 100) + ')'; } style.position = "absolute"; }, /** * Method: clearImage * Clear tile */ clearImage: function () { this.image = null; this.border = null; if (this.canvasContext) this.canvasContext.clearRect(0, 0, this.size.w, this.size.h); }, /** * Method: setImage * Set image (binary mask) for tile */ setImage: function(image) { this.image = image; this.drawBorder(); }, /** * Method: drawBorder * Draw hatch border of image (binary mask) */ drawBorder: function (noBorder) { if (!this.image) return false; var i, j, k, q, len, w = this.size.w, // viewport size h = this.size.h, ix = this.size.w - 1, // right bottom of viewport (left top = [0,0]) iy = this.size.h - 1, sw = this.size.w + 2, // extend viewport size (+1 px on each side) sh = this.size.h + 2; if (!noBorder) { // need create border var dx, dy, x0, y0, x1, y1, k1, k2, rx0, rx1, ry0, ry1, // result of the intersection image with the viewport (+1 px on each side) img = this.image.data, w1 = this.image.width, b = this.image.bounds, of = this.image.globalOffset, // image offset in the viewport basis, data = new Uint8Array(sw * sh), // viewport data (+1 px on each side) for correct detection border minPx = Math.round(this.layer.map.minPx.x), minPy = Math.round(this.layer.map.minPx.y), maxPx = Math.round(this.layer.map.maxPx.x), pxLen = maxPx - minPx, // width in pixels of the one world offset, offsets = [{ // all posible world offsets in the viewport basis (considering wrapDateLine) x: -minPx, y: -minPy }, { // add left world x: -(minPx - pxLen), y: -minPy }, { // add right world x: -(minPx + pxLen), y: -minPy }]; // walk through all worlds var offsetsLen = offsets.length; for (j = 0; j < offsetsLen; j++) { offset = offsets[j]; // world offset in the viewport basis dx = of.x - offset.x; // delta for the transformation in viewport basis dy = of.y - offset.y; x0 = dx + b.minX; // left top of image (in viewport basis) y0 = dy + b.minY; x1 = dx + b.maxX; // right bottom of image (in viewport basis) y1 = dy + b.maxY; // intersection of the image with viewport if (!(x1 < 0 || x0 > ix || y1 < 0 || y0 > iy)) { rx0 = x0 > -1 ? x0 : -1; // intersection +1 px on each side (for search border) ry0 = y0 > -1 ? y0 : -1; rx1 = x1 < ix + 1 ? x1 : ix + 1; ry1 = y1 < iy + 1 ? y1 : iy + 1; } else { continue; } // copy result of the intersection(+1 px on each side) to mask data for detection border len = rx1 - rx0 + 1; i = (ry0 + 1) * sw + (rx0 + 1); k1 = (ry0 - dy) * w1 + (rx0 - dx); k2 = (ry1 - dy) * w1 + (rx0 - dx) + 1; // walk through rows (Y) for (k = k1; k < k2; k += w1) { // walk through cols (X) for (q = 0; q < len; q++) { if (img[k + q] === 1) data[i + q] = 1; // copy only "black" points } i += sw; } } // save result of border detection for animation this.border = MagicWand.getBorderIndices({ data: data, width: sw, height: sh }); } this.canvasContext.clearRect(0, 0, w, h); var ind = this.border; // array of indices of the boundary points if (!ind) return false; var x, y, imgData = this.canvasContext.createImageData(w, h), // result image res = imgData.data, hatchLength = this.layer.hatchLength, hatchLength2 = hatchLength * 2, hatchOffset = this.hatchOffset; len = ind.length; for (j = 0; j < len; j++) { i = ind[j], x = i % sw; // calc x by index y = (i - x) / sw; // calc y by index x -= 1; // viewport coordinates transformed from extend (+1 px) viewport y -= 1; if (x < 0 || x > ix || y < 0 || y > iy) continue; k = (y * w + x) * 4; // result image index by viewport coordinates if ((x + y + hatchOffset) % hatchLength2 < hatchLength) { // detect hatch color res[k + 3] = 255; // black, change only alpha } else { res[k] = 255; // white res[k + 1] = 255; res[k + 2] = 255; res[k + 3] = 255; } } this.canvasContext.putImageData(imgData, 0, 0); return true; }, // use without wrapDateLine (faster than drawBorder) drawBorderOld: function (noBorder) { if (!this.image) return false; var ind, // array of indices of the boundary points nx0, nx1, ny0, ny1, // result of the intersection image with the viewport rx0, rx1, ry0, ry1, // result of the intersection image with the viewport (+1px on each side) w, h; // size of the intersection(+1px on each side) if (!noBorder) { // need create border // copy visible image data (+1 px on each side) for border search var offset = { // viewport offset in the global basis x: Math.round(-this.layer.map.minPx.x), y: Math.round(-this.layer.map.minPx.y) }, img = this.image.data, w1 = this.image.width, b = this.image.bounds, of = this.image.globalOffset, // image offset in the global basis dx = of.x - offset.x, // delta for the transformation to viewport basis dy = of.y - offset.y, x0 = dx + b.minX, // left top of image (in viewport basis) y0 = dy + b.minY, x1 = dx + b.maxX, // right bottom of image (in viewport basis) y1 = dy + b.maxY, ix = this.size.w - 1, // right bottom of viewport (left top = [0,0]) iy = this.size.h - 1; // intersection of the image with viewport if (!(x1 < 0 || x0 > ix || y1 < 0 || y0 > iy)) { nx0 = x0 > 0 ? x0 : 0, // image fully visible in the viewport ny0 = y0 > 0 ? y0 : 0, nx1 = x1 < ix ? x1 : ix, ny1 = y1 < iy ? y1 : iy, rx0 = x0 > -1 ? x0 : -1; // intersection +1 px on each side (for search border) ry0 = y0 > -1 ? y0 : -1; rx1 = x1 < ix + 1 ? x1 : ix + 1; ry1 = y1 < iy + 1 ? y1 : iy + 1; } else { return false; } // copy result of the intersection(+1px on each side) to mask data for getBorderIndices w = rx1 - rx0 + 1; h = ry1 - ry0 + 1; var data = new Uint8Array(w * h), i = 0, k1 = (ry0 - dy) * w1 + (rx0 - dx), k2 = (ry1 - dy) * w1 + (rx0 - dx) + 1; // walk through rows (Y) for (var k = k1; k < k2; k += w1) { data.set(img.subarray(k, k + w), i); // copy row i += w; } ind = MagicWand.getBorderIndices({ data: data, width: w, height: h }); //save border for animation this.border = { data: ind, offsetX: rx0, offsetY: ry0, minX: nx0, minY: ny0, maxX: nx1, maxY: ny1, width: w }; } else { // restore the existing border ind = this.border.data; rx0 = this.border.offsetX; ry0 = this.border.offsetY; nx0 = this.border.minX; ny0 = this.border.minY; nx1 = this.border.maxX; ny1 = this.border.maxY; w = this.border.width; } var nw = nx1 - nx0 + 1, nh = ny1 - ny0 + 1, imgData = this.canvasContext.createImageData(nw, nh), // result image res = imgData.data, len = ind.length, x, y, j, hatchLength = this.layer.hatchLength, hatchLength2 = hatchLength * 2, hatchOffset = this.hatchOffset; for (j = 0; j < len; j++) { i = ind[j], x = i % w; // calc x by index y = (i - x) / w; // calc y by index x += rx0; // viewport coordinates y += ry0; if (x < nx0 || x > nx1 || y < ny0 || y > ny1) continue; k = ((y - ny0) * nw + x - nx0) * 4; // result image index by viewport coordinates if ((x + y + hatchOffset) % hatchLength2 < hatchLength) { // detect hatch color res[k + 3] = 255; // black, change only alpha } else { res[k] = 255; // white res[k + 1] = 255; res[k + 2] = 255; res[k + 3] = 255; } } this.canvasContext.clearRect(0, 0, this.size.w, this.size.h); this.canvasContext.putImageData(imgData, nx0, ny0); return true; }, /** * Method: getContours * Return contours of image (binary mask) by filter */ getContours: function (filter) { if (!this.image) return null; var i, j, points, len, plen, c, image = this.image, dx = image.globalOffset.x + Math.round(this.layer.map.minPx.x), dy = image.globalOffset.y + Math.round(this.layer.map.minPx.y), contours = MagicWand.traceContours(image), result = []; if (this.layer.simplifyTolerant > 0) contours = MagicWand.simplifyContours(contours, this.layer.simplifyTolerant, this.layer.simplifyCount); len = contours.length; for (i = 0; i < len; i++) { c = contours[i]; points = c.points; plen = points.length; c.initialCount = c.initialCount || plen; if (filter && filter(c) === false) continue; for (j = 0; j < plen; j++) { points[j].x += dx; points[j].y += dy; } result.push(contours[i]); } return result; }, CLASS_NAME: "OpenLayers.Tile.Mask" }); /** * Class: OpenLayers.Layer.Mask * Layer for displaying binary mask * * Inherits from: * - <OpenLayers.Layer> */ OpenLayers.Layer.Mask = OpenLayers.Class(OpenLayers.Layer, { // override alwaysInRange: true, /** * Property: tile * {<OpenLayers.Tile.Mask>} */ tile: null, /** * Property: hatchLength * {Integer} Thickness of the stroke (in pixels) */ hatchLength: 4, /** * Property: hatchTimeout * {Integer} Hatching redraw timeout (in ms) */ hatchTimeout: 300, /** * Property: simplifyTolerant * {Float} Tool parameter: Simplify tolerant (see method 'simplifyContours' in MagicWand.js) */ simplifyTolerant: 1, /** * Property: simplifyCount * {Integer} Tool parameter: Simplify count (see method 'simplifyContours' in MagicWand.js) */ simplifyCount: 30, // private resolution: null, // override destroy: function () { if (this.tile) { this.tile.destroy(); this.tile = null; } OpenLayers.Layer.prototype.destroy.call(this); }, // override moveTo: function (bounds, zoomChanged, dragging) { OpenLayers.Layer.prototype.moveTo.call(this, bounds, zoomChanged, dragging); // recreate tile only when resolution is changed if (Math.abs(this.map.resolution - this.resolution) > 0.000001 || !this.tile) { this.resolution = this.map.resolution; // save current mask resolution //create the new tile if (this.tile) this.tile.destroy(); this.tile = new OpenLayers.Tile.Mask(this, this.getTilePosition(), this.getTileSize()); this.events.triggerEvent("createtile", { "tile": this.tile }); } else { //just resize the tile and set it's new position this.tile.setCanvasSize(this.getTileSize()); this.tile.setPosition(this.getTilePosition()); } this.tile.draw(); }, // override moveByPx: function (dx, dy) { this.tile.setPosition(this.getTilePosition()); this.tile.draw(); }, /** * Method: getTileSize * Calc the tile size based on the map size. */ getTileSize: function () { return this.map.getCurrentSize().clone(); }, /** * Method: getTilePosition * Calc the tile position based on the map position. */ getTilePosition: function () { return new OpenLayers.Pixel(-this.map.layerContainerOriginPx.x, -this.map.layerContainerOriginPx.y); }, onResize: function () { this.tile.setCanvasSize(this.getTileSize()); this.tile.draw(); }, CLASS_NAME: "OpenLayers.Layer.Mask" }); /** * Class: OpenLayers.Layer.Snapshot * Base snapshot class */ OpenLayers.Layer.Snapshot = OpenLayers.Class({ /** * APIProperty: layer * {<OpenLayers.Layer>} Layer from which the snapshot will be made */ layer: null, /** * Property: bytes * {Integer} Amount of bytes per pixel */ bytes: 4, /** * Property: size * {Object} w = width, h = height */ size: null, /** * Property: image * {Uint8Array} Snapshot data */ image: null, /** * APIProperty: eventListeners * {Object} If set as an option at construction, the eventListeners * object will be registered with <OpenLayers.Events.on>. Object * structure must be a listeners object as shown in the example for * the events.on method. */ eventListeners: null, /** * APIProperty: events * {<OpenLayers.Events>} An events object that handles all events on the map */ events: null, initialize: function (layer, options) { OpenLayers.Util.extend(this, options); this.events = new OpenLayers.Events(this); if (this.eventListeners instanceof Object) { this.events.on(this.eventListeners); } this.layer = layer; }, /** * Method: getPixelColor * Get color by screen coordinates */ getPixelColor: function (x, y) { var i = (y * this.size.w + x) * this.bytes; var res = [this.image[i], this.image[i + 1], this.image[i + 2], this.image[i + 3]]; return res; }, /** * Method: toImageUrl * Create data URL from the snapshot image */ toImageUrl: function (format) { if (!this.image || !this.size) return null; format = format || "image/png"; var canvas = document.createElement("canvas"); var context = canvas.getContext("2d"); context.canvas.width = this.size.w; context.canvas.height = this.size.h; var imgData = context.createImageData(this.size.w, this.size.h); for (var i = 0; i < this.image.length; i++) { imgData.data[i] = this.image[i]; } context.putImageData(imgData, 0, 0); return canvas.toDataURL(format); }, /** * Method: isReady * Indicates whether or not the snapshot is fully loaded. This should be overriden by any subclass */ isReady: function () { return false; }, /** * Method: destroy * Destroy this snapshot */ destroy: function () { this.image = null; this.events.triggerEvent('destroy', null); this.events.destroy(); this.events = null; }, CLASS_NAME: "OpenLayers.Layer.Snapshot" }); /** * Class: OpenLayers.Layer.Snapshot.Grid * Snapshot for all grid layers * * Inherits from: * - <OpenLayers.Layer.Snapshot> */ OpenLayers.Layer.Snapshot.Grid = OpenLayers.Class(OpenLayers.Layer.Snapshot, { // private cache: null, // private cacheCount: 0, // private tilesCount: 0, initialize: function (layer, options) { OpenLayers.Layer.Snapshot.prototype.initialize.call(this, layer, options); this.scan(); }, scan: function () { this.cacheCount = 0; this.cache = {}; if (this.layer.map && this.layer.grid.length > 0) { this.events.triggerEvent("scanstart", { snapshot: this }); this.size = this.layer.map.getCurrentSize(); this.image = new Uint8Array(this.size.w * this.size.h * this.bytes); this.tilesCount = this.layer.grid.length * this.layer.grid[0].length; this.connectToLayer(); for (var i = 0, lenI = this.layer.grid.length; i < lenI; i++) { for (var j = 0, lenJ = this.layer.grid[i].length; j < lenJ; j++) { var tile = this.layer.grid[i][j]; if (tile.shouldDraw()) { if (!tile.isLoading && tile.imgDiv) this.addToCache(tile); } else { this.tilesCount--; } } } if (this.isReady()) this.onLoadEnd(); return true; } return false; }, // private connectToLayer: function () { this.layer.events.register('tileloaded', this, this.onTileLoaded); }, // private disconnectFromLayer: function () { this.layer.events.unregister('tileloaded', this, this.onTileLoaded); }, // private onTileLoaded: function (evt) { this.addToCache(evt.tile); if (this.isReady()) this.onLoadEnd(); }, // private onLoadEnd: function () { this.disconnectFromLayer(); this.events.triggerEvent("scanfinish", { snapshot: this }); }, // private addToCache: function (tile) { if (!this.cache[tile.id]) { this.cache[tile.id] = tile; this.cacheCount++; try { this.addToImage(tile); } catch (e) { // stub } } }, // private addToImage: function (tile) { var tileWidth = this.layer.tileSize.w, tileHeight = this.layer.tileSize.h, imgData = tile.getCanvasContext().getImageData(0, 0, tileWidth, tileHeight), tileData = imgData.data, data = this.image, bytes = this.bytes, x = tile.position.x + this.layer.map.layerContainerOriginPx.x, // tile position in viewport y = tile.position.y + this.layer.map.layerContainerOriginPx.y, w = this.size.w, x0 = Math.max(0, x), // intersection of tile and shapshot (viewport) y0 = Math.max(0, y), x1 = Math.min(w, x + tileWidth) - 1, y1 = Math.min(this.size.h, y + tileHeight) - 1; if (x0 > x1 || y0 > y1) return; // tile isn't visible var i = (y0 * w + x0) * bytes, len = (x1 - x0 + 1) * bytes, w1 = tileWidth * bytes, k1 = ((y0 - y) * tileWidth + x0 - x) * bytes, k2 = ((y1 - y) * tileWidth + x0 - x + 1) * bytes; w *= bytes; // copy only the visible data of image to snapshot for (var k = k1; k < k2; k += w1) { // walk through rows (Y) data.set(tileData.subarray(k, k + len), i); // copy row i += w; } }, // override isReady: function () { return this.tilesCount == this.cacheCount; }, // override destroy: function () { this.cache = null; this.disconnectFromLayer(); OpenLayers.Layer.Snapshot.prototype.destroy.call(this); }, CLASS_NAME: "OpenLayers.Layer.Snapshot.Grid" }); /** * Class: OpenLayers.Layer.Snapshot.Google * Snapshot for Google layers * * Inherits from: * - <OpenLayers.Layer.Snapshot> */ OpenLayers.Layer.Snapshot.Google = OpenLayers.Class(OpenLayers.Layer.Snapshot, { // private cache: null, // private tilesAll: 0, // private tilesLoaded: 0, // private ready: false, // private googleListeners: null, initialize: function (layer, options) { OpenLayers.Layer.Snapshot.prototype.initialize.call(this, layer, options); this.cache = []; this.scan(); }, scan: function () { if (this.layer.map) { this.size = this.layer.map.getCurrentSize(); this.connectToGoogle(); // if google tiles are not yet loaded this.onTilesLoad(); // if google tiles have been loaded already return true; } return false; }, // private connectToGoogle: function () { var me = this; this.disconnectFromGoogle(); this.googleListeners = []; this.googleListeners.push(google.maps.event.addListenerOnce(this.layer.mapObject, 'tilesloaded', function () { me.onGoogleTilesLoaded(); })); }, // private disconnectFromGoogle: function () { if (!this.googleListeners) return false; // remove all listeners for (var i = 0; i < this.googleListeners.length; i++) { google.maps.event.removeListener(this.googleListeners[i]); } this.googleListeners.length = 0; return true; }, // private onGoogleIdle: function () { this.onTilesLoad(); }, // private onGoogleTilesLoaded: function () { var me = this; this.googleListeners.push(google.maps.event.addListenerOnce(this.layer.mapObject, 'idle', function () { me.onGoogleIdle(); })); // force simulation of panning for trigger idle event this.layer.mapObject.panBy(0, 1); this.layer.mapObject.panBy(0, -1); }, // private getGoogleImages: function (layer) { if (!layer.getMapContainer) return []; // find all images in layer div var all = Array.prototype.slice.call(layer.getMapContainer().getElementsByTagName('img')); var len = all.length, images = [], tileSize = layer.tileSize, //zoom = "z=" + layer.map.getZoom(), i, tile; // filter google tiles with current zoom among all for (i = 0; i < len; i++) { tile = all[i]; if (tile.src.search("google") != -1 /*&& tile.src.search(zoom) != -1*/ && tile.width == tileSize.w && tile.height == tileSize.h) { images.push(tile); } } return images; }, // private onTilesLoad: function () { this.ready = false; this.tilesAll = 0; this.tilesLoaded = 0; this.image = new Uint8Array(this.size.w * this.size.h * this.bytes); this.disconnectFromImages(); this.events.triggerEvent("scanstart", { snapshot: this }); var images = this.getGoogleImages(this.layer), j, k, len, len2, wrongImages, index; var overviews = this.layer.map.getControlsByClass("OpenLayers.Control.OverviewMap"); for (j = 0, len = overviews.length; j < len; j++) { wrongImages = this.getGoogleImages(overviews[j].ovmap.baseLayer); for (k = 0, len2 = wrongImages.length; k < len2; k++) { index = images.indexOf(wrongImages[k]); if (index != -1) { images.splice(index, 1); } } } this.tilesAll = images.length; var view = this.layer.map.viewPortDiv.getBoundingClientRect(); // create clones for google tile with anonymous crossorigin for (var i = 0; i < this.tilesAll; i++) { var tile = images[i]; var bounds = tile.getBoundingClientRect(); var img = new Image(); this.cache.push(img); img.setAttribute("crossorigin", "anonymous"); OpenLayers.Event.observe(img, "load", OpenLayers.Function.bind(this.onImageLoad, this, img, bounds.left - view.left, bounds.top - view.top) ); img.src = tile.src; // set same url } return true; }, // private onImageLoad: function (img, x, y) { this.addToImage(img, x, y); // add data of clone to snapshot if (++this.tilesLoaded == this.tilesAll) this.onLoadEnd(); // all clones of tiles are loaded }, // private disconnectFromImages: function () { for (var i = 0; i < this.cache.length; i++) { OpenLayers.Event.stopObservingElement(this.cache[i]); } this.cache.length = 0; }, // private onLoadEnd: function () { this.disconnectFromImages(); this.ready = true; this.events.triggerEvent("scanfinish", { snapshot: this }); }, // private addToImage: function (tile, x, y) { var tileWidth = this.layer.tileSize.w, tileHeight = this.layer.tileSize.h, data = this.image, bytes = this.bytes, w = this.size.w, x0 = Math.max(0, x), // intersection of tile and shapshot (viewport) y0 = Math.max(0, y), x1 = Math.min(w, x + tileWidth) - 1, y1 = Math.min(this.size.h, y + tileHeight) - 1; if (x0 > x1 || y0 > y1) return; // tile isn't visible var canvas = document.createElement("canvas"); // create canvas for tile canvas.width = tileWidth; canvas.height = tileHeight; var ctx = canvas.getContext("2d"); // copy to canvas context tile image ctx.drawImage(tile, 0, 0); var imgData = ctx.getImageData(0, 0, tileWidth, tileHeight), tileData = imgData.data, i = (y0 * w + x0) * bytes, len = (x1 - x0 + 1) * bytes, w1 = tileWidth * bytes, k1 = ((y0 - y) * tileWidth + x0 - x) * bytes, k2 = ((y1 - y) * tileWidth + x0 - x + 1) * bytes; w *= bytes; // copy only the visible data of image to snapshot for (var k = k1; k < k2; k += w1) { // walk through rows (Y) data.set(tileData.subarray(k, k + len), i); // copy row i += w; } }, // override isReady: function () { return this.ready; }, // override destroy: function () { this.disconnectFromImages(); this.disconnectFromGoogle(); this.cache = null; OpenLayers.Layer.Snapshot.prototype.destroy.call(this); }, CLASS_NAME: "OpenLayers.Layer.Snapshot.Google" }); /** * Class: OpenLayers.Handler.Mouse * Simple mouse handler * * Inherits from: * - <OpenLayers.Handler> */ OpenLayers.Handler.Mouse = OpenLayers.Class(OpenLayers.Handler, { mousemove: function (e) { this.callback("move", [e]); }, mousedown: function (e) { this.callback("down", [e]); }, mouseup: function (e) { this.callback("up", [e]); } }); /** * Class: OpenLayers.Control.MagicWand * The MagicWand control * * Inherits from: * - <OpenLayers.Control> */ OpenLayers.Control.MagicWand = OpenLayers.Class(OpenLayers.Control, { // override type: OpenLayers.Control.TYPE_TOOL, /** * APIProperty: layer * {<OpenLayers.Layer>} Overlay (don't use for base layers) from which the snapshot will be made */ layer: null, /** * APIProperty: maskLayer * {<OpenLayers.Layer.Mask>} Layer for displaying mask */ maskLayer: null, /** * Property: waitClass * {String} CSS class for map when snapshot is loading */ waitClass: null, /** * Property: drawClass * {String} CSS class for map when "add mode" is turned off (default) */ drawClass: null, /** * Property: addClass * {String} CSS class for map when "add mode" is turned on */ addClass: null, /** * Property: colorThreshold * {Integer} Tool parameter: Color threshold [1-255] (see method 'floodFill' in MagicWand.js) */ colorThreshold: 15, /** * Property: blurRadius * {Integer} Tool parameter: Blur radius [1-15] (see method 'gaussBlurOnlyBorder' in MagicWand.js) */ blurRadius: 5, /** * Property: resetLayerOnDeactivate * {Boolean} Indicates whether or not the layer should be set to null when control is deactivated */ resetLayerOnDeactivate: false, // private snapshot: null, // private history: null, // private isMapConnect: false, // private allowDraw: false, // private addMode: false, // private currentThreshold: 0, // private downPoint: null, // private oldImage: null, initialize: function (options) { OpenLayers.Control.prototype.initialize.call(this, options); this.init(); }, // private init: function () { this.currentThreshold = this.colorThreshold; if (this.layer) this.setLayer(this.layer); this.history = new OpenLayers.Control.MagicWand.MaskHistory(); this.handlers = { keyboard: new OpenLayers.Handler.Keyboard(this, { "keydown": this.keydown, "keyup": this.keyup, }), mouse: new OpenLayers.Handler.Mouse(this, { "move": this.move, "down": this.down, "up": this.up, }) }; }, // override destroy: function () { this.onDeactivate(); if (this.history) this.history.destroy(); OpenLayers.Control.prototype.destroy.call(this); }, setColorThreshold: function (threshold) { this.currentThreshold = this.colorThreshold = threshold; }, setBlurRadius: function (radius) { this.blurRadius = radius; }, getLayer: function() { return this.layer || this.map.baseLayer; }, setLayer: function (layer) { this.layer = layer.isBaseLayer ? null : layer; // property layer only for overlays if (this.active) { this.clearImage(); this.createSnapshot(); } }, clearImage: function() { if (this.maskLayer && this.maskLayer.tile) { this.maskLayer.tile.clearImage(); } }, // private connectToMaskLayer: function () { this.maskLayer.events.on({ 'createtile': this.onCreateMaskTile, scope: this }); }, // private disconnectFromMaskLayer: function () { this.maskLayer.events.un({ 'createtile': this.onCreateMaskTile, scope: this }); }, // private onCreateMaskTile: function (e) { if (this.history) this.history.clear(); }, // override setMap: function (map) { OpenLayers.Control.prototype.setMap.call(this, map); if (this.handlers.mouse) { this.handlers.mouse.setMap(map); } if (this.handlers.keyboard) { this.handlers.keyboard.setMap(map); } this.connectToMap(); }, // private connectToMap: function () { if (this.isMapConnect || !this.active) return false; this.map.events.on({ 'moveend': this.onMapMoveEnd, 'updatesize': this.onMapUpdateSize, 'changebaselayer': this.onChangeBaseLayer, scope: this }); this.onMapMoveEnd(); this.isMapConnect = true; return true; }, // private disconnectFromMap: function () { if (!this.isMapConnect || this.active) return false; this.map.events.un({ 'moveend': this.onMapMoveEnd, 'updatesize': this.onMapUpdateSize, 'changebaselayer': this.onChangeBaseLayer, scope: this }); this.isMapConnect = false; return true; }, // private onChangeBaseLayer: function () { this.createSnapshot(); }, // private onMapMoveEnd: function () { this.createSnapshot(); }, // private onMapUpdateSize: function () { var me = this; setTimeout(function () { me.onMapResize(); }, 50); }, // private onMapResize: function () { this.createSnapshot(); this.maskLayer.onResize(); }, // override activate: function () { OpenLayers.Control.prototype.activate.call(this); if (this.handlers.mouse) { this.handlers.mouse.activate(); } if (this.handlers.keyboard) { this.handlers.keyboard.activate(); } this.map.div.classList.add(this.drawClass); this.connectToMap(); if (this.maskLayer) this.connectToMaskLayer(); }, // override deactivate: function () { OpenLayers.Control.prototype.deactivate.call(this); this.onDeactivate(); }, // private onDeactivate: function () { if (this.handlers.mouse) { this.handlers.mouse.deactivate(); } if (this.handlers.keyboard) { this.handlers.keyboard.deactivate(); } if (this.resetLayerOnDeactivate) this.layer = null; this.allowDraw = false; this.downPoint = null; this.oldImage = null; this.addMode = false; this.disconnectFromMap(); if (this.maskLayer) this.disconnectFromMaskLayer(); this.removeSnapshot(); this.clearImage(); if (this.history) this.history.clear(); this.map.div.classList.remove(this.drawClass); this.map.div.classList.remove(this.waitClass); this.map.div.classList.remove(this.addClass); }, // private keydown: function (evt) { // ctrl press (add mode on) if (evt.keyCode == 17 && !this.map.div.classList.contains(this.addClass)) this.map.div.classList.add(this.addClass); }, // private keyup: function (evt) { // ctrl unpress (add mode off) if (evt.keyCode == 17) this.map.div.classList.remove(this.addClass); if (evt.keyCode == 67) { // show contours (debug mode) var cs = this.maskLayer.tile.getContours(); var ctx = this.maskLayer.tile.canvasContext; ctx.clearRect(0, 0, this.maskLayer.tile.size.w, this.maskLayer.tile.size.h); var i, j, ps; // lines ctx.beginPath(); for (i = 0; i < cs.length; i++) { ps = cs[i].points; ctx.moveTo(ps[0].x, ps[0].y); for (j = 1; j < ps.length; j++) { ctx.lineTo(ps[j].x, ps[j].y); } } ctx.strokeStyle = "red"; ctx.stroke(); // vertices ctx.fillStyle = "aqua"; for (i = 0; i < cs.length; i++) { ps = cs[i].points; for (j = 0; j < ps.length; j++) { ctx.fillRect(ps[j].x, ps[j].y, 1, 1); } } } if (evt.ctrlKey) { // history manipulations var img = null; if (evt.keyCode == 89) img = this.history.redo(); // ctrl + y if (evt.keyCode == 90) img = this.history.undo(); // ctrl + z if (img && this.maskLayer) this.maskLayer.tile.setImage(img); // apply mask from history } }, // private move: function (e) { // log current pixel color (debug mode) //var pixel = this.map.events.getMousePosition(e); //if (this.snapshot && this.snapshot.isReady()) { // var r = this.snapshot.getPixelColor(Math.round(pixel.x), Math.round(pixel.y)); // console.log(r[0] + " " + r[1] + " " + r[2] + " " + r[3]); //} //return; if (this.allowDraw) { var pixel = this.map.events.getMousePosition(e); var x = Math.round(pixel.x); var y = Math.round(pixel.y); var px = this.downPoint.x; var py = this.downPoint.y; if (x != px || y != py) { // color threshold calculation var dx = x - px; var dy = y - py; var len = Math.sqrt(dx * dx + dy * dy); var adx = Math.abs(dx); var ady = Math.abs(dy); var sign = adx > ady ? dx / adx : dy / ady; sign = sign < 0 ? sign / 5 : sign / 3; var thres = Math.min(Math.max(this.colorThreshold + Math.round(sign * len), 1), 255); // 1st method //var thres = Math.min(Math.max(this.colorThreshold + dx / 2, 1), 255); // 2nd method //var thres = Math.min(this.colorThreshold + Math.round(len / 3), 255); // 3rd method if (thres != this.currentThreshold) { this.currentThreshold = thres; this.drawMask(px, py); } } } }, // private down: function (e) { if (e.button == 2) { // right button - draw mask if (!this.maskLayer || !this.snapshot || !this.snapshot.isReady()) return; this.downPoint = this.map.events.getMousePosition(e); this.downPoint.x = Math.round(this.downPoint.x); // mouse down point (base point) this.downPoint.y = Math.round(this.downPoint.y); this.allowDraw = true; this.addMode = e.ctrlKey; // || e.shiftKey; this.drawMask(this.downPoint.x, this.downPoint.y); } else if (e.button == 1) { // show current snapshot (debug mode) var imgData = this.maskLayer.tile.canvasContext.createImageData(this.maskLayer.tile.size.w, this.maskLayer.tile.size.h); for (var i = 0; i < this.snapshot.image.length; i++) { imgData.data[i] = this.snapshot.image[i]; } this.maskLayer.tile.canvasContext.clearRect(0, 0, this.maskLayer.tile.size.w, this.maskLayer.tile.size.h); this.maskLayer.tile.canvasContext.putImageData(imgData, 0, 0); } else { // reset all this.allowDraw = false; this.oldImage = null; this.addMode = false; } }, // private up: function (e) { // add current mask to history if (this.allowDraw && this.maskLayer && this.history) { this.history.addMask(this.maskLayer.tile.image); } // reset all this.currentThreshold = this.colorThreshold; this.allowDraw = false; this.oldImage = null; this.addMode = false; }, createSnapshot: function () { var layer = this.getLayer(); if (this.snapshot && this.snapshot.layer == layer) { this.snapshot.scan(); return; } this.removeSnapshot(); var options = { eventListeners: { 'scanstart': function (evt) { this.map.div.classList.add(this.waitClass); }, 'scanfinish': function (evt) { this.map.div.classList.remove(this.waitClass); }, scope: this } }; if (layer instanceof OpenLayers.Layer.Grid) { this.snapshot = new OpenLayers.Layer.Snapshot.Grid(layer, options); } else if (layer instanceof OpenLayers.Layer.Google) { this.snapshot = new OpenLayers.Layer.Snapshot.Google(layer, options); } }, removeSnapshot: function() { if (this.snapshot) { this.snapshot.destroy(); this.snapshot = null; } }, // return concatenation of image and old masks concatMask: function (image, old) { var data1 = old.data, data2 = image.data, w1 = old.width, w2 = image.width, px1 = old.globalOffset.x, py1 = old.globalOffset.y, px2 = image.globalOffset.x, py2 = image.globalOffset.y, b1 = old.bounds, b2 = image.bounds, px = Math.min(b1.minX + px1, b2.minX + px2), // global offset for new image (by min in bounds) py = Math.min(b1.minY + py1, b2.minY + py2), b = { // bounds for new image include all of the pixels [0,0,width,height] (reduce to bounds) minX: 0, minY: 0, maxX: Math.max(b1.maxX + px1, b2.maxX + px2) - px, maxY: Math.max(b1.maxY + py1, b2.maxY + py2) - py, }, w = b.maxX + 1, // size for new image h = b.maxY + 1, i, j, k, k1, k2, len; var result = new Uint8Array(w * h); // copy all old image len = b1.maxX - b1.minX + 1; i = (py1 - py + b1.minY) * w + (px1 - px + b1.minX); k1 = b1.minY * w1 + b1.minX; k2 = b1.maxY * w1 + b1.minX + 1; // walk through rows (Y) for (k = k1; k < k2; k += w1) { result.set(data1.subarray(k, k + len), i); // copy row i += w; } // copy new image (only "black" pixels) len = b2.maxX - b2.minX + 1; i = (py2 - py + b2.minY) * w + (px2 - px + b2.minX); k1 = b2.minY * w2 + b2.minX; k2 = b2.maxY * w2 + b2.minX + 1; // walk through rows (Y) for (k = k1; k < k2; k += w2) { // walk through cols (X) for (j = 0; j < len; j++) { if (data2[k + j] === 1) result[i + j] = 1; } i += w; } return { data: result, width: w, height: h, bounds: b, globalOffset: { x: px, y: py, } }; }, drawMask: function (x, y) { if (!(this.snapshot && this.snapshot.image)) return false; var size = this.snapshot.size; var mapSize = this.map.getCurrentSize(); if (size.w != mapSize.w || size.h != mapSize.h) { // if map size is not equal to snapshot size then recreate snapshot this.onMapResize(); if (!this.snapshot.isReady()) return false; size = this.snapshot.size; } var tile = this.maskLayer.tile; var offset = { x: Math.round(-this.map.minPx.x), y: Math.round(-this.map.minPx.y) }; // offset from the map var image = { data: this.snapshot.image, width: size.w, height: size.h, bytes: this.snapshot.bytes }; if (this.addMode && tile.image) { if (!this.oldImage) { var img = tile.image; var bounds = img.bounds; // clone image this.oldImage = { data: new Uint8Array(img.data), width: img.width, height: img.height, bounds: { minX: bounds.minX, maxX: bounds.maxX, minY: bounds.minY, maxY: bounds.maxY, }, globalOffset: { x: img.globalOffset.x, y: img.globalOffset.y } }; var oldOffset = this.oldImage.globalOffset, minPx = Math.round(this.map.minPx.x), maxPx = Math.round(this.map.maxPx.x), offsets = [{ x: oldOffset.x, y: oldOffset.y }]; // add old image offset (current world) var pxLen = maxPx - minPx; offsets.push({ x: oldOffset.x - pxLen, y: oldOffset.y }); // add additional old image offsets (neighboring worlds) offsets.push({ x: oldOffset.x + pxLen, y: oldOffset.y }); //// set correct offset for new image in old image world //if (oldOffset.x <= 0 && offset.x > 0) { // offset.x -= pxLen; //} else if (oldOffset.x > 0 && offset.x <= 0) { // offset.x += pxLen; //} var i, j, k, k1, k2, len, of, x0, y0, x1, y1, dx, dy, rx0, rx1, ry0, ry1, w = image.width, h = image.height, data = new Uint8Array(w * h), old = this.oldImage.data, w1 = this.oldImage.width, b = this.oldImage.bounds, ix = image.width - 1, // right bottom of image (left top = [0,0]) iy = image.height - 1, offsetsLen = offsets.length; // copy visible data from old mask for floodfill (considering wrapDateLine and neighboring worlds) for (j = 0; j < offsetsLen; j++) { of = offsets[j]; // old mask offset in the global basis dx = of.x - offset.x; // delta for the transformation to image basis dy = of.y - offset.y; x0 = dx + b.minX; // left top of old mask (in image basis) y0 = dy + b.minY; x1 = dx + b.maxX; // right bottom of old mask (in image basis) y1 = dy + b.maxY; // intersection of the old mask with the image (viewport) if (!(x1 < 0 || x0 > ix || y1 < 0 || y0 > iy)) { rx0 = x0 > 0 ? x0 : 0; // result of the intersection ry0 = y0 > 0 ? y0 : 0; rx1 = x1 < ix ? x1 : ix; ry1 = y1 < iy ? y1 : iy; } else { continue; } // copy result of the intersection to mask data for floodfill len = rx1 - rx0 + 1; i = ry0 * w + rx0; k1 = (ry0 - dy) * w1 + (rx0 - dx); k2 = (ry1 - dy) * w1 + (rx0 - dx) + 1; // walk through rows (Y) for (k = k1; k < k2; k += w1) { data.set(old.subarray(k, k + len), i); // copy row i += w; } } this.oldImage.visibleData = data; } // create the new mask considering the current visible data image = MagicWand.floodFill(image, x, y, this.currentThreshold, this.oldImage.visibleData); if (!image) return false; // blur the new mask considering the current visible data if (this.blurRadius > 0) image = MagicWand.gaussBlurOnlyBorder(image, this.blurRadius, this.oldImage.visibleData); image.globalOffset = offset; image = this.concatMask(image, this.oldImage); // old mask + new mask } else { image = MagicWand.floodFill(image, x, y, this.currentThreshold); if (this.blurRadius > 0) image = MagicWand.gaussBlurOnlyBorder(image, this.blurRadius); image.globalOffset = offset; } tile.setImage(image); return true; }, CLASS_NAME: "OpenLayers.Control.MagicWand" }); /** * Class: OpenLayers.Control.MagicWand.MaskHistory * History of masks */ OpenLayers.Control.MagicWand.MaskHistory = OpenLayers.Class({ /** * Property: history * {Array} Array of masks */ history: null, /** * Property: current * {Integer} Current index of history array */ current: -1, initialize: function (options) { OpenLayers.Util.extend(this, options); this.history = []; }, destroy: function() { this.history = null; }, clear: function() { this.history.length = 0; this.current = -1; }, addMask: function (mask) { if (!mask) return false; this.current++; this.history.length = this.current; this.history.push(mask); return true; }, getCurrent: function () { return this.current > -1 ? this.history[this.current] : null; }, allowUndo: function() { return this.current > 0; }, allowRedo: function () { return this.current < this.history.length - 1; }, undo: function () { if (!this.allowUndo()) return null; this.current--; return this.getCurrent(); }, redo: function () { if (!this.allowRedo()) return null; this.current++; return this.getCurrent(); } });
# -*- coding: utf-8 -*- # Copyright (c) 2020, UMIS and Contributors # See license.txt from __future__ import unicode_literals # import frappe import unittest class TestManagementSuratPKWTT(unittest.TestCase): pass
var fs = require('fs'); module.exports = { fileDemo: function(wss){ fs.readFile('file.txt','utf8', function(error, text){ wss.broadcast(text); }); wss.broadcast("After First Read\n"); fs.readFile('file2.txt','utf8', function(error, text){ wss.broadcast(text); }); wss.broadcast("After Second Read\n"); } }
import request from '@/utils/request' export function getRoutes() { return request({ url: '/vue-element-admin/routes', method: 'get' }) }
# Import packages import codecademylib import numpy as np import pandas as pd # Import matplotlib pyplot from matplotlib import pyplot as plt # Read in transactions data mu, sigma = 800, 100 # mean and standard deviation burrito_calories = np.random.normal(mu, sigma, 320) # Save transaction times to a separate numpy array plt.hist(burrito_calories, range=(250, 1250), bins=100, edgecolor='black') plt.title("Calories in a Burrito Bowl", fontsize = 24) plt.xlabel("Calories", fontsize=18) plt.ylabel("Count", fontsize=18) plt.show()
from tkinter import * def donothing(): filewin = Toplevel(root) button = Button(filewin, text="Do nothing button") button.pack() root = Tk() menubar = Menu(root) filemenu = Menu(menubar, tearoff=0) filemenu.add_command(label="New", command=donothing) filemenu.add_command(label="Open", command=donothing) filemenu.add_command(label="Save", command=donothing) filemenu.add_command(label="Save as...", command=donothing) filemenu.add_command(label="Close", command=donothing) filemenu.add_separator() filemenu.add_command(label="Exit", command=root.quit) menubar.add_cascade(label="File", menu=filemenu) editmenu = Menu(menubar, tearoff=0) editmenu.add_command(label="Undo", command=donothing) editmenu.add_separator() editmenu.add_command(label="Cut", command=donothing) editmenu.add_command(label="Copy", command=donothing) editmenu.add_command(label="Paste", command=donothing) editmenu.add_command(label="Delete", command=donothing) editmenu.add_command(label="Select All", command=donothing) menubar.add_cascade(label="Edit", menu=editmenu) helpmenu = Menu(menubar, tearoff=0) helpmenu.add_command(label="Help Index", command=donothing) helpmenu.add_command(label="About...", command=donothing) menubar.add_cascade(label="Help", menu=helpmenu) root.config(menu=menubar) root.mainloop()
// ==UserScript== // @name Press "g" to Google (DuckDuckGo) // @namespace https://wiki.gslin.org/wiki/Google // @version 0.20210908.0 // @description Press "g" to Google in DuckDuckGo // @author Gea-Suan Lin // @match https://duckduckgo.com/* // @grant GM_addStyle // @grant GM_getValue // @grant GM_openInTab // @grant GM_registerMenuCommand // @grant GM_setValue // @require https://greasyfork.org/scripts/38445-monkeyconfig/code/MonkeyConfig.js?version=251319 // @license MIT // ==/UserScript== (function() { 'use strict'; const cfg = new MonkeyConfig({ menuCommand: true, params: { search_engine: { type: 'text', default: 'https://www.google.com/search?q=', }, }, title: 'Press "g" to Google in DuckDuckGo', }); document.addEventListener('keyup', function(event) { if ('input' === document.activeElement.tagName.toLowerCase()) { return; } if ('g' !== event.key) { return; } let q = document.getElementById('search_form_input').value; let q_encoded = encodeURIComponent(q).replace(/%20/g, '+'); let url = cfg.get('search_engine') + q_encoded; document.location = url; }); })();
// Moving noise into the global scope so its not attached to P5 let noise = () => {} const canvasW = 685 const canvasH = 500 const dimensions = 10 let masks = {} let SLIDER = { zoom: 0, // voronoiLerp: .9, backgroundColor: .5, color: .5, saturation: .5, thickness: .5, eyebrows: .5 } let controls = { startMask: "myMask", paused: false, playingRecordedData: true, playingFrame: 0, recording: false, maskOffset: new Vector(0,0), maskZoom: 1, } let app = { recordingData: {hand:[],face:[]}, // Location of the mouse mouse: new Vector(), // Store the mask instance, if its a class-based mask maskInstance: undefined, maskFxn: undefined, maskID: undefined, setMask(id) { console.log("Set mask", id) app.maskID = id app.maskInstance = undefined app.maskFxn = undefined if (typeof masks[id] === "function") { if (isClass(masks[id])) { console.log("Loading Class-based mask", id) app.maskInstance = new masks[id]() } else if (masks[id] !== undefined) { console.log("Loading Function-based mask", id) app.maskFxn = masks[id] } console.log("set to fxn") } else { console.warn("No mask named", id, " in mask list", masks) } }, init() { // Start playing test data, use the initial mask app.setMask(controls.startMask) console.log(controls.startMask) }, draw(p) { p.push() p.translate(p.width/2, p.height/2) // Set the relative offset based on the current offset // console.log(app.mouse) let relOffset = Vector.add(controls.maskOffset, app.mouse.dragOffset) relOffset.mult(-1) controls.zoom = (SLIDER.zoom*8)**1.5 + 1 p.scale(controls.zoom, controls.zoom) p.translate(...relOffset) let t = p.millis()*.001 let dt = p.deltaTime*.001 if (app.maskFxn) { if (!controls.paused) app.maskFxn(p) } if (app.maskInstance) { if (!controls.paused) app.maskInstance.update(t, dt, p.frameCount) app.maskInstance.draw(p) } }, updateFace(p) { // Run some update code every frame // If we are recording, // push a copy of the current face/hand points onto the recording data if (controls.recording) { app.recordingData.face.push(face.points.map(pt => pt.slice(0))) let handData = hand.map(h => h.points.map(pt => pt.slice(0))) app.recordingData.hand.push(handData) } // If we are *playing* recorded data, // use the current frame of the recorded data to set the hands/face if (controls.playingRecordedData) { if (!controls.paused && p.frameCount%3 == 1) { controls.playingFrame++ // console.log(frame) let frame = controls.playingFrame%testFaceData.length let faceData = testFaceData[frame] face.points.forEach((pt,i) => pt.copy(faceData[i])) let handData = testHandData[frame] hand.forEach((h,index) => { h.points.forEach((pt,i) => pt.copy(handData[index][i])) }) calculateMetaTrackingData() } } else { // Currently using Handsfree, its updated on its own schedule } } } // Setup and Vue things document.addEventListener("DOMContentLoaded", function(){ // CONTROLS // UI to control things *not* handled by individual AOFs new Vue({ el : "#controls", template: ` <div id="controls"> <button class="randomized-button" @click="controls.playingRecordedData = !controls.playingRecordedData">Pre-recorded {{controls.playingRecordedData?"⏸":"▶️"}}</button> <button class="randomized-button" @click="toggleHandsFree">Real-time {{controls.playingRecordedData?"▶️":"⏸"}}</button> <br><br> <select @change="setMask"> <option v-for="id in Object.keys(masks)" :selected="controls.startMask==id" >{{id}}</option> </select> <div v-if="false" class="recordingcontrols"> <button @click="controls.recording=!controls.recording" :class="{toggled:controls.recording}">record</button> <button @click="saveData()">copy</button> <button @click="saveHandData()">copy hands</button> </div> <table> <br> <tr v-for="(value, label in sliders"> <td class="label">{{label}}</td> <td class="slider-cell"> <input type="range" min="0" max="1" :step=".001" class="slider" v-model="sliders[label]" /> </td> </tr> </table> </div>`, methods: { toggleHandsFree() { if (handsfree === undefined) { console.log("start handsfree") initHandsFree() controls.playingRecordedData = !controls.playingRecordedData } else { controls.playingRecordedData = !controls.playingRecordedData console.log("Set recorded Data = ", controls.playingRecordedData) } }, setMask(ev) { console.log(ev.target.value) app.setMask(ev.target.value) }, saveData() { let output = 'let testFaceData = ' + neatJSON(app.recordingData.face, {decimals:1}) console.log(output) navigator.clipboard.writeText(output); }, saveHandData() { let output = 'let testHandData = ' + neatJSON(app.recordingData.hand, {decimals:1}) console.log(output) navigator.clipboard.writeText(output); } }, computed: { }, data() { return { sliders: SLIDER, controls: controls, masks: masks, } } }) // P5 new Vue({ el : "#app", template: `<div id="app"> <div id="p5-holder" ref="p5"></div> </div>`, mounted() { app.p5 = new p5((p) => { // Save the noise fxn noise = p.noise // Save a mouse position // Basic P5 setup p.setup = () => { p.createCanvas(canvasW, canvasH) p.colorMode(p.HSL) p.ellipseMode(p.RADIUS) } //------------------------------------------- // Mouse things app.mouse.dragStart = new Vector(0,0) app.mouse.dragOffset = new Vector(0,0) // Utility fxn to test if mouse in p5 function mouseInP5() { return p.mouseX > 0 && p.mouseX < canvasW && p.mouseY > 0 && p.mouseY < canvasH } p.mousePressed = () => { if (mouseInP5()) { app.mouse.dragging = true app.mouse.dragStart.setTo(p.mouseX, p.mouseY) } } p.mouseReleased = () => { // Stopped dragging? Update the offset app.mouse.dragging = false controls.maskOffset[0] += app.mouse.dragOffset[0] controls.maskOffset[1] += app.mouse.dragOffset[1] app.mouse.dragOffset.setTo(0, 0) } p.mouseMoved = () => { app.mouse.setTo(p.mouseX, p.mouseY) } p.mouseDragged = () => { app.mouse.setTo(p.mouseX, p.mouseY) if (app.mouse.dragging) { app.mouse.dragOffset.setToDifference(app.mouse.dragStart, app.mouse) } } p.doubleClicked = () => {} p.mouseClicked = () => {} //------------------------------------------- // Draw let recordedFrame = 0 p.draw = () => { app.updateFace(p) app.draw(p) } }, this.$refs.p5) app.init() }, data() { return { output: "", } } }) }) //============ // Utilities // Returns a value between 0 and 1, but never reaching either // https://zaiste.net/posts/javascript-class-function/ function isClass(func) { return typeof func === 'function' && /^class\s/.test(Function.prototype.toString.call(func)); } function sigmoid(v) { return 1 / (1 + Math.pow(Math.E, -v)); } function unitSigmoid(v, range=1) { return 1 / (1 + Math.pow(Math.E, -range*(v - .5))); } // https://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array /* Randomize array in-place using Durstenfeld shuffle algorithm */ function shuffleArray(array) { for (var i = array.length - 1; i > 0; i--) { var j = Math.floor(Math.random() * (i + 1)); var temp = array[i]; array[i] = array[j]; array[j] = temp; } return array } document.addEventListener('keyup', function(e){ console.log(e) if (e.key === "Shift") { // Clear all the shift-selected app.shiftDown = false // Vue.set(app, "shiftSelected", []) } }); document.addEventListener('keydown', function(e){ if (e.key === "Shift") { app.shiftDown = true Vue.set(app, "shiftSelected", []) } if (e.code === "Space") { controls.paused = !controls.paused console.log("paused", controls.paused) } });
/** * Xenon Main * * Theme by: www.laborator.co **/ var public_vars = public_vars || {}; ;(function($, window, undefined){ "use strict"; $(document).ready(function() { // Main Vars public_vars.$body = $("body"); public_vars.$pageContainer = public_vars.$body.find(".page-container"); public_vars.$sidebarMenu = public_vars.$pageContainer.find('.sidebar-menu'); public_vars.$mainMenu = public_vars.$sidebarMenu.find('.main-menu'); public_vars.$horizontalNavbar = public_vars.$body.find('.navbar.horizontal-menu'); public_vars.$horizontalMenu = public_vars.$horizontalNavbar.find('.navbar-nav'); public_vars.$mainContent = public_vars.$pageContainer.find('.main-content'); public_vars.$mainFooter = public_vars.$body.find('footer.main-footer'); public_vars.$userInfoMenuHor = public_vars.$body.find('.navbar.horizontal-menu'); public_vars.$userInfoMenu = public_vars.$body.find('nav.navbar.user-info-navbar'); public_vars.$settingsPane = public_vars.$body.find('.settings-pane'); public_vars.$settingsPaneIn = public_vars.$settingsPane.find('.settings-pane-inner'); public_vars.wheelPropagation = true; // used in Main menu (sidebar) public_vars.$pageLoadingOverlay = public_vars.$body.find('.page-loading-overlay'); public_vars.defaultColorsPalette = ['#68b828','#7c38bc','#0e62c7','#fcd036','#4fcdfc','#00b19d','#ff6264','#f7aa47']; // Page Loading Overlay if(public_vars.$pageLoadingOverlay.length) { $(window).load(function() { public_vars.$pageLoadingOverlay.addClass('loaded'); }); } window.onerror = function() { // failsafe remove loading overlay public_vars.$pageLoadingOverlay.addClass('loaded'); } // Setup Sidebar Menu setup_sidebar_menu(); // Setup Horizontal Menu setup_horizontal_menu(); // Sticky Footer if(public_vars.$mainFooter.hasClass('sticky')) { stickFooterToBottom(); $(window).on('xenon.resized', stickFooterToBottom); } // Perfect Scrollbar if($.isFunction($.fn.perfectScrollbar)) { if(public_vars.$sidebarMenu.hasClass('fixed')) ps_init(); $(".ps-scrollbar").each(function(i, el) { var $el = $(el); $el.perfectScrollbar({ wheelPropagation: false }); }); // User info opening dropdown trigger PS update $(".user-info-navbar .dropdown:has(.ps-scrollbar)").each(function(i, el) { var $scrollbar = $(this).find('.ps-scrollbar'); $(this).on('click', '[data-toggle="dropdown"]', function(ev) { ev.preventDefault(); setTimeout(function() { $scrollbar.perfectScrollbar('update'); }, 1); }); }); // Scrollable $("div.scrollable").each(function(i, el) { var $this = $(el), max_height = parseInt(attrDefault($this, 'max-height', 200), 10); max_height = max_height < 0 ? 200 : max_height; $this.css({maxHeight: max_height}).perfectScrollbar({ wheelPropagation: true }); }); } // User info search button var $uim_search_form = $(".user-info-menu .search-form, .nav.navbar-right .search-form"); $uim_search_form.each(function(i, el) { var $uim_search_input = $(el).find('.form-control'); $(el).on('click', '.btn', function(ev) { if($uim_search_input.val().trim().length == 0) { jQuery(el).addClass('focused'); setTimeout(function(){ $uim_search_input.focus(); }, 100); return false; } }); $uim_search_input.on('blur', function() { jQuery(el).removeClass('focused'); }); }); // Fixed Footer if(public_vars.$mainFooter.hasClass('fixed')) { public_vars.$mainContent.css({ paddingBottom: public_vars.$mainFooter.outerHeight(true) }); } // Go to to links $('body').on('click', 'a[rel="go-top"]', function(ev) { ev.preventDefault(); var obj = {pos: $(window).scrollTop()}; TweenLite.to(obj, .3, {pos: 0, ease:Power4.easeOut, onUpdate: function() { $(window).scrollTop(obj.pos); }}); }); // User info navbar equal heights if(public_vars.$userInfoMenu.length) { public_vars.$userInfoMenu.find('.user-info-menu > li').css({ minHeight: public_vars.$userInfoMenu.outerHeight() - 1 }); } // Autosize if($.isFunction($.fn.autosize)) { $(".autosize, .autogrow").autosize(); } // Custom Checkboxes & radios cbr_replace(); // Auto hidden breadcrumbs $(".breadcrumb.auto-hidden").each(function(i, el) { var $bc = $(el), $as = $bc.find('li a'), collapsed_width = $as.width(), expanded_width = 0; $as.each(function(i, el) { var $a = $(el); expanded_width = $a.outerWidth(true); $a.addClass('collapsed').width(expanded_width); $a.hover(function() { $a.removeClass('collapsed'); }, function() { $a.addClass('collapsed'); }); }); }); // Close Modal on Escape Keydown $(window).on('keydown', function(ev) { // Escape if(ev.keyCode == 27) { // Close opened modal if(public_vars.$body.hasClass('modal-open')) $(".modal-open .modal:visible").modal('hide'); } }); // Minimal Addon focus interaction $(".input-group.input-group-minimal:has(.form-control)").each(function(i, el) { var $this = $(el), $fc = $this.find('.form-control'); $fc.on('focus', function() { $this.addClass('focused'); }).on('blur', function() { $this.removeClass('focused'); }); }); // Spinner $(".input-group.spinner").each(function(i, el) { var $ig = $(el), $dec = $ig.find('[data-type="decrement"]'), $inc = $ig.find('[data-type="increment"]'), $inp = $ig.find('.form-control'), step = attrDefault($ig, 'step', 1), min = attrDefault($ig, 'min', 0), max = attrDefault($ig, 'max', 0), umm = min < max; $dec.on('click', function(ev) { ev.preventDefault(); var num = new Number($inp.val()) - step; if(umm && num <= min) { num = min; } $inp.val(num); }); $inc.on('click', function(ev) { ev.preventDefault(); var num = new Number($inp.val()) + step; if(umm && num >= max) { num = max; } $inp.val(num); }); }); // Select2 Dropdown replacement if($.isFunction($.fn.select2)) { $(".select2").each(function(i, el) { var $this = $(el), opts = { allowClear: attrDefault($this, 'allowClear', false) }; $this.select2(opts); $this.addClass('visible'); //$this.select2("open"); }); if($.isFunction($.fn.niceScroll)) { $(".select2-results").niceScroll({ cursorcolor: '#d4d4d4', cursorborder: '1px solid #ccc', railpadding: {right: 3} }); } } // SelectBoxIt Dropdown replacement if($.isFunction($.fn.selectBoxIt)) { $("select.selectboxit").each(function(i, el) { var $this = $(el), opts = { showFirstOption: attrDefault($this, 'first-option', true), 'native': attrDefault($this, 'native', false), defaultText: attrDefault($this, 'text', ''), }; $this.addClass('visible'); $this.selectBoxIt(opts); }); } // Datepicker if($.isFunction($.fn.datepicker)) { $(".datepicker").each(function(i, el) { var $this = $(el), opts = { format: attrDefault($this, 'format', 'mm/dd/yyyy'), startDate: attrDefault($this, 'startDate', ''), endDate: attrDefault($this, 'endDate', ''), daysOfWeekDisabled: attrDefault($this, 'disabledDays', ''), startView: attrDefault($this, 'startView', 0), rtl: rtl() }, $n = $this.next(), $p = $this.prev(); $this.datepicker(opts); if($n.is('.input-group-addon') && $n.has('a')) { $n.on('click', function(ev) { ev.preventDefault(); $this.datepicker('show'); }); } if($p.is('.input-group-addon') && $p.has('a')) { $p.on('click', function(ev) { ev.preventDefault(); $this.datepicker('show'); }); } }); } // Date Range Picker if($.isFunction($.fn.daterangepicker)) { $(".daterange").each(function(i, el) { // Change the range as you desire var ranges = { 'Today': [moment(), moment()], 'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)], 'Last 7 Days': [moment().subtract('days', 6), moment()], 'Last 30 Days': [moment().subtract('days', 29), moment()], 'This Month': [moment().startOf('month'), moment().endOf('month')], 'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')] }; var $this = $(el), opts = { format: attrDefault($this, 'format', 'MM/DD/YYYY'), timePicker: attrDefault($this, 'timePicker', false), timePickerIncrement: attrDefault($this, 'timePickerIncrement', false), separator: attrDefault($this, 'separator', ' - '), }, min_date = attrDefault($this, 'minDate', ''), max_date = attrDefault($this, 'maxDate', ''), start_date = attrDefault($this, 'startDate', ''), end_date = attrDefault($this, 'endDate', ''); if($this.hasClass('add-ranges')) { opts['ranges'] = ranges; } if(min_date.length) { opts['minDate'] = min_date; } if(max_date.length) { opts['maxDate'] = max_date; } if(start_date.length) { opts['startDate'] = start_date; } if(end_date.length) { opts['endDate'] = end_date; } $this.daterangepicker(opts, function(start, end) { var drp = $this.data('daterangepicker'); if($this.is('[data-callback]')) { //daterange_callback(start, end); callback_test(start, end); } if($this.hasClass('daterange-inline')) { $this.find('span').html(start.format(drp.format) + drp.separator + end.format(drp.format)); } }); if(typeof opts['ranges'] == 'object') { $this.data('daterangepicker').container.removeClass('show-calendar'); } }); } // Timepicker if($.isFunction($.fn.timepicker)) { $(".timepicker").each(function(i, el) { var $this = $(el), opts = { template: attrDefault($this, 'template', false), showSeconds: attrDefault($this, 'showSeconds', false), defaultTime: attrDefault($this, 'defaultTime', 'current'), showMeridian: attrDefault($this, 'showMeridian', true), minuteStep: attrDefault($this, 'minuteStep', 15), secondStep: attrDefault($this, 'secondStep', 15) }, $n = $this.next(), $p = $this.prev(); $this.timepicker(opts); if($n.is('.input-group-addon') && $n.has('a')) { $n.on('click', function(ev) { ev.preventDefault(); $this.timepicker('showWidget'); }); } if($p.is('.input-group-addon') && $p.has('a')) { $p.on('click', function(ev) { ev.preventDefault(); $this.timepicker('showWidget'); }); } }); } // Colorpicker if($.isFunction($.fn.colorpicker)) { $(".colorpicker").each(function(i, el) { var $this = $(el), opts = { }, $n = $this.next(), $p = $this.prev(), $preview = $this.siblings('.input-group-addon').find('.color-preview'); $this.colorpicker(opts); if($n.is('.input-group-addon') && $n.has('a')) { $n.on('click', function(ev) { ev.preventDefault(); $this.colorpicker('show'); }); } if($p.is('.input-group-addon') && $p.has('a')) { $p.on('click', function(ev) { ev.preventDefault(); $this.colorpicker('show'); }); } if($preview.length) { $this.on('changeColor', function(ev){ $preview.css('background-color', ev.color.toHex()); }); if($this.val().length) { $preview.css('background-color', $this.val()); } } }); } // Form Validation if($.isFunction($.fn.validate)) { $("form.validate").each(function(i, el) { var $this = $(el), opts = { rules: {}, messages: {}, errorElement: 'span', errorClass: 'validate-has-error', highlight: function (element) { $(element).closest('.form-group').addClass('validate-has-error'); }, unhighlight: function (element) { $(element).closest('.form-group').removeClass('validate-has-error'); }, errorPlacement: function (error, element) { if(element.closest('.has-switch').length) { error.insertAfter(element.closest('.has-switch')); } else if(element.parent('.checkbox, .radio').length || element.parent('.input-group').length) { error.insertAfter(element.parent()); } else { error.insertAfter(element); } } }, $fields = $this.find('[data-validate]'); $fields.each(function(j, el2) { var $field = $(el2), name = $field.attr('name'), validate = attrDefault($field, 'validate', '').toString(), _validate = validate.split(','); for(var k in _validate) { var rule = _validate[k], params, message; if(typeof opts['rules'][name] == 'undefined') { opts['rules'][name] = {}; opts['messages'][name] = {}; } if($.inArray(rule, ['required', 'url', 'email', 'number', 'date', 'creditcard']) != -1) { opts['rules'][name][rule] = true; message = $field.data('message-' + rule); if(message) { opts['messages'][name][rule] = message; } } // Parameter Value (#1 parameter) else if(params = rule.match(/(\w+)\[(.*?)\]/i)) { if($.inArray(params[1], ['min', 'max', 'minlength', 'maxlength', 'equalTo']) != -1) { opts['rules'][name][params[1]] = params[2]; message = $field.data('message-' + params[1]); if(message) { opts['messages'][name][params[1]] = message; } } } } }); $this.validate(opts); }); } // Input Mask if($.isFunction($.fn.inputmask)) { $("[data-mask]").each(function(i, el) { var $this = $(el), mask = $this.data('mask').toString(), opts = { numericInput: attrDefault($this, 'numeric', false), radixPoint: attrDefault($this, 'radixPoint', ''), rightAlign: attrDefault($this, 'numericAlign', 'left') == 'right' }, placeholder = attrDefault($this, 'placeholder', ''), is_regex = attrDefault($this, 'isRegex', ''); if(placeholder.length) { opts[placeholder] = placeholder; } switch(mask.toLowerCase()) { case "phone": mask = "(999) 999-9999"; break; case "currency": case "rcurrency": var sign = attrDefault($this, 'sign', '$');; mask = "999,999,999.99"; if($this.data('mask').toLowerCase() == 'rcurrency') { mask += ' ' + sign; } else { mask = sign + ' ' + mask; } opts.numericInput = true; opts.rightAlignNumerics = false; opts.radixPoint = '.'; break; case "email": mask = 'Regex'; opts.regex = "[a-zA-Z0-9._%-]+@[a-zA-Z0-9-]+\\.[a-zA-Z]{2,4}"; break; case "fdecimal": mask = 'decimal'; $.extend(opts, { autoGroup : true, groupSize : 3, radixPoint : attrDefault($this, 'rad', '.'), groupSeparator : attrDefault($this, 'dec', ',') }); } if(is_regex) { opts.regex = mask; mask = 'Regex'; } $this.inputmask(mask, opts); }); } // Form Wizard if($.isFunction($.fn.bootstrapWizard)) { $(".form-wizard").each(function(i, el) { var $this = $(el), $tabs = $this.find('> .tabs > li'), $progress = $this.find(".progress-indicator"), _index = $this.find('> ul > li.active').index(); // Validation var checkFormWizardValidaion = function(tab, navigation, index) { if($this.hasClass('validate')) { var $valid = $this.valid(); if( ! $valid) { $this.data('validator').focusInvalid(); return false; } } return true; }; // Setup Progress if(_index > 0) { $progress.css({width: _index/$tabs.length * 100 + '%'}); $tabs.removeClass('completed').slice(0, _index).addClass('completed'); } $this.bootstrapWizard({ tabClass: "", onTabShow: function($tab, $navigation, index) { var pct = $tabs.eq(index).position().left / $tabs.parent().width() * 100; $tabs.removeClass('completed').slice(0, index).addClass('completed'); $progress.css({width: pct + '%'}); }, onNext: checkFormWizardValidaion, onTabClick: checkFormWizardValidaion }); $this.data('bootstrapWizard').show( _index ); $this.find('.pager a').on('click', function(ev) { ev.preventDefault(); }); }); } // Slider if($.isFunction($.fn.slider)) { $(".slider").each(function(i, el) { var $this = $(el), $label_1 = $('<span class="ui-label"></span>'), $label_2 = $label_1.clone(), orientation = attrDefault($this, 'vertical', 0) != 0 ? 'vertical' : 'horizontal', prefix = attrDefault($this, 'prefix', ''), postfix = attrDefault($this, 'postfix', ''), fill = attrDefault($this, 'fill', ''), $fill = $(fill), step = attrDefault($this, 'step', 1), value = attrDefault($this, 'value', 5), min = attrDefault($this, 'min', 0), max = attrDefault($this, 'max', 100), min_val = attrDefault($this, 'min-val', 10), max_val = attrDefault($this, 'max-val', 90), is_range = $this.is('[data-min-val]') || $this.is('[data-max-val]'), reps = 0; // Range Slider Options if(is_range) { $this.slider({ range: true, orientation: orientation, min: min, max: max, values: [min_val, max_val], step: step, slide: function(e, ui) { var min_val = (prefix ? prefix : '') + ui.values[0] + (postfix ? postfix : ''), max_val = (prefix ? prefix : '') + ui.values[1] + (postfix ? postfix : ''); $label_1.html( min_val ); $label_2.html( max_val ); if(fill) $fill.val(min_val + ',' + max_val); reps++; }, change: function(ev, ui) { if(reps == 1) { var min_val = (prefix ? prefix : '') + ui.values[0] + (postfix ? postfix : ''), max_val = (prefix ? prefix : '') + ui.values[1] + (postfix ? postfix : ''); $label_1.html( min_val ); $label_2.html( max_val ); if(fill) $fill.val(min_val + ',' + max_val); } reps = 0; } }); var $handles = $this.find('.ui-slider-handle'); $label_1.html((prefix ? prefix : '') + min_val + (postfix ? postfix : '')); $handles.first().append( $label_1 ); $label_2.html((prefix ? prefix : '') + max_val+ (postfix ? postfix : '')); $handles.last().append( $label_2 ); } // Normal Slider else { $this.slider({ range: attrDefault($this, 'basic', 0) ? false : "min", orientation: orientation, min: min, max: max, value: value, step: step, slide: function(ev, ui) { var val = (prefix ? prefix : '') + ui.value + (postfix ? postfix : ''); $label_1.html( val ); if(fill) $fill.val(val); reps++; }, change: function(ev, ui) { if(reps == 1) { var val = (prefix ? prefix : '') + ui.value + (postfix ? postfix : ''); $label_1.html( val ); if(fill) $fill.val(val); } reps = 0; } }); var $handles = $this.find('.ui-slider-handle'); //$fill = $('<div class="ui-fill"></div>'); $label_1.html((prefix ? prefix : '') + value + (postfix ? postfix : '')); $handles.html( $label_1 ); //$handles.parent().prepend( $fill ); //$fill.width($handles.get(0).style.left); } }) } // jQuery Knob if($.isFunction($.fn.knob)) { $(".knob").knob({ change: function (value) { }, release: function (value) { }, cancel: function () { }, draw: function () { if (this.$.data('skin') == 'tron') { var a = this.angle(this.cv) // Angle , sa = this.startAngle // Previous start angle , sat = this.startAngle // Start angle , ea // Previous end angle , eat = sat + a // End angle , r = 1; this.g.lineWidth = this.lineWidth; this.o.cursor && (sat = eat - 0.3) && (eat = eat + 0.3); if (this.o.displayPrevious) { ea = this.startAngle + this.angle(this.v); this.o.cursor && (sa = ea - 0.3) && (ea = ea + 0.3); this.g.beginPath(); this.g.strokeStyle = this.pColor; this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, sa, ea, false); this.g.stroke(); } this.g.beginPath(); this.g.strokeStyle = r ? this.o.fgColor : this.fgColor; this.g.arc(this.xy, this.xy, this.radius - this.lineWidth, sat, eat, false); this.g.stroke(); this.g.lineWidth = 2; this.g.beginPath(); this.g.strokeStyle = this.o.fgColor; this.g.arc(this.xy, this.xy, this.radius - this.lineWidth + 1 + this.lineWidth * 2 / 3, 0, 2 * Math.PI, false); this.g.stroke(); return false; } } }); } // Wysiwyg Editor if($.isFunction($.fn.wysihtml5)) { $(".wysihtml5").each(function(i, el) { var $this = $(el), stylesheets = attrDefault($this, 'stylesheet-url', '') $(".wysihtml5").wysihtml5({ size: 'white', stylesheets: stylesheets.split(','), "html": attrDefault($this, 'html', true), "color": attrDefault($this, 'colors', true), }); }); } // CKeditor WYSIWYG if($.isFunction($.fn.ckeditor)) { $(".ckeditor").ckeditor({ contentsLangDirection: rtl() ? 'rtl' : 'ltr' }); } // Dropzone is prezent if(typeof Dropzone != 'undefined') { Dropzone.autoDiscover = false; $(".dropzone[action]").each(function(i, el) { $(el).dropzone(); }); } // Tocify Table if($.isFunction($.fn.tocify) && $("#toc").length) { $("#toc").tocify({ context: '.tocify-content', selectors: "h2,h3,h4,h5" }); var $this = $(".tocify"), watcher = scrollMonitor.create($this.get(0)); $this.width( $this.parent().width() ); watcher.lock(); watcher.stateChange(function() { $($this.get(0)).toggleClass('fixed', this.isAboveViewport) }); } // Login Form Label Focusing $(".login-form .form-group:has(label)").each(function(i, el) { var $this = $(el), $label = $this.find('label'), $input = $this.find('.form-control'); $input.on('focus', function() { $this.addClass('is-focused'); }); $input.on('keydown', function() { $this.addClass('is-focused'); }); $input.on('blur', function() { $this.removeClass('is-focused'); if($input.val().trim().length > 0) { $this.addClass('is-focused'); } }); $label.on('click', function() { $input.focus(); }); if($input.val().trim().length > 0) { $this.addClass('is-focused'); } }); }); // Enable/Disable Resizable Event var wid = 0; $(window).resize(function() { clearTimeout(wid); wid = setTimeout(trigger_resizable, 200); }); })(jQuery, window); // Sideber Menu Setup function var sm_duration = .2, sm_transition_delay = 150; function setup_sidebar_menu() { if(public_vars.$sidebarMenu.length) { var $items_with_subs = public_vars.$sidebarMenu.find('li:has(> ul)'), toggle_others = public_vars.$sidebarMenu.hasClass('toggle-others'); $items_with_subs.filter('.active').addClass('expanded'); $items_with_subs.each(function(i, el) { var $li = jQuery(el), $a = $li.children('a'), $sub = $li.children('ul'); $li.addClass('has-sub'); $a.on('click', function(ev) { ev.preventDefault(); if(toggle_others) { sidebar_menu_close_items_siblings($li); } if($li.hasClass('expanded') || $li.hasClass('opened')) sidebar_menu_item_collapse($li, $sub); else sidebar_menu_item_expand($li, $sub); }); }); } } function sidebar_menu_item_expand($li, $sub) { if($li.data('is-busy') || ($li.parent('.main-menu').length && public_vars.$sidebarMenu.hasClass('collapsed'))) return; $li.addClass('expanded').data('is-busy', true); //$sub.show(); var $sub_items = $sub.children(), sub_height = $sub.outerHeight(), win_y = jQuery(window).height(), total_height = $li.outerHeight(), current_y = public_vars.$sidebarMenu.scrollTop(), item_max_y = $li.position().top + current_y, fit_to_viewpport = public_vars.$sidebarMenu.hasClass('fit-in-viewport'); $sub_items.addClass('is-hidden'); $sub.height(0); TweenMax.to($sub, sm_duration, {css: {height: sub_height}, onUpdate: ps_update, onComplete: function(){ $sub.height(''); }}); var interval_1 = $li.data('sub_i_1'), interval_2 = $li.data('sub_i_2'); window.clearTimeout(interval_1); interval_1 = setTimeout(function() { $sub_items.each(function(i, el) { var $sub_item = jQuery(el); $sub_item.addClass('is-shown'); }); var finish_on = sm_transition_delay * $sub_items.length, t_duration = parseFloat($sub_items.eq(0).css('transition-duration')), t_delay = parseFloat($sub_items.last().css('transition-delay')); if(t_duration && t_delay) { finish_on = (t_duration + t_delay) * 1000; } // In the end window.clearTimeout(interval_2); interval_2 = setTimeout(function() { $sub_items.removeClass('is-hidden is-shown'); }, finish_on); $li.data('is-busy', false); }, 0); $li.data('sub_i_1', interval_1), $li.data('sub_i_2', interval_2); } function sidebar_menu_item_collapse($li, $sub) { if($li.data('is-busy')) return; var $sub_items = $sub.children(); $li.removeClass('expanded').data('is-busy', true); $sub_items.addClass('hidden-item'); TweenMax.to($sub, sm_duration, {css: {height: 0}, onUpdate: ps_update, onComplete: function() { $li.data('is-busy', false).removeClass('opened'); //$sub.attr('style', '').hide(); $sub_items.removeClass('hidden-item'); $li.find('li.expanded ul').attr('style', '').hide().parent().removeClass('expanded'); ps_update(true); }}); } function sidebar_menu_close_items_siblings($li) { $li.siblings().not($li).filter('.expanded, .opened').each(function(i, el) { var $_li = jQuery(el), $_sub = $_li.children('ul'); sidebar_menu_item_collapse($_li, $_sub); }); } // Horizontal Menu function setup_horizontal_menu() { if(public_vars.$horizontalMenu.length) { var $items_with_subs = public_vars.$horizontalMenu.find('li:has(> ul)'), click_to_expand = public_vars.$horizontalMenu.hasClass('click-to-expand'); if(click_to_expand) { public_vars.$mainContent.add( public_vars.$sidebarMenu ).on('click', function(ev) { $items_with_subs.removeClass('hover'); }); } $items_with_subs.each(function(i, el) { var $li = jQuery(el), $a = $li.children('a'), $sub = $li.children('ul'), is_root_element = $li.parent().is('.navbar-nav'); $li.addClass('has-sub'); // Mobile Only $a.on('click', function(ev) { if(isxs()) { ev.preventDefault(); // Automatically will toggle other menu items in mobile view if(true) { sidebar_menu_close_items_siblings($li); } if($li.hasClass('expanded') || $li.hasClass('opened')) sidebar_menu_item_collapse($li, $sub); else sidebar_menu_item_expand($li, $sub); } }); // Click To Expand if(click_to_expand) { $a.on('click', function(ev) { ev.preventDefault(); if(isxs()) return; // For parents only if(is_root_element) { $items_with_subs.filter(function(i, el){ return jQuery(el).parent().is('.navbar-nav'); }).not($li).removeClass('hover'); $li.toggleClass('hover'); } // Sub menus else { var sub_height; // To Expand if($li.hasClass('expanded') == false) { $li.addClass('expanded'); $sub.addClass('is-visible'); sub_height = $sub.outerHeight(); $sub.height(0); TweenLite.to($sub, .15, {css: {height: sub_height}, ease: Sine.easeInOut, onComplete: function(){ $sub.attr('style', ''); }}); // Hide Existing in the list $li.siblings().find('> ul.is-visible').not($sub).each(function(i, el) { var $el = jQuery(el); sub_height = $el.outerHeight(); $el.removeClass('is-visible').height(sub_height); $el.parent().removeClass('expanded'); TweenLite.to($el, .15, {css: {height: 0}, onComplete: function(){ $el.attr('style', ''); }}); }); } // To Collapse else { sub_height = $sub.outerHeight(); $li.removeClass('expanded'); $sub.removeClass('is-visible').height(sub_height); TweenLite.to($sub, .15, {css: {height: 0}, onComplete: function(){ $sub.attr('style', ''); }}); } } }); } // Hover To Expand else { $li.hoverIntent({ over: function() { if(isxs()) return; if(is_root_element) { $li.addClass('hover'); } else { $sub.addClass('is-visible'); sub_height = $sub.outerHeight(); $sub.height(0); TweenLite.to($sub, .25, {css: {height: sub_height}, ease: Sine.easeInOut, onComplete: function(){ $sub.attr('style', ''); }}); } }, out: function() { if(isxs()) return; if(is_root_element) { $li.removeClass('hover'); } else { sub_height = $sub.outerHeight(); $li.removeClass('expanded'); $sub.removeClass('is-visible').height(sub_height); TweenLite.to($sub, .25, {css: {height: 0}, onComplete: function(){ $sub.attr('style', ''); }}); } }, timeout: 200, interval: is_root_element ? 10 : 100 }); } }); } } function stickFooterToBottom() { public_vars.$mainFooter.add( public_vars.$mainContent ).add( public_vars.$sidebarMenu ).attr('style', ''); if(isxs()) return false; if(public_vars.$mainFooter.hasClass('sticky')) { var win_height = jQuery(window).height(), footer_height = public_vars.$mainFooter.outerHeight(true), main_content_height = public_vars.$mainFooter.position().top + footer_height, main_content_height_only = main_content_height - footer_height, extra_height = public_vars.$horizontalNavbar.outerHeight(); if(win_height > main_content_height - parseInt(public_vars.$mainFooter.css('marginTop'), 10)) { public_vars.$mainFooter.css({ marginTop: win_height - main_content_height - extra_height }); } } } // Perfect scroll bar functions by Arlind Nushi function ps_update(destroy_init) { if(isxs()) return; if(jQuery.isFunction(jQuery.fn.perfectScrollbar)) { if(public_vars.$sidebarMenu.hasClass('collapsed')) { return; } public_vars.$sidebarMenu.find('.sidebar-menu-inner').perfectScrollbar('update'); if(destroy_init) { ps_destroy(); ps_init(); } } } function ps_init() { if(isxs()) return; if(jQuery.isFunction(jQuery.fn.perfectScrollbar)) { if(public_vars.$sidebarMenu.hasClass('collapsed') || ! public_vars.$sidebarMenu.hasClass('fixed')) { return; } public_vars.$sidebarMenu.find('.sidebar-menu-inner').perfectScrollbar({ wheelSpeed: 2, wheelPropagation: public_vars.wheelPropagation }); } } function ps_destroy() { if(jQuery.isFunction(jQuery.fn.perfectScrollbar)) { public_vars.$sidebarMenu.find('.sidebar-menu-inner').perfectScrollbar('destroy'); } } // Radio and Check box replacement by Arlind Nushi function cbr_replace() { var $inputs = jQuery('input[type="checkbox"].cbr, input[type="radio"].cbr').filter(':not(.cbr-done)'), $wrapper = '<div class="cbr-replaced"><div class="cbr-input"></div><div class="cbr-state"><span></span></div></div>'; $inputs.each(function(i, el) { var $el = jQuery(el), is_radio = $el.is(':radio'), is_checkbox = $el.is(':checkbox'), is_disabled = $el.is(':disabled'), styles = ['primary', 'secondary', 'success', 'danger', 'warning', 'info', 'purple', 'blue', 'red', 'gray', 'pink', 'yellow', 'orange', 'turquoise']; if( ! is_radio && ! is_checkbox) return; $el.after( $wrapper ); $el.addClass('cbr-done'); var $wrp = $el.next(); $wrp.find('.cbr-input').append( $el ); if(is_radio) $wrp.addClass('cbr-radio'); if(is_disabled) $wrp.addClass('cbr-disabled'); if($el.is(':checked')) { $wrp.addClass('cbr-checked'); } // Style apply jQuery.each(styles, function(key, val) { var cbr_class = 'cbr-' + val; if( $el.hasClass(cbr_class)) { $wrp.addClass(cbr_class); $el.removeClass(cbr_class); } }); // Events $wrp.on('click', function(ev) { if(is_radio && $el.prop('checked') || $wrp.parent().is('label')) return; if(jQuery(ev.target).is($el) == false) { $el.prop('checked', ! $el.is(':checked')); $el.trigger('change'); } }); $el.on('change', function(ev) { $wrp.removeClass('cbr-checked'); if($el.is(':checked')) $wrp.addClass('cbr-checked'); cbr_recheck(); }); }); } function cbr_recheck() { var $inputs = jQuery("input.cbr-done"); $inputs.each(function(i, el) { var $el = jQuery(el), is_radio = $el.is(':radio'), is_checkbox = $el.is(':checkbox'), is_disabled = $el.is(':disabled'), $wrp = $el.closest('.cbr-replaced'); if(is_disabled) $wrp.addClass('cbr-disabled'); if(is_radio && ! $el.prop('checked') && $wrp.hasClass('cbr-checked')) { $wrp.removeClass('cbr-checked'); } }); } // Element Attribute Helper function attrDefault($el, data_var, default_val) { if(typeof $el.data(data_var) != 'undefined') { return $el.data(data_var); } return default_val; } // Test function function callback_test() { alert("Callback function executed! No. of arguments: " + arguments.length + "\n\nSee console log for outputed of the arguments."); console.log(arguments); } // Date Formatter function date(format, timestamp) { // discuss at: http://phpjs.org/functions/date/ // original by: Carlos R. L. Rodrigues (http://www.jsfromhell.com) // original by: gettimeofday // parts by: Peter-Paul Koch (http://www.quirksmode.org/js/beat.html) // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // improved by: MeEtc (http://yass.meetcweb.com) // improved by: Brad Touesnard // improved by: Tim Wiel // improved by: Bryan Elliott // improved by: David Randall // improved by: Theriault // improved by: Theriault // improved by: Brett Zamir (http://brett-zamir.me) // improved by: Theriault // improved by: Thomas Beaucourt (http://www.webapp.fr) // improved by: JT // improved by: Theriault // improved by: Rafał Kukawski (http://blog.kukawski.pl) // improved by: Theriault // input by: Brett Zamir (http://brett-zamir.me) // input by: majak // input by: Alex // input by: Martin // input by: Alex Wilson // input by: Haravikk // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // bugfixed by: majak // bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // bugfixed by: Brett Zamir (http://brett-zamir.me) // bugfixed by: omid (http://phpjs.org/functions/380:380#comment_137122) // bugfixed by: Chris (http://www.devotis.nl/) // note: Uses global: php_js to store the default timezone // note: Although the function potentially allows timezone info (see notes), it currently does not set // note: per a timezone specified by date_default_timezone_set(). Implementers might use // note: this.php_js.currentTimezoneOffset and this.php_js.currentTimezoneDST set by that function // note: in order to adjust the dates in this function (or our other date functions!) accordingly // example 1: date('H:m:s \\m \\i\\s \\m\\o\\n\\t\\h', 1062402400); // returns 1: '09:09:40 m is month' // example 2: date('F j, Y, g:i a', 1062462400); // returns 2: 'September 2, 2003, 2:26 am' // example 3: date('Y W o', 1062462400); // returns 3: '2003 36 2003' // example 4: x = date('Y m d', (new Date()).getTime()/1000); // example 4: (x+'').length == 10 // 2009 01 09 // returns 4: true // example 5: date('W', 1104534000); // returns 5: '53' // example 6: date('B t', 1104534000); // returns 6: '999 31' // example 7: date('W U', 1293750000.82); // 2010-12-31 // returns 7: '52 1293750000' // example 8: date('W', 1293836400); // 2011-01-01 // returns 8: '52' // example 9: date('W Y-m-d', 1293974054); // 2011-01-02 // returns 9: '52 2011-01-02' var that = this; var jsdate, f; // Keep this here (works, but for code commented-out below for file size reasons) // var tal= []; var txt_words = [ 'Sun', 'Mon', 'Tues', 'Wednes', 'Thurs', 'Fri', 'Satur', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ]; // trailing backslash -> (dropped) // a backslash followed by any character (including backslash) -> the character // empty string -> empty string var formatChr = /\\?(.?)/gi; var formatChrCb = function (t, s) { return f[t] ? f[t]() : s; }; var _pad = function (n, c) { n = String(n); while (n.length < c) { n = '0' + n; } return n; }; f = { // Day d: function () { // Day of month w/leading 0; 01..31 return _pad(f.j(), 2); }, D: function () { // Shorthand day name; Mon...Sun return f.l() .slice(0, 3); }, j: function () { // Day of month; 1..31 return jsdate.getDate(); }, l: function () { // Full day name; Monday...Sunday return txt_words[f.w()] + 'day'; }, N: function () { // ISO-8601 day of week; 1[Mon]..7[Sun] return f.w() || 7; }, S: function () { // Ordinal suffix for day of month; st, nd, rd, th var j = f.j(); var i = j % 10; if (i <= 3 && parseInt((j % 100) / 10, 10) == 1) { i = 0; } return ['st', 'nd', 'rd'][i - 1] || 'th'; }, w: function () { // Day of week; 0[Sun]..6[Sat] return jsdate.getDay(); }, z: function () { // Day of year; 0..365 var a = new Date(f.Y(), f.n() - 1, f.j()); var b = new Date(f.Y(), 0, 1); return Math.round((a - b) / 864e5); }, // Week W: function () { // ISO-8601 week number var a = new Date(f.Y(), f.n() - 1, f.j() - f.N() + 3); var b = new Date(a.getFullYear(), 0, 4); return _pad(1 + Math.round((a - b) / 864e5 / 7), 2); }, // Month F: function () { // Full month name; January...December return txt_words[6 + f.n()]; }, m: function () { // Month w/leading 0; 01...12 return _pad(f.n(), 2); }, M: function () { // Shorthand month name; Jan...Dec return f.F() .slice(0, 3); }, n: function () { // Month; 1...12 return jsdate.getMonth() + 1; }, t: function () { // Days in month; 28...31 return (new Date(f.Y(), f.n(), 0)) .getDate(); }, // Year L: function () { // Is leap year?; 0 or 1 var j = f.Y(); return j % 4 === 0 & j % 100 !== 0 | j % 400 === 0; }, o: function () { // ISO-8601 year var n = f.n(); var W = f.W(); var Y = f.Y(); return Y + (n === 12 && W < 9 ? 1 : n === 1 && W > 9 ? -1 : 0); }, Y: function () { // Full year; e.g. 1980...2010 return jsdate.getFullYear(); }, y: function () { // Last two digits of year; 00...99 return f.Y() .toString() .slice(-2); }, // Time a: function () { // am or pm return jsdate.getHours() > 11 ? 'pm' : 'am'; }, A: function () { // AM or PM return f.a() .toUpperCase(); }, B: function () { // Swatch Internet time; 000..999 var H = jsdate.getUTCHours() * 36e2; // Hours var i = jsdate.getUTCMinutes() * 60; // Minutes // Seconds var s = jsdate.getUTCSeconds(); return _pad(Math.floor((H + i + s + 36e2) / 86.4) % 1e3, 3); }, g: function () { // 12-Hours; 1..12 return f.G() % 12 || 12; }, G: function () { // 24-Hours; 0..23 return jsdate.getHours(); }, h: function () { // 12-Hours w/leading 0; 01..12 return _pad(f.g(), 2); }, H: function () { // 24-Hours w/leading 0; 00..23 return _pad(f.G(), 2); }, i: function () { // Minutes w/leading 0; 00..59 return _pad(jsdate.getMinutes(), 2); }, s: function () { // Seconds w/leading 0; 00..59 return _pad(jsdate.getSeconds(), 2); }, u: function () { // Microseconds; 000000-999000 return _pad(jsdate.getMilliseconds() * 1000, 6); }, // Timezone e: function () { // Timezone identifier; e.g. Atlantic/Azores, ... // The following works, but requires inclusion of the very large // timezone_abbreviations_list() function. /* return that.date_default_timezone_get(); */ throw 'Not supported (see source code of date() for timezone on how to add support)'; }, I: function () { // DST observed?; 0 or 1 // Compares Jan 1 minus Jan 1 UTC to Jul 1 minus Jul 1 UTC. // If they are not equal, then DST is observed. var a = new Date(f.Y(), 0); // Jan 1 var c = Date.UTC(f.Y(), 0); // Jan 1 UTC var b = new Date(f.Y(), 6); // Jul 1 // Jul 1 UTC var d = Date.UTC(f.Y(), 6); return ((a - c) !== (b - d)) ? 1 : 0; }, O: function () { // Difference to GMT in hour format; e.g. +0200 var tzo = jsdate.getTimezoneOffset(); var a = Math.abs(tzo); return (tzo > 0 ? '-' : '+') + _pad(Math.floor(a / 60) * 100 + a % 60, 4); }, P: function () { // Difference to GMT w/colon; e.g. +02:00 var O = f.O(); return (O.substr(0, 3) + ':' + O.substr(3, 2)); }, T: function () { // Timezone abbreviation; e.g. EST, MDT, ... // The following works, but requires inclusion of the very // large timezone_abbreviations_list() function. /* var abbr, i, os, _default; if (!tal.length) { tal = that.timezone_abbreviations_list(); } if (that.php_js && that.php_js.default_timezone) { _default = that.php_js.default_timezone; for (abbr in tal) { for (i = 0; i < tal[abbr].length; i++) { if (tal[abbr][i].timezone_id === _default) { return abbr.toUpperCase(); } } } } for (abbr in tal) { for (i = 0; i < tal[abbr].length; i++) { os = -jsdate.getTimezoneOffset() * 60; if (tal[abbr][i].offset === os) { return abbr.toUpperCase(); } } } */ return 'UTC'; }, Z: function () { // Timezone offset in seconds (-43200...50400) return -jsdate.getTimezoneOffset() * 60; }, // Full Date/Time c: function () { // ISO-8601 date. return 'Y-m-d\\TH:i:sP'.replace(formatChr, formatChrCb); }, r: function () { // RFC 2822 return 'D, d M Y H:i:s O'.replace(formatChr, formatChrCb); }, U: function () { // Seconds since UNIX epoch return jsdate / 1000 | 0; } }; this.date = function (format, timestamp) { that = this; jsdate = (timestamp === undefined ? new Date() : // Not provided (timestamp instanceof Date) ? new Date(timestamp) : // JS Date() new Date(timestamp * 1000) // UNIX timestamp (auto-convert to int) ); return format.replace(formatChr, formatChrCb); }; return this.date(format, timestamp); }
"""test_1 URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import include, url from django.contrib import admin urlpatterns = [ url(r'^admin/', include(admin.site.urls)), ]
/** vim: et:ts=4:sw=4:sts=4 * @license RequireJS 2.1.5 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. * Available via the MIT or new BSD license. * see: http://github.com/jrburke/requirejs for details */ //Not using strict: uneven strict support in browsers, #392, and causes //problems with requirejs.exec()/transpiler plugins that may not be strict. /*jslint regexp: true, nomen: true, sloppy: true */ /*global window, navigator, document, importScripts, setTimeout, opera */ var requirejs, require, define; (function (global) { var req, s, head, baseElement, dataMain, src, interactiveScript, currentlyAddingScript, mainScript, subPath, version = '2.1.5', commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg, jsSuffixRegExp = /\.js$/, currDirRegExp = /^\.\//, op = Object.prototype, ostring = op.toString, hasOwn = op.hasOwnProperty, ap = Array.prototype, apsp = ap.splice, isBrowser = !!(typeof window !== 'undefined' && navigator && document), isWebWorker = !isBrowser && typeof importScripts !== 'undefined', //PS3 indicates loaded and complete, but need to wait for complete //specifically. Sequence is 'loading', 'loaded', execution, // then 'complete'. The UA check is unfortunate, but not sure how //to feature test w/o causing perf issues. readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ? /^complete$/ : /^(complete|loaded)$/, defContextName = '_', //Oh the tragedy, detecting opera. See the usage of isOpera for reason. isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]', contexts = {}, cfg = {}, globalDefQueue = [], useInteractive = false; function isFunction(it) { return ostring.call(it) === '[object Function]'; } function isArray(it) { return ostring.call(it) === '[object Array]'; } /** * Helper function for iterating over an array. If the func returns * a true value, it will break out of the loop. */ function each(ary, func) { if (ary) { var i; for (i = 0; i < ary.length; i += 1) { if (ary[i] && func(ary[i], i, ary)) { break; } } } } /** * Helper function for iterating over an array backwards. If the func * returns a true value, it will break out of the loop. */ function eachReverse(ary, func) { if (ary) { var i; for (i = ary.length - 1; i > -1; i -= 1) { if (ary[i] && func(ary[i], i, ary)) { break; } } } } function hasProp(obj, prop) { return hasOwn.call(obj, prop); } function getOwn(obj, prop) { return hasProp(obj, prop) && obj[prop]; } /** * Cycles over properties in an object and calls a function for each * property value. If the function returns a truthy value, then the * iteration is stopped. */ function eachProp(obj, func) { var prop; for (prop in obj) { if (hasProp(obj, prop)) { if (func(obj[prop], prop)) { break; } } } } /** * Simple function to mix in properties from source into target, * but only if target does not already have a property of the same name. */ function mixin(target, source, force, deepStringMixin) { if (source) { eachProp(source, function (value, prop) { if (force || !hasProp(target, prop)) { if (deepStringMixin && typeof value !== 'string') { if (!target[prop]) { target[prop] = {}; } mixin(target[prop], value, force, deepStringMixin); } else { target[prop] = value; } } }); } return target; } //Similar to Function.prototype.bind, but the 'this' object is specified //first, since it is easier to read/figure out what 'this' will be. function bind(obj, fn) { return function () { return fn.apply(obj, arguments); }; } function scripts() { return document.getElementsByTagName('script'); } //Allow getting a global that expressed in //dot notation, like 'a.b.c'. function getGlobal(value) { if (!value) { return value; } var g = global; each(value.split('.'), function (part) { g = g[part]; }); return g; } /** * Constructs an error with a pointer to an URL with more information. * @param {String} id the error ID that maps to an ID on a web page. * @param {String} message human readable error. * @param {Error} [err] the original error, if there is one. * * @returns {Error} */ function makeError(id, msg, err, requireModules) { var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id); e.requireType = id; e.requireModules = requireModules; if (err) { e.originalError = err; } return e; } if (typeof define !== 'undefined') { //If a define is already in play via another AMD loader, //do not overwrite. return; } if (typeof requirejs !== 'undefined') { if (isFunction(requirejs)) { //Do not overwrite and existing requirejs instance. return; } cfg = requirejs; requirejs = undefined; } //Allow for a require config object if (typeof require !== 'undefined' && !isFunction(require)) { //assume it is a config object. cfg = require; require = undefined; } function newContext(contextName) { var inCheckLoaded, Module, context, handlers, checkLoadedTimeoutId, config = { //Defaults. Do not set a default for map //config to speed up normalize(), which //will run faster if there is no default. waitSeconds: 7, baseUrl: './', paths: {}, pkgs: {}, shim: {}, config: {} }, registry = {}, //registry of just enabled modules, to speed //cycle breaking code when lots of modules //are registered, but not activated. enabledRegistry = {}, undefEvents = {}, defQueue = [], defined = {}, urlFetched = {}, requireCounter = 1, unnormalizedCounter = 1; /** * Trims the . and .. from an array of path segments. * It will keep a leading path segment if a .. will become * the first path segment, to help with module name lookups, * which act like paths, but can be remapped. But the end result, * all paths that use this function should look normalized. * NOTE: this method MODIFIES the input array. * @param {Array} ary the array of path segments. */ function trimDots(ary) { var i, part; for (i = 0; ary[i]; i += 1) { part = ary[i]; if (part === '.') { ary.splice(i, 1); i -= 1; } else if (part === '..') { if (i === 1 && (ary[2] === '..' || ary[0] === '..')) { //End of the line. Keep at least one non-dot //path segment at the front so it can be mapped //correctly to disk. Otherwise, there is likely //no path mapping for a path starting with '..'. //This can still fail, but catches the most reasonable //uses of .. break; } else if (i > 0) { ary.splice(i - 1, 2); i -= 2; } } } } /** * Given a relative module name, like ./something, normalize it to * a real name that can be mapped to a path. * @param {String} name the relative name * @param {String} baseName a real name that the name arg is relative * to. * @param {Boolean} applyMap apply the map config to the value. Should * only be done if this normalization is for a dependency ID. * @returns {String} normalized name */ function normalize(name, baseName, applyMap) { var pkgName, pkgConfig, mapValue, nameParts, i, j, nameSegment, foundMap, foundI, foundStarMap, starI, baseParts = baseName && baseName.split('/'), normalizedBaseParts = baseParts, map = config.map, starMap = map && map['*']; //Adjust any relative paths. if (name && name.charAt(0) === '.') { //If have a base name, try to normalize against it, //otherwise, assume it is a top-level require that will //be relative to baseUrl in the end. if (baseName) { if (getOwn(config.pkgs, baseName)) { //If the baseName is a package name, then just treat it as one //name to concat the name with. normalizedBaseParts = baseParts = [baseName]; } else { //Convert baseName to array, and lop off the last part, //so that . matches that 'directory' and not name of the baseName's //module. For instance, baseName of 'one/two/three', maps to //'one/two/three.js', but we want the directory, 'one/two' for //this normalization. normalizedBaseParts = baseParts.slice(0, baseParts.length - 1); } name = normalizedBaseParts.concat(name.split('/')); trimDots(name); //Some use of packages may use a . path to reference the //'main' module name, so normalize for that. pkgConfig = getOwn(config.pkgs, (pkgName = name[0])); name = name.join('/'); if (pkgConfig && name === pkgName + '/' + pkgConfig.main) { name = pkgName; } } else if (name.indexOf('./') === 0) { // No baseName, so this is ID is resolved relative // to baseUrl, pull off the leading dot. name = name.substring(2); } } //Apply map config if available. if (applyMap && map && (baseParts || starMap)) { nameParts = name.split('/'); for (i = nameParts.length; i > 0; i -= 1) { nameSegment = nameParts.slice(0, i).join('/'); if (baseParts) { //Find the longest baseName segment match in the config. //So, do joins on the biggest to smallest lengths of baseParts. for (j = baseParts.length; j > 0; j -= 1) { mapValue = getOwn(map, baseParts.slice(0, j).join('/')); //baseName segment has config, find if it has one for //this name. if (mapValue) { mapValue = getOwn(mapValue, nameSegment); if (mapValue) { //Match, update name to the new value. foundMap = mapValue; foundI = i; break; } } } } if (foundMap) { break; } //Check for a star map match, but just hold on to it, //if there is a shorter segment match later in a matching //config, then favor over this star map. if (!foundStarMap && starMap && getOwn(starMap, nameSegment)) { foundStarMap = getOwn(starMap, nameSegment); starI = i; } } if (!foundMap && foundStarMap) { foundMap = foundStarMap; foundI = starI; } if (foundMap) { nameParts.splice(0, foundI, foundMap); name = nameParts.join('/'); } } return name; } function removeScript(name) { if (isBrowser) { each(scripts(), function (scriptNode) { if (scriptNode.getAttribute('data-requiremodule') === name && scriptNode.getAttribute('data-requirecontext') === context.contextName) { scriptNode.parentNode.removeChild(scriptNode); return true; } }); } } function hasPathFallback(id) { var pathConfig = getOwn(config.paths, id); if (pathConfig && isArray(pathConfig) && pathConfig.length > 1) { removeScript(id); //Pop off the first array value, since it failed, and //retry pathConfig.shift(); context.require.undef(id); context.require([id]); return true; } } //Turns a plugin!resource to [plugin, resource] //with the plugin being undefined if the name //did not have a plugin prefix. function splitPrefix(name) { var prefix, index = name ? name.indexOf('!') : -1; if (index > -1) { prefix = name.substring(0, index); name = name.substring(index + 1, name.length); } return [prefix, name]; } /** * Creates a module mapping that includes plugin prefix, module * name, and path. If parentModuleMap is provided it will * also normalize the name via require.normalize() * * @param {String} name the module name * @param {String} [parentModuleMap] parent module map * for the module name, used to resolve relative names. * @param {Boolean} isNormalized: is the ID already normalized. * This is true if this call is done for a define() module ID. * @param {Boolean} applyMap: apply the map config to the ID. * Should only be true if this map is for a dependency. * * @returns {Object} */ function makeModuleMap(name, parentModuleMap, isNormalized, applyMap) { var url, pluginModule, suffix, nameParts, prefix = null, parentName = parentModuleMap ? parentModuleMap.name : null, originalName = name, isDefine = true, normalizedName = ''; //If no name, then it means it is a require call, generate an //internal name. if (!name) { isDefine = false; name = '_@r' + (requireCounter += 1); } nameParts = splitPrefix(name); prefix = nameParts[0]; name = nameParts[1]; if (prefix) { prefix = normalize(prefix, parentName, applyMap); pluginModule = getOwn(defined, prefix); } //Account for relative paths if there is a base name. if (name) { if (prefix) { if (pluginModule && pluginModule.normalize) { //Plugin is loaded, use its normalize method. normalizedName = pluginModule.normalize(name, function (name) { return normalize(name, parentName, applyMap); }); } else { normalizedName = normalize(name, parentName, applyMap); } } else { //A regular module. normalizedName = normalize(name, parentName, applyMap); //Normalized name may be a plugin ID due to map config //application in normalize. The map config values must //already be normalized, so do not need to redo that part. nameParts = splitPrefix(normalizedName); prefix = nameParts[0]; normalizedName = nameParts[1]; isNormalized = true; url = context.nameToUrl(normalizedName); } } //If the id is a plugin id that cannot be determined if it needs //normalization, stamp it with a unique ID so two matching relative //ids that may conflict can be separate. suffix = prefix && !pluginModule && !isNormalized ? '_unnormalized' + (unnormalizedCounter += 1) : ''; return { prefix: prefix, name: normalizedName, parentMap: parentModuleMap, unnormalized: !!suffix, url: url, originalName: originalName, isDefine: isDefine, id: (prefix ? prefix + '!' + normalizedName : normalizedName) + suffix }; } function getModule(depMap) { var id = depMap.id, mod = getOwn(registry, id); if (!mod) { mod = registry[id] = new context.Module(depMap); } return mod; } function on(depMap, name, fn) { var id = depMap.id, mod = getOwn(registry, id); if (hasProp(defined, id) && (!mod || mod.defineEmitComplete)) { if (name === 'defined') { fn(defined[id]); } } else { getModule(depMap).on(name, fn); } } function onError(err, errback) { var ids = err.requireModules, notified = false; if (errback) { errback(err); } else { each(ids, function (id) { var mod = getOwn(registry, id); if (mod) { //Set error on module, so it skips timeout checks. mod.error = err; if (mod.events.error) { notified = true; mod.emit('error', err); } } }); if (!notified) { req.onError(err); } } } /** * Internal method to transfer globalQueue items to this context's * defQueue. */ function takeGlobalQueue() { //Push all the globalDefQueue items into the context's defQueue if (globalDefQueue.length) { //Array splice in the values since the context code has a //local var ref to defQueue, so cannot just reassign the one //on context. apsp.apply(defQueue, [defQueue.length - 1, 0].concat(globalDefQueue)); globalDefQueue = []; } } handlers = { 'require': function (mod) { if (mod.require) { return mod.require; } else { return (mod.require = context.makeRequire(mod.map)); } }, 'exports': function (mod) { mod.usingExports = true; if (mod.map.isDefine) { if (mod.exports) { return mod.exports; } else { return (mod.exports = defined[mod.map.id] = {}); } } }, 'module': function (mod) { if (mod.module) { return mod.module; } else { return (mod.module = { id: mod.map.id, uri: mod.map.url, config: function () { return (config.config && getOwn(config.config, mod.map.id)) || {}; }, exports: defined[mod.map.id] }); } } }; function cleanRegistry(id) { //Clean up machinery used for waiting modules. delete registry[id]; delete enabledRegistry[id]; } function breakCycle(mod, traced, processed) { var id = mod.map.id; if (mod.error) { mod.emit('error', mod.error); } else { traced[id] = true; each(mod.depMaps, function (depMap, i) { var depId = depMap.id, dep = getOwn(registry, depId); //Only force things that have not completed //being defined, so still in the registry, //and only if it has not been matched up //in the module already. if (dep && !mod.depMatched[i] && !processed[depId]) { if (getOwn(traced, depId)) { mod.defineDep(i, defined[depId]); mod.check(); //pass false? } else { breakCycle(dep, traced, processed); } } }); processed[id] = true; } } function checkLoaded() { var map, modId, err, usingPathFallback, waitInterval = config.waitSeconds * 1000, //It is possible to disable the wait interval by using waitSeconds of 0. expired = waitInterval && (context.startTime + waitInterval) < new Date().getTime(), noLoads = [], reqCalls = [], stillLoading = false, needCycleCheck = true; //Do not bother if this call was a result of a cycle break. if (inCheckLoaded) { return; } inCheckLoaded = true; //Figure out the state of all the modules. eachProp(enabledRegistry, function (mod) { map = mod.map; modId = map.id; //Skip things that are not enabled or in error state. if (!mod.enabled) { return; } if (!map.isDefine) { reqCalls.push(mod); } if (!mod.error) { //If the module should be executed, and it has not //been inited and time is up, remember it. if (!mod.inited && expired) { if (hasPathFallback(modId)) { usingPathFallback = true; stillLoading = true; } else { noLoads.push(modId); removeScript(modId); } } else if (!mod.inited && mod.fetched && map.isDefine) { stillLoading = true; if (!map.prefix) { //No reason to keep looking for unfinished //loading. If the only stillLoading is a //plugin resource though, keep going, //because it may be that a plugin resource //is waiting on a non-plugin cycle. return (needCycleCheck = false); } } } }); if (expired && noLoads.length) { //If wait time expired, throw error of unloaded modules. err = makeError('timeout', 'Load timeout for modules: ' + noLoads, null, noLoads); err.contextName = context.contextName; return onError(err); } //Not expired, check for a cycle. if (needCycleCheck) { each(reqCalls, function (mod) { breakCycle(mod, {}, {}); }); } //If still waiting on loads, and the waiting load is something //other than a plugin resource, or there are still outstanding //scripts, then just try back later. if ((!expired || usingPathFallback) && stillLoading) { //Something is still waiting to load. Wait for it, but only //if a timeout is not already in effect. if ((isBrowser || isWebWorker) && !checkLoadedTimeoutId) { checkLoadedTimeoutId = setTimeout(function () { checkLoadedTimeoutId = 0; checkLoaded(); }, 50); } } inCheckLoaded = false; } Module = function (map) { this.events = getOwn(undefEvents, map.id) || {}; this.map = map; this.shim = getOwn(config.shim, map.id); this.depExports = []; this.depMaps = []; this.depMatched = []; this.pluginMaps = {}; this.depCount = 0; /* this.exports this.factory this.depMaps = [], this.enabled, this.fetched */ }; Module.prototype = { init: function (depMaps, factory, errback, options) { options = options || {}; //Do not do more inits if already done. Can happen if there //are multiple define calls for the same module. That is not //a normal, common case, but it is also not unexpected. if (this.inited) { return; } this.factory = factory; if (errback) { //Register for errors on this module. this.on('error', errback); } else if (this.events.error) { //If no errback already, but there are error listeners //on this module, set up an errback to pass to the deps. errback = bind(this, function (err) { this.emit('error', err); }); } //Do a copy of the dependency array, so that //source inputs are not modified. For example //"shim" deps are passed in here directly, and //doing a direct modification of the depMaps array //would affect that config. this.depMaps = depMaps && depMaps.slice(0); this.errback = errback; //Indicate this module has be initialized this.inited = true; this.ignore = options.ignore; //Could have option to init this module in enabled mode, //or could have been previously marked as enabled. However, //the dependencies are not known until init is called. So //if enabled previously, now trigger dependencies as enabled. if (options.enabled || this.enabled) { //Enable this module and dependencies. //Will call this.check() this.enable(); } else { this.check(); } }, defineDep: function (i, depExports) { //Because of cycles, defined callback for a given //export can be called more than once. if (!this.depMatched[i]) { this.depMatched[i] = true; this.depCount -= 1; this.depExports[i] = depExports; } }, fetch: function () { if (this.fetched) { return; } this.fetched = true; context.startTime = (new Date()).getTime(); var map = this.map; //If the manager is for a plugin managed resource, //ask the plugin to load it now. if (this.shim) { context.makeRequire(this.map, { enableBuildCallback: true })(this.shim.deps || [], bind(this, function () { return map.prefix ? this.callPlugin() : this.load(); })); } else { //Regular dependency. return map.prefix ? this.callPlugin() : this.load(); } }, load: function () { var url = this.map.url; //Regular dependency. if (!urlFetched[url]) { urlFetched[url] = true; context.load(this.map.id, url); } }, /** * Checks if the module is ready to define itself, and if so, * define it. */ check: function () { if (!this.enabled || this.enabling) { return; } var err, cjsModule, id = this.map.id, depExports = this.depExports, exports = this.exports, factory = this.factory; if (!this.inited) { this.fetch(); } else if (this.error) { this.emit('error', this.error); } else if (!this.defining) { //The factory could trigger another require call //that would result in checking this module to //define itself again. If already in the process //of doing that, skip this work. this.defining = true; if (this.depCount < 1 && !this.defined) { if (isFunction(factory)) { //If there is an error listener, favor passing //to that instead of throwing an error. if (this.events.error) { try { exports = context.execCb(id, factory, depExports, exports); } catch (e) { err = e; } } else { exports = context.execCb(id, factory, depExports, exports); } if (this.map.isDefine) { //If setting exports via 'module' is in play, //favor that over return value and exports. After that, //favor a non-undefined return value over exports use. cjsModule = this.module; if (cjsModule && cjsModule.exports !== undefined && //Make sure it is not already the exports value cjsModule.exports !== this.exports) { exports = cjsModule.exports; } else if (exports === undefined && this.usingExports) { //exports already set the defined value. exports = this.exports; } } if (err) { err.requireMap = this.map; err.requireModules = [this.map.id]; err.requireType = 'define'; return onError((this.error = err)); } } else { //Just a literal value exports = factory; } this.exports = exports; if (this.map.isDefine && !this.ignore) { defined[id] = exports; if (req.onResourceLoad) { req.onResourceLoad(context, this.map, this.depMaps); } } //Clean up cleanRegistry(id); this.defined = true; } //Finished the define stage. Allow calling check again //to allow define notifications below in the case of a //cycle. this.defining = false; if (this.defined && !this.defineEmitted) { this.defineEmitted = true; this.emit('defined', this.exports); this.defineEmitComplete = true; } } }, callPlugin: function () { var map = this.map, id = map.id, //Map already normalized the prefix. pluginMap = makeModuleMap(map.prefix); //Mark this as a dependency for this plugin, so it //can be traced for cycles. this.depMaps.push(pluginMap); on(pluginMap, 'defined', bind(this, function (plugin) { var load, normalizedMap, normalizedMod, name = this.map.name, parentName = this.map.parentMap ? this.map.parentMap.name : null, localRequire = context.makeRequire(map.parentMap, { enableBuildCallback: true }); //If current map is not normalized, wait for that //normalized name to load instead of continuing. if (this.map.unnormalized) { //Normalize the ID if the plugin allows it. if (plugin.normalize) { name = plugin.normalize(name, function (name) { return normalize(name, parentName, true); }) || ''; } //prefix and name should already be normalized, no need //for applying map config again either. normalizedMap = makeModuleMap(map.prefix + '!' + name, this.map.parentMap); on(normalizedMap, 'defined', bind(this, function (value) { this.init([], function () { return value; }, null, { enabled: true, ignore: true }); })); normalizedMod = getOwn(registry, normalizedMap.id); if (normalizedMod) { //Mark this as a dependency for this plugin, so it //can be traced for cycles. this.depMaps.push(normalizedMap); if (this.events.error) { normalizedMod.on('error', bind(this, function (err) { this.emit('error', err); })); } normalizedMod.enable(); } return; } load = bind(this, function (value) { this.init([], function () { return value; }, null, { enabled: true }); }); load.error = bind(this, function (err) { this.inited = true; this.error = err; err.requireModules = [id]; //Remove temp unnormalized modules for this module, //since they will never be resolved otherwise now. eachProp(registry, function (mod) { if (mod.map.id.indexOf(id + '_unnormalized') === 0) { cleanRegistry(mod.map.id); } }); onError(err); }); //Allow plugins to load other code without having to know the //context or how to 'complete' the load. load.fromText = bind(this, function (text, textAlt) { /*jslint evil: true */ var moduleName = map.name, moduleMap = makeModuleMap(moduleName), hasInteractive = useInteractive; //As of 2.1.0, support just passing the text, to reinforce //fromText only being called once per resource. Still //support old style of passing moduleName but discard //that moduleName in favor of the internal ref. if (textAlt) { text = textAlt; } //Turn off interactive script matching for IE for any define //calls in the text, then turn it back on at the end. if (hasInteractive) { useInteractive = false; } //Prime the system by creating a module instance for //it. getModule(moduleMap); //Transfer any config to this other module. if (hasProp(config.config, id)) { config.config[moduleName] = config.config[id]; } try { req.exec(text); } catch (e) { return onError(makeError('fromtexteval', 'fromText eval for ' + id + ' failed: ' + e, e, [id])); } if (hasInteractive) { useInteractive = true; } //Mark this as a dependency for the plugin //resource this.depMaps.push(moduleMap); //Support anonymous modules. context.completeLoad(moduleName); //Bind the value of that module to the value for this //resource ID. localRequire([moduleName], load); }); //Use parentName here since the plugin's name is not reliable, //could be some weird string with no path that actually wants to //reference the parentName's path. plugin.load(map.name, localRequire, load, config); })); context.enable(pluginMap, this); this.pluginMaps[pluginMap.id] = pluginMap; }, enable: function () { enabledRegistry[this.map.id] = this; this.enabled = true; //Set flag mentioning that the module is enabling, //so that immediate calls to the defined callbacks //for dependencies do not trigger inadvertent load //with the depCount still being zero. this.enabling = true; //Enable each dependency each(this.depMaps, bind(this, function (depMap, i) { var id, mod, handler; if (typeof depMap === 'string') { //Dependency needs to be converted to a depMap //and wired up to this module. depMap = makeModuleMap(depMap, (this.map.isDefine ? this.map : this.map.parentMap), false, !this.skipMap); this.depMaps[i] = depMap; handler = getOwn(handlers, depMap.id); if (handler) { this.depExports[i] = handler(this); return; } this.depCount += 1; on(depMap, 'defined', bind(this, function (depExports) { this.defineDep(i, depExports); this.check(); })); if (this.errback) { on(depMap, 'error', this.errback); } } id = depMap.id; mod = registry[id]; //Skip special modules like 'require', 'exports', 'module' //Also, don't call enable if it is already enabled, //important in circular dependency cases. if (!hasProp(handlers, id) && mod && !mod.enabled) { context.enable(depMap, this); } })); //Enable each plugin that is used in //a dependency eachProp(this.pluginMaps, bind(this, function (pluginMap) { var mod = getOwn(registry, pluginMap.id); if (mod && !mod.enabled) { context.enable(pluginMap, this); } })); this.enabling = false; this.check(); }, on: function (name, cb) { var cbs = this.events[name]; if (!cbs) { cbs = this.events[name] = []; } cbs.push(cb); }, emit: function (name, evt) { each(this.events[name], function (cb) { cb(evt); }); if (name === 'error') { //Now that the error handler was triggered, remove //the listeners, since this broken Module instance //can stay around for a while in the registry. delete this.events[name]; } } }; function callGetModule(args) { //Skip modules already defined. if (!hasProp(defined, args[0])) { getModule(makeModuleMap(args[0], null, true)).init(args[1], args[2]); } } function removeListener(node, func, name, ieName) { //Favor detachEvent because of IE9 //issue, see attachEvent/addEventListener comment elsewhere //in this file. if (node.detachEvent && !isOpera) { //Probably IE. If not it will throw an error, which will be //useful to know. if (ieName) { node.detachEvent(ieName, func); } } else { node.removeEventListener(name, func, false); } } /** * Given an event from a script node, get the requirejs info from it, * and then removes the event listeners on the node. * @param {Event} evt * @returns {Object} */ function getScriptData(evt) { //Using currentTarget instead of target for Firefox 2.0's sake. Not //all old browsers will be supported, but this one was easy enough //to support and still makes sense. var node = evt.currentTarget || evt.srcElement; //Remove the listeners once here. removeListener(node, context.onScriptLoad, 'load', 'onreadystatechange'); removeListener(node, context.onScriptError, 'error'); return { node: node, id: node && node.getAttribute('data-requiremodule') }; } function intakeDefines() { var args; //Any defined modules in the global queue, intake them now. takeGlobalQueue(); //Make sure any remaining defQueue items get properly processed. while (defQueue.length) { args = defQueue.shift(); if (args[0] === null) { return onError(makeError('mismatch', 'Mismatched anonymous define() module: ' + args[args.length - 1])); } else { //args are id, deps, factory. Should be normalized by the //define() function. callGetModule(args); } } } context = { config: config, contextName: contextName, registry: registry, defined: defined, urlFetched: urlFetched, defQueue: defQueue, Module: Module, makeModuleMap: makeModuleMap, nextTick: req.nextTick, onError: onError, /** * Set a configuration for the context. * @param {Object} cfg config object to integrate. */ configure: function (cfg) { //Make sure the baseUrl ends in a slash. if (cfg.baseUrl) { if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') { cfg.baseUrl += '/'; } } //Save off the paths and packages since they require special processing, //they are additive. var pkgs = config.pkgs, shim = config.shim, objs = { paths: true, config: true, map: true }; eachProp(cfg, function (value, prop) { if (objs[prop]) { if (prop === 'map') { if (!config.map) { config.map = {}; } mixin(config[prop], value, true, true); } else { mixin(config[prop], value, true); } } else { config[prop] = value; } }); //Merge shim if (cfg.shim) { eachProp(cfg.shim, function (value, id) { //Normalize the structure if (isArray(value)) { value = { deps: value }; } if ((value.exports || value.init) && !value.exportsFn) { value.exportsFn = context.makeShimExports(value); } shim[id] = value; }); config.shim = shim; } //Adjust packages if necessary. if (cfg.packages) { each(cfg.packages, function (pkgObj) { var location; pkgObj = typeof pkgObj === 'string' ? { name: pkgObj } : pkgObj; location = pkgObj.location; //Create a brand new object on pkgs, since currentPackages can //be passed in again, and config.pkgs is the internal transformed //state for all package configs. pkgs[pkgObj.name] = { name: pkgObj.name, location: location || pkgObj.name, //Remove leading dot in main, so main paths are normalized, //and remove any trailing .js, since different package //envs have different conventions: some use a module name, //some use a file name. main: (pkgObj.main || 'main') .replace(currDirRegExp, '') .replace(jsSuffixRegExp, '') }; }); //Done with modifications, assing packages back to context config config.pkgs = pkgs; } //If there are any "waiting to execute" modules in the registry, //update the maps for them, since their info, like URLs to load, //may have changed. eachProp(registry, function (mod, id) { //If module already has init called, since it is too //late to modify them, and ignore unnormalized ones //since they are transient. if (!mod.inited && !mod.map.unnormalized) { mod.map = makeModuleMap(id); } }); //If a deps array or a config callback is specified, then call //require with those args. This is useful when require is defined as a //config object before require.js is loaded. if (cfg.deps || cfg.callback) { context.require(cfg.deps || [], cfg.callback); } }, makeShimExports: function (value) { function fn() { var ret; if (value.init) { ret = value.init.apply(global, arguments); } return ret || (value.exports && getGlobal(value.exports)); } return fn; }, makeRequire: function (relMap, options) { options = options || {}; function localRequire(deps, callback, errback) { var id, map, requireMod; if (options.enableBuildCallback && callback && isFunction(callback)) { callback.__requireJsBuild = true; } if (typeof deps === 'string') { if (isFunction(callback)) { //Invalid call return onError(makeError('requireargs', 'Invalid require call'), errback); } //If require|exports|module are requested, get the //value for them from the special handlers. Caveat: //this only works while module is being defined. if (relMap && hasProp(handlers, deps)) { return handlers[deps](registry[relMap.id]); } //Synchronous access to one module. If require.get is //available (as in the Node adapter), prefer that. if (req.get) { return req.get(context, deps, relMap, localRequire); } //Normalize module name, if it contains . or .. map = makeModuleMap(deps, relMap, false, true); id = map.id; if (!hasProp(defined, id)) { return onError(makeError('notloaded', 'Module name "' + id + '" has not been loaded yet for context: ' + contextName + (relMap ? '' : '. Use require([])'))); } return defined[id]; } //Grab defines waiting in the global queue. intakeDefines(); //Mark all the dependencies as needing to be loaded. context.nextTick(function () { //Some defines could have been added since the //require call, collect them. intakeDefines(); requireMod = getModule(makeModuleMap(null, relMap)); //Store if map config should be applied to this require //call for dependencies. requireMod.skipMap = options.skipMap; requireMod.init(deps, callback, errback, { enabled: true }); checkLoaded(); }); return localRequire; } mixin(localRequire, { isBrowser: isBrowser, /** * Converts a module name + .extension into an URL path. * *Requires* the use of a module name. It does not support using * plain URLs like nameToUrl. */ toUrl: function (moduleNamePlusExt) { var ext, index = moduleNamePlusExt.lastIndexOf('.'), segment = moduleNamePlusExt.split('/')[0], isRelative = segment === '.' || segment === '..'; //Have a file extension alias, and it is not the //dots from a relative path. if (index !== -1 && (!isRelative || index > 1)) { ext = moduleNamePlusExt.substring(index, moduleNamePlusExt.length); moduleNamePlusExt = moduleNamePlusExt.substring(0, index); } return context.nameToUrl(normalize(moduleNamePlusExt, relMap && relMap.id, true), ext, true); }, defined: function (id) { return hasProp(defined, makeModuleMap(id, relMap, false, true).id); }, specified: function (id) { id = makeModuleMap(id, relMap, false, true).id; return hasProp(defined, id) || hasProp(registry, id); } }); //Only allow undef on top level require calls if (!relMap) { localRequire.undef = function (id) { //Bind any waiting define() calls to this context, //fix for #408 takeGlobalQueue(); var map = makeModuleMap(id, relMap, true), mod = getOwn(registry, id); delete defined[id]; delete urlFetched[map.url]; delete undefEvents[id]; if (mod) { //Hold on to listeners in case the //module will be attempted to be reloaded //using a different config. if (mod.events.defined) { undefEvents[id] = mod.events; } cleanRegistry(id); } }; } return localRequire; }, /** * Called to enable a module if it is still in the registry * awaiting enablement. A second arg, parent, the parent module, * is passed in for context, when this method is overriden by * the optimizer. Not shown here to keep code compact. */ enable: function (depMap) { var mod = getOwn(registry, depMap.id); if (mod) { getModule(depMap).enable(); } }, /** * Internal method used by environment adapters to complete a load event. * A load event could be a script load or just a load pass from a synchronous * load call. * @param {String} moduleName the name of the module to potentially complete. */ completeLoad: function (moduleName) { var found, args, mod, shim = getOwn(config.shim, moduleName) || {}, shExports = shim.exports; takeGlobalQueue(); while (defQueue.length) { args = defQueue.shift(); if (args[0] === null) { args[0] = moduleName; //If already found an anonymous module and bound it //to this name, then this is some other anon module //waiting for its completeLoad to fire. if (found) { break; } found = true; } else if (args[0] === moduleName) { //Found matching define call for this script! found = true; } callGetModule(args); } //Do this after the cycle of callGetModule in case the result //of those calls/init calls changes the registry. mod = getOwn(registry, moduleName); if (!found && !hasProp(defined, moduleName) && mod && !mod.inited) { if (config.enforceDefine && (!shExports || !getGlobal(shExports))) { if (hasPathFallback(moduleName)) { return; } else { return onError(makeError('nodefine', 'No define call for ' + moduleName, null, [moduleName])); } } else { //A script that does not call define(), so just simulate //the call for it. callGetModule([moduleName, (shim.deps || []), shim.exportsFn]); } } checkLoaded(); }, /** * Converts a module name to a file path. Supports cases where * moduleName may actually be just an URL. * Note that it **does not** call normalize on the moduleName, * it is assumed to have already been normalized. This is an * internal API, not a public one. Use toUrl for the public API. */ nameToUrl: function (moduleName, ext, skipExt) { var paths, pkgs, pkg, pkgPath, syms, i, parentModule, url, parentPath; //If a colon is in the URL, it indicates a protocol is used and it is just //an URL to a file, or if it starts with a slash, contains a query arg (i.e. ?) //or ends with .js, then assume the user meant to use an url and not a module id. //The slash is important for protocol-less URLs as well as full paths. if (req.jsExtRegExp.test(moduleName)) { //Just a plain path, not module name lookup, so just return it. //Add extension if it is included. This is a bit wonky, only non-.js things pass //an extension, this method probably needs to be reworked. url = moduleName + (ext || ''); } else { //A module that needs to be converted to a path. paths = config.paths; pkgs = config.pkgs; syms = moduleName.split('/'); //For each module name segment, see if there is a path //registered for it. Start with most specific name //and work up from it. for (i = syms.length; i > 0; i -= 1) { parentModule = syms.slice(0, i).join('/'); pkg = getOwn(pkgs, parentModule); parentPath = getOwn(paths, parentModule); if (parentPath) { //If an array, it means there are a few choices, //Choose the one that is desired if (isArray(parentPath)) { parentPath = parentPath[0]; } syms.splice(0, i, parentPath); break; } else if (pkg) { //If module name is just the package name, then looking //for the main module. if (moduleName === pkg.name) { pkgPath = pkg.location + '/' + pkg.main; } else { pkgPath = pkg.location; } syms.splice(0, i, pkgPath); break; } } //Join the path parts together, then figure out if baseUrl is needed. url = syms.join('/'); url += (ext || (/\?/.test(url) || skipExt ? '' : '.js')); url = (url.charAt(0) === '/' || url.match(/^[\w\+\.\-]+:/) ? '' : config.baseUrl) + url; } return config.urlArgs ? url + ((url.indexOf('?') === -1 ? '?' : '&') + config.urlArgs) : url; }, //Delegates to req.load. Broken out as a separate function to //allow overriding in the optimizer. load: function (id, url) { req.load(context, id, url); }, /** * Executes a module callack function. Broken out as a separate function * solely to allow the build system to sequence the files in the built * layer in the right sequence. * * @private */ execCb: function (name, callback, args, exports) { return callback.apply(exports, args); }, /** * callback for script loads, used to check status of loading. * * @param {Event} evt the event from the browser for the script * that was loaded. */ onScriptLoad: function (evt) { //Using currentTarget instead of target for Firefox 2.0's sake. Not //all old browsers will be supported, but this one was easy enough //to support and still makes sense. if (evt.type === 'load' || (readyRegExp.test((evt.currentTarget || evt.srcElement).readyState))) { //Reset interactive script so a script node is not held onto for //to long. interactiveScript = null; //Pull out the name of the module and the context. var data = getScriptData(evt); context.completeLoad(data.id); } }, /** * Callback for script errors. */ onScriptError: function (evt) { var data = getScriptData(evt); if (!hasPathFallback(data.id)) { return onError(makeError('scripterror', 'Script error', evt, [data.id])); } } }; context.require = context.makeRequire(); return context; } /** * Main entry point. * * If the only argument to require is a string, then the module that * is represented by that string is fetched for the appropriate context. * * If the first argument is an array, then it will be treated as an array * of dependency string names to fetch. An optional function callback can * be specified to execute when all of those dependencies are available. * * Make a local req variable to help Caja compliance (it assumes things * on a require that are not standardized), and to give a short * name for minification/local scope use. */ req = requirejs = function (deps, callback, errback, optional) { //Find the right context, use default var context, config, contextName = defContextName; // Determine if have config object in the call. if (!isArray(deps) && typeof deps !== 'string') { // deps is a config object config = deps; if (isArray(callback)) { // Adjust args if there are dependencies deps = callback; callback = errback; errback = optional; } else { deps = []; } } if (config && config.context) { contextName = config.context; } context = getOwn(contexts, contextName); if (!context) { context = contexts[contextName] = req.s.newContext(contextName); } if (config) { context.configure(config); } return context.require(deps, callback, errback); }; /** * Support require.config() to make it easier to cooperate with other * AMD loaders on globally agreed names. */ req.config = function (config) { return req(config); }; /** * Execute something after the current tick * of the event loop. Override for other envs * that have a better solution than setTimeout. * @param {Function} fn function to execute later. */ req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) { setTimeout(fn, 4); } : function (fn) { fn(); }; /** * Export require as a global, but only if it does not already exist. */ if (!require) { require = req; } req.version = version; //Used to filter out dependencies that are already paths. req.jsExtRegExp = /^\/|:|\?|\.js$/; req.isBrowser = isBrowser; s = req.s = { contexts: contexts, newContext: newContext }; //Create default context. req({}); //Exports some context-sensitive methods on global require. each([ 'toUrl', 'undef', 'defined', 'specified' ], function (prop) { //Reference from contexts instead of early binding to default context, //so that during builds, the latest instance of the default context //with its config gets used. req[prop] = function () { var ctx = contexts[defContextName]; return ctx.require[prop].apply(ctx, arguments); }; }); if (isBrowser) { head = s.head = document.getElementsByTagName('head')[0]; //If BASE tag is in play, using appendChild is a problem for IE6. //When that browser dies, this can be removed. Details in this jQuery bug: //http://dev.jquery.com/ticket/2709 baseElement = document.getElementsByTagName('base')[0]; if (baseElement) { head = s.head = baseElement.parentNode; } } /** * Any errors that require explicitly generates will be passed to this * function. Intercept/override it if you want custom error handling. * @param {Error} err the error object. */ req.onError = function (err) { throw err; }; /** * Does the request to load a module for the browser case. * Make this a separate function to allow other environments * to override it. * * @param {Object} context the require context to find state. * @param {String} moduleName the name of the module. * @param {Object} url the URL to the module. */ req.load = function (context, moduleName, url) { var config = (context && context.config) || {}, node; if (isBrowser) { //In the browser so use a script tag node = config.xhtml ? document.createElementNS('http://www.w3.org/1999/xhtml', 'html:script') : document.createElement('script'); node.type = config.scriptType || 'text/javascript'; node.charset = 'utf-8'; node.async = true; node.setAttribute('data-requirecontext', context.contextName); node.setAttribute('data-requiremodule', moduleName); //Set up load listener. Test attachEvent first because IE9 has //a subtle issue in its addEventListener and script onload firings //that do not match the behavior of all other browsers with //addEventListener support, which fire the onload event for a //script right after the script execution. See: //https://connect.microsoft.com/IE/feedback/details/648057/script-onload-event-is-not-fired-immediately-after-script-execution //UNFORTUNATELY Opera implements attachEvent but does not follow the script //script execution mode. if (node.attachEvent && //Check if node.attachEvent is artificially added by custom script or //natively supported by browser //read https://github.com/jrburke/requirejs/issues/187 //if we can NOT find [native code] then it must NOT natively supported. //in IE8, node.attachEvent does not have toString() //Note the test for "[native code" with no closing brace, see: //https://github.com/jrburke/requirejs/issues/273 !(node.attachEvent.toString && node.attachEvent.toString().indexOf('[native code') < 0) && !isOpera) { //Probably IE. IE (at least 6-8) do not fire //script onload right after executing the script, so //we cannot tie the anonymous define call to a name. //However, IE reports the script as being in 'interactive' //readyState at the time of the define call. useInteractive = true; node.attachEvent('onreadystatechange', context.onScriptLoad); //It would be great to add an error handler here to catch //404s in IE9+. However, onreadystatechange will fire before //the error handler, so that does not help. If addEventListener //is used, then IE will fire error before load, but we cannot //use that pathway given the connect.microsoft.com issue //mentioned above about not doing the 'script execute, //then fire the script load event listener before execute //next script' that other browsers do. //Best hope: IE10 fixes the issues, //and then destroys all installs of IE 6-9. //node.attachEvent('onerror', context.onScriptError); } else { node.addEventListener('load', context.onScriptLoad, false); node.addEventListener('error', context.onScriptError, false); } node.src = url; //For some cache cases in IE 6-8, the script executes before the end //of the appendChild execution, so to tie an anonymous define //call to the module name (which is stored on the node), hold on //to a reference to this node, but clear after the DOM insertion. currentlyAddingScript = node; if (baseElement) { head.insertBefore(node, baseElement); } else { head.appendChild(node); } currentlyAddingScript = null; return node; } else if (isWebWorker) { try { //In a web worker, use importScripts. This is not a very //efficient use of importScripts, importScripts will block until //its script is downloaded and evaluated. However, if web workers //are in play, the expectation that a build has been done so that //only one script needs to be loaded anyway. This may need to be //reevaluated if other use cases become common. importScripts(url); //Account for anonymous modules context.completeLoad(moduleName); } catch (e) { context.onError(makeError('importscripts', 'importScripts failed for ' + moduleName + ' at ' + url, e, [moduleName])); } } }; function getInteractiveScript() { if (interactiveScript && interactiveScript.readyState === 'interactive') { return interactiveScript; } eachReverse(scripts(), function (script) { if (script.readyState === 'interactive') { return (interactiveScript = script); } }); return interactiveScript; } //Look for a data-main script attribute, which could also adjust the baseUrl. if (isBrowser) { //Figure out baseUrl. Get it from the script tag with require.js in it. eachReverse(scripts(), function (script) { //Set the 'head' where we can append children by //using the script's parent. if (!head) { head = script.parentNode; } //Look for a data-main attribute to set main script for the page //to load. If it is there, the path to data main becomes the //baseUrl, if it is not already set. dataMain = script.getAttribute('data-main'); if (dataMain) { //Set final baseUrl if there is not already an explicit one. if (!cfg.baseUrl) { //Pull off the directory of data-main for use as the //baseUrl. src = dataMain.split('/'); mainScript = src.pop(); subPath = src.length ? src.join('/') + '/' : './'; cfg.baseUrl = subPath; dataMain = mainScript; } //Strip off any trailing .js since dataMain is now //like a module name. dataMain = dataMain.replace(jsSuffixRegExp, ''); //Put the data-main script in the files to load. cfg.deps = cfg.deps ? cfg.deps.concat(dataMain) : [dataMain]; return true; } }); } /** * The function that handles definitions of modules. Differs from * require() in that a string for the module should be the first argument, * and the function to execute after dependencies are loaded should * return a value to define the module corresponding to the first argument's * name. */ define = function (name, deps, callback) { var node, context; //Allow for anonymous modules if (typeof name !== 'string') { //Adjust args appropriately callback = deps; deps = name; name = null; } //This module may not have dependencies if (!isArray(deps)) { callback = deps; deps = []; } //If no name, and callback is a function, then figure out if it a //CommonJS thing with dependencies. if (!deps.length && isFunction(callback)) { //Remove comments from the callback string, //look for require calls, and pull them into the dependencies, //but only if there are function args. if (callback.length) { callback .toString() .replace(commentRegExp, '') .replace(cjsRequireRegExp, function (match, dep) { deps.push(dep); }); //May be a CommonJS thing even without require calls, but still //could use exports, and module. Avoid doing exports and module //work though if it just needs require. //REQUIRES the function to expect the CommonJS variables in the //order listed below. deps = (callback.length === 1 ? ['require'] : ['require', 'exports', 'module']).concat(deps); } } //If in IE 6-8 and hit an anonymous define() call, do the interactive //work. if (useInteractive) { node = currentlyAddingScript || getInteractiveScript(); if (node) { if (!name) { name = node.getAttribute('data-requiremodule'); } context = contexts[node.getAttribute('data-requirecontext')]; } } //Always save off evaluating the def call until the script onload handler. //This allows multiple modules to be in a file without prematurely //tracing dependencies, and allows for anonymous module support, //where the module name is not known until the script onload event //occurs. If no context, use the global queue, and get it processed //in the onscript load callback. (context ? context.defQueue : globalDefQueue).push([name, deps, callback]); }; define.amd = { jQuery: true }; /** * Executes the text. Normally just uses eval, but can be modified * to use a better, environment-specific call. Only used for transpiling * loader plugins, not for plain JS modules. * @param {String} text the text to execute/evaluate. */ req.exec = function (text) { /*jslint evil: true */ return eval(text); }; //Set up with config info. req(cfg); }(this));
# coding: utf-8 import warnings from .base import Model, ModelManager class SenderSignature(Model): def get(self): new_instance = self._manager.get(self.ID) self._data = new_instance._data return self def edit(self, **kwargs): response = self._manager.edit(self.ID, **kwargs) self._update(response) def delete(self): return self._manager.delete(self.ID) def resend(self): return self._manager.resend(self.ID) def verifyspf(self): return self._manager.verifyspf(self.ID) def requestnewdkim(self): return self._manager.requestnewdkim(self.ID) class SenderSignaturesManager(ModelManager): name = 'senders' model = SenderSignature token_type = 'account' def all(self, count=500, offset=0): """ Gets a list of sender signatures containing brief details associated with your account. """ responses = self.call_many('GET', '/senders/', count=count, offset=offset) return self.expand_responses(responses, 'SenderSignatures') def get(self, id): """ Gets all the details for a specific sender signature. """ response = self.call('GET', '/senders/%s' % id) return self._init_instance(response) def create(self, FromEmail, Name, ReplyToEmail=None, ReturnPathDomain=None): data = { 'FromEmail': FromEmail, 'Name': Name, 'ReplyToEmail': ReplyToEmail, 'ReturnPathDomain': ReturnPathDomain, } return self._init_instance(self.call('POST', '/senders/', data=data)) def edit(self, id, Name, ReplyToEmail=None, ReturnPathDomain=None): data = { 'Name': Name, 'ReplyToEmail': ReplyToEmail, 'ReturnPathDomain': ReturnPathDomain, } return self.call('PUT', '/senders/%s' % id, data=data) def delete(self, id): return self.call('DELETE', '/senders/%s' % id)['Message'] def resend(self, id): return self.call('POST', '/senders/%s/resend' % id)['Message'] def verifyspf(self, id): return self.call('POST', '/senders/%s/verifyspf' % id) def requestnewdkim(self, id): """ Will query DNS for your domain and attempt to verify the SPF record contains the information for Postmark's servers. """ warnings.warn( 'This method has been deprecated. ' 'Please use the new Domains API (http://developer.postmarkapp.com/developer-api-domains.html) ' 'for updated SPF methods.', DeprecationWarning ) return self.call('POST', '/senders/%s/requestnewdkim' % id)
/* Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or http://ckeditor.com/license */ CKEDITOR.plugins.setLang("uicolor","km",{title:"ប្រដាប់​រើស​ពណ៌",preview:"មើល​ជាមុន​ផ្ទាល់",config:"បិទ​ភ្ជាប់​ខ្សែ​អក្សរ​នេះ​ទៅ​ក្នុង​ឯកសារ config.js របស់​អ្នក",predefined:"ឈុត​ពណ៌​កំណត់​រួច​ស្រេច"});
'use strict' const mongoose = require('mongoose') const schema = mongoose.Schema({ _id: String, courseCode: { type: String, required: [true, 'Enter Course Code'], }, semesterList: [ { semester: String, idList: [Number], }, ], }) const CourseUsedRoundsHandler = mongoose.model('CourseUsedRoundsHandler', schema) module.exports = { CourseUsedRoundsHandler, schema, }
import datetime import os from itertools import chain, starmap def dict_compare(old_dict, new_dict, nested=None): """ Compare two dictionaries Only 1 level, ignoring attributes starting with '_' """ key_prefix = nested + '|' if nested else '' intersect_keys = old_dict.keys() & new_dict.keys() modified = {key_prefix + k: dict(old=old_dict[k], new=new_dict[k], action='mod') for k in intersect_keys if k[0] != '_' and old_dict[k] != new_dict[k] and not (isinstance(old_dict[k], dict) and isinstance(new_dict[k], dict))} nested_keys = [k for k in intersect_keys if k[0] != '_' and isinstance(old_dict[k], dict) and isinstance(new_dict[k], dict)] for k in nested_keys: x = dict_compare(old_dict[k], new_dict[k], key_prefix + k) if x: modified.update(x) added = new_dict.keys() - old_dict.keys() modified.update({key_prefix + k: dict(new=new_dict[k], action='add') for k in added if k[0] != '_'}) deleted = old_dict.keys() - new_dict.keys() modified.update({key_prefix + k: dict(old=old_dict[k], action='del') for k in deleted if k[0] != '_'}) if modified: return modified def running_in_gcf(): """ Determine if code is running in GCF using GCP_PROJECT """ return os.getenv('GCP_PROJECT') is not None def default_object(o): """ Default handler for json.dumps()""" if isinstance(o, (datetime.date, datetime.datetime)): return o.isoformat() raise TypeError("Type %s not serializable" % type(o)) # def buid_dict(composed_key, key_value): # def recursive_buid_dict(keys, value, nest_level=0): # if nest_level < len(keys): # return recursive_buid_dict(keys, value={keys[nest_level]: value}, nest_level=nest_level + 1) # elif nest_level == len(keys): # return value # # return recursive_buid_dict(keys=list(reversed(composed_key.split('.'))), value=key_value) # # from collections import ChainMap # # def merge_dicts(dict_a, dict_b): # new_dict = dict() # for key in ChainMap(dict_a, dict_b): # val_a , val_b = dict_a.get(key), dict_b.get(key) # if isinstance(val_a, dict) and isinstance(val_b, dict): # new_dict[key] = merge_dicts(val_a, val_b) # elif val_a is None and val_b is None: # continue # elif val_a is None: # new_dict[key] = val_b # elif val_b is None or val_a == val_b: # new_dict[key] = val_a # else: # new_dict[key] = [val_a, val_b] # return new_dict class Compare(object): def __init__(self, old_dictionary=None, new_dictionary=None, ignore_starting=None, ignore_ending=None): self.old_dict = old_dictionary self.new_dict = new_dictionary self.ignore_starting = ignore_starting self.ignore_ending = ignore_ending self.result = self.deepcompare(old_dict=old_dictionary, new_dict=new_dictionary, ignore_starting=self.ignore_starting, ignore_ending=self.ignore_starting) self.flatresult = self.flat() @staticmethod def intersect_lists(left_list, right_list): """Intersect two list and return difference as tuple (left, middle, right) USAGE: l, _, _ = intersect_list(left_list, right_list) return list of values in left list not matched with right list _, m, _ = intersect_list(left_list, right_list) return list of values in matched in left list and right list _, _, r = intersect_list(left_list, right_list) return list of values in right list not matched with left list l, m, r = intersect_list(left_list, right_list) return all three above mentioned results EXAMPLE: l, m, r = intersect_list([1, 2, 3], [2, 3, 4]) l = [1] m = [2, 3] r = [4] """ l = [value for value in left_list if value not in right_list] m = [value for value in left_list if value in right_list] r = [value for value in right_list if value not in left_list] return l, m, r @staticmethod def unnest(dictionary, separator='.'): """Flatten a nested dictionary structure EXAMPLE: test_unnest = {'a': {'b': {'c': {'d': ['e', 'f'], 'g': 5}}}} unnest(test_unnest) returns {'a.b.c.d': ['e', 'f'], 'a.b.c.g': 5} """ def unpack(parent_key, parent_value): """Unpack one level of nesting in a dictionary""" try: for key, value in parent_value.items(): yield (f'{parent_key}{separator}{key}', value) except AttributeError: # parent_value was not a dict, no need to flatten yield (f'{parent_key}', parent_value) if not isinstance(dictionary, dict): return dictionary while any(isinstance(value, dict) for value in dictionary.values()): # TODO secure breaking # Keep unpacking the dictionary until all value's are not dictionary's try: dictionary = dict(chain.from_iterable(starmap(unpack, dictionary.items()))) except AttributeError: break return dictionary @staticmethod def exclude_keys(set_of_keys, starting=None, ending=None): """Remove keys from set of keys starting and/or ending with string :param set_of_keys: a set of string keys to be iterated for ignoring keys :param starting: keys starting with string to be removed from a set of keys (default None) :param ending: keys ending with string to be removed from a set of keys (default None) """ try: clean_keys = set() for key in set_of_keys: if starting and ending and key.startswith(starting) and key.endswith(ending): continue elif starting and key.startswith(starting): continue elif ending and key.endswith(ending): continue else: clean_keys.add(key) return clean_keys except TypeError as te: raise te def listtodict(self, lst): """Convert list of dictionaries to dictionary of dictionaries using index of list converts list of objects to dictionary of objects :param lst: list or dictionary to be converted to dictionary of objects """ #NOTE: if object is not a dictionary it will be converted using default key as parent and index as child key if not isinstance(lst, (list, dict)): return lst try: result = {key: self.listtodict(value) for key, value in lst.items()} except AttributeError: result = {f'{index}': self.listtodict(value) for index, value in enumerate(lst)} return result def deepcompare(self, old_dict, new_dict, ignore_starting=None, ignore_ending=None): """Compare nested dictionaries, including lists recursively :param old_dict: the dictionary to be compared with :param new_dict: the dictionary to compare :param ignore_starting: keys to be ignored starting with string (default None) :param ignore_ending: keys to be ignored ending with string (default None) :param unnested_result: boolean if return unnest(normalized) result :param separator: if unnested_result separator used to normalize keys """ if old_dict == new_dict: return result = {} try: old = self.exclude_keys(old_dict.keys(), ignore_starting, ignore_ending) new = self.exclude_keys(new_dict.keys(), ignore_starting, ignore_ending) overlapping_keys = old & new old_keys = old - new new_keys = new - old if old_keys: for key in old_keys: result.update({key: {'action': 'del', 'old': old_dict[key]}}) if new_keys: for key in new_keys: result.update({key: {'action': 'add', 'new': new_dict[key]}}) for key in overlapping_keys: if isinstance(old_dict[key], list) and isinstance(new_dict[key], list): old_d = self.listtodict(old_dict[key]) new_d = self.listtodict(new_dict[key]) value = self.deepcompare(old_d, new_d) if value is None: continue else: value = self.deepcompare(old_dict[key], new_dict[key]) if value is None: continue if all(f'{index}' == key for index, key in enumerate(sorted(value.keys()))): value = [v for _, v in value.items()] result.update({key: value}) except AttributeError: if old_dict != new_dict: result = {'action': 'mod', 'old': old_dict, 'new': new_dict} finally: if result: return result def flat(self, dictionary=None, separator='.', unpack_lists=False): if unpack_lists == True: return self.unnest(self.listtodict(dictionary or self.result), separator=separator) else: return self.unnest(dictionary or self.result, separator=separator)
export const MONTHS = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ]; export const HEADER_DAY_NAMES = ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'] export const FINAL_MONTH_INDEX = 11; export const INITIAL_MONTH_INDEX = 0; export const YEAR_PERIOD = 12; export const DAY_VIEW = "Day"; export const MONTH_VIEW = "Month"; export const YEAR_VIEW = "Year"; export const getNumberOfDaysInMonth = (year, month) => { return new Date(year, month + 1, 0).getDate(); }; export const getDaysOfMonth = (month, year) => { let monthDays = []; const numberOfDays = getNumberOfDaysInMonth(year, month); let week = ['', '', '', '', '', '', '']; for (let j = 1; j <= numberOfDays; j++) { let tempDate = new Date(); tempDate.setFullYear(year); tempDate.setDate(j); tempDate.setMonth(month); let dayIndex = tempDate.getDay(); if (dayIndex === 0 && j !== 1 && j !== numberOfDays) { monthDays.push(week); week = ['', '', '', '', '', '', '']; week[dayIndex] = j; } else if (dayIndex === 0 && j === 1) { week[dayIndex] = j; } else if (dayIndex !== 0 && j !== numberOfDays) { week[dayIndex] = j; } else if (j === numberOfDays) { if (dayIndex !== 0) { week[dayIndex] = j; monthDays.push(week); } else if (dayIndex === 0) { monthDays.push(week); week = ['', '', '', '', '', '', '']; week[dayIndex] = j; monthDays.push(week); } } } return monthDays; }; export const getYears = (startYear, endYear) => { const YEARS = []; let count = 0; let yearRow = []; for (let i = startYear; i <= endYear; i++) { yearRow.push(i); count++; if (count % 3 === 0) { count = 0; YEARS.push(yearRow); yearRow = []; } } return YEARS; }
const {createFilePath} = require("gatsby-source-filesystem"); exports.onCreateNode = ({ node , getNode, actions }) => { const {createNodeField} = actions; if (node.internal.type === "MarkdownRemark"){ const slug = createFilePath({node, getNode, basePath: "posts"}) createNodeField({ node, name: "slug", value: slug }) } } exports.createPages = ({graphql, actions}) => { return qraphql(`{ allMarkdownRemark{ nodes{ fields{ slug } } } } `).then }
// |!| Consider older versions var dummyAdd = function(paramA, paramB){ return paramA + paramB; } var dummyMulitply = function(paramA, paramB){ return paramA + paramB; } // |!| This is the last line
var express = require('express'), app = express(), bodyParser = require('body-parser'), mongoose = require('mongoose'), meetupsController = require('./server/controllers/meetups-controller'); mongoose.connect('mongodb://localhost:27017/mean-demo'); app.use(bodyParser()); app.get('/', function (req, res) { res.sendFile(__dirname + '/client/views/index.html') }) app.use('/js', express.static(__dirname + '/client/js')); // REST API app.get('/api/meetups', meetupsController.list ); app.post('/api/meetups', meetupsController.create ); var server = app.listen(3000, function () { console.log('Example app listening...') })
(function () { "use strict"; Date.Parsing = { Exception: function (s) { this.message = "Parse error at '" + s.substring(0, 10) + " ...'"; } }; var $P = Date.Parsing; var dayOffsets = { standard: [0,31,59,90,120,151,181,212,243,273,304,334], leap: [0,31,60,91,121,152,182,213,244,274,305,335] }; $P.isLeapYear = function(year) { return ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0); }; var utils = { multiReplace : function (str, hash ) { var key; for (key in hash) { if (Object.prototype.hasOwnProperty.call(hash, key)) { var regex; if (typeof hash[key] === "function") { } else { regex = (hash[key] instanceof RegExp) ? hash[key] : new RegExp(hash[key], "g"); } str = str.replace(regex, key); } } return str; }, getDayOfYearFromWeek : function (obj) { var d, jan4, offset; obj.weekDay = (!obj.weekDay && obj.weekDay !== 0) ? 1 : obj.weekDay; d = new Date(obj.year, 0, 4); jan4 = d.getDay() === 0 ? 7 : d.getDay(); // JS is 0 indexed on Sunday. offset = jan4+3; obj.dayOfYear = ((obj.week * 7) + (obj.weekDay === 0 ? 7 : obj.weekDay))-offset; return obj; }, getDayOfYear : function (obj, dayOffset) { if (!obj.dayOfYear) { obj = utils.getDayOfYearFromWeek(obj); } for (var i=0;i <= dayOffset.length;i++) { if (obj.dayOfYear < dayOffset[i] || i === dayOffset.length) { obj.day = obj.day ? obj.day : (obj.dayOfYear - dayOffset[i-1]); break; } else { obj.month = i; } } return obj; }, adjustForTimeZone : function (obj, date) { var offset; if (obj.zone.toUpperCase() === "Z" || (obj.zone_hours === 0 && obj.zone_minutes === 0)) { // it's UTC/GML so work out the current timeszone offset offset = -date.getTimezoneOffset(); } else { offset = (obj.zone_hours*60) + (obj.zone_minutes || 0); if (obj.zone_sign === "+") { offset *= -1; } offset -= date.getTimezoneOffset(); } date.setMinutes(date.getMinutes()+offset); return date; }, setDefaults : function (obj) { obj.year = obj.year || Date.today().getFullYear(); obj.hours = obj.hours || 0; obj.minutes = obj.minutes || 0; obj.seconds = obj.seconds || 0; obj.milliseconds = obj.milliseconds || 0; if (!(!obj.month && (obj.week || obj.dayOfYear))) { // if we have a month, or if we don't but don't have the day calculation data obj.month = obj.month || 0; obj.day = obj.day || 1; } return obj; }, dataNum: function (data, mod, explict, postProcess) { var dataNum = data*1; if (mod) { if (postProcess) { return data ? mod(data)*1 : data; } else { return data ? mod(dataNum) : data; } } else if (!explict){ return data ? dataNum : data; } else { return (data && typeof data !== "undefined") ? dataNum : data; } }, timeDataProcess: function (obj) { var timeObj = {}; for (var x in obj.data) { if (obj.data.hasOwnProperty(x)) { timeObj[x] = obj.ignore[x] ? obj.data[x] : utils.dataNum(obj.data[x], obj.mods[x], obj.explict[x], obj.postProcess[x]); } } if (obj.data.secmins) { obj.data.secmins = obj.data.secmins.replace(",", ".") * 60; if (!timeObj.minutes) { timeObj.minutes = obj.data.secmins; } else if (!timeObj.seconds) { timeObj.seconds = obj.data.secmins; } delete obj.secmins; } return timeObj; }, buildTimeObjectFromData: function (data) { var time = utils.timeDataProcess({ data: { year : data[1], month : data[5], day : data[7], week : data[8], dayOfYear : data[10], hours : data[15], zone_hours : data[23], zone_minutes : data[24], zone : data[21], zone_sign : data[22], weekDay : data[9], minutes: data[16], seconds: data[19], milliseconds: data[20], secmins: data[18] }, mods: { month: function(data) { return data-1; }, weekDay: function (data) { data = Math.abs(data); return (data === 7 ? 0 : data); }, minutes: function (data) { return data.replace(":",""); }, seconds: function (data) { return Math.floor( (data.replace(":","").replace(",","."))*1 ); }, milliseconds: function (data) { return (data.replace(",",".")*1000); } }, postProcess: { minutes: true, seconds: true, milliseconds: true }, explict: { zone_hours: true, zone_minutes: true }, ignore: { zone: true, zone_sign: true, secmins: true } }); return time; }, addToHash: function (hash, keys, data) { keys = keys; data = data; var len = keys.length; for (var i = 0; i < len; i++) { hash[keys[i]] = data[i]; } return hash; }, combineRegex: function (r1, r2) { return new RegExp("(("+r1.source+")\\s("+r2.source+"))"); }, getDateNthString: function(add, last, inc){ if (add) { return Date.today().addDays(inc).toString("d"); } else if (last) { return Date.today().last()[inc]().toString("d"); } }, buildRegexData: function (array) { var arr = []; var len = array.length; for (var i=0; i < len; i++) { if (Array.isArray(array[i])) { arr.push(this.combineRegex(array[i][0], array[i][1])); } else { arr.push(array[i]); } } return arr; } }; $P.processTimeObject = function (obj) { var date, dayOffset; utils.setDefaults(obj); dayOffset = ($P.isLeapYear(obj.year)) ? dayOffsets.leap : dayOffsets.standard; if (!obj.month && (obj.week || obj.dayOfYear)) { utils.getDayOfYear(obj, dayOffset); } else { obj.dayOfYear = dayOffset[obj.month] + obj.day; } date = new Date(obj.year, obj.month, obj.day, obj.hours, obj.minutes, obj.seconds, obj.milliseconds); if (obj.zone) { utils.adjustForTimeZone(obj, date); // adjust (and calculate) for timezone } return date; }; $P.ISO = { regex : /^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-4])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?\s?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/, parse : function (s) { var time, data = s.match(this.regex); if (!data || !data.length) { return null; } time = utils.buildTimeObjectFromData(data); if (!time.year || (!time.year && (!time.month && !time.day) && (!time.week && !time.dayOfYear)) ) { return null; } return $P.processTimeObject(time); } }; $P.Numeric = { isNumeric: function (e){return!isNaN(parseFloat(e))&&isFinite(e);}, regex: /\b([0-1]?[0-9])([0-3]?[0-9])([0-2]?[0-9]?[0-9][0-9])\b/i, parse: function (s) { var data, i, time = {}, order = Date.CultureInfo.dateElementOrder.split(""); if (!(this.isNumeric(s)) || // if it's non-numeric OR (s[0] === "+" && s[0] === "-")) { // It's an arithmatic string (eg +/-1000) return null; } if (s.length < 5) { // assume it's just a year. time.year = s; return $P.processTimeObject(time); } data = s.match(this.regex); if (!data || !data.length) { return null; } for (i=0; i < order.length; i++) { switch(order[i]) { case "d": time.day = data[i+1]; break; case "m": time.month = (data[i+1]-1); break; case "y": time.year = data[i+1]; break; } } return $P.processTimeObject(time); } }; $P.Normalizer = { regexData: function () { var $R = Date.CultureInfo.regexPatterns; return utils.buildRegexData([ $R.tomorrow, $R.yesterday, [$R.past, $R.mon], [$R.past, $R.tue], [$R.past, $R.wed], [$R.past, $R.thu], [$R.past, $R.fri], [$R.past, $R.sat], [$R.past, $R.sun] ]); }, basicReplaceHash : function() { var $R = Date.CultureInfo.regexPatterns; return { "January": $R.jan.source, "February": $R.feb, "March": $R.mar, "April": $R.apr, "May": $R.may, "June": $R.jun, "July": $R.jul, "August": $R.aug, "September": $R.sep, "October": $R.oct, "November": $R.nov, "December": $R.dec, "": /\bat\b/gi, " ": /\s{2,}/, "am": $R.inTheMorning, "9am": $R.thisMorning, "pm": $R.inTheEvening, "7pm":$R.thisEvening }; }, keys : function(){ return [ utils.getDateNthString(true, false, 1), // tomorrow utils.getDateNthString(true, false, -1), // yesterday utils.getDateNthString(false, true, "monday"), //last mon utils.getDateNthString(false, true, "tuesday"), //last tues utils.getDateNthString(false, true, "wednesday"), //last wed utils.getDateNthString(false, true, "thursday"), //last thurs utils.getDateNthString(false, true, "friday"), //last fri utils.getDateNthString(false, true, "saturday"), //last sat utils.getDateNthString(false, true, "sunday") //last sun ]; }, buildRegexFunctions: function () { var $R = Date.CultureInfo.regexPatterns; var __ = Date.i18n.__; var regexStr = new RegExp("(\\b\\d\\d?("+__("AM")+"|"+__("PM")+")? )("+$R.tomorrow.source.slice(1)+")", "i"); this.replaceFuncs = [ [regexStr, function(full, m1) { var t = Date.today().addDays(1).toString("d"); return (t + " " + m1); }], [$R.amThisMorning, function(str, am){return am;}], [$R.pmThisEvening, function(str, pm){return pm;}] ]; }, buildReplaceData: function () { this.buildRegexFunctions(); this.replaceHash = utils.addToHash(this.basicReplaceHash(), this.keys(), this.regexData()); }, stringReplaceFuncs: function (s) { for (var i=0; i < this.replaceFuncs.length; i++) { s = s.replace(this.replaceFuncs[i][0], this.replaceFuncs[i][1]); } return s; }, parse: function (s) { s = this.stringReplaceFuncs(s); s = utils.multiReplace(s, this.replaceHash); try { var n = s.split(/([\s\-\.\,\/\x27]+)/); if (n.length === 3 && $P.Numeric.isNumeric(n[0]) && $P.Numeric.isNumeric(n[2]) && (n[2].length >= 4)) { // ok, so we're dealing with x/year. But that's not a full date. // This fixes wonky dateElementOrder parsing when set to dmy order. if (Date.CultureInfo.dateElementOrder[0] === "d") { s = "1/" + n[0] + "/" + n[2]; // set to 1st of month and normalize the seperator } } } catch (e) {} return s; } }; $P.Normalizer.buildReplaceData(); }());
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Input flags.""" import tensorflow.compat.v1 as tf flags = tf.app.flags FLAGS = flags.FLAGS # Input parameters flags.DEFINE_integer("img_size", 28, "Image size in pixels.") flags.DEFINE_integer("num_classes", 10, "Number of classes.") # Model parameters flags.DEFINE_integer("attention_dim", 16, "Attention dimension.") flags.DEFINE_integer("val_dim", 64, "Value dimension.") flags.DEFINE_integer("final_units", 256, "Final units.") flags.DEFINE_string("normalization", "sparsemax", "normalization.") flags.DEFINE_float("epsilon_sparsity", 0.000001, "Epsilon.") flags.DEFINE_float("sparsity_weight", 0.0001, "Sparsity weight.") flags.DEFINE_float("alpha_intermediate", 0.5, "Coefficient for intermediate loss term.") # Training parameters flags.DEFINE_integer("random_seed", 1, "Random seed.") flags.DEFINE_integer("num_steps", 400000, "Number of training steps.") flags.DEFINE_integer("display_step", 1000, "Display step.") flags.DEFINE_integer("val_step", 4000, "Validation step.") flags.DEFINE_integer("save_step", 15000, "Save step.") flags.DEFINE_float("init_learning_rate", 0.001, "Initial learning rate.") flags.DEFINE_integer("decay_every", 8000, "Decay interval.") flags.DEFINE_float("decay_rate", 0.9, "Decay rate.") flags.DEFINE_integer("gradient_thresh", 20, "Gradient clipping threshold.") flags.DEFINE_integer("batch_size", 128, "Batch size.") flags.DEFINE_integer("example_cand_size", 1024, "Training candidate database size.") flags.DEFINE_integer("eval_cand_size", 32768, "Validation candidate database size.")
/** * @license Apache-2.0 * * Copyright (c) 2020 The Stdlib Authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ 'use strict'; // MODULES // var bench = require( '@stdlib/bench' ); var randu = require( '@stdlib/random-base-randu' ); var isnanf = require( '@stdlib/math-base-assert-is-nanf' ); var pow = require( '@stdlib/math-base-special-pow' ); var Float32Array = require( '@stdlib/array-float32' ); var pkg = require( './../package.json' ).name; var scuminabs = require( './../lib/scuminabs.js' ); // FUNCTIONS // /** * Creates a benchmark function. * * @private * @param {PositiveInteger} len - array length * @returns {Function} benchmark function */ function createBenchmark( len ) { var y; var x; var i; x = new Float32Array( len ); y = new Float32Array( len ); for ( i = 0; i < x.length; i++ ) { x[ i ] = ( randu()*20.0 ) - 10.0; } return benchmark; function benchmark( b ) { var v; var i; for ( i = 0; i < len; i++ ) { y[ i ] = 0.0; } b.tic(); for ( i = 0; i < b.iterations; i++ ) { x[ 0 ] += 1.0; v = scuminabs( x.length, x, 1, y, 1 ); if ( isnanf( v[ i%len ] ) ) { b.fail( 'should not return NaN' ); } } b.toc(); if ( isnanf( v[ i%len ] ) ) { b.fail( 'should not return NaN' ); } b.pass( 'benchmark finished' ); b.end(); } } // MAIN // /** * Main execution sequence. * * @private */ function main() { var len; var min; var max; var f; var i; min = 1; // 10^min max = 6; // 10^max for ( i = min; i <= max; i++ ) { len = pow( 10, i ); f = createBenchmark( len ); bench( pkg+':len='+len, f ); } } main();
# Autoreloading launcher. # Borrowed from Peter Hunt and the CherryPy project (http://www.cherrypy.org). # Some taken from Ian Bicking's Paste (http://pythonpaste.org/). # # Portions copyright (c) 2004, CherryPy Team ([email protected]) # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # * Neither the name of the CherryPy Team nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. import os import signal import subprocess import sys import time import traceback from django.apps import apps from django.conf import settings from django.core.signals import request_finished from django.utils import six from django.utils._os import npath from django.utils.encoding import force_bytes, get_system_encoding from django.utils.six.moves import _thread as thread # This import does nothing, but it's necessary to avoid some race conditions # in the threading module. See http://code.djangoproject.com/ticket/2330 . try: import threading # NOQA except ImportError: pass try: import termios except ImportError: termios = None USE_INOTIFY = False try: # Test whether inotify is enabled and likely to work import pyinotify fd = pyinotify.INotifyWrapper.create().inotify_init() if fd >= 0: USE_INOTIFY = True os.close(fd) except ImportError: pass RUN_RELOADER = True FILE_MODIFIED = 1 I18N_MODIFIED = 2 _mtimes = {} _win = (sys.platform == "win32") _exception = None _error_files = [] _cached_modules = set() _cached_filenames = [] def gen_filenames(only_new=False): """ Returns a list of filenames referenced in sys.modules and translation files. """ # N.B. ``list(...)`` is needed, because this runs in parallel with # application code which might be mutating ``sys.modules``, and this will # fail with RuntimeError: cannot mutate dictionary while iterating global _cached_modules, _cached_filenames module_values = set(sys.modules.values()) _cached_filenames = clean_files(_cached_filenames) if _cached_modules == module_values: # No changes in module list, short-circuit the function if only_new: return [] else: return _cached_filenames + clean_files(_error_files) new_modules = module_values - _cached_modules new_filenames = clean_files( [filename.__file__ for filename in new_modules if hasattr(filename, '__file__')]) if not _cached_filenames and settings.USE_I18N: # Add the names of the .mo files that can be generated # by compilemessages management command to the list of files watched. basedirs = [os.path.join(os.path.dirname(os.path.dirname(__file__)), 'conf', 'locale'), 'locale'] for app_config in reversed(list(apps.get_app_configs())): basedirs.append(os.path.join(npath(app_config.path), 'locale')) basedirs.extend(settings.LOCALE_PATHS) basedirs = [os.path.abspath(basedir) for basedir in basedirs if os.path.isdir(basedir)] for basedir in basedirs: for dirpath, dirnames, locale_filenames in os.walk(basedir): for filename in locale_filenames: if filename.endswith('.mo'): new_filenames.append(os.path.join(dirpath, filename)) _cached_modules = _cached_modules.union(new_modules) _cached_filenames += new_filenames if only_new: return new_filenames + clean_files(_error_files) else: return _cached_filenames + clean_files(_error_files) def clean_files(filelist): filenames = [] for filename in filelist: if not filename: continue if filename.endswith(".pyc") or filename.endswith(".pyo"): filename = filename[:-1] if filename.endswith("$py.class"): filename = filename[:-9] + ".py" if os.path.exists(filename): filenames.append(filename) return filenames def reset_translations(): import gettext from django.utils.translation import trans_real gettext._translations = {} trans_real._translations = {} trans_real._default = None trans_real._active = threading.local() def inotify_code_changed(): """ Checks for changed code using inotify. After being called it blocks until a change event has been fired. """ class EventHandler(pyinotify.ProcessEvent): modified_code = None def process_default(self, event): if event.path.endswith('.mo'): EventHandler.modified_code = I18N_MODIFIED else: EventHandler.modified_code = FILE_MODIFIED wm = pyinotify.WatchManager() notifier = pyinotify.Notifier(wm, EventHandler()) def update_watch(sender=None, **kwargs): if sender and getattr(sender, 'handles_files', False): # No need to update watches when request serves files. # (sender is supposed to be a django.core.handlers.BaseHandler subclass) return mask = ( pyinotify.IN_MODIFY | pyinotify.IN_DELETE | pyinotify.IN_ATTRIB | pyinotify.IN_MOVED_FROM | pyinotify.IN_MOVED_TO | pyinotify.IN_CREATE | pyinotify.IN_DELETE_SELF | pyinotify.IN_MOVE_SELF ) for path in gen_filenames(only_new=True): wm.add_watch(path, mask) # New modules may get imported when a request is processed. request_finished.connect(update_watch) # Block until an event happens. update_watch() notifier.check_events(timeout=None) notifier.read_events() notifier.process_events() notifier.stop() # If we are here the code must have changed. return EventHandler.modified_code def code_changed(): global _mtimes, _win for filename in gen_filenames(): stat = os.stat(filename) mtime = stat.st_mtime if _win: mtime -= stat.st_ctime if filename not in _mtimes: _mtimes[filename] = mtime continue if mtime != _mtimes[filename]: _mtimes = {} try: del _error_files[_error_files.index(filename)] except ValueError: pass return I18N_MODIFIED if filename.endswith('.mo') else FILE_MODIFIED return False def check_errors(fn): def wrapper(*args, **kwargs): global _exception try: fn(*args, **kwargs) except Exception: _exception = sys.exc_info() et, ev, tb = _exception if getattr(ev, 'filename', None) is None: # get the filename from the last item in the stack filename = traceback.extract_tb(tb)[-1][0] else: filename = ev.filename if filename not in _error_files: _error_files.append(filename) raise return wrapper def raise_last_exception(): global _exception if _exception is not None: six.reraise(*_exception) def ensure_echo_on(): if termios: fd = sys.stdin if fd.isatty(): attr_list = termios.tcgetattr(fd) if not attr_list[3] & termios.ECHO: attr_list[3] |= termios.ECHO if hasattr(signal, 'SIGTTOU'): old_handler = signal.signal(signal.SIGTTOU, signal.SIG_IGN) else: old_handler = None termios.tcsetattr(fd, termios.TCSANOW, attr_list) if old_handler is not None: signal.signal(signal.SIGTTOU, old_handler) def reloader_thread(): ensure_echo_on() if USE_INOTIFY: fn = inotify_code_changed else: fn = code_changed while RUN_RELOADER: change = fn() if change == FILE_MODIFIED: sys.exit(3) # force reload elif change == I18N_MODIFIED: reset_translations() time.sleep(1) def restart_with_reloader(): while True: args = [sys.executable] + ['-W%s' % o for o in sys.warnoptions] + sys.argv new_environ = os.environ.copy() if _win and six.PY2: # Environment variables on Python 2 + Windows must be str. encoding = get_system_encoding() for key in new_environ.keys(): str_key = force_bytes(key, encoding=encoding) str_value = force_bytes(new_environ[key], encoding=encoding) del new_environ[key] new_environ[str_key] = str_value new_environ["RUN_MAIN"] = 'true' exit_code = subprocess.call(args, env=new_environ) if exit_code != 3: return exit_code def python_reloader(main_func, args, kwargs): if os.environ.get("RUN_MAIN") == "true": thread.start_new_thread(main_func, args, kwargs) try: reloader_thread() except KeyboardInterrupt: pass else: try: exit_code = restart_with_reloader() if exit_code < 0: os.kill(os.getpid(), -exit_code) else: sys.exit(exit_code) except KeyboardInterrupt: pass def jython_reloader(main_func, args, kwargs): from _systemrestart import SystemRestart thread.start_new_thread(main_func, args) while True: if code_changed(): raise SystemRestart time.sleep(1) def main(main_func, args=None, kwargs=None): if args is None: args = () if kwargs is None: kwargs = {} if sys.platform.startswith('java'): reloader = jython_reloader else: reloader = python_reloader wrapped_main_func = check_errors(main_func) reloader(wrapped_main_func, args, kwargs)
# Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import inspect import multiprocessing import os from abc import ABC from copy import deepcopy from functools import partial from typing import Any, Callable, Dict, List, Optional, Tuple, Union from torch.utils.data import BatchSampler, DataLoader, RandomSampler, SequentialSampler from torch.utils.data.distributed import DistributedSampler import pytorch_lightning as pl from pytorch_lightning.accelerators import Accelerator from pytorch_lightning.overrides.distributed import IndexBatchSamplerWrapper, UnrepeatedDistributedSampler from pytorch_lightning.trainer.connectors.accelerator_connector import AcceleratorConnector from pytorch_lightning.trainer.states import RunningStage from pytorch_lightning.trainer.supporters import CombinedLoader from pytorch_lightning.utilities import rank_zero_warn from pytorch_lightning.utilities.apply_func import apply_to_collection from pytorch_lightning.utilities.auto_restart import _sampler_metadata_collate from pytorch_lightning.utilities.data import has_iterable_dataset, has_len from pytorch_lightning.utilities.debugging import InternalDebugger from pytorch_lightning.utilities.exceptions import MisconfigurationException from pytorch_lightning.utilities.imports import _fault_tolerant_enabled from pytorch_lightning.utilities.model_helpers import is_overridden from pytorch_lightning.utilities.seed import pl_worker_init_function class TrainerDataLoadingMixin(ABC): # this is just a summary on variables used in this abstract class, # the proper values/initialisation should be done in child class val_check_interval: float tpu_local_core_rank: int train_dataloader: DataLoader num_training_batches: Union[int, float] val_check_batch: float val_dataloaders: Optional[List[DataLoader]] num_val_batches: List[Union[int, float]] test_dataloaders: Optional[List[DataLoader]] num_test_batches: List[Union[int, float]] limit_train_batches: Union[int, float] log_every_n_steps: int overfit_batches: Union[int, float] distributed_sampler_kwargs: dict accelerator: Accelerator accelerator_connector: AcceleratorConnector dev_debugger: InternalDebugger call_hook: Callable def _worker_check(self, dataloader: DataLoader, name: str) -> None: if not isinstance(dataloader, DataLoader): return using_spawn = self.accelerator_connector.distributed_backend == "ddp_spawn" num_cpus = multiprocessing.cpu_count() # ddp_spawn + num_workers > 0 don't mix! tell the user if dataloader.num_workers > 0 and using_spawn: # checks for the attr persistent_workers available in pytorch >= 1.7 if hasattr(dataloader, "persistent_workers"): if not dataloader.persistent_workers: rank_zero_warn( "num_workers>0, persistent_workers=False, and accelerator=ddp_spawn" " may result in data loading bottlenecks." " Consider setting persistent_workers=True" " (this is a limitation of Python .spawn() and PyTorch)" ) else: rank_zero_warn( "num_workers>0 and accelerator=ddp_spawn do not mix well" " and may result in data loading bottlenecks." " Consider setting accelerator=ddp to use num_workers>0" " (this is a limitation of Python .spawn() and PyTorch)" ) elif dataloader.num_workers == 0 and using_spawn: # checks for the attr persistent_workers available in pytorch >= 1.7 if hasattr(dataloader, "persistent_workers"): if not dataloader.persistent_workers: rank_zero_warn( "accelerator=ddp_spawn and num_workers=0 may result in data loading bottlenecks." " Consider setting num_workers>0 and persistent_workers=True" ) else: rank_zero_warn( "accelerator=ddp_spawn and num_workers=0 may result in data loading bottlenecks." " Consider setting accelerator=ddp and set num_workers>0" ) elif dataloader.num_workers <= 2 < num_cpus and not using_spawn: rank_zero_warn( f"The dataloader, {name}, does not have many workers which may be a bottleneck." " Consider increasing the value of the `num_workers` argument`" f" (try {num_cpus} which is the number of cpus on this machine)" f" in the `DataLoader` init to improve performance." ) def auto_add_worker_init_fn(self, dataloader: DataLoader) -> None: if int(os.environ.get("PL_SEED_WORKERS", 0)) and dataloader.worker_init_fn is None: dataloader.worker_init_fn = partial(pl_worker_init_function, rank=self.global_rank) def auto_add_sampler(self, dataloader: Any, shuffle: bool, mode: Optional[RunningStage] = None) -> Any: # don't do anything if it's not a dataloader is_dataloader = isinstance(dataloader, DataLoader) # don't manipulate iterable datasets is_iterable_ds = has_iterable_dataset(dataloader) if isinstance(dataloader, CombinedLoader): dataloader.loaders = apply_to_collection(dataloader.loaders, DataLoader, self.auto_add_sampler, shuffle) return dataloader if not is_dataloader or is_iterable_ds: return dataloader need_dist_sampler = self.accelerator_connector.is_distributed and not isinstance( dataloader.sampler, DistributedSampler ) if self.accelerator_connector.replace_sampler_ddp and need_dist_sampler: if not isinstance(dataloader.sampler, (SequentialSampler, RandomSampler)): raise MisconfigurationException( "You seem to have configured a sampler in your DataLoader. This will be replaced " " by `DistributedSampler` since `replace_sampler_ddp` is True and you are using" " distributed training. Either remove the sampler from your DataLoader or set" " `replace_sampler_ddp`=False if you want to use your custom sampler." ) # replace with distributed sampler sampler = self._get_distributed_sampler(dataloader, shuffle, mode=mode) dataloader = self.replace_sampler(dataloader, sampler, mode=mode) return dataloader @staticmethod def _resolve_batch_sampler(dataloader, sampler, mode: Optional[RunningStage] = None) -> Dict[str, Any]: batch_sampler = getattr(dataloader, "batch_sampler") is_predicting = mode == RunningStage.PREDICTING # checking the batch sampler type is different than PyTorch default. if (batch_sampler is not None and type(batch_sampler) is not BatchSampler) or is_predicting: batch_sampler = type(batch_sampler)( sampler, batch_size=batch_sampler.batch_size, drop_last=(False if is_predicting else batch_sampler.drop_last), ) if is_predicting: batch_sampler = IndexBatchSamplerWrapper(batch_sampler) return { "sampler": None, "shuffle": False, "batch_sampler": batch_sampler, "batch_size": 1, "drop_last": False, } return {"sampler": sampler, "shuffle": False, "batch_sampler": None} def replace_sampler(self, dataloader: DataLoader, sampler, mode: Optional[RunningStage] = None) -> DataLoader: if not isinstance(dataloader, DataLoader): raise ValueError(f"The dataloader {dataloader} needs to subclass `torch.utils.data.DataLoader`") # get the dataloader instance attributes attrs = {k: v for k, v in vars(dataloader).items() if not k.startswith("_")} # not part of `vars` attrs["multiprocessing_context"] = dataloader.multiprocessing_context # get the dataloader instance `__init__` parameters params = dict(inspect.signature(dataloader.__init__).parameters) # keep only the params whose default is different to the current attr value non_defaults = {name for name, p in params.items() if name in attrs and p.default != attrs[name]} # add `dataset` as it might have been replaced with `*args` non_defaults.add("dataset") # kwargs to re-construct the dataloader dl_kwargs = {k: v for k, v in attrs.items() if k in non_defaults} dl_kwargs.update(self._resolve_batch_sampler(dataloader, sampler, mode=mode)) required_args = { p.name for p in params.values() if p.kind in (p.POSITIONAL_ONLY, p.POSITIONAL_OR_KEYWORD) and p.default is p.empty and p.name not in dl_kwargs } # the dataloader has required args which we could not extract from the existing attributes if required_args: required_args = sorted(required_args) dataloader_cls_name = dataloader.__class__.__name__ raise MisconfigurationException( f"Trying to inject `DistributedSampler` into the `{dataloader_cls_name}` instance. " "This would fail as some of the `__init__` arguments are not available as instance attributes. " f"The missing attributes are {required_args}. " f"HINT: If you wrote the `{dataloader_cls_name}` class, define `self.missing_arg_name` or " "manually add the `DistributedSampler` as: " f"`{dataloader_cls_name}(dataset, sampler=DistributedSampler(dataset))`." ) has_variadic_kwargs = any(p.kind is p.VAR_KEYWORD for p in params.values()) if not has_variadic_kwargs: # the dataloader signature does not allow keyword arguments that need to be passed missing_kwargs = dl_kwargs.keys() - params.keys() if missing_kwargs: missing_kwargs = sorted(missing_kwargs) dataloader_cls_name = dataloader.__class__.__name__ raise MisconfigurationException( f"Trying to inject `DistributedSampler` into the `{dataloader_cls_name}` instance. " "This would fail as it doesn't expose all its attributes in the `__init__` signature. " f"The missing arguments are {missing_kwargs}. " f"HINT: If you wrote the `{dataloader_cls_name}` class, add the `__init__` arguments or " "manually add the `DistributedSampler` as: " f"`{dataloader_cls_name}(dataset, sampler=DistributedSampler(dataset))`." ) dl_cls = type(dataloader) dataloader = dl_cls(**dl_kwargs) return dataloader def _get_distributed_sampler( self, dataloader: DataLoader, shuffle: bool, mode: Optional[RunningStage] = None ) -> DistributedSampler: kwargs = self.distributed_sampler_kwargs kwargs["shuffle"] = shuffle and not self.overfit_batches kwargs.setdefault("seed", int(os.getenv("PL_GLOBAL_SEED", 0))) cls = UnrepeatedDistributedSampler if mode == RunningStage.PREDICTING else DistributedSampler sampler = cls(dataloader.dataset, **kwargs) return sampler def reset_train_dataloader(self, model: "pl.LightningModule") -> None: """Resets the train dataloader and initialises required variables (number of batches, when to validate, etc.). Args: model: The current `LightningModule` """ self.train_dataloader = self.request_dataloader(model, "train") if self.overfit_batches > 0: if hasattr(self.train_dataloader, "sampler") and isinstance(self.train_dataloader.sampler, RandomSampler): rank_zero_warn( "You requested to overfit but enabled training dataloader shuffling." " We are turning off the training dataloader shuffling for you." ) self.train_dataloader = self.replace_sampler( self.train_dataloader, SequentialSampler(self.train_dataloader.dataset) ) # debugging self.dev_debugger.track_load_dataloader_call("train_dataloader", dataloaders=[self.train_dataloader]) # automatically add samplers self.train_dataloader = apply_to_collection( self.train_dataloader, DataLoader, self.auto_add_sampler, shuffle=True ) # check the workers recursively apply_to_collection(self.train_dataloader, DataLoader, self._worker_check, "train dataloader") # add worker_init_fn for correct seeding in worker processes apply_to_collection(self.train_dataloader, DataLoader, self.auto_add_worker_init_fn) # add collate_fn to collect metadata for fault tolerant training if _fault_tolerant_enabled(): apply_to_collection(self.train_dataloader, DataLoader, self._add_sampler_metadata_collate) # wrap the sequence of train loaders to a CombinedLoader object for computing the num_training_batches self.train_dataloader = CombinedLoader(self.train_dataloader, self.data_connector.multiple_trainloader_mode) # allow accelerator to modify dataloader self.train_dataloader = self.accelerator.on_reset_train_dataloader(self.train_dataloader) self.num_training_batches = len(self.train_dataloader) if has_len(self.train_dataloader) else float("inf") if isinstance(self.limit_train_batches, int) or self.limit_train_batches == 0.0: self.num_training_batches = min(self.num_training_batches, int(self.limit_train_batches)) elif self.num_training_batches != float("inf"): self.num_training_batches = int(self.num_training_batches * self.limit_train_batches) elif self.limit_train_batches != 1.0: raise MisconfigurationException( "When using an IterableDataset for `limit_train_batches`," " `Trainer(limit_train_batches)` must be `0.0`, `1.0` or an int. An int k specifies" " `num_training_batches` to use." ) # determine when to check validation # if int passed in, val checks that often # otherwise, it checks in [0, 1.0] % range of a training epoch if isinstance(self.val_check_interval, int): self.val_check_batch = self.val_check_interval if self.val_check_batch > self.num_training_batches: raise ValueError( f"`val_check_interval` ({self.val_check_interval}) must be less than or equal " f"to the number of the training batches ({self.num_training_batches}). " "If you want to disable validation set `limit_val_batches` to 0.0 instead." ) else: if not has_len(self.train_dataloader): if self.val_check_interval == 1.0: self.val_check_batch = float("inf") else: raise MisconfigurationException( "When using an IterableDataset for `train_dataloader`," " `Trainer(val_check_interval)` must be `1.0` or an int. An int k specifies" " checking validation every k training batches." ) else: self.val_check_batch = int(self.num_training_batches * self.val_check_interval) self.val_check_batch = max(1, self.val_check_batch) if self.logger and self.num_training_batches < self.log_every_n_steps: rank_zero_warn( f"The number of training samples ({self.num_training_batches}) is smaller than the logging interval" f" Trainer(log_every_n_steps={self.log_every_n_steps}). Set a lower value for log_every_n_steps if" f" you want to see logs for the training epoch." ) def _reset_eval_dataloader( self, model: "pl.LightningModule", mode: str ) -> Tuple[List[Union[int, float]], List[DataLoader]]: """Generic method to reset a dataloader for evaluation. Args: model: The current `LightningModule` mode: Either `'val'`, `'test'` or `'predict'` Returns: Tuple (num_batches, dataloaders) """ # always get the loaders first so we can count how many there are loader_name = f"{mode}_dataloader" dataloaders = self.request_dataloader(model, mode) if not isinstance(dataloaders, list): dataloaders = [dataloaders] # when overfitting use the training loader as val and test # duplicate it the numb of times needed to match the train loaders if self.overfit_batches > 0: num_loaders = len(dataloaders) train_dataloader = self.request_dataloader(model, "train") dataloaders = [deepcopy(train_dataloader) for _ in range(num_loaders)] self.dev_debugger.track_load_dataloader_call(loader_name, dataloaders=dataloaders) for loader_i in range(len(dataloaders)): loader = dataloaders[loader_i] # shuffling in val and test set is bad practice modes = ("val", "test", "predict") if mode in modes and hasattr(loader, "sampler") and isinstance(loader.sampler, RandomSampler): # when overfitting, the dataloader should not have sampler if self.overfit_batches > 0 and mode != "predict": rank_zero_warn( "You requested to overfit but enabled val/test dataloader shuffling." " We are turning it off for you." ) dataloaders[loader_i] = self.replace_sampler(loader, SequentialSampler(loader.dataset)) else: rank_zero_warn( f"Your {mode}_dataloader has `shuffle=True`, it is best practice to turn" " this off for val/test/predict dataloaders." ) if any(dl is None for dl in dataloaders): rank_zero_warn("One of given dataloaders is None and it will be skipped.") # add samplers dataloaders = [ self.auto_add_sampler(dl, shuffle=False, mode=self.state.stage) for dl in dataloaders if dl is not None ] # add worker_init_fn for correct seeding in worker processes apply_to_collection(dataloaders, dtype=DataLoader, function=self.auto_add_worker_init_fn) # allow accelerator to modify dataloader hook_name = f"on_reset_{mode}_dataloader" dataloaders = getattr(self.accelerator, hook_name)(dataloaders) loader_num_batches = [] # determine number of batches # datasets could be none, 1 or 2+ if len(dataloaders) != 0: for i, dataloader in enumerate(dataloaders): num_batches = len(dataloader) if has_len(dataloader) else float("inf") self._worker_check(dataloader, f"{mode} dataloader {i}") # percent or num_steps limit_eval_batches = getattr(self, f"limit_{mode}_batches") # limit num batches either as a percent or num steps if isinstance(limit_eval_batches, int) or limit_eval_batches == 0.0: num_batches = min(num_batches, int(limit_eval_batches)) elif num_batches != float("inf"): num_batches = int(num_batches * limit_eval_batches) elif limit_eval_batches != 1.0: raise MisconfigurationException( "When using an IterableDataset for `limit_{mode}_batches`," f" `Trainer(limit_{mode}_batches)` must be `0.0`, `1.0` or an int. An int k specifies" f" `num_{mode}_batches` to use." ) if num_batches == 0 and limit_eval_batches > 0.0 and isinstance(limit_eval_batches, float): min_pct = 1.0 / len(dataloader) raise MisconfigurationException( f"you requested to check {limit_eval_batches} of the {mode} dataloader but" f" {limit_eval_batches}*{num_batches} < 1. Please increase the limit_{mode}_batches." f" Try at least limit_{mode}_batches={min_pct}" ) loader_num_batches.append(num_batches) return loader_num_batches, dataloaders def reset_val_dataloader(self, model: "pl.LightningModule") -> None: """Resets the validation dataloader and determines the number of batches. Args: model: The current `LightningModule` """ has_loader = is_overridden("val_dataloader", model) has_step = is_overridden("validation_step", model) if has_loader and has_step: self.num_val_batches, self.val_dataloaders = self._reset_eval_dataloader(model, "val") def reset_test_dataloader(self, model) -> None: """Resets the test dataloader and determines the number of batches. Args: model: The current `LightningModule` """ has_loader = is_overridden("test_dataloader", model) has_step = is_overridden("test_step", model) if has_loader and has_step: self.num_test_batches, self.test_dataloaders = self._reset_eval_dataloader(model, "test") def reset_predict_dataloader(self, model) -> None: """Resets the predict dataloader and determines the number of batches. Args: model: The current `LightningModule` """ has_loader = is_overridden("predict_dataloader", model) if has_loader: self.num_predict_batches, self.predict_dataloaders = self._reset_eval_dataloader(model, "predict") def reset_train_val_dataloaders(self, model) -> None: """ Resets train and val dataloaders if none are attached to the trainer. The val dataloader must be initialized before training loop starts, as the training loop inspects the val dataloader to determine whether to run the evaluation loop. """ if self.train_dataloader is None: self.reset_train_dataloader(model) if self.val_dataloaders is None: self.reset_val_dataloader(model) def request_dataloader(self, model: "pl.LightningModule", stage: str) -> Union[DataLoader, List[DataLoader]]: """Handles downloading data in the GPU or TPU case. Returns: The dataloader """ self.call_hook(f"on_{stage}_dataloader") dataloader = getattr(model, f"{stage}_dataloader")() if isinstance(dataloader, tuple): dataloader = list(dataloader) self.accelerator.barrier("get_dataloaders") return dataloader @staticmethod def _add_sampler_metadata_collate(dataloader: DataLoader) -> None: """ Wrap default collate function to retrive ``FastForwardSampler`` state dict when fault tolerant is enabled. """ dataloader.collate_fn = partial( _sampler_metadata_collate, dataset=dataloader.dataset, default_collate=dataloader.collate_fn )
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = function (Prism) { Prism.languages.applescript = { 'comment': [ // Allow one level of nesting /\(\*(?:\(\*[\s\S]*?\*\)|[\s\S])*?\*\)/, /--.+/, /#.+/], 'string': /"(?:\\.|[^"\\\r\n])*"/, 'number': /(?:\b\d+\.?\d*|\B\.\d+)(?:e-?\d+)?\b/i, 'operator': [/[&=≠≤≥*+\-\/÷^]|[<>]=?/, /\b(?:(?:start|begin|end)s? with|(?:(?:does not|doesn't) contain|contains?)|(?:is|isn't|is not) (?:in|contained by)|(?:(?:is|isn't|is not) )?(?:greater|less) than(?: or equal)?(?: to)?|(?:(?:does not|doesn't) come|comes) (?:before|after)|(?:is|isn't|is not) equal(?: to)?|(?:(?:does not|doesn't) equal|equals|equal to|isn't|is not)|(?:a )?(?:ref(?: to)?|reference to)|(?:and|or|div|mod|as|not))\b/], 'keyword': /\b(?:about|above|after|against|apart from|around|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|continue|copy|does|eighth|else|end|equal|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|my|ninth|of|on|onto|out of|over|prop|property|put|repeat|return|returning|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/, 'class': { pattern: /\b(?:alias|application|boolean|class|constant|date|file|integer|list|number|POSIX file|real|record|reference|RGB color|script|text|centimetres|centimeters|feet|inches|kilometres|kilometers|metres|meters|miles|yards|square feet|square kilometres|square kilometers|square metres|square meters|square miles|square yards|cubic centimetres|cubic centimeters|cubic feet|cubic inches|cubic metres|cubic meters|cubic yards|gallons|litres|liters|quarts|grams|kilograms|ounces|pounds|degrees Celsius|degrees Fahrenheit|degrees Kelvin)\b/, alias: 'builtin' }, 'punctuation': /[{}():,¬«»《》]/ }; };
/* * Copyright (C) 2019-2020 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * SPDX-License-Identifier: Apache-2.0 * License-Filename: LICENSE */ import {editorTests, displayTests, testUtils, prepare} from 'hereTest'; import {Map} from '@here/xyz-maps-core'; import {Editor} from '@here/xyz-maps-editor'; import dataset from './drawingmanager_dragmap_spec.json'; describe('Create new Links by drawing manager', function() { const expect = chai.expect; let editor; let display; let preparedData; let mapContainer; let link; before(async function() { preparedData = await prepare(dataset); display = new Map(document.getElementById('map'), { center: {longitude: 76.98506, latitude: 12.88776}, zoomLevel: 18, layers: preparedData.getLayers() }); editor = new Editor(display, { layers: preparedData.getLayers() }); await editorTests.waitForEditorReady(editor); mapContainer = display.getContainer(); }); after(async function() { editor.destroy(); display.destroy(); }); it('start drawing manager', async function() { await editorTests.waitForEditorReady(editor, ()=>{ editor.getDrawingBoard().start({ position: {x: 143, y: 95} }); }); expect(editor.getDrawingBoard().isActive()).to.be.true; }); it('add shape point and validate', async function() { await testUtils.events.mousemove(mapContainer, {x: 100, y: 80}, {x: 100, y: 100}); await testUtils.events.click(mapContainer, 100, 100); await testUtils.events.mousemove(mapContainer, {x: 100, y: 280}, {x: 100, y: 300}); await testUtils.events.click(mapContainer, 100, 300); expect(editor.getDrawingBoard().getLength()).to.be.equal(3); await testUtils.events.mousemove(mapContainer, {x: 100, y: 180}, {x: 150, y: 200}); await testUtils.events.click(mapContainer, 150, 200); expect(editor.getDrawingBoard().getLength()).to.be.equal(4); }); it('drag ground, validate map is dragged', async function() { await editorTests.waitForEditorReady(editor, async ()=>{ await testUtils.events.drag(mapContainer, {x: 200, y: 100}, {x: 250, y: 100}); }); expect(display.getCenter().longitude).to.not.equal(76.98506); }); it('finish drawing the link and validate its prop', async function() { await editorTests.waitForEditorReady(editor, ()=>{ link = editor.getDrawingBoard().create({featureClass: 'NAVLINK'}); }); link.prop('fc', 1); expect(link.prop('fc')).to.equal(1); }); it('revert all modifications', async function() { await editorTests.waitForEditorReady(editor, ()=>{ editor.revert(); }); expect(editor.getDrawingBoard().isActive()).to.be.false; let objs = editor.search(display.getViewBounds()); expect(objs).to.have.lengthOf(0); }); });
import React from 'react'; const buttonStyle = { width: '80px', height: '30px', }; const LogoutBtn = ({ logOut }) => { return ( <button onClick={logOut} style={buttonStyle}> 로그아웃 </button> ); }; export default LogoutBtn;
try: from setuptools import setup except ImportError: from distutils.core import setup setup( author='Simon Davy', author_email='[email protected]', classifiers=[ 'License :: OSI Approved :: Apache Software License', 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Natural Language :: English', 'Topic :: Internet :: WWW/HTTP :: WSGI', 'Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware', 'Topic :: System :: Logging', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: Implementation :: CPython', ], description='A common WSGI stack', entry_points=dict( console_scripts=[ 'talisker=talisker:run_gunicorn', 'talisker.run=talisker:run', 'talisker.gunicorn=talisker:run_gunicorn', 'talisker.gunicorn.eventlet=talisker:run_gunicorn_eventlet', 'talisker.gunicorn.gevent=talisker:run_gunicorn_gevent', 'talisker.celery=talisker:run_celery', ], ), extras_require=dict( celery=[ 'celery>=3.1.13.0,<5.0', ], dev=[ 'logging_tree>=1.7', 'pygments>=2.2', 'psutil>=5.0', 'objgraph>=3.0', ], django=[ 'django>=1.10, <2.3', ], flask=[ 'flask>=0.11,<2.0', 'blinker>=1.4,<2.0', ], pg=[ 'sqlparse', 'psycopg2', ], prometheus=[ 'prometheus-client>=0.2.0,<0.5.0' + ',!=0.4.0,!=0.4.1', ], ), include_package_data=True, install_requires=['pycryptodome==3.7.3','gunicorn>=19.7.0,<20.0', 'Werkzeug>=0.11.5,<0.15', 'statsd>=3.2.1,<4.0', 'requests>=2.10.0,<3.0', 'raven>=5.27.1,<7.0','future>=0.15.2,<0.17','ipaddress>=1.0.16,<2.0;python_version<"3.3"',], keywords=[ 'talisker', ], name='talisker', package_data=dict( talisker=[ 'logstash/*', ], ), package_dir=dict( talisker='talisker', ), packages=[ 'talisker', ], test_suite='tests', url='https://github.com/canonical-ols/talisker', version='0.9.16', zip_safe=False, )
export function requestAnimationFrame() { return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(cb) { return window.setTimeout(cb, 1000 / 60); // 每秒60帧肉眼感觉不出卡顿 }; } export function cancelAnimationFrame() { return window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.clearTimeout; }
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var React = require("react"); var react_redux_1 = require("react-redux"); var styles_1 = require("@material-ui/core/styles"); var core_1 = require("@material-ui/core"); var useStyles = styles_1.makeStyles(function (theme) { return ({ root: { width: "100%", backgroundColor: theme.palette.background.paper, }, nested: { paddingLeft: theme.spacing(4), }, inline: { display: "inline", }, list_root: { width: "100%", listStyle: "none", padding: 0, margin: 0, marginTop: 2, }, list_light: { width: "100%", backgroundColor: "transparent", "&:hover": { backgroundColor: "#E3E3E3", }, }, list_dark: { width: "100%", backgroundColor: "transparent", "&:hover": { backgroundColor: "#6B6B6B", }, }, mainList: { height: "70vh", width: "100%", overflow: "auto", }, }); }); var AccountsSideList = function (props) { var classes = useStyles(); var _a = React.useState(10), active = _a[0], setActive = _a[1]; var handleSelected = function (id) { setActive(id); switch (id) { case 0: props.dispatchEvent({ type: "CHANGEVIEW", view: "inventory_list", title: "Inventory", }); break; case 1: props.dispatchEvent({ type: "CHANGEVIEW", view: "end_of_day_records", title: "Inventory", }); break; default: break; } }; return (React.createElement("div", null, React.createElement("ul", { className: classes.list_root }, React.createElement("div", { className: props.Theme.theme === "light" ? classes.list_light : classes.list_dark }, React.createElement("li", { onClick: function () { return handleSelected(0); }, style: { padding: 6, backgroundColor: active === 0 ? props.Theme.theme === "light" ? "#F78A09" : "#212121" : "transparent", color: active === 0 ? "#fff" : "#1D1D1D", } }, React.createElement(core_1.Typography, { style: { color: props.Theme.theme === "light" ? active === 0 ? "#fff" : "#1D1D1D" : "#fff", } }, "Account Types"))), React.createElement("div", { className: props.Theme.theme === "light" ? classes.list_light : classes.list_dark }, React.createElement("li", { onClick: function () { return handleSelected(1); }, style: { padding: 6, backgroundColor: active === 1 ? props.Theme.theme === "light" ? "#F78A09" : "#212121" : "transparent", color: active === 1 ? "#fff" : "#1D1D1D", } }, React.createElement(core_1.Typography, { style: { color: props.Theme.theme === "light" ? active === 1 ? "#fff" : "#1D1D1D" : "#fff", } }, "Accounts"))), React.createElement("div", { className: props.Theme.theme === "light" ? classes.list_light : classes.list_dark }, React.createElement("li", { onClick: function () { return handleSelected(2); }, style: { padding: 6, backgroundColor: active === 2 ? props.Theme.theme === "light" ? "#F78A09" : "#212121" : "transparent", color: active === 2 ? "#fff" : "#1D1D1D", } }, React.createElement(core_1.Typography, { style: { color: props.Theme.theme === "light" ? active === 2 ? "#fff" : "#1D1D1D" : "#fff", } }, "Account Screens"))), React.createElement("div", { className: props.Theme.theme === "light" ? classes.list_light : classes.list_dark }, React.createElement("li", { onClick: function () { return handleSelected(3); }, style: { padding: 6, backgroundColor: active === 3 ? props.Theme.theme === "light" ? "#F78A09" : "#212121" : "transparent", color: active === 3 ? "#fff" : "#1D1D1D", } }, React.createElement(core_1.Typography, { style: { color: props.Theme.theme === "light" ? active === 3 ? "#fff" : "#1D1D1D" : "#fff", } }, "Transaction Types"))), React.createElement("div", { className: props.Theme.theme === "light" ? classes.list_light : classes.list_dark }, React.createElement("li", { onClick: function () { return handleSelected(4); }, style: { padding: 6, backgroundColor: active === 4 ? props.Theme.theme === "light" ? "#F78A09" : "#212121" : "transparent", color: active === 4 ? "#fff" : "#1D1D1D", } }, React.createElement(core_1.Typography, { style: { color: props.Theme.theme === "light" ? active === 4 ? "#fff" : "#1D1D1D" : "#fff", } }, "Transactions")))))); }; function mapStateToProps(state) { return { Theme: state.Theme, }; } var mapDispatchToProps = function (dispatch) { return { dispatchEvent: function (data) { return dispatch(data); }, }; }; exports.default = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(AccountsSideList); //# sourceMappingURL=LeftSide.js.map
import React from 'react'; import Presentation from '../components/Presentation'; import Profile from '../components/Profile'; import withOnboardService from '../components/withOnboardService'; function Authorship(props) { return ( <React.Fragment> <Profile {...props} /> <Presentation title="Authorship" action={props.moveForward} actionLabel="Next" cancel={props.stepBack} cancelLabel="Go Back" > <p> First and foremost, Auth0 wants to make clear to authors that their <strong>moral rights as authors </strong> will never be declined. That is, authors can rest assured that they will always have: </p> <ul> <li>the <strong>right of paternity</strong>;</li> <li>the <strong>right of integrity</strong>;</li> <li>and the right to <strong>object to false attribution</strong>;</li> </ul> to protect their work and themselves. </Presentation> </React.Fragment> ); } export default withOnboardService(Authorship);
var windows = []; /** * Resets the windows and removes * any interval that is running */ function reset() { windows.forEach( function (w) { w.contentWindow.close(); } ); windows.length = 0; } /** * Initialise and launch the windows * @see http://developer.chrome.com/trunk/apps/app.window.html */ function launch() { // reset everything reset(); // create the original window chrome.app.window.create('original.html', { id: "mainwin", bounds: { top: 128, left: 128, width: 300, height: 300 }, minHeight: 300, maxWidth: 500, minWidth: 300, frame: 'none' }, // when that is created store it // and create the copycat window function(originalWindow) { windows.push(originalWindow); chrome.app.window.create('copycat.html', { id: "copywin", bounds: { top: 128, left: 428 + 5, width: 300, height: 300 }, minHeight: 300, maxWidth: 500, minWidth: 300, frame: 'none' }, function(copycatWindow) { // store the copycat windows.push(copycatWindow); // now have the copycat watch the // original window for changes originalWindow.onClosed.addListener(reset); copycatWindow.onClosed.addListener(reset); originalWindow.onBoundsChanged.addListener(function() { var bounds = originalWindow.getBounds(); bounds.left = bounds.left + bounds.width + 5; copycatWindow.setBounds(bounds); }); copycatWindow.onRestored.addListener(function() { console.log('copy restored'); if (originalWindow.isMinimized()) originalWindow.restore(); }) originalWindow.onRestored.addListener(function() { console.log('copy restored'); if (copycatWindow.isMinimized()) copycatWindow.restore(); }) originalWindow.focus(); }); }); } /** * Minimises both the original and copycat windows * @see http://developer.chrome.com/trunk/apps/app.window.html */ function minimizeAll() { windows.forEach( function (w) { w.minimize(); }); } // @see http://developer.chrome.com/trunk/apps/app.runtime.html chrome.app.runtime.onLaunched.addListener(launch);
import { isBigNumber, isCollection, isNumber } from '../../utils/is' import { factory } from '../../utils/factory' import { errorTransform } from './utils/errorTransform' import { createSum } from '../../function/statistics/sum' /** * Attach a transform function to math.sum * Adds a property transform containing the transform function. * * This transform changed the last `dim` parameter of function sum * from one-based to zero based */ const name = 'sum' const dependencies = ['typed', 'config', 'add', '?bignumber', '?fraction'] export const createSumTransform = /* #__PURE__ */ factory(name, dependencies, ({ typed, config, add, bignumber, fraction }) => { const sum = createSum({ typed, config, add, bignumber, fraction }) return typed(name, { '...any': function (args) { // change last argument dim from one-based to zero-based if (args.length === 2 && isCollection(args[0])) { const dim = args[1] if (isNumber(dim)) { args[1] = dim - 1 } else if (isBigNumber(dim)) { args[1] = dim.minus(1) } } try { return sum.apply(null, args) } catch (err) { throw errorTransform(err) } } }) }, { isTransformFunction: true })
var dispatcher = require("../dispatcher"); var schoolService = require("../services/schoolService"); function SchoolStore() { var listeners = []; function onChange(listener) { getSchools(listener); listeners.push(listener); } function getSchools(cb){ schoolService.getSchools().then(function (res) { cb(res); }); } function addSchool(school) { schoolService.addSchool(school).then(function (res) { console.log(res); triggerListeners(); }); } function deleteSchool(school) { schoolService.deleteSchool(school).then(function (res) { console.log(res); triggerListeners(); }); } function triggerListeners() { getSchools(function (res) { listeners.forEach(function (listener) { listener(res); }); }); } dispatcher.register(function (payload) { var split = payload.type.split(":"); if (split[0] === "school") { switch (split[1]) { case "addSchool": addSchool(payload.school); break; case "deleteSchool": deleteSchool(payload.school); break; } } }); return { onChange: onChange } } module.exports = SchoolStore();
const checkAuth = (req, res, next) => { console.log(req.isAuthenticated()); if(req.isAuthenticated()){ console.log('Autenticado'); next(); } else{ console.log('Sin autenticar') } } const isAdmin = (req, res, next) => { console.log('ROLE', req.user.role); req.user.role === 'admin' ? next() : res.send({ msg: 'You are not admin'}); } const isClient = (req, res, next) => { console.log('ROLE', req.user.role); req.user.role === 'client' ? next() : res.send({ msg: 'You are not client'}); } module.exports = { checkAuth, isAdmin, isClient };
/* eslint react/no-string-refs:0 */ import React, { Component } from 'react'; import IceContainer from '@icedesign/container'; import { Input, Button, Select, DatePicker, Radio, Message } from '@alifd/next'; import { FormBinderWrapper as IceFormBinderWrapper, FormBinder as IceFormBinder, FormError as IceFormError, } from '@icedesign/form-binder'; const { Option } = Select; const { Group: RadioGroup } = Radio; export default class DonationForm extends Component { static displayName = 'DonationForm'; static propTypes = {}; static defaultProps = {}; constructor(props) { super(props); this.state = { value: { status: 'pending', }, }; } formChange = (value) => { console.log('value', value); this.setState({ value, }); }; validateAllFormField = () => { this.refs.form.validateAll((errors, values) => { if (errors) { console.log({ errors }); Message.error('提交失败'); return; } console.log({ values }); Message.success('提交成功'); }); }; render() { return ( <IceContainer style={styles.container}> <IceFormBinderWrapper value={this.state.value} onChange={this.formChange} ref="form" > <div style={styles.formContent}> <div style={styles.formItem}> <div style={styles.formLabel}>案件名称</div> <IceFormBinder required triggerType="onBlur" message="案件名称不能为空" name="casename" > <Input placeholder="请输入案件名称" style={{ width: '400px' }} /> </IceFormBinder> <div style={styles.formError}> <IceFormError name="casename" /> </div> </div> <div style={styles.formItem}> <div style={styles.formLabel}>案件编号</div> <IceFormBinder required triggerType="onBlur" message="案件编号不能为空" name="id" > <Input placeholder="图书背面右下角条纹码处" style={{ width: '400px' }} /> </IceFormBinder> <div style={styles.formError}> <IceFormError name="id" /> </div> </div> <div style={styles.formItem}> <div style={styles.formLabel}>案件类别</div> <IceFormBinder name="cate"> <Select placeholder="请选择" mode="multiple" style={{ width: '400px' }} > <Option value="1">知识产权</Option> <Option value="2">劳动纠纷</Option> <Option value="3">交通事故</Option> <Option value="other">其他</Option> </Select> </IceFormBinder> </div> <div style={styles.formItem}> <div style={styles.formLabel}>立案人</div> <IceFormBinder required triggerType="onBlur" message="立案人不能为空" name="donator" > <Input placeholder="请输入" style={{ width: '400px' }} /> </IceFormBinder> <div style={styles.formError}> <IceFormError name="donator" /> </div> </div> <div style={styles.formItem}> <div style={styles.formLabel}>立案时间</div> <IceFormBinder name="time"> <DatePicker style={{ width: '400px' }} /> </IceFormBinder> </div> <div style={styles.formItem}> <div style={styles.formLabel}>状态</div> <IceFormBinder name="status"> <RadioGroup dataSource={[ { value: 'on', label: '立即立案', }, { value: 'delay', label: '延迟立案', }, ]} /> </IceFormBinder> </div> <Button type="primary" style={styles.submitButton} onClick={this.validateAllFormField} > 提 交 </Button> </div> </IceFormBinderWrapper> </IceContainer> ); } } const styles = { formContent: { marginLeft: '30px', }, formItem: { marginBottom: '25px', display: 'flex', alignItems: 'center', }, formLabel: { width: '70px', marginRight: '15px', textAlign: 'right', }, formError: { marginLeft: '10px', }, submitButton: { marginLeft: '85px', }, };
import React from "react" import { useStaticQuery, graphql } from "gatsby" import Img from "gatsby-image" /* * This component is built using `gatsby-image` to automatically serve optimized * images with lazy loading and reduced file sizes. The image is loaded using a * `useStaticQuery`, which allows us to load the image from directly within this * component, rather than having to pass the image data down from pages. * * For more information, see the docs: * - `gatsby-image`: https://gatsby.dev/gatsby-image * - `useStaticQuery`: https://www.gatsbyjs.org/docs/use-static-query/ */ const TetonBuffalo = () => { const data = useStaticQuery(graphql` query { placeholderImage: file(relativePath: { eq: "teton-buffalo.jpg" }) { childImageSharp { fluid(maxWidth: 900) { ...GatsbyImageSharpFluid } } } } `) return <Img fluid={data.placeholderImage.childImageSharp.fluid} /> } export default TetonBuffalo
define(['module', 'require', 'external'], function (module, require, external) { 'use strict'; function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } function _interopNamespace(e) { if (e && e.__esModule) { return e; } else { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n['default'] = e; return Object.freeze(n); } } var external__default = /*#__PURE__*/_interopDefaultLegacy(external); console.log(external__default['default']); const _interopDefault$1 = 1; const _interopNamespace$1 = 1; const module$1 = 1; const require$1 = 1; const exports$1 = 1; const document$1 = 1; const URL$1 = 1; console.log(_interopDefault$1, _interopNamespace$1, module$1, require$1, exports$1, document$1, URL$1); new Promise(function (resolve, reject) { require(['external'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject) }).then(console.log); exports.default = 0; console.log(new URL(module.uri, document.baseURI).href); function nested1() { const _interopDefault = 1; const _interopNamespace$1 = 1; const module$1 = 1; const require$1 = 1; const exports$1 = 1; const document$1 = 1; const URL$1 = 1; console.log(_interopDefault, _interopNamespace$1, module$1, require$1, exports$1, document$1, URL$1); new Promise(function (resolve, reject) { require(['external'], function (m) { resolve(/*#__PURE__*/_interopNamespace(m)); }, reject) }).then(console.log); exports.default = 1; console.log(new URL(module.uri, document.baseURI).href); } nested1(); function nested2() { const _interopDefault = 1; const _interopNamespace = 1; const module = 1; const require = 1; const exports = 1; const document = 1; const URL = 1; console.log(_interopDefault, _interopNamespace, module, require, exports, document, URL); } nested2(); return exports.default; });
let porcionesNecesitadasFresas let porcionesNecesitadasTres let porcionesNecesitadasTorta let disponiblePastelFresas = 5 let disponiblePastelTres = 8 let disponiblePastelTorta = 2 let precioPastelFresas = 16 let precioPastelTres = 12 let precioPastelTorta = 18 let eleccion let seguirComprando while (eleccion != "salir") { eleccion = prompt(("Elige que tipo de pastel quieres 1. Fresas con crema 2. Tres Leches 3. Torta chilena, escribe el numero de tu eleccion, o escribe salir si ya no quieres continuar.")) if(eleccion == "1"){ alert("Has elegido Fresas con crema, Hay " + disponiblePastelFresas + " porciones disponibles, cada porcion cuesta Q." + precioPastelFresas + ".00 escribe salir si ya no quieres continuar") pregunta = prompt("Quieres comprar alguna porcion, escribe si o no") if(pregunta == "si"){ porcionesNecesitadasFresas = parseInt(prompt("Cuantas porciones quieres, escribe salir si ya no quieres continuar")) } if(porcionesNecesitadasFresas > disponiblePastelFresas){ alert("No tenemos tantas porciones disponibles, escriber salir si ya no quieres continuar") }else{ alert("Has comprado " + porcionesNecesitadasFresas + " porcion/es de pastel de Fresas con crema") } seguirComprando = prompt("quieres seguir comprando, si o salir") } if(eleccion == "2"){ alert("Has elegido Tres Leches, Hay " + disponiblePastelTres + " porciones disponibles, cada porcion cuesta Q." + precioPastelTres + ".00 escribe salir si ya no quieres continuar") pregunta = prompt("Quieres comprar alguna porcion, escribe si o no") if(pregunta == "si"){ porcionesNecesitadasTres = parseInt(prompt("Cuantas porciones quieres, escribe salir si ya no quieres continuar")) } if(porcionesNecesitadasTres > disponiblePastelTres){ alert("No tenemos tantas porciones disponibles, escriber salir si ya no quieres continuar") }else{ alert("Has comprado " + porcionesNecesitadasTres + " porcion/es de pastel de Tres Leches") } seguirComprando = prompt("quieres seguir comprando, si o salir") } if(eleccion == "3"){ alert("Has elegido Torta chilena, Hay " + disponiblePastelTorta + " porciones disponibles, cada porcion cuesta Q." + precioPastelTorta + ".00 escribe salir si ya no quieres continuar") pregunta = prompt("Quieres comprar alguna porcion, escribe si o no") if(pregunta == "si"){ porcionesNecesitadasTorta = parseInt(prompt("Cuantas porciones quieres, escribet salir si ya no quieres continuar")) } if(porcionesNecesitadasTorta > disponiblePastelTorta){ alert("No tenemos tantas porciones disponibles, escriber salir si ya no quieres continuar") }else{ alert("Has comprado " + porcionesNecesitadasTorta + " porcion/es de pastel de Torta chilena") } seguirComprando = prompt("quieres seguir comprando, si o salir") } } alert("Cantidad de porciones compradas " + (porcionesNecesitadasFresas+porcionesNecesitadasTres+porcionesNecesitadasTorta)+" Total a pagar Q."+((precioPastelFresas*porcionesNecesitadasFresas)+(precioPastelTres*porcionesNecesitadasTres)+(precioPastelTorta*porcionesNecesitadasTorta)+".00"))
var express = require('express'); var router = express.Router(); var models = require('../models'); var expressValidator = require('express-validator'); const Op = models.sequelize.Op; router.use(expressValidator()); /* POST search page '/' is NOT Home page */ router.post('/', function(req, res, next) { if (req.body.city < 0) { req.checkBody('city', 'Error: You entered a negative number').isInt({min: 0}); } req.checkBody('city', 'Search string too long').isLength({max: 40}) .notEmpty(req.body.city).withMessage('Search field empty. Please enter an address, zip code, city, or state') req.sanitize('city') .blacklist('!@#$%^*;+'); var errors = req.validationErrors(); console.log("Errors object: " + errors); if (errors) { res.cookie('errors', errors[0]); res.redirect('search'); res.send(errors); } else { // var queryBuilderArguments = {searchString : req.body.city}; // if(req.body.sortOption) { // queryBuilderArguments.orderMode = req.body.sortOption; // } models.Listing.findAll(buildListingsQuery(req)).then(function(listings) { res.render('search', { // render the Search/Browse page title: 'Search', listings: listings, previousSearchString: req.body.city, previousSortOption: req.body.sortOption, bedFilterOption: req.body.bedFilterOption ? req.body.bedFilterOption : 0, bathFilterOption: req.body.bathFilterOption ? req.body.bathFilterOption : 0, UserState: req.cookies.UserState, User: req.cookies.User, errors: req.cookies.errors }); // START HOW TO GET AND USE ASSOCIATED MODELS console.log(models.Listing.prototype); listings.forEach(function(listing) { console.log("listing.address: " + listing.address); listing.getMedia().then(function(media){ media.forEach(function(medium) { console.log("medium.id: " + medium.id + ", medium.imageFilePath: " + medium.imageFilePath); }); }); }); // END HOW TO GET AND USE ASSOCIATED MODELS }); } }); router.get('/', function(req, res, next) { //res.sendFile(path.join(__dirname + '/index.html')); models.Listing.findAll() .then(function(listings) { res.render('search', { // render the Search/Browse page title: 'Search', listings: listings, previousSearchString: req.body.city, previousSortOption: req.body.sortOption, bedFilterOption: req.body.bedFilterOption ? req.body.bedFilterOption : 0, bathFilterOption: req.body.bathFilterOption ? req.body.bathFilterOption : 0, UserState: req.cookies.UserState, User: req.body.User, errors: req.cookies.errors }); }); res.cookie('errors', ''); }); module.exports = router; function buildListingsQuery(req) { var sequelizeQuery = { include: [ models.Media ] // !! This line requests retrieval of the associated model. }; if (! req.body.city){ req.body.city = ""; } sequelizeQuery.where = { [Op.or]: [ { address: { [Op.like]: '%' + req.body.city + '%' } }, { city: { [Op.like]: '%' + req.body.city + '%' } }, { state: { [Op.like]: '%' + req.body.city + '%' } }, { zipcode: { [Op.like]: '%' + req.body.city + '%' } } ], [Op.and]: [ { numBedrooms: { [Op.gte]: req.body.bedFilterOption ? req.body.bedFilterOption : 0 } }, { numBathrooms: { [Op.gte]: req.body.bathFilterOption ? req.body.bathFilterOption : 0 } } ] }; if (req.body.sortOption){ sequelizeQuery.order = models.sequelize.literal(req.body.sortOption); } return sequelizeQuery; }
export default "M13 13H11V7H13M13 17H11V15H13M18 4V20H6V8.8L10.8 4H18M18 2H10L4 8V20C4 21.1 4.9 22 6 22H18C19.1 22 20 21.1 20 20V4C20 2.9 19.1 2 18 2Z"
import { InterpolateDiscrete } from '../../constants'; import { KeyframeTrackPrototype } from '../KeyframeTrackPrototype'; import { KeyframeTrackConstructor } from '../KeyframeTrackConstructor'; /** * * A Track of Boolean keyframe values. * * * @author Ben Houston / http://clara.io/ * @author David Sarno / http://lighthaus.us/ * @author tschw */ function BooleanKeyframeTrack ( name, times, values ) { this.isBooleanKeyframeTrack = true; KeyframeTrackConstructor.call( this, name, times, values ); }; BooleanKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrackPrototype ), { constructor: BooleanKeyframeTrack, ValueTypeName: 'bool', ValueBufferType: Array, DefaultInterpolation: InterpolateDiscrete, InterpolantFactoryMethodLinear: undefined, InterpolantFactoryMethodSmooth: undefined // Note: Actually this track could have a optimized / compressed // representation of a single value and a custom interpolant that // computes "firstValue ^ isOdd( index )". } ); export { BooleanKeyframeTrack };
import GTM from '../../../common/gtm'; import { translate, translateLangToLang } from '../../../common/i18n'; import { getLanguage } from '../../../common/lang'; import { save } from './utils'; /* eslint-disable */ Blockly.WorkspaceAudio.prototype.preload = function() {}; Blockly.FieldDropdown.prototype.render_ = function() { if (!this.visible_) { this.size_.width = 0; return; } if (this.sourceBlock_ && this.arrow_) { // Update arrow's colour. this.arrow_.style.fill = this.sourceBlock_.getColour(); } goog.dom.removeChildren(this.textElement_); goog.dom.removeNode(this.imageElement_); this.imageElement_ = null; if (this.imageJson_) { this.renderSelectedImage_(); } else { this.renderSelectedText_(); } this.borderRect_.setAttribute('height', this.size_.height - 8); this.borderRect_.setAttribute('width', this.size_.width + Blockly.BlockSvg.SEP_SPACE_X); }; Blockly.FieldDropdown.prototype.renderSelectedText_ = function() { // Text option is selected. // Replace the text. const textNode = document.createTextNode(this.getDisplayText_()); this.textElement_.appendChild(textNode); // Insert dropdown arrow. if (this.sourceBlock_.RTL) { this.textElement_.insertBefore(this.arrow_, this.textElement_.firstChild); } else { this.textElement_.appendChild(this.arrow_); } this.textElement_.setAttribute('text-anchor', 'start'); this.textElement_.setAttribute('x', 0); this.size_.height = 30; this.size_.width = Blockly.Field.getCachedWidth(this.textElement_); }; Blockly.BlockSvg.SEP_SPACE_X = 20; Blockly.Field.prototype.init = function() { if (this.fieldGroup_) { // Field has already been initialized once. return; } // Build the DOM. this.fieldGroup_ = Blockly.utils.createSvgElement('g', {}, null); if (!this.visible_) { this.fieldGroup_.style.display = 'none'; } this.borderRect_ = Blockly.utils.createSvgElement( 'rect', { rx: 4, ry: 4, x: -Blockly.BlockSvg.SEP_SPACE_X / 2, y: 0, height: 16, }, this.fieldGroup_ ); this.textElement_ = Blockly.utils.createSvgElement( 'text', { class: 'blocklyText', y: this.size_.height - 10 }, this.fieldGroup_ ); this.updateEditable(); this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_); this.mouseDownWrapper_ = Blockly.bindEventWithChecks_(this.fieldGroup_, 'mousedown', this, this.onMouseDown_); // Force a render. this.render_(); }; Blockly.FieldLabel.prototype.init = function() { if (this.textElement_) { // Text has already been initialized once. return; } // Build the DOM. this.textElement_ = Blockly.utils.createSvgElement( 'text', { class: 'blocklyText', y: this.size_.height - 2 }, null ); if (this.class_) { Blockly.utils.addClass(this.textElement_, this.class_); } if (!this.visible_) { this.textElement_.style.display = 'none'; } this.sourceBlock_.getSvgRoot().appendChild(this.textElement_); // Configure the field to be transparent with respect to tooltips. this.textElement_.tooltip = this.sourceBlock_; Blockly.Tooltip.bindMouseEvents(this.textElement_); // Force a render. this.render_(); }; Blockly.BlockSvg.prototype.renderCompute_ = function(iconWidth) { const inputList = this.inputList; const inputRows = []; inputRows.rightEdge = iconWidth + Blockly.BlockSvg.SEP_SPACE_X * 2; if (this.previousConnection || this.nextConnection) { inputRows.rightEdge = Math.max( inputRows.rightEdge, Blockly.BlockSvg.NOTCH_WIDTH + Blockly.BlockSvg.SEP_SPACE_X ); } let fieldValueWidth = 0; // Width of longest external value field. let fieldStatementWidth = 0; // Width of longest statement field. let hasValue = false; let hasStatement = false; let hasDummy = false; let lastType; const isInline = this.getInputsInline() && !this.isCollapsed(); for (var i = 0, input; (input = inputList[i]); i++) { if (!input.isVisible()) { continue; } var row; if (!isInline || !lastType || lastType == Blockly.NEXT_STATEMENT || input.type == Blockly.NEXT_STATEMENT) { // Create new row. lastType = input.type; row = []; if (isInline && input.type != Blockly.NEXT_STATEMENT) { row.type = Blockly.BlockSvg.INLINE; } else { row.type = input.type; } row.height = 0; inputRows.push(row); } else { row = inputRows[inputRows.length - 1]; } row.push(input); // Compute minimum input size. input.renderHeight = Blockly.BlockSvg.MIN_BLOCK_Y; // The width is currently only needed for inline value inputs. if (isInline && input.type == Blockly.INPUT_VALUE) { input.renderWidth = Blockly.BlockSvg.TAB_WIDTH + Blockly.BlockSvg.SEP_SPACE_X * 1.25; } else { input.renderWidth = 0; } // Expand input size if there is a connection. if (input.connection && input.connection.isConnected()) { const linkedBlock = input.connection.targetBlock(); const bBox = linkedBlock.getHeightWidth(); input.renderHeight = Math.max(input.renderHeight, bBox.height); input.renderWidth = Math.max(input.renderWidth, bBox.width); } // Blocks have a one pixel shadow that should sometimes overhang. if (!isInline && i == inputList.length - 1) { // Last value input should overhang. input.renderHeight--; } else if ( !isInline && input.type == Blockly.INPUT_VALUE && inputList[i + 1] && inputList[i + 1].type == Blockly.NEXT_STATEMENT ) { // Value input above statement input should overhang. input.renderHeight--; } row.height = Math.max(row.height, input.renderHeight); input.fieldWidth = 0; if (inputRows.length == 1) { // The first row gets shifted to accommodate any icons. input.fieldWidth += this.RTL ? -iconWidth : iconWidth; } let previousFieldEditable = false; for (var j = 0, field; (field = input.fieldRow[j]); j++) { if (j != 0) { input.fieldWidth += Blockly.BlockSvg.SEP_SPACE_X; } // Get the dimensions of the field. const fieldSize = field.getSize(); field.renderWidth = fieldSize.width; field.renderSep = previousFieldEditable && field.EDITABLE ? Blockly.BlockSvg.SEP_SPACE_X : 0; input.fieldWidth += field.renderWidth + field.renderSep; row.height = Math.max(row.height, fieldSize.height) + 1; previousFieldEditable = field.EDITABLE; } if (row.type != Blockly.BlockSvg.INLINE) { if (row.type == Blockly.NEXT_STATEMENT) { hasStatement = true; fieldStatementWidth = Math.max(fieldStatementWidth, input.fieldWidth); } else { if (row.type == Blockly.INPUT_VALUE) { hasValue = true; } else if (row.type == Blockly.DUMMY_INPUT) { hasDummy = true; } fieldValueWidth = Math.max(fieldValueWidth, input.fieldWidth); } } } // Make inline rows a bit thicker in order to enclose the values. for (var y = 0, row; (row = inputRows[y]); y++) { row.thicker = false; if (row.type == Blockly.BlockSvg.INLINE) { for (var z = 0, input; (input = row[z]); z++) { if (input.type == Blockly.INPUT_VALUE) { row.height += 2 * Blockly.BlockSvg.INLINE_PADDING_Y; row.thicker = true; break; } } } } // Compute the statement edge. // This is the width of a block where statements are nested. inputRows.statementEdge = 2 * Blockly.BlockSvg.SEP_SPACE_X + fieldStatementWidth; // Compute the preferred right edge. Inline blocks may extend beyond. // This is the width of the block where external inputs connect. if (hasStatement) { inputRows.rightEdge = Math.max(inputRows.rightEdge, inputRows.statementEdge + Blockly.BlockSvg.NOTCH_WIDTH); } if (hasValue) { inputRows.rightEdge = Math.max( inputRows.rightEdge, fieldValueWidth + Blockly.BlockSvg.SEP_SPACE_X * 2 + Blockly.BlockSvg.TAB_WIDTH ); } else if (hasDummy) { inputRows.rightEdge = Math.max(inputRows.rightEdge, fieldValueWidth + Blockly.BlockSvg.SEP_SPACE_X * 2); } inputRows.hasValue = hasValue; inputRows.hasStatement = hasStatement; inputRows.hasDummy = hasDummy; return inputRows; }; Blockly.FieldLabel.prototype.init = function() { if (this.textElement_) { // Text has already been initialized once. return; } // Build the DOM. this.textElement_ = Blockly.utils.createSvgElement( 'text', { class: 'blocklyText', y: this.size_.height - 3 }, null ); if (this.class_) { Blockly.utils.addClass(this.textElement_, this.class_); } if (!this.visible_) { this.textElement_.style.display = 'none'; } this.sourceBlock_.getSvgRoot().appendChild(this.textElement_); // Configure the field to be transparent with respect to tooltips. this.textElement_.tooltip = this.sourceBlock_; Blockly.Tooltip.bindMouseEvents(this.textElement_); // Force a render. this.render_(); }; // Override inline editor blockly Blockly.FieldTextInput.prototype.showInlineEditor_ = function(quietInput) { Blockly.WidgetDiv.show(this, this.sourceBlock_.RTL, this.widgetDispose_()); var div = Blockly.WidgetDiv.DIV; // Create the input. var htmlInput = document.createElement('input'); htmlInput.className = 'blocklyHtmlInput'; htmlInput.setAttribute('spellcheck', this.spellcheck_); htmlInput.setAttribute('data-lpignore', 'true'); var fontSize = Blockly.FieldTextInput.FONTSIZE * this.workspace_.scale + 'pt'; div.style.fontSize = fontSize; htmlInput.style.fontSize = fontSize; Blockly.FieldTextInput.htmlInput_ = htmlInput; div.appendChild(htmlInput); htmlInput.value = htmlInput.defaultValue = this.text_; htmlInput.oldValue_ = null; this.validate_(); this.resizeEditor_(); if (!quietInput) { htmlInput.focus(); htmlInput.select(); } this.bindEvents_(htmlInput); }; const originalContextMenuFn = (e, menuOption, rlt) => { return; }; //const originalContextMenuFn = Blockly.ContextMenu.show; Blockly.ContextMenu.show = (e, menuOptions, rtl) => { // Rename 'Clean up blocks' menuOptions.some(option => { if (option.text === Blockly.Msg.CLEAN_UP) { option.text = translate('Rearrange vertically'); // eslint-disable-line no-param-reassign return true; } return false; }) && /* Remove delete all blocks, but only when 'Clean up blocks' is available (i.e. workspace) * This allows users to still delete root blocks containing blocks */ menuOptions.some((option, i) => { if ( option.text === Blockly.Msg.DELETE_BLOCK || option.text.replace(/[0-9]+/, '%1') === Blockly.Msg.DELETE_X_BLOCKS ) { menuOptions.splice(i, 1); return true; } return false; }); // Open the Elev.io widget when clicking 'Help' // eslint-disable-next-line no-underscore-dangle if (window._elev) { menuOptions.some(option => { if (option.text === Blockly.Msg.HELP) { option.callback = () => window._elev.open(); // eslint-disable-line no-param-reassign, no-underscore-dangle return true; } return false; }); } originalContextMenuFn(e, menuOptions, rtl); }; Blockly.Input.prototype.attachShadowBlock = function(value, name, shadowBlockType) { const shadowBlock = this.sourceBlock_.workspace.newBlock(shadowBlockType); shadowBlock.setShadow(true); shadowBlock.setFieldValue(value, name); // Refactor when using shadow block for strings in future shadowBlock.outputConnection.connect(this.connection); shadowBlock.initSvg(); shadowBlock.render(); }; /** * Expand or collapse the node on mouse click. * @param {!goog.events.BrowserEvent} _e The browser event. * @override */ Blockly.Toolbox.TreeNode.prototype.onClick_ = function(_e) { // eslint-disable-next-line no-underscore-dangle const blocklyCategoryName = translateLangToLang(_e.target.innerText, getLanguage(), 'en'); GTM.pushDataLayer({ event: 'Click Block Category', blocklyCategoryName }); // Expand icon. if (this.hasChildren() && this.isUserCollapsible_) { this.toggle(); this.select(); } else if (this.isSelected()) { this.getTree().setSelectedItem(null); } else { this.select(); } this.updateRow(); }; /** * Preload all the audio files so that they play quickly when asked for. * @package */ Blockly.WorkspaceAudio.prototype.preload = function() { for (var name in this.SOUNDS_) { var sound = this.SOUNDS_[name]; sound.volume = 0.01; sound.play().catch(function() {}); sound.pause(); // iOS can only process one sound at a time. Trying to load more than one // corrupts the earlier ones. Just load one and leave the others uncached. if (goog.userAgent.IPAD || goog.userAgent.IPHONE) { break; } } }; // https://groups.google.com/forum/#!msg/blockly/eS1V49pI9c8/VEh5UuUcBAAJ const addDownloadOption = (callback, options, block) => { options.push({ text: translate('Download'), enabled: true, callback: () => { const xml = Blockly.Xml.textToDom('<xml xmlns="http://www.w3.org/1999/xhtml" collection="false"></xml>'); xml.appendChild(Blockly.Xml.blockToDom(block)); save('binary-bot-block', true, xml); }, }); callback(options); }; const originalCustomContextVarFn = Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN.customContextMenu; Blockly.Constants.Variables.CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN.customContextMenu = function(options) { addDownloadOption(originalCustomContextVarFn.bind(this), options, this); }; const originalCustomContextLoopFn = Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN.customContextMenu; Blockly.Constants.Loops.CUSTOM_CONTEXT_MENU_CREATE_VARIABLES_GET_MIXIN.customContextMenu = function(options) { addDownloadOption(originalCustomContextLoopFn.bind(this), options, this); }; /** * Return the parent block or null if this block is at the top level. * @return {Blockly.Block} The block that holds the current block. */ Blockly.Block.prototype.getRootInputTargetBlock = function() { let inputName; let currentBlock = this.getParent(); while (currentBlock) { const rootBlock = this.getRootBlock(); const currentInput = rootBlock.getInputWithBlock(currentBlock); if (currentInput && currentInput.name) { inputName = currentInput.name; } currentBlock = currentBlock.getParent(); } return inputName; };
import os from pathlib import Path from jina import Flow from jina.parsers.helloworld import set_hw_parser if __name__ == '__main__': from helper import ( print_result, write_html, download_data, index_generator, query_generator, ) from my_executors import MyEncoder, MyIndexer, MyEvaluator else: from .helper import ( print_result, write_html, download_data, index_generator, query_generator, ) from .my_executors import MyEncoder, MyIndexer, MyEvaluator cur_dir = os.path.dirname(os.path.abspath(__file__)) def hello_world(args): """ Runs Jina's Hello World. Usage: Use it via CLI :command:`jina hello-world`. Description: It downloads Fashion-MNIST dataset and :term:`Indexer<indexes>` 50,000 images. The index is stored into 4 *shards*. It randomly samples 128 unseen images as :term:`Queries<Searching>` Results are shown in a webpage. More options can be found in :command:`jina hello-world --help` :param args: Argparse object """ Path(args.workdir).mkdir(parents=True, exist_ok=True) targets = { 'index-labels': { 'url': args.index_labels_url, 'filename': os.path.join(args.workdir, 'index-labels'), }, 'query-labels': { 'url': args.query_labels_url, 'filename': os.path.join(args.workdir, 'query-labels'), }, 'index': { 'url': args.index_data_url, 'filename': os.path.join(args.workdir, 'index-original'), }, 'query': { 'url': args.query_data_url, 'filename': os.path.join(args.workdir, 'query-original'), }, } # download the data download_data(targets, args.download_proxy) # reduce the network load by using `fp16`, or even `uint8` os.environ['JINA_ARRAY_QUANT'] = 'fp16' os.environ['HW_WORKDIR'] = args.workdir # now comes the real work # load index flow from a YAML file f = Flow().add(uses=MyEncoder, parallel=2).add(uses=MyIndexer).add(uses=MyEvaluator) # run it! with f: f.index( index_generator(num_docs=targets['index']['data'].shape[0], target=targets), request_size=args.request_size, ) # f.search( # query_generator( # num_docs=args.num_query, target=targets, with_groundtruth=True # ), # shuffle=True, # on_done=print_result, # request_size=args.request_size, # parameters={'top_k': args.top_k}, # ) f.post( '/eval', query_generator( num_docs=args.num_query, target=targets, with_groundtruth=True ), shuffle=True, on_done=print_result, request_size=args.request_size, parameters={'top_k': args.top_k}, ) # write result to html write_html(os.path.join(args.workdir, 'demo.html')) if __name__ == '__main__': args = set_hw_parser().parse_args() hello_world(args)
from functools import wraps from inspect import iscoroutinefunction from typing import Any from typing import Callable from typing import List from starlette.requests import Request from sso_auth.config import SSOAuthConfig from sso_auth.exceptions import SSOPermissionDenied from sso_auth.exceptions import SSOUnathorized from sso_auth.users import SSOUser from sso_auth.utils import is_ignored_path async def execute_view(func: Callable, request: Request, *args, **kwargs) -> Any: if iscoroutinefunction(func): return await func(request, *args, **kwargs) return func(request, *args, **kwargs) # TODO удалить def check_sso_groups(groups: List[str]) -> Callable: """Проверяет права на уровне групп пользователя.""" def decorator(func: Callable) -> Callable: @wraps(func) async def wrapper(request: Request, *args, **kwargs): # noqa: ANN201 if not SSOAuthConfig.sso_auth_validation_enabled: return await execute_view(func, request, *args, **kwargs) if is_ignored_path(request.url.path): return await execute_view(func, request, *args, **kwargs) sso_user: SSOUser = request.user if not sso_user: raise SSOUnathorized is_access_granted = sso_user.has_common_groups(groups) if not is_access_granted: raise SSOPermissionDenied return await execute_view(func, request, *args, **kwargs) return wrapper return decorator # TODO удалить def check_sso_permissions(permissions: List[str]) -> Callable: """Проверяет права на уровне пермишенов юзера.""" def decorator(func: Callable) -> Callable: @wraps(func) async def wrapper(request: Request, *args, **kwargs): # noqa: ANN201 if not SSOAuthConfig.sso_auth_validation_enabled: return await execute_view(func, request, *args, **kwargs) if is_ignored_path(request.url.path): return await execute_view(func, request, *args, **kwargs) sso_user: SSOUser = request.user if not sso_user: raise SSOUnathorized is_access_granted = sso_user.has_common_permissions(permissions) if not is_access_granted: raise SSOPermissionDenied return await execute_view(func, request, *args, **kwargs) return wrapper return decorator